Documentation
¶
Overview ¶
Package compactionkernel makes compaction survival a checkable property. A kernel is the smallest pinned statement of what governs a session: the tree revision, the governing authority files with their blob hashes, and an optional bounded list of requirement ids with their pinned spec blob hashes. It is rendered into a fenced envelope a host hook injects, and verified again out of whatever text survived compaction.
Claude Code's PreCompact hook should call `corvint kernel` and carry the rendered block into the compacted transcript; the following SessionStart(compact) hook should pipe that transcript into `corvint kernel verify`. A host that emits no compaction signal degrades to the session-start injection alone; nothing here depends on a host-specific compaction API.
Index ¶
Constants ¶
const ( // Profile names this kernel's wire shape. Profile = "corvint-compaction-kernel/0" // MaxKernelBytes bounds the canonical JSON document, envelope excluded. The // kernel must stay small enough that no compaction budget can justify // dropping it (CKN-V0-002). MaxKernelBytes = 600 )
Variables ¶
This section is empty.
Functions ¶
func InjectionBlock ¶
func InjectionBlock(index *contextindex.Index, governance []Entry) (string, error)
InjectionBlock is the orchestrator's entry point: the exact block the session-start and user-prompt adapter paths inject, with no requirement list.
Types ¶
type Entry ¶
Entry is one row of the harness governance array, in the shape the user-prompt packet already produces.
func GovernanceFromPacket ¶
GovernanceFromPacket converts the `governance` member of a harness packet into kernel entries, so no caller re-implements the authority selection the prompt compiler already made.
type Kernel ¶
type Kernel struct {
Authorities []Authority
Digest string
Omitted int
Requirements []Requirement
Revision string
}
Kernel is the compaction-survival statement itself.
type Mismatch ¶
type Mismatch struct {
Actual string `json:"actual"`
Expected string `json:"expected"`
Path string `json:"path"`
Reason string `json:"reason"`
}
Mismatch names one specific way a recovered kernel no longer matches the repository. It never carries source content.
type Requirement ¶
Requirement binds a requirement id to the pinned blob of the spec that states it.