Skip to content

feat(headless): content-address AHE target snapshots - #961

Merged
likun666661 merged 1 commit into
apache:mainfrom
likun666661:feat/execution-evidence-spine-phase-4a
Jul 14, 2026
Merged

likun666661 merged 1 commit into
apache:mainfrom
likun666661:feat/execution-evidence-spine-phase-4a

Conversation

@likun666661

Copy link
Copy Markdown
Member

Summary

Implements Phase 4A of #948: Target Means Bytes.

AHE target snapshots now bind identity to the exact bytes of every registered source ref, instead of relying on component declarations or optional Git metadata alone.

What changed

  • introduce maka.ahe-target.v2 for new AHE exports;
  • add a deterministic SHA-256 source manifest with component id, path, optional export name, content digest, and byte size;
  • derive snapshotId from the source manifest plus canonical component topology;
  • exclude createdAt, sourceLabel, and optional Git metadata from content identity;
  • reject missing sources, directories, path traversal, and symbolic-link escapes;
  • validate manifest digest, exact component/source-ref coverage, and final snapshot identity before writing an AHE export;
  • preserve explicit v1 compatibility through validateMakaAheTargetSnapshot, without treating legacy snapshots as content-bound;
  • update the AHE protocol and bilingual architecture documentation.

Identity invariants

  • same managed bytes + same component topology => same snapshotId;
  • any registered source-byte change => different snapshotId;
  • source-ref ordering, export time, source label, and Git metadata do not change the id;
  • legacy v1 remains readable, but is never silently reinterpreted as v2.

Scope

This PR intentionally stops at target/code identity. It does not add execution-lineage exports, baseline/candidate comparison derivation, verifier behavior, patch execution, or a self-iteration controller. Those remain later Phase 4 work.

Verification

  • npm run typecheck
  • npm --workspace @maka/headless test — 945 passed, 0 failed, 1 skipped
  • targeted AHE protocol/export tests — 19 passed, 0 failed
  • real repository snapshot smoke — 25 source-manifest entries, content-addressed v2 id

Closes the target-identity portion of #948 (Phase 4A); does not close the parent issue.

@likun666661
likun666661 merged commit 7d04bbb into apache:main Jul 14, 2026
3 checks passed
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.

1 participant