100%

Section 01 - content-fingerprint version engine (INV-7a)

Goal

Make CURRENT_HARNESS_VERSION real: a content fingerprint computed over the manifest-resolved, PRE-TAILOR distributed set, a recorded-fingerprint store, a version-status / fingerprint subcommand, and the CURRENT_HARNESS_VERSION == latest_registered_harness_migration() integrity invariant. Today the version is a frozen manual 1 (scripts/harness_dist/version.py:29) and the only moving signal is the whole-repo git SHA (apply.py:77-82 canonical_git_headapply.py:594-598 consumer pin) — demote the SHA to provenance.

Implementation Sketch

  • Add canonical_fingerprint(manifest, config) to scripts/harness_dist/classify.py reusing the existing primitives file_sha256 (classify.py:74), iter_files (classify.py:93), canonical_path_for (classify.py:158), and resolve_includes (classify.py:416). Hash the CANONICAL SOURCE bytes PRE-tailor (the apply.py:355-356 raw-source branch is the model) — never the post-tailor per-target hash (_hash_after_tailor, apply.py:352), so per-project tailoring never changes the version.
  • The fingerprint domain = exactly the manifest-verified-complete declared set (verify_manifest, classify.py:844, already fails on any unclassified file), so no distributed content silently escapes the fingerprint.
  • Store the last-recorded fingerprint; version-status reports current fingerprint vs recorded + whether a bump is due. A version bump fires when the fingerprint changes.
  • Add the integrity invariant CURRENT_HARNESS_VERSION == latest_registered_harness_migration() (generalize scripts/plan_corpus/migrations/__init__.py:138 latest_registered_version), enforced by a test so the pin + registry never drift.

Spec & Rule References

INV-7 (mission). Generalizes scripts/plan_corpus/version.py + migrations/__init__.py pattern. script-first.md §4 (api surface) + §10.

Layer Coverage

Tooling-scope: L1-L11 N/A. L12 = scripts/harness_dist/tests/test_fingerprint.py driving the real fingerprint/version-status subcommand. pytest gate: scripts/harness_dist/tests/test_version.py (extend) + test_fingerprint.py (new).

Work Items

  • Add canonical_fingerprint(manifest, config) to classify.py hashing pre-tailor canonical source bytes over resolve_includes x canonical_path_for.
  • Add fingerprint/version-status subcommands; record + compare the last fingerprint; demote git SHA to provenance.
  • Enforce CURRENT_HARNESS_VERSION == latest_registered_harness_migration() via a test.

Fresh intel (regenerated)

{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “installable-harness/s-8afa3c4a” }, “generated_at”: “2026-06-25T13:23:33.937512+00:00”, “graph_state”: { “head_sha”: “b74d6b9a”, “last_code_import_at”: “2026-06-25T13:20:09.544Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:installable-harness/s-8afa3c4a] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/installable-harness” } } }

(full dossier: content-fingerprint-version—s-8afa3c4a.intel.json)