Skip to content

feat(kernel): compose generated history codecs and CID links - #2660

Merged
jbeda merged 3 commits into
mainfrom
impl/cid-links
Nov 3, 2026
Merged

jbeda merged 3 commits into
mainfrom
impl/cid-links

Conversation

@jbeda

@jbeda jbeda commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Compose generated persistence codecs across the isolated kernel's actual history DTOs and identity owners, including fixed-profile CID links. This is the combined final result of the CID-link and history-codec work following #2651; it does not activate the kernel in production.

  • Generate owner methods for resource IDs, history IDs, content IDs, commits, and records. Compose them through one operation budget/reader and shared codec.Check, Encode, and Decode[T] helpers.
  • Support explicit transparent representations, fixed DAG-CBOR CID links, and declared pure local validators. Encode checks the whole value before output allocation; decode owns storage and preserves existing receivers on failure.
  • Replace handwritten history serialization, format.CID, format-specific limits/convenience functions, per-type codec entry points, and named-limit dictionaries. History hashes emitted bytes and verifies the original accepted bytes directly.
  • Keep strict canonicality, preallocation bounds, opaque payloads, and history-owned scope/ancestry/CAS/retry semantics. Bootstrap generation across missing, stale, or broken owner artifacts without executing owner initialization.

Issue relationship

Closes #2662. Relates to #2659. This completes another infrastructure milestone, not the production-cutover outcome. Follows merged #2179, #2639, and #2651.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no production runtime behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

Baseline checks

  • task lint
  • task --concurrency 3 test — full run passed again after the final diagnostic cleanup
  • task --concurrency 1 test:race — full rerun passed; the initial run hit the unchanged UI flake described below
  • go run ./cmd/mecademo — demonstrated tool call/result and permission ask/approval/result
  • task docs
  • task site:build — not applicable; no user-docs/UI behavior change
  • task api:check; affected API snapshots were regenerated during implementation and remain current
  • engine/CHANGELOG.md records additive engine/id methods; early-kernel contracts follow the scoped exemption from compatibility/changelog bookkeeping
  • task generate and task generate:codecs:check
  • Focused generator regression and affected history/contentid tests
  • git diff --check

The initial full race run failed only in unchanged
TestStreamMarkdownMatchesFullRender/heading_and_fence_runs: incremental/full
output differed in ANSI token-run grouping, with no data-race report. Five
focused race repetitions passed, followed by a successful full race rerun with
module concurrency reduced to one. The same signature was observed during
earlier phase-2 qualification and is now tracked in #2661. Current main's newer
Chroma dependency is not a verified fix: focused comparisons passed on both old
and new versions. No UI or dependency-pin changes are included here.

Earlier implementation qualification also covered standalone engine/generator tests, focused architecture/history/identity race tests, 386 checks, allocation/resource admission, and bounded fuzz smokes. Those receipts are separate from the fresh PR-preparation gates above.

Changes

Area Review focus
internal/cborgen/ Owner discovery/bootstrap, explicit representations/validators, method composition, freshness and schema diagnostics
engine/kernel/codec/ Shared operation helpers, immediate/global budgets, fixed-link framing, transactional decoding
engine/id/, engine/kernel/contentid/, engine/kernel/history/id/ Owning representations and generated persistence/value methods
engine/kernel/history/format/, engine/kernel/history/ Generated actual DTOs, optional root/parent identities, direct exact-byte hashing/verification, native limits
History adapters/conformance, API snapshots and guards Opaque backend boundary, preserved history semantics, deliberate dependency-direction changes

API compatibility

  • Wire/production: no remote-observable production behavior, protocol major, feature identifier, or client-upgrade change. No production entry point adopts the experiment.
  • Go: additive generated methods on engine/id.ID. The experimental kernel intentionally replaces its initial codec APIs, removes format.CID and format-specific limits/convenience functions, and changes commit identities to optional pointers. Kernel consumers must use the new owner methods/shared helpers and contentid.CID; the scoped experimental policy permits this without compatibility facades. API snapshots and both dependency guard sets are updated.
  • Stored data: no history bytes have been persisted. Root commits omit parent; successors omit history ID; present-zero/null identities are invalid. Earlier experimental history encodings/CIDs are deliberately not preserved or migrated. Existing production session storage remains unchanged.
  • No dependency pins, version bump, release, migration, deployment, or mixed-version rollout is included.

User-facing change

None in the production harness. This is isolated-kernel infrastructure.

Special notes for reviewers

Reviewed the combined final tree against 0dde05a06c484d31cafca9c838dd2f1ad17dc35a, not just the second commit. Spec, Standards, independent Test adequacy, and architecture/security/reuse/duplication reviews are clear after targeted fixes and rechecks.

The combined review removed obsolete facade release notes, deleted a redundant CID parser suite stranded in the former format owner while retaining owner-level coverage, and renamed stale decoder tests. It also found and fixed owner uint shadowing of generated machine-maximum caps (regression demonstrated failing before the fix and passing afterward), and added late backend-return cancellation coverage with positive controls.

No squash or rebase was performed. The PR description describes the final combined design; intermediate commit descriptions describe their original scopes.

Full approved implementation plan and delivery-checkpoint amendment, archived in one conversation comment and verified by full-content SHA-256 readback. Planned checks in that archive are distinct from executed results above.

jbeda and others added 3 commits November 2, 2026 15:17
Add fixed-profile DAG-CBOR CID primitives, generator leaf support, and canonical encoding and allocation qualification. Keep history codecs unchanged.

Co-authored-by: Mecatl <[email protected]>
Generate persistence and value methods in the packages that own resource IDs,
content IDs, history IDs, commits, and records. Share operation accounting,
canonical encoding, transactional decoding, and explicit local validation
across package boundaries, including bootstrap from missing or broken output.

Migrate history to shared codec helpers and exact-byte content verification.
Remove handwritten history serialization, redundant CID and policy wrappers,
and named-limit machinery. Update dependency guards, API snapshots, references,
and regression coverage for ownership, canonicality, and resource admission.

Co-authored-by: Mecatl <[email protected]>
Remove obsolete format codec/CID release notes and redundant parser tests
from the former owner package, retaining identity-owner coverage and the
independent history composition checks. Rename stale decoder tests and
correct struct-only root diagnostics.

Reject uint shadowing before generation so emitted machine-maximum field
caps cannot silently resolve to an owner-defined narrow integer type.
Add regression coverage and post-backend history read cancellation checks.

Co-authored-by: Mecatl <[email protected]>
@jbeda

jbeda commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Approved implementation plan: history-codecs

  • Updated: 2026-11-03.
  • Source provenance: .scratch/history-codecs-plan.md (local path, not a remote link).
  • Branch: impl/cid-links; PR base: main.
  • Combined review baseline: 0dde05a06c484d31cafca9c838dd2f1ad17dc35a.
  • Phase-2 baseline: 8d04d2f81e61f96ca4dbd41326af9af6126a7558.
  • SHA-256 of the complete plan portion below (UTF-8, including its final newline): 47d310bf053cf2e1297ccf33754e71540d8741283bcda3ac17c59dff8310ab0a.

The full current plan follows without omissions. Its delivery-checkpoint amendment
records the subsequent review/PR authority and contract-preserving cleanup.
Planned verification is not a claim of executed tests; actual results belong in
the PR description.


Phase 2: compositional generated history codecs

Slug: history-codecs
Implementation branch: impl/cid-links
Base branch: main
Phase-2 start/review baseline: 8d04d2f
Plan path: .scratch/history-codecs-plan.md

Joe explicitly chose the existing branch instead of impl/history-codecs (Q9).
The plan below records the approved implementation contract; planning-time authority
and readiness statements describe the checkpoint at which it was written.

Delivery checkpoint — 2026-11-03

Implementation is complete. Joe subsequently authorized a combined final-tree
review against 0dde05a06c484d31cafca9c838dd2f1ad17dc35a (the branch's original
baseline), cleanup of superseded-design residue, and creating a PR. This does not
authorize rebasing, squashing, merging, release, or production integration.
The phase-2 baseline below remains provenance for the original phase-2 review,
not the baseline of the combined review.

Combined-review corrections preserve the settled contract: remove obsolete
kernel codec/facade changelog claims and redundant former-owner CID tests,
retain owner-level coverage and the unique formatting assertion, rename stale
decoder test names, reject owner shadowing of the uint primitive used by
emitted field caps, and add post-backend read-cancellation regression coverage.
No new design decision, compatibility facade, dependency, or production behavior
is introduced. Planned verification below is separate from actual gate results
reported in the PR.

Outcome and settled scope

Generate the actual history persistence DTOs and all persisted named dependencies
in their owning packages. Generated methods compose across packages with one
operation budget/reader and one encoding buffer. Remove handwritten history CBOR,
parallel wire DTOs, redundant identities and convenience wrappers. Revise slice 1
as needed; it is committed locally, not published. The complete question/answer
record is .scratch/history-codecs-spec.md.

Settled with Joe:

  • Methods on T/*T, not codec objects; recursively compose owner-generated methods.
  • Explicit transparent wrappers collapse into their represented value. Ordinary
    structs remain maps; no inferred unwrapping or general custom CBOR hooks.
  • Native runtime limits, optional inline literal field caps, conservative byte
    admission. Remove @name, Limits.Named, and all named-limit machinery.
  • Policy validation once per whole operation, not once per nested call. Field and
    aggregate accounting still applies at each represented wire value.
  • Explicit owner-written local validators; generated traversal checks children
    once, then local invariants. Clone/Equal never validate.
  • Optional commit identities are pointers; exactly one present. Root omits parent;
    successor omits history ID. Present-zero is invalid; explicit null is rejected.
  • Remove format.CID in favor of contentid.CID, without compatibility aliases.
  • Shared codec.Check/Encode/Decode[T]; remove generated per-type convenience
    functions AND format.EncodeCommit/DecodeCommit, not merely thin wrappers.
  • Runtime imports no identity owners. Identity packages may import codec; change
    current leaf layering deliberately rather than adding another runtime package.

No history bytes have been persisted. Byte-identical old history encodings/CIDs,
old API signatures, and backward decoding are not requirements. Keep version 1
and replace affected wire/CID fixtures deliberately. No production execution,
legacy session, provider, host storage, new backend, retry/ancestry redesign,
reflection, runtime codec registry, arbitrary tags, new dependencies, or module
pin changes. Recursive type graphs and other unsupported vocabulary stay rejected.

Existing boundaries to change

  • internal/cborgen/{load,schema,emit,inventory}.go currently selects only local
    struct roots, expands imported storage, rejects private persisted fields, and
    overlays one package output. It emits whole-root functions and private helpers.
  • engine/kernel/codec/{budget,reader,limits}.go own strict admission and owning
    reads. codec/cid.go currently imports contentid: that edge must disappear
    before generated contentid methods import codec.
  • engine/id.ID stores a private string; history/id.HistoryID stores a private
    resource ID; contentid.CID stores private [36]byte. Their current stdlib/identity
    leaf allowances must change in BOTH architecture guard sets.
  • history/format/{commit,record,cbor,cid,limits}.go own current manual codecs,
    DTO validation and exact-size policy. History.encode and History.Read are
    the only semantic serialization integration paths (history/history.go:72,193).
  • Backend treats bytes as opaque and enforces byte caps BEFORE materialization
    (history/backend.go). Keep that boundary; update conformance fixtures, not
    backend knowledge of CBOR. Identity/ancestry checks stay in History.

Public operation and ownership contract

Generate these five methods on each persisted named type (aliases use the
underlying owner's methods). Generate local helper traversal for built-ins and
anonymous values; don't invent methods for unnamed Go types.

func (v T) CheckCBOR(b *codec.Budget, depth, fieldMax int) error
func (v T) AppendCBOR(dst []byte) []byte
func (v *T) ReadCBOR(r *codec.Reader, depth, fieldMax int) error
func (v T) Clone() T
func (v T) Equal(other T) bool

Shared runtime interfaces Marshaler and Unmarshaler expose the corresponding
CBOR methods. Shared whole-value Check/Encode use the marshaling constraint;
Decode uses a pointer constraint so codec.Decode[T](data, limits) can infer the
*T implementation and return T. Prove this in a compiled cross-package consumer;
do not change the call shape or introduce codec objects to dodge inference.

Whole-value helpers construct state and validate all positive global limits once.
The unconstrained outer field maximum is a positive machine maximum; primitive
runtime checks ALWAYS supplement it with the appropriate configured global cap.
Nested generated methods never create another budget, reader, policy or encoded
buffer. fieldMax is the immediate value cap, not a subtree cap. Transparent
wrappers pass it through, taking the minimum with their own applicable literal
cap. Ordinary containers apply their own immediate cap, then each child receives
its own field/default cap; parent collection caps do not leak into child lengths.
Retain current literal grammar/overflow-safe clamping. Keep caps unsupported on
ordinary struct maps, numeric/bool scalars and CID representations; literals on
transparent wrappers follow their represented string/bytes/array/map kind.

Encode checks the entire value before output/sorting allocation, then appends
without recharging accounting or rerunning validators. AppendCBOR is a low-level
prechecked operation: caller must have checked the same stable value. It promises
no independent admission, null/default policy, or safe mutation during the pass.
Root Encode returns nil bytes on any error. No public method silently resets state.

ReadCBOR reads one nested value into a fresh temporary and assigns its receiver
only after structural and declared local semantic success. On failure the existing
receiver and its reachable storage remain unchanged, but reader cursor/accounting
need not roll back: discard the operation after error. Only root Decode calls
Done and rejects trailing bytes; every root failure returns zero T. Successful
strings/bytes/collections own storage. Clone detaches all mutable state, including
excluded fields, preserving nil/empty distinctions; Equal includes excluded state
and preserves current nil/empty collection equivalence. Pointer absence is distinct
from present-zero. Nil required pointers fail; optional nil omits; null fails.
Nil shared state/receiver is invalid, not a request to construct default state.
Whole-value helpers are intended for generated value roots, not nil pointer roots.

All unsupported-type, recursion, inaccessible-owner, malformed tag and method
collision errors remain generation errors with useful owner/field diagnostics.
Defined pointer types cannot have Go receiver methods: reject them and prescribe
ordinary pointers/aliases instead. A byte string is one scalar, not per-byte wire
nodes; do not silently bypass a named byte element's declared semantics. Reject
packed named-byte elements with a declared validator unless their constraints
can be proved by the supported packing contract (do not add a new packing hook).
Named string map keys must retain their owner checks while preserving canonical
UTF-8 key order; they are not an exception to semantic validation.

Declarations and semantic composition

Use the existing source-local go:generate registry and one marked output per
package. Extend selected families to generate methods for reachable local named
persisted types, including supported scalar/container declarations; cross-package
owners opt in through their own registry declarations. Interface compatibility
alone never opts arbitrary handwritten serializers into generated composition.
Validate owner declarations and required generated signatures at build time; no
runtime provenance/security mechanism or registry is needed. Excluded-only state
needs correct Clone/Equal but no serialization traversal. For imported opaque
excluded values, require owner-generated value operations or reject; don't inspect
private storage from the consuming package or invoke arbitrary custom hooks.

Proposed concrete declaration grammar for this slice:

//cborgen:validate validateCBOR
// ID is a validated resource identifier.
type ID struct {
    value string `cbor:",value" cborlimit:"bytes=25"`
}

//cborgen:validate validateCBOR
// HistoryID identifies one history.
type HistoryID struct {
    value resourceid.ID `cbor:",value"`
}

//cborgen:validate validateCBOR
// CID is a fixed-profile content identity.
type CID struct {
    binary [36]byte `cbor:",cid"`
}

The annotation belongs to the named type declaration and names a local value
receiver method func (v T) validateCBOR() error (the identifier is explicit,
not a magic method-name lookup). Validate syntax/signature and reject duplicate,
unknown or ambiguous directives. No custom encode/decode/clone/equal callbacks.

,value requires exactly one representation field and no other persisted fields;
others must explicitly be excluded. It emits the field at the same depth/node,
recursively composing the field owner's methods. Permit explicit private persisted
fields only when generation runs in that owner. Ordinary structs keep explicitly
named field maps. Never normalize invalid values during encoding/decoding.

,cid is limited to the [36]byte binary representation and fixed DAG-CBOR tag42,
minimal 37-byte string, zero prefix. It is not a generic tag facility. Runtime
primitives own framing/accounting without importing a CID type; generated owner
code owns its private array and invokes the declared profile validator. Reuse
contentid's existing profile authority; no duplicated profile parser in runtime
or generator. Tag depth d + bytes at d+1, two nodes, 55 estimated bytes, 41 emitted
bytes, 37 content bytes charged to the global byte-string cap, no collection item.
Retain zero-allocation fixed-size read and pre-copy exact-length rejection.

Owner validators run after the relevant generated structural/budget traversal
on Check and after child reads before assignment on Read. They are local, pure,
non-normalizing, non-recursive and contain no CBOR or resource policy logic.
Opaque ID validators preserve constructor/parser validity, including unset-value
rejection. Commit's local validator checks version1, one identity, root/successor
sequence, and nonempty records. Record checks nonempty UTF-8 kind and positive
kind version; payload stays opaque, including unknown kind/version pairs. Preserve
budget-independent public Validate helpers where useful, sharing local logic
rather than registering recursive Validate as a generated hook. Owner semantic
rejection classifies as codec.ErrInvalidData without leaking value/payload content;
other error categories remain ErrInvalidLimits and ErrLimitExceeded.

Generation and identity dependency graph

Desired imports: codec -> stdlib/Atmos only; engine/id -> codec;
contentid -> codec; history/id -> engine/id + codec;
history/format -> identities + codec; history -> those values/codec/contentid.
Update exact edges, descriptions and obsolete stdlib/codec-independent claims in
.golangci.yml, engine/arch/layering_test.go, owning Godoc/READMEs, and scoped
kernel guidance. Do not loosen unrelated guards or add broad generated exceptions.

Cross-package generation must bootstrap when all selected generated files are
missing, stale or syntactically broken. Extend load-only overlays/signature stubs
to the declared owner closure, including the new methods, and generate in stable
dependency order. Do not require users to guess go:generate ordering. Respect the
existing standalone module/build context, refuse malformed handwritten sources,
never run owner initialization, and keep output ownership/atomic-file safeguards.
Single-package generation must either resolve its declared owner prerequisites
using the same machinery or produce an actionable missing-declaration error;
it must not silently inspect/import a handwritten codec instead. Check mode
remains nonmutating and covers every owner artifact/orphan using the same registry.
No all-package transactional write or hostile-filesystem confinement promise.

History migration

Commit keeps format version/sequence/records and uses optional
*historyid.HistoryID (h,omitempty) / *contentid.CID (p,omitempty). Record keeps
its current kind/version/opaque payload fields and short wire keys. Use generated
Clone/Equal; retire conflicting handwritten implementations. Replace format.Limits
with codec.Limits in History.Policy.CommitLimits; no adapter type, named dictionary,
old exact-size guarantee, or speculative new hardcoded payload/count limits.

Delete the handwritten cborDecoder, append/sizing helpers, CID facade/parser,
format-specific Limits, EncodeCommit and DecodeCommit. In History's existing
shared encode path call codec.Encode then contentid.Sum(canonical). In Read call
codec.Decode[format.Commit], then contentid.Verify(originalBytes, indexedCID),
then existing indexed sequence/scope/ancestry/endpoint checks. Never hash a
reencoding and never treat unset expected CID as verification opt-out. Keep
ErrInvalid/ErrCorrupt mappings, zero failure outputs, cancellation/CAS/retry
semantics and authoritative acceptance behavior unchanged.

Backend remains opaque. Derive ByteReadRequest.MaxCommitBytes directly from
CommitLimits.MaxBytes (which bounds actual input as well as conservative admission);
retain separate page byte/count caps and all pre-materialization checks. This
is not an adapter that reconstructs the former four-cap policy. Copy the value
policy on History construction; no mutable policy dictionary remains.

API compatibility: no production/wire API major/feature change, since no shipped
server semantics are changed. Early-kernel Go/stored-format changes above were
explicitly accepted, with no old-data migration/compatibility facades. Regenerate
all affected API snapshots. Skip kernel compatibility/changelog bookkeeping per
kernel guidance; engine/id is outside that scoped exemption, so record its
additive generated methods under the ordinary engine policy and correct the
obsolete codec-independent identity description where applicable. No version
bump, release, publication or module-pin update is part of this work.

Dependency-ordered implementation tasks

  1. Shared runtime contract and removal of named limits. Add interfaces and
    generic Check/Encode/Decode helpers; prove pointer-type inference, nil/zero
    failure outputs and root-only Done with small test-owned implementations.
    Remove dictionary APIs; retain literal caps and positive globals. Replace typed
    CID dependency with minimal fixed-link raw primitives. Test accounting/parity,
    boundary depths/extreme arithmetic, exact headers and allocation admission.
    Keep in-package codec tests identity-free too: move typed-CID assertions to
    contentid tests or external codec_test tests to avoid a test-only import cycle.
    Files: codec interfaces/helpers, budget/reader/limits/cid tests and API snapshot.

  2. Owner-aware generation and bootstrap. Add owner declaration/closure loading,
    new method overlays, local named scalar/container roots and private-field access
    rules; emit/check five methods, shared runtime helper use, imported-owner calls,
    explicit transparent/CID representations and local validators. Retire per-type
    functions and named-reference emitter policy. Extend real copied-module tests;
    add missing/stale-all-owner bootstrap, deterministic order, no-init traps,
    provenance/method collisions, unsupported owner/type/annotation diagnostics and
    nonmutating freshness. Keep one artifact/package and source-local registry.

  3. Generate identity owners. Annotate/register resource ID, HistoryID and CID;
    add/reuse their local validators without changing parsing/generation semantics.
    Reverse runtime/identity dependency guard edges coherently. Compile real
    generated multi-package calls; check valid/invalid/zero identities, transparent
    bytes/depth and unchanged receiver after malformed/semantic failures. Tasks
    1-3 are one integration unit; don't require broken intermediate commits.

  4. Generate Commit/Record and integrate history. Apply pointer identities and
    local validators; replace manual Clone/Equal, codecs and policy; delete old
    format helpers rather than retaining aliases/wrappers. Update History direct
    shared-helper/hash/verify calls, typed references, byte-facing request policy
    and all affected history/conformance fixtures. Preserve memory backend opacity.
    Focused proof: identify/append/read/resolve roundtrip, mismatch/ancestry rejection,
    independent reader policies, ownership/zero results and early backend bounds.

  5. Qualification, docs and full integration. Migrate generator fixtures to
    inline caps and owner-generated methods (including imported named containers,
    keys, private values and excluded mutable state); regenerate only via task
    generate. Keep independent canonical/noncanonical goldens and bounded fuzz.
    Update owning generator/runtime/kernel and changed architecture claims in
    place; no drafts as current behavior or new public feature guide is needed.
    Refresh snapshots and the narrowly applicable engine/id note. Run full gates
    and final panel below; fix/recheck findings before calling the slice complete.

Acceptance and verification

  • Independent fixed root/successor wire goldens: omit absent identity, reject both/
    neither/present-zero/null, preserve opaque payload bytes and exact content hashes.
    All old manual history codec functions/types are absent and callers compile.
  • Real cross-package owner codecs cover private fields, nested transparent wrappers,
    scalar/container roots, named keys/bytes, aliases, excluded state and validator
    rejection. Parent and child literal/global caps take their minimum BEFORE the
    corresponding scan, allocation or copy; no budget reset at imported boundaries.
  • Tiny aggregate/node/depth budgets reject a collection of individually valid
    child values; only one root check pass and one append pass occur. Counting
    validators distinguish local calls from repeated descendant revalidation.
    Literal caps are generated constants; @NAMEs and Named fail/are removed, not
    ignored. Add compile-time positive/negative interface/owner controls.
  • Existing populated receiver and reachable storage remain unchanged on truncated,
    malformed, limit and semantic errors; original input stays unchanged. Root decode
    returns zero even after nested success followed by a later error/trailing bytes.
    Clone detaches optional ID/CID pointers and payloads; Equal includes excluded
    state and distinguishes absent/present-zero without validating either operand.
  • CID exact framing/profile, all truncated prefixes, nonminimal/stacked/wrong tags,
    huge and fully supplied wrong lengths, prefix/varints/profile rejection remain
    tested. Retain zero-allocation raw successful link read and bounded allocated
    bytes on rejected large declarations; no intermediate child byte buffers.
  • Whole-repository generation succeeds from test-owned copies with all selected
    artifacts missing or corrupt, with poisoned owner init never executed. Freshness
    detects modified owner schema/declarations/output and extra artifacts without
    changing files. Prove GOWORK=off and copied fixture closure on all changed modules.
  • History remains correct for CAS/retry, sequence overflow, indexed CID/sequence/
    scope/parent mismatch, through identity, cancellation, byte/count bounds before
    backend materialization, page limits, corruption and non-content-bearing errors.
    Memory adapter conformance remains a schema-opaque integration boundary.

Focused commands: GOWORK=off go test ./internal/cborgen/... from root;
cd engine && GOWORK=off go test -race ./id ./kernel/... ./arch ./adapter/history/....
Run task generate, task generate:codecs:check, task api:update and task api:check.
Run bounded fuzz smoke for affected identity/generated/history decoders, and
retarget existing allocation and 32-bit qualification to the new entry points.

The integration owner runs task test once per integrated set; then PR-ready
task lint, task test:race, task docs, and offline go run ./cmd/mecademo
(show tool call, ask/approval, result). Full test suites get 1800-second outer
timeouts; other full gates get 600 seconds. No live provider tests. Public docs
edits, if later necessary, follow tech-writer/user-docs guidance and site build;
contributor reference edits use tech-writer and task docs.

Final panel-review fixed point is the recorded phase-2 baseline
8d04d2f, NOT main and not a moving HEAD.
Supply the actual final-tree tracked diff and owned new-file snapshot. Retain
per-axis results; targeted fixes get incremental rechecks against the reviewed
candidate. No rebase, commit, push, PR, merge or cleanup is implied.

Review and handoff

Fresh-context general, architecture and security design reviews completed against
this plan and Joe's decision record at 8d04d2f. All three reported no blocker,
important or advisory findings, and no additional user decisions. Receipt:
.scratch/history-codecs-plan-review.md. This establishes design coherence only;
generic inference, owner bootstrap, resource admission and migration behavior
remain unverified until implementation executes the planned tests.

Keep the final plan ignored and update HANDOFF.md at Joe's explicit request before
clear, naming this plan, spec record, exact commit, branch exception and review
outcome. After clear, re-read both and wait for the implementation request; do not
re-grill settled decisions or implement based on review approval alone.
If a PR is separately authorized, archive the complete publishable latest plan in
one identifiable PR conversation comment, verify its identity/privacy/completeness
and readback, and record its URL/digest in ignored run metadata. Humans alone merge.

@jbeda
jbeda marked this pull request as ready for review November 3, 2026 16:01
@jbeda
jbeda enabled auto-merge (squash) November 3, 2026 16:53
@jbeda
jbeda merged commit 0c7308a into main Nov 3, 2026
79 of 99 checks passed
@jbeda
jbeda deleted the impl/cid-links branch November 3, 2026 17:04
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Nov 18, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deliver compositional history codecs and CID links

1 participant