diff --git a/.bitcode/v46-local-interface-comprehension-rehearsal.json b/.bitcode/v46-local-interface-comprehension-rehearsal.json index 7ba33c577..ea652cdcf 100644 --- a/.bitcode/v46-local-interface-comprehension-rehearsal.json +++ b/.bitcode/v46-local-interface-comprehension-rehearsal.json @@ -799,18 +799,18 @@ "delta": "BITCODE_SPEC_V46_DELTA.md:a16a16db40d4eeae612a0657", "notes": "BITCODE_SPEC_V46_NOTES.md:cca70aca3566132e7026351c", "parity": "BITCODE_SPEC_V46_PARITY_MATRIX.md:91b47eeaa106639d2d21856b", - "roadmap": "SPECIFICATIONS_ROADMAP.md:90a3988a2651878e43f96c65", + "roadmap": "SPECIFICATIONS_ROADMAP.md:9a349af9258300768b8fc758", "readme": "README.md:d28ec731634e03953d8adfe6", "protocolReadme": "packages/protocol/README.md:f5b175049f4f4e8df179e184", - "packageJson": "package.json:b79014968c556bc1b43ab341", + "packageJson": "package.json:9985108aaea23b4bb4f5e7a9", "packageIndex": "packages/protocol/src/index.js:1f16ea428bd71351a1292cb6", "packageTypes": "packages/protocol/src/index.d.ts:278dfc652c621533b5e86f4d", - "packageSource": "packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js:553cbdb03542959151ef8fce", + "packageSource": "packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js:ea56065835a819cd454c5558", "packageTest": "packages/protocol/test/v46-local-interface-comprehension-rehearsal.test.js:5b6ad282088791ea76ec2bbf", "generator": "scripts/generate-v46-local-interface-comprehension-rehearsal.mjs:d6a9dadb6f8ee51de50a529f", "checker": "scripts/check-v46-gate7-local-interface-comprehension-rehearsal.mjs:beb49c72404e73e730640a72", - "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:e5de1dddfaeeb0ee525b0c0f", - "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:43cc4ded2bd9757dda9091dc", + "gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:7cb34abd82e64e1fb32946b0", + "canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:7e675adc942626fc2048a266", "v46ProtocolArtifact": ".bitcode/v46-protocol-comprehension-object-model.json:b09508f0d7841284effb0e01", "v46PublicArtifact": ".bitcode/v46-public-operator-claim-boundaries.json:352e9021ffbe43d650923b98", "v46ProductArtifact": ".bitcode/v46-product-route-comprehension-readback.json:c5d1d887915cb920288b18a8", diff --git a/.github/workflows/bitcode-canon-quality.yml b/.github/workflows/bitcode-canon-quality.yml index 78c2c303e..013d82485 100644 --- a/.github/workflows/bitcode-canon-quality.yml +++ b/.github/workflows/bitcode-canon-quality.yml @@ -449,6 +449,12 @@ jobs: node scripts/check-bitcode-canonical-inputs.mjs --current-target V46 node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V46 --draft-target V47 node scripts/check-v46-gate8-promotion-readiness.mjs --promotion-mode --skip-branch-check --skip-package-tests + if [ -f BITCODE_SPEC_V47.md ]; then + node scripts/check-bitcode-spec-family.mjs --version V47 --mode draft --current-target V46 + if [ -f scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs ]; then + node scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs --skip-branch-check + fi + fi else echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2 exit 1 diff --git a/.github/workflows/bitcode-gate-quality.yml b/.github/workflows/bitcode-gate-quality.yml index d26c40975..0a4eb5935 100644 --- a/.github/workflows/bitcode-gate-quality.yml +++ b/.github/workflows/bitcode-gate-quality.yml @@ -578,6 +578,12 @@ jobs: node scripts/check-bitcode-canonical-inputs.mjs --current-target V46 node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V46 --draft-target V47 node scripts/check-v46-gate8-promotion-readiness.mjs --promotion-mode --skip-branch-check --skip-package-tests + if [ -f BITCODE_SPEC_V47.md ]; then + node scripts/check-bitcode-spec-family.mjs --version V47 --mode draft --current-target V46 + if [ -f scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs ]; then + node scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs --skip-branch-check + fi + fi else echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2 exit 1 diff --git a/BITCODE_SPEC_V47.md b/BITCODE_SPEC_V47.md new file mode 100644 index 000000000..8229d38cb --- /dev/null +++ b/BITCODE_SPEC_V47.md @@ -0,0 +1,778 @@ +# Bitcode Spec V47 + +## Status + +- Version: `V47` +- V47 state: draft opening; V46 remains the active canon while V47 scopes commercial website testnet launch readiness +- Current canonical/latest target: `V46` +- Prior canonical anchor: `BITCODE_SPEC_V46.md` +- Prior generated proof appendix: `BITCODE_SPEC_V46_PROVEN.md` +- Generated structured artifact inventory: planned draft `.bitcode/v47-spec-family-report.json`, `.bitcode/v47-canonical-input-report.json`, V47 launch-readiness artifacts, V47 commercial website testnet rehearsal artifacts, and `BITCODE_SPEC_V47_PROVEN.md` after promotion readiness +- Source parity state: V47 source parity is not yet implemented; Gate 1 opens the draft family, testnet semantics, measurement law, launch freeze, and closure gates over promoted V46 +- Notes companion: `BITCODE_SPEC_V47_NOTES.md` +- Delta companion: `BITCODE_SPEC_V47_DELTA.md` +- Parity companion: `BITCODE_SPEC_V47_PARITY_MATRIX.md` +- Scope: V47 draft system specification for commercial website testnet launch readiness over promoted V46 protocol comprehension canon +- Last fully realized canonical target preserved in source: `V46` + +## Version executive summary + +V47 is the final commercial-readiness version before Bitcode can deploy a +complete staging-testnet website experience for the first generally available +MVP. It narrows launch scope to the rich website application: `/deposit`, +`/read`, `/packs`, and Auxillaries for identity, connections, wallets, +organizations, and histories. + +V47 does not make mainnet value-bearing claims. In V47, "testnet" means one +thing: BTC amounts and settlement observations are testnet only, making the +commercial transaction economically free while the rest of the system behaves +as production-intended. Source-safe AssetPack synthesis, Depository admission, +Finding Fits, preview, quote, BTD rights, delivery, proof readback, +ledger/database/storage synchronization, and repair states must be real enough +for commercial demonstration. + +Measurement is the key commercial primitive. V47 requires a clear measurement +catalog, prompt ownership, typed measurement output, weights, weighted scalar +BTD formula, and seller/buyer visualization so IP sellers can decide what to +deposit and IP buyers can decide what to buy without source leakage. + +## Canonical Bitcode executive summary + +Bitcode commoditizes knowledge by packaging source, documents, data, workflows, +and other technical materials as AssetPacks. Depositors supply AssetPacks into +the Depository. Readers ask Bitcode to understand a Read Request, synthesize a +Need, find fitting Depository AssetPacks, synthesize a Need-Fit AssetPack, +preview source-safe measurements, settle in BTC, receive BTD rights, and receive +entitled repository delivery. + +BTD is the weighted scalar knowledge-volume measured from source bits, bytes, +content, documents, code, and other knowledge-bearing material. BTD can be +estimated for deposit-side AssetPack options, but final BTD size is +Need-relative: it is computed from measurements against a reviewed Need and +bound to settlement, rights, delivery, and source-to-shares compensation. + +V47 makes the website experience commercially demonstrable on staging-testnet +by proving both sides of the exchange: IP sellers can deposit AssetPacks, and IP +buyers can buy Need-fitting AssetPacks. + +## V47 source-of-truth hierarchy + +`BITCODE_SPEC.txt` points to `V46`; V46 is the active promoted Bitcode canon. +`BITCODE_SPEC_V47.md`, `BITCODE_SPEC_V47_DELTA.md`, +`BITCODE_SPEC_V47_NOTES.md`, and `BITCODE_SPEC_V47_PARITY_MATRIX.md` are draft +V47 material until V47 promotion. V47 authorizes implementation only gate by +gate through accepted parity, generated proof artifacts, tests, and promotion +readiness. + +Implementation remains unversioned in source paths. Routes, packages, +components, tests, prompts, telemetry, schemas, APIs, and workflows continue to +move in place as the single current Bitcode system after V47 gates authorize +their changes. + +## V47 full-system, re-implementation, and audit rule + +V47 must be reconstructable from this draft family, source code, generated +artifacts, proof roots, workflow receipts, ledger journals, database +projections, object-storage roots, wallet/provider receipts, repository +delivery receipts, and source-safe telemetry. + +No V47 surface may disclose protected source, unpaid AssetPack source, raw +prompts, raw model/provider responses, credentials, wallet private material, +private settlement payloads, private repository access, or source-bearing +delivery contents before entitlement. + +## V47 totality and precision enforcement rule + +V47 must preserve V46 protocol comprehension while becoming operationally +complete for the website launch. AssetPack is the commodity. BTD is weighted +scalar knowledge-volume and, after settlement, a rights-bearing receipt. BTC is +settlement money, testnet-only in V47 deployment. Source-to-shares is +post-finality contributor allocation. Measurement is the basis for price. +Preview is not source disclosure. Quote is not payment. Payment observation is +not finality. Database projection is not ledger truth when stronger evidence +conflicts. + +Every user-visible state must name whether it is estimate, potential, preview, +quote, observed testnet payment, final settlement, rights transfer, delivery, +contributor allocation, compensation, or repair. + +## V47 system goals, non-goals, and design principles + +Goals: + +- Launch-freeze the first generally available website MVP scope. +- Make `/deposit`, `/read`, `/packs`, and Auxillaries commercially coherent on + staging-testnet. +- Specify seller and buyer user flows with exact state machines. +- Specify measurement law: catalog, prompts, typed outputs, weights, BTD scalar + formula, proof roots, and source-safe visualizations. +- Audit feature excess and defer or flag anything that distracts from launch. +- Prove E2E IP selling and IP buying through browser-level commercial tests. +- Refurbish the landing page and public launch messaging for V47 testnet + readiness. + +Non-goals: + +- V47 does not launch value-bearing mainnet BTC settlement. +- V47 does not commercialize Bitcode Chat, ChatGPT App, or MCP/API beyond + source-safe compatibility and future-readiness boundaries. +- V47 does not finish deeper BTD mining cryptography beyond the website launch + contract. +- V47 does not expose unpaid source or source-bearing prompts. +- V47 does not add advanced market mechanics beyond MVP selling and buying. + +Design principles: measurement before price, price before settlement, +settlement before source unlock, source safety before convenience, website +clarity before advanced interfaces, proof-backed readback before projection, +and testnet value semantics without weakening production-like system behavior. + +## V47 system architecture and layer boundaries + +V47 acts through the website application: + +- Auxillaries owns user identity, organizations, teams, wallets, source + connections, target repository connections, and histories. +- `/deposit` owns IP-seller source connection, deposit AssetPack option + synthesis, source-safe option review, Depository admission, and compensation + expectation readback. +- `/read` owns IP-buyer Read Request, ReadNeedComprehensionSynthesis, + Need review/resynthesis, ReadFitsFindingSynthesis, source-safe preview, + quote, BTC-testnet settlement, BTD rights transfer, and repository delivery. +- `/packs` owns searchable master-detail PackActivity across deposits, reads, + previews, quotes, settlements, rights, delivery, compensation, repairs, proof + roots, and histories. +- API/MCP, ChatGPT App, and Bitcode Chat remain deferred commercial surfaces in + V47, though their source-safe contracts must not regress. + +## V47 canonical domain model + +Canonical V47 launch objects: + +- IP seller, IP buyer, organization, team, wallet, BTC-testnet account, + source connection, target repository connection, deposit source bundle, + deposit AssetPack option, Depository AssetPack, Read Request, synthesized + Need, accepted Need, Fit candidate set, selected Fit set, Need-Fit AssetPack, + source-safe preview, measurement vector, measurement weight policy, + weighted BTD scalar, BTC-testnet quote, settlement receipt, BTD rights + receipt, repository delivery receipt, source-to-shares allocation, + compensation statement, PackActivity row, proof root, repair case, and + commercial rehearsal receipt. + +Canonical V47 states: + +- Seller states: `seller-connected`, `source-connected`, + `deposit-options-synthesizing`, `deposit-option-synthesized`, + `deposit-option-reviewed`, `deposit-option-approved`, + `depository-admission-submitted`, `depository-assetpack-admitted`, + `compensation-eligible`, `seller-repair-required`. +- Buyer states: `buyer-connected`, `target-repository-connected`, + `read-requested`, `read-need-synthesizing`, `read-need-reviewing`, + `read-need-accepted`, `finding-fits-running`, `fits-found`, + `need-fit-assetpack-synthesized`, `source-safe-preview-reviewing`, + `btc-testnet-quote-issued`, `btc-testnet-settlement-observed`, + `btd-rights-transferred`, `repository-delivery-created`, + `buyer-repair-required`. +- Pack states: `pack-activity-created`, `measurement-visualized`, + `proof-root-bound`, `ledger-projected`, `database-synchronized`, + `storage-root-bound`, `repair-opened`, `repair-closed`. + +## V47 measurement law + +Measurement is the singular key to valuable IP commoditization and exchange. +Every V47 sale or deposit decision must be grounded in source-safe measurement +readback. + +Measurement catalog: + +- Coverage measurement: how much of the Need or deposit option is addressed. +- Specificity measurement: how precise the AssetPack is relative to a Need or + supply opportunity. +- Novelty measurement: how much non-public or hard-to-recreate knowledge the + AssetPack contains without exposing source. +- Reuse measurement: how likely the AssetPack is to help future Reads. +- Risk measurement: source criticality, leakage risk, rights risk, and repair + risk. +- Evidence measurement: proof-root, test, benchmark, repository, telemetry, and + provenance support. +- Fit measurement: Need-relative alignment across candidate Fits. +- Delivery measurement: confidence that the synthesized AssetPack can be + delivered as a repository PR or equivalent entitled delivery. + +Measurement prompt rule: + +- Each measurement must be commanded by a named Prompt or PromptPart composition + through the existing prompt registry. +- Each inference-owned measurement must record its input context class, source + boundary, prompt template identity, interpolated prompt hash or source-safe + digest, typed output schema, parsed result, proof root, telemetry receipt, + and repair posture. +- Raw protected prompts, raw provider responses, protected source, and unpaid + AssetPack source remain private. Source-safe prompt identity, prompt digest, + typed measurement result, and proof root are disclosable. + +Weighted scalar BTD formula: + +- Each measurement emits `measurementVolume`, `confidence`, `riskAdjustment`, + and `weight`. +- Normalized contribution is + `measurementVolume * confidence * riskAdjustment * weight`. +- Deposit-side BTD is an estimated or potential BTD range because no reviewed + buyer Need is bound yet. +- Read-side BTD is the final Need-relative weighted scalar knowledge-volume + after measurement policy lock, Need acceptance, Fit selection, and quote + binding. +- The sum of normalized contributions becomes the BTD scalar used for quote, + rights, delivery, and source-to-shares accounting. + +Seller visualization: + +- Depositors must see source-safe measurements for criticality, likely demand, + reuse value, evidence, estimated BTD range, ROI posture, compensation + expectation, source-safety blockers, and repair requirements before approving + deposit. + +Buyer visualization: + +- Readers must see source-safe measurements for Need coverage, Fit confidence, + selected Fit provenance, novelty, risk, delivery readiness, quote basis, + final BTD scalar, and repair blockers before paying BTC-testnet settlement. + +Measurement theorem: + +No measurement, no price. No price, no settlement. No settlement, no market. + +## V47 whole Bitcode operator chain + +1. Seller connects identity, wallet, organization, and source. +2. Bitcode synthesizes source-safe deposit AssetPack options. +3. Seller reviews measurements and approves an option for Depository admission. +4. Depository indexes admitted AssetPack metadata, measurements, embeddings, + proof roots, and compensation posture. +5. Buyer connects identity, wallet, organization, and target repository. +6. Buyer requests a Read. +7. Bitcode synthesizes a Need and the buyer accepts or resynthesizes it. +8. Bitcode runs Finding Fits against the Depository. +9. Bitcode synthesizes a Need-Fit AssetPack and source-safe preview. +10. Buyer reviews measurements, quote, and proof posture. +11. Buyer settles with BTC-testnet. +12. Bitcode transfers BTD rights, unlocks entitled delivery, creates the + repository PR, journals compensation, and synchronizes `/packs`. +13. Operators repair only through proof-backed state transitions. + +## V47 canonical subsystem surfaces + +### Depositing and asset supply + +- Current canonical objects and emitted artifacts: deposit source bundle, + deposit AssetPack option, Depository AssetPack, measurement vector, estimated + BTD range, admission receipt, compensation expectation, PackActivity row. +- Current algorithms and derivation rules: synthesize options from connected + source, measure source-safe value, classify criticality, estimate demand, + admit approved options, index Depository metadata. +- Current invariants and fail-closed conditions: no source exposure before + entitlement, no critical IP admission without explicit approval, no + compensation claim without settlement evidence. +- Current proof obligations: source connection receipt, option synthesis + receipt, measurement receipt, approval receipt, admission receipt, index root. +- Current source-bearing implementation basis: source remains protected behind + source-safe option review and storage boundaries. +- Current validating commands and parity basis: V47 Gate 4 and Gate 7 tests + must prove seller flow and deposit-to-read continuity. +- Current accepted boundaries: deposit estimates are not final BTD until a + Need-relative read binds them. + +### Reading and prompt/inference ownership + +- Current canonical objects and emitted artifacts: Read Request, synthesized + Need, accepted Need, Prompt/PromptPart measurement commands, typed inference + results, ReadFitsFindingSynthesis receipt, Need-Fit AssetPack. +- Current algorithms and derivation rules: synthesize Need, review/resynthesize + Need, find Fits, measure Need-relative value, synthesize preview and delivery. +- Current invariants and fail-closed conditions: no Finding Fits without + accepted Need, no paid delivery before settlement, no raw prompt/provider + response disclosure. +- Current proof obligations: prompt identity, source-safe prompt digest, typed + output, parsed result, telemetry receipt, proof root, repair posture. +- Current source-bearing implementation basis: protected source may inform + inference only through entitlement-safe execution boundaries. +- Current validating commands and parity basis: V47 Gate 5 and Gate 7 tests + must prove buyer flow and measurement visualization. +- Current accepted boundaries: inference output is advisory until parsed, + typed, proof-bound, and state-admitted. + +### Fit, recall, ranking, and verification + +- Current canonical objects and emitted artifacts: candidate Fits, selected Fit + set, recall receipts, ranking receipts, verification receipts, source-safe + provenance summaries. +- Current algorithms and derivation rules: search Depository metadata, + embeddings, measurements, lexical indexes, and proof roots; rank above + threshold; verify candidate usefulness before AssetPack synthesis. +- Current invariants and fail-closed conditions: no candidate source disclosure + before settlement, no survivor-free AssetPack, no ranking without proofable + measurement basis. +- Current proof obligations: query synthesis receipt, search receipt, ranking + receipt, selected Fit receipt, verification receipt. +- Current source-bearing implementation basis: source remains protected while + measurement metadata and provenance summaries remain source-safe. +- Current validating commands and parity basis: V47 Gate 5 and Gate 7 tests + must prove Fit search drives buyer preview and delivery. +- Current accepted boundaries: many Fits may contribute to one Need-Fit + AssetPack and compensation follows source-to-shares after settlement. + +### Selection and materialization + +- Current canonical objects and emitted artifacts: Need-Fit AssetPack, + withheld source bundle, preview, delivery branch, repository PR, delivery + receipt. +- Current algorithms and derivation rules: synthesize source-safe preview + before settlement, materialize source-bearing delivery only after settlement + and rights transfer. +- Current invariants and fail-closed conditions: preview is not source; quote + is not delivery; delivery requires settlement and rights transfer. +- Current proof obligations: preview boundary receipt, quote receipt, + settlement receipt, BTD rights receipt, delivery receipt. +- Current source-bearing implementation basis: source-bearing output is + withheld until entitlement. +- Current validating commands and parity basis: V47 Gate 5 and Gate 7 tests + must prove repository delivery after settlement. +- Current accepted boundaries: failed delivery opens repair, not silent success. + +### Identity, authorization, and sensitive flow + +- Current canonical objects and emitted artifacts: user identity, organization, + team, wallet, role, policy, source connection, target repository connection, + spend/deposit authority receipt. +- Current algorithms and derivation rules: bind actions to identity, wallet, + org authority, connection authority, and policy. +- Current invariants and fail-closed conditions: no deposit, read, settlement, + rights transfer, or delivery without authority. +- Current proof obligations: auth receipt, wallet receipt, provider receipt, + policy receipt, denial receipt. +- Current source-bearing implementation basis: credentials and wallet private + material remain secret. +- Current validating commands and parity basis: V47 Gate 6 and Gate 7 tests + must prove Auxillaries and route authority. +- Current accepted boundaries: testnet BTC does not weaken identity or rights + boundaries. + +### Disclosure and projection + +- Current canonical objects and emitted artifacts: source-safe preview, + measurement visualization, proof-root projection, PackActivity projection, + denied-state projection, repair projection. +- Current algorithms and derivation rules: expose only source-safe + measurements, summaries, states, proof roots, and repair guidance before + entitlement. +- Current invariants and fail-closed conditions: public projection + overexposure blocks state advancement. +- Current proof obligations: disclosure policy receipt, projection receipt, + no-source/no-secret scan, repair receipt. +- Current source-bearing implementation basis: raw source and raw protected + prompts remain outside public projection. +- Current validating commands and parity basis: V47 Gate 6, Gate 7, and Gate 8 + tests must prove disclosure boundaries. +- Current accepted boundaries: source-safe value explanation is allowed; source + transfer is not. + +### Settlement and exact accounting + +- Current canonical objects and emitted artifacts: BTC-testnet quote, payment + observation, finality receipt, BTD scalar, BTD rights receipt, + source-to-shares allocation, compensation statement. +- Current algorithms and derivation rules: compute quote from weighted BTD + scalar, observe BTC-testnet payment, finalize settlement, transfer rights, + allocate source-to-shares. +- Current invariants and fail-closed conditions: observed payment is not + finality, finality is required before source unlock, compensation requires + conservation. +- Current proof obligations: quote receipt, wallet/provider receipt, ledger + journal, rights receipt, compensation receipt, reconciliation receipt. +- Current source-bearing implementation basis: settlement payloads remain + private except source-safe receipts. +- Current validating commands and parity basis: V47 Gate 5, Gate 6, and Gate 7 + tests must prove accounting and repair. +- Current accepted boundaries: V47 BTC amounts are testnet; state semantics are + production-intended. + +### Proof contract, witnesses, and replay + +- Current canonical objects and emitted artifacts: proof root, generated + artifact, witness, replay receipt, workflow receipt, repair case. +- Current algorithms and derivation rules: every state transition must bind to + a proofable receipt or fail closed. +- Current invariants and fail-closed conditions: proof mismatch opens repair; + stale promoted status truth is failure. +- Current proof obligations: generated artifact, replay proof, workflow proof, + diff hygiene, test receipt. +- Current source-bearing implementation basis: proofs must be source-safe unless + entitlement authorizes source-bearing delivery. +- Current validating commands and parity basis: V47 Gate 7, Gate 9, and Gate 10 + must prove replay and promotion readiness. +- Current accepted boundaries: proof readback decides; UI projection explains. + +## V47 proof-family canon + +### Exact proof-family inventory matrix + +| proofFamily | proofArtifactPath | memberIds | theoremIds | replayStepIds | witnessArtifactPaths | Current source basis | +| --- | --- | --- | --- | --- | --- | --- | +| Inference-synthesis | `.bitcode/v47-spec-family-report.json` | `measurement-prompt`, `need-synthesis`, `fit-synthesis` | `typed-measurement-output` | `v47-inference-readback` | `BITCODE_SPEC_V47_PROVEN.md` | V46 inference and V47 measurement law | +| Prompt-completeness | `.bitcode/v47-spec-family-report.json` | `measurement-prompts`, `visualization-prompts` | `prompt-identity-bound` | `v47-prompt-readback` | `BITCODE_SPEC_V47_PROVEN.md` | Prompt registry and V41/V46 canon | +| Static-code-analysis | `.bitcode/v47-canonical-input-report.json` | `route-static-contracts`, `workflow-hooks` | `source-safety-static` | `v47-static-readback` | `BITCODE_SPEC_V47_PROVEN.md` | Current website source and workflows | +| Verification-decisions | `.bitcode/v47-spec-family-report.json` | `seller-decision`, `buyer-decision` | `measurement-before-price` | `v47-decision-readback` | `BITCODE_SPEC_V47_PROVEN.md` | V47 state machine law | +| Selection-and-materialization | `.bitcode/v47-spec-family-report.json` | `fit-selection`, `delivery-materialization` | `settlement-before-source` | `v47-materialization-readback` | `BITCODE_SPEC_V47_PROVEN.md` | Reading and delivery packages | +| Authorization-and-sensitive-flow | `.bitcode/v47-canonical-input-report.json` | `identity`, `wallet`, `source-connection` | `authority-required` | `v47-authority-readback` | `BITCODE_SPEC_V47_PROVEN.md` | Auxillaries and route authority | +| Settlement-source-to-shares | `.bitcode/v47-spec-family-report.json` | `quote`, `settlement`, `compensation` | `btctestnet-conservation` | `v47-settlement-readback` | `BITCODE_SPEC_V47_PROVEN.md` | BTD/BTC accounting canon | +| Disclosure-boundary | `.bitcode/v47-canonical-input-report.json` | `preview`, `measurement-visualization` | `no-unpaid-source` | `v47-disclosure-readback` | `BITCODE_SPEC_V47_PROVEN.md` | V45/V46 source-safety canon | +| Proof-contract | `.bitcode/v47-spec-family-report.json` | `proof-root`, `replay`, `repair` | `proof-readback-decides` | `v47-proof-readback` | `BITCODE_SPEC_V47_PROVEN.md` | Generated proof and workflow canon | + +### Inference-synthesis + +- proofArtifactPath: `.bitcode/v47-spec-family-report.json` +- members: measurement prompts, Need synthesis, deposit option synthesis, Finding Fits, AssetPack synthesis +- theoremIds: typed-measurement-output, inference-source-safety, measurement-before-price +- replayStepIds: v47-inference-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: every inference-owned measurement must have prompt identity, typed output, proof root, and repair posture +- current member verdict shape: source-safe typed receipt +- current theorem-by-theorem closure reading: inference may guide state only after typed parsing and proof binding +- current theorem-to-replay grouping: prompt identity, typed output, and measurement visualization replay together +- minimum artifact/replay binding set: prompt registry id, digest, typed output schema, telemetry receipt +- current proof-object fields: promptId, promptDigest, outputType, measurementId, proofRoot +- generated-artifact and test bindings: V47 Gate 1 checker and later Gate 7 E2E tests +- fail-closed conditions: prompt contract incompleteness, parsed-envelope inadmissibility + +### Prompt-completeness + +- proofArtifactPath: `.bitcode/v47-spec-family-report.json` +- members: measurement PromptParts, seller visualization prompts, buyer visualization prompts +- theoremIds: prompt-identity-bound, prompt-output-typed +- replayStepIds: v47-prompt-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: every measurement prompt must be catalogued and source-safe +- current member verdict shape: prompt contract receipt +- current theorem-by-theorem closure reading: prompt composition must identify source boundaries and output schema +- current theorem-to-replay grouping: prompt registry and measurement output replay together +- minimum artifact/replay binding set: PromptPart ids, Prompt id, interpolation keys, schema id +- current proof-object fields: promptPartIds, promptId, interpolationDigest, outputSchema +- generated-artifact and test bindings: V47 measurement-law parity and prompt tests +- fail-closed conditions: missing prompt part, raw prompt leakage, schema mismatch + +### Static-code-analysis + +- proofArtifactPath: `.bitcode/v47-canonical-input-report.json` +- members: route contracts, workflow hooks, no-source scans +- theoremIds: source-safety-static, route-state-static +- replayStepIds: v47-static-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: code and workflow changes must align to V47 launch scope +- current member verdict shape: static pass/fail receipt +- current theorem-by-theorem closure reading: static source must not expose protected payloads or stale route names +- current theorem-to-replay grouping: source scan and spec-family scan replay together +- minimum artifact/replay binding set: source paths, route ids, forbidden phrase scan +- current proof-object fields: sourcePath, predicateId, verdict, proofRoot +- generated-artifact and test bindings: gate/canon workflows and check-v47-gate1 +- fail-closed conditions: source exposure, stale route, missing workflow hook + +### Verification-decisions + +- proofArtifactPath: `.bitcode/v47-spec-family-report.json` +- members: seller approval, buyer payment, operator repair +- theoremIds: measurement-before-price, proof-before-state +- replayStepIds: v47-decision-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: decisions must show source-safe measurement and authority +- current member verdict shape: decision receipt +- current theorem-by-theorem closure reading: no decision is valid without measurement and proof +- current theorem-to-replay grouping: measurement, decision, and state transition replay together +- minimum artifact/replay binding set: actor, authority, measurement root, state transition +- current proof-object fields: actorId, authorityId, measurementRoot, transitionId +- generated-artifact and test bindings: V47 E2E seller/buyer tests +- fail-closed conditions: authorization denial, missing measurement, projection mismatch + +### Selection-and-materialization + +- proofArtifactPath: `.bitcode/v47-spec-family-report.json` +- members: Fit selection, AssetPack preview, repository delivery +- theoremIds: settlement-before-source, selected-fit-proof +- replayStepIds: v47-materialization-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: selected Fits and delivery must have proof roots +- current member verdict shape: materialization receipt +- current theorem-by-theorem closure reading: delivery follows settlement and rights transfer +- current theorem-to-replay grouping: Fit selection, quote, settlement, and delivery replay together +- minimum artifact/replay binding set: fitSetId, assetPackId, quoteId, deliveryId +- current proof-object fields: fitSetId, previewRoot, settlementRoot, deliveryRoot +- generated-artifact and test bindings: V47 Gate 5 and Gate 7 +- fail-closed conditions: no-survivor asset pack, settlement mismatch, delivery failure + +### Authorization-and-sensitive-flow + +- proofArtifactPath: `.bitcode/v47-canonical-input-report.json` +- members: identity, organization, wallet, source connection, repository connection +- theoremIds: authority-required, secrets-never-projected +- replayStepIds: v47-authority-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: every sensitive action must bind to authority and no-secret projection +- current member verdict shape: authority receipt +- current theorem-by-theorem closure reading: testnet does not weaken authority +- current theorem-to-replay grouping: identity, wallet, connection, and route action replay together +- minimum artifact/replay binding set: identityId, orgId, walletId, providerId, routeActionId +- current proof-object fields: subjectId, policyId, walletReceipt, providerReceipt +- generated-artifact and test bindings: V47 Gate 6 and Gate 7 +- fail-closed conditions: authorization denial, secret leakage, missing wallet + +### Settlement-source-to-shares + +- proofArtifactPath: `.bitcode/v47-spec-family-report.json` +- members: quote, BTC-testnet observation, finality, BTD rights, compensation +- theoremIds: btctestnet-conservation, source-to-shares-conservation +- replayStepIds: v47-settlement-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: quote, settlement, rights, and compensation must conserve measured BTD and source-to-shares +- current member verdict shape: accounting receipt +- current theorem-by-theorem closure reading: BTC-testnet is free economically but not loose semantically +- current theorem-to-replay grouping: quote, payment, finality, rights, compensation replay together +- minimum artifact/replay binding set: quoteId, paymentId, btdScalar, rightsId, allocationId +- current proof-object fields: quoteAmount, testnetTxid, btdScalar, allocationRoot +- generated-artifact and test bindings: V47 Gate 5, Gate 6, Gate 7 +- fail-closed conditions: settlement conservation drift, payment mismatch, compensation mismatch + +### Disclosure-boundary + +- proofArtifactPath: `.bitcode/v47-canonical-input-report.json` +- members: preview, measurement visualization, proof projection +- theoremIds: no-unpaid-source, measurement-visible-source-hidden +- replayStepIds: v47-disclosure-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: every pre-settlement display must expose value without exposing source +- current member verdict shape: disclosure receipt +- current theorem-by-theorem closure reading: measurements can reveal value, confidence, risk, and fit but not protected source +- current theorem-to-replay grouping: projection policy and UI state replay together +- minimum artifact/replay binding set: projectionId, measurementIds, no-source scan +- current proof-object fields: projectionId, allowedFields, deniedFields, scanRoot +- generated-artifact and test bindings: V47 Gate 6, Gate 7, Gate 8 +- fail-closed conditions: public projection overexposure, raw prompt leakage, unpaid source leakage + +### Proof-contract + +- proofArtifactPath: `.bitcode/v47-spec-family-report.json` +- members: proof root, workflow receipt, replay receipt, repair receipt +- theoremIds: proof-readback-decides, stale-truth-fails +- replayStepIds: v47-proof-readback +- witnessArtifactPaths: `BITCODE_SPEC_V47_PROVEN.md` +- current member closure criteria: every state transition must be proof-readable +- current member verdict shape: proof receipt +- current theorem-by-theorem closure reading: projection explains, proof decides +- current theorem-to-replay grouping: generated artifact, workflow, and repair replay together +- minimum artifact/replay binding set: artifactRoot, workflowRun, stateTransition, repairId +- current proof-object fields: artifactRoot, workflowId, transitionId, repairState +- generated-artifact and test bindings: V47 Gate 10 promotion readiness +- fail-closed conditions: stale promoted status truth, missing proof root, generated artifact drift + +## V47 generated canon + +### Appendix C. Generated artifact contract catalog + +#### Inherited V19 reproducible-canon artifacts + +`.bitcode/v19-contract-change-ledger.json`, +`.bitcode/v19-negative-proof-mutation-matrix.json`, +`.bitcode/v19-proof-member-semantic-matrix.json`, +`.bitcode/v19-theorem-evidence-matrix.json`, +`.bitcode/v19-state-machine-matrix.json`, +`.bitcode/v19-deterministic-replay-report.json`, and +`.bitcode/v19-volatility-inventory.json` remain historical reproducibility +inputs. + +#### Inherited V20 operator-quality artifacts + +`.bitcode/v20-operator-acceptance-transcript.json`, +`.bitcode/v20-visual-regression-report.json`, +`.bitcode/v20-accessibility-report.json`, +`.bitcode/v20-performance-budget-report.json`, +`.bitcode/v20-projection-quality-smoke-matrix.json`, +`.bitcode/v20-quality-summary.json`, and `ENGI_SPEC_V20_PROVEN.md` remain +historical operator-quality inputs. + +#### Exact generated-artifact inventory matrix + +| artifactPath | role | disclosability | +| --- | --- | --- | +| `.bitcode/v47-spec-family-report.json` | V47 spec-family validation report | source-safe | +| `.bitcode/v47-canonical-input-report.json` | V47 canonical-input validation report | source-safe | +| `BITCODE_SPEC_V47_PROVEN.md` | V47 generated proof appendix after promotion readiness | source-safe | + +#### V47 specifying generated artifacts + +V47 Gate 1 reserves `.bitcode/v47-spec-family-report.json` and +`.bitcode/v47-canonical-input-report.json`. Later gates may add launch, +measurement, route, and E2E rehearsal artifacts. + +#### Shared generated-artifact fields + +All V47 generated artifacts must carry artifact id, version, generatedAt or +deterministic marker, source roots, proof root, source-safety verdict, +predicate results, aggregate proof verdict, and repair posture. + +#### Artifact-specific generated payload fields + +Measurement artifacts must include measurement ids, weights, normalized +contributions, prompt identities, typed output schemas, visualization fields, +and source-safety denials. + +#### Artifact confidentiality and disclosability taxonomy + +V47 artifacts classify fields as public, operator, buyer, reviewer, internal, +source-bearing, secret, or denied. + +#### Minimum generated appendix rendered contents + +The generated appendix must render aggregate proof verdict, exact proof-family +inventory, exact per-family member inventory, exact per-family theorem +inventory, exact replay-step inventories and theorem bindings, witness artifact +inventories, generated artifact inventories, scenario and run coverage matrices, +proof-source commit, and fail closed when conditions. + +#### Canonical regeneration and fail-closed posture + +Regeneration must fail closed when source roots drift, proof roots mismatch, +generated artifact inventories are incomplete, scenario and run coverage +matrices are stale, proof-source commit is missing, or source-safety scans fail. + +## V47 validation canon + +V47 Gate 1 validation requires: + +- `node scripts/check-bitcode-spec-family.mjs --version V46 --mode promoted --current-target V46` +- `node scripts/check-bitcode-spec-family.mjs --version V47 --mode draft --current-target V46` +- `node scripts/check-bitcode-canonical-inputs.mjs --current-target V46` +- `node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V46 --draft-target V47` +- `node scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs --skip-branch-check` + +Later gates must add focused tests, browser E2E, proof generation, staging +rehearsal, and promotion readiness checks. + +## V47 promotion canon + +V47 may promote only after all gates close, all generated artifacts are fresh, +all commercial website launch tests are green, staging-testnet rehearsal proves +seller and buyer E2E flows, and the maintained promotion workflow advances +`BITCODE_SPEC.txt` to `V47`. + +## V47 appendices and canonical supporting material + +### Appendix A. Canonical type and surface catalog + +Canonical surfaces are `/deposit`, `/read`, `/packs`, Auxillaries, Depository +indexes, proof roots, workflow receipts, ledger journals, database projections, +object-storage roots, wallet/provider receipts, and repository delivery +receipts. API/MCP, ChatGPT App, and Bitcode Chat remain compatibility surfaces +for V47, not commercial launch scope. + +### Appendix B. Proof family closure catalog + +The nine proof families above close through measurement, state-machine, +disclosure, settlement, delivery, repair, and promotion evidence. + +### Appendix D. Validation and checking gate catalog + +V47 gates: + +1. Scope, Testnet Semantics, Measurement Law, And Launch Freeze. +2. Feature Excess And Gate Alignment Audit. +3. Seller And Buyer State Machine Law. +4. Depositor Website Completion. +5. Reader Website Completion. +6. Packs And Auxillaries Commercial Dashboard. +7. E2E IP Selling And Buying Tests. +8. Landing Page And Public Launch Messaging. +9. Staging-Testnet Deployment Rehearsal. +10. Promotion Readiness. + +### Appendix E. Current canonical source map + +Current source map roots include `uapi`, `packages/btd`, +`packages/pipeline-asset-pack`, `packages/pipeline-hosts`, +`packages/protocol`, `packages/prompts`, `packages/executions-mcp`, +`packages/chatgptapp`, `protocol-demonstration`, `.github/workflows`, and +`.bitcode` generated artifacts. + +### Appendix F. Subsystem totality and derivability matrix + +Required coverage phrases: repo supply and depositing; reading and measured +demand; prompt/inference/evaluator ownership; deposit-to-read fit; recall and +ranking; verification decisions; selection and materialization; branch +artifacts and assetPackEvidence; identity, authority, signing, and policy; +sensitive data and confidentiality flows; projection, disclosure, and +redaction; proof families, members, theorems, witnesses, and replay; +settlement, source-to-shares, journals, and exact accounting; telemetry, +persistence, state, and failure semantics; host/runtime capability truth; +operator experience and pedagogy; validation and test stack; generated +artifacts and canonical promotion. + +### Appendix G. Canonical file-family and promotion contract catalog + +The V47 file family is `BITCODE_SPEC_V47.md`, +`BITCODE_SPEC_V47_DELTA.md`, `BITCODE_SPEC_V47_NOTES.md`, +`BITCODE_SPEC_V47_PARITY_MATRIX.md`, and eventually +`BITCODE_SPEC_V47_PROVEN.md`. Promotion must be workflow-driven. + +### Appendix H. Operator surface and quality contract catalog + +Operators need source-safe views of seller flow, buyer flow, measurements, +quotes, BTC-testnet observations, BTD rights, delivery, compensation, repair, +proof roots, and workflow receipts. Operator surfaces must remain measurable, +readable, accessible, performant, and repairable. + +### Appendix I. Scenario, workflow, and cross-product contract catalog + +V47 keeps historical scenario coverage terms auth-issuer-rollback, +privacy-boundary-proof-export, polyglot-gateway-benchmark-remediation, +auth-many-asset-normalization, Targeted deposit, Normalization deposit, patch, +context, public, buyer, reviewer, internal, Openly writable, Measurably +readable, Provable, and Valuable. + +New V47 scenarios are IP seller deposits an AssetPack and IP buyer buys a +Need-Fit AssetPack on staging-testnet. + +### Appendix J. Fail-closed contract and error posture matrix + +V47 fails closed on invalid deposit, prompt contract incompleteness, +parsed-envelope inadmissibility, no-survivor asset pack, authorization denial, +public projection overexposure, settlement conservation drift, stale promoted +status truth, measurement formula drift, BTC-testnet quote mismatch, and +repository delivery failure. + +### Appendix K. Source-bearing AssetPack and artifact contract catalog + +Source-bearing artifacts include `.bitcode/asset-pack.lock.json`, +`.bitcode/selected-source-material.json`, +`.bitcode/verification-report.json`, `.bitcode/source-to-shares.json`, +`.bitcode/projection-policy.json`, `.bitcode/system-proof-bundle.json`, and +`BITCODE_SPEC_V47_PROVEN.md`. Source-bearing payloads remain protected until +entitlement; source-safe receipts may be projected. + +## V47 accepted boundaries and reopen conditions + +- V46 remains active canon until V47 promotion. +- V47 Gate 1 does not authorize runtime behavior changes. +- V47 testnet means BTC amounts are testnet only; system behavior remains + production-intended. +- Measurement must be visible and source-safe before a user decides to deposit + or buy. +- Conversation surfaces, ChatGPT App commercialization, MCP/API + commercialization, deeper BTD mining cryptography, mainnet launch authority, + and advanced market mechanics are deferred to later versions. +- Any source leakage, measurement ambiguity, quote/finality collapse, rights + ambiguity, or delivery ambiguity reopens the relevant gate. + +## V47 completion condition + +V47 Gate 1 is complete when the V47 draft spec family exists over active V46, +testnet semantics and measurement law are specified, the seller/buyer launch +scope and ten-gate plan are recorded, the roadmap names V47 as active draft +target, `check:v47-gate1` exists, gate/canon workflows validate active V46 plus +draft V47, and the gate branch is committed, pushed, and pull-requested into +`version/v47`. diff --git a/BITCODE_SPEC_V47_DELTA.md b/BITCODE_SPEC_V47_DELTA.md new file mode 100644 index 000000000..0098ea7aa --- /dev/null +++ b/BITCODE_SPEC_V47_DELTA.md @@ -0,0 +1,137 @@ +# Bitcode Spec V47 Delta + +## Status + +- Version: `V47` +- V47 state: draft opening; V46 remains active canon while V47 scopes website commercial testnet launch readiness +- Current canonical/latest target: `V46` +- Prior canonical anchor: `BITCODE_SPEC_V46.md` +- Prior generated proof appendix: `BITCODE_SPEC_V46_PROVEN.md` +- Generated structured artifact inventory: planned draft `.bitcode/v47-spec-family-report.json`, `.bitcode/v47-canonical-input-report.json`, V47 launch-readiness artifacts, and `BITCODE_SPEC_V47_PROVEN.md` after promotion readiness +- Source parity state: V47 source parity is pending; Gate 1 is specification, roadmap, measurement-law, and workflow-hook opening only +- Notes companion: `BITCODE_SPEC_V47_NOTES.md` +- Spec companion: `BITCODE_SPEC_V47.md` +- Parity companion: `BITCODE_SPEC_V47_PARITY_MATRIX.md` +- Scope: V47 delta for commercial website testnet readiness over promoted V46 protocol comprehension canon +- Last fully realized canonical target preserved in source: `V46` + +## Why V47 exists + +V45 made Bitcode's knowledge commoditization law precise. V46 made that law +commercially legible. V47 exists to make the website application commercially +ready on staging-testnet: IP sellers can deposit AssetPacks, IP buyers can buy +Need-fitting AssetPacks, and `/packs` plus Auxillaries make the whole exchange +auditable, source-safe, and repairable. + +V47 is not a broad feature expansion. It is the first generally available MVP +launch-readiness version and therefore must freeze scope, remove or defer +feature excess, specify measurement law, prove seller and buyer state machines, +and validate the website E2E. + +## Accepted V47 decisions + +- V47 focuses on the rich website application: `/deposit`, `/read`, `/packs`, + and Auxillaries. +- In V47, testnet means BTC amounts and payment observations are testnet only; + all other protocol behavior should be production-intended. +- Measurement is the basis of IP commoditization: individual measurements, + inference prompts, typed outputs, weights, normalized contributions, BTD + scalar formula, and source-safe visualization are launch-critical. +- V47 must support two profiles: IP sellers and IP buyers. +- Conversation experiences, ChatGPT App commercialization, MCP/API + commercialization, deeper BTD mining cryptography, mainnet launch authority, + and advanced market mechanics are deferred. +- A dedicated feature-excess gate must remove, hide, or flag anything that + distracts from the launch MVP. +- A dedicated E2E gate must prove selling and buying IP the Bitcode way. +- A dedicated public launch messaging gate must refurbish the landing page for + V47 commercial testnet readiness. + +## Explicitly deferred + +- Value-bearing mainnet settlement. +- Commercial launch of API/MCP, ChatGPT App, and Bitcode Chat. +- Deeper BTD mining cryptographic implementation beyond existing website + launch contracts. +- Advanced exchange/market mechanics beyond the MVP seller/buyer AssetPack + flows. +- Source-bearing preview before BTC-testnet settlement and BTD rights transfer. + +## Pre-Implementation Sequence + +1. Open the V47 draft spec family over active V46. +2. Specify testnet semantics, measurement law, launch freeze, user profiles, + and gate plan. +3. Audit feature excess and gate misalignment. +4. Specify seller/buyer state machines and measurement visualizations. +5. Implement and test depositor website completion. +6. Implement and test reader website completion. +7. Complete `/packs` and Auxillaries commercial dashboard state. +8. Prove E2E IP selling and buying tests. +9. Rehearse canonical staging-testnet deployment. +10. Promote V47 only after commercial website launch-readiness evidence is + complete. + +## Commit-Body Direction + +V47 commits should describe the commercial launch behavior, the measurement or +state-machine proof they close, the commands run, and any feature flags or +deferrals introduced. Commit bodies should name source-safety, measurement, +testnet semantics, proof/readback, and user-flow consequences when relevant. + +## Gate 1: V47 Scope, Testnet Semantics, Measurement Law, And Launch Freeze + +Gate 1 closes when the V47 spec family exists over active V46, V47 is framed as +commercial website testnet launch readiness, testnet means only BTC amounts are +testnet/free, measurement law is explicit, seller and buyer flows are named, +the ten-gate launch plan is recorded, package and workflow checks exist, and no +V47 file claims promoted authority. + +## Gate 2: Feature Excess And Gate Alignment Audit + +Gate 2 audits all website features and protocol surfaces for launch relevance. +It removes wrong features, feature-flags post-V47 behavior, and records +deferrals so the first generally available MVP is focused. + +## Gate 3: Seller And Buyer State Machine Law + +Gate 3 specifies exact IP seller and IP buyer state machines, including +measurement, proof, repair, settlement, delivery, and `/packs` history. + +## Gate 4: Depositor Website Completion + +Gate 4 completes source connection, deposit AssetPack option synthesis, +source-safe review, Depository admission, and compensation visibility. + +## Gate 5: Reader Website Completion + +Gate 5 completes Read Request, Need synthesis/review, Finding Fits, preview, +quote, BTC-testnet settlement, BTD rights transfer, and PR delivery. + +## Gate 6: Packs And Auxillaries Commercial Dashboard + +Gate 6 completes identity, teams, wallets, histories, PackActivity +master-detail, filters/search, proof readback, and repair surfaces. + +## Gate 7: E2E IP Selling And Buying Tests + +Gate 7 adds browser-level tests proving both sides of Bitcode: deposit IP into +Bitcode, buy synthesized IP from Bitcode, and verify ledger/database/storage, +proof, settlement, rights, compensation, and delivery. + +## Gate 8: Landing Page And Public Launch Messaging + +Gate 8 refurbishes landing and public docs for V47 commercial testnet +readiness, core flows, proof-backed trust, source-safe IP exchange, and the +meaning of testnet. + +## Gate 9: Staging-Testnet Deployment Rehearsal + +Gate 9 validates the canonical staging-testnet deployment with realistic data, +real routes, real storage/database/ledger projections, and BTC-testnet +settlement. + +## Gate 10: V47 Promotion Readiness + +Gate 10 closes parity matrix, generated proof artifacts, CI/promotion workflow, +commercial website readiness, and canonical promotion. diff --git a/BITCODE_SPEC_V47_NOTES.md b/BITCODE_SPEC_V47_NOTES.md index bd8b06da7..2827eb0e2 100644 --- a/BITCODE_SPEC_V47_NOTES.md +++ b/BITCODE_SPEC_V47_NOTES.md @@ -7,19 +7,44 @@ - Active canonical anchor: `BITCODE_SPEC_V46.md` - Active generated proof appendix: `BITCODE_SPEC_V46_PROVEN.md` - Current canonical/latest target: `V46` -- Prior canonical anchor: `BITCODE_SPEC_V45.md` -- Prior generated proof appendix: `BITCODE_SPEC_V45_PROVEN.md` -- V47 state: notes-only draft opening -- Scope: V47 starts as a specification-workshopping target over promoted V46 protocol comprehension canon. +- Prior canonical anchor: `BITCODE_SPEC_V46.md` +- Prior generated proof appendix: `BITCODE_SPEC_V46_PROVEN.md` +- V47 state: draft opening for commercial website testnet launch readiness; V46 remains active canon +- Generated structured artifact inventory: planned draft `.bitcode/v47-spec-family-report.json`, `.bitcode/v47-canonical-input-report.json`, V47 commercial website testnet artifacts, and `BITCODE_SPEC_V47_PROVEN.md` after promotion readiness +- Source parity state: V47 source parity is pending; Gate 1 opens launch scope, testnet semantics, measurement law, and closure gates over promoted V46 +- Scope: V47 starts as the commercial website testnet launch-readiness target over promoted V46 protocol comprehension canon. -## Notes-only draft rule +## Notes companion rule -These notes make the V47 draft target visible to strict spec-quality checks after -V46 promotion. They are not first-gate implementation authority, not a full V47 -specification family, and not permission to bypass the V46 canon. V47 work must -continue by refining specification atoms, creating an explicit parity matrix, -and then opening scoped gate branches only after the new specification intent is -clear. +These notes accompany the V47 draft specification family. They are not stronger +than `BITCODE_SPEC_V47.md`, the active `BITCODE_SPEC.txt` pointer, or generated +proof artifacts. They record concise launch intent, user-flow emphasis, +measurement clarity, and deferrals while V46 remains active canon. + +## Concise current-system reading + +V45 and V46 made Bitcode's law and explanation precise enough for a final +website commercial-readiness pass. V47 should make the rich website application +deployable and demonstrable on staging-testnet across `/deposit`, `/read`, +`/packs`, and Auxillaries. + +IP sellers should be able to connect source, receive deposit AssetPack options, +review source-safe measurements, approve a deposit, and track future +compensation posture. IP buyers should be able to request a Read, review a +synthesized Need, request Finding Fits, review source-safe AssetPack +measurements and quote, settle on BTC testnet, receive BTD rights, and get +repository delivery. + +Measurement is the commercial center. Individual measurements, the prompts that +command them, typed output schemas, weights, normalized contributions, and +weighted BTD scalar visualization must be understandable to sellers and buyers. + +## Simplified-spec reading rule + +V47 should simplify launch experience, not protocol law. If a feature, route, +copy block, state, or panel does not help a seller deposit IP, a buyer buy IP, +an operator prove state, or a user understand source-safe measurement, it should +be removed, hidden, feature-flagged, or deferred. ## Deferred from V46 @@ -30,30 +55,32 @@ ChatGPT App, Bitcode Chat, proof roots, repair states, Bitcoin/BTC settlement language, BTD scalar-volume and rights language, GitHub delivery boundaries, compute constraints, storage boundaries, and build/process validation. -V47 begins from the remaining question: which protocol atoms need further -precision before the next implementation parity pass. The opening posture is -intentionally small so V47 can be workshopped from the promoted canon rather -than inherited from stale notes. +V47 begins from the remaining question: what is still required for complete +commercial website testnet readiness. Its posture is intentionally focused: +website application first, commercial testnet semantics, exact measurement law, +feature excess audit, E2E seller/buyer proof, and promotion readiness. ## Candidate V47 workstreams -- Protocol atom audit: inspect the promoted V46 law in small pieces and classify - each atom as precise, vague, contradictory, missing, or implementation-ready. -- Parity matrix preparation: convert accepted V47 specification changes into a - source-to-proof matrix before implementation gates begin. -- Product claim discipline: keep public, operator, interface, and proof - language aligned with source-safe AssetPack, BTD, BTC, rights, settlement, - delivery, repair, and compensation law. -- Commercial readiness proofs: identify the tests, generated artifacts, - workflows, local rehearsals, and staging-testnet evidence needed for any V47 - implementation gates. +- Scope, testnet semantics, measurement law, and launch freeze. +- Feature excess and gate alignment audit. +- Seller and buyer state machine law. +- Depositor website completion. +- Reader website completion. +- Packs and Auxillaries commercial dashboard. +- E2E IP selling and buying tests. +- Landing page and public launch messaging. +- Staging-testnet deployment rehearsal. +- V47 promotion readiness. ## Non-goals during V47 opening -- Do not implement V47 product behavior from this notes-only opening. -- Do not rewrite V46 promoted canon except through an explicit addendum. +- Do not implement product behavior until a scoped V47 gate authorizes it. +- Do not rewrite V46 promoted canon except through explicit V47 draft law and + accepted parity. - Do not expose raw source, unpaid AssetPack source, secrets, wallet private material, private settlement payloads, raw prompts, or raw provider responses. - Do not collapse estimate, quote, observed payment, final settlement, contributor allocation, delivery, compensation, and repair states. -- Do not treat notes-only V47 material as stronger than active V46 protocol law. +- Do not commercialize API/MCP, ChatGPT App, or Bitcode Chat in V47. +- Do not launch value-bearing mainnet settlement in V47. diff --git a/BITCODE_SPEC_V47_PARITY_MATRIX.md b/BITCODE_SPEC_V47_PARITY_MATRIX.md new file mode 100644 index 000000000..87b2d3f8b --- /dev/null +++ b/BITCODE_SPEC_V47_PARITY_MATRIX.md @@ -0,0 +1,93 @@ +# Bitcode Spec V47 Parity Matrix + +## Status + +- Version: `V47` +- V47 state: draft parity opening; V46 remains active canon while V47 scopes website commercial testnet launch readiness +- Current canonical/latest target: `V46` +- Prior canonical anchor: `BITCODE_SPEC_V46.md` +- Prior generated proof appendix: `BITCODE_SPEC_V46_PROVEN.md` +- Generated structured artifact inventory: planned draft `.bitcode/v47-spec-family-report.json`, `.bitcode/v47-canonical-input-report.json`, V47 launch-readiness artifacts, and `BITCODE_SPEC_V47_PROVEN.md` after promotion readiness +- Source parity state: V47 source parity is pending; Gate 1 records launch scope, measurement law, testnet semantics, and planned closure gates +- Notes companion: `BITCODE_SPEC_V47_NOTES.md` +- Spec companion: `BITCODE_SPEC_V47.md` +- Delta companion: `BITCODE_SPEC_V47_DELTA.md` +- Scope: V47 draft parity ledger for commercial website testnet readiness over promoted V46 protocol comprehension canon +- Last fully realized canonical target preserved in source: `V46` + +## Purpose + +This matrix records V47 launch-readiness parity work. V47 starts from promoted +V46 and narrows the first generally available MVP to the website application: +`/deposit`, `/read`, `/packs`, and Auxillaries. The matrix names what must be +specified, implemented, tested, documented, and proven before V47 can promote. + +## Audit basis + +Gate 1 audit inputs are `BITCODE_SPEC.txt`, `BITCODE_SPEC_V46.md`, +`BITCODE_SPEC_V46_DELTA.md`, `BITCODE_SPEC_V46_NOTES.md`, +`BITCODE_SPEC_V46_PARITY_MATRIX.md`, `BITCODE_SPEC_V46_PROVEN.md`, +`BITCODE_SPEC_V47.md`, `BITCODE_SPEC_V47_DELTA.md`, +`BITCODE_SPEC_V47_NOTES.md`, this parity matrix, `SPECIFICATIONS_ROADMAP.md`, +`package.json`, gate/canon workflows, `/deposit`, `/read`, `/packs`, +Auxillaries, pipeline packages, prompt registries, proof roots, ledger/database +storage readback, wallet/provider receipts, and repository delivery receipts. + +## V47 implementation matrix + +| Area | Required V47 result | Current judgment | Source-grounded finding | Closure gate | +| --- | --- | --- | --- | --- | +| Scope and launch freeze | V47 is website-first commercial staging-testnet readiness, not broad feature expansion | drafted | Gate 1 opens scope and keeps V46 active canon. | Gate 1 | +| Testnet semantics | Testnet means BTC amounts are testnet/free while the rest of the system behaves production-intended | drafted | Gate 1 records this as launch law. | Gate 1 | +| Measurement law | Catalog measurements, prompts, typed outputs, weights, BTD scalar formula, seller/buyer visualization, and proof roots | drafted | Gate 1 makes measurement the basis for price and settlement. | Gate 1 | +| Feature excess audit | Remove, hide, flag off, or defer non-launch behavior | draft-required | V47 needs a first-GA MVP discipline gate. | Gate 2 | +| Seller state machine | IP seller can connect source, synthesize options, review measurements, approve deposit, and track compensation | draft-required | Seller flow exists conceptually and needs exact website parity. | Gate 3 and Gate 4 | +| Buyer state machine | IP buyer can request Read, approve Need, Finding Fits, preview, settle, receive rights, and get PR delivery | draft-required | Buyer flow exists conceptually and needs exact website parity. | Gate 3 and Gate 5 | +| `/packs` dashboard | Master-detail PackActivity tracks deposits, reads, proofs, settlements, rights, delivery, compensation, repair | draft-required | V46 comprehension exists; V47 needs launch-ready dashboard behavior. | Gate 6 | +| Auxillaries launch readiness | Identity, source connections, target repository connections, wallets, teams, histories are usable | draft-required | Auxillaries must support website launch flows. | Gate 6 | +| E2E IP exchange tests | Browser tests prove selling and buying IP the Bitcode way | draft-required | V47 needs experiential proof, not only unit checks. | Gate 7 | +| Landing and public messaging | Landing page explains commercial testnet readiness and user flows | draft-required | Public claim readiness must match launch behavior. | Gate 8 | +| Staging-testnet rehearsal | Canonical deployment validates real routes, real data stores, and BTC-testnet settlement | draft-required | V47 promotion needs deployment-grade evidence. | Gate 9 | +| Promotion readiness | V47 generated artifacts, parity, CI, and promotion workflow are green | pending | Promotion remains later. | Gate 10 | + +## V47 implementation checklist + +| Area | Required V47 result | Current judgment | Source-grounded finding | Closure gate | +| --- | --- | --- | --- | --- | +| Active pointer truth | `BITCODE_SPEC.txt` remains V46 during Gate 1 | accepted boundary | V47 is draft only. | Gate 1 | +| Draft files | V47 SPEC, DELTA, NOTES, and PARITY files exist | drafted | Gate 1 creates full draft family. | Gate 1 | +| CI posture | Gate and canon workflows validate active V46 plus draft V47 | drafted | Gate 1 wires `check:v47-gate1`. | Gate 1 | +| Measurement prompt traceability | Every measurement points to prompt identity, typed output, weight, and proof | draft-required | Later gates must audit concrete prompt registry bindings. | Gate 3+ | +| Seller visualization | Depositors see source-safe measurement and compensation basis | draft-required | Deposit route must support decision-quality measurement views. | Gate 4 | +| Buyer visualization | Readers see source-safe fit measurements and quote basis before paying | draft-required | Read route must support decision-quality preview views. | Gate 5 | +| Website-only launch focus | API/MCP, ChatGPT App, and Bitcode Chat are deferred commercial surfaces | accepted boundary | V47 avoids scope sprawl. | Gate 1 and Gate 2 | +| Mainnet block | Value-bearing mainnet remains blocked | accepted boundary | BTC amounts are testnet only in V47. | Gate 1+ | + +## Grouped closure gates + +1. Scope, Testnet Semantics, Measurement Law, And Launch Freeze. +2. Feature Excess And Gate Alignment Audit. +3. Seller And Buyer State Machine Law. +4. Depositor Website Completion. +5. Reader Website Completion. +6. Packs And Auxillaries Commercial Dashboard. +7. E2E IP Selling And Buying Tests. +8. Landing Page And Public Launch Messaging. +9. Staging-Testnet Deployment Rehearsal. +10. Promotion Readiness. + +## V47 accepted boundaries + +- V46 remains active canon during V47 draft work. +- Gate 1 is specification, roadmap, and checking only. +- Testnet BTC does not weaken rights, proof, source-safety, authority, or + delivery boundaries. +- Measurement is source-safe and visible; source remains protected until + entitlement. +- Commercial launch scope is website-only. + +## V47 completion condition + +V47 Gate 1 is complete when the V47 draft spec family, roadmap, package script, +Gate 1 checker, and CI workflow hooks validate active V46 plus draft V47, and +the gate branch is committed, pushed, and pull-requested into `version/v47`. diff --git a/SPECIFICATIONS_ROADMAP.md b/SPECIFICATIONS_ROADMAP.md index 9131e9863..e09ce2dda 100644 --- a/SPECIFICATIONS_ROADMAP.md +++ b/SPECIFICATIONS_ROADMAP.md @@ -4,10 +4,12 @@ - Current active canonical pointer: `BITCODE_SPEC.txt` -> `V46` - Current active canon: `BITCODE_SPEC_V46.md` -- Current draft target: `BITCODE_SPEC_V47_NOTES.md` notes-only opening -- Current working gate: V47 opening preparation after V46 canonical promotion. -- Next queued work after V46 promotion: workshop V47 protocol atoms from promoted V46, then create the V47 parity matrix and scoped gate branches. +- Current draft target: `BITCODE_SPEC_V47.md` +- Current working gate: V47 Gate 1 Scope, Testnet Semantics, Measurement Law, And Launch Freeze. +- Next queued work after V47 Gate 1: Feature Excess And Gate Alignment Audit. - Latest closed gate: V46 Gate 8 Promotion Readiness And Canonical Promotion, which added `V46PromotionReadinessReport`, `.bitcode/v46-promotion-readiness-report.json`, `BITCODE_SPEC_V46_PROVEN.md`, V46 promotion workflow support, promotion-script support, promoted V46 / draft V47 runtime posture, source-safe promotion metadata, package exports, focused tests, workflow wiring, `check:v46-gate8`, and the standalone `BITCODE_SPEC.txt` pointer promotion to V46. +- V47 Gate 1 closure target: open the full V47 draft family over active V46, freeze V47 as commercial website testnet launch readiness for `/deposit`, `/read`, `/packs`, and Auxillaries, specify that testnet means BTC amounts are testnet/free while production-intended protocol behavior remains real, make measurement law explicit, name IP seller and IP buyer launch flows, list scoped V47 gates, expose `check:v47-gate1`, and wire CI to validate active V46 plus draft V47 without claiming V47 promotion. +- V47 Gate 1 closure anchor: Gate 1 is closed when V47 SPEC, DELTA, NOTES, and PARITY files validate in draft mode; this roadmap lists V47 as the active draft target; V46 remains the active pointer; CI runs draft V47 checks when V47 files exist; `check:v47-gate1` passes; and the gate branch is committed, pushed, and pull-requested into `version/v47`. - V45 Gate 19 closure anchor: promoted V45 spec-family checks, canonical-input checks, canon-posture drift checks, promoted-stale-posture tests, generated artifact freshness checks, `check:v45-gate19`, and diff hygiene passed before merge to `main`. - V46 Gate 1 closure target: open the V46 draft family over active V45, name commercial protocol comprehension as the V46 focus, list provisional V46 gates, expose `check:v46-gate1`, and wire CI to validate active V45 plus draft V46 without claiming V46 promotion. - V46 Gate 1 closure anchor: Gate 1 is closed when V46 SPEC, DELTA, NOTES, and PARITY files validate in draft mode, this roadmap lists V46 as active draft target, V45 remains the active pointer, CI runs draft V46 checks when V46 files exist, `check:v46-gate1` passes, and the gate branch is committed, pushed, and pull-requested into `version/v46`. @@ -158,7 +160,7 @@ They are referenced here for specification history only; active implementation w - 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. - Active Bitcode specifications: `BITCODE_SPEC_V46.md`, with companion `DELTA`, `NOTES`, `PARITY_MATRIX`, and `PROVEN` files. - Promoted Bitcode history: `BITCODE_SPEC_V26.md` through `BITCODE_SPEC_V45.md`, with companion `DELTA`, `NOTES`, `PARITY_MATRIX`, and `PROVEN` files. -- Draft and future Bitcode specifications: V47 opens next over promoted V46 as `BITCODE_SPEC_V47_NOTES.md` until a full V47 specification family is intentionally drafted. Planned V47+ work follows the active roadmap and any accepted notes created after V46 promotion. +- Draft and future Bitcode specifications: V47 opens over promoted V46 as `BITCODE_SPEC_V47.md`, with companion `DELTA`, `NOTES`, and `PARITY_MATRIX` files. Planned V47+ work follows the active roadmap, the V47 draft family, and any accepted notes created after V46 promotion. - Specification discipline references: `BITCODE_SPECIFYING.md` and `BITCODE_SPEC_TEMPLATEGUIDE.md`. ## Roadmap @@ -211,7 +213,7 @@ They are referenced here for specification history only; active implementation w | V44 | `BITCODE_SPEC_V44.md` | promoted historical Bitcode canon | Scaled engineering economy and tokenized AssetPack network operation after V43 route cleanup: enterprise AssetPack portfolios, Pack market signals, Reading demand signals, deposit supply opportunities, Reading budget policy, AssetPack quote policy, BTD/BTC/source-to-shares accounting, contributor compensation statements, organization policy, wallet/spend authority, scaled local/staging-testnet rehearsal, and polished economic operation across `/packs`, `/read`, and `/deposit` while keeping value-bearing mainnet blocked until later launch authority. | | V45 | `BITCODE_SPEC_V45.md` | promoted historical Bitcode canon | Knowledge commoditization protocol precision after V44 scaled economics: AssetPack commodity lifecycle, BTD Need-relative scalar knowledge-volume and rights, BTC settlement finality, source-safe interface disclosure, proof-backed readback, operational repair, generated proof-family artifacts, source-safe end-to-end rehearsal, and canonical promotion. | | V46 | `BITCODE_SPEC_V46.md` | active canon | Commercial protocol comprehension and launch-facing interface claim readiness after V45 knowledge commoditization law: source-safe public/operator explanation, product route comprehension for `/packs`, `/read`, and `/deposit`, API/MCP/ChatGPT App/Bitcode Chat claim contracts, proof-readable market activity, local interface rehearsal without value-bearing mainnet authority, and canonical promotion. | -| V47 | `BITCODE_SPEC_V47_NOTES.md` | notes-only draft target | Specification-workshopping target after promoted V46: audit protocol atoms in small pieces, refine exact Bitcode law before implementation parity, prepare the V47 parity matrix, and then open scoped gates only after the accepted specification changes are precise. | +| V47 | `BITCODE_SPEC_V47.md` | active draft target | Commercial website testnet launch readiness after V46 protocol comprehension: launch-freeze `/deposit`, `/read`, `/packs`, and Auxillaries; define testnet as BTC amounts only; make measurement law, weighted BTD scalar visualization, IP seller and IP buyer state machines, feature-excess audit, E2E IP selling/buying proof, landing/public messaging, staging-testnet rehearsal, and promotion readiness exact before V47 canon. | ## Current Planning Spine @@ -235,15 +237,16 @@ They are referenced here for specification history only; active implementation w 18. V43 promoted agentic deposit-side and route-product cleanup after the MVP paths became reliable: enterprises get deposit AssetPack options synthesized from connected repositories and Bitcode's observed Depository/Reading demand, then approve or reject source-safe, sub-critical, positive-ROI options for Depository admission; `/terminal` split into `/read` and `/deposit`, and `/exchange` became `/packs`. 19. V44 promoted the scaled engineering economy after product routes became intelligible: enterprise AssetPack portfolios, Pack market intelligence, Reading budgets and quote governance, deposit earning/ROI intelligence, BTD/BTC/source-to-shares compensation statements, organization policy/wallet authority, enterprise economic UX, and scaled local/staging-testnet rehearsal without weakening source-safety or value-bearing mainnet blocks. 20. V45 promoted Bitcode's knowledge commoditization law after V44: AssetPack as commodity, BTD as Need-relative scalar knowledge-volume and settled rights, BTC as settlement money, proof-backed readback as state authority, source-safe interface disclosure, operational repair, generated proof-family artifacts, source-safe rehearsal, and canonical promotion. -21. V46 opens commercial protocol comprehension after V45: the active law remains V45 while V46 drafts how public, operator, product, API/MCP, ChatGPT App, and Bitcode Chat surfaces explain AssetPacks, BTD scalar knowledge-volume and rights, BTC settlement, proof readback, source-safe preview, quotes, finality, delivery, compensation, and repair with launch-safe claims. +21. V46 promoted commercial protocol comprehension after V45: public, operator, product, API/MCP, ChatGPT App, and Bitcode Chat surfaces now have source-safe claim contracts for explaining AssetPacks, BTD scalar knowledge-volume and rights, BTC settlement, proof readback, source-safe preview, quotes, finality, delivery, compensation, and repair with launch-safe claims. +22. V47 opens commercial website testnet launch readiness after V46: the active law remains promoted V46 while V47 drafts the final website-first staging-testnet MVP scope, measurement law, IP seller and IP buyer launch flows, feature-excess audit, E2E IP exchange proof, landing-page readiness, staging-testnet rehearsal, and promotion readiness. ## Boundary Rules - Do not treat `_legacy/` ENGI specifications as active implementation authority. - Do use `_legacy/` specifications to understand why current Bitcode concepts exist and what must not regress. -- New version work must build on V45 active canon and V27 `$BTD` law unless a future promoted spec explicitly supersedes it. -- V46 is the active draft target opened from active V45 posture. -- V46 Gate 1 is a roadmap/spec-family/checking gate only. It does not authorize runtime protocol behavior. +- New version work must build on V46 active canon and V27 `$BTD` law unless a future promoted spec explicitly supersedes it. +- V47 is the active draft target opened from active V46 posture. +- V47 Gate 1 is a roadmap/spec-family/checking gate only. It does not authorize runtime protocol behavior. - V45 Gate 19 was a promotion addendum only. It repaired promoted specification posture and enforcement, not runtime protocol behavior. - No implementation route should be versioned by spec number; source should move in place with the active canon. - Future notes files are planning memory only until their version is explicitly opened as the draft-target SPEC family. diff --git a/package.json b/package.json index 7912f1cba..8fc33bec2 100644 --- a/package.json +++ b/package.json @@ -434,6 +434,7 @@ "generate:v46-promotion-readiness": "node scripts/generate-v46-promotion-readiness-report.mjs", "check:v46-promotion-readiness": "node scripts/generate-v46-promotion-readiness-report.mjs --check", "check:v46-gate8": "node scripts/check-v46-gate8-promotion-readiness.mjs", + "check:v47-gate1": "node scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs", "generate:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs", "check:v38-inference-surface-inventory": "node scripts/generate-v38-inference-surface-inventory.mjs --check", "check:v38-gate2": "node scripts/check-v38-gate2-inference-surface-inventory.mjs", diff --git a/packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js b/packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js index 9291bacd7..750260417 100644 --- a/packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js +++ b/packages/protocol/src/canonical/v46-local-interface-comprehension-rehearsal.js @@ -449,7 +449,10 @@ function buildPredicateResults(repoRoot) { sources.roadmap.includes('Current working gate: V46 Gate 8 Promotion Readiness And Canonical Promotion')) || (sources.roadmap.includes('V46 Gate 7 closure anchor') && sources.roadmap.includes('Latest closed gate: V46 Gate 8 Promotion Readiness And Canonical Promotion') && - sources.roadmap.includes('Current working gate: V47 opening preparation')), + (sources.roadmap.includes('Current working gate: V47 opening preparation') || + sources.roadmap.includes( + 'Current working gate: V47 Gate 1 Scope, Testnet Semantics, Measurement Law, And Launch Freeze', + ))), ), predicateResult( 'readmes-document-gate7', diff --git a/scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs b/scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs new file mode 100644 index 000000000..ae36f8a49 --- /dev/null +++ b/scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs @@ -0,0 +1,217 @@ +#!/usr/bin/env node + +import { execFileSync } from 'node:child_process'; +import { existsSync, readFileSync } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const defaultRepoRoot = path.resolve(__dirname, '..'); + +function read(root, relativePath) { + return readFileSync(path.join(root, relativePath), 'utf8'); +} + +function exists(root, relativePath) { + return existsSync(path.join(root, relativePath)); +} + +function git(root, args) { + return execFileSync('git', args, { cwd: root, encoding: 'utf8' }).trim(); +} + +function run(root, command, args) { + return execFileSync(command, args, { cwd: root, encoding: 'utf8', stdio: 'pipe' }).trim(); +} + +function assertCheck(failures, condition, message) { + if (!condition) failures.push(message); +} + +function parseArgs(argv) { + const args = { + repoRoot: defaultRepoRoot, + skipBranchCheck: false, + help: false, + }; + for (let index = 0; index < argv.length; index += 1) { + const arg = argv[index]; + if (arg === '--repo-root') args.repoRoot = path.resolve(argv[++index]); + else if (arg === '--skip-branch-check') args.skipBranchCheck = true; + else if (arg === '--help' || arg === '-h') args.help = true; + else throw new Error(`Unknown argument ${arg}`); + } + return args; +} + +function printHelp() { + process.stdout.write( + [ + 'Usage: node scripts/check-v47-gate1-scope-measurement-launch-freeze.mjs [--skip-branch-check] [--repo-root ]', + '', + 'Checks the V47 Gate 1 draft-opening posture: active V46 pointer, draft V47 spec family, website launch scope, measurement law, package script, and CI workflow hooks.', + ].join('\n'), + ); + process.stdout.write('\n'); +} + +const DRAFT_FILES = Object.freeze([ + 'BITCODE_SPEC_V47.md', + 'BITCODE_SPEC_V47_DELTA.md', + 'BITCODE_SPEC_V47_NOTES.md', + 'BITCODE_SPEC_V47_PARITY_MATRIX.md', +]); + +const REQUIRED_FILES = Object.freeze([ + 'BITCODE_SPEC.txt', + 'BITCODE_SPEC_V46.md', + 'BITCODE_SPEC_V46_PROVEN.md', + ...DRAFT_FILES, + 'SPECIFICATIONS_ROADMAP.md', + 'package.json', + '.github/workflows/bitcode-gate-quality.yml', + '.github/workflows/bitcode-canon-quality.yml', +]); + +const DRAFT_FILE_PHRASES = Object.freeze([ + 'Version: `V47`', + 'Current canonical/latest target: `V46`', + 'Prior canonical anchor: `BITCODE_SPEC_V46.md`', + 'Prior generated proof appendix: `BITCODE_SPEC_V46_PROVEN.md`', + 'Generated structured artifact inventory:', + 'Source parity state:', +]); + +const REQUIRED_SCOPE_PHRASES = Object.freeze([ + 'commercial website testnet launch readiness', + 'testnet means BTC amounts', + 'Measurement is the singular key', + 'No measurement, no price', + '/deposit', + '/read', + '/packs', + 'Auxillaries', + 'IP seller', + 'IP buyer', + 'Feature Excess And Gate Alignment Audit', + 'E2E IP Selling And Buying Tests', + 'Landing Page And Public Launch Messaging', + 'check:v47-gate1', +]); + +const FORBIDDEN_PROMOTION_PHRASES = Object.freeze([ + 'canonical promotion complete', + 'Canonical proof-source commit', + 'Active canonical anchor: `BITCODE_SPEC_V47.md`', + 'Active generated proof appendix: `BITCODE_SPEC_V47_PROVEN.md`', + 'Canonical pointer: `BITCODE_SPEC.txt` -> `V47`', + 'V47 is active canon', + 'promoted V47', + 'active `BITCODE_SPEC_V47_PROVEN.md`', +]); + +function includesInsensitive(content, phrase) { + return content.toLowerCase().includes(phrase.toLowerCase()); +} + +function main() { + const args = parseArgs(process.argv.slice(2)); + if (args.help) { + printHelp(); + return; + } + + const root = args.repoRoot; + const failures = []; + const pointer = read(root, 'BITCODE_SPEC.txt').trim(); + + assertCheck(failures, pointer === 'V46', `BITCODE_SPEC.txt must remain V46 during V47 Gate 1. Observed ${pointer || 'empty'}.`); + + if (!args.skipBranchCheck) { + const branch = git(root, ['branch', '--show-current']); + assertCheck( + failures, + branch === 'version/v47' || /^v47\/gate-1-[a-z0-9][a-z0-9-]*$/u.test(branch), + `V47 Gate 1 work must occur on version/v47 or v47/gate-1-* branches. Observed ${branch || 'detached HEAD'}.`, + ); + } + + for (const relativePath of REQUIRED_FILES) { + assertCheck(failures, exists(root, relativePath), `Missing required V47 Gate 1 file: ${relativePath}`); + } + + for (const relativePath of DRAFT_FILES) { + const content = exists(root, relativePath) ? read(root, relativePath) : ''; + for (const phrase of DRAFT_FILE_PHRASES) { + assertCheck(failures, content.includes(phrase), `${relativePath} must include "${phrase}".`); + } + for (const phrase of FORBIDDEN_PROMOTION_PHRASES) { + assertCheck(failures, !content.includes(phrase), `${relativePath} contains premature promoted V47 posture phrase "${phrase}".`); + } + } + + const spec = read(root, 'BITCODE_SPEC_V47.md'); + const delta = read(root, 'BITCODE_SPEC_V47_DELTA.md'); + const notes = read(root, 'BITCODE_SPEC_V47_NOTES.md'); + const parity = read(root, 'BITCODE_SPEC_V47_PARITY_MATRIX.md'); + const roadmap = read(root, 'SPECIFICATIONS_ROADMAP.md'); + const packageJson = read(root, 'package.json'); + const gateWorkflow = read(root, '.github/workflows/bitcode-gate-quality.yml'); + const canonWorkflow = read(root, '.github/workflows/bitcode-canon-quality.yml'); + const combined = [spec, delta, notes, parity, roadmap, packageJson, gateWorkflow, canonWorkflow].join('\n'); + + for (const phrase of REQUIRED_SCOPE_PHRASES) { + assertCheck(failures, includesInsensitive(combined, phrase), `V47 Gate 1 opening must include "${phrase}".`); + } + + for (const [label, content, phrase] of [ + ['spec', spec, '`BITCODE_SPEC.txt` points to `V46`; V46 is the active promoted Bitcode canon.'], + ['spec', spec, 'V47 does not make mainnet value-bearing claims.'], + ['spec', spec, 'Weighted scalar BTD formula:'], + ['delta', delta, 'Gate 1: V47 Scope, Testnet Semantics, Measurement Law, And Launch Freeze'], + ['notes', notes, 'Measurement is the commercial center.'], + ['parity', parity, 'V47 Gate 1 is complete when the V47 draft spec family'], + ['roadmap', roadmap, 'Current draft target: `BITCODE_SPEC_V47.md`'], + ['roadmap', roadmap, 'V47 Gate 1 closure anchor'], + ['roadmap', roadmap, '| V47 | `BITCODE_SPEC_V47.md` | active draft target |'], + ['package.json', packageJson, '"check:v47-gate1"'], + ['gate workflow', gateWorkflow, 'check-v47-gate1-scope-measurement-launch-freeze.mjs'], + ['canon workflow', canonWorkflow, 'check-v47-gate1-scope-measurement-launch-freeze.mjs'], + ]) { + assertCheck(failures, content.includes(phrase), `${label} must include "${phrase}".`); + } + + const commandChecks = [ + ['node', ['scripts/check-bitcode-spec-family.mjs', '--version', 'V46', '--mode', 'promoted', '--current-target', 'V46']], + ['node', ['scripts/check-bitcode-spec-family.mjs', '--version', 'V47', '--mode', 'draft', '--current-target', 'V46']], + ['node', ['scripts/check-bitcode-canonical-inputs.mjs', '--current-target', 'V46']], + ['node', ['scripts/check-bitcode-canon-posture-drift.mjs', '--active-canon', 'V46', '--draft-target', 'V47']], + ]; + + for (const [command, commandArgs] of commandChecks) { + try { + run(root, command, commandArgs); + } catch (error) { + failures.push(`Command failed: ${command} ${commandArgs.join(' ')}`); + if (error && typeof error === 'object' && 'stdout' in error) { + const stdout = String(error.stdout || '').trim(); + if (stdout) failures.push(stdout); + } + if (error && typeof error === 'object' && 'stderr' in error) { + const stderr = String(error.stderr || '').trim(); + if (stderr) failures.push(stderr); + } + } + } + + if (failures.length > 0) { + process.stderr.write(['V47 Gate 1 scope/measurement/launch-freeze check failed:', ...failures.map((failure) => `- ${failure}`)].join('\n')); + process.stderr.write('\n'); + process.exit(1); + } + + process.stdout.write('V47 Gate 1 scope/measurement/launch-freeze check passed.\n'); +} + +main();