Skip to content

Commit 0955bab

Browse files
V32 Gate 3: Prove deterministic artifact replay
Add the deterministic replay artifact package, volatility inventory, source-safety failure probes, and exact regeneration checker for V32 Gate 3. Wire the gate-quality workflow and package scripts, widen the Gate 2 roadmap guard for later gates, and update the V32 specification family plus roadmap to track deterministic stable JSON replay. Validated with pnpm run check:v32-gate1, check:v32-gate2, check:v32-gate3, @bitcode/protocol tests, V32 spec family checks, canonical input checks, canon posture drift checks, artifact regeneration, and git diff --check.
1 parent 64a8e2d commit 0955bab

13 files changed

Lines changed: 891 additions & 13 deletions
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"acceptedVolatileFields": [
3+
{
4+
"artifactPath": ".bitcode/v32-proof-coverage-matrix.json",
5+
"classification": "context-bound",
6+
"fieldPath": "generatedAt",
7+
"normalizedValue": "2026-05-22T00:00:00.000Z",
8+
"reason": "V32 generated artifacts use a fixed replay context timestamp so byte equality remains meaningful."
9+
},
10+
{
11+
"artifactPath": ".bitcode/v32-artifact-volatility-inventory.json",
12+
"classification": "context-bound",
13+
"fieldPath": "generatedAt",
14+
"normalizedValue": "2026-05-22T00:00:00.000Z",
15+
"reason": "V32 generated artifacts use a fixed replay context timestamp so byte equality remains meaningful."
16+
},
17+
{
18+
"artifactPath": ".bitcode/v32-deterministic-replay-report.json",
19+
"classification": "context-bound",
20+
"fieldPath": "generatedAt",
21+
"normalizedValue": "2026-05-22T00:00:00.000Z",
22+
"reason": "V32 generated artifacts use a fixed replay context timestamp so byte equality remains meaningful."
23+
}
24+
],
25+
"artifactId": "v32-artifact-volatility-inventory",
26+
"blockingFindings": [],
27+
"classificationCounts": {
28+
"canonical-stable": 1,
29+
"context-bound": 4
30+
},
31+
"command": "pnpm run generate:v32-deterministic-replay-artifacts",
32+
"currentTarget": "V31",
33+
"findingCount": 5,
34+
"findings": [
35+
{
36+
"artifactPath": ".bitcode/v32-proof-coverage-matrix.json",
37+
"classification": "canonical-stable",
38+
"fieldPath": "$",
39+
"reason": "artifact bytes match stable sorted JSON serialization",
40+
"value": "stable-json-order"
41+
},
42+
{
43+
"artifactPath": ".bitcode/v32-proof-coverage-matrix.json",
44+
"classification": "context-bound",
45+
"fieldPath": "generatedAt",
46+
"reason": "generatedAt is fixed by V32 replay context",
47+
"value": "2026-05-22T00:00:00.000Z"
48+
},
49+
{
50+
"artifactPath": ".bitcode/v32-proof-coverage-matrix.json",
51+
"classification": "context-bound",
52+
"fieldPath": "generatedAt",
53+
"reason": "V32 generated artifacts use a fixed replay context timestamp so byte equality remains meaningful.",
54+
"value": "2026-05-22T00:00:00.000Z"
55+
},
56+
{
57+
"artifactPath": ".bitcode/v32-artifact-volatility-inventory.json",
58+
"classification": "context-bound",
59+
"fieldPath": "generatedAt",
60+
"reason": "V32 generated artifacts use a fixed replay context timestamp so byte equality remains meaningful.",
61+
"value": "2026-05-22T00:00:00.000Z"
62+
},
63+
{
64+
"artifactPath": ".bitcode/v32-deterministic-replay-report.json",
65+
"classification": "context-bound",
66+
"fieldPath": "generatedAt",
67+
"reason": "V32 generated artifacts use a fixed replay context timestamp so byte equality remains meaningful.",
68+
"value": "2026-05-22T00:00:00.000Z"
69+
}
70+
],
71+
"generatedArtifactPaths": [
72+
".bitcode/v32-proof-coverage-matrix.json",
73+
".bitcode/v32-artifact-volatility-inventory.json",
74+
".bitcode/v32-deterministic-replay-report.json"
75+
],
76+
"generatedAt": "2026-05-22T00:00:00.000Z",
77+
"passed": true,
78+
"scannedArtifactPaths": [
79+
".bitcode/v32-proof-coverage-matrix.json"
80+
],
81+
"schemaId": "bitcode.v32.artifactVolatilityInventory.v1",
82+
"sourceCommit": "draft-gate-3-source-derived",
83+
"sourceSafetyVerdict": "source-safe",
84+
"version": "V32"
85+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"allReplayArtifactsByteEqual": true,
3+
"artifactComparisons": [
4+
{
5+
"artifactPath": ".bitcode/v32-artifact-volatility-inventory.json",
6+
"byteEqual": true,
7+
"byteLength": 3276,
8+
"firstDigest": "sha256:d31f4689ff0f08afa8044dbb394e117adb9f9a74ee6e78c3c4ae31c24624f278",
9+
"secondDigest": "sha256:d31f4689ff0f08afa8044dbb394e117adb9f9a74ee6e78c3c4ae31c24624f278"
10+
},
11+
{
12+
"artifactPath": ".bitcode/v32-proof-coverage-matrix.json",
13+
"byteEqual": true,
14+
"byteLength": 19340,
15+
"firstDigest": "sha256:dad4dd6b12ed1c45b703ba88bffa589981d722e51bb298f52aec84ed16c4a4c8",
16+
"secondDigest": "sha256:dad4dd6b12ed1c45b703ba88bffa589981d722e51bb298f52aec84ed16c4a4c8"
17+
}
18+
],
19+
"artifactId": "v32-deterministic-replay-report",
20+
"command": "pnpm run generate:v32-deterministic-replay-artifacts",
21+
"currentTarget": "V31",
22+
"failureModeCoverage": [
23+
"missing-path",
24+
"stale-source-commit",
25+
"malformed-schema",
26+
"source-safety-violation",
27+
"unstable-json-order"
28+
],
29+
"generatedArtifactPaths": [
30+
".bitcode/v32-proof-coverage-matrix.json",
31+
".bitcode/v32-artifact-volatility-inventory.json",
32+
".bitcode/v32-deterministic-replay-report.json"
33+
],
34+
"generatedAt": "2026-05-22T00:00:00.000Z",
35+
"passed": true,
36+
"replayCommands": [
37+
"pnpm run generate:v32-proof-coverage-matrix",
38+
"pnpm run generate:v32-deterministic-replay-artifacts"
39+
],
40+
"replaySourceArtifacts": [
41+
".bitcode/v32-proof-coverage-matrix.json"
42+
],
43+
"runCount": 2,
44+
"schemaId": "bitcode.v32.deterministicReplayReport.v1",
45+
"sourceCommit": "draft-gate-3-source-derived",
46+
"sourceSafetyVerdict": "source-safe",
47+
"version": "V32",
48+
"volatilityBlockingFindingCount": 0,
49+
"volatilityInventoryArtifact": ".bitcode/v32-artifact-volatility-inventory.json"
50+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ jobs:
113113
node scripts/check-v31-gate10-promotion-readiness.mjs --promotion-mode --skip-branch-check
114114
node scripts/check-v32-gate1-provation-roadmap-opening.mjs --skip-branch-check
115115
node scripts/check-v32-gate2-proof-matrix-inventory.mjs --skip-branch-check
116+
node scripts/check-v32-gate3-deterministic-replay-artifact-stability.mjs --skip-branch-check
116117
else
117118
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
118119
exit 1

BITCODE_SPEC_V32.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Canonical proof-source commit: none until V32 promotion
99
- Prior canonical anchor: `BITCODE_SPEC_V31.md`
1010
- Prior generated proof appendix: `BITCODE_SPEC_V31_PROVEN.md`
11-
- Generated structured artifact inventory: planned draft `.bitcode/v32-spec-family-report.json`, `.bitcode/v32-canonical-input-report.json`, `.bitcode/v32-canon-posture-drift-report.json`, generated Gate 2 `.bitcode/v32-proof-coverage-matrix.json`, later V32 proof/test coverage artifacts, V32 gate-quality and promotion workflow evidence, and `BITCODE_SPEC_V32_PROVEN.md` only after promotion
11+
- Generated structured artifact inventory: planned draft `.bitcode/v32-spec-family-report.json`, `.bitcode/v32-canonical-input-report.json`, `.bitcode/v32-canon-posture-drift-report.json`, generated Gate 2 `.bitcode/v32-proof-coverage-matrix.json`, generated Gate 3 `.bitcode/v32-artifact-volatility-inventory.json` and `.bitcode/v32-deterministic-replay-report.json`, later V32 proof/test coverage artifacts, V32 gate-quality and promotion workflow evidence, and `BITCODE_SPEC_V32_PROVEN.md` only after promotion
1212
- Source parity state: V32 source-side proof-family replay, deterministic artifact generation, scenario matrices, cross-surface regression coverage, browser/accessibility/visual evidence, testnet/mainnet-readiness rehearsal, and promotion-proof hardening are opened but not yet closed
1313
- State: draft target opened
1414
- Active canonical pointer during draft opening: `BITCODE_SPEC.txt` -> `V31`
@@ -243,6 +243,13 @@ Gate 3 deterministic replay precision:
243243
- volatile fields must be explicitly cataloged and normalized before equality checks;
244244
- stale artifact checks must identify missing path, stale source commit, malformed schema, or source-safety violation separately.
245245

246+
Gate 3 closes the first V32 deterministic replay package with `.bitcode/v32-artifact-volatility-inventory.json` and `.bitcode/v32-deterministic-replay-report.json`.
247+
Those artifacts are generated by `pnpm run generate:v32-deterministic-replay-artifacts` and checked by `pnpm run check:v32-gate3`.
248+
The Gate 3 replay package regenerates `.bitcode/v32-proof-coverage-matrix.json`, compares two deterministic in-memory runs, records byte-level digest equality for generated proof artifacts, and requires stable JSON ordering for every generated artifact.
249+
The volatility inventory classifies accepted `generatedAt` fields as context-bound using a fixed replay timestamp and fails closed when unaccepted random, nonce, UUID, timestamp, `createdAt`, or `updatedAt` fields appear.
250+
The Gate 3 checker proves fail-closed behavior for `missing-path`, `stale-source-commit`, `malformed-schema`, `source-safety-violation`, and `unstable-json-order` cases.
251+
No Gate 3 generated artifact may contain provider tokens, service keys, database passwords, OpenAI keys, Vercel tokens, Supabase service-role material, protected AssetPack source, private prompts, or pre-settlement AssetPack source.
252+
246253
Gate 4 Reading pipeline proof precision:
247254

248255
- `ReadNeedComprehensionSynthesis` coverage names phases, PTRR agents, PTRR steps, ThricifiedGenerations, prompt templates, prompt parts, tool calls, typed outputs, telemetry, and storage records;
@@ -834,6 +841,8 @@ V32 continues operator-quality proof: Terminal workflow claims must be backed by
834841
| `.bitcode/v32-canonical-input-report.json` | yes | yes | records canonical input closure for active V31 plus V32 draft |
835842
| `.bitcode/v32-canon-posture-drift-report.json` | gate-dependent | yes | proves runtime/docs active/draft posture |
836843
| `.bitcode/v32-proof-coverage-matrix.json` | yes | yes | records source-safe V32 proof/test coverage inventory across promoted surfaces |
844+
| `.bitcode/v32-artifact-volatility-inventory.json` | yes | yes | records V32 accepted volatile fields, stable ordering findings, source-safety verdict, and blocking volatility count |
845+
| `.bitcode/v32-deterministic-replay-report.json` | yes | yes | records V32 deterministic replay byte comparisons and fail-closed artifact stability failure modes |
837846
| `BITCODE_SPEC_V32_PROVEN.md` | no | yes | generated proof appendix for promoted V32 |
838847

839848
### V32 specifying generated artifacts

BITCODE_SPEC_V32_DELTA.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Canonical proof-source commit: none until V32 promotion
99
- Prior canonical anchor: `BITCODE_SPEC_V31.md`
1010
- Prior generated proof appendix: `BITCODE_SPEC_V31_PROVEN.md`
11-
- Generated structured artifact inventory: planned draft `.bitcode/v32-spec-family-report.json`, `.bitcode/v32-canonical-input-report.json`, `.bitcode/v32-canon-posture-drift-report.json`, generated Gate 2 `.bitcode/v32-proof-coverage-matrix.json`, later V32 proof/test coverage artifacts, V32 gate-quality and promotion workflow evidence, and `BITCODE_SPEC_V32_PROVEN.md` only after promotion
11+
- Generated structured artifact inventory: planned draft `.bitcode/v32-spec-family-report.json`, `.bitcode/v32-canonical-input-report.json`, `.bitcode/v32-canon-posture-drift-report.json`, generated Gate 2 `.bitcode/v32-proof-coverage-matrix.json`, generated Gate 3 `.bitcode/v32-artifact-volatility-inventory.json` and `.bitcode/v32-deterministic-replay-report.json`, later V32 proof/test coverage artifacts, V32 gate-quality and promotion workflow evidence, and `BITCODE_SPEC_V32_PROVEN.md` only after promotion
1212
- Source parity state: V32 source-side proof-family replay, deterministic artifacts, test matrices, cross-surface regression, browser/accessibility/visual proof, testnet/mainnet-readiness rehearsal, and promotion-proof hardening are opened but not yet closed
1313
- State: draft target delta opened
1414
- Active canonical pointer during draft opening: `BITCODE_SPEC.txt` -> `V31`
@@ -108,6 +108,10 @@ Closure acceptance:
108108
- generated JSON artifacts have stable ordering, source-safe payloads, and no volatile fields outside explicit volatility inventories;
109109
- promotion proof generation fails closed on missing, stale, or malformed artifacts.
110110

111+
Gate 3 source closure is `.bitcode/v32-artifact-volatility-inventory.json` plus `.bitcode/v32-deterministic-replay-report.json`, generated by `pnpm run generate:v32-deterministic-replay-artifacts` and checked by `pnpm run check:v32-gate3`.
112+
The replay report compares byte digests across two deterministic generated-artifact runs and the volatility inventory records the accepted context-bound `generatedAt` field for every V32 replay artifact.
113+
The checker must fail closed for `missing-path`, `stale-source-commit`, `malformed-schema`, `source-safety-violation`, and `unstable-json-order`, separating those failures so promotion diagnostics are repairable.
114+
111115
### Gate 4: Reading Pipeline Proof Coverage
112116

113117
Gate 4 deepens proof over `ReadNeedComprehensionSynthesis` and `ReadFitsFindingSynthesis`.

BITCODE_SPEC_V32_NOTES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Current active draft target: `V32`
99
- Prior canonical anchor: `BITCODE_SPEC_V31.md`
1010
- Prior generated proof appendix: `BITCODE_SPEC_V31_PROVEN.md`
11-
- Generated structured artifact inventory: planned `.bitcode/v32-spec-family-report.json`, `.bitcode/v32-canonical-input-report.json`, `.bitcode/v32-canon-posture-drift-report.json`, generated Gate 2 `.bitcode/v32-proof-coverage-matrix.json`, later V32 proof/test coverage artifacts, and `BITCODE_SPEC_V32_PROVEN.md` only at promotion
11+
- Generated structured artifact inventory: planned `.bitcode/v32-spec-family-report.json`, `.bitcode/v32-canonical-input-report.json`, `.bitcode/v32-canon-posture-drift-report.json`, generated Gate 2 `.bitcode/v32-proof-coverage-matrix.json`, generated Gate 3 `.bitcode/v32-artifact-volatility-inventory.json` and `.bitcode/v32-deterministic-replay-report.json`, later V32 proof/test coverage artifacts, and `BITCODE_SPEC_V32_PROVEN.md` only at promotion
1212
- Source parity state: V32 proof/test parity begins with Gate 1 and closes only through gate-specific implementation, tests, documentation, and workflow evidence
1313
- Scope: deeper provation and testing over promoted Terminal, Reading, Protocol/BTD, Auxillaries, MCP, ChatGPT App, API, ledger/database/object-storage, and protocol-demonstration surfaces.
1414

@@ -61,6 +61,9 @@ Harden generated artifact repeatability:
6161
- stable JSON ordering and source-safe payloads;
6262
- volatility inventories for accepted variable fields;
6363
- fail-closed checks for stale, missing, malformed, or non-regenerable artifacts.
64+
- generated artifacts `.bitcode/v32-artifact-volatility-inventory.json` and `.bitcode/v32-deterministic-replay-report.json`;
65+
- generator command `pnpm run generate:v32-deterministic-replay-artifacts` and closure checker `pnpm run check:v32-gate3`;
66+
- required failure modes `missing-path`, `stale-source-commit`, `malformed-schema`, `source-safety-violation`, and `unstable-json-order`.
6467

6568
### Gate 4: Reading Pipeline Proof Coverage
6669

0 commit comments

Comments
 (0)