Skip to content

Commit 365971a

Browse files
Merge pull request #141 from engineeredsoftware/v39/gate-6-assetpack-preview-quote-disclosure
V39 Gate 6: AssetPack Preview Quote Boundary
2 parents 87267ef + ab3b18d commit 365971a

25 files changed

Lines changed: 2240 additions & 10 deletions

.bitcode/v39-assetpack-preview-quote-boundary.json

Lines changed: 530 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
@@ -196,6 +196,9 @@ jobs:
196196
if [ -f scripts/check-v39-gate5-read-fits-finding-runtime.mjs ]; then
197197
node scripts/check-v39-gate5-read-fits-finding-runtime.mjs --skip-branch-check --skip-package-tests
198198
fi
199+
if [ -f scripts/check-v39-gate6-assetpack-preview-quote-boundary.mjs ]; then
200+
node scripts/check-v39-gate6-assetpack-preview-quote-boundary.mjs --skip-branch-check --skip-package-tests
201+
fi
199202
fi
200203
else
201204
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ jobs:
325325
if [ -f scripts/check-v39-gate5-read-fits-finding-runtime.mjs ]; then
326326
node scripts/check-v39-gate5-read-fits-finding-runtime.mjs --skip-branch-check --skip-package-tests
327327
fi
328+
if [ -f scripts/check-v39-gate6-assetpack-preview-quote-boundary.mjs ]; then
329+
node scripts/check-v39-gate6-assetpack-preview-quote-boundary.mjs --skip-branch-check --skip-package-tests
330+
fi
328331
fi
329332
else
330333
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
@@ -401,6 +404,7 @@ jobs:
401404
pnpm --filter @bitcode/pipeline-hosts exec jest --config jest.config.cjs --runTestsByPath src/__tests__/distributed-execution-runtime-receipt.test.ts --runInBand --forceExit
402405
pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --runTestsByPath src/__tests__/reading-pipeline-observability.test.ts src/__tests__/reading-pipeline-contract.test.ts src/__tests__/v32-reading-pipeline-proof-coverage.test.ts --runInBand --forceExit
403406
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
407+
pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --runTestsByPath src/__tests__/asset-pack-preview-boundary.test.ts --runInBand --forceExit
404408
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
405409
pnpm --dir packages/protocol exec node --test --test-force-exit test/conversation-telemetry-proof-hooks.test.js
406410
pnpm --dir packages/protocol exec node --test --test-force-exit test/conversation-rehearsal.test.js

BITCODE_SPEC_V39.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,19 @@ AssetPack source. The generated source-safe proof artifact is
147147

148148
### Gate 6: AssetPack Preview, Quote, And Disclosure Boundary
149149

150-
Gate 6 makes source-safe AssetPack preview commercially usable without leaking source.
150+
Gate 6 makes source-safe AssetPack preview reviewable and actionable without leaking source.
151151
It must synthesize a preview from selected fits, expose fit measurements, quality reasons, proof roots, deterministic BTC quote, selected-fit provenance, delivery posture, and settlement instructions while withholding source-bearing AssetPack content until paid.
152+
The implementation basis is `AssetPackPreviewBoundary`, exported from
153+
`packages/pipelines/asset-pack/src/asset-pack-preview-boundary.ts`. It wraps
154+
`AssetPackSourceSafePreview`, `AssetPackPreviewQuoteReceipt`,
155+
`AssetPackDisclosureReview`, `AssetPackPreviewSettlementInstructions`,
156+
`AssetPackPreviewDeliveryPosture`, `AssetPackPreviewReplayReceipt`, and
157+
`AssetPackPreviewRepairPosture` so preview review is sufficient for buyer review
158+
without exposing protected source, raw protected prompts, raw provider
159+
responses, credentials, wallet private material, private settlement payloads,
160+
or unpaid AssetPack source. The deterministic proof artifact is
161+
`.bitcode/v39-assetpack-preview-quote-boundary.json`, checked by
162+
`pnpm run check:v39-gate6`.
152163

153164
### Gate 7: Settlement, BTD Rights Transfer, And Delivery
154165

BITCODE_SPEC_V39_DELTA.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ Closure acceptance:
166166

167167
Closure implementation:
168168

169-
- Pending Gate 6 work must define preview/quote artifacts, disclosure tests, and deterministic quote source.
169+
- Gate 6 package source is `packages/pipelines/asset-pack/src/asset-pack-preview-boundary.ts`.
170+
- `AssetPackPreviewBoundary` persists source-safe preview, fit measurement, selected-fit provenance, deterministic BTC quote, disclosure review, settlement instructions, delivery posture, replay receipt, and repair posture records.
171+
- `AssetPackPreviewQuoteReceipt` preserves the deterministic `sum(measurement.weight * measurement.volume * admitted_fit_quality)` share-to-fee formula with minimum sats, dust floor, quote root, and reader-wallet-before-broadcast posture.
172+
- Focused package tests cover deterministic quote replay, blocked no-worthy-fit repair posture, protected-source leak fail-closed review, and postprocess storage projection.
173+
- The generated proof artifact is `.bitcode/v39-assetpack-preview-quote-boundary.json`; `pnpm run check:v39-gate6` validates artifact freshness, protocol tests, package tests, source safety, docs, and workflow wiring.
170174

171175
### Gate 7: Settlement, BTD Rights Transfer, And Delivery
172176

BITCODE_SPEC_V39_NOTES.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ discipline as all other prompt material.
9393
- Make `ReadFitsFindingSynthesis` a runtime search pipeline over the whole
9494
available Depository, gathering many above-threshold candidate deposits before
9595
selected-fit provenance is handed into AssetPack synthesis.
96-
- Make source-safe AssetPack preview commercially sufficient without IP leakage:
96+
- Make source-safe AssetPack preview sufficient for buyer review without IP leakage:
9797
show measurements, fit reasons, selected-fit provenance, quality posture,
9898
proof roots, deterministic BTC quote, and delivery posture while withholding
9999
source-bearing AssetPack content until settlement unlock.
@@ -223,6 +223,17 @@ wallet private material, settlement payloads, or unpaid AssetPack source.
223223
## Gate 6 implementation notes
224224

225225
Gate 6 closes the source-safe AssetPack preview and deterministic BTC quote boundary. Preview can show measurements, fit reasons, quality posture, proof roots, quote, and delivery posture, but not source-bearing AssetPack content.
226+
The package-owned `AssetPackPreviewBoundary` is the source-safe AssetPack preview boundary runtime
227+
projection for this boundary. It composes the source-safe preview, selected-fit
228+
provenance, `AssetPackPreviewQuoteReceipt`, disclosure review, settlement
229+
instructions, delivery posture, storage records, replay receipt, and repair
230+
posture. The quote is deterministic over the accepted Need measurement vector,
231+
admitted fit quality, weighted volume, minimum sats, dust floor, and active fee
232+
schedule. Settlement instructions require reader wallet authorization before
233+
broadcast, BTC fee payment readback, settlement finality readback, BTD rights
234+
transfer readback, and ledger/database/storage reconciliation before source
235+
unlock. Pull-request delivery is projected as available only after settlement;
236+
unpaid source-bearing AssetPack content remains invisible.
226237

227238
## Gate 7 implementation notes
228239

BITCODE_SPEC_V39_PARITY_MATRIX.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ No `_legacy/` source is active source truth.
7474
| Enterprise Reading UX state machine | Gate 3 | `uapi/app/terminal/terminal-enterprise-reading-ux-state.ts`, `TerminalDepositReadWorkbench.tsx`, Conversation handoff, Terminal route query, `.bitcode/v39-enterprise-reading-ux-state.json`, focused UAPI tests, opt-in browser proof workflow | implemented | The five-step enterprise Reading UX is implemented with low-detail defaults, expandable source-safe detail, route-state handoff, rich execution stream integration, and source-safe disclosure proof. |
7575
| ReadNeed review and resynthesis | Gate 4 | `packages/pipelines/asset-pack/src/read-need-review-resynthesis.ts`, `.bitcode/v39-read-need-review-resynthesis.json`, package tests, route tests, protocol tests | implemented | Finding Fits remains blocked until a reviewed Need is accepted; rejected Needs preserve feedback and stay blocked. |
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. |
77-
| AssetPack preview and quote boundary | Gate 6 | AssetPack preview tests, quote tests, disclosure leak scans, proof roots | pending | Preview is commercially sufficient without exposing source-bearing AssetPack content. |
77+
| 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 | BTC settlement receipt, BTD rights transfer, source-to-shares, ledger/database/storage, PR delivery | pending | Payment unlocks rights and delivery; repair paths are auditable. |
7979
| 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. |
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. |
@@ -165,7 +165,7 @@ No `_legacy/` source is active source truth.
165165

166166
## Later Gate Parity
167167

168-
Later V39 gates must add gate-specific parity sections when their implementation begins. Gates 1 through 5 intentionally do not claim closure for preview/quote, settlement/delivery, telemetry/repair, interface parity, rehearsal, or promotion readiness.
168+
Later V39 gates must add gate-specific parity sections when their implementation begins. Gates 1 through 6 intentionally do not claim closure for paid settlement/delivery, telemetry/repair, interface parity, rehearsal, or promotion readiness.
169169

170170
## accepted boundaries and reopen conditions
171171

@@ -174,6 +174,7 @@ V39 Gate 2 accepts only Depository supply indexing, source-safe search document,
174174
V39 Gate 3 accepts only enterprise Reading UX state, source-safe route handoff/readback, low-detail/expandable Terminal rendering, rich stream-log integration, opt-in browser proof wiring, and generated UX proof artifact closure.
175175
V39 Gate 4 accepts only ReadNeed review runtime storage projection, feedback/resynthesis lineage, accepted-Need admission, rejected-Need posture, source-safe telemetry receipts, route actions, and generated review proof artifact closure.
176176
V39 Gate 5 accepts only ReadFitsFinding runtime storage projection, many-candidate depository search, source-safe query/ranking/provenance evidence, replay receipts, repair posture, active embedding policy, and generated runtime proof artifact closure.
177+
V39 Gate 6 accepts only source-safe AssetPack preview, deterministic share-to-fee quote, disclosure leak scanning, settlement instructions, delivery-withheld posture, replay receipts, repair posture, and generated preview proof artifact closure.
177178
Later gate scope is intentionally pending and must be reopened into gate-specific parity sections before implementation starts.
178179

179180
## Gate 5 Parity
@@ -188,6 +189,19 @@ AssetPack source. The generated proof artifact is
188189
`.bitcode/v39-read-fits-finding-runtime.json` and the gate check is
189190
`pnpm run check:v39-gate5`.
190191

192+
## Gate 6 Parity
193+
194+
V39 Gate 6 is implemented when `AssetPackPreviewBoundary` wraps
195+
`AssetPackSourceSafePreview` with deterministic BTC quote, disclosure review,
196+
selected-fit provenance, settlement instructions, delivery posture, storage
197+
projection, replay receipt, and repair posture. The parity source is
198+
`packages/pipelines/asset-pack/src/asset-pack-preview-boundary.ts`; it must not
199+
expose protected source, raw protected prompts, raw provider responses,
200+
credentials, wallet private material, settlement private payloads, or unpaid
201+
AssetPack source. The generated proof artifact is
202+
`.bitcode/v39-assetpack-preview-quote-boundary.json` and the gate check is
203+
`pnpm run check:v39-gate6`.
204+
191205
## completion condition
192206

193-
V39 Gate 5 is complete when `check:v39-gate5`, focused ReadFitsFinding package tests, V39 draft spec-family validation, V38/V39 canon-posture drift validation, and promoted V38 spec-family validation all pass on a `v39/gate-5-*` branch.
207+
V39 Gate 6 is complete when `check:v39-gate6`, focused AssetPack preview boundary 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-6-*` branch.

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,14 @@ provenance, active embedding policy, replay receipts, repair posture, and
283283
telemetry receipts into PipelineExecution-compatible storage records. Use
284284
`pnpm run generate:v39-read-fits-finding-runtime` and
285285
`pnpm run check:v39-gate5` before closing the gate.
286+
V39 Gate 6 adds the package-owned `AssetPackPreviewBoundary` and source-safe
287+
generated artifact `.bitcode/v39-assetpack-preview-quote-boundary.json`.
288+
AssetPack preview now projects source-safe measurements, selected-fit
289+
provenance, deterministic share-to-fee BTC quote, disclosure leak review,
290+
settlement instructions, withheld pull-request delivery posture, replay
291+
receipt, and repair posture without exposing unpaid source-bearing AssetPack
292+
content. Use `pnpm run generate:v39-assetpack-preview-quote-boundary` and
293+
`pnpm run check:v39-gate6` before closing the gate.
286294
V36 Gate 2 anchors market-wide activity through the package-owned
287295
`ExchangeActivityBook` and the source-safe generated artifact
288296
`.bitcode/v36-exchange-activity-book.json`, including listing, bid, ask,
@@ -448,7 +456,9 @@ through `pnpm run check:v39-gate3` and its generated
448456
`.bitcode/v39-enterprise-reading-ux-state.json` artifact. V39 Gate 4 is wired
449457
through `pnpm run check:v39-gate4`; V39 Gate 5 is wired through
450458
`pnpm run check:v39-gate5` and its generated
451-
`.bitcode/v39-read-fits-finding-runtime.json` artifact.
459+
`.bitcode/v39-read-fits-finding-runtime.json` artifact. V39 Gate 6 is wired
460+
through `pnpm run check:v39-gate6` and its generated
461+
`.bitcode/v39-assetpack-preview-quote-boundary.json` artifact.
452462
V38 Gates 1 through 11 are wired through `pnpm run check:v38-gate1`,
453463
`pnpm run check:v38-gate2`, `pnpm run check:v38-gate3`,
454464
`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 5 ReadFitsFinding Runtime, Ranking, And Replay.
9-
- Next queued gate after V39 Gate 5 closure: V39 Gate 6 AssetPack Preview, Quote, And Disclosure Boundary.
8+
- Current working gate: V39 Gate 6 AssetPack Preview, Quote, And Disclosure Boundary.
9+
- Next queued gate after V39 Gate 6 closure: V39 Gate 7 Settlement, BTD Rights Transfer, And Delivery.
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`.
@@ -65,6 +65,7 @@
6565
- V39 Gate 3 closure anchor: Commercial Reading readiness now owns package-backed `TerminalEnterpriseReadingUxState` source, deterministic `.bitcode/v39-enterprise-reading-ux-state.json`, five-step Reading state, source-safe `readingStage` Conversation handoff and Terminal readback, low-detail defaults, expandable source-safe detail, rich execution stream integration, component/route tests, opt-in browser proof workflow wiring, and `check:v39-gate3`.
6666
- V39 Gate 4 closure anchor: Commercial Reading readiness now owns package-backed `ReadNeedReviewResynthesisRuntime` source, deterministic `.bitcode/v39-read-need-review-resynthesis.json`, Read Request persistence, synthesized Need storage, feedback/resynthesis lineage, Need measurement storage, accepted-Need admission, rejected-Need posture, source-safe telemetry receipts, route/runtime storage projection tests, workflow wiring, and `check:v39-gate4`.
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`.
68+
- 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`.
6869
- Purpose: concise running index of Bitcode/ENGI specification history, current work, and planned work.
6970

7071
This roadmap is not an active system specification.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@
227227
"generate:v39-read-fits-finding-runtime": "node scripts/generate-v39-read-fits-finding-runtime.mjs",
228228
"check:v39-read-fits-finding-runtime": "node scripts/generate-v39-read-fits-finding-runtime.mjs --check",
229229
"check:v39-gate5": "node scripts/check-v39-gate5-read-fits-finding-runtime.mjs",
230+
"generate:v39-assetpack-preview-quote-boundary": "node scripts/generate-v39-assetpack-preview-quote-boundary.mjs",
231+
"check:v39-assetpack-preview-quote-boundary": "node scripts/generate-v39-assetpack-preview-quote-boundary.mjs --check",
232+
"check:v39-gate6": "node scripts/check-v39-gate6-assetpack-preview-quote-boundary.mjs",
230233
"generate:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs",
231234
"check:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs --check",
232235
"check:v38-gate2": "node scripts/check-v38-gate2-inference-surface-inventory.mjs",

0 commit comments

Comments
 (0)