context

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package context builds the Pasture-side context-disclosure projection: a bounded, canonical summary of committed lifecycle records, per-host chain summaries derived from committed links, and the metamodel coordinates present in the interpreted evidence.

The package is named context but imports NO standard library context: the projection is PURE. Project takes already-read committed inputs and returns a constructor-owned ContextProjection; it holds no clock, store, or I/O and does not consult std context, so importers alias this package as lifecyclecontext to avoid colliding with the standard library.

Disclosure is the heaviest surface per unit of payoff, so this package is deliberately LEAN (Stage-3 M5 axis-C directive). It exposes exactly one projection shape under a single static policy — disclose committed lifecycle records, links, and metamodel coordinates only. There is no alternate policy to select (ContextPolicyDefinitionRef stays a staked seam) and there are no speculative accessors: the disclosure command reads what Project returns, and the durable plan fact fingerprints it.

Index

Constants

View Source
const MaxProjectionRecords = model.MaxPageSize

MaxProjectionRecords bounds the number of record summaries a single disclosure projection carries. A selection wider than this is disclosed truncated (with an explicit marker) rather than releasing an unbounded projection — the same "reads stay bounded" discipline the lifecycle readers use.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextInput

type ContextInput struct {
	Scope model.OccurrenceQuery
}

ContextInput selects the bounded committed state a disclosure projects. Scope is the OccurrenceQuery whose fingerprint becomes the durable plan scope; the records and links Project summarizes are read against this same selection by the disclosure command before Project is called.

The single static M5 policy — disclose committed lifecycle records, links, and metamodel coordinates only — is implicit: ContextInput carries no policy selector because no alternate policy exists to choose.

type ContextProjection

type ContextProjection struct {
	// contains filtered or unexported fields
}

ContextProjection is the constructor-owned, bounded disclosure projection. Its contents are unexported and exposed only through the canonical MarshalJSON (whose digest is the released content), ScopeFingerprint, and Digest — there are no field accessors, keeping the surface lean. Only Project constructs a valid projection; the zero value marshals to nothing and every disclosure surface refuses it.

func Project

func Project(input ContextInput, records []model.LifecycleRecord, links []model.LinkRecord) (ContextProjection, error)

Project is the PURE context-disclosure projection. Given the disclosed selection and the already-read committed records and links, it returns a bounded ContextProjection: a canonical, deterministically-ordered summary of the records, the per-host identity chains (edge counts derived from committed links whose endpoints fall inside the disclosed record set), and the metamodel coordinates present in the interpreted evidence.

It performs no I/O, holds no clock or store, and consults no std context, so re-running it over identical inputs yields a byte-identical projection and a stable digest. Records beyond MaxProjectionRecords are dropped and the projection is explicitly marked truncated rather than released unbounded.

func (ContextProjection) Digest

Digest returns the sha256 content identity of the canonical projection — the projection content digest recorded in the durable plan fact and presented to the write gate as the disclosure scope.

func (ContextProjection) IsValid

func (p ContextProjection) IsValid() bool

IsValid reports whether the projection was produced by Project. A zero projection is never valid, so it can never be disclosed or committed.

func (ContextProjection) MarshalJSON

func (p ContextProjection) MarshalJSON() ([]byte, error)

MarshalJSON returns the canonical projection bytes. It is the sole content accessor: the disclosure command prints these bytes and the durable plan fact records their digest, so "what is released" and "what is fingerprinted" are by construction the same bytes.

func (ContextProjection) ScopeFingerprint

func (p ContextProjection) ScopeFingerprint() model.ContentIdentity

ScopeFingerprint returns the fingerprint of the disclosed selection (the OccurrenceQuery), which the durable plan fact records as its scope. It is stable across disclosures of the same selection and independent of the committed contents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL