Skip to content

Commit 0fbb35e

Browse files
Merge pull request #162 from engineeredsoftware/v41/gate-3-registry-interpolation-contracts
V41 Gate 3: Registry Interpolation Contracts
2 parents c8b8df0 + a8b17d1 commit 0fbb35e

18 files changed

Lines changed: 3047 additions & 16 deletions

.bitcode/v41-registry-interpolation-contracts.json

Lines changed: 1510 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/bitcode-canon-quality.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ jobs:
265265
if [ -f scripts/check-v41-gate2-promptpart-prompt-inventory.mjs ]; then
266266
node scripts/check-v41-gate2-promptpart-prompt-inventory.mjs --skip-branch-check --skip-package-tests
267267
fi
268+
if [ -f scripts/check-v41-gate3-registry-interpolation-contracts.mjs ]; then
269+
node scripts/check-v41-gate3-registry-interpolation-contracts.mjs --skip-branch-check --skip-package-tests
270+
fi
268271
fi
269272
else
270273
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

.github/workflows/bitcode-gate-quality.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@ jobs:
394394
if [ -f scripts/check-v41-gate2-promptpart-prompt-inventory.mjs ]; then
395395
node scripts/check-v41-gate2-promptpart-prompt-inventory.mjs --skip-branch-check --skip-package-tests
396396
fi
397+
if [ -f scripts/check-v41-gate3-registry-interpolation-contracts.mjs ]; then
398+
node scripts/check-v41-gate3-registry-interpolation-contracts.mjs --skip-branch-check --skip-package-tests
399+
fi
397400
fi
398401
else
399402
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

BITCODE_SPEC_V41.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Prior canonical anchor: `BITCODE_SPEC_V40.md`
99
- Prior generated proof appendix: `BITCODE_SPEC_V40_PROVEN.md`
1010
- Active canonical pointer during draft opening: `BITCODE_SPEC.txt` -> `V40`
11-
- Generated structured artifact inventory: draft `.bitcode/v41-spec-family-report.json`, draft `.bitcode/v41-canonical-input-report.json`, planned prompt-program catalogue artifacts, planned benchmark artifacts, planned promotion-readiness artifact, and eventual `BITCODE_SPEC_V41_PROVEN.md` after V41 promotion
11+
- Generated structured artifact inventory: draft `.bitcode/v41-spec-family-report.json`, draft `.bitcode/v41-canonical-input-report.json`, Gate 2 `.bitcode/v41-promptpart-prompt-inventory.json`, Gate 3 `.bitcode/v41-registry-interpolation-contracts.json`, planned benchmark artifacts, planned promotion-readiness artifact, and eventual `BITCODE_SPEC_V41_PROVEN.md` after V41 promotion
1212
- Source parity state: V41 opens prompt-program parity over V40 exhaustive testing, V38 inference correctness, and V39 commercial Reading readiness; source-side prompt and PromptPart rewrites are blocked until catalogue, benchmark, interpolation, registry, callsite, and return-type surfaces are specified and checked
1313
- Notes companion: `BITCODE_SPEC_V41_NOTES.md`
1414
- Delta companion: `BITCODE_SPEC_V41_DELTA.md`
@@ -116,6 +116,8 @@ Gate 2 also preserves V41 scope and prepares draft V42 only as forward roadmap t
116116

117117
Gate 3 must prove the composition chain from phase and pipeline context through PTRR agents, PTRR steps, FailsafeGenerationSequence, and ThricifiedGeneration final prompt resolution.
118118
Rows must bind registry ids, execution ancestry frames, interpolation keys, missing-key behavior, tool doc-comment prompt injection, context-size handling, and parser targets.
119+
Gate 3 is closed by the package-backed `buildV41RegistryInterpolationContracts` source, deterministic `.bitcode/v41-registry-interpolation-contracts.json` artifact, `generate:v41-registry-interpolation-contracts`, `check:v41-registry-interpolation-contracts`, `check:v41-gate3`, protocol tests, and gate/canon workflow wiring.
120+
The current source-safe contract covers 12 rows, 65 passing source predicates, Prompt registry totality, TemplatedPromptPart interpolation, PTRR agent prompt composition, PTRR step prompt composition, FailsafeGenerationSequence context handling, ThricifiedGeneration final prompt resolution, execution ancestry overlays, tool doc-code prompt injection, `ReadNeedComprehensionSynthesis` parser targets, `ReadFitsFindingSynthesis` search/parser targets, AssetPack synthesis/finishing parser targets, and Gate 2 prompt inventory binding.
119121

120122
## V41 Gate 4 Reading Pipeline Prompt Benchmark Baselines
121123

@@ -449,6 +451,7 @@ Generation must fail closed when artifact freshness, source-safety, benchmark co
449451

450452
V41 Gate 1 validates with `pnpm run check:v41-gate1`, `node scripts/check-bitcode-spec-family.mjs --version V41 --mode draft --current-target V40`, `node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V40 --draft-target V41`, and `node scripts/check-bitcode-canonical-inputs.mjs --current-target V40`.
451453
V41 Gate 2 validates with `pnpm run generate:v41-prompt-inventory`, `pnpm run check:v41-prompt-inventory`, `pnpm run check:v41-gate2`, and `node --test --test-force-exit packages/protocol/test/v41-promptpart-prompt-inventory.test.js`.
454+
V41 Gate 3 validates with `pnpm run generate:v41-registry-interpolation-contracts`, `pnpm run check:v41-registry-interpolation-contracts`, `pnpm run check:v41-gate3`, and `node --test --test-force-exit packages/protocol/test/v41-registry-interpolation-contracts.test.js`.
452455
Later gates add focused generator, checker, package, benchmark, and workflow commands.
453456

454457
## V41 promotion canon

BITCODE_SPEC_V41_DELTA.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
- Current canonical/latest target: `V40`
88
- Prior canonical anchor: `BITCODE_SPEC_V40.md`
99
- Prior generated proof appendix: `BITCODE_SPEC_V40_PROVEN.md`
10-
- Generated structured artifact inventory: draft `.bitcode/v41-spec-family-report.json`, draft `.bitcode/v41-canonical-input-report.json`, planned prompt-program catalogue artifacts, planned benchmark artifacts, planned promotion-readiness artifact, and eventual `BITCODE_SPEC_V41_PROVEN.md` after V41 promotion
11-
- Source parity state: V41 source parity begins at specification and workflow posture; prompt rewrites are explicitly deferred until catalogue and benchmark gates close
10+
- Generated structured artifact inventory: draft `.bitcode/v41-spec-family-report.json`, draft `.bitcode/v41-canonical-input-report.json`, Gate 2 `.bitcode/v41-promptpart-prompt-inventory.json`, Gate 3 `.bitcode/v41-registry-interpolation-contracts.json`, planned benchmark artifacts, planned promotion-readiness artifact, and eventual `BITCODE_SPEC_V41_PROVEN.md` after V41 promotion
11+
- Source parity state: V41 source parity now includes prompt inventory plus registry/interpolation contracts; prompt rewrites are explicitly deferred until catalogue, contract, and benchmark gates close
1212
- Scope: V41 draft delta for Prompt and PromptPart excellence over promoted V40
1313

1414
## Why V41 exists
@@ -39,6 +39,8 @@ It also records V42 as the subsequent MVP experience version for shortest-path D
3939
### Gate 3: Registry Composition And Interpolation Contracts
4040

4141
Prove registry composition, prompt context interpolation, execution ancestry, tool prompt injection, and parsed return type bindings.
42+
Gate 3 is package-backed by `buildV41RegistryInterpolationContracts`, emits `.bitcode/v41-registry-interpolation-contracts.json`, and currently covers 12 source-safe contract rows with 65 passing source predicates across Prompt registry totality, PromptPart interpolation, PTRR agent/step composition, FailsafeGenerationSequence context handling, ThricifiedGeneration final prompt resolution, execution ancestry overlays, tool doc-code prompt injection, Reading parser targets, Finding Fits search contracts, and AssetPack synthesis/finishing parser targets.
43+
It preserves V42 as subsequent reliable MVP experience planning while keeping V41 focused on prompt-program correctness.
4244

4345
### Gate 4: Reading Pipeline Prompt Benchmark Baselines
4446

BITCODE_SPEC_V41_NOTES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Canonical pointer: `BITCODE_SPEC.txt` -> `V40`
99
- Prior canonical anchor: `BITCODE_SPEC_V40.md`
1010
- Prior generated proof appendix: `BITCODE_SPEC_V40_PROVEN.md`
11-
- Generated structured artifact inventory: draft `.bitcode/v41-spec-family-report.json`, draft `.bitcode/v41-canonical-input-report.json`, Gate 2 `.bitcode/v41-promptpart-prompt-inventory.json`, planned benchmark artifacts, planned promotion-readiness artifact, and eventual `BITCODE_SPEC_V41_PROVEN.md` after V41 promotion
11+
- Generated structured artifact inventory: draft `.bitcode/v41-spec-family-report.json`, draft `.bitcode/v41-canonical-input-report.json`, Gate 2 `.bitcode/v41-promptpart-prompt-inventory.json`, Gate 3 `.bitcode/v41-registry-interpolation-contracts.json`, planned benchmark artifacts, planned promotion-readiness artifact, and eventual `BITCODE_SPEC_V41_PROVEN.md` after V41 promotion
1212
- Source parity state: V41 notes track prompt-program planning, catalogue, benchmark, rewrite, telemetry, and promotion parity over active V40
1313
- Draft target posture: V41 Gate 1 creates the full SPEC, DELTA, NOTES, and PARITY family.
1414
- Scope: Prompt and PromptPart excellence over the promoted V40 exhaustive testing base.
@@ -29,8 +29,16 @@ This is an inventory and admission artifact, not a rewrite artifact.
2929

3030
V42 is re-roadmapped as the MVP experience version after V41.
3131
Its focus is shortest-path Depositing, shortest-path Reading, and a strong AI-reading dominant demonstration where any deposit source can contribute proprietary or otherwise non-public training, prompt, context, or evaluation material to an AssetPack that measurably improves an AI system beyond public-data-only performance.
32+
Depositing must minimize the path to admitting source material and later receiving BTC compensation when the deposit participates in a synthesized AssetPack.
33+
Reading must minimize the path from Read Request to synthesized Need review/resynthesis, Finding Fits, source-safe AssetPack preview, BTD/BTC purchase and settlement, and repository delivery.
3234
V42 must keep depositor compensation, reader purchase, BTD/AssetPack rights, and repository delivery visible in the shortest path without widening V41 beyond Prompt and PromptPart excellence.
3335

36+
## Gate 3 registry and interpolation contract note
37+
38+
Gate 3 makes the prompt registry call chain source-checkable before prompt rewrites.
39+
The package-backed contract currently emits 12 rows and 65 source predicates for Prompt registry totality, TemplatedPromptPart interpolation, PTRR agent and step prompt composition, FailsafeGenerationSequence context handling, ThricifiedGeneration final prompt resolution, execution ancestry overlays, tool doc-code prompt injection, Reading parser targets, Finding Fits search and embedding contracts, AssetPack synthesis and finishing parser targets, and Gate 2 inventory binding.
40+
The artifact records ids, source paths, hashes, predicate verdicts, parser target ids, interpolation key ids, and ancestry frame ids only; it does not serialize raw prompt text, provider responses, private context, credentials, or unpaid AssetPack source.
41+
3442
## Concise current-system reading
3543

3644
Bitcode is active at V40.

BITCODE_SPEC_V41_PARITY_MATRIX.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
- Current canonical/latest target: `V40`
88
- Prior canonical anchor: `BITCODE_SPEC_V40.md`
99
- Prior generated proof appendix: `BITCODE_SPEC_V40_PROVEN.md`
10-
- Generated structured artifact inventory: draft `.bitcode/v41-spec-family-report.json`, draft `.bitcode/v41-canonical-input-report.json`, Gate 2 `.bitcode/v41-promptpart-prompt-inventory.json`, planned benchmark artifacts, planned promotion-readiness artifact, and eventual `BITCODE_SPEC_V41_PROVEN.md` after V41 promotion
11-
- Source parity state: Gate 1 closes spec, roadmap, docs, package script, workflow posture, and checker parity; Gate 2 closes source-safe prompt inventory parity; later gates own registry contracts, rewrite, benchmark, telemetry, and promotion parity
10+
- Generated structured artifact inventory: draft `.bitcode/v41-spec-family-report.json`, draft `.bitcode/v41-canonical-input-report.json`, Gate 2 `.bitcode/v41-promptpart-prompt-inventory.json`, Gate 3 `.bitcode/v41-registry-interpolation-contracts.json`, planned benchmark artifacts, planned promotion-readiness artifact, and eventual `BITCODE_SPEC_V41_PROVEN.md` after V41 promotion
11+
- Source parity state: Gate 1 closes spec, roadmap, docs, package script, workflow posture, and checker parity; Gate 2 closes source-safe prompt inventory parity; Gate 3 closes source-safe registry/interpolation contract parity; later gates own rewrite, benchmark, telemetry, and promotion parity
1212
- Scope: V41 draft parity ledger for Prompt and PromptPart excellence
1313
- Last fully realized canonical target preserved in source: `V40`
1414

@@ -35,7 +35,7 @@ This matrix records the prompt-program surfaces that must become promotion-grade
3535
| Gate workflow | Gate quality knows active V40 and draft V41 Gate 1 | `.github/workflows/bitcode-gate-quality.yml` | drafted |
3636
| Canon workflow | Canon quality knows active V40 and draft V41 Gate 1 | `.github/workflows/bitcode-canon-quality.yml` | drafted |
3737
| Prompt inventory | Every raw PromptPart and composed Prompt catalogued | `.bitcode/v41-promptpart-prompt-inventory.json` | implemented |
38-
| Registry/interpolation | Registry composition and interpolation contracts proven | planned V41 Gate 3 artifact | pending |
38+
| Registry/interpolation | Registry composition and interpolation contracts proven | `.bitcode/v41-registry-interpolation-contracts.json` | implemented |
3939
| Reading baselines | Reading prompt benchmarks captured before rewrites | planned V41 Gate 4 artifact | pending |
4040
| ReadNeed rewrite | ReadNeedComprehensionSynthesis prompts rewritten and type-hardened | planned V41 Gate 5 artifact | pending |
4141
| Finding Fits rewrite | ReadFitsFindingSynthesis prompts rewritten for search and AssetPack context | planned V41 Gate 6 artifact | pending |
@@ -49,7 +49,7 @@ This matrix records the prompt-program surfaces that must become promotion-grade
4949
| --- | --- | --- |
5050
| Gate 1 | Open V41 family, roadmap, docs, workflow posture, package script, and checker | closed |
5151
| Gate 2 | PromptPart and Prompt inventory artifact | implemented |
52-
| Gate 3 | Registry composition and interpolation artifact | pending |
52+
| Gate 3 | Registry composition and interpolation artifact | implemented |
5353
| Gate 4 | Reading prompt benchmark baseline artifact | pending |
5454
| Gate 5 | ReadNeedComprehensionSynthesis rewrite artifact | pending |
5555
| Gate 6 | ReadFitsFindingSynthesis rewrite artifact | pending |
@@ -67,6 +67,10 @@ V41 Gate 2 may catalogue PromptPart and Prompt metadata, hashes, registry owners
6767
It may not serialize raw prompt text, raw provider responses, protected source, secrets, or unpaid AssetPack source.
6868
It also may record the V42 MVP roadmap posture as forward planning while preserving V41 as the active prompt-program draft target.
6969

70+
V41 Gate 3 may catalogue registry ids, interpolation key ids, missing-key behavior ids, context-handling ids, tool prompt injection ids, execution ancestry frame ids, parser target ids, source hashes, and predicate verdicts.
71+
It may not serialize raw prompt text, raw provider responses, protected source, private context, credentials, settlement-private payloads, or unpaid AssetPack source.
72+
It closes prompt rewrites' precondition that prompt composition and interpolation contracts are observable before semantic PromptPart or Prompt rewrite work proceeds.
73+
7074
## V41 completion condition
7175

7276
V41 closes when prompt-program quality is fully specified, implemented, benchmarked, source-safe, tested, documented, generated, workflow-checked, and promotion-ready across Reading, Conversation, tool-definition, and interface inference surfaces.

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,19 @@ generated source-safe artifact `.bitcode/v41-promptpart-prompt-inventory.json`.
2424
The inventory currently covers 1,459 raw PromptPart rows and 105 composed Prompt
2525
rows across Reading, Conversation, tool-definition, interface, and benchmark
2626
surfaces, with `generate:v41-prompt-inventory`, `check:v41-prompt-inventory`,
27-
and `check:v41-gate2`. V42 is now roadmapped as the next MVP experience version:
28-
shortest-path Depositing, shortest-path Reading, and an AI-reading dominant
27+
and `check:v41-gate2`.
28+
V41 Gate 3 adds the package-backed `buildV41RegistryInterpolationContracts` and
29+
generated source-safe artifact `.bitcode/v41-registry-interpolation-contracts.json`.
30+
The contract currently covers 12 registry/interpolation rows and 65 source
31+
predicates for Prompt registry totality, PromptPart interpolation, PTRR
32+
agent/step composition, Failsafe and Thricified prompt resolution, execution
33+
ancestry overlays, tool doc-code prompt injection, Reading parser targets,
34+
Finding Fits search contracts, AssetPack synthesis/finishing parser targets,
35+
and Gate 2 inventory binding with `check:v41-gate3`.
36+
V42 is now roadmapped as the next MVP experience version: shortest-path
37+
Depositing with later BTC compensation, shortest-path Reading through
38+
Need review/resynthesis, Finding Fits, source-safe AssetPack preview,
39+
BTD/BTC settlement, repository delivery, and an AI-reading dominant
2940
demonstration whose AssetPack measurably improves an AI system beyond
3041
public-data-only performance.
3142

0 commit comments

Comments
 (0)