Skip to content

Commit b6a592f

Browse files
Merge pull request #143 from engineeredsoftware/v39/gate-8-operational-telemetry-repair-readback
V39 Gate 8: Operational Telemetry Repair Readback
2 parents 6abc5bf + 09f9993 commit b6a592f

29 files changed

Lines changed: 2987 additions & 118 deletions

.bitcode/v39-operational-telemetry-repair-readback.json

Lines changed: 607 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
@@ -202,6 +202,9 @@ jobs:
202202
if [ -f scripts/check-v39-gate7-settlement-rights-delivery.mjs ]; then
203203
node scripts/check-v39-gate7-settlement-rights-delivery.mjs --skip-branch-check --skip-package-tests
204204
fi
205+
if [ -f scripts/check-v39-gate8-operational-telemetry-repair-readback.mjs ]; then
206+
node scripts/check-v39-gate8-operational-telemetry-repair-readback.mjs --skip-branch-check --skip-package-tests --skip-uapi-tests
207+
fi
205208
fi
206209
else
207210
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ jobs:
331331
if [ -f scripts/check-v39-gate7-settlement-rights-delivery.mjs ]; then
332332
node scripts/check-v39-gate7-settlement-rights-delivery.mjs --skip-branch-check --skip-package-tests
333333
fi
334+
if [ -f scripts/check-v39-gate8-operational-telemetry-repair-readback.mjs ]; then
335+
node scripts/check-v39-gate8-operational-telemetry-repair-readback.mjs --skip-branch-check --skip-package-tests --skip-uapi-tests
336+
fi
334337
fi
335338
else
336339
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
@@ -409,6 +412,7 @@ jobs:
409412
pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --runTestsByPath src/__tests__/asset-pack-disclosure.test.ts src/__tests__/postprocess.test.ts src/__tests__/read-need.test.ts src/__tests__/read-need-review-resynthesis.test.ts --runInBand --forceExit
410413
pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --runTestsByPath src/__tests__/asset-pack-preview-boundary.test.ts --runInBand --forceExit
411414
pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --runTestsByPath src/__tests__/asset-pack-settlement-rights-delivery.test.ts --runInBand --forceExit
415+
pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --runTestsByPath src/__tests__/reading-operational-telemetry-repair-readback.test.ts --runInBand --forceExit
412416
pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/conversations/__tests__/stream-events.test.ts src/conversations/__tests__/privacy.test.ts src/conversations/__tests__/telemetry.test.ts --runInBand --forceExit
413417
pnpm --dir packages/protocol exec node --test --test-force-exit test/conversation-telemetry-proof-hooks.test.js
414418
pnpm --dir packages/protocol exec node --test --test-force-exit test/conversation-rehearsal.test.js
@@ -490,6 +494,7 @@ jobs:
490494
tests/terminalTransactionDetailSnapshot.test.ts \
491495
tests/terminalUxBrowserProof.test.tsx \
492496
tests/bitcodeBrowserAccessibilityResponsiveProof.test.ts \
497+
tests/readingOperationalTelemetryPipelineLog.test.tsx \
493498
tests/pipelineExecutionLogHeader.test.tsx \
494499
--runInBand
495500

BITCODE_SPEC_V39.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,32 @@ responses. The deterministic source-safe proof artifact is
187187
Gate 8 makes the Reading product observable and repairable.
188188
It must stream source-safe phase, agent, step, Failsafe, ThricifiedGeneration, tool, storage, ledger, wallet, delivery, and UI events into the rich execution log and operator readback surfaces with proof roots and runbook hooks.
189189

190+
The package-owned closure type is `ReadingOperationalTelemetryRepairReadback`
191+
in
192+
`packages/pipelines/asset-pack/src/reading-operational-telemetry-repair-readback.ts`.
193+
It projects `ReadNeedComprehensionSynthesis` and
194+
`ReadFitsFindingSynthesis` pipeline contracts into
195+
`ReadingOperationalTelemetryEvent` rows for phase, PTRR agent, PTRR step,
196+
`FailsafeGenerationSequence`, `ThricifiedGeneration`, `ToolExecution`,
197+
storage, ledger, wallet, delivery, UI, and repair posture. Each event carries
198+
`ReadingOperationalExecutionState` with event id, proof root,
199+
prompt-template identity, output schema/return type, redaction posture,
200+
prompt disclosure posture, result disclosure posture, and fail-closed state
201+
where applicable.
202+
203+
The operator readback persists `ReadingOperationalOperatorReadback`,
204+
source-safe stream events, repair runbook hooks, telemetry roots, repair
205+
roots, and readback roots under `reading/operational`. The shared rich
206+
execution log accepts direct operational telemetry payloads and renders
207+
Reading pipeline, phase, PTRR agent, PTRR step, Failsafe, generation, tool,
208+
schema, event, proof, disclosure, and fail-closed metadata in collapsed rows
209+
with expandable details. No operational artifact may serialize protected
210+
source, raw protected prompts, raw interpolated prompts, raw provider
211+
responses, unpaid AssetPack source, wallet private material, private
212+
settlement payloads, or credentials. The deterministic source-safe proof
213+
artifact is `.bitcode/v39-operational-telemetry-repair-readback.json`,
214+
checked by `pnpm run check:v39-gate8`.
215+
190216
### Gate 9: Interface And Conversation Product Parity
191217

192218
Gate 9 brings Conversation, MCP/API, ChatGPT App, and package-facing interfaces into the same Reading contract without creating parallel authority.

BITCODE_SPEC_V39_DELTA.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ Closure acceptance:
199199

200200
Closure implementation:
201201

202-
- Pending Gate 8 work must define telemetry/repair artifacts and route or component tests.
202+
- Gate 8 package source is `packages/pipelines/asset-pack/src/reading-operational-telemetry-repair-readback.ts`.
203+
- `ReadingOperationalTelemetryRepairReadback` emits `ReadingOperationalTelemetryEvent`, `ReadingOperationalOperatorReadback`, `ReadingOperationalTelemetryStorageRecord`, and `ReadingOperationalRepairRunbookHook` projections under `reading/operational`.
204+
- Event kinds are phase, PTRR agent, PTRR step, Failsafe, ThricifiedGeneration, ToolExecution, storage, ledger, wallet, delivery, UI, and repair; each event carries proof roots plus prompt/result disclosure posture.
205+
- The rich execution log and header accept direct Reading operational telemetry payloads and render pipeline, phase, agent, step, Failsafe, generation, tool, schema, event, proof, redaction, prompt disclosure, result disclosure, and fail-closed posture.
206+
- Focused package tests cover complete settled stream coverage, BTC-finality repair, and persistence; focused UI tests cover direct Reading telemetry rendering.
207+
- The generated proof artifact is `.bitcode/v39-operational-telemetry-repair-readback.json`; `pnpm run check:v39-gate8` validates artifact freshness, protocol tests, package tests, UI tests, docs, source safety, and workflow wiring.
203208

204209
### Gate 9: Interface And Conversation Product Parity
205210

BITCODE_SPEC_V39_NOTES.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,25 @@ credential value.
254254

255255
## Gate 8 implementation notes
256256

257-
Gate 8 closes operational telemetry, repair, and operator readback for Reading. Every pipeline, storage, ledger, wallet, delivery, and UI event must be source-safe, proof-rooted, and tied to repair/runbook posture.
257+
Gate 8 closes operational telemetry, repair, and operator readback for Reading.
258+
`ReadingOperationalTelemetryRepairReadback` is the package-owned seam that
259+
turns Reading pipeline contracts, storage projections, settlement facts, UI
260+
stage states, and repair posture into source-safe operator telemetry. Every
261+
phase, PTRR agent, PTRR step, `FailsafeGenerationSequence`,
262+
`ThricifiedGeneration`, `ToolExecution`, storage, ledger, wallet, delivery,
263+
UI, and repair event is proof-rooted and carries the execution-state metadata
264+
needed by the rich log component. Prompt visibility is template-id only;
265+
result visibility is parsed shape and proof roots only; raw interpolated
266+
prompts and raw provider responses stay absent. Repair hooks include rich-log
267+
inspection, source-safe metadata inspection, Need resynthesis, Depository
268+
search repair, BTC finality observation, projection repair, and pull-request
269+
delivery recovery.
270+
271+
The operator readback persists under `reading/operational` as readback,
272+
operatorReadback, streamEvents, runbookHooks, telemetryRoot, repairRoot, and
273+
readbackRoot records. Gate 8 also extends the shared execution log to accept
274+
direct operational telemetry payloads so live Reading runs can display a
275+
compact row-by-row stream while preserving expandable source-safe metadata.
258276

259277
## Gate 9 implementation notes
260278

BITCODE_SPEC_V39_PARITY_MATRIX.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ No `_legacy/` source is active source truth.
7676
| ReadFitsFinding runtime and replay | Gate 5 | `packages/pipelines/asset-pack/src/read-fits-finding-runtime.ts`, `depository-search.ts`, `.bitcode/v39-read-fits-finding-runtime.json`, package tests, protocol tests | implemented | Finding Fits searches the whole available Depository for many above-threshold candidates and persists source-safe replay, storage, telemetry, and repair receipts. |
7777
| AssetPack preview and quote boundary | Gate 6 | `packages/pipelines/asset-pack/src/asset-pack-preview-boundary.ts`, `.bitcode/v39-assetpack-preview-quote-boundary.json`, package tests, protocol tests | implemented | Preview exposes source-safe measurements, deterministic quote, settlement instructions, and withheld delivery posture without source-bearing AssetPack content. |
7878
| Settlement, BTD rights, and delivery | Gate 7 | `packages/pipelines/asset-pack/src/asset-pack-settlement-rights-delivery.ts`, `.bitcode/v39-settlement-rights-delivery.json`, BTD receipt/source-to-shares/reconciliation primitives, package tests, protocol tests | implemented | Payment unlocks rights and delivery only when finality, source-to-shares, BTD rights, reconciliation, and pull-request delivery agree; repair paths are auditable. |
79-
| Operational telemetry and repair | Gate 8 | stream events, operator readback, runbook hooks, proof roots, repair commands | pending | Reading is observable and repairable end to end. |
79+
| Operational telemetry and repair | Gate 8 | `ReadingOperationalTelemetryRepairReadback`, `.bitcode/v39-operational-telemetry-repair-readback.json`, package tests, UI tests, protocol tests | implemented | Reading is observable and repairable end to end through source-safe stream events, operator readback, runbook hooks, proof roots, and repair commands. |
8080
| Interface and Conversation parity | Gate 9 | Conversation, MCP/API, ChatGPT App, package contract tests | pending | Interfaces follow Terminal authority and cannot bypass gating, preview, settlement, rights, or delivery boundaries. |
8181
| Local and staging rehearsal | Gate 10 | local/staging lanes, real-inference gates, depository search, preview, settlement/delivery posture | pending | The full Reading flow rehearses in local and staging-testnet with production-mainnet value-bearing admission blocked. |
8282
| Promotion readiness | Gate 11 | V39 promotion report, generated proof appendix, promotion workflow, command dry-run | pending | V39 promotes only after all commercial Reading gates and source-safety evidence close. |
@@ -98,6 +98,7 @@ No `_legacy/` source is active source truth.
9898
| ReadFitsFinding runtime | `ReadFitsFindingSynthesis` searches many above-threshold deposits with replayable query, ranking, threshold, and selected-fit provenance receipts | implemented |
9999
| Preview and quote | AssetPack preview is source-safe and quote is deterministic before settlement | implemented |
100100
| Settlement and delivery | BTC settlement, BTD rights transfer, source-to-shares compensation, ledger/database/storage sync, and delivery are auditable | implemented |
101+
| Operational telemetry and repair | Reading stream events, operator readback, rich log rendering, proof roots, and repair hooks are source-safe and replayable | implemented |
101102
| Telemetry and repair | Reading emits source-safe rich stream events and operator readback with proof roots and repair posture | pending |
102103
| Interface parity | Conversation, MCP/API, ChatGPT App, and package consumers cannot bypass Terminal Reading authority | pending |
103104
| Local/staging rehearsal | Full Reading flow rehearses locally and in staging-testnet with mainnet value-bearing admission blocked | pending |
@@ -218,6 +219,23 @@ or unpaid AssetPack source. The generated proof artifact is
218219
`.bitcode/v39-settlement-rights-delivery.json` and the gate check is
219220
`pnpm run check:v39-gate7`.
220221

222+
## Gate 8 Parity
223+
224+
V39 Gate 8 is implemented when
225+
`ReadingOperationalTelemetryRepairReadback` wraps the Reading runtime,
226+
preview, settlement, storage, UI, and repair posture into source-safe
227+
operator readback. The parity source is
228+
`packages/pipelines/asset-pack/src/reading-operational-telemetry-repair-readback.ts`.
229+
It emits event kinds for phase, PTRR agent, PTRR step,
230+
`FailsafeGenerationSequence`, `ThricifiedGeneration`, `ToolExecution`,
231+
storage, ledger, wallet, delivery, UI, and repair. It persists
232+
`reading/operational` readback, stream events, runbook hooks, telemetry root,
233+
repair root, and readback root. The shared execution log accepts direct
234+
Reading telemetry payloads and renders event/proof/disclosure metadata without
235+
source leakage. The generated proof artifact is
236+
`.bitcode/v39-operational-telemetry-repair-readback.json` and the gate check
237+
is `pnpm run check:v39-gate8`.
238+
221239
## completion condition
222240

223-
V39 Gate 7 is complete when `check:v39-gate7`, focused AssetPack settlement rights delivery package tests, V39 draft spec-family validation, V38/V39 canon-posture drift validation, promoted V38 spec-family validation, and Gate Quality pass on a `v39/gate-7-*` branch.
241+
V39 Gate 8 is complete when `check:v39-gate8`, focused AssetPack operational telemetry package tests, focused rich execution log UI tests, V39 draft spec-family validation, V38/V39 canon-posture drift validation, promoted V38 spec-family validation, and Gate Quality pass on a `v39/gate-8-*` branch.

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,15 @@ private settlement payloads, credentials, raw protected prompts, raw provider
301301
responses, or unpaid AssetPack source. Use
302302
`pnpm run generate:v39-settlement-rights-delivery` and
303303
`pnpm run check:v39-gate7` before closing the gate.
304+
V39 Gate 8 adds the package-owned
305+
`ReadingOperationalTelemetryRepairReadback` and source-safe generated artifact
306+
`.bitcode/v39-operational-telemetry-repair-readback.json`. Reading now
307+
projects phase, PTRR agent, PTRR step, Failsafe, ThricifiedGeneration,
308+
ToolExecution, storage, ledger, wallet, delivery, UI, and repair events into
309+
operator readback with proof roots, runbook hooks, prompt/result disclosure
310+
posture, and rich execution-log rendering. Use
311+
`pnpm run generate:v39-operational-telemetry-repair-readback` and
312+
`pnpm run check:v39-gate8` before closing the gate.
304313
V36 Gate 2 anchors market-wide activity through the package-owned
305314
`ExchangeActivityBook` and the source-safe generated artifact
306315
`.bitcode/v36-exchange-activity-book.json`, including listing, bid, ask,
@@ -468,7 +477,11 @@ through `pnpm run check:v39-gate4`; V39 Gate 5 is wired through
468477
`pnpm run check:v39-gate5` and its generated
469478
`.bitcode/v39-read-fits-finding-runtime.json` artifact. V39 Gate 6 is wired
470479
through `pnpm run check:v39-gate6` and its generated
471-
`.bitcode/v39-assetpack-preview-quote-boundary.json` artifact.
480+
`.bitcode/v39-assetpack-preview-quote-boundary.json` artifact. V39 Gate 7 is
481+
wired through `pnpm run check:v39-gate7` and its generated
482+
`.bitcode/v39-settlement-rights-delivery.json` artifact. V39 Gate 8 is wired
483+
through `pnpm run check:v39-gate8` and its generated
484+
`.bitcode/v39-operational-telemetry-repair-readback.json` artifact.
472485
V38 Gates 1 through 11 are wired through `pnpm run check:v38-gate1`,
473486
`pnpm run check:v38-gate2`, `pnpm run check:v38-gate3`,
474487
`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 7 Settlement, BTD Rights Transfer, And Delivery.
9-
- Next queued gate after V39 Gate 7 closure: V39 Gate 8 Operational Telemetry, Repair, And Operator Readback.
8+
- Current working gate: V39 Gate 8 Operational Telemetry, Repair, And Operator Readback.
9+
- Next queued gate after V39 Gate 8 closure: V39 Gate 9 Interface And Conversation Product Parity.
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`.
@@ -67,6 +67,7 @@
6767
- V39 Gate 5 closure anchor: Commercial Reading readiness now owns package-backed `ReadFitsFindingRuntime` source, deterministic `.bitcode/v39-read-fits-finding-runtime.json`, accepted-Need-only Finding Fits admission, source-safe query plans, seven search channels, many-candidate ranking, selected-fit provenance roots, active OpenAI embedding policy, replay receipts, repair posture, package tests, protocol tests, workflow wiring, and `check:v39-gate5`.
6868
- V39 Gate 6 closure anchor: Reading readiness now owns package-backed `AssetPackPreviewBoundary` source, deterministic `.bitcode/v39-assetpack-preview-quote-boundary.json`, source-safe preview measurements, deterministic share-to-fee BTC quotes, disclosure leak scanning, selected-fit provenance, settlement instructions, withheld pull-request delivery posture, replay receipts, repair posture, package tests, protocol tests, workflow wiring, and `check:v39-gate6`.
6969
- V39 Gate 7 closure anchor: Reading readiness now owns package-backed `AssetPackSettlementRightsDeliveryBoundary` source, deterministic `.bitcode/v39-settlement-rights-delivery.json`, BTC payment observation/finality, source-to-shares contributor compensation, BTD rights transfer/read receipts, settlement unlock readback, ledger/database/object-storage reconciliation, post-settlement pull-request delivery unlock, repair posture, package tests, protocol tests, workflow wiring, and `check:v39-gate7`.
70+
- V39 Gate 8 closure anchor: Reading readiness now owns package-backed `ReadingOperationalTelemetryRepairReadback` source, deterministic `.bitcode/v39-operational-telemetry-repair-readback.json`, source-safe phase/PTRR agent/PTRR step/Failsafe/ThricifiedGeneration/tool/storage/ledger/wallet/delivery/UI/repair events, operator readback, proof roots, runbook hooks, rich execution log rendering, package tests, UI tests, protocol tests, workflow wiring, and `check:v39-gate8`.
7071
- Purpose: concise running index of Bitcode/ENGI specification history, current work, and planned work.
7172

7273
This roadmap is not an active system specification.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@
233233
"generate:v39-settlement-rights-delivery": "node scripts/generate-v39-settlement-rights-delivery.mjs",
234234
"check:v39-settlement-rights-delivery": "node scripts/generate-v39-settlement-rights-delivery.mjs --check",
235235
"check:v39-gate7": "node scripts/check-v39-gate7-settlement-rights-delivery.mjs",
236+
"generate:v39-operational-telemetry-repair-readback": "node scripts/generate-v39-operational-telemetry-repair-readback.mjs",
237+
"check:v39-operational-telemetry-repair-readback": "node scripts/generate-v39-operational-telemetry-repair-readback.mjs --check",
238+
"check:v39-gate8": "node scripts/check-v39-gate8-operational-telemetry-repair-readback.mjs",
236239
"generate:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs",
237240
"check:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs --check",
238241
"check:v38-gate2": "node scripts/check-v38-gate2-inference-surface-inventory.mjs",

0 commit comments

Comments
 (0)