Skip to content

Commit 796cc3d

Browse files
Define Terminal transaction read models
Closes V29 Gate 2 by specifying and implementing route-owned Terminal transaction read models, default transaction route recovery, typed section navigation, and low-detail detail headers. Adds focused query/read-model tests plus a Gate 2 checker wired into gate-quality CI. Validation: pnpm run check:v29-gate1; pnpm run check:v29-gate2; node scripts/check-bitcode-spec-family.mjs --version V29 --mode draft --current-target V28; node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V28 --draft-target V29; node scripts/check-bitcode-canonical-inputs.mjs --current-target V28; node scripts/check-bitcode-spec-family.mjs --version V28 --mode promoted --current-target V28; pnpm --dir uapi exec jest --runTestsByPath tests/terminalTransactionDetail.test.ts tests/terminalTransactionDetailCards.test.tsx tests/terminalTransactionDetailSnapshot.test.ts tests/terminalTransactionQuery.test.ts tests/terminalTransactionReadModel.test.ts tests/terminalTransactionSource.test.ts tests/terminalPageShell.test.tsx tests/exchangePageClient.test.tsx --runInBand; pnpm --dir uapi exec tsc --noEmit; pnpm --dir uapi exec eslint . --ext .ts,.tsx --quiet; bash scripts/check-import-casing.sh; bash scripts/find-uppercase-raw-promptparts.sh; git diff --check; node scripts/check-bitcode-pre-commit.mjs.
1 parent 3df6509 commit 796cc3d

19 files changed

Lines changed: 1004 additions & 56 deletions

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V28 --draft-target V29
4747
node scripts/check-bitcode-canonical-inputs.mjs --current-target V28
4848
node scripts/check-v29-gate1-objectives-and-gating.mjs --skip-branch-check
49+
node scripts/check-v29-gate2-terminal-transaction-read-models.mjs --skip-branch-check
4950
5051
- name: Validate source casing and imports
5152
run: |
@@ -71,6 +72,8 @@ jobs:
7172
tests/api/pipelineHarnessRoute.test.ts \
7273
tests/terminalPipelineHarnessClient.test.ts \
7374
tests/terminalDepositReadWorkbench.test.ts \
75+
tests/terminalTransactionQuery.test.ts \
76+
tests/terminalTransactionReadModel.test.ts \
7477
tests/pipelineExecutionLogHeader.test.tsx \
7578
--runInBand
7679

BITCODE_SPEC_V29.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ The V29 domain model extends V28 operationally:
158158
- `AssetPackPreview`: source-safe measurements, quality score, disclosure policy, access policy, fee quote, range projection, and protected-source lock.
159159
- `SettlementUnlock`: BTC fee proof, BTD range/read-license/right transfer, paid disclosure decision, delivery admission, and reconciliation state.
160160
- `TerminalTransaction`: URL-addressable activity combining execution, pipeline, agent, tool, prompt, ledger, database, delivery, and proof state.
161+
- `TerminalTransactionReadModel`: typed operator projection of a selected `TerminalTransaction`, including route state, active detail section, low-detail summary, section availability, expandable audit posture, and source-safe raw-payload boundary.
161162

162163
## V29 whole Bitcode operator chain
163164

@@ -179,6 +180,25 @@ Readiness
179180

180181
Each transition must be observable as an execution, pipeline, PTRR agent, PTRR step, ThricifiedGeneration, tool call, ledger journal row, database projection, or repair receipt where applicable.
181182

183+
## V29 Terminal transaction read-model canon
184+
185+
Terminal transaction reading is route-owned.
186+
When Terminal has a selected transaction, `/terminal?transactionId=<id>` is the recoverable address.
187+
`transactionDetail` selects a typed detail section and defaults to source-safe Shippables when omitted.
188+
189+
The Terminal transaction read model must contain:
190+
191+
- selected transaction identity, activity type, lens, status, participant, repository, branch, timing, and proof posture;
192+
- route state with canonical hrefs for each section and with the former `runId` carrier removed on write;
193+
- low-detail default summary, metrics, and posture chips sufficient for ordinary operation without opening raw JSON;
194+
- section read models for Shippables, identity, closure, proofs, history, journal, activity stream, and console;
195+
- explicit section availability: available, empty, or blocked with an operator-readable reason;
196+
- expandable detail metadata preserving row counts, metric counts, payload availability, and target DOM section ids;
197+
- a source-safe disclosure boundary: protected AssetPack source is never displayed before settlement, and raw payloads remain audit detail rather than the default operator contract.
198+
199+
The model is deterministic from execution history, detail readback, route query state, and data mode.
200+
It must tolerate partial live readback by preserving a fallback selected-run projection while naming empty or blocked sections.
201+
182202
## V29 canonical subsystem surfaces
183203

184204
### Depositing and asset supply

BITCODE_SPEC_V29_DELTA.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ Gate 1 opens V29 correctly:
8585

8686
Gate 2 owns URL-addressable transaction state, Terminal state machine, detail panes, execution-to-transaction read models, low-detail defaults, expandable detail, and no raw-JSON dependency for ordinary operators.
8787

88+
Closure acceptance:
89+
90+
- the Terminal writes a selected transaction id into the route whenever live, projected, or review-fallback activity is selectable;
91+
- former `runId` links continue resolving but are rewritten to `transactionId`;
92+
- a typed `TerminalTransactionReadModel` derives the selected activity's low-detail operator summary, section navigation, active detail focus, and expandable audit posture;
93+
- Shippables, identity, closure, proofs, history, journal, activity stream, and console sections expose availability, target ids, route hrefs, and blocking reasons without raw JSON inspection;
94+
- console detail is blocked outside live execution-history mode rather than presented as an inert or misleading section;
95+
- unit tests cover route recovery, section availability, legacy query migration, low-detail defaults, and filter/pagination preservation;
96+
- V29 SPEC, DELTA, NOTES, PARITY, Terminal README, package scripts, and gate-quality workflow name the Gate 2 closure surface.
97+
8898
### Gate 3: Wallet Signer Session And BTC Fee Operations
8999

90100
Gate 3 owns wallet connection depth, signer-session recovery, BTC fee quote lifecycle, PSBT handoff, broadcast/finality/replacement/reorg/failure states, blocked-readiness receipts, and no server-custody posture.

BITCODE_SPEC_V29_NOTES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ For a simplified reading of V29:
5252

5353
2. **Gate 2: Terminal Transaction Read Models And Navigation**
5454
- Build URL-addressable Terminal transaction state, typed read models, default-low-detail navigation, and expandable detail panes.
55+
- Acceptance detail: selected transactions must recover through `transactionId`, detail focus must recover through `transactionDetail`, the first selectable row must write itself into a bare Terminal URL, and the operator-facing model must expose section summaries and blockers before raw payloads.
5556

5657
3. **Gate 3: Wallet Signer Session And BTC Fee Operations**
5758
- Deepen signer-session recovery, BTC fee quote, PSBT handoff, broadcast, replacement, reorg, failure, and blocked-readiness states.
@@ -89,6 +90,22 @@ Gate 1 accepted evidence:
8990
- workflows and README describe V28 active / V29 draft posture.
9091
- `pnpm run check:v29-gate1` validates branch, posture, workflow, docs, and spec-family shape.
9192

93+
## Gate 2 working notes
94+
95+
Gate 2 closes the first product-source V29 slice.
96+
Its read model is intentionally not a new protocol primitive and not a versioned API route.
97+
It is the Terminal projection that lets operators recover, share, and inspect a selected transaction without depending on browser network logs or raw JSON.
98+
99+
The low-detail default should answer:
100+
101+
- which transaction is selected;
102+
- whether the selected detail section is available, empty, or blocked;
103+
- where to navigate next inside the transaction;
104+
- which facts are proof, ledger, database, delivery, or execution facts;
105+
- whether deeper audit payloads exist behind an expansion.
106+
107+
The detailed view may still carry raw payload accordions for audit, but the ordinary collapsed view must be typed and readable.
108+
92109
## Later-version boundaries
93110

94111
- V30 remains reserved for Protocol/BTD hardening that is not necessary to close Terminal transaction depth.

BITCODE_SPEC_V29_PARITY_MATRIX.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ No `_legacy/` source is active source truth.
4949
| --- | --- | --- | --- | --- |
5050
| Draft family and branch posture | Gate 1 | `BITCODE_SPEC_V29.md`, DELTA, NOTES, PARITY, `BITCODE_SPEC.txt`, branch `v29/gate-1-objectives-and-gating` | drafted | V29 family validates in draft mode over active V28 and `check:v29-gate1` passes. |
5151
| Workflow retargeting | Gate 1 | `.github/workflows/bitcode-gate-quality.yml`, `.github/workflows/bitcode-canon-quality.yml` | drafted | CI checks V28 active / V29 draft posture instead of stale V27/V28 posture. |
52-
| Terminal transaction read models | Gate 2 | `uapi/app/terminal`, API execution routes, read-model adapters | pending | Terminal transaction state is URL-addressable, recoverable, and typed. |
52+
| Terminal transaction read models | Gate 2 | `uapi/app/terminal/terminal-transaction-read-model.ts`, `uapi/app/terminal/terminal-transaction-query.ts`, `TerminalTransactionWorkspace.tsx`, `TerminalTransactionDetailSurface.tsx`, UAPI tests, Gate 2 checker | drafted | Terminal transaction state is URL-addressable, recoverable, typed, low-detail by default, and expandable without raw JSON as the ordinary operator contract. |
5353
| Wallet signer/BTC operations | Gate 3 | `packages/btd`, wallet API, BTC fee route, Terminal wallet UI | pending | Signer session, PSBT, broadcast/finality/reorg/replacement/failure states are ordinary Terminal states. |
5454
| Reading pipeline observability | Gate 4 | `packages/pipelines/asset-pack`, `packages/pipeline-hosts`, Terminal stream components | pending | Pipeline/phase/PTRR/ThricifiedGeneration/tool/prompt telemetry is complete and readable. |
5555
| AssetPack disclosure rights | Gate 5 | BTD access primitives, AssetPack preview UI, disclosure policy tests | pending | Source-safe preview and paid unlock are proven without source leakage. |
@@ -67,7 +67,8 @@ No `_legacy/` source is active source truth.
6767
| Gate branch pattern | V29 work happens on `version/v29` or `v29/gate-N-*` branches | drafted |
6868
| Spec-family shape | V29 SPEC, DELTA, NOTES, and PARITY satisfy the full spec-family checker | drafted |
6969
| Gate 1 script | `pnpm run check:v29-gate1` fails closed on stale posture or missing gates | drafted |
70-
| Product implementation gates | Gates 2-9 close Terminal transaction depth with tests and docs | pending |
70+
| Gate 2 read model | `pnpm run check:v29-gate2` proves typed route-owned Terminal transaction reading | drafted |
71+
| Product implementation gates | Gates 3-9 close remaining Terminal transaction depth with tests and docs | pending |
7172
| Promotion gate | Gate 10 closes generated proof and promotion automation | pending |
7273

7374
## Gate 1 Parity
@@ -92,3 +93,25 @@ No `_legacy/` source is active source truth.
9293
## completion condition
9394

9495
Gate 1 is complete when the V29 draft family validates, `check:v29-gate1` passes, workflow posture is V29-aware, README/docs reflect V29 initiation, and the gate branch is committed and pushed for review into `version/v29`.
96+
97+
## Gate 2 Parity
98+
99+
| Requirement | Source evidence | Current V29 judgment |
100+
| --- | --- | --- |
101+
| Selected transactions are URL-addressable | `terminal-transaction-query.ts`, `TerminalPageClient.tsx` | drafted |
102+
| Detail focus is typed and recoverable | `terminal-transaction-read-model.ts`, `TerminalTransactionDetailActionBar.tsx` | drafted |
103+
| Low-detail read model exists before raw payloads | `terminal-transaction-read-model.ts`, `TerminalTransactionDetailHero.tsx` | drafted |
104+
| Section navigation exposes availability and blockers | `terminal-transaction-read-model.ts`, `TerminalTransactionDetailSurface.tsx` | drafted |
105+
| Console is blocked outside live execution-history mode | `terminal-transaction-read-model.ts`, UAPI read-model tests | drafted |
106+
| Gate 2 checker is wired to package scripts and CI | `scripts/check-v29-gate2-terminal-transaction-read-models.mjs`, `package.json`, gate workflow | drafted |
107+
108+
## Gate 2 accepted boundaries
109+
110+
- Gate 2 does not implement wallet signing, PSBT, broadcast, reorg, or replacement depth.
111+
- Gate 2 does not implement deeper Reading pipeline telemetry; Gate 4 owns that work.
112+
- Gate 2 does not expose protected AssetPack source before settlement.
113+
- Gate 2 does not add versioned API routes or source identifiers.
114+
115+
## Gate 2 completion condition
116+
117+
Gate 2 is complete when Terminal selected transaction state rewrites recoverable URLs, a typed read model drives detail navigation and low-detail summaries, focused tests pass, `check:v29-gate2` passes, CI invokes the checker, docs name the implemented source surfaces, and the gate branch is committed and pushed for review into `version/v29`.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"check:v28-gate12": "node scripts/check-v28-gate12-settlement-rights-delivery.mjs",
4646
"check:v28-gate13": "node scripts/check-v28-gate13-product-closure-promotion-readiness.mjs",
4747
"check:v29-gate1": "node scripts/check-v29-gate1-objectives-and-gating.mjs",
48+
"check:v29-gate2": "node scripts/check-v29-gate2-terminal-transaction-read-models.mjs",
4849
"check:spec-quality": "node scripts/run-bitcode-spec-quality.mjs --mode basic",
4950
"check:spec-quality:title": "node scripts/run-bitcode-spec-quality.mjs --mode strict-from-title",
5051
"check:spec-quality:v24": "node scripts/run-bitcode-spec-quality.mjs --mode strict-version --version V24",

0 commit comments

Comments
 (0)