Skip to content

Commit 242b018

Browse files
Merge pull request #107 from engineeredsoftware/v36/gate-8-exchange-ux-terminal-integration
V36 Gate 8: Exchange UX And Terminal Navigation Integration
2 parents 0731923 + 8d95ff1 commit 242b018

33 files changed

Lines changed: 2518 additions & 25 deletions

.bitcode/v36-exchange-ux-proof.json

Lines changed: 1294 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
@@ -91,6 +91,9 @@ jobs:
9191
if [ -f scripts/check-v36-gate7-exchange-dispute-repair-revenue-route.mjs ]; then
9292
node scripts/check-v36-gate7-exchange-dispute-repair-revenue-route.mjs --skip-branch-check
9393
fi
94+
if [ -f scripts/check-v36-gate8-exchange-ux-proof.mjs ]; then
95+
node scripts/check-v36-gate8-exchange-ux-proof.mjs --skip-branch-check
96+
fi
9497
fi
9598
else
9699
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ jobs:
219219
if [ -f scripts/check-v36-gate7-exchange-dispute-repair-revenue-route.mjs ]; then
220220
node scripts/check-v36-gate7-exchange-dispute-repair-revenue-route.mjs --skip-branch-check
221221
fi
222+
if [ -f scripts/check-v36-gate8-exchange-ux-proof.mjs ]; then
223+
node scripts/check-v36-gate8-exchange-ux-proof.mjs --skip-branch-check
224+
fi
222225
fi
223226
else
224227
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
@@ -242,7 +245,7 @@ jobs:
242245
243246
- name: Test gate packages
244247
run: |
245-
pnpm --filter @bitcode/btd test
248+
pnpm --filter @bitcode/btd exec jest --config jest.config.cjs --runInBand --forceExit
246249
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/btc-fee-operation.test.ts
247250
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/btd.test.ts
248251
pnpm --filter @bitcode/btd test -- --runTestsByPath __tests__/v32-ledger-btd-settlement-failure-states.test.ts
@@ -280,6 +283,7 @@ jobs:
280283
pnpm --dir packages/protocol exec node --test --test-force-exit test/v36-exchange-pricing-quote.test.js
281284
pnpm --dir packages/protocol exec node --test --test-force-exit test/v36-exchange-settlement-reconciliation.test.js
282285
pnpm --dir packages/protocol exec node --test --test-force-exit test/v36-exchange-dispute-repair-revenue-route.test.js
286+
pnpm --dir packages/protocol exec node --test --test-force-exit test/v36-exchange-ux-proof.test.js
283287
pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/routes/__tests__/btd-crypto.test.ts --runInBand
284288
pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/routes/__tests__/auxillaries-contract.test.ts --runInBand
285289
pnpm --dir packages/executions-mcp/src/mcp-server run test:mcp -- --runTestsByPath src/__tests__/unit/auth.test.ts --runInBand
@@ -311,6 +315,8 @@ jobs:
311315
tests/terminalDepositReadWorkbench.test.ts \
312316
tests/terminalTransactionQuery.test.ts \
313317
tests/terminalTransactionReadModel.test.ts \
318+
tests/exchangePageClient.test.tsx \
319+
tests/exchangeTerminalHandoff.test.ts \
314320
tests/terminalProtocolProjection.test.ts \
315321
tests/terminalInterfaceIntegrationRegression.test.ts \
316322
tests/terminalWalletBtcOperation.test.ts \

BITCODE_SPEC_V36.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,26 @@ wallet private material, provider tokens, protected prompts, protected model
205205
responses, private payment credentials, private buyer repository payloads,
206206
object-storage private bytes, raw disputed source bytes, or secret values.
207207

208+
## V36 Gate 8 ExchangeUxProof canon
209+
210+
Gate 8 implements `ExchangeUxProof` as the package-owned contract binding the
211+
Exchange route, Terminal handoff, and source-safe review surfaces to generated
212+
proof.
213+
214+
`ExchangeUxProof` covers market-wide master-detail, filters, order history, rights-transfer review, pricing quote, settlement state, and repair state.
215+
It proves that Terminal can hand off to Exchange without losing transaction context.
216+
It also proves that collapsed UI gives readable status and expanded UI exposes source-safe detail.
217+
Exchange telemetry dashboards remain source-safe and proof-rooted.
218+
219+
Gate 8 emits `.bitcode/v36-exchange-ux-proof.json` with
220+
`source-safe-exchange-ux-proof-metadata`.
221+
The artifact may expose route ids, transaction ids, filter ids, order state,
222+
rights-transfer preview state, quote roots, settlement state, repair state,
223+
proof roots, event ids, and source-safe UI detail metadata; it must not expose
224+
protected source, unpaid AssetPack source, wallet private material, provider
225+
tokens, protected prompts, protected model responses, buyer private repository
226+
payloads, or secret values.
227+
208228
## Canonical Bitcode executive summary
209229

210230
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ Closure acceptance:
151151
- `/exchange` exposes market-wide master-detail, filters, order history, rights-transfer review, pricing quote, settlement state, and repair state;
152152
- Terminal can hand off to Exchange without losing transaction context;
153153
- collapsed UI gives readable status and expanded UI exposes source-safe detail.
154+
- Exchange telemetry dashboards remain source-safe and proof-rooted.
155+
- `.bitcode/v36-exchange-ux-proof.json` is generated from the package-owned `ExchangeUxProof` builder with `source-safe-exchange-ux-proof-metadata`;
156+
- `pnpm run check:v36-gate8` validates package source, artifact freshness, package tests, route handoff tests, docs, workflow wiring, master-detail UX, filters, order history, rights-transfer review, pricing quote, settlement state, repair state, Terminal handoff, collapsed/expanded disclosure, telemetry binding, proof roots, and event ids.
154157

155158
### Gate 9: Local Staging Exchange Rehearsal And Proof Coverage
156159

BITCODE_SPEC_V36_NOTES.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ principal ids, status, commands, routes, and proof posture, not protected source
153153
unpaid AssetPack source, private payment credentials, or wallet private
154154
material.
155155

156+
## Gate 8 closure notes
157+
158+
Gate 8 closes when `ExchangeUxProof` is package-owned and generated through
159+
`.bitcode/v36-exchange-ux-proof.json`.
160+
The generated artifact carries `source-safe-exchange-ux-proof-metadata`.
161+
`ExchangeUxProof` covers market-wide master-detail, filters, order history, rights-transfer review, pricing quote, settlement state, and repair state.
162+
Terminal can hand off to Exchange without losing transaction context.
163+
collapsed UI gives readable status and expanded UI exposes source-safe detail.
164+
Exchange telemetry dashboards remain source-safe and proof-rooted.
165+
Exchange UX artifacts remain source-safe: they expose route state, filter state,
166+
transaction identity, order history, rights-transfer preview, pricing quote,
167+
settlement state, repair state, proof roots, event ids, and redaction posture,
168+
not protected source, unpaid AssetPack source, wallet private material, provider
169+
tokens, protected prompts, protected model responses, buyer private repository
170+
payloads, or secret values.
171+
156172
## Accepted boundaries
157173

158174
- V36 owns deeper Exchange.

BITCODE_SPEC_V36_PARITY_MATRIX.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ No `_legacy/` source is active source truth.
6060
| Pricing quote | Gate 5 | `ExchangePricingQuote`, `.bitcode/v36-pricing-liquidity-fee-quote.json`, package source, tests, and `check:v36-gate5` | closed | BTC price, measurement weight, measurement volume, liquidity band, wrapper analysis, treasury/depositor/reader routes, quote roots, and fail-closed payment/network posture are deterministic. |
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. |
63-
| Exchange UX and Terminal integration | Gate 8 | `/exchange`, Terminal handoff, public docs, telemetry dashboards, `.bitcode/v36-exchange-ux-proof.json`, and `check:v36-gate8` | draft-required | Master-detail UX, source-safe expanded detail, order history, and Terminal navigation are validated. |
63+
| 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. |
6464
| 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. |
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

@@ -173,6 +173,18 @@ No `_legacy/` source is active source truth.
173173
| Dispute and revenue payloads are source-safe | `source-safe-exchange-dispute-repair-revenue-route-metadata`; protected source, unpaid AssetPack source, private wallet material, private payment credentials, raw disputed source bytes, provider tokens, protected prompts, protected model responses, private buyer payloads, object-storage private bytes, and secret values are forbidden | closed |
174174
| Workflow and package tests are wired | `packages/protocol/test/v36-exchange-dispute-repair-revenue-route.test.js`, `scripts/check-v36-gate7-exchange-dispute-repair-revenue-route.mjs`, `.github/workflows/bitcode-gate-quality.yml` | closed |
175175

176+
## Gate 8 Parity
177+
178+
| Requirement | Source evidence | Current V36 judgment |
179+
| --- | --- | --- |
180+
| `ExchangeUxProof` is package-owned | `packages/protocol/src/canonical/exchange-ux-proof.js`, `packages/protocol/src/index.js`, `packages/protocol/src/index.d.ts` | closed |
181+
| Generated Exchange UX artifact exists | `.bitcode/v36-exchange-ux-proof.json`, `scripts/generate-v36-exchange-ux-proof.mjs`, `pnpm run check:v36-exchange-ux-proof` | closed |
182+
| Exchange route exposes market review | `/exchange` exposes market-wide master-detail, filters, order history, rights-transfer review, pricing quote, settlement state, and repair state | closed |
183+
| Terminal handoff preserves context | `buildExchangeHref`, `TerminalTransactionDetailHero`, and `uapi/tests/exchangeTerminalHandoff.test.ts`; Terminal can hand off to Exchange without losing transaction context | closed |
184+
| Collapsed and expanded disclosure is source-safe | collapsed UI gives readable status and expanded UI exposes source-safe detail | closed |
185+
| Telemetry binding is source-safe | `source-safe-exchange-ux-proof-metadata`; Exchange telemetry dashboards remain source-safe and proof-rooted | closed |
186+
| 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 |
187+
176188
## V36 accepted boundaries
177189

178190
- V36 owns deeper Exchange.

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ generated artifact `.bitcode/v36-exchange-dispute-repair-revenue-route.json`.
5555
`ExchangeRevenueRoute` covers depositor, reader, treasury, fee, BTC route, BTD right route, and conservation proof.
5656
The source-safe verdict is
5757
`source-safe-exchange-dispute-repair-revenue-route-metadata`; runbooks and repair commands are source-safe and proof-rooted.
58+
V36 Gate 8 anchors Exchange route usability through package-owned
59+
`ExchangeUxProof` and the source-safe generated artifact
60+
`.bitcode/v36-exchange-ux-proof.json`.
61+
`ExchangeUxProof` covers market-wide master-detail, filters, order history, rights-transfer review, pricing quote, settlement state, and repair state.
62+
Terminal can hand off to Exchange without losing transaction context.
63+
collapsed UI gives readable status and expanded UI exposes source-safe detail.
64+
Exchange telemetry dashboards remain source-safe and proof-rooted.
65+
The source-safe verdict is `source-safe-exchange-ux-proof-metadata`.
5866
Promoted V35 closure owns telemetry and documentation depth over promoted V34:
5967
internal codebase docs, public `/docs`, telemetry taxonomy, dashboards, alert
6068
runbooks, incident response, operator escalation, documentation QA, developer

SPECIFICATIONS_ROADMAP.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- Current active canonical pointer: `BITCODE_SPEC.txt` -> `V35`
66
- Current active canon: `BITCODE_SPEC_V35.md`
77
- Current draft target: `BITCODE_SPEC_V36.md`
8-
- Current working gate: V36 Gate 8 Exchange UX And Terminal Navigation Integration, following V36 Gate 7 dispute repair revenue route closure.
8+
- Current working gate: V36 Gate 9 Local Staging Exchange Rehearsal And Proof Coverage, following V36 Gate 8 Exchange UX and Terminal navigation closure.
99
- Latest closed version: V35 Telemetry And Documentation Depth, which promoted documentation surfaces, telemetry taxonomy, public docs, dashboards, alert runbooks, incident response, operator escalation, documentation QA, onboarding, local/staging telemetry rehearsal, and V35 promotion readiness.
1010
- Recent V35 closure anchor: V35 Gate 10 Promotion Readiness generated V35 proof support, promoted `BITCODE_SPEC.txt` to `V35`, prepared V35 active / V36 draft runtime posture, and closed telemetry/documentation-depth canon.
1111
- 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`.
@@ -34,6 +34,7 @@
3434
- V36 Gate 5 closure anchor: Exchange depth now owns package-backed `ExchangePricingQuote` source, deterministic `.bitcode/v36-pricing-liquidity-fee-quote.json`, `source-safe-exchange-pricing-quote-metadata`, BTC amount, measurement weight, measurement volume, liquidity band, wrapper analysis, treasury route, depositor route, reader route, quote root, proof roots, event ids, ledger/database projection refs, package tests, workflow wiring, and `check:v36-gate5`; wrapper analysis cannot make BTD range cells fungible chain-of-record assets, and underpayment, overpayment, stale quote, or unsupported network posture fails closed.
3535
- V36 Gate 6 closure anchor: Exchange depth now owns package-backed `ExchangeSettlementReceipt` source, deterministic `.bitcode/v36-exchange-settlement-reconciliation.json`, `source-safe-exchange-settlement-reconciliation-metadata`, payment observation, finality state, rights transfer receipt, ledger root, database projection root, object storage root, delivery state, repair id, observer jobs, repair jobs, proof roots, event ids, package tests, workflow wiring, and `check:v36-gate6`; observers and repair jobs reconcile database projections to ledger truth, and settlement finality and delivery are auditable.
3636
- V36 Gate 7 closure anchor: Exchange depth now owns package-backed `ExchangeDisputeRepairCase` and `ExchangeRevenueRoute` source, deterministic `.bitcode/v36-exchange-dispute-repair-revenue-route.json`, `source-safe-exchange-dispute-repair-revenue-route-metadata`, stale owner, cancelled order replay, underpayment, overpayment, projection drift, source leakage, delivery mismatch, depositor, reader, treasury, fee, BTC route, BTD right route, conservation proof, source-safe proof-rooted runbooks, repair commands, verification commands, escalation paths, proof roots, event ids, package tests, workflow wiring, and `check:v36-gate7`.
37+
- V36 Gate 8 closure anchor: Exchange depth now owns package-backed `ExchangeUxProof` source, deterministic `.bitcode/v36-exchange-ux-proof.json`, `source-safe-exchange-ux-proof-metadata`, market-wide master-detail, filters, order history, rights-transfer review, pricing quote, settlement state, repair state, Terminal context handoff, collapsed readable status, expanded source-safe detail, source-safe proof-rooted telemetry dashboards, route preservation tests, package tests, workflow wiring, and `check:v36-gate8`.
3738
- Purpose: concise running index of Bitcode/ENGI specification history, current work, and planned work.
3839

3940
This roadmap is not an active system specification.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@
203203
"generate:v36-exchange-dispute-repair-revenue-route": "node scripts/generate-v36-exchange-dispute-repair-revenue-route.mjs",
204204
"check:v36-exchange-dispute-repair-revenue-route": "node scripts/generate-v36-exchange-dispute-repair-revenue-route.mjs --check",
205205
"check:v36-gate7": "node scripts/check-v36-gate7-exchange-dispute-repair-revenue-route.mjs",
206+
"generate:v36-exchange-ux-proof": "node scripts/generate-v36-exchange-ux-proof.mjs",
207+
"check:v36-exchange-ux-proof": "node scripts/generate-v36-exchange-ux-proof.mjs --check",
208+
"check:v36-gate8": "node scripts/check-v36-gate8-exchange-ux-proof.mjs",
206209
"check:spec-quality": "node scripts/run-bitcode-spec-quality.mjs --mode basic",
207210
"check:spec-quality:title": "node scripts/run-bitcode-spec-quality.mjs --mode strict-from-title",
208211
"check:spec-quality:v24": "node scripts/run-bitcode-spec-quality.mjs --mode strict-version --version V24",

0 commit comments

Comments
 (0)