Skip to content

Commit e447458

Browse files
V38 Gate 5: Prove Inference Telemetry Disclosure
Adds the package-backed V38InferenceTelemetryDisclosureReport and deterministic disclosure-boundary artifact for source-safe inference telemetry rows, disclosure tiers, raw provider response boundaries, schema verdicts, retry/repair posture, and stream UI projection proof. Wires generator/checker scripts, protocol exports/tests, gate/canon workflows, roadmap advancement, and V38 spec/docs parity closure for Gate 5.
1 parent 8e88738 commit e447458

17 files changed

Lines changed: 2758 additions & 6 deletions

.bitcode/v38-disclosure-boundary-report.json

Lines changed: 1390 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
@@ -154,6 +154,9 @@ jobs:
154154
if [ -f scripts/check-v38-gate4-prompt-benchmark-report.mjs ]; then
155155
node scripts/check-v38-gate4-prompt-benchmark-report.mjs --skip-branch-check
156156
fi
157+
if [ -f scripts/check-v38-gate5-inference-telemetry-disclosure-report.mjs ]; then
158+
node scripts/check-v38-gate5-inference-telemetry-disclosure-report.mjs --skip-branch-check
159+
fi
157160
fi
158161
else
159162
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
@@ -283,6 +283,9 @@ jobs:
283283
if [ -f scripts/check-v38-gate4-prompt-benchmark-report.mjs ]; then
284284
node scripts/check-v38-gate4-prompt-benchmark-report.mjs --skip-branch-check
285285
fi
286+
if [ -f scripts/check-v38-gate5-inference-telemetry-disclosure-report.mjs ]; then
287+
node scripts/check-v38-gate5-inference-telemetry-disclosure-report.mjs --skip-branch-check
288+
fi
286289
fi
287290
else
288291
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
@@ -368,6 +371,9 @@ jobs:
368371
if [ -f packages/protocol/test/v38-prompt-benchmark-report.test.js ]; then
369372
pnpm --dir packages/protocol exec node --test --test-force-exit test/v38-prompt-benchmark-report.test.js
370373
fi
374+
if [ -f packages/protocol/test/v38-inference-telemetry-disclosure-report.test.js ]; then
375+
pnpm --dir packages/protocol exec node --test --test-force-exit test/v38-inference-telemetry-disclosure-report.test.js
376+
fi
371377
pnpm --filter @bitcode/protocol test
372378
373379
- name: Test staged Reading route and Terminal harness contracts

BITCODE_SPEC_V38.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ The artifact has `source-safe-prompt-benchmark-metadata` disclosure posture and
9696

9797
Gate 5 binds inference execution to source-safe telemetry.
9898
It must stream phase, agent, step, Failsafe, ThricifiedGeneration, tool, prompt-template, interpolated-prompt, raw-response, parsed-output, schema-verdict, retry, repair, and failure evidence at the correct disclosure tier without leaking protected source, credentials, unpaid AssetPack contents, wallet private material, or settlement private payloads.
99+
Gate 5 is closed by the package-backed `V38InferenceTelemetryDisclosureReport` source and deterministic `.bitcode/v38-disclosure-boundary-report.json` artifact.
100+
The artifact has `source-safe-inference-telemetry-disclosure-metadata` disclosure posture and records 8 telemetry/disclosure rows, 13 required telemetry levels, 12 disclosure tier ids, 66 passed source predicates, and upstream proof roots for V35 telemetry taxonomy, V37 stream events, V38 inference inventory, V38 PTRR/Failsafe/Thricified stack, and V38 prompt benchmarking.
101+
The raw provider response boundary is private or root-only: public and reader-visible streams may show raw-response presence, roots, typed output shape, schema verdicts, retry/repair posture, and prompt/template identities, but never raw provider response content, raw protected prompt text, protected source, unpaid AssetPack source, credentials, wallet private material, or private settlement payloads.
99102

100103
### Gate 6: ReadNeedComprehensionSynthesis Inference Hardening
101104

@@ -417,15 +420,15 @@ Generated canon for V38 includes source-safe `.bitcode/v38-*` artifacts, generat
417420
Generated artifacts must be reproducible, deterministic where possible, and blocked when source-safe payload rules fail.
418421
Inherited V19 reproducible-canon artifacts remain the baseline for deterministic generated proof.
419422
Inherited V20 operator-quality artifacts remain the baseline for operator-visible quality.
420-
Exact generated-artifact inventory matrix includes `.bitcode/v38-spec-family-report.json`, `.bitcode/v38-canonical-input-report.json`, `.bitcode/v38-canon-posture-drift-report.json`, `.bitcode/v38-inference-surface-inventory.json`, `.bitcode/v38-ptrr-failsafe-thricified-stack.json`, and later `.bitcode/v38-*` gate artifacts.
423+
Exact generated-artifact inventory matrix includes `.bitcode/v38-spec-family-report.json`, `.bitcode/v38-canonical-input-report.json`, `.bitcode/v38-canon-posture-drift-report.json`, `.bitcode/v38-inference-surface-inventory.json`, `.bitcode/v38-ptrr-failsafe-thricified-stack.json`, `.bitcode/v38-prompt-benchmark-report.json`, `.bitcode/v38-disclosure-boundary-report.json`, and later `.bitcode/v38-*` gate artifacts.
421424
V38 specifying generated artifacts include inference inventory, prompt benchmark, telemetry disclosure, depository search, AssetPack handoff, rehearsal, and promotion readiness reports.
422425
Shared generated-artifact fields: version, currentTarget, artifactRoot, sourceRoots, proofRoots, disclosureTier, generatedAt, and command.
423426
Artifact-specific generated payload fields: prompt ids, PromptPart ids, phase ids, agent ids, step ids, Failsafe ids, ThricifiedGeneration ids, tool ids, fit ids, ranking roots, and settlement roots.
424427
Artifact confidentiality and disclosability taxonomy: public, source-safe, buyer-visible, reviewer-visible, operator-only, and forbidden.
425428

426429
## validation canon
427430

428-
Validation canon includes `pnpm run check:v38-gate1`, `pnpm run check:v38-gate2`, `pnpm run check:v38-gate3`, later V38 gate checks, `node scripts/check-bitcode-spec-family.mjs --version V38 --mode draft --current-target V37`, `node scripts/check-bitcode-canonical-inputs.mjs --current-target V37`, `node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V37 --draft-target V38`, package tests, route tests, UI tests, prompt benchmark checks, telemetry redaction checks, and local/staging rehearsal checks.
431+
Validation canon includes `pnpm run check:v38-gate1`, `pnpm run check:v38-gate2`, `pnpm run check:v38-gate3`, `pnpm run check:v38-gate4`, `pnpm run check:v38-gate5`, later V38 gate checks, `node scripts/check-bitcode-spec-family.mjs --version V38 --mode draft --current-target V37`, `node scripts/check-bitcode-canonical-inputs.mjs --current-target V37`, `node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V37 --draft-target V38`, package tests, route tests, UI tests, prompt benchmark checks, telemetry redaction checks, and local/staging rehearsal checks.
429432

430433
## promotion canon
431434

@@ -490,6 +493,13 @@ Its current source-predicate contract is 69/69 passed predicates, 9 rows, 52 PTR
490493

491494
V38 specifying generated artifacts include inference inventory, prompt benchmark, telemetry disclosure, depository search, AssetPack handoff, rehearsal, and promotion readiness reports.
492495

496+
### V38InferenceTelemetryDisclosureReport
497+
498+
`V38InferenceTelemetryDisclosureReport` is the Gate 5 source-safe inference telemetry and disclosure tier contract.
499+
It is generated to `.bitcode/v38-disclosure-boundary-report.json` as `source-safe-inference-telemetry-disclosure-metadata`.
500+
It binds phase, agent, PTRR step, Failsafe, ThricifiedGeneration, tool, prompt template, interpolated prompt, raw response, parsed output, schema verdict, retry, repair, and stream UI projection rows to allowed payload fields, forbidden payload classes, proof roots, storage targets, stream event kinds, fail-closed states, and source predicates.
501+
Its current count contract is 8 rows, 13 required telemetry levels, 12 disclosure tier ids, 66 passed predicates, no legacy source roots, and no public raw provider response, protected source, credential, wallet private material, private settlement payload, or unpaid AssetPack source visibility.
502+
493503
### Shared generated-artifact fields
494504

495505
Shared generated-artifact fields: version, currentTarget, artifactRoot, sourceRoots, proofRoots, disclosureTier, generatedAt, and command.

BITCODE_SPEC_V38_DELTA.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ Closure acceptance:
125125
- protected payloads remain blocked or redacted;
126126
- `pnpm run check:v38-gate5` validates event contracts, UI stream compatibility, API contracts, and redaction tests.
127127

128+
Closure implementation:
129+
130+
- `V38InferenceTelemetryDisclosureReport` is now package-backed in `packages/protocol/src/canonical/inference-telemetry-disclosure-report.js` and generated to `.bitcode/v38-disclosure-boundary-report.json`.
131+
- The generated artifact is `source-safe-inference-telemetry-disclosure-metadata` and covers pipeline phase, PTRR agent step, Failsafe sequence, ThricifiedGeneration, tool execution, prompt template interpolation, raw response to parsed output schema, and stream UI/storage projection rows.
132+
- The report binds 13 required telemetry levels and 12 disclosure tier ids to allowed payload fields, forbidden payload classes, proof roots, fail-closed states, V35 telemetry taxonomy roots, V37 stream-event roots, V38 Gate 2 inventory roots, V38 Gate 3 PTRR/Failsafe/Thricified roots, and V38 Gate 4 prompt benchmark roots.
133+
- The raw provider response boundary is private or root-only: public rows can expose raw response presence, roots, typed output shape, schema verdict, retry/repair posture, and source-safe inference audit shapes, but not raw provider response content, raw protected prompts, protected source, unpaid AssetPack source, credentials, private wallet material, or private settlement payloads.
134+
128135
### Gate 6: ReadNeedComprehensionSynthesis Inference Hardening
129136

130137
Closure acceptance:

BITCODE_SPEC_V38_NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ The artifact deliberately stores prompt identities, source-safe fixture ids, typ
171171
The current generated report covers 7 benchmark rows, 13 fixtures, 24 typed-output quality expectations, 38 source predicates, 443 active PromptPart doc-comments, 39 complete Prompt doc-comments, 465 benchmark definitions, 275 PromptPart exports, and 85 Prompt constructions.
172172
Later V38 gates must use this report when streaming inference telemetry, hardening the two Reading pipelines, and applying Conversation/tool-prompt parity.
173173

174+
## Gate 5 implementation notes
175+
176+
Gate 5 closes the first source-safe inference telemetry and disclosure-tier contract by making the disclosure boundary package-backed, generated, tested, and workflow-checkable.
177+
`V38InferenceTelemetryDisclosureReport` and `.bitcode/v38-disclosure-boundary-report.json` record pipeline phase lifecycle, PTRR agent step lifecycle, FailsafeGenerationSequence lifecycle, ThricifiedGeneration lifecycle, tool execution lifecycle, prompt template interpolation, raw response to parsed output schema, and stream UI/storage projection rows as `source-safe-inference-telemetry-disclosure-metadata`.
178+
The artifact deliberately stores telemetry level ids, disclosure tier ids, source roots, proof roots, source predicate ids, allowed payload fields, forbidden payload classes, and fail-closed states rather than raw provider response content or raw protected prompt text.
179+
The current generated report covers 8 rows, 13 required telemetry levels, 12 disclosure tier ids, 66 source predicates, V35 telemetry taxonomy roots, V37 stream event roots, V38 inference inventory roots, V38 PTRR/Failsafe/Thricified stack roots, and V38 prompt benchmark roots.
180+
Prompt template identity, interpolated prompt presence, raw response presence, parsed typed output shape, schema verdicts, retry, repair, and inference audit shapes can stream at their disclosure tiers; protected source, unpaid AssetPack source, raw provider response content, credentials, private wallet material, and private settlement payloads remain blocked or private.
181+
174182
## V38 gate plan
175183

176184
- Gate 1: V38 Inference Stack Roadmap And Spec Opening

BITCODE_SPEC_V38_PARITY_MATRIX.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Current canonical/latest target: `V37`
88
- Prior canonical anchor: `BITCODE_SPEC_V37.md`
99
- Prior generated proof appendix: `BITCODE_SPEC_V37_PROVEN.md`
10-
- Generated structured artifact inventory: draft `.bitcode/v38-spec-family-report.json`, `.bitcode/v38-canonical-input-report.json`, `.bitcode/v38-canon-posture-drift-report.json`, `.bitcode/v38-inference-surface-inventory.json`, `.bitcode/v38-ptrr-failsafe-thricified-stack.json`, `.bitcode/v38-prompt-benchmark-report.json`, V38 gate-quality workflow evidence, and future V38 generated proof artifacts as gates close
10+
- Generated structured artifact inventory: draft `.bitcode/v38-spec-family-report.json`, `.bitcode/v38-canonical-input-report.json`, `.bitcode/v38-canon-posture-drift-report.json`, `.bitcode/v38-inference-surface-inventory.json`, `.bitcode/v38-ptrr-failsafe-thricified-stack.json`, `.bitcode/v38-prompt-benchmark-report.json`, `.bitcode/v38-disclosure-boundary-report.json`, V38 gate-quality workflow evidence, and future V38 generated proof artifacts as gates close
1111
- Source parity state: V38 source-side inference stack, prompt benchmarking, Reading pipeline, depository-search, telemetry, rehearsal, workflow, and promotion surfaces are draft-required until their gates close
1212
- Spec companion: `BITCODE_SPEC_V38.md`
1313
- Notes companion: `BITCODE_SPEC_V38_NOTES.md`
@@ -69,6 +69,11 @@ Gate 1 audit basis:
6969
- `packages/protocol/test/v38-prompt-benchmark-report.test.js`
7070
- `scripts/generate-v38-prompt-benchmark-report.mjs`
7171
- `scripts/check-v38-gate4-prompt-benchmark-report.mjs`
72+
- `.bitcode/v38-disclosure-boundary-report.json`
73+
- `packages/protocol/src/canonical/inference-telemetry-disclosure-report.js`
74+
- `packages/protocol/test/v38-inference-telemetry-disclosure-report.test.js`
75+
- `scripts/generate-v38-inference-telemetry-disclosure-report.mjs`
76+
- `scripts/check-v38-gate5-inference-telemetry-disclosure-report.mjs`
7277

7378
No `_legacy/` source is active source truth.
7479

@@ -86,6 +91,7 @@ No `_legacy/` source is active source truth.
8691
| Inference surface inventory | Gate 2 | `V38InferenceSurfaceInventory`, `.bitcode/v38-inference-surface-inventory.json`, protocol test, generator, checker, workflows | closed | Source-safe inventory covers Reading, Conversation, tool-definition prompt, interface entrypoint, prompt registry, and execution primitive families with 52 PTRR steps and later-gate gaps explicit. |
8792
| PTRR Failsafe and Thricified execution stack | Gate 3 | `V38PtrrFailsafeThricifiedStack`, `.bitcode/v38-ptrr-failsafe-thricified-stack.json`, protocol test, generator, checker, workflows | closed | Practical PTRR agents prove four steps, three Failsafe stages, three ThricifiedGeneration stages, 69 source predicates, and Gate 2 count binding with step-owned tools. |
8893
| PromptPart and Prompt benchmarking | Gate 4 | `V38PromptBenchmarkReport`, `.bitcode/v38-prompt-benchmark-report.json`, protocol test, generator, checker, workflows | closed | Source-safe benchmark report covers active Reading, Conversation, and tool-definition PromptParts and complete Prompts with 7 rows, 13 fixtures, 24 typed-output quality expectations, and 38 passed source predicates. |
94+
| Inference telemetry and disclosure tiers | Gate 5 | `V38InferenceTelemetryDisclosureReport`, `.bitcode/v38-disclosure-boundary-report.json`, protocol test, generator, checker, workflows | closed | Source-safe telemetry disclosure report covers phase, agent, PTRR step, Failsafe, ThricifiedGeneration, tool, prompt template, interpolated prompt, raw response root, parsed typed output shape, schema verdict, retry, repair, and stream UI projection rows with 8 rows, 13 telemetry levels, 12 disclosure tier ids, and 66 passed predicates. |
8995

9096
## V38 implementation checklist
9197

@@ -101,6 +107,7 @@ No `_legacy/` source is active source truth.
101107
| Inference surface inventory | `.bitcode/v38-inference-surface-inventory.json` and `V38InferenceSurfaceInventory` are generated, tested, checked, documented, and workflow-wired as `source-safe-inference-surface-metadata` | closed |
102108
| PTRR stack artifact | `.bitcode/v38-ptrr-failsafe-thricified-stack.json` and `V38PtrrFailsafeThricifiedStack` are generated, tested, checked, documented, and workflow-wired as `source-safe-ptrr-failsafe-thricified-stack-metadata` | closed |
103109
| Prompt benchmark artifact | `.bitcode/v38-prompt-benchmark-report.json` and `V38PromptBenchmarkReport` are generated, tested, checked, documented, and workflow-wired as `source-safe-prompt-benchmark-metadata` | closed |
110+
| Inference telemetry disclosure artifact | `.bitcode/v38-disclosure-boundary-report.json` and `V38InferenceTelemetryDisclosureReport` are generated, tested, checked, documented, and workflow-wired as `source-safe-inference-telemetry-disclosure-metadata` with disclosure tier and raw provider response boundaries explicit | closed |
104111
| Inference stack vocabulary | V38 spec family names `PipelineExecution`, PTRR agents, Plan, Try, Refine, Retry, `FailsafeGenerationSequence`, `ThricifiedGeneration`, `ToolExecution`, `DocCodeToolPrompt`, and provider call boundaries | drafted |
105112
| Reading vocabulary | V38 spec family names `ReadNeedComprehensionSynthesis` and `ReadFitsFindingSynthesis` | drafted |
106113
| Depository search vocabulary | V38 spec family names lexical, symbolic, path, metadata, measurement, embedding/vector, provider-specific channels, candidate deposits, ranking, thresholds, and selected-fit provenance | drafted |
@@ -169,9 +176,25 @@ No `_legacy/` source is active source truth.
169176
| Count contract is explicit | 7 rows, 13 fixtures, 24 typed-output quality expectations, 38 source predicates, 443 PromptPart doc-comments, 39 complete Prompt doc-comments, 465 benchmark definitions, 275 PromptPart exports, and 85 Prompt constructions | closed |
170177
| Gate checker is wired | `pnpm run check:v38-gate4`, package test, generator check, gate/canon workflows | closed |
171178

179+
## Gate 5 Parity
180+
181+
| Requirement | Source evidence | Current V38 judgment |
182+
| --- | --- | --- |
183+
| Telemetry disclosure source is package-owned | `packages/protocol/src/canonical/inference-telemetry-disclosure-report.js`, `packages/protocol/src/index.js`, `packages/protocol/src/index.d.ts` | closed |
184+
| Deterministic artifact exists | `.bitcode/v38-disclosure-boundary-report.json` | closed |
185+
| Source-safe disclosure posture is explicit | `source-safe-inference-telemetry-disclosure-metadata`, disclosure tier ids, forbidden payload classes, no protected source, credentials, private wallet material, private settlement payload, or unpaid AssetPack source | closed |
186+
| Pipeline phase rows are covered | `storePhaseStart`, `storePhaseComplete`, `phase-start`, `phase-complete`, phase input/output summaries | closed |
187+
| PTRR agent step rows are covered | agent start/complete events, Plan/Try/Refine/Retry factories, source-safe step traces | closed |
188+
| Failsafe rows are covered | prepare-context, chunk-then-sum, stitch-until-complete, retry, repair, prompt-pruned trace posture | closed |
189+
| ThricifiedGeneration rows are covered | Reason, Judge, StructuredOutput, prompt template ids, interpolation roots, raw response roots, parsed typed output shape, schema verdicts | closed |
190+
| Tool rows are covered | `ToolExecution`, tools namespace, invocation/result events, tool input/output/error shape telemetry | closed |
191+
| Stream UI projection is covered | Terminal harness stream snapshots, `readingPipelineTelemetry`, `inferenceAudit`, rich execution log metadata, V37 stream UI parity | closed |
192+
| Count contract is explicit | 8 rows, 13 required telemetry levels, 12 disclosure tier ids, 66 source predicates, V35/V37/V38 proof roots | closed |
193+
| Gate checker is wired | `pnpm run check:v38-gate5`, package test, generator check, gate/canon workflows | closed |
194+
172195
## Completion condition
173196

174-
Gate 4 closes when `pnpm run check:v38-gate4`, the V38 prompt benchmark report generator check, Gate 3 PTRR/Failsafe/Thricified stack checks, Gate 2 inventory checks, V38 draft spec-family validation over V37, V37/V38 canon-posture drift validation, canonical input validation for V37, strict V38 spec quality, protocol tests, workflow wiring checks, secret scans, and diff hygiene all pass on `v38/gate-4-promptpart-prompt-benchmarking`.
197+
Gate 5 closes when `pnpm run check:v38-gate5`, the V38 inference telemetry disclosure report generator check, Gate 4 prompt benchmark checks, Gate 3 PTRR/Failsafe/Thricified stack checks, Gate 2 inventory checks, V38 draft spec-family validation over V37, V37/V38 canon-posture drift validation, canonical input validation for V37, strict V38 spec quality, protocol tests, workflow wiring checks, secret scans, and diff hygiene all pass on `v38/gate-5-inference-telemetry-disclosure-tiers`.
175198

176199
## accepted boundaries
177200

0 commit comments

Comments
 (0)