Skip to content

Commit 238d2c5

Browse files
V43 Gate 6: Add deposit policy and compensation scoring
Implement source-safe DepositAssetPackOptionPolicyReport scoring for criticality, likely demand, ROI, estimate-only BTD potential, and BTC source-to-shares compensation preview. Wire the policy through /deposit session state and UI readback, add package and route tests, bind protocol exports/checkers/artifacts, refresh V43 docs/workflows, and keep Gate 7 admission/indexing deferred. Validation: pnpm run check:v43-gate1; pnpm run check:v43-gate2; pnpm run check:v43-gate3 --skip-uapi-tests; pnpm run check:v43-gate4 --skip-uapi-tests; pnpm run check:v43-gate5 --skip-uapi-tests --skip-package-tests; pnpm run check:v43-gate6; pnpm --filter @bitcode/protocol test -- v43-deposit-policy-compensation.test.js; pnpm --filter @bitcode/protocol typecheck; pnpm --filter @bitcode/pipeline-asset-pack typecheck; pnpm --filter @bitcode/pipeline-asset-pack exec jest deposit-asset-pack-option-policy.test.ts deposit-asset-pack-options.test.ts --runInBand; pnpm --dir uapi exec jest --runTestsByPath tests/depositRouteModel.test.ts tests/depositPageClient.test.tsx --runInBand; pnpm --dir uapi exec tsc --noEmit --pretty false; pnpm --dir uapi run lint; pnpm --dir uapi run build; Playwright /deposit smoke.
1 parent a1dc0a4 commit 238d2c5

31 files changed

Lines changed: 1846 additions & 88 deletions
Lines changed: 307 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
{
2+
"artifactId": "v43-deposit-policy-compensation",
3+
"schemaId": "bitcode.v43.depositPolicyCompensation.v1",
4+
"version": "V43",
5+
"currentTarget": "V42",
6+
"sourceSafetyVerdict": "source-safe-deposit-policy-compensation-metadata",
7+
"generatedAt": "deterministic",
8+
"artifactRoot": "v43-deposit-policy-compensation:06077693236133dff819908a",
9+
"passed": true,
10+
"objectIds": [
11+
"DepositAssetPackOptionPolicy",
12+
"DepositAssetPackOptionPolicyReport",
13+
"DepositAssetPackOptionPolicyEvaluation",
14+
"source criticality posture",
15+
"likely demand posture",
16+
"ROI posture",
17+
"BTD potential estimate",
18+
"BTC source-to-shares compensation route",
19+
"future Gate 7 admission boundary"
20+
],
21+
"fieldIds": [
22+
"sourceCriticality",
23+
"demand",
24+
"roi",
25+
"btdPotential",
26+
"compensation",
27+
"policyDecision",
28+
"admissionBoundary",
29+
"policy roots"
30+
],
31+
"forbiddenPayloadIds": [
32+
"protected_source_payload",
33+
"raw_source_text",
34+
"unpaid_assetpack_source",
35+
"raw_protected_prompt",
36+
"interpolated_prompt",
37+
"raw_provider_response",
38+
"wallet_private_material",
39+
"settlement_private_payload"
40+
],
41+
"contractRows": [
42+
{
43+
"rowId": "criticality-policy",
44+
"owner": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
45+
"contract": "DepositAssetPackOptionPolicy evaluates source criticality from source-safe criticality signals and blocks critical IP before Gate 7 admission.",
46+
"requiredFields": [
47+
"sourceCriticality",
48+
"blocked-critical-source",
49+
"critical_source_policy_block"
50+
],
51+
"rowRoot": "v43-deposit-policy-contract:e5411b4187a92443f8ac974f",
52+
"sourceSafeMetadataOnly": true,
53+
"protectedSourceVisible": false,
54+
"unpaidAssetPackSourceVisible": false
55+
},
56+
{
57+
"rowId": "demand-roi-policy",
58+
"owner": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
59+
"contract": "Policy evaluates likely demand and ROI deterministically from source-safe option measurements, demand confidence, estimated settlement, and development cost.",
60+
"requiredFields": [
61+
"demand",
62+
"roi",
63+
"positive-expected-value",
64+
"negative-expected-value"
65+
],
66+
"rowRoot": "v43-deposit-policy-contract:b686a0c2af187d224c61c5f7",
67+
"sourceSafeMetadataOnly": true,
68+
"protectedSourceVisible": false,
69+
"unpaidAssetPackSourceVisible": false
70+
},
71+
{
72+
"rowId": "btd-compensation-policy",
73+
"owner": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
74+
"contract": "Policy exposes BTD potential as estimate-only and previews future-reader BTC source-to-shares compensation without minting BTD or transferring rights.",
75+
"requiredFields": [
76+
"btdPotential",
77+
"compensation",
78+
"source-to-shares-largest-remainder",
79+
"BTC"
80+
],
81+
"rowRoot": "v43-deposit-policy-contract:00577909a54242c3c4cf17e3",
82+
"sourceSafeMetadataOnly": true,
83+
"protectedSourceVisible": false,
84+
"unpaidAssetPackSourceVisible": false
85+
},
86+
{
87+
"rowId": "route-policy-readback",
88+
"owner": "uapi/app/deposit/DepositPageClient.tsx",
89+
"contract": "/deposit renders policy readback for criticality, demand, ROI, BTD potential, and compensation while admission/indexing remain owned by Gate 7.",
90+
"requiredFields": [
91+
"DepositAssetPackOptionPolicy",
92+
"BTC source-to-shares preview",
93+
"future-gate7-deposit-option-review"
94+
],
95+
"rowRoot": "v43-deposit-policy-contract:d04bd16cdda75bf1c0539c52",
96+
"sourceSafeMetadataOnly": true,
97+
"protectedSourceVisible": false,
98+
"unpaidAssetPackSourceVisible": false
99+
}
100+
],
101+
"sourceRoots": {
102+
"activePointer": "BITCODE_SPEC.txt:75f3f6d81f999da998f40cb6",
103+
"spec": "BITCODE_SPEC_V43.md:801a9fc58bfeddd4c71140ac",
104+
"delta": "BITCODE_SPEC_V43_DELTA.md:3f942fe82b77655231ddb8ed",
105+
"notes": "BITCODE_SPEC_V43_NOTES.md:540a19ddbba065526ebe0819",
106+
"parity": "BITCODE_SPEC_V43_PARITY_MATRIX.md:0555bc917046cbad7995966e",
107+
"roadmap": "SPECIFICATIONS_ROADMAP.md:aa1ee2ac496931752e11cd7e",
108+
"readme": "README.md:89be1d13f8d516dc263bd9cf",
109+
"protocolReadme": "packages/protocol/README.md:ecd8d9539e4cacdc7d1a32e6",
110+
"packageJson": "package.json:d5e4b589e6a81ff3ba867017",
111+
"gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:715ca61f2961eae12ae64bb8",
112+
"canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:c9d194dbe48ea4eafd75f225",
113+
"optionModel": "packages/pipelines/asset-pack/src/deposit-asset-pack-options.ts:df560ea2544282645f57a6b5",
114+
"policyModel": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts:12816b23b2d8e304ab4a1638",
115+
"optionModelTest": "packages/pipelines/asset-pack/src/__tests__/deposit-asset-pack-options.test.ts:66cfc8c728f134087476a3a3",
116+
"policyModelTest": "packages/pipelines/asset-pack/src/__tests__/deposit-asset-pack-option-policy.test.ts:1af7adccac488298ccd7f048",
117+
"routeModel": "uapi/app/deposit/deposit-route-model.ts:65e22b7bd3a9dcd6db0b7a47",
118+
"client": "uapi/app/deposit/DepositPageClient.tsx:13f13e38dff99f46eb557179",
119+
"routeModelTest": "uapi/tests/depositRouteModel.test.ts:c755b89c1e977e101aee25c1",
120+
"pageTest": "uapi/tests/depositPageClient.test.tsx:f1526e498bfa332b3eb2cc42",
121+
"packageIndex": "packages/pipelines/asset-pack/src/index.ts:7eddc6519cf67b4044fcd40e",
122+
"packageManifest": "packages/pipelines/asset-pack/package.json:09e67662168fc921a53c696e",
123+
"protocolIndex": "packages/protocol/src/index.js:533d73eb0b2cf01b4ac5c8b5",
124+
"protocolTypes": "packages/protocol/src/index.d.ts:307e3a474c62fcce0b015be6",
125+
"protocolTest": "packages/protocol/test/v43-deposit-policy-compensation.test.js:f84b0c016065b10f796eb775",
126+
"generator": "scripts/generate-v43-deposit-policy-compensation.mjs:0117b1222d0f4a4640324b47",
127+
"checker": "scripts/check-v43-gate6-deposit-policy-compensation.mjs:03412b725c36f24991a6325e"
128+
},
129+
"predicateResults": [
130+
{
131+
"id": "active-canon-pointer-remains-v42",
132+
"sourcePath": "BITCODE_SPEC.txt",
133+
"passed": true
134+
},
135+
{
136+
"id": "spec-defines-gate6",
137+
"sourcePath": "BITCODE_SPEC_V43.md",
138+
"passed": true
139+
},
140+
{
141+
"id": "spec-names-policy-objects",
142+
"sourcePath": "BITCODE_SPEC_V43.md",
143+
"passed": true
144+
},
145+
{
146+
"id": "delta-records-gate6",
147+
"sourcePath": "BITCODE_SPEC_V43_DELTA.md",
148+
"passed": true
149+
},
150+
{
151+
"id": "notes-records-gate6",
152+
"sourcePath": "BITCODE_SPEC_V43_NOTES.md",
153+
"passed": true
154+
},
155+
{
156+
"id": "parity-records-gate6",
157+
"sourcePath": "BITCODE_SPEC_V43_PARITY_MATRIX.md",
158+
"passed": true
159+
},
160+
{
161+
"id": "roadmap-records-gate6",
162+
"sourcePath": "SPECIFICATIONS_ROADMAP.md",
163+
"passed": true
164+
},
165+
{
166+
"id": "readme-records-gate6",
167+
"sourcePath": "README.md",
168+
"passed": true
169+
},
170+
{
171+
"id": "protocol-readme-records-gate6",
172+
"sourcePath": "packages/protocol/README.md",
173+
"passed": true
174+
},
175+
{
176+
"id": "policy-model-defines-report",
177+
"sourcePath": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
178+
"passed": true
179+
},
180+
{
181+
"id": "policy-model-defines-criticality",
182+
"sourcePath": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
183+
"passed": true
184+
},
185+
{
186+
"id": "policy-model-defines-demand-roi",
187+
"sourcePath": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
188+
"passed": true
189+
},
190+
{
191+
"id": "policy-model-defines-btd-compensation",
192+
"sourcePath": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
193+
"passed": true
194+
},
195+
{
196+
"id": "policy-model-defers-gate7-admission",
197+
"sourcePath": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
198+
"passed": true
199+
},
200+
{
201+
"id": "policy-model-forbids-source-leakage",
202+
"sourcePath": "packages/pipelines/asset-pack/src/deposit-asset-pack-option-policy.ts",
203+
"passed": true
204+
},
205+
{
206+
"id": "route-model-owns-policy",
207+
"sourcePath": "uapi/app/deposit/deposit-route-model.ts",
208+
"passed": true
209+
},
210+
{
211+
"id": "deposit-client-renders-policy",
212+
"sourcePath": "uapi/app/deposit/DepositPageClient.tsx",
213+
"passed": true
214+
},
215+
{
216+
"id": "asset-pack-package-exports-policy",
217+
"sourcePath": "packages/pipelines/asset-pack/src/index.ts",
218+
"passed": true
219+
},
220+
{
221+
"id": "asset-pack-manifest-exports-policy",
222+
"sourcePath": "packages/pipelines/asset-pack/package.json",
223+
"passed": true
224+
},
225+
{
226+
"id": "policy-test-covers-report",
227+
"sourcePath": "packages/pipelines/asset-pack/src/__tests__/deposit-asset-pack-option-policy.test.ts",
228+
"passed": true
229+
},
230+
{
231+
"id": "route-test-covers-policy",
232+
"sourcePath": "uapi/tests/depositRouteModel.test.ts",
233+
"passed": true
234+
},
235+
{
236+
"id": "page-test-covers-policy",
237+
"sourcePath": "uapi/tests/depositPageClient.test.tsx",
238+
"passed": true
239+
},
240+
{
241+
"id": "protocol-test-covers-artifact",
242+
"sourcePath": "packages/protocol/test/v43-deposit-policy-compensation.test.js",
243+
"passed": true
244+
},
245+
{
246+
"id": "protocol-package-exports-gate6",
247+
"sourcePath": "packages/protocol/src/index.js",
248+
"passed": true
249+
},
250+
{
251+
"id": "protocol-types-export-gate6",
252+
"sourcePath": "packages/protocol/src/index.d.ts",
253+
"passed": true
254+
},
255+
{
256+
"id": "package-json-exposes-gate6",
257+
"sourcePath": "package.json",
258+
"passed": true
259+
},
260+
{
261+
"id": "gate-workflow-runs-gate6",
262+
"sourcePath": ".github/workflows/bitcode-gate-quality.yml",
263+
"passed": true
264+
},
265+
{
266+
"id": "canon-workflow-runs-gate6",
267+
"sourcePath": ".github/workflows/bitcode-canon-quality.yml",
268+
"passed": true
269+
},
270+
{
271+
"id": "generator-exists",
272+
"sourcePath": "scripts/generate-v43-deposit-policy-compensation.mjs",
273+
"passed": true
274+
},
275+
{
276+
"id": "checker-exists",
277+
"sourcePath": "scripts/check-v43-gate6-deposit-policy-compensation.mjs",
278+
"passed": true
279+
}
280+
],
281+
"coverage": {
282+
"depositPolicyImplemented": true,
283+
"criticalityPolicyImplemented": true,
284+
"criticalSourceBlockedBeforeAdmission": true,
285+
"demandPolicyImplemented": true,
286+
"roiPolicyImplemented": true,
287+
"btdPotentialEstimateOnly": true,
288+
"compensationPolicyImplemented": true,
289+
"compensationPriceAsset": "BTC",
290+
"compensationAllocationMethod": "source-to-shares-largest-remainder",
291+
"btdMintRequiresFutureNeedFitSettlement": true,
292+
"admissionAndIndexingDeferredToGate7": true,
293+
"routePolicyReadbackImplemented": true,
294+
"sourceSafeMetadataOnly": true,
295+
"protectedSourceVisible": false,
296+
"rawSourceTextVisible": false,
297+
"unpaidAssetPackSourceVisible": false,
298+
"rawPromptVisible": false,
299+
"interpolatedPromptVisible": false,
300+
"rawProviderResponseVisible": false,
301+
"walletPrivateMaterialVisible": false,
302+
"settlementPrivatePayloadVisible": false,
303+
"requiredPredicateCount": 30,
304+
"passedPredicateCount": 30,
305+
"failedPredicateIds": []
306+
}
307+
}

.bitcode/v43-deposit-route-options.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"currentTarget": "V42",
66
"sourceSafetyVerdict": "source-safe-deposit-route-option-metadata",
77
"generatedAt": "deterministic",
8-
"artifactRoot": "v43-deposit-route-options:1526fdf3f411384b07dd5db3",
8+
"artifactRoot": "v43-deposit-route-options:cad9aab28407bb9a43dd27aa",
99
"passed": true,
1010
"stepIds": [
1111
"connect-source",
@@ -111,33 +111,33 @@
111111
],
112112
"sourceRoots": {
113113
"activePointer": "BITCODE_SPEC.txt:75f3f6d81f999da998f40cb6",
114-
"spec": "BITCODE_SPEC_V43.md:33b2ffd69e638cda5924ff84",
115-
"delta": "BITCODE_SPEC_V43_DELTA.md:eda402621bd2f265573cfae3",
116-
"notes": "BITCODE_SPEC_V43_NOTES.md:276187a00ac011add5b867ab",
117-
"parity": "BITCODE_SPEC_V43_PARITY_MATRIX.md:3b29425561456f9bc81745a5",
118-
"roadmap": "SPECIFICATIONS_ROADMAP.md:58c7f7db3966ba19c82db7e5",
119-
"readme": "README.md:e090d2bf24246cb842600900",
120-
"protocolReadme": "packages/protocol/README.md:cee8de9b189f70c155029df7",
121-
"packageJson": "package.json:bb1ffd9a93103ef8519c1920",
122-
"gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:2fd6aec9c8291402cdfca043",
123-
"canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:b0479c7d71076f41e34011e7",
114+
"spec": "BITCODE_SPEC_V43.md:801a9fc58bfeddd4c71140ac",
115+
"delta": "BITCODE_SPEC_V43_DELTA.md:3f942fe82b77655231ddb8ed",
116+
"notes": "BITCODE_SPEC_V43_NOTES.md:540a19ddbba065526ebe0819",
117+
"parity": "BITCODE_SPEC_V43_PARITY_MATRIX.md:0555bc917046cbad7995966e",
118+
"roadmap": "SPECIFICATIONS_ROADMAP.md:aa1ee2ac496931752e11cd7e",
119+
"readme": "README.md:89be1d13f8d516dc263bd9cf",
120+
"protocolReadme": "packages/protocol/README.md:ecd8d9539e4cacdc7d1a32e6",
121+
"packageJson": "package.json:d5e4b589e6a81ff3ba867017",
122+
"gateWorkflow": ".github/workflows/bitcode-gate-quality.yml:715ca61f2961eae12ae64bb8",
123+
"canonWorkflow": ".github/workflows/bitcode-canon-quality.yml:c9d194dbe48ea4eafd75f225",
124124
"terminalRoutes": "uapi/app/terminal/terminal-routes.ts:80f478da2673f1a64ada9bfb",
125-
"routeModel": "uapi/app/deposit/deposit-route-model.ts:f8a9c553c9ef418538981f76",
125+
"routeModel": "uapi/app/deposit/deposit-route-model.ts:65e22b7bd3a9dcd6db0b7a47",
126126
"page": "uapi/app/deposit/page.tsx:6bab6a9debab3f4350d0ddca",
127-
"client": "uapi/app/deposit/DepositPageClient.tsx:aacb1c4ba2bc494f62e5eee8",
127+
"client": "uapi/app/deposit/DepositPageClient.tsx:13f13e38dff99f46eb557179",
128128
"optionModel": "packages/pipelines/asset-pack/src/deposit-asset-pack-options.ts:df560ea2544282645f57a6b5",
129129
"optionModelTest": "packages/pipelines/asset-pack/src/__tests__/deposit-asset-pack-options.test.ts:66cfc8c728f134087476a3a3",
130-
"packageIndex": "packages/pipelines/asset-pack/src/index.ts:056519274720276b37d3432d",
131-
"packageManifest": "packages/pipelines/asset-pack/package.json:ae609a986babb6d97ddce16f",
130+
"packageIndex": "packages/pipelines/asset-pack/src/index.ts:7eddc6519cf67b4044fcd40e",
131+
"packageManifest": "packages/pipelines/asset-pack/package.json:09e67662168fc921a53c696e",
132132
"publicCopy": "uapi/components/base/bitcode/layout/bitcode-public-copy.ts:3a45184ba8d2a4e71858c597",
133133
"publicExplainers": "uapi/components/base/bitcode/layout/bitcode-public-explainers.ts:282d915eac3c9f22ba8c07f1",
134134
"workspaceSurface": "uapi/components/base/bitcode/layout/workspace-surface.ts:12418d5db9c3ddad6d10c841",
135135
"nav": "uapi/components/base/bitcode/layout/nav.tsx:d7d1a8104e780bb7c25f1880",
136136
"footer": "uapi/components/base/bitcode/layout/footer.tsx:44749b98e5f63e7ac8f9f574",
137-
"routeModelTest": "uapi/tests/depositRouteModel.test.ts:c4b37d9400817a86af56306a",
138-
"pageTest": "uapi/tests/depositPageClient.test.tsx:f2931dcddd80be378ce40aaf",
139-
"protocolIndex": "packages/protocol/src/index.js:d6fea9aa2abae4a717a3373a",
140-
"protocolTypes": "packages/protocol/src/index.d.ts:32caa412e41598f3c0c9bad8",
137+
"routeModelTest": "uapi/tests/depositRouteModel.test.ts:c755b89c1e977e101aee25c1",
138+
"pageTest": "uapi/tests/depositPageClient.test.tsx:f1526e498bfa332b3eb2cc42",
139+
"protocolIndex": "packages/protocol/src/index.js:533d73eb0b2cf01b4ac5c8b5",
140+
"protocolTypes": "packages/protocol/src/index.d.ts:307e3a474c62fcce0b015be6",
141141
"protocolTest": "packages/protocol/test/v43-deposit-route-options.test.js:6576a3d4947b9bc23f7a786d",
142142
"generator": "scripts/generate-v43-deposit-route-options.mjs:2d92d5e9c25e2e66712953f9",
143143
"checker": "scripts/check-v43-gate5-deposit-route-options.mjs:10c6ad1594ea8bd06f97d7d5"

0 commit comments

Comments
 (0)