Documentation
¶
Overview ¶
Package gokernel contains the experimental dependency-free Corvint production kernel. The initial slice intentionally implements only non-index lifecycle events; unsupported events fail closed instead of delegating to Python.
Index ¶
- Constants
- func CanonicalJSON(value any) ([]byte, error)
- func CompactionDegradations(event string, block map[string]any) []any
- func HandleEvent(request EventRequest) (map[string]any, error)
- func HandleEventContext(ctx context.Context, request EventRequest) (map[string]any, error)
- func HarnessHosts() []string
- func KnownHarnessHost(host string) bool
- func SanitizedGitEnvironment() []string
- func SupportedEvents() []string
- type Error
- type EventRequest
- type IndexedBlock
- type IndexedContext
- type Observation
- type Repository
- type SharedIndexedContext
Constants ¶
const ( Profile = "corvint-harness-event/0" ReceiptPrefix = "harness-receipt:sha256:" MaxInputBytes = 131_072 MinOutputBytes = 4_096 MaxOutputBytes = 1_000_000 // OutputOverheadBytes is reserved for the receipt envelope around the context // block, matching the oracle's OUTPUT_OVERHEAD_BYTES. OutputOverheadBytes = 2_048 // MaxQueryCharacters and MaxTaskBytes bound the user-prompt task, matching the // oracle's MAX_QUERY_CHARS and MAX_TASK_BYTES. MaxQueryCharacters = 2_000 MaxTaskBytes = 16_384 )
Variables ¶
This section is empty.
Functions ¶
func CanonicalJSON ¶
CanonicalJSON matches the compact, sorted, UTF-8 JSON used by the Python harness protocol. It intentionally returns no terminal newline so the bytes are suitable for receipt hashing.
func CompactionDegradations ¶
CompactionDegradations reads back the compaction rehydration block. The oracle raises each flag inside the branch that shaped that block, so the block itself is the evidence for which degradations belong on the receipt.
func HandleEvent ¶
func HandleEvent(request EventRequest) (map[string]any, error)
func HandleEventContext ¶
func HarnessHosts ¶
func HarnessHosts() []string
HarnessHosts returns the host identifiers in the embedded schema.
func KnownHarnessHost ¶
KnownHarnessHost reports whether the embedded schema admits host.
func SanitizedGitEnvironment ¶
func SanitizedGitEnvironment() []string
SanitizedGitEnvironment is the environment of every Core Git read. An empty GIT_ALLOW_PROTOCOL refuses every transport, so a Git that ignores GIT_NO_LAZY_FETCH still cannot fetch a missing promisor object (V1-0349).
func SupportedEvents ¶
func SupportedEvents() []string
Types ¶
type Error ¶
Error is the stable machine-readable error returned by the experimental Go kernel. Callers must key behavior from Code, never Message. ReasonClass is the closed status refusal class of decision 0383, set only on a status refusal.
type EventRequest ¶
type IndexedBlock ¶
IndexedBlock finishes an index-backed event from an index already in memory. It reads no repository state, so the bracket runs it beside its closing observation rather than inside the read stage.
type IndexedContext ¶
type IndexedContext func(ctx context.Context, root, event string, normalized map[string]any, budgetBytes int) (map[string]any, error)
IndexedContext supplies the context block for the two events that require a built repository index. It is injected rather than imported so this package stays dependency-free; when it is nil those events fail closed exactly as before.
type Observation ¶
type Observation struct {
ObjectFormat, CommitRevision, TreeRevision string
DirtyPaths []string
StatusSHA256 string
}
Observation is the bracket's opening observation as handed to a shared reader: the identity that names an index snapshot and the dirty set a snapshot hit applies (IDX-SNAP-V0-010). StatusSHA256 digests the raw status bytes exactly as the index loader's own status read would.
type Repository ¶
type Repository struct {
CommitRevision string
DirtyPathCount int
DirtyPathsSHA string
ObjectFormat string
ProfileID string
TreeRevision string
WorktreeState string
}
func ProbeRepository ¶
func ProbeRepository(root string) (Repository, error)
func ProbeRepositoryContext ¶
func ProbeRepositoryContext(parent context.Context, root string) (Repository, error)
type SharedIndexedContext ¶
type SharedIndexedContext func(ctx context.Context, root, event string, normalized map[string]any, budgetBytes int, observation Observation) (IndexedBlock, error)
SharedIndexedContext is IndexedContext placed inside the GPK-V0-007 bracket (proposed GPK-V0-058): it consumes the bracket's opening observation instead of reading identity and status itself, performs the event's reads, and returns the IndexedBlock that computes the context block from what it read. When nil, the default concurrent path runs unchanged. It serves file-change and compact session-start; user-prompt keeps the default path.