Skip to content

Commit 8206d02

Browse files
V39 Gate 3: Enterprise Reading UX State Machine
Closes the V39 Gate 3 enterprise Reading UX state machine, Terminal five-step Reading guidance, conversation handoff state, source-safe disclosure contract, protocol artifact, and gate-quality proof coverage.
1 parent b932499 commit 8206d02

30 files changed

Lines changed: 1904 additions & 65 deletions

.bitcode/v39-enterprise-reading-ux-state.json

Lines changed: 558 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
@@ -187,6 +187,9 @@ jobs:
187187
if [ -f scripts/check-v39-gate2-depository-supply-indexing.mjs ]; then
188188
node scripts/check-v39-gate2-depository-supply-indexing.mjs --skip-branch-check --skip-package-tests
189189
fi
190+
if [ -f scripts/check-v39-gate3-enterprise-reading-ux-state.mjs ]; then
191+
node scripts/check-v39-gate3-enterprise-reading-ux-state.mjs --skip-branch-check --skip-uapi-tests
192+
fi
190193
fi
191194
else
192195
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ jobs:
316316
if [ -f scripts/check-v39-gate2-depository-supply-indexing.mjs ]; then
317317
node scripts/check-v39-gate2-depository-supply-indexing.mjs --skip-branch-check --skip-package-tests
318318
fi
319+
if [ -f scripts/check-v39-gate3-enterprise-reading-ux-state.mjs ]; then
320+
node scripts/check-v39-gate3-enterprise-reading-ux-state.mjs --skip-branch-check --skip-uapi-tests
321+
fi
319322
fi
320323
else
321324
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
@@ -456,6 +459,7 @@ jobs:
456459
tests/api/readReviewRoute.test.ts \
457460
tests/api/pipelineHarnessRoute.test.ts \
458461
tests/terminalPipelineHarnessClient.test.ts \
462+
tests/terminalEnterpriseReadingUxState.test.ts \
459463
tests/terminalDepositReadWorkbench.test.ts \
460464
tests/terminalTransactionQuery.test.ts \
461465
tests/terminalTransactionReadModel.test.ts \

BITCODE_SPEC_V39.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ source-safe `DepositoryAsset` candidates for Finding Fits.
105105
Gate 3 implements the five-step enterprise Reading path in Terminal and connected Conversation handoffs.
106106
The UX must default to clear low-detail guidance while preserving expandable source-safe operational detail for every step, pipeline run, quote, settlement, and delivery state.
107107
The gate is closed by route state contracts, component tests, browser proof, stream-log integration, and source-safe disclosure tests.
108+
The implementation basis is `TerminalEnterpriseReadingUxState`, exported from
109+
`uapi/app/terminal/terminal-enterprise-reading-ux-state.ts`, with five stable
110+
steps: `request-read`, `review-synthesized-need`, `request-fit`,
111+
`review-synthesized-asset-pack`, and `buy-asset-pack-settle`.
112+
Conversation handoffs may carry only source-safe stage intent through the
113+
`readingStage` query parameter and `terminalEnterpriseReadingStage` metadata;
114+
Terminal remains the transaction authority. The generated source-safe proof
115+
artifact is `.bitcode/v39-enterprise-reading-ux-state.json`, checked by
116+
`pnpm run check:v39-gate3`.
108117

109118
### Gate 4: ReadNeed Review, Resynthesis, And Admission Runtime
110119

BITCODE_SPEC_V39_DELTA.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,24 @@ Closure acceptance:
9999

100100
Closure implementation:
101101

102-
- Pending Gate 3 work must define route contracts, UI tests, and generated UX-state proof artifact.
102+
- Gate 3 defines `TerminalEnterpriseReadingUxState` as the Terminal-owned
103+
route/UI state contract for the five Reading stages.
104+
- The state contract defaults to low-detail guidance, preserves expandable
105+
source-safe detail, and forbids protected source, raw protected prompts, raw
106+
provider responses, unpaid AssetPack source, wallet private material,
107+
private settlement payloads, and ledger write authority.
108+
- Conversation handoff now serializes source-safe `readingStage` route intent
109+
and `terminalEnterpriseReadingStage` metadata while Terminal keeps authority.
110+
- The Terminal workbench renders stable `terminal-enterprise-reading-step-*`
111+
stage rows, state chips, blockers, and source-safe detail accordions.
112+
- `ReadFitsFindingSynthesis` telemetry continues to stream through the rich
113+
execution log with pipeline phase, PTRR, Failsafe, ThricifiedGeneration, tool,
114+
prompt, and schema metadata.
115+
- The deterministic proof artifact is
116+
`.bitcode/v39-enterprise-reading-ux-state.json`; `pnpm run check:v39-gate3`
117+
validates artifact freshness, protocol tests, focused UAPI tests, source-safe
118+
disclosure, route contracts, stream-log integration, docs, and workflow
119+
wiring.
103120

104121
### Gate 4: ReadNeed Review, Resynthesis, And Admission Runtime
105122

BITCODE_SPEC_V39_NOTES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,15 @@ without reading source-bearing payloads before settlement. The proof artifact is
188188

189189
## Gate 3 implementation notes
190190

191-
Gate 3 closes the enterprise Reading UX state machine. Terminal and Conversation handoff must expose the five-step Reading path with low-detail guidance by default and expandable source-safe pipeline detail.
191+
Gate 3 closes the enterprise Reading UX state machine. Terminal and
192+
Conversation handoff expose the five-step Reading path with low-detail guidance
193+
by default and expandable source-safe pipeline detail.
194+
The state carrier is `TerminalEnterpriseReadingUxState`; Conversation can
195+
suggest only a source-safe `readingStage`, and Terminal reads it back as
196+
operator posture while retaining transaction authority.
197+
The generated artifact `.bitcode/v39-enterprise-reading-ux-state.json` binds
198+
stage ids, source-safe disclosure, rich execution stream integration, route
199+
state tests, component tests, and the maintained opt-in browser proof workflow.
192200

193201
## Gate 4 implementation notes
194202

BITCODE_SPEC_V39_PARITY_MATRIX.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ No `_legacy/` source is active source truth.
7171
| Depository search scope | Gate 1 | depository-search source and tools, embedding policy, fit ranking expectations | drafted | Gate plan requires many-candidate Finding Fits across lexical, symbolic, path, metadata, measurement, vector, and provider channels. |
7272
| Settlement and delivery scope | Gate 1 | BTD receipts, source-to-shares compensation, ledger/database/storage synchronization, pull-request delivery | drafted | Gate plan keeps source-bearing AssetPack delivery blocked until settlement unlock. |
7373
| Depository supply indexing | Gate 2 | `packages/pipelines/asset-pack/src/depository-supply-index.ts`, `.bitcode/v39-depository-supply-indexing.json`, `packages/pipelines/asset-pack/src/__tests__/depository-supply-index.test.ts`, `packages/protocol/test/v39-depository-supply-indexing.test.js` | implemented | Deposited source becomes measurable, indexable, rights-aware, searchable, and repairable through source-safe `DepositorySupplyIndex` records. |
74-
| Enterprise Reading UX state machine | Gate 3 | Terminal route state, Conversation handoff, rich execution log, browser proof | pending | The five-step enterprise Reading UX is implemented with low-detail defaults and expandable source-safe detail. |
74+
| Enterprise Reading UX state machine | Gate 3 | `uapi/app/terminal/terminal-enterprise-reading-ux-state.ts`, `TerminalDepositReadWorkbench.tsx`, Conversation handoff, Terminal route query, `.bitcode/v39-enterprise-reading-ux-state.json`, focused UAPI tests, opt-in browser proof workflow | implemented | The five-step enterprise Reading UX is implemented with low-detail defaults, expandable source-safe detail, route-state handoff, rich execution stream integration, and source-safe disclosure proof. |
7575
| ReadNeed review and resynthesis | Gate 4 | `ReadNeedComprehensionSynthesis`, Need storage, feedback, resynthesis, accepted-Need admission | pending | Finding Fits remains blocked until a reviewed Need is accepted. |
7676
| ReadFitsFinding runtime and replay | Gate 5 | `ReadFitsFindingSynthesis`, search tools, embeddings, ranking, selected-fit provenance, replay receipts | pending | Finding Fits searches the whole available Depository for many above-threshold candidates. |
7777
| AssetPack preview and quote boundary | Gate 6 | AssetPack preview tests, quote tests, disclosure leak scans, proof roots | pending | Preview is commercially sufficient without exposing source-bearing AssetPack content. |
@@ -93,7 +93,7 @@ No `_legacy/` source is active source truth.
9393
| Canon-quality workflow | Canon workflow validates promoted V38 canon, V39 draft family when present, and V38/V39 posture | drafted |
9494
| Package docs | README, protocol package README, demonstration README, and PR template state V38 active / V39 draft workflow | drafted |
9595
| Depository supply indexing | Deposits become measurable, embedded, indexable, rights-aware, searchable, and repairable | implemented |
96-
| Enterprise Reading UX | Terminal implements request read, review Need, request Finding Fits, review preview, buy and settle | pending |
96+
| Enterprise Reading UX | Terminal implements request read, review Need, request Finding Fits, review preview, buy and settle | implemented |
9797
| ReadNeed runtime | `ReadNeedComprehensionSynthesis` persists reviewable Needs, feedback, resynthesis, measurements, and accepted-Need admission | pending |
9898
| ReadFitsFinding runtime | `ReadFitsFindingSynthesis` searches many above-threshold deposits with replayable query, ranking, threshold, and selected-fit provenance receipts | pending |
9999
| Preview and quote | AssetPack preview is source-safe and quote is deterministic before settlement | pending |
@@ -138,16 +138,28 @@ No `_legacy/` source is active source truth.
138138
| Gate 2 proof artifact is source-safe | `.bitcode/v39-depository-supply-indexing.json`, `packages/protocol/src/canonical/v39-depository-supply-indexing.js`, `packages/protocol/test/v39-depository-supply-indexing.test.js` | implemented |
139139
| Gate 2 checker is wired | `scripts/check-v39-gate2-depository-supply-indexing.mjs`, `package.json`, canon/gate workflows | implemented |
140140

141+
## Gate 3 Parity
142+
143+
| Requirement | Source evidence | Current V39 judgment |
144+
| --- | --- | --- |
145+
| Five-step Reading state machine exists | `uapi/app/terminal/terminal-enterprise-reading-ux-state.ts`, `uapi/tests/terminalEnterpriseReadingUxState.test.ts` | implemented |
146+
| Terminal renders low-detail and expandable source-safe detail | `uapi/app/terminal/TerminalDepositReadWorkbench.tsx`, `uapi/tests/terminalDepositReadWorkbench.test.ts` | implemented |
147+
| Conversation handoff carries source-safe Reading stage intent | `uapi/app/conversations/conversation-terminal-handoff.ts`, `uapi/app/terminal/terminal-transaction-query.ts`, `uapi/tests/conversationTerminalHandoff.test.tsx`, `uapi/tests/terminalTransactionQuery.test.ts` | implemented |
148+
| Rich execution log remains the live Reading pipeline stream | `uapi/app/terminal/terminal-pipeline-harness-client.ts`, `uapi/tests/pipelineExecutionLogHeader.test.tsx` | implemented |
149+
| Proof artifact and checker exist | `.bitcode/v39-enterprise-reading-ux-state.json`, `packages/protocol/src/canonical/v39-enterprise-reading-ux-state.js`, `packages/protocol/test/v39-enterprise-reading-ux-state.test.js`, `scripts/check-v39-gate3-enterprise-reading-ux-state.mjs` | implemented |
150+
| Browser proof remains wired as opt-in gate-quality evidence | `.github/workflows/bitcode-gate-quality.yml`, `uapi/tests/terminalUxBrowserProof.test.tsx`, `uapi/tests/e2e/commercial-mvp.terminal-ux.spec.ts` | implemented |
151+
141152
## Later Gate Parity
142153

143-
Later V39 gates must add gate-specific parity sections when their implementation begins. Gates 1 and 2 intentionally do not claim closure for enterprise Reading UX, Need review, Finding Fits runtime, preview/quote, settlement/delivery, telemetry/repair, interface parity, rehearsal, or promotion readiness.
154+
Later V39 gates must add gate-specific parity sections when their implementation begins. Gates 1 through 3 intentionally do not claim closure for Need review, Finding Fits runtime, preview/quote, settlement/delivery, telemetry/repair, interface parity, rehearsal, or promotion readiness.
144155

145156
## accepted boundaries and reopen conditions
146157

147158
V39 Gate 1 accepts only draft-family, roadmap, workflow, branch, and documentation posture closure.
148159
V39 Gate 2 accepts only Depository supply indexing, source-safe search document, vector projection, storage readback posture, rights boundary, repair posture, and Finding Fits handoff closure.
160+
V39 Gate 3 accepts only enterprise Reading UX state, source-safe route handoff/readback, low-detail/expandable Terminal rendering, rich stream-log integration, opt-in browser proof wiring, and generated UX proof artifact closure.
149161
Later gate scope is intentionally pending and must be reopened into gate-specific parity sections before implementation starts.
150162

151163
## completion condition
152164

153-
V39 Gate 2 is complete when `check:v39-gate2`, package Depository supply tests, V39 draft spec-family validation, V38/V39 canon-posture drift validation, and promoted V38 spec-family validation all pass on a `v39/gate-2-*` branch.
165+
V39 Gate 3 is complete when `check:v39-gate3`, focused Terminal/Conversation/UAPI tests, V39 draft spec-family validation, V38/V39 canon-posture drift validation, and promoted V38 spec-family validation all pass on a `v39/gate-3-*` branch.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ wallet, source-safe search documents, active embedding/vector projection,
257257
Supabase storage readback posture, deterministic repair actions, and a
258258
source-safe Finding Fits handoff. Use `pnpm run generate:v39-depository-supply-indexing`
259259
and `pnpm run check:v39-gate2` before closing the gate.
260+
V39 Gate 3 adds the package-owned `TerminalEnterpriseReadingUxState` and
261+
source-safe generated artifact `.bitcode/v39-enterprise-reading-ux-state.json`.
262+
Terminal now owns the five-stage enterprise Reading state machine: request
263+
Read, review synthesized Need, request Finding Fits, review source-safe
264+
AssetPack preview, and buy AssetPack/settle. Conversation handoffs may pass
265+
only source-safe `readingStage` intent, Terminal parses it as posture, and the
266+
rich execution stream remains the live Reading pipeline log. Use
267+
`pnpm run generate:v39-enterprise-reading-ux-state` and
268+
`pnpm run check:v39-gate3` before closing the gate.
260269
V36 Gate 2 anchors market-wide activity through the package-owned
261270
`ExchangeActivityBook` and the source-safe generated artifact
262271
`.bitcode/v36-exchange-activity-book.json`, including listing, bid, ask,
@@ -417,6 +426,9 @@ commit promotion artifacts plus the `BITCODE_SPEC.txt` pointer change from
417426
For V39, Gate 1 opens `version/v39` and the gate-quality posture through
418427
`pnpm run check:v39-gate1` before later gates add generated commercial Reading
419428
artifacts and the V39 promotion workflow.
429+
V39 Gate 2 is wired through `pnpm run check:v39-gate2`; V39 Gate 3 is wired
430+
through `pnpm run check:v39-gate3` and its generated
431+
`.bitcode/v39-enterprise-reading-ux-state.json` artifact.
420432
V38 Gates 1 through 11 are wired through `pnpm run check:v38-gate1`,
421433
`pnpm run check:v38-gate2`, `pnpm run check:v38-gate3`,
422434
`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` -> `V38`
66
- Current active canon: `BITCODE_SPEC_V38.md`
77
- Current draft target: `BITCODE_SPEC_V39.md`.
8-
- Current working gate: V39 Gate 2 Depository Supply Indexing And Searchable Deposit Lifecycle.
9-
- Next queued gate after V39 Gate 2 closure: V39 Gate 3 Enterprise Reading UX State Machine.
8+
- Current working gate: V39 Gate 3 Enterprise Reading UX State Machine.
9+
- Next queued gate after V39 Gate 3 closure: V39 Gate 4 ReadNeed Review, Resynthesis, And Admission Runtime.
1010
- Latest closed version: V38 Inference Correctness, which promoted pipeline execution call-stack law, PTRR/Failsafe/Thricified parity, prompt and PromptPart benchmarking, source-safe inference telemetry, ReadNeedComprehensionSynthesis hardening, ReadFitsFindingSynthesis search and embeddings, AssetPack economic traceability, local/staging inference rehearsal, and V38 promotion readiness.
1111
- Recent V38 closure anchor: V38 Gate 11 Promotion Readiness generated V38 proof support, promoted `BITCODE_SPEC.txt` to `V38`, prepared V38 active / V39 draft runtime posture, and closed inference correctness canon.
1212
- 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`.
@@ -62,6 +62,7 @@
6262
- V38 Gate 11 closure anchor: Inference correctness depth now owns package-backed `V38InferencePromotionReadinessReport` source, deterministic `.bitcode/v38-promotion-readiness-report.json`, `source-safe-inference-promotion-readiness-metadata`, source-safe coverage for all V38 inference artifacts, `BITCODE_SPEC_V38_PROVEN.md` generation support, promotion command dry-run support, `v38-canon-promotion.yml`, active V38 / draft V39 posture preparation, package tests, workflow wiring, and `check:v38-gate11`.
6363
- V39 Gate 1 opening anchor: Commercial Reading readiness opens over promoted V38 with V39 SPEC, DELTA, NOTES, and PARITY files, `check:v39-gate1`, V38 active / V39 draft posture, and an eleven-gate plan for Depository supply indexing, enterprise Reading UX state, ReadNeed review/resynthesis, ReadFitsFinding runtime and replay, AssetPack preview/quote disclosure, settlement/BTD rights/delivery, operational telemetry/repair, interface parity, local/staging rehearsal, and promotion readiness.
6464
- V39 Gate 2 closure anchor: Commercial Reading readiness now owns package-backed `DepositorySupplyIndex` source, deterministic `.bitcode/v39-depository-supply-indexing.json`, source-safe Depository supply records, lexical/metadata/measurement/vector search documents, active OpenAI embedding/vector projection, Supabase storage readback posture, depositor/Reader settlement boundary, repair actions, Finding Fits handoff, package tests, protocol tests, workflow wiring, and `check:v39-gate2`.
65+
- V39 Gate 3 closure anchor: Commercial Reading readiness now owns package-backed `TerminalEnterpriseReadingUxState` source, deterministic `.bitcode/v39-enterprise-reading-ux-state.json`, five-step Reading state, source-safe `readingStage` Conversation handoff and Terminal readback, low-detail defaults, expandable source-safe detail, rich execution stream integration, component/route tests, opt-in browser proof workflow wiring, and `check:v39-gate3`.
6566
- Purpose: concise running index of Bitcode/ENGI specification history, current work, and planned work.
6667

6768
This roadmap is not an active system specification.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@
218218
"generate:v39-depository-supply-indexing": "node scripts/generate-v39-depository-supply-indexing.mjs",
219219
"check:v39-depository-supply-indexing": "node scripts/generate-v39-depository-supply-indexing.mjs --check",
220220
"check:v39-gate2": "node scripts/check-v39-gate2-depository-supply-indexing.mjs",
221+
"generate:v39-enterprise-reading-ux-state": "node scripts/generate-v39-enterprise-reading-ux-state.mjs",
222+
"check:v39-enterprise-reading-ux-state": "node scripts/generate-v39-enterprise-reading-ux-state.mjs --check",
223+
"check:v39-gate3": "node scripts/check-v39-gate3-enterprise-reading-ux-state.mjs",
221224
"generate:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs",
222225
"check:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs --check",
223226
"check:v38-gate2": "node scripts/check-v38-gate2-inference-surface-inventory.mjs",

0 commit comments

Comments
 (0)