Skip to content

Commit 1c121a4

Browse files
Implement V39 Depository supply indexing
Add the package-owned DepositorySupplyIndex, source-safe search documents, vector/storage projections, rights boundary, and repair-aware Finding Fits handoff. Generate the V39 Gate 2 proof artifact, checker, protocol tests, package tests, docs, roadmap updates, and workflow wiring for Gate 2 closure.
1 parent 5710b3b commit 1c121a4

23 files changed

Lines changed: 2132 additions & 11 deletions

.bitcode/v39-depository-supply-indexing.json

Lines changed: 430 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
@@ -184,6 +184,9 @@ jobs:
184184
if [ -f BITCODE_SPEC_V39.md ]; then
185185
node scripts/check-bitcode-spec-family.mjs --version V39 --mode draft --current-target V38
186186
node scripts/check-v39-gate1-commercial-reading-roadmap-opening.mjs --skip-branch-check
187+
if [ -f scripts/check-v39-gate2-depository-supply-indexing.mjs ]; then
188+
node scripts/check-v39-gate2-depository-supply-indexing.mjs --skip-branch-check --skip-package-tests
189+
fi
187190
fi
188191
else
189192
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ jobs:
313313
if [ -f BITCODE_SPEC_V39.md ]; then
314314
node scripts/check-bitcode-spec-family.mjs --version V39 --mode draft --current-target V38
315315
node scripts/check-v39-gate1-commercial-reading-roadmap-opening.mjs --skip-branch-check
316+
if [ -f scripts/check-v39-gate2-depository-supply-indexing.mjs ]; then
317+
node scripts/check-v39-gate2-depository-supply-indexing.mjs --skip-branch-check --skip-package-tests
318+
fi
316319
fi
317320
else
318321
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

BITCODE_SPEC_V39.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ Gate 2 closes Depository supply reality for Reading.
8686
It must make deposited source materials measurable, indexable, vector-searchable, metadata-searchable, rights-aware, and repairable as the source set that Finding Fits can search.
8787
The gate is closed by package-backed source, deterministic source-safe artifact generation, deposit lifecycle tests, embedding/vector policy tests, Supabase/storage projection readback, and a checker that proves no protected source or credentials enter public artifacts.
8888

89+
Gate 2 introduces `DepositorySupplyIndex` as the package-owned source-safe
90+
index over deposited source supply. Each `DepositorySupplyRecord` binds
91+
repository, branch, commit, proof root, measurement root, reconciliation
92+
readback root, source-safe search documents, vector projection rows, storage
93+
readback posture, repair actions, and the depositor/reader rights boundary.
94+
Its search documents are lexical, metadata, measurement, and vector documents
95+
derived from source-safe metadata only. Raw protected source remains stored
96+
outside the index and is never visible to the Reader before settlement. The
97+
active vector policy remains OpenAI `text-embedding-3-small`, 1536 dimensions,
98+
cosine `match_deliverable_vectors`; rows that are missing or dimension-invalid
99+
produce repair posture rather than pretending the corpus is searchable.
100+
`ReadFitsFindingSynthesis` consumes the index by converting records into
101+
source-safe `DepositoryAsset` candidates for Finding Fits.
102+
89103
### Gate 3: Enterprise Reading UX State Machine
90104

91105
Gate 3 implements the five-step enterprise Reading path in Terminal and connected Conversation handoffs.
@@ -199,6 +213,8 @@ Current source-bearing implementation basis: package source and route contracts
199213
Current validating commands and parity basis: active V38 promoted checks plus V39 gate checks.
200214
Current accepted boundaries: V39 only changes inference/search surfaces that consume deposits.
201215

216+
Gate 2 implementation basis: `packages/pipelines/asset-pack/src/depository-supply-index.ts` owns `DepositorySupplyIndex`, `DepositorySupplyRecord`, `DepositorySupplySearchDocument`, `DepositorySupplyVectorProjection`, and `DepositorySupplyStorageProjection`. The deterministic source-safe proof artifact is `.bitcode/v39-depository-supply-indexing.json`, generated by `pnpm run generate:v39-depository-supply-indexing` and checked by `pnpm run check:v39-gate2`.
217+
202218
### Reading and prompt/inference ownership
203219

204220
Current canonical objects and emitted artifacts: Read Request, synthesized Need, prompt registry receipts, PromptPart benchmark fixtures, Failsafe receipts, ThricifiedGeneration receipts, and typed Need outputs.

BITCODE_SPEC_V39_DELTA.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ Closure acceptance:
8181

8282
Closure implementation:
8383

84-
- Pending Gate 2 work must define its package-owned canonical source and deterministic artifact path before implementation begins.
85-
- The artifact must use a source-safe disclosure posture and include repair/replay acceptance criteria.
84+
- V39 Gate 2 package source is `packages/pipelines/asset-pack/src/depository-supply-index.ts`.
85+
- `DepositorySupplyIndex` and `DepositorySupplyRecord` normalize deposited source supply into source-safe lifecycle receipts with repository, branch, commit, proof, measurement, reconciliation readback, BTD range, depositor wallet, and source-safe search document roots.
86+
- Source-safe search documents are lexical, metadata, measurement, and vector projections. They carry source-safe text roots, source path roots, symbol roots, constraint roots, and active vector policy metadata without protected source text.
87+
- Vector projection preserves OpenAI `text-embedding-3-small`, 1536 dimensions, cosine `match_deliverable_vectors`; pending or invalid vector rows emit repair actions.
88+
- Storage projection binds the retained physical `deliverables` and `deliverable_vectors` tables to the active AssetPack evidence semantics.
89+
- `ReadFitsFindingSynthesis` consumes `DepositorySupplyIndex` through `depositorySupplyAssetsFromIndex`, preserving source-safe handoff into candidate recall and ranking.
90+
- The deterministic artifact path is `.bitcode/v39-depository-supply-indexing.json`; `pnpm run check:v39-gate2` validates artifact freshness, protocol tests, package tests, source-safety markers, docs, and workflow wiring.
8691

8792
### Gate 3: Enterprise Reading UX State Machine
8893

BITCODE_SPEC_V39_NOTES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ Gate 1 adds `check:v39-gate1`, workflow posture updates, README and package docu
175175

176176
Gate 2 closes Depository supply indexing and searchable deposit lifecycle. The artifact must prove deposited source can be measured, embedded, indexed, rights-aware, and searched without exposing protected source or credentials.
177177

178+
Gate 2 closure note: `DepositorySupplyIndex` is now the package-owned
179+
source-safe index for deposited supply. It produces `DepositorySupplyRecord`
180+
receipts with source binding, proof roots, measurement roots, reconciliation
181+
readback roots, lexical/metadata/measurement/vector source-safe search
182+
documents, active embedding vector projections, storage projection readback,
183+
depositor/reader BTD rights boundary, and repair actions. The index converts
184+
into `DepositoryAsset` candidates for `ReadFitsFindingSynthesis` through
185+
`depositorySupplyAssetsFromIndex`, so Finding Fits can search deposited supply
186+
without reading source-bearing payloads before settlement. The proof artifact is
187+
`.bitcode/v39-depository-supply-indexing.json`.
188+
178189
## Gate 3 implementation notes
179190

180191
Gate 3 closes the enterprise Reading UX state machine. Terminal and Conversation handoff must expose the five-step Reading path with low-detail guidance by default and expandable source-safe pipeline detail.

BITCODE_SPEC_V39_PARITY_MATRIX.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ No `_legacy/` source is active source truth.
7070
| Inference vocabulary | Gate 1 | `PipelineExecution`, PTRR Plan/Try/Refine/Retry, `FailsafeGenerationSequence`, `ThricifiedGeneration`, `ToolExecution`, `DocCodeToolPrompt` | drafted | V38 inference law remains binding on V39 product implementation. |
7171
| Depository search scope | Gate 1 | depository-search source and tools, embedding policy, fit ranking expectations | drafted | Gate plan requires many-candidate Finding Fits across lexical, symbolic, path, metadata, measurement, vector, and provider channels. |
7272
| Settlement and delivery scope | Gate 1 | BTD receipts, source-to-shares compensation, ledger/database/storage synchronization, pull-request delivery | drafted | Gate plan keeps source-bearing AssetPack delivery blocked until settlement unlock. |
73-
| Depository supply indexing | Gate 2 | package source, generated artifact, deposit lifecycle tests, embedding/search projection tests | pending | Deposited source becomes measurable, indexable, rights-aware, searchable, and repairable. |
73+
| Depository supply indexing | Gate 2 | `packages/pipelines/asset-pack/src/depository-supply-index.ts`, `.bitcode/v39-depository-supply-indexing.json`, `packages/pipelines/asset-pack/src/__tests__/depository-supply-index.test.ts`, `packages/protocol/test/v39-depository-supply-indexing.test.js` | implemented | Deposited source becomes measurable, indexable, rights-aware, searchable, and repairable through source-safe `DepositorySupplyIndex` records. |
7474
| Enterprise Reading UX state machine | Gate 3 | Terminal route state, Conversation handoff, rich execution log, browser proof | pending | The five-step enterprise Reading UX is implemented with low-detail defaults and expandable source-safe detail. |
7575
| ReadNeed review and resynthesis | Gate 4 | `ReadNeedComprehensionSynthesis`, Need storage, feedback, resynthesis, accepted-Need admission | pending | Finding Fits remains blocked until a reviewed Need is accepted. |
7676
| ReadFitsFinding runtime and replay | Gate 5 | `ReadFitsFindingSynthesis`, search tools, embeddings, ranking, selected-fit provenance, replay receipts | pending | Finding Fits searches the whole available Depository for many above-threshold candidates. |
@@ -92,7 +92,7 @@ No `_legacy/` source is active source truth.
9292
| Gate-quality workflow | Gate workflow validates V38 active / V39 draft posture and the V39 Gate 1 checker | drafted |
9393
| Canon-quality workflow | Canon workflow validates promoted V38 canon, V39 draft family when present, and V38/V39 posture | drafted |
9494
| Package docs | README, protocol package README, demonstration README, and PR template state V38 active / V39 draft workflow | drafted |
95-
| Depository supply indexing | Deposits become measurable, embedded, indexable, rights-aware, searchable, and repairable | pending |
95+
| Depository supply indexing | Deposits become measurable, embedded, indexable, rights-aware, searchable, and repairable | implemented |
9696
| Enterprise Reading UX | Terminal implements request read, review Need, request Finding Fits, review preview, buy and settle | pending |
9797
| ReadNeed runtime | `ReadNeedComprehensionSynthesis` persists reviewable Needs, feedback, resynthesis, measurements, and accepted-Need admission | pending |
9898
| ReadFitsFinding runtime | `ReadFitsFindingSynthesis` searches many above-threshold deposits with replayable query, ranking, threshold, and selected-fit provenance receipts | pending |
@@ -123,15 +123,31 @@ No `_legacy/` source is active source truth.
123123
| Finding Fits is plural and depository-wide | `packages/pipelines/asset-pack/src/depository-search.ts`, V39 SPEC/DELTA | drafted |
124124
| Gate checker is wired | `scripts/check-v39-gate1-commercial-reading-roadmap-opening.mjs`, `package.json`, workflows | drafted |
125125

126+
## Gate 2 Parity
127+
128+
| Requirement | Source evidence | Current V39 judgment |
129+
| --- | --- | --- |
130+
| Depository supply index type exists | `packages/pipelines/asset-pack/src/depository-supply-index.ts` | implemented |
131+
| Deposited source lifecycle is source-bound | `DepositorySupplyRecord.sourceBinding`, `DepositorySupplyRecord.lifecycle`, `depository-supply-index.test.ts` | implemented |
132+
| Source-safe search documents exist | `DepositorySupplySearchDocument`, lexical/metadata/measurement/vector document kinds | implemented |
133+
| Active vector policy is projected | `DepositorySupplyVectorProjection`, `embedding-config.ts`, `match_deliverable_vectors`, `text-embedding-3-small`, 1536 dimensions | implemented |
134+
| Supabase/storage readback projection exists | `DepositorySupplyStorageProjection`, retained `deliverables` and `deliverable_vectors` storage-edge names | implemented |
135+
| Depositor and Reader rights boundary is explicit | `DepositorySupplyRecord.rightsBoundary`, BTD range, depositor wallet, settlement-required source-bearing unlock | implemented |
136+
| Repair posture is deterministic | lifecycle blockers, warnings, and `repairActions` including `sync-active-embedding-vector-rows` | implemented |
137+
| Finding Fits handoff is source-safe | `depositorySupplyAssetsFromIndex`, `depository-search.ts`, package tests returning `worthy_fit` without raw source text | implemented |
138+
| Gate 2 proof artifact is source-safe | `.bitcode/v39-depository-supply-indexing.json`, `packages/protocol/src/canonical/v39-depository-supply-indexing.js`, `packages/protocol/test/v39-depository-supply-indexing.test.js` | implemented |
139+
| Gate 2 checker is wired | `scripts/check-v39-gate2-depository-supply-indexing.mjs`, `package.json`, canon/gate workflows | implemented |
140+
126141
## Later Gate Parity
127142

128-
Later V39 gates must add gate-specific parity sections when their implementation begins. Gate 1 intentionally does not claim closure for Depository indexing, enterprise Reading UX, Need review, Finding Fits runtime, preview/quote, settlement/delivery, telemetry/repair, interface parity, rehearsal, or promotion readiness.
143+
Later V39 gates must add gate-specific parity sections when their implementation begins. Gates 1 and 2 intentionally do not claim closure for enterprise Reading UX, Need review, Finding Fits runtime, preview/quote, settlement/delivery, telemetry/repair, interface parity, rehearsal, or promotion readiness.
129144

130145
## accepted boundaries and reopen conditions
131146

132147
V39 Gate 1 accepts only draft-family, roadmap, workflow, branch, and documentation posture closure.
148+
V39 Gate 2 accepts only Depository supply indexing, source-safe search document, vector projection, storage readback posture, rights boundary, repair posture, and Finding Fits handoff closure.
133149
Later gate scope is intentionally pending and must be reopened into gate-specific parity sections before implementation starts.
134150

135151
## completion condition
136152

137-
V39 Gate 1 is complete when `check:v39-gate1`, V39 draft spec-family validation, V38/V39 canon-posture drift validation, and promoted V38 spec-family validation all pass on a `v39/gate-1-*` branch.
153+
V39 Gate 2 is complete when `check:v39-gate2`, package Depository supply tests, V39 draft spec-family validation, V38/V39 canon-posture drift validation, and promoted V38 spec-family validation all pass on a `v39/gate-2-*` branch.

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ ReadFitsFinding runtime and replay, source-safe AssetPack preview and
249249
deterministic BTC quote, settlement, BTD rights transfer, post-settlement
250250
delivery, ledger/database/storage synchronization, telemetry/repair, interface
251251
parity, local/staging rehearsal, and promotion readiness.
252+
V39 Gate 2 adds the package-owned `DepositorySupplyIndex` and source-safe
253+
generated artifact `.bitcode/v39-depository-supply-indexing.json`. Deposited
254+
source supply is normalized into rights-aware records with repository, branch,
255+
commit, proof, measurement, reconciliation readback, BTD range, depositor
256+
wallet, source-safe search documents, active embedding/vector projection,
257+
Supabase storage readback posture, deterministic repair actions, and a
258+
source-safe Finding Fits handoff. Use `pnpm run generate:v39-depository-supply-indexing`
259+
and `pnpm run check:v39-gate2` before closing the gate.
252260
V36 Gate 2 anchors market-wide activity through the package-owned
253261
`ExchangeActivityBook` and the source-safe generated artifact
254262
`.bitcode/v36-exchange-activity-book.json`, including listing, bid, ask,

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 1 Commercial Reading Roadmap And Spec Opening.
9-
- Next queued gate after V39 Gate 1 closure: V39 Gate 2 Depository Supply Indexing And Searchable Deposit Lifecycle.
8+
- Current working gate: V39 Gate 2 Depository Supply Indexing And Searchable Deposit Lifecycle.
9+
- Next queued gate after V39 Gate 2 closure: V39 Gate 3 Enterprise Reading UX State Machine.
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`.
@@ -61,6 +61,7 @@
6161
- V38 Gate 10 closure anchor: Inference correctness depth now owns package-backed `V38LocalStagingInferenceDepositorySearchRehearsal` source, deterministic `.bitcode/v38-local-staging-inference-depository-search-rehearsal.json`, `source-safe-local-staging-inference-depository-search-rehearsal-metadata`, protocol test, Vercel Sandbox harness tests, Reading depository-search tests, route preflight/harness tests, Terminal stream UI tests, generator/checker scripts, workflow wiring, 8 rehearsal rows, 2 lanes, local sandbox opt-in, staging-testnet bounded real-inference preflight, Supabase readback validation, ReadNeedComprehensionSynthesis and ReadFitsFindingSynthesis rehearsal, many-fit search, source-safe AssetPack preview, telemetry streaming/readback, ledger/database posture, blocked production-mainnet value-bearing admission, and protected source/raw prompt/raw provider response/live log payload/unpaid AssetPack source/credential/private wallet/private settlement payloads kept private or blocked.
6262
- V38 Gate 11 closure anchor: Inference correctness depth now owns package-backed `V38InferencePromotionReadinessReport` source, deterministic `.bitcode/v38-promotion-readiness-report.json`, `source-safe-inference-promotion-readiness-metadata`, source-safe coverage for all V38 inference artifacts, `BITCODE_SPEC_V38_PROVEN.md` generation support, promotion command dry-run support, `v38-canon-promotion.yml`, active V38 / draft V39 posture preparation, package tests, workflow wiring, and `check:v38-gate11`.
6363
- V39 Gate 1 opening anchor: Commercial Reading readiness opens over promoted V38 with V39 SPEC, DELTA, NOTES, and PARITY files, `check:v39-gate1`, V38 active / V39 draft posture, and an eleven-gate plan for Depository supply indexing, enterprise Reading UX state, ReadNeed review/resynthesis, ReadFitsFinding runtime and replay, AssetPack preview/quote disclosure, settlement/BTD rights/delivery, operational telemetry/repair, interface parity, local/staging rehearsal, and promotion readiness.
64+
- V39 Gate 2 closure anchor: Commercial Reading readiness now owns package-backed `DepositorySupplyIndex` source, deterministic `.bitcode/v39-depository-supply-indexing.json`, source-safe Depository supply records, lexical/metadata/measurement/vector search documents, active OpenAI embedding/vector projection, Supabase storage readback posture, depositor/Reader settlement boundary, repair actions, Finding Fits handoff, package tests, protocol tests, workflow wiring, and `check:v39-gate2`.
6465
- Purpose: concise running index of Bitcode/ENGI specification history, current work, and planned work.
6566

6667
This roadmap is not an active system specification.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@
215215
"check:v37-gate1": "node scripts/check-v37-gate1-conversations-roadmap-opening.mjs",
216216
"check:v38-gate1": "node scripts/check-v38-gate1-inference-stack-roadmap-opening.mjs",
217217
"check:v39-gate1": "node scripts/check-v39-gate1-commercial-reading-roadmap-opening.mjs",
218+
"generate:v39-depository-supply-indexing": "node scripts/generate-v39-depository-supply-indexing.mjs",
219+
"check:v39-depository-supply-indexing": "node scripts/generate-v39-depository-supply-indexing.mjs --check",
220+
"check:v39-gate2": "node scripts/check-v39-gate2-depository-supply-indexing.mjs",
218221
"generate:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs",
219222
"check:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs --check",
220223
"check:v38-gate2": "node scripts/check-v38-gate2-inference-surface-inventory.mjs",

0 commit comments

Comments
 (0)