Skip to content

Commit 42ad395

Browse files
wip v28
1 parent 3b2c16f commit 42ad395

54 files changed

Lines changed: 39418 additions & 7 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ uapi/stories/**/*.js
6565
admin/tailwind.config.js
6666
packages/**/tests/**/*.js
6767
packages/**/test/**/*.js
68+
# @bitcode/protocol is a runtime JavaScript package, not TypeScript build
69+
# output. These sources must ship in git clones for Vercel builds.
70+
!packages/protocol/src/**/*.js
71+
!packages/protocol/test/**/*.js
6872
!protocol-demonstration/test/v26-public-copy.test.js
6973
packages/**/examples/**/*.js
7074
packages/**/run/**/*.js

BITCODE_SPEC_V28_NOTES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ The standalone `protocol-demonstration` runtime must not import UAPI or commerci
136136
V28 closes this as a boundary baseline; V29 must continue commercializing freshly ported protocol internals into cleaner packages and narrower APIs.
137137
Dual-lane setup smoke also found that the embedded demonstration witness could overwrite the commercial Terminal browser title with `Bitcode Demonstration`.
138138
That is a commercial/demonstration boundary leak, so V28 now requires the mounted witness bundle to guard document-title writes when hosted inside `/terminal`; standalone demonstration may keep its demonstration title.
139-
The same deployment-readiness pass found a Vercel production build failure in `lib/bitcode-app-context.ts` because the newly formalized `@bitcode/protocol` package was present as a workspace dependency but had not been added to the Next transpilation/webpack alias path.
140-
V28 treats this as a commercial MVP blocker: formal protocol package imports must resolve during local and Vercel `next build`.
141-
The UAPI Next configuration now transpiles `@bitcode/protocol`, aliases its root import to `packages/protocol/src/index.js`, and the commercial protocol boundary test asserts this resolver so the standalone demonstration separation remains deployable.
139+
The same deployment-readiness pass found a Vercel production build failure in `lib/bitcode-app-context.ts` because the newly formalized `@bitcode/protocol` package exported runtime JS from `packages/protocol/src/**`, while those files were still ignored by the generic "package TS build output" rule.
140+
V28 treats this as a commercial MVP blocker: formal protocol package imports must resolve from a clean git clone during local and Vercel `next build`.
141+
The repository now explicitly unignores the `@bitcode/protocol` runtime JS source and package-boundary tests, the commercial protocol boundary test asserts required protocol runtime files are present and not ignored, and clean-repro builds pass after those runtime files are present in the clone.
142142

143143
Manual QA was re-ordered on May 8, 2026 into two directionalities.
144144
The first is natural operator progression: connect wallet/GitHub/identity prerequisites, perform the fastest simple Need through Fit/settlement/delivery readback, then perform the fastest simple Give through measurement/earning/settlement readback.

BITCODE_V28_QA.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Implemented after Pass 2, pending next manual QA confirmation:
171171
| Testnet-readiness | `http://127.0.0.1:3001/terminal` | renders HTTP 200 after cold compile | Server runs with public mock flags disabled and `NEXT_PUBLIC_BITCODE_ENV=testnet`; missing live credentials/providers are expected to appear as blocked readiness, not success. |
172172
| Both | `/terminal` browser title | pass | Follow-up smoke confirms both lanes keep the commercial `Bitcode Terminal` document title after the embedded witness title guard. |
173173
| Both | 2026-05-08 dev-server restart for Pass 3A | pass | Mock server restarted on `3000`; testnet-readiness server restarted on `3001`; curl and Playwright smoke confirm `/terminal` HTTP 200, `Bitcode Terminal` title, no page errors, and no non-HMR internal 404s after reload. |
174-
| Vercel deployment build | pass after fix | Latest deployment failed because `lib/bitcode-app-context.ts` imported `@bitcode/protocol` before Next's workspace-package resolver knew how to transpile/alias the new formal protocol package. V28 now adds `@bitcode/protocol` to `transpilePackages`, aliases the root import to `packages/protocol/src/index.js`, and verifies the resolver in `tests/protocolCommercialBoundary.test.ts`. Local `pnpm run build` from `uapi` now passes. |
174+
| Vercel deployment build | pass after fix | Latest deployment failed because the formal `@bitcode/protocol` package exported `packages/protocol/src/index.js`, but the runtime JS source files under `packages/protocol/src/**` were still ignored as generic TS build output and therefore absent from clean Vercel clones. V28 now unignores the protocol package runtime JS and package-boundary tests, verifies required runtime files are present and not ignored, and clean-repro builds pass after those files are present. |
175175
| Mock top chrome during 1A | pass | Manual reconfirmation on 2026-05-08 accepted the fixed mock balance, notification, and profile posture. V28 now treats master mock mode as sufficient for auxillaries mock data in client and server code, explicitly exposes public mock flags through Next config, and revalidates stale module-level user data on new mount so lane transitions cannot keep anonymous/zero cached data. |
176176
| Dual-lane dev artifact isolation | pass | Manual reconfirmation on 2026-05-08 accepted the mock/testnet-readiness separation. V28 QA servers use lane-specific `NEXT_DIST_DIR` values so public mock env compilation is isolated per lane. |
177177
| Mock Terminal data classification | pass | Manual QA clarified that the currently visible Terminal data is mock data because the operator is in the mock lane. This evidence remains mock-lane evidence only, not testnet-readiness evidence. |
@@ -216,9 +216,9 @@ Automated verification after this implementation pass:
216216
- `npm --prefix protocol-demonstration run test:v28-commercial-mvp-qa`: 8 passed after adding the boundary-separation checks.
217217
- `pnpm -C uapi exec jest --runInBand tests/demonstrationWitnessMount.test.tsx tests/demonstrationWitnessScopedStylesRoute.test.ts tests/terminalPreservedShellSurface.test.tsx tests/terminalShellBridge.test.tsx tests/marketingLandingPage.test.tsx tests/api/needReviewProtocolParity.test.ts tests/api/bitcodeAppContextOptions.test.ts tests/protocolCommercialBoundary.test.ts`: 18 passed after the formal protocol package split.
218218
- `node --test --test-force-exit protocol-demonstration/test/v28-boundary-separation.test.js`: 2 passed after the formal package split.
219-
- `pnpm -C packages/protocol test`: 1 passed after the formal package split.
219+
- `pnpm -C packages/protocol test`: 2 passed after the formal package split and protocol runtime-source deployment fix.
220220
- `pnpm -C packages/protocol run typecheck`: pass after adding the formal package typecheck config.
221-
- `pnpm -C uapi exec jest --runInBand tests/protocolCommercialBoundary.test.ts`: 3 passed after the formal package split.
221+
- `pnpm -C uapi exec jest --runInBand tests/protocolCommercialBoundary.test.ts`: 5 passed after adding the formal protocol deployment-source boundary check.
222222
- `pnpm -C uapi exec jest --runInBand tests/useUserDataHydration.test.tsx tests/featureFlagsMockMode.test.ts tests/protocolCommercialBoundary.test.ts`: 11 passed after the mock top-chrome cache/flag fix, JavaScript companion parity check, and protocol package resolver check.
223223
- Playwright dual-lane browser verification after lane-specific `NEXT_DIST_DIR` restart: mock lane shows `0.042 BTC`, `1,200 BTD`, mock review state, reviewer profile, and populated notifications; testnet-readiness lane shows no mock balances, no mock review state, and the Connect Wallet prerequisite controls; both lanes have no product console/page errors.
224224

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { sha256, nowIso } from './bitcode-core.js';
2+
3+
export function buildAttestationSnapshot() {
4+
const gitCommit = 'demo-cff6dc9';
5+
const imageDigest = `sha256:${sha256('bitcode-demo-image')}`;
6+
const policyDigest = `sha256:${sha256('bitcode-policy-release-v1')}`;
7+
const verifierDigest = `sha256:${sha256('bitcode-demo-verifier')}`;
8+
9+
return {
10+
deploymentId: `deploy_${sha256(`${gitCommit}:${imageDigest}`).slice(0, 10)}`,
11+
builtAt: nowIso(),
12+
gitCommit,
13+
imageDigest,
14+
verifierDigest,
15+
policyDigest,
16+
provenance: {
17+
buildSystem: 'github-actions (modeled)',
18+
predicateType: 'https://slsa.dev/provenance/v1',
19+
sourceRepo: 'workspace/bitcode',
20+
builderIdentity: 'github-actions/demo-workflow',
21+
attestationStatus: 'modeled-demo'
22+
},
23+
runtimeClaims: [
24+
'Receipts reference the current deployment id.',
25+
'Measurement logic is deterministic within this prototype shell.',
26+
'Private bundle content is disclosed only on licensed issuance responses.'
27+
]
28+
};
29+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { clampBp } from './bitcode-core.js';
2+
import { telemetrySpan } from './telemetry.js';
3+
4+
/**
5+
* @param {any} input
6+
* @returns {any}
7+
*/
8+
export function buildBenchmarkComparison({ bundleId, benchmark, baselineBp, treatmentBp }) {
9+
return telemetrySpan('bitcode.buildBenchmarkComparison', {
10+
bundleId,
11+
benchmark,
12+
baselineBp,
13+
treatmentBp
14+
}, () => {
15+
const upliftBp = clampBp(Number(treatmentBp) - Number(baselineBp));
16+
const improved = upliftBp > 0;
17+
18+
return {
19+
bundleId,
20+
benchmark,
21+
task: 'Recover a production monorepo auth migration with issuer mismatch while preserving session validity and rollback safety.',
22+
baselineBp: clampBp(baselineBp),
23+
treatmentBp: clampBp(treatmentBp),
24+
upliftBp,
25+
baselineOutcome: improved
26+
? 'Without the licensed bundle, the remediation system proposes a generic rollback that misses issuer compatibility sequencing and audit guardrails.'
27+
: 'Without the licensed bundle, the remediation system performs roughly the same as treatment.' ,
28+
treatmentOutcome: improved
29+
? 'With the licensed bundle, the remediation system restores verifier configuration in the right order, preserves session invariants, and emits the expected audit steps.'
30+
: 'With the licensed bundle, the remediation system does not materially outperform baseline in this run.',
31+
whyItHelped: improved
32+
? 'The licensed bundle supplied specific rollback sequencing, issuer-mismatch diagnosis, and proof-backed validator patch guidance that the baseline system lacked.'
33+
: 'The licensed bundle did not add enough task-specific knowledge to create measurable lift in this run.',
34+
businessImpact: improved
35+
? 'Higher confidence incident recovery, faster safe rollback, and lower risk of releasing an auth fix that breaks live sessions.'
36+
: 'No measurable buyer impact established in this run.',
37+
interpretation: improved
38+
? 'Licensed bundle improved the reader system\'s remediation performance on the target task.'
39+
: 'No measurable lift detected in this run.',
40+
checks: [
41+
'same task family',
42+
'baseline without licensed bundle',
43+
'treatment with licensed bundle',
44+
'scored in basis points for simple comparability'
45+
]
46+
};
47+
});
48+
}

0 commit comments

Comments
 (0)