Skip to content

Commit fdadacd

Browse files
Merge pull request #108 from engineeredsoftware/v36/gate-9-local-staging-exchange-rehearsal
V36 Gate 9: Local Staging Exchange Rehearsal Proof
2 parents 242b018 + bb39c8d commit fdadacd

18 files changed

Lines changed: 2509 additions & 24 deletions

.bitcode/v36-exchange-rehearsal.json

Lines changed: 1430 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
@@ -94,6 +94,9 @@ jobs:
9494
if [ -f scripts/check-v36-gate8-exchange-ux-proof.mjs ]; then
9595
node scripts/check-v36-gate8-exchange-ux-proof.mjs --skip-branch-check
9696
fi
97+
if [ -f scripts/check-v36-gate9-exchange-rehearsal.mjs ]; then
98+
node scripts/check-v36-gate9-exchange-rehearsal.mjs --skip-branch-check
99+
fi
97100
fi
98101
else
99102
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

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

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ jobs:
222222
if [ -f scripts/check-v36-gate8-exchange-ux-proof.mjs ]; then
223223
node scripts/check-v36-gate8-exchange-ux-proof.mjs --skip-branch-check
224224
fi
225+
if [ -f scripts/check-v36-gate9-exchange-rehearsal.mjs ]; then
226+
node scripts/check-v36-gate9-exchange-rehearsal.mjs --skip-branch-check
227+
fi
225228
fi
226229
else
227230
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
@@ -246,27 +249,27 @@ jobs:
246249
- name: Test gate packages
247250
run: |
248251
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runInBand --forceExit
249-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/btc-fee-operation.test.ts
250-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/btd.test.ts
251-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/v32-ledger-btd-settlement-failure-states.test.ts
252-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/v32-interface-contract-regression.test.ts
253-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/interface-contract-catalog.test.ts
254-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/mcp-tool-contract.test.ts
255-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/chatgpt-app-action-contract.test.ts
256-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/interface-authorization-policy.test.ts
257-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/read-license-assetpack-rights-contract.test.ts
258-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/api-schema-compatibility-matrix.test.ts
259-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/interface-telemetry-proof-hook.test.ts
260-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/interface-consumer-ux-regression-proof.test.ts
261-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/deployment-host-capability-catalog.test.ts
262-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/deployment-storage-posture.test.ts
263-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/secret-rotation-plan.test.ts
264-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/migration-approval-gate.test.ts
265-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/runtime-observer-repair-job.test.ts
266-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/rollback-upgrade-repair-playbook.test.ts
267-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/deployment-readiness-rehearsal.test.ts
268-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/deployment-promotion-readiness-report.test.ts
269-
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/v32-testnet-mainnet-readiness-rehearsal.test.ts
252+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/btc-fee-operation.test.ts --runInBand --forceExit
253+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/btd.test.ts --runInBand --forceExit
254+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/v32-ledger-btd-settlement-failure-states.test.ts --runInBand --forceExit
255+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/v32-interface-contract-regression.test.ts --runInBand --forceExit
256+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/interface-contract-catalog.test.ts --runInBand --forceExit
257+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/mcp-tool-contract.test.ts --runInBand --forceExit
258+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/chatgpt-app-action-contract.test.ts --runInBand --forceExit
259+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/interface-authorization-policy.test.ts --runInBand --forceExit
260+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/read-license-assetpack-rights-contract.test.ts --runInBand --forceExit
261+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/api-schema-compatibility-matrix.test.ts --runInBand --forceExit
262+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/interface-telemetry-proof-hook.test.ts --runInBand --forceExit
263+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/interface-consumer-ux-regression-proof.test.ts --runInBand --forceExit
264+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/deployment-host-capability-catalog.test.ts --runInBand --forceExit
265+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/deployment-storage-posture.test.ts --runInBand --forceExit
266+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/secret-rotation-plan.test.ts --runInBand --forceExit
267+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/migration-approval-gate.test.ts --runInBand --forceExit
268+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/runtime-observer-repair-job.test.ts --runInBand --forceExit
269+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/rollback-upgrade-repair-playbook.test.ts --runInBand --forceExit
270+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/deployment-readiness-rehearsal.test.ts --runInBand --forceExit
271+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/deployment-promotion-readiness-report.test.ts --runInBand --forceExit
272+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runTestsByPath __tests__/v32-testnet-mainnet-readiness-rehearsal.test.ts --runInBand --forceExit
270273
pnpm --dir packages/protocol exec node --test --test-force-exit test/v32-promotion-proof-generation.test.js
271274
pnpm --dir packages/protocol exec node --test --test-force-exit test/v35-documentation-surface-catalog.test.js
272275
pnpm --dir packages/protocol exec node --test --test-force-exit test/v35-telemetry-taxonomy-catalog.test.js
@@ -284,6 +287,7 @@ jobs:
284287
pnpm --dir packages/protocol exec node --test --test-force-exit test/v36-exchange-settlement-reconciliation.test.js
285288
pnpm --dir packages/protocol exec node --test --test-force-exit test/v36-exchange-dispute-repair-revenue-route.test.js
286289
pnpm --dir packages/protocol exec node --test --test-force-exit test/v36-exchange-ux-proof.test.js
290+
pnpm --dir packages/protocol exec node --test --test-force-exit test/v36-exchange-rehearsal.test.js
287291
pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/routes/__tests__/btd-crypto.test.ts --runInBand
288292
pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/routes/__tests__/auxillaries-contract.test.ts --runInBand
289293
pnpm --dir packages/executions-mcp/src/mcp-server run test:mcp -- --runTestsByPath src/__tests__/unit/auth.test.ts --runInBand

BITCODE_SPEC_V36.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,25 @@ protected source, unpaid AssetPack source, wallet private material, provider
225225
tokens, protected prompts, protected model responses, buyer private repository
226226
payloads, or secret values.
227227

228+
## V36 Gate 9 ExchangeRehearsal canon
229+
230+
Gate 9 implements `ExchangeRehearsal` as the package-owned contract binding
231+
local and staging-testnet Exchange rehearsals to generated proof.
232+
233+
`ExchangeRehearsal` proves that local and staging-testnet rehearsals exercise list, bid, ask, cancel, accept, settle, repair, and history flows.
234+
It proves that rehearsal logs/screenshots are source-safe.
235+
It also proves that ledger/database synchronization and value-bearing mainnet blocking are visible.
236+
237+
Gate 9 emits `.bitcode/v36-exchange-rehearsal.json` with
238+
`source-safe-exchange-rehearsal-metadata`.
239+
The artifact may expose rehearsal ids, lane ids, flow ids, event ids, proof
240+
roots, ledger/database synchronization checks, validation commands, redacted
241+
log/screenshot roots, source evidence, and summary counts; it must not expose
242+
protected source, unpaid AssetPack source, wallet private material, private
243+
payment credentials, object-storage private bytes, provider tokens, protected
244+
prompts, protected model responses, buyer private repository payloads, or secret
245+
values.
246+
228247
## Canonical Bitcode executive summary
229248

230249
Bitcode measures technical knowledge, finds deposits that fit reviewed Reads, synthesizes source-bearing AssetPacks, and settles read rights in BTC with BTD range and rights receipts.

BITCODE_SPEC_V36_DELTA.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,12 @@ Gate 9 proves Exchange locally and in staging-testnet.
161161

162162
Closure acceptance:
163163

164+
- `ExchangeRehearsal` is package-owned by `@bitcode/protocol`;
164165
- local and staging-testnet rehearsals exercise list, bid, ask, cancel, accept, settle, repair, and history flows;
165166
- rehearsal logs/screenshots are source-safe;
166-
- ledger/database synchronization and value-bearing mainnet blocking are visible.
167+
- ledger/database synchronization and value-bearing mainnet blocking are visible;
168+
- `.bitcode/v36-exchange-rehearsal.json` is generated from the package-owned `ExchangeRehearsal` builder with `source-safe-exchange-rehearsal-metadata`;
169+
- `pnpm run check:v36-gate9` validates package source, artifact freshness, package tests, docs, workflow wiring, local lane flow coverage, staging-testnet lane flow coverage, source-safe logs/screenshots, ledger/database synchronization checks, proof roots, and blocked value-bearing mainnet posture.
167170

168171
### Gate 10: V36 Promotion Readiness
169172

BITCODE_SPEC_V36_NOTES.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,22 @@ not protected source, unpaid AssetPack source, wallet private material, provider
169169
tokens, protected prompts, protected model responses, buyer private repository
170170
payloads, or secret values.
171171

172+
## Gate 9 closure notes
173+
174+
Gate 9 closes when `ExchangeRehearsal` is package-owned and generated through
175+
`.bitcode/v36-exchange-rehearsal.json`.
176+
The generated artifact carries `source-safe-exchange-rehearsal-metadata`.
177+
`ExchangeRehearsal` proves that local and staging-testnet rehearsals exercise list, bid, ask, cancel, accept, settle, repair, and history flows.
178+
It proves that rehearsal logs/screenshots are source-safe.
179+
It also proves that ledger/database synchronization and value-bearing mainnet blocking are visible.
180+
Exchange rehearsal artifacts remain source-safe: they expose rehearsal ids,
181+
lane ids, flow ids, event ids, proof roots, ledger/database synchronization
182+
checks, validation commands, redacted log/screenshot roots, source evidence,
183+
and summary counts, not protected source, unpaid AssetPack source, wallet
184+
private material, private payment credentials, object-storage private bytes,
185+
provider tokens, protected prompts, protected model responses, buyer private
186+
repository payloads, or secret values.
187+
172188
## Accepted boundaries
173189

174190
- V36 owns deeper Exchange.

BITCODE_SPEC_V36_PARITY_MATRIX.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ No `_legacy/` source is active source truth.
6161
| Settlement reconciliation | Gate 6 | `ExchangeSettlementReceipt`, `.bitcode/v36-exchange-settlement-reconciliation.json`, observers, repair tests, and `check:v36-gate6` | closed | Payment observation, finality state, rights-transfer receipt, ledger root, database projection root, object storage root, delivery state, repair id, observer jobs, and repair jobs reconcile. |
6262
| Dispute repair revenue routes | Gate 7 | `ExchangeDisputeRepairCase`, `ExchangeRevenueRoute`, `.bitcode/v36-exchange-dispute-repair-revenue-route.json`, tests, and `check:v36-gate7` | closed | Disputes, repairs, revenue routes, conservation proofs, runbooks, and escalation paths exist. |
6363
| Exchange UX and Terminal integration | Gate 8 | `ExchangeUxProof`, `/exchange`, Terminal handoff, public docs, telemetry dashboards, `.bitcode/v36-exchange-ux-proof.json`, tests, and `check:v36-gate8` | closed | Master-detail UX, filters, order history, rights-transfer review, pricing quote, settlement state, repair state, Terminal navigation, collapsed status, and source-safe expanded detail are validated. |
64-
| Local staging rehearsal | Gate 9 | `.bitcode/v36-exchange-rehearsal.json`, local/staging logs, proof roots, and `check:v36-gate9` | draft-required | Local and staging-testnet list/bid/ask/cancel/accept/settle/repair/history flows are rehearsed. |
64+
| Local staging rehearsal | Gate 9 | `.bitcode/v36-exchange-rehearsal.json`, local/staging logs, proof roots, and `check:v36-gate9` | closed | Local and staging-testnet list/bid/ask/cancel/accept/settle/repair/history flows are rehearsed. |
6565
| Promotion readiness | Gate 10 | `.bitcode/v36-promotion-readiness-report.json`, promotion workflow, generated proof support, and `check:v36-gate10` | draft-required | V36 can promote only after all Exchange gates pass and generated canon remains source-safe. |
6666

6767
## V36 implementation checklist
@@ -185,6 +185,17 @@ No `_legacy/` source is active source truth.
185185
| Telemetry binding is source-safe | `source-safe-exchange-ux-proof-metadata`; Exchange telemetry dashboards remain source-safe and proof-rooted | closed |
186186
| Workflow, package, and UI tests are wired | `packages/protocol/test/v36-exchange-ux-proof.test.js`, `uapi/tests/exchangePageClient.test.tsx`, `uapi/tests/exchangeTerminalHandoff.test.ts`, `scripts/check-v36-gate8-exchange-ux-proof.mjs`, `.github/workflows/bitcode-gate-quality.yml` | closed |
187187

188+
## Gate 9 Parity
189+
190+
| Requirement | Source evidence | Current V36 judgment |
191+
| --- | --- | --- |
192+
| `ExchangeRehearsal` is package-owned | `packages/protocol/src/canonical/exchange-rehearsal.js`, `packages/protocol/src/index.js`, `packages/protocol/src/index.d.ts` | closed |
193+
| Generated Exchange rehearsal artifact exists | `.bitcode/v36-exchange-rehearsal.json`, `scripts/generate-v36-exchange-rehearsal.mjs`, `pnpm run check:v36-exchange-rehearsal` | closed |
194+
| Local and staging-testnet flows are complete | local and staging-testnet rehearsals exercise list, bid, ask, cancel, accept, settle, repair, and history flows | closed |
195+
| Rehearsal evidence is source-safe | rehearsal logs/screenshots are source-safe through redacted screenshot/log roots and `source-safe-exchange-rehearsal-metadata` | closed |
196+
| Ledger/database synchronization is visible | ledger/database synchronization and value-bearing mainnet blocking are visible through sync checks, projection roots, and blocked mainnet row posture | closed |
197+
| Workflow and package tests are wired | `packages/protocol/test/v36-exchange-rehearsal.test.js`, `scripts/check-v36-gate9-exchange-rehearsal.mjs`, `.github/workflows/bitcode-gate-quality.yml`, `.github/workflows/bitcode-canon-quality.yml` | closed |
198+
188199
## V36 accepted boundaries
189200

190201
- V36 owns deeper Exchange.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ Terminal can hand off to Exchange without losing transaction context.
6363
collapsed UI gives readable status and expanded UI exposes source-safe detail.
6464
Exchange telemetry dashboards remain source-safe and proof-rooted.
6565
The source-safe verdict is `source-safe-exchange-ux-proof-metadata`.
66+
V36 Gate 9 anchors Exchange rehearsal through package-owned
67+
`ExchangeRehearsal` and the source-safe generated artifact
68+
`.bitcode/v36-exchange-rehearsal.json`.
69+
`ExchangeRehearsal` proves that local and staging-testnet rehearsals exercise list, bid, ask, cancel, accept, settle, repair, and history flows.
70+
It proves that rehearsal logs/screenshots are source-safe.
71+
It also proves that ledger/database synchronization and value-bearing mainnet blocking are visible.
72+
The source-safe verdict is `source-safe-exchange-rehearsal-metadata`.
6673
Promoted V35 closure owns telemetry and documentation depth over promoted V34:
6774
internal codebase docs, public `/docs`, telemetry taxonomy, dashboards, alert
6875
runbooks, incident response, operator escalation, documentation QA, developer

0 commit comments

Comments
 (0)