Skip to content

Commit 5f94d52

Browse files
V40 Gate 9: Local Staging Rehearsal Automation
Add source-safe local and staging-testnet operator rehearsal automation with dry-run receipts, explicit live execution opt-in, lane-bound secret-family checks, and Vercel Sandbox harness delegation. Generate the V40 Gate 9 protocol artifact, export and test it, wire the checker into gate/canon quality workflows, and update V40 spec, roadmap, README, and protocol docs. Validated with check:v40-gate9, protocol tests/typecheck, V40 gate smoke checks, dry-run receipts, syntax checks, and diff hygiene.
1 parent d96db0d commit 5f94d52

18 files changed

Lines changed: 1814 additions & 5 deletions

.bitcode/v40-local-staging-rehearsal-automation.json

Lines changed: 616 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
@@ -244,6 +244,9 @@ jobs:
244244
if [ -f scripts/check-v40-gate8-ledger-storage-sync.mjs ]; then
245245
node scripts/check-v40-gate8-ledger-storage-sync.mjs --skip-branch-check --skip-integration-tests
246246
fi
247+
if [ -f scripts/check-v40-gate9-local-staging-rehearsal-automation.mjs ]; then
248+
node scripts/check-v40-gate9-local-staging-rehearsal-automation.mjs --skip-branch-check --skip-package-tests
249+
fi
247250
fi
248251
else
249252
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,9 @@ jobs:
373373
if [ -f scripts/check-v40-gate8-ledger-storage-sync.mjs ]; then
374374
node scripts/check-v40-gate8-ledger-storage-sync.mjs --skip-branch-check --skip-integration-tests
375375
fi
376+
if [ -f scripts/check-v40-gate9-local-staging-rehearsal-automation.mjs ]; then
377+
node scripts/check-v40-gate9-local-staging-rehearsal-automation.mjs --skip-branch-check --skip-package-tests
378+
fi
376379
fi
377380
else
378381
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
@@ -502,6 +505,9 @@ jobs:
502505
if [ -f packages/protocol/test/v40-ledger-storage-sync.test.js ]; then
503506
pnpm --dir packages/protocol exec node --test --test-force-exit test/v40-ledger-storage-sync.test.js
504507
fi
508+
if [ -f packages/protocol/test/v40-local-staging-rehearsal-automation.test.js ]; then
509+
pnpm --dir packages/protocol exec node --test --test-force-exit test/v40-local-staging-rehearsal-automation.test.js
510+
fi
505511
pnpm --filter @bitcode/protocol test
506512
507513
- name: Test staged Reading route and Terminal harness contracts

BITCODE_SPEC_V40.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ The app-owned `BITCODE_LEDGER_STORAGE_SYNC_CONTRACT` covers settlement source-to
152152
The focused proof test suite exercises the existing `AssetPackSettlementRightsDeliveryBoundary`, BTD wallet and reconciliation primitives, Terminal wallet/journal/detail readbacks, and the app contract without serializing protected source, unpaid AssetPack source, wallet private material, raw prompts, provider responses, or private settlement payloads.
153153
Gate 8 permits no missing, blocked, or lane-skipped critical synchronization row; source-bearing pull-request delivery remains withheld until payment observation, confirmed finality, source-to-shares conservation, BTD rights transfer, and ledger/database/object-storage reconciliation all agree.
154154

155+
## V40 Gate 9 Local And Staging-Testnet Rehearsal Automation
156+
157+
Gate 9 closes local and staging-testnet rehearsal automation for the source-safe operator path that proves the test system can be replayed without tracked credentials.
158+
The package-owned `V40LocalStagingRehearsalAutomation` emits `.bitcode/v40-local-staging-rehearsal-automation.json` with ten source-safe rows: local operator rehearsal, staging-testnet real-inference rehearsal, lane-bound secret-family checks, source-safe operator receipts, Vercel Sandbox harness runner, database stream and route readback, five-stage Reading pipeline rehearsal, ledger/storage/wallet/delivery rehearsal continuity, value-bearing mainnet blocking, and proof-system wiring.
159+
The operator command `rehearse:v40-local-staging` builds local or staging-testnet receipts from environment presence only, writes receipts under ignored harness-run roots when requested, and requires explicit live execution opt-in before delegating to the Vercel Sandbox AssetPack harness.
160+
Staging-testnet automation binds the Supabase project `tkpyosihuouusyaxtbau`, the REST host `https://tkpyosihuouusyaxtbau.supabase.co/rest/v1/`, real inference, database event streaming, and structured readback while serializing no secret values, protected source, raw prompts, provider responses, unpaid AssetPack source, wallet private material, private settlement payloads, or live log payloads.
161+
Gate 9 permits no missing critical rehearsal automation row and keeps value-bearing mainnet admission blocked.
162+
155163
## V40 canonical subsystem surfaces
156164

157165
### Depositing and asset supply
@@ -416,12 +424,14 @@ V40 inherits operator-quality artifact expectations for readable proof and repai
416424
| `.bitcode/v40-reading-pipeline-integration-coverage.json` | protocol canonical package | Gate 5 source-safe Reading pipeline integration coverage |
417425
| `.bitcode/v40-conversation-terminal-integration.json` | protocol canonical package | Gate 6 source-safe Conversation/Terminal integration coverage |
418426
| `.bitcode/v40-browser-e2e-visual-proof.json` | protocol canonical package | Gate 7 source-safe browser, visual, accessibility, and responsive proof |
427+
| `.bitcode/v40-ledger-storage-sync.json` | protocol canonical package | Gate 8 source-safe ledger, database, storage, wallet, and delivery synchronization proof |
428+
| `.bitcode/v40-local-staging-rehearsal-automation.json` | protocol canonical package | Gate 9 source-safe local and staging-testnet rehearsal automation proof |
419429
| `.bitcode/v40-promotion-readiness-report.json` | future V40 promotion gate | promotion readiness |
420430

421431
### V40 specifying generated artifacts
422432

423433
V40 generated artifacts begin with `.bitcode/v40-spec-family-report.json` and `.bitcode/v40-canonical-input-report.json`.
424-
Later gates add disclosure, synchronization, prompt benchmark smoke, rehearsal, and promotion-readiness artifacts.
434+
Closed gates now add unit, API, pipeline, Conversation/Terminal, browser, synchronization, and local/staging rehearsal artifacts; later gates add prompt benchmark smoke and promotion-readiness artifacts.
425435

426436
### Shared generated-artifact fields
427437

@@ -447,7 +457,7 @@ Missing generated artifacts, stale reports, malformed JSON, invalid screenshots,
447457

448458
## V40 validation canon
449459

450-
Validation canon includes `pnpm run check:v40-gate1`, `pnpm run check:v40-gate2`, `pnpm run check:v40-gate3`, `pnpm run check:v40-gate4`, `pnpm run check:v40-gate5`, `pnpm run check:v40-gate6`, `pnpm run check:v40-gate7`, `pnpm run check:v40-browser-e2e-visual-proof`, `node scripts/check-bitcode-spec-family.mjs --version V40 --mode draft --current-target V39`, `node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V39 --draft-target V40`, package typechecks, protocol tests, route/API tests, browser E2E suites, visual/screenshot proof suites, integration suites, unit suites, prompt benchmark smoke tests, local/staging rehearsal commands, and diff hygiene.
460+
Validation canon includes `pnpm run check:v40-gate1`, `pnpm run check:v40-gate2`, `pnpm run check:v40-gate3`, `pnpm run check:v40-gate4`, `pnpm run check:v40-gate5`, `pnpm run check:v40-gate6`, `pnpm run check:v40-gate7`, `pnpm run check:v40-gate8`, `pnpm run check:v40-gate9`, `pnpm run check:v40-browser-e2e-visual-proof`, `pnpm run rehearse:v40-local-staging --lane local --dry-run --json`, `pnpm run rehearse:v40-local-staging --lane staging-testnet --dry-run --json`, `node scripts/check-bitcode-spec-family.mjs --version V40 --mode draft --current-target V39`, `node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V39 --draft-target V40`, package typechecks, protocol tests, route/API tests, browser E2E suites, visual/screenshot proof suites, integration suites, unit suites, prompt benchmark smoke tests, local/staging rehearsal commands, and diff hygiene.
451461

452462
## V40 promotion canon
453463

BITCODE_SPEC_V40_DELTA.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Gate 8 closes with package-backed `V40LedgerStorageSync`, deterministic `.bitcod
6868
### Gate 9: Local And Staging-Testnet Rehearsal Automation
6969

7070
Close local/staging rehearsal scripts with lane-bound secrets, no tracked credentials, and reproducible operator receipts.
71+
Gate 9 closes with package-backed `V40LocalStagingRehearsalAutomation`, deterministic `.bitcode/v40-local-staging-rehearsal-automation.json`, source-safe operator dry-run receipts for local and staging-testnet lanes, explicit live-execution opt-in, staging-testnet Supabase project binding, real-inference and database-stream readback checks, workflow wiring, and `check:v40-gate9`.
7172

7273
### Gate 10: Prompt Benchmark Smoke And V41 Readiness
7374

BITCODE_SPEC_V40_NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,11 @@ Its generated `.bitcode/v40-ledger-storage-sync.json` artifact binds ledger, dat
114114
The app-owned `BITCODE_LEDGER_STORAGE_SYNC_CONTRACT` summarizes settlement source-to-shares, no-custody wallet authority, and post-settlement pull-request delivery surfaces with explicit delivery visibility boundaries.
115115
The focused tests prove the existing AssetPack settlement delivery boundary, BTD BTC fee/wallet/reconciliation/source-to-shares primitives, Terminal wallet/journal/detail readbacks, and source-safe UAPI contract.
116116
No missing, blocked, or lane-skipped critical synchronization row is allowed in the Gate 8 artifact; source-bearing delivery stays locked until payment, finality, compensation, BTD rights, and projection reconciliation agree.
117+
118+
## Gate 9 implementation notes
119+
120+
Gate 9 is closed by `V40LocalStagingRehearsalAutomation`.
121+
Its generated `.bitcode/v40-local-staging-rehearsal-automation.json` artifact binds local and staging-testnet rehearsal automation to ten source-safe rows covering operator lane receipts, lane-bound secret-family checks, Vercel Sandbox harness execution, database stream/readback, five-stage Reading rehearsal, ledger/storage/wallet/delivery continuity, value-bearing mainnet blocking, and proof/workflow wiring.
122+
The operator command `rehearse:v40-local-staging` emits receipts from environment presence only; secret values, protected source, raw prompts, raw provider responses, unpaid AssetPack source, wallet private material, private settlement payloads, and live log payloads are absent from the generated artifact and receipts.
123+
Live execution remains dry-run by default and requires `BITCODE_V40_REHEARSAL_EXECUTE=1` before delegating to the Vercel Sandbox AssetPack harness.
124+
Staging-testnet receipts bind Supabase project `tkpyosihuouusyaxtbau`, REST host `https://tkpyosihuouusyaxtbau.supabase.co/rest/v1/`, real inference, and database event streaming/readback.

BITCODE_SPEC_V40_PARITY_MATRIX.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This matrix records the V40 testing surfaces that must become promotion-grade be
5050
| Gate 6 | Conversation/Terminal integration artifact | implemented |
5151
| Gate 7 | Browser/visual/accessibility/responsive artifact | implemented |
5252
| Gate 8 | Ledger/database/storage/wallet/delivery sync artifact | implemented |
53-
| Gate 9 | Local/staging rehearsal artifact | not yet implemented |
53+
| Gate 9 | Local/staging rehearsal artifact | implemented |
5454
| Gate 10 | Prompt benchmark smoke and V41 readiness artifact | not yet implemented |
5555
| Gate 11 | Promotion readiness artifact and workflow | not yet implemented |
5656

@@ -60,6 +60,8 @@ Gate 4 implementation evidence: package-backed `V40ApiIntegrationContracts` emit
6060
Gate 5 implementation evidence: package-backed `V40ReadingPipelineIntegrationCoverage` emits `.bitcode/v40-reading-pipeline-integration-coverage.json` and is wired through `check:v40-gate5`.
6161
Gate 6 implementation evidence: package-backed `V40ConversationTerminalIntegration` emits `.bitcode/v40-conversation-terminal-integration.json` and is wired through `check:v40-gate6`.
6262
Gate 7 implementation evidence: package-backed `V40BrowserE2eVisualProof` emits `.bitcode/v40-browser-e2e-visual-proof.json` and is wired through `check:v40-gate7`.
63+
Gate 8 implementation evidence: package-backed `V40LedgerStorageSync` emits `.bitcode/v40-ledger-storage-sync.json` and is wired through `check:v40-gate8`.
64+
Gate 9 implementation evidence: package-backed `V40LocalStagingRehearsalAutomation` emits `.bitcode/v40-local-staging-rehearsal-automation.json` and is wired through `check:v40-gate9`.
6365

6466
## V40 accepted boundaries
6567

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,13 @@ reconciliation, storage locks, no-custody wallet authority, Terminal readback,
568568
repair posture, and post-settlement pull-request delivery. The current app
569569
ledger/storage sync contract keeps source-bearing AssetPack delivery invisible
570570
until settlement, BTD rights, compensation, and projection readbacks agree.
571+
V40 Gate 9 adds the package-backed `V40LocalStagingRehearsalAutomation`,
572+
generated `.bitcode/v40-local-staging-rehearsal-automation.json`,
573+
`rehearse:v40-local-staging`, and `check:v40-gate9` to close source-safe local
574+
and staging-testnet rehearsal automation. Operator receipts use lane-bound
575+
secret-family readiness rather than secret values, are dry-run by default, bind
576+
staging-testnet to Supabase project `tkpyosihuouusyaxtbau`, and require explicit
577+
live execution opt-in before delegating to the Vercel Sandbox AssetPack harness.
571578
V38 Gates 1 through 11 are wired through `pnpm run check:v38-gate1`,
572579
`pnpm run check:v38-gate2`, `pnpm run check:v38-gate3`,
573580
`pnpm run check:v38-gate4`, `pnpm run check:v38-gate5`,

SPECIFICATIONS_ROADMAP.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
- Current active canonical pointer: `BITCODE_SPEC.txt` -> `V39`
66
- Current active canon: `BITCODE_SPEC_V39.md`
77
- Current draft target: `BITCODE_SPEC_V40.md`.
8-
- Current working gate: V40 Gate 8 Ledger, Database, Storage, Wallet, And Delivery Synchronization.
9-
- Next queued gate after V40 Gate 8 closure: V40 Gate 9 Local And Staging-Testnet Rehearsal Automation.
8+
- Current working gate: V40 Gate 9 Local And Staging-Testnet Rehearsal Automation.
9+
- Next queued gate after V40 Gate 9 closure: V40 Gate 10 Prompt Benchmark Smoke And V41 Readiness.
1010
- Latest closed version: V39 Commercial Reading Readiness, which promoted Depository supply indexing, enterprise five-step Reading UX, ReadNeed review/resynthesis, ReadFitsFinding many-candidate runtime, source-safe AssetPack preview and deterministic BTC quote, settlement rights delivery, operational telemetry/repair readback, interface parity, local/staging rehearsal, and V39 promotion readiness.
1111
- Recent V39 closure anchor: V39 canonical promotion updated `BITCODE_SPEC.txt` to `V39`, generated `BITCODE_SPEC_V39_PROVEN.md`, preserved active V39 / draft V40 runtime posture, and closed commercial Reading readiness canon.
1212
- V39 Gate 9 closure anchor: commercial Reading readiness now owns package-backed `ReadingInterfaceProductParity`, deterministic `.bitcode/v39-interface-conversation-product-parity.json`, Terminal/Conversation/API/MCP/ChatGPT/package-consumer no-bypass rows, source-safe contract readback, BTD interface root composition, focused package/interface tests, and workflow wiring through `check:v39-gate9`.
@@ -20,6 +20,7 @@
2020
- V40 Gate 6 closure anchor: exhaustive testing now owns package-backed `V40ConversationTerminalIntegration` source, deterministic `.bitcode/v40-conversation-terminal-integration.json`, eight source-safe Conversation/Terminal integration surfaces for Terminal handoff route contracts, Conversation stream-to-rich-log projection, route/API persistence and branch contracts, writing/source selector handoff, Terminal Reading state readback, Terminal harness log streaming, transaction-cockpit authority boundaries, and rehearsal/docs/interface parity, protocol exports, focused UAPI integration test, package tests, workflow wiring, and `check:v40-gate6`.
2121
- V40 Gate 7 closure anchor: exhaustive testing now owns package-backed `V40BrowserE2eVisualProof` source, deterministic `.bitcode/v40-browser-e2e-visual-proof.json`, eight source-safe browser proof surfaces for Terminal, Conversations, Auxillaries, Exchange, Docs, responsive viewport overflow, screenshot/trace baselines, and keyboard/landmark/status accessibility, app-owned current browser proof contract, focused Jest and Playwright proof tests, workflow wiring, optional browser lane, and `check:v40-gate7`.
2222
- V40 Gate 8 closure anchor: exhaustive testing now owns package-backed `V40LedgerStorageSync` source, deterministic `.bitcode/v40-ledger-storage-sync.json`, ten source-safe synchronization surfaces for BTC fee finality, BTD rights projection, source-to-shares compensation, ledger/database/object-storage reconciliation, storage locks, post-settlement pull-request delivery, repair posture, no-custody wallet authority, Terminal route/interface readback, and proof/workflow wiring, app-owned current synchronization contract, focused protocol/package/UAPI tests, workflow wiring, and `check:v40-gate8`.
23+
- V40 Gate 9 closure anchor: exhaustive testing now owns package-backed `V40LocalStagingRehearsalAutomation` source, deterministic `.bitcode/v40-local-staging-rehearsal-automation.json`, local and staging-testnet source-safe operator receipts, lane-bound secret-family checks, explicit live-execution opt-in, Vercel Sandbox harness evidence/telemetry capture, staging-testnet Supabase `tkpyosihuouusyaxtbau` stream/readback binding, five-stage Reading rehearsal continuity, ledger/storage/wallet/delivery rehearsal continuity, value-bearing mainnet blocking, focused protocol/package/script tests, workflow wiring, and `check:v40-gate9`.
2324
- Forward planning note: V41 should focus singularly on Prompt and PromptPart implementation quality: prompts as programs. V38's inference correctness hardening and V40's testing/benchmark depth should empower V41 to examine every raw PromptPart, every composed Prompt, every benchmark, every meaningfully benchmarkable semantic part, title, template, interpolation contract, registry binding, inference callsite, and downstream parsed return type; then repartition, retitle, rewrite, catalogue, and validate them across Reading pipelines and conversational interactions. V41 should primarily harden `ReadNeedComprehensionSynthesis` and `ReadFitsFindingSynthesis` prompt surfaces while also covering conversational and other inference prompts with the same catalogue-and-benchmark discipline.
2425
- V34 Gate 2 closure anchor: deployment-depth now owns package-backed `DeploymentHostCapabilityCatalog` and `EnvironmentLaneContract` source, deterministic `.bitcode/v34-deployment-host-capability-catalog.json` and `.bitcode/v34-environment-lane-contracts.json`, and visible `value-bearing-mainnet` blocking through `blocked_future_canon_required`.
2526
- V34 Gate 3 closure anchor: deployment-depth now owns package-backed `DistributedExecutionRuntimeReceipt` source, deterministic `.bitcode/v34-distributed-execution-runtime-receipts.json`, `request_response_not_required` long-running work posture, and source-safe roots for pipeline, PTRR agent, ThricifiedGeneration, tool, ledger, wallet, proof, object-storage, and repair work.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@
267267
"generate:v40-ledger-storage-sync": "node scripts/generate-v40-ledger-storage-sync.mjs",
268268
"check:v40-ledger-storage-sync": "node scripts/generate-v40-ledger-storage-sync.mjs --check",
269269
"check:v40-gate8": "node scripts/check-v40-gate8-ledger-storage-sync.mjs",
270+
"rehearse:v40-local-staging": "node scripts/rehearse-v40-local-staging-testnet.mjs",
271+
"generate:v40-local-staging-rehearsal-automation": "node scripts/generate-v40-local-staging-rehearsal-automation.mjs",
272+
"check:v40-local-staging-rehearsal-automation": "node scripts/generate-v40-local-staging-rehearsal-automation.mjs --check",
273+
"check:v40-gate9": "node scripts/check-v40-gate9-local-staging-rehearsal-automation.mjs",
270274
"generate:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs",
271275
"check:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs --check",
272276
"check:v38-gate2": "node scripts/check-v38-gate2-inference-surface-inventory.mjs",

0 commit comments

Comments
 (0)