Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,037 changes: 1,037 additions & 0 deletions .bitcode/v38-ptrr-failsafe-thricified-stack.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .github/workflows/bitcode-canon-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ jobs:
if [ -f scripts/check-v38-gate2-inference-surface-inventory.mjs ]; then
node scripts/check-v38-gate2-inference-surface-inventory.mjs --skip-branch-check
fi
if [ -f scripts/check-v38-gate3-ptrr-failsafe-thricified-stack.mjs ]; then
node scripts/check-v38-gate3-ptrr-failsafe-thricified-stack.mjs --skip-branch-check
fi
fi
else
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/bitcode-gate-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ jobs:
if [ -f scripts/check-v38-gate2-inference-surface-inventory.mjs ]; then
node scripts/check-v38-gate2-inference-surface-inventory.mjs --skip-branch-check
fi
if [ -f scripts/check-v38-gate3-ptrr-failsafe-thricified-stack.mjs ]; then
node scripts/check-v38-gate3-ptrr-failsafe-thricified-stack.mjs --skip-branch-check
fi
fi
else
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
Expand Down Expand Up @@ -356,6 +359,9 @@ jobs:
if [ -f packages/protocol/test/v38-inference-surface-inventory.test.js ]; then
pnpm --dir packages/protocol exec node --test --test-force-exit test/v38-inference-surface-inventory.test.js
fi
if [ -f packages/protocol/test/v38-ptrr-failsafe-thricified-stack.test.js ]; then
pnpm --dir packages/protocol exec node --test --test-force-exit test/v38-ptrr-failsafe-thricified-stack.test.js
fi
pnpm --filter @bitcode/protocol test

- name: Test staged Reading route and Terminal harness contracts
Expand Down
22 changes: 16 additions & 6 deletions BITCODE_SPEC_V38.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- Prior canonical anchor: `BITCODE_SPEC_V37.md`
- Prior generated proof appendix: `BITCODE_SPEC_V37_PROVEN.md`
- Active canonical pointer during draft opening: `BITCODE_SPEC.txt` -> `V37`
- 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`, V38 gate-quality workflow evidence, and future V38 generated proof artifacts as gates close
- 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`, V38 gate-quality workflow evidence, and future V38 generated proof artifacts as gates close
- 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
- Notes companion: `BITCODE_SPEC_V38_NOTES.md`
- Delta companion: `BITCODE_SPEC_V38_DELTA.md`
Expand Down Expand Up @@ -79,6 +79,9 @@ The artifact has `source-safe-inference-surface-metadata` disclosure posture and

Gate 3 makes practical PTRR steps use `FailsafeGenerationSequence` above `ThricifiedGeneration` unless a source-backed exception is specified and tested.
It must validate prompt registry composition from phase to agent to step to Failsafe to Thricified generation and provider call, including execution ancestry state preparation and typed-output repair.
Gate 3 is closed by the package-backed `V38PtrrFailsafeThricifiedStack` source and deterministic `.bitcode/v38-ptrr-failsafe-thricified-stack.json` artifact.
The artifact has `source-safe-ptrr-failsafe-thricified-stack-metadata` disclosure posture and proves the current practical call stack with 9 source-backed rows, 69 passed source predicates, all 4 PTRR steps, all 3 Failsafe stages, all 3 ThricifiedGeneration stages, and Gate 2's 52 PTRR steps / 156 Failsafe sequences / 156 ThricifiedGeneration chains / 468 provider-call slots.
Gate 3 confirms tools remain step-owned postprocess capabilities while `FailsafeGenerationSequence` delegates final Reason, Judge, and StructuredOutput production to `ThricifiedGeneration`.

### Gate 4: PromptPart And Prompt Benchmarking

Expand Down Expand Up @@ -263,7 +266,7 @@ The V38 proof-family canon inherits all nine proof families and adds inference-f

### Inference-synthesis

proofArtifactPath: `.bitcode/v38-inference-surface-inventory.json`
proofArtifactPath: `.bitcode/v38-inference-surface-inventory.json` and `.bitcode/v38-ptrr-failsafe-thricified-stack.json`
members: pipeline phases, PTRR agents, Plan/Try/Refine/Retry steps, Failsafe chains, ThricifiedGeneration calls, provider calls
theoremIds: inference-stack-totality, typed-output-admissibility
replayStepIds: run V38 Gate 2 and Gate 3 checks
Expand Down Expand Up @@ -411,15 +414,15 @@ Generated canon for V38 includes source-safe `.bitcode/v38-*` artifacts, generat
Generated artifacts must be reproducible, deterministic where possible, and blocked when source-safe payload rules fail.
Inherited V19 reproducible-canon artifacts remain the baseline for deterministic generated proof.
Inherited V20 operator-quality artifacts remain the baseline for operator-visible quality.
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`, and later `.bitcode/v38-*` gate artifacts.
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.
V38 specifying generated artifacts include inference inventory, prompt benchmark, telemetry disclosure, depository search, AssetPack handoff, rehearsal, and promotion readiness reports.
Shared generated-artifact fields: version, currentTarget, artifactRoot, sourceRoots, proofRoots, disclosureTier, generatedAt, and command.
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.
Artifact confidentiality and disclosability taxonomy: public, source-safe, buyer-visible, reviewer-visible, operator-only, and forbidden.

## validation canon

Validation canon includes `pnpm run check:v38-gate1`, 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.
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.

## promotion canon

Expand All @@ -442,7 +445,7 @@ Each family must close with proofArtifactPath, members, theoremIds, replayStepId

| proofFamily | proofArtifactPath | memberIds | theoremIds | replayStepIds | witnessArtifactPaths | Current source basis |
| --- | --- | --- | --- | --- | --- | --- |
| Inference-synthesis | `.bitcode/v38-inference-surface-inventory.json` | phases, agents, steps, failsafes, generations | inference-stack-totality | v38-gate2, v38-gate3 | prompt receipts, generation receipts | `packages/agent-generics`, `packages/pipelines/asset-pack` |
| Inference-synthesis | `.bitcode/v38-inference-surface-inventory.json`; `.bitcode/v38-ptrr-failsafe-thricified-stack.json` | phases, agents, steps, failsafes, generations | inference-stack-totality | v38-gate2, v38-gate3 | prompt receipts, generation receipts | `packages/agent-generics`, `packages/pipelines/asset-pack` |
| Prompt-completeness | `.bitcode/v38-prompt-benchmark-report.json` | PromptParts, Prompts | prompt-registry-totality | v38-gate4 | benchmark fixtures | `packages/prompts` |
| Static-code-analysis | `.bitcode/v38-static-inference-boundary-report.json` | imports, routes, scans | source-boundary-conformance | gate-quality | workflow logs | scripts and workflows |
| Verification-decisions | `.bitcode/v38-verification-decision-report.json` | Need, fits, previews | verification-is-typed | v38-gate6, v38-gate7, v38-gate8 | verification reports | Reading pipeline packages |
Expand All @@ -464,7 +467,7 @@ Inherited V20 operator-quality artifacts remain the baseline for operator-visibl

### Exact generated-artifact inventory matrix

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`, and later `.bitcode/v38-*` gate artifacts.
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.

### V38InferenceSurfaceInventory

Expand All @@ -473,6 +476,13 @@ It is owned by `packages/protocol/src/canonical/inference-surface-inventory.js`,
It records the current active Reading and Conversation inference surface map as source-safe metadata: `ReadNeedComprehensionSynthesis`, `ReadFitsFindingSynthesis`, Website Conversation inference, stream-event interface entrypoints, doc-comment-backed tool prompt definitions, prompt registry and benchmark coverage, and the execution primitive stack.
Its current count contract is 52 PTRR steps across 156 FailsafeGenerationSequence / ThricifiedGeneration chains and 468 provider-call slots, with known V38 repair gaps explicitly carried forward to later gates instead of hidden.

### V38PtrrFailsafeThricifiedStack

`V38PtrrFailsafeThricifiedStack` is the Gate 3 source-safe stack contract for practical PTRR agents.
It is owned by `packages/protocol/src/canonical/ptrr-failsafe-thricified-stack.js`, exported by `packages/protocol/src/index.js`, type-declared by `packages/protocol/src/index.d.ts`, tested by `packages/protocol/test/v38-ptrr-failsafe-thricified-stack.test.js`, generated by `scripts/generate-v38-ptrr-failsafe-thricified-stack.mjs`, checked by `scripts/check-v38-gate3-ptrr-failsafe-thricified-stack.mjs`, and serialized to `.bitcode/v38-ptrr-failsafe-thricified-stack.json`.
It records `source-safe-ptrr-failsafe-thricified-stack-metadata`: the `factoryAgentWithPTRR` prompt carrier, Plan/Try/Refine/Retry step factories, `FailsafeGenerationSequence`, `ThricifiedGeneration`, prompt/context/telemetry substeps, step-owned tool postprocess boundaries, and the Gate 2 count binding.
Its current source-predicate contract is 69/69 passed predicates, 9 rows, 52 PTRR steps, 156 Failsafe sequences, 156 ThricifiedGeneration chains, 468 provider-call slots, and no protected source, credentials, unpaid AssetPack source, or `_legacy/` source roots.

### V38 specifying generated artifacts

V38 specifying generated artifacts include inference inventory, prompt benchmark, telemetry disclosure, depository search, AssetPack handoff, rehearsal, and promotion readiness reports.
Expand Down
8 changes: 7 additions & 1 deletion BITCODE_SPEC_V38_DELTA.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Current canonical/latest target: `V37`
- Prior canonical anchor: `BITCODE_SPEC_V37.md`
- Prior generated proof appendix: `BITCODE_SPEC_V37_PROVEN.md`
- 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`, V38 gate-quality workflow evidence, and future V38 generated proof artifacts as gates close
- 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`, V38 gate-quality workflow evidence, and future V38 generated proof artifacts as gates close
- 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
- Spec companion: `BITCODE_SPEC_V38.md`
- Notes companion: `BITCODE_SPEC_V38_NOTES.md`
Expand Down Expand Up @@ -94,6 +94,12 @@ Closure acceptance:
- exceptions are source-backed and tested;
- `pnpm run check:v38-gate3` validates stack composition, typed output repair, and telemetry events.

Closure implementation:

- `V38PtrrFailsafeThricifiedStack` is now package-backed in `packages/protocol/src/canonical/ptrr-failsafe-thricified-stack.js` and generated to `.bitcode/v38-ptrr-failsafe-thricified-stack.json`.
- The generated artifact is `source-safe-ptrr-failsafe-thricified-stack-metadata` and proves `factoryAgentWithPTRR`, all four PTRR step factories, `FailsafeGenerationSequence`, `ThricifiedGeneration`, substep prompt/context/telemetry storage, step-owned tool postprocess boundaries, and Gate 2 count binding.
- The current stack contract passes 69 source predicates and binds 52 PTRR steps to 156 Failsafe sequences, 156 ThricifiedGeneration chains, and 468 provider-call slots without serializing protected source, credentials, raw protected prompts, or unpaid AssetPack source.

### Gate 4: PromptPart And Prompt Benchmarking

Closure acceptance:
Expand Down
9 changes: 8 additions & 1 deletion BITCODE_SPEC_V38_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- Current active draft target: `V38`
- Prior canonical anchor: `BITCODE_SPEC_V37.md`
- Prior generated proof appendix: `BITCODE_SPEC_V37_PROVEN.md`
- 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`, V38 gate-quality workflow evidence, and future V38 generated proof artifacts as gates close
- 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`, V38 gate-quality workflow evidence, and future V38 generated proof artifacts as gates close
- 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
- Spec companion: `BITCODE_SPEC_V38.md`
- Delta companion: `BITCODE_SPEC_V38_DELTA.md`
Expand Down Expand Up @@ -155,6 +155,13 @@ Gate 2 closes the first concrete V38 inference audit by making the inventory pac
The current generated count is 52 PTRR steps across 156 FailsafeGenerationSequence / ThricifiedGeneration chains and 468 provider-call slots.
The inventory deliberately records known gaps, including quick-response conversation repair, prompt benchmark completion, and later PTRR/Failsafe/Thricified call-stack validation, so later V38 gates cannot hide work outside the parity matrix.

## Gate 3 implementation notes

Gate 3 closes the practical PTRR stack contract by making the existing source-backed call stack generated, tested, and workflow-checkable.
`V38PtrrFailsafeThricifiedStack` and `.bitcode/v38-ptrr-failsafe-thricified-stack.json` record `factoryAgentWithPTRR`, Plan/Try/Refine/Retry factories, `FailsafeGenerationSequence`, `ThricifiedGeneration`, prompt/context/telemetry substeps, and Gate 2 count binding as `source-safe-ptrr-failsafe-thricified-stack-metadata`.
The artifact proves 69 source predicates and binds 52 PTRR steps to 156 Failsafe sequences, 156 ThricifiedGeneration chains, and 468 provider-call slots.
Tools remain step-owned postprocess executions; `ThricifiedGeneration` remains the lowest-level Reason, Judge, StructuredOutput provider-call chain.

## V38 gate plan

- Gate 1: V38 Inference Stack Roadmap And Spec Opening
Expand Down
Loading
Loading