Skip to content

Commit 950c78d

Browse files
Merge pull request #123 from engineeredsoftware/v37/gate-11-post-promotion-boundary-hardening
V37 Gate 11: Post-Promotion Boundary Hardening
2 parents 68d69ed + 389ba71 commit 950c78d

6 files changed

Lines changed: 154 additions & 22 deletions

File tree

BITCODE_SPEC_V38_NOTES.md

Lines changed: 133 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,135 @@
1-
V38 should ensure PTRR agents' steps use FailsafeGenerations above (sans tools) ThricifiedGenerations (RJS per Failsafe (context preparation, large input handling, large output handling - each RJS (Thriceified) within them)
1+
# Bitcode Spec V38 Notes
22

3-
Thricification is the lowest-level inference call chaining (final prompt regsitry resolutions (above call chain) to compose final form, inteprolations formatted etc.). Failsafes are also generic inference chains but delegate their internal infer down (again, in the case of PTRR agent implementations) to Thricified
3+
## Status
44

5-
Ensure pipeline execution agents inference call stack is completed correctly (prompt registries and final compositions and interpolations, prompt contents and context expectations, generation implementations (Failsafes, Thricifieds) from phase->agents(PTRR)->steps->...
5+
- Canonical pointer: `BITCODE_SPEC.txt` -> `V37`
6+
- Active canonical anchor: `BITCODE_SPEC_V37.md`
7+
- Active generated proof appendix: `BITCODE_SPEC_V37_PROVEN.md`
8+
- V38 state: notes-only draft opening
9+
10+
## Notes-only draft rule
11+
12+
V38 begins as a notes-only draft opening, not first-gate implementation. The
13+
active implementation remains V37 until a V38 version branch and Gate 1 draft
14+
family explicitly open the V38 specification set.
15+
16+
These notes preserve candidate work without creating source identifiers,
17+
routes, tests, or package APIs that claim V38 implementation before Gate 1.
18+
19+
## Deferred from V37
20+
21+
V37 promoted Website Conversations. V38 is inference-focused: it should correct
22+
remaining gaps in the pipeline inference stack, fully use Bitcode's existing
23+
agent, prompt, execution, tool, telemetry, and registry primitives, and bring
24+
all Reading inference surfaces to commercial-readiness without weakening any
25+
runtime boundary.
26+
27+
Source anchors already exist and must be audited before V38 implementation:
28+
29+
- `packages/agent-generics/src/steps/failsafe-sequence.ts` defines
30+
`FailsafeGenerationSequence` as prepare-concise-context, chunk-then-sum, and
31+
stitch-until-complete wrappers over `ThricifiedGeneration`.
32+
- `packages/agent-generics/src/steps/thricified-generation.ts` defines
33+
`ThricifiedGeneration` as the strict Reason, Judge, StructuredOutput chain.
34+
- `packages/agent-generics/src/agents/factories.ts` requires
35+
`factoryAgentWithPTRR` callers to provide an agent prompt plus complete
36+
Plan, Try, Refine, and Retry step prompt registries.
37+
- `packages/tools-generics/src/Tool.ts`,
38+
`packages/tools-generics/src/doc-code-tool/DocCodeToolPrompt.ts`, and
39+
`packages/tools-generics/src/doc-code-tool/formatUsableTools.ts` define the
40+
doc-comment-backed tool prompt path that inference prompts must consume.
41+
- `packages/pipelines/asset-pack/src/reading-pipeline-contract.ts`,
42+
`packages/pipelines/asset-pack/src/read-need.ts`,
43+
`packages/pipelines/asset-pack/src/depository-search.ts`, and
44+
`packages/pipelines/asset-pack/src/tools/*DepositorySearchTool*` define the
45+
current `ReadNeedComprehensionSynthesis` and
46+
`ReadFitsFindingSynthesis` contracts, tools, search result shape, and
47+
source-safe preview boundary.
48+
49+
Thricification remains the lowest-level inference call chain. It is the final
50+
place where phase, agent, step, substep, tool-documentation, and generation
51+
prompt registries are resolved, composed, interpolated, and constrained to the
52+
typed output. Failsafe chains may prepare context, chunk large inputs, summarize
53+
or stitch large outputs, retry repairable typed-output failures, and organize
54+
execution ancestry state around those calls, but inside PTRR agents they must
55+
delegate final reason, judge-reasoning, and structured typed response
56+
production to `ThricifiedGeneration`.
57+
58+
Tools remain step-owned capability executions, not hidden children of
59+
`ThricifiedGeneration`. Tool definitions must still be represented in final
60+
prompts through the doc-comment `DocCodeToolPrompt` path, composed and
61+
interpolated at the lowest inference point with the same source-safe telemetry
62+
discipline as all other prompt material.
63+
64+
## Candidate V38 workstreams
65+
66+
- Audit every inference point in Reading pipelines, Website Conversations,
67+
tool-definition prompts, and interface-specific inference entrypoints. The
68+
audit must count base primitives and specific implementations separately:
69+
phase prompts, PTRR agent prompts, step prompts, Failsafe substep prompts,
70+
ThricifiedGeneration prompts, tool prompt definitions, prompt templates,
71+
interpolation bindings, expected context fields, raw outputs, parsed typed
72+
outputs, and repair/failure surfaces.
73+
- Specify the exact execution stack for pipeline agents without overlapping
74+
names: PipelineExecution owns phases; PTRR agents own Plan, Try, Refine, and
75+
Retry steps; FailsafeGenerationSequence owns context preparation, large input
76+
handling, large output handling, and repair orchestration; ThricifiedGeneration
77+
owns Reason, Judge, and StructuredOutput inference calls; ToolExecution owns
78+
callable tools and tool input/output receipts.
79+
- Require all PTRR agent steps to use practical FailsafeGenerationSequence
80+
layers above ThricifiedGeneration unless a source-backed exception is
81+
specified, tested, and justified. The default Reading stack should be
82+
PipelineExecution -> PTRR agent -> PTRR step -> FailsafeGenerationSequence ->
83+
ThricifiedGeneration -> provider call.
84+
- Finish prompt and PromptPart benchmarking so semantically divided
85+
PromptParts and complete Prompts are both benchmarkable. V38 Gate 1 should
86+
inventory existing `benchmarks:` doc-comment metadata, the
87+
`packages/prompts/src/benchmarking/*` runner, and all Reading and
88+
conversation prompt surfaces, then define initial benchmark suites for every
89+
prompt part and prompt used by active inference.
90+
- Complete prompt registry composition and interpolation rules from phase
91+
prompts through agent prompts, step prompts, substep prompts, final generation
92+
prompts, and tool documentation. The final inference call must expose the
93+
unrendered template identity, interpolated prompt, context bindings, selected
94+
tools, raw response, parsed output, and schema verdict to telemetry at the
95+
proper disclosure tier.
96+
- Integrate this inference work with prior telemetry. Execution ancestry
97+
state-stack data must be written, read, prepared by Failsafe layers,
98+
interpolated into prompts, maintained through retries, and streamed as
99+
source-safe phase, agent, step, Failsafe, ThricifiedGeneration, tool, input,
100+
output, and typed-result events.
101+
- Complete `ReadFitsFindingSynthesis` depository-search internals as the
102+
coupled second focus of V38. Fit-finding queries are inference-derived and
103+
must search throughout the Bitcode Depository using lexical, symbolic, path,
104+
metadata, measurement, embedding/vector, and provider-specific channels where
105+
appropriate.
106+
- Harden the depository-search tool and primitive utility stack around source
107+
embeddings, measurement embeddings, metadata embeddings, query synthesis,
108+
ranking, verification, and AssetPack synthesis handoff. Existing OpenAI
109+
embedding policy (`text-embedding-3-small`, 1536 dimensions, cosine
110+
`match_deliverable_vectors`) is an active source anchor, and V38 may specify
111+
additional LlamaIndex, Pinecone, or provider-backed channels only when their
112+
boundaries, storage, credentials, telemetry, and tests are explicit.
113+
- Preserve the economic carry-through from found fits to AssetPack settlement:
114+
selected fit deposits must remain traceable into source-safe preview,
115+
post-settlement delivery, contributor compensation, exact ledger/database
116+
synchronization, and proof receipts.
117+
- Clarify how Bitcoin, GitHub, compute, storage, and build/process boundaries
118+
are represented in long-running inference and pipeline telemetry.
119+
- Confirm that source-safe telemetry exposes prompt templates, interpolated
120+
prompts, raw provider responses, parsed typed results, repair attempts, and
121+
failed-output evidence only at their permitted disclosure tier.
122+
123+
The V38 acceptance posture is commercial inference correctness: Bitcode's
124+
ability to maximize inference intelligence must produce reliable technical
125+
intelligence measurement, labeling, fit-finding, AssetPack synthesis, and
126+
mutually beneficial depositing and Reading exchange.
127+
128+
## Non-goals during V38 opening
129+
130+
- No new production route, API version, source package name, or UI label should
131+
carry V38 in source code during the notes-only opening.
132+
- No Bitcoin, GitHub, compute, storage, or build/process runtime boundary may
133+
be weakened while the inference execution stack is being clarified.
134+
- No V38 gate may begin until Gate 1 creates the full draft family and updates
135+
the roadmap from this notes-only posture.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Bitcode Repository
22

33
`BITCODE_SPEC.txt` is the canonical pointer for active-system work. It currently
4-
resolves to `V36`; V37 is the active draft target for Website Conversations
5-
depth after the promoted Exchange canon.
4+
resolves to `V37`; V38 is the next draft target after the promoted Website
5+
Conversations canon.
66

77
## Current Product Posture
88

@@ -12,14 +12,14 @@ The primary operator routes are:
1212
- `/terminal` for depositing, reading, transaction work, and protocol follow-through.
1313
- `/auxillaries` for Wallet, Externals, Profile, and Interfaces support surfaces.
1414

15-
Exchange is promoted V36 canon: market-wide activity master-detail, buy/sell/
15+
Exchange is inherited V36 canon: market-wide activity master-detail, buy/sell/
1616
bid/ask/cancel/accept/settle/history flows, AssetPack range trading,
1717
rights-transfer review, pricing/liquidity/wrapper analysis, settlement
1818
reconciliation, dispute/repair/revenue routes, Exchange UX, local/staging
1919
rehearsal, and Exchange-specific proofs.
20-
Website Conversations are the active V37 draft focus: conversation sessions,
21-
route-local history, stream UI/event contracts, fullscreen writing mode, source
22-
selectors, conversation-to-Terminal handoff, persistence/privacy/redaction,
20+
Website Conversations are promoted V37 canon: conversation sessions, route-local
21+
history, stream UI/event contracts, fullscreen writing mode, source selectors,
22+
conversation-to-Terminal handoff, persistence/privacy/redaction,
2323
telemetry/proof/docs, local/staging rehearsal, and promotion readiness.
2424
V37 Gate 1 opens the Conversations spec family and `check:v37-gate1` over
2525
active V36.

SPECIFICATIONS_ROADMAP.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## Status
44

5-
- Current active canonical pointer: `BITCODE_SPEC.txt` -> `V36`
6-
- Current active canon: `BITCODE_SPEC_V36.md`
7-
- Current draft target: `BITCODE_SPEC_V37.md`
8-
- Current working gate: V37 Gate 10 Promotion Readiness.
5+
- Current active canonical pointer: `BITCODE_SPEC.txt` -> `V37`
6+
- Current active canon: `BITCODE_SPEC_V37.md`
7+
- Current draft target: `V38` draft opening.
8+
- Current working gate: V38 Gate 1 Draft Opening.
99
- Next queued gate after V37 promotion: V38 Gate 1 Draft Opening.
10-
- Latest closed version: V36 Exchange Depth, which promoted market-wide activity, intent/order contracts, rights-transfer review, pricing/liquidity/fee quotes, settlement reconciliation, dispute/repair/revenue routes, Exchange UX, local/staging rehearsal, and V36 promotion readiness.
11-
- Recent V36 closure anchor: V36 Gate 10 Promotion Readiness generated V36 proof support, promoted `BITCODE_SPEC.txt` to `V36`, prepared V36 active / V37 draft runtime posture, and closed Exchange-depth canon.
10+
- Latest closed version: V37 Website Conversations, which promoted conversation sessions, route-local history, stream UI/event contracts, fullscreen writing, source selectors, Terminal handoff, persistence/privacy/redaction, telemetry/proof hooks, local/staging rehearsal, and V37 promotion readiness.
11+
- Recent V37 closure anchor: V37 Gate 10 Promotion Readiness generated V37 proof support, promoted `BITCODE_SPEC.txt` to `V37`, prepared V37 active / V38 draft runtime posture, and closed Website Conversations 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`.
1313
- V34 Gate 3 closure anchor: deployment-depth now owns package-backed `DistributedExecutionRuntimeReceipt` source, deterministic `.bitcode/v34-distributed-execution-runtime-receipts.json`, `request_response_not_required` long-running work posture, and source-safe roots for pipeline, PTRR agent, ThricifiedGeneration, tool, ledger, wallet, proof, object-storage, and repair work.
1414
- V34 Gate 4 closure anchor: deployment-depth now owns package-backed `DeploymentStoragePosture` source, deterministic `.bitcode/v34-deployment-storage-posture.json`, ledger/database/object-storage drift repair fixtures, retention/encryption/backup/rollback/audit posture, and source-bearing AssetPack storage remains locked before settlement.
@@ -60,9 +60,9 @@ They are referenced here for specification history only; active implementation w
6060
## Source Families
6161

6262
- Legacy ENGI specifications: `_legacy/ENGI_SPEC_V1.md` through `_legacy/ENGI_SPEC_V25.md`, with companion `NOTES`, `DELTA`, `PARITY_MATRIX`, `SYSTEM_PARITY_MATRIX`, `PROVEN`, and audit files where present.
63-
- Active Bitcode specifications: `BITCODE_SPEC_V36.md`, with companion `DELTA`, `NOTES`, `PARITY_MATRIX`, and `PROVEN` files.
64-
- Promoted Bitcode history: `BITCODE_SPEC_V26.md` through `BITCODE_SPEC_V35.md`, with companion `DELTA`, `NOTES`, `PARITY_MATRIX`, and `PROVEN` files.
65-
- Draft and future Bitcode specifications: `BITCODE_SPEC_V37.md`, `BITCODE_SPEC_V37_DELTA.md`, `BITCODE_SPEC_V37_NOTES.md`, `BITCODE_SPEC_V37_PARITY_MATRIX.md`, and later notes files.
63+
- Active Bitcode specifications: `BITCODE_SPEC_V37.md`, with companion `DELTA`, `NOTES`, `PARITY_MATRIX`, and `PROVEN` files.
64+
- Promoted Bitcode history: `BITCODE_SPEC_V26.md` through `BITCODE_SPEC_V36.md`, with companion `DELTA`, `NOTES`, `PARITY_MATRIX`, and `PROVEN` files.
65+
- Draft and future Bitcode specifications: V38 draft family files once V38 Gate 1 opens, and later notes files.
6666
- Specification discipline references: `BITCODE_SPECIFYING.md` and `BITCODE_SPEC_TEMPLATEGUIDE.md`.
6767

6868
## Roadmap

packages/protocol/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ Current exported commercial helpers include:
4545
- canonical proven-generation helpers;
4646
- the package app/server context used by commercial interfaces.
4747

48-
This is now the `V36` active, `V37` draft after V36 promotion posture accepted
49-
by V36 Gate 10 and opened by V37 Gate 1.
50-
V37 Gate 1 treats this package as promotion-critical runtime posture.
48+
This is now the `V37` active, `V38` draft after V37 promotion posture accepted
49+
by V37 Gate 10.
50+
V38 Gate 1 treats this package as promotion-critical runtime posture.
5151
`packages/protocol/src/canon-posture.js` and `packages/protocol/data/state.json`
52-
must remain aligned to `V36` active, `V37` draft while V37 gates are in flight.
52+
must remain aligned to `V37` active, `V38` draft while V38 opens.
5353
V37 Gate 1 opens the Website Conversations spec family and `check:v37-gate1`.
5454
V37 Gate 2 adds source-safe `ConversationSession` route-history contracts
5555
through `buildConversationSessionRouteHistory` and

packages/protocol/test/protocol-package-boundary.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ test('@bitcode/protocol commercial formalization exports package-native canon he
5656
V34: { activeCanon: 'V34', draftTarget: 'V35' },
5757
V35: { activeCanon: 'V35', draftTarget: 'V36' },
5858
V36: { activeCanon: 'V36', draftTarget: 'V37' },
59+
V37: { activeCanon: 'V37', draftTarget: 'V38' },
5960
};
6061
const expectedPosture = expectedPostureByPointer[pointer];
6162

protocol-demonstration/test/v21-specifying.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function expectedActiveCanonicalInputArtifactCount(version) {
2424
V34: 12,
2525
V35: 0,
2626
V36: 0,
27+
V37: 0,
2728
};
2829
if (Object.hasOwn(expectedCountsByVersion, version)) {
2930
return expectedCountsByVersion[version];

0 commit comments

Comments
 (0)