Skip to content

Commit 37ea6d7

Browse files
Merge pull request #204 from engineeredsoftware/v45/gate-1-v44-promotion-addendum
2 parents 344b6c9 + 703466a commit 37ea6d7

7 files changed

Lines changed: 218 additions & 12 deletions

BITCODE_SPEC_V44.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,30 @@ operating many technical knowledge trades.
5353

5454
## V44 source-of-truth hierarchy
5555

56-
`BITCODE_SPEC.txt` points to `V43` while V44 is draft.
57-
`BITCODE_SPEC_V43.md` and `BITCODE_SPEC_V43_PROVEN.md` are active canon.
58-
`BITCODE_SPEC_V44.md`, `BITCODE_SPEC_V44_DELTA.md`,
59-
`BITCODE_SPEC_V44_NOTES.md`, and `BITCODE_SPEC_V44_PARITY_MATRIX.md` define
60-
the draft target only on `version/v44` and `v44/gate-*` branches.
56+
`BITCODE_SPEC.txt` points to `V44`; V44 is the active promoted Bitcode canon.
57+
`BITCODE_SPEC_V44.md` and `BITCODE_SPEC_V44_PROVEN.md` are active canon.
58+
`BITCODE_SPEC_V44_DELTA.md`, `BITCODE_SPEC_V44_NOTES.md`, and
59+
`BITCODE_SPEC_V44_PARITY_MATRIX.md` are promoted V44 companion canon. V43 is
60+
the prior canonical anchor only. `BITCODE_SPEC_V45_NOTES.md` is discussion-prep
61+
draft material only until a V45 version branch and first gate explicitly open.
6162
Implementation remains unversioned in source paths; package, route, component,
6263
test, prompt, script, and telemetry names move in place as the single current
6364
Bitcode system.
6465

66+
## V44 promotion addendum: canonical posture repair
67+
68+
V44 promotion discovered and repaired a source-of-truth prose contradiction:
69+
the promoted V44 status and `BITCODE_SPEC.txt` pointer correctly named V44 as
70+
active canon, while the source-of-truth hierarchy still contained pre-promotion
71+
V43-active / V44-draft language. That was a protocol-law contradiction in the
72+
canon-posture layer, even though it did not change BTC settlement, BTD rights,
73+
source withholding, source-to-shares, or repository delivery law.
74+
75+
The repaired enforcement rule is: promoted spec-family validation fails when a
76+
promoted source-of-truth hierarchy says the active pointer targets an older
77+
version, says the promoted version remains a draft, or classifies the promoted
78+
spec family as draft-only branch material. Canon posture is protocol law.
79+
6580
## V44 full-system, re-implementation, and audit rule
6681

6782
V44 work must be reconstructable from specification, source, generated
@@ -797,13 +812,12 @@ Gate 9 validates with `pnpm run generate:v44-scaled-network-rehearsal`,
797812
`pnpm run rehearse:v44-scaled-network -- --lane local --json`,
798813
`pnpm run rehearse:v44-scaled-network -- --lane staging-testnet --json`, and
799814
`pnpm run check:v44-gate9`.
800-
Shared draft posture validates with
801-
`node scripts/check-bitcode-spec-family.mjs --version V44 --mode draft --current-target V43`,
802-
`node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V43 --draft-target V44`,
803-
and `git diff --check`.
804-
805-
Later gates must bind promotion readiness, PROVEN generation, and active V44 /
806-
draft V45 posture after scaled local/staging rehearsal proof is closed.
815+
Promoted V44 posture validates with
816+
`node scripts/check-bitcode-spec-family.mjs --version V44 --mode promoted --current-target V44`,
817+
`node scripts/check-bitcode-canon-posture-drift.mjs --active-canon V44 --draft-target V45`,
818+
and `git diff --check`. Historical V43-active / V44-draft checks are retained
819+
only as pre-promotion evidence in gate artifacts and prior branch history; they
820+
are not active V44 canon after promotion.
807821

808822
## V44 promotion canon
809823

BITCODE_SPEC_V44_DELTA.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ settlements, contributors, compensation statements, and repair states.
3636
- Bind Gate 2 economic contracts in package code before route/API/UI surfaces
3737
consume portfolio, quote, settlement, compensation, governance, or repair
3838
objects.
39+
- Treat promoted source-of-truth hierarchy prose as protocol law: stale
40+
active/draft wording after promotion is a canon-posture defect and must fail
41+
promoted spec-family validation.
3942

4043
## V44 gate plan
4144

BITCODE_SPEC_V44_NOTES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ must remain metadata and proof roots. They must not serialize protected source,
7878
unpaid AssetPack source, raw prompts, raw provider responses, credentials,
7979
wallet private material, or private settlement payloads.
8080

81+
## Promotion addendum note
82+
83+
V44 promotion includes a post-promotion addendum repairing stale
84+
source-of-truth hierarchy prose. `BITCODE_SPEC.txt` now points to `V44`; V44 is
85+
the active canon; V45 notes are discussion-prep material only. Promoted
86+
spec-family validation must fail closed when promoted source-of-truth hierarchy
87+
prose still says an older version is active, the promoted version is draft, or
88+
the promoted spec family is draft-only branch material.
89+
8190
## Gate 1 note
8291

8392
Gate 1 is intentionally a posture gate. It opens the V44 family and validates

BITCODE_SPEC_V44_PARITY_MATRIX.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ artifacts, workflow checks, and local/staging rehearsal receipts.
3939
| Enterprise UX | Dense economic surfaces, proof expansion, responsive/accessibility proof through `.bitcode/v44-enterprise-product-ux.json` | implemented |
4040
| Scaled rehearsal | Many-pack, many-org local/staging-testnet economic rehearsal through `.bitcode/v44-scaled-network-rehearsal.json` | implemented |
4141
| Promotion readiness | Generated PROVEN, workflow, all V44 artifacts bound | closed |
42+
| Promotion addendum | Promoted source-of-truth hierarchy repaired and enforced against stale V43-active / V44-draft prose | closed |
4243

4344
## V44 implementation checklist
4445

@@ -49,6 +50,7 @@ artifacts, workflow checks, and local/staging rehearsal receipts.
4950
| Ledger reconciliation | Portfolio statements reconcile to receipts before finality | implemented |
5051
| Route authority | `/packs`, `/read`, `/deposit` do not bypass protocol law | implemented prerequisite |
5152
| Tests and proofs | Each gate has generated artifacts, package tests, route tests, and workflow checks | implemented prerequisite |
53+
| Canon posture prose | Promoted source-of-truth hierarchy fails closed when it contains stale draft/active wording | implemented |
5254

5355
## Accepted boundaries
5456

BITCODE_SPEC_V45_NOTES.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,69 @@ build/process validation.
4646
- Operational proof: preserve V44 workflow reliability while identifying the
4747
next proof, test, and replay obligations needed for the commercial system.
4848

49+
## V45 opening discussion frame
50+
51+
V45 opens from the premise that specification is the source of protocol truth.
52+
Before a V45 parity matrix or gate plan exists, the first work is a protocol
53+
audit over the promoted V44 canon. The audit should classify each framing as
54+
clearly specified, vaguely specified, incorrectly specified, missing, or already
55+
production-grade:
56+
57+
- Bitcode as the world's knowledge commoditization system.
58+
- AssetPacks as the packaged knowledge commodity entering and leaving the
59+
Depository.
60+
- Depositing as source-safe supply formation and later contributor
61+
compensation.
62+
- Reading as demand formation, Need synthesis, Finding Fits, quote approval,
63+
BTC settlement, BTD rights transfer, and repository delivery.
64+
- `/packs` as the searchable master-detail surface for Bitcode network
65+
activity, proofs, statements, repairs, and economic state.
66+
- BTC as settlement money and source of payment truth.
67+
- BTD as the measured/mined/minted read-right object bound to AssetPack value,
68+
rights transfer, source unlock, and ownership boundaries.
69+
- Proof roots, ledgerized journaling, telemetry, database/storage
70+
synchronization, and generated canon as auditability rails.
71+
- Website routes, ChatGPT App, Bitcode Chat conversation overlays, API/MCP,
72+
public docs, and landing page as coherent interface windows into the same
73+
protocol law.
74+
75+
## V45 known starting observations
76+
77+
- V44 is strong on source-safe economic labels, route law, proof families,
78+
generated artifacts, organization governance, and scaled rehearsal.
79+
- V44 needed this promotion addendum because canon posture text is protocol law:
80+
a promoted spec cannot contain stale active/draft hierarchy prose.
81+
- V44 states the BTD/BTC/source-to-shares roles clearly, but V45 must decide
82+
whether BTD measuring, mining, minting, ownership, and lifecycle state are
83+
specified precisely enough for enterprise and public protocol comprehension.
84+
- V44 names BTC settlement, quote, observed payment, final settlement,
85+
reconciliation, and repair states, but V45 should audit whether the exact
86+
payment/finality/source-unlock/delivery state machine is complete enough.
87+
- V44 identifies interface surfaces beyond the website only as future alignment
88+
targets; V45 should decide how deeply each interface must be specified before
89+
implementation gates.
90+
91+
## V45 questions before a parity matrix
92+
93+
1. What is the smallest complete protocol-law statement for Bitcode as
94+
knowledge commoditization system?
95+
2. What exact state transitions define an AssetPack from potential deposit
96+
option through admitted supply, Finding Fits, paid Need-Fit pack, delivery,
97+
compensation, and repair?
98+
3. What exact state transitions define BTD measuring, mining, minting,
99+
ownership transfer, source unlock, and post-settlement rights?
100+
4. What exact state transitions define BTC quote, payment observation,
101+
confirmation/finality, repair, refund/escalation if any, and contributor
102+
compensation?
103+
5. Which user-visible statements are allowed before settlement, after preview,
104+
after quote, after payment observation, after finality, after rights
105+
transfer, and after repository delivery?
106+
6. Which surfaces are protocol-authoritative in V45: `/packs`, `/read`,
107+
`/deposit`, API/MCP, ChatGPT App, Bitcode Chat, public docs, and landing
108+
page?
109+
7. Which V45 gates should be specification-only, proof-only, interface-only,
110+
implementation, rehearsal, and promotion gates?
111+
49112
## Non-goals during V45 opening
50113

51114
- Do not implement V45 gate behavior before the V45 intent discussion is

packages/protocol/src/canonical/v21-specifying.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,49 @@ function recordFailure(failures, condition, message) {
12551255
if (!condition) failures.push(message);
12561256
}
12571257

1258+
/**
1259+
* @param {string[]} failures
1260+
* @param {string} section
1261+
* @param {string} version
1262+
*/
1263+
function validatePromotedSourceOfTruthHierarchy(failures, section, version) {
1264+
if (versionNumber(version) < 44) return;
1265+
1266+
recordFailure(
1267+
failures,
1268+
section.length > 0,
1269+
`spec promoted-mode validation requires a ${version} source-of-truth hierarchy section.`
1270+
);
1271+
1272+
recordFailure(
1273+
failures,
1274+
section.includes('BITCODE_SPEC.txt') && section.includes(`points to \`${version}\``),
1275+
`spec promoted source-of-truth hierarchy must state BITCODE_SPEC.txt points to ${version}.`
1276+
);
1277+
1278+
recordFailure(
1279+
failures,
1280+
/\bactive\b[\s\S]{0,80}\bcanon\b/i.test(section),
1281+
`spec promoted source-of-truth hierarchy must state ${version} is active canon.`
1282+
);
1283+
1284+
const staleDraftPosturePattern = new RegExp(
1285+
[
1286+
`BITCODE_SPEC\\.txt[\\s\\S]{0,160}points to[\\s\\S]{0,80}\\bV\\d+\\b[\\s\\S]{0,120}while[\\s\\S]{0,80}${version}[\\s\\S]{0,80}draft`,
1287+
`${version}[\\s\\S]{0,80}(?:is|remains)[\\s\\S]{0,80}draft`,
1288+
`${version}[\\s\\S]{0,160}draft target only`,
1289+
`define[\\s\\S]{0,80}the draft target only[\\s\\S]{0,80}${version}`
1290+
].join('|'),
1291+
'i'
1292+
);
1293+
1294+
recordFailure(
1295+
failures,
1296+
!staleDraftPosturePattern.test(section),
1297+
`spec promoted source-of-truth hierarchy still contains stale draft posture for ${version}.`
1298+
);
1299+
}
1300+
12581301
/**
12591302
* @param {{
12601303
* repoRoot?: string,
@@ -1367,6 +1410,14 @@ export function buildV21SpecFamilyReport({
13671410
}
13681411

13691412
const specContent = contents['spec'] || '';
1413+
if (mode === 'promoted') {
1414+
validatePromotedSourceOfTruthHierarchy(
1415+
failures,
1416+
extractSection(specContent, 'source-of-truth hierarchy'),
1417+
version
1418+
);
1419+
}
1420+
13701421
for (const phrase of profile.requiredSpecSections) {
13711422
recordFailure(failures, hasSection(specContent, phrase), `spec is missing required section containing "${phrase}".`);
13721423
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import assert from 'node:assert/strict';
2+
import { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
3+
import { tmpdir } from 'node:os';
4+
import path from 'node:path';
5+
import { fileURLToPath } from 'node:url';
6+
import test from 'node:test';
7+
8+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
9+
const repoRoot = path.resolve(__dirname, '..', '..', '..');
10+
11+
const V44_SPEC_FAMILY_FILES = [
12+
'BITCODE_SPEC.txt',
13+
'BITCODE_SPECIFYING.md',
14+
'BITCODE_SPEC_TEMPLATEGUIDE.md',
15+
'BITCODE_SPEC_V44.md',
16+
'BITCODE_SPEC_V44_DELTA.md',
17+
'BITCODE_SPEC_V44_NOTES.md',
18+
'BITCODE_SPEC_V44_PARITY_MATRIX.md',
19+
];
20+
21+
test('promoted spec-family validation rejects stale draft source-of-truth prose', async () => {
22+
const protocol = await import('../src/index.js');
23+
const tempDir = mkdtempSync(path.join(tmpdir(), 'bitcode-promoted-spec-posture-'));
24+
25+
try {
26+
for (const relativePath of V44_SPEC_FAMILY_FILES) {
27+
copyFileSync(path.join(repoRoot, relativePath), path.join(tempDir, relativePath));
28+
}
29+
30+
const specPath = path.join(tempDir, 'BITCODE_SPEC_V44.md');
31+
const spec = readFileSync(specPath, 'utf8');
32+
const staleSpec = spec.replace(
33+
/## V44 source-of-truth hierarchy[\s\S]*?## V44 promotion addendum: canonical posture repair/u,
34+
[
35+
'## V44 source-of-truth hierarchy',
36+
'',
37+
'`BITCODE_SPEC.txt` points to `V43` while V44 is draft.',
38+
'`BITCODE_SPEC_V43.md` and `BITCODE_SPEC_V43_PROVEN.md` are active canon.',
39+
'`BITCODE_SPEC_V44.md`, `BITCODE_SPEC_V44_DELTA.md`,',
40+
'`BITCODE_SPEC_V44_NOTES.md`, and `BITCODE_SPEC_V44_PARITY_MATRIX.md` define',
41+
'the draft target only on `version/v44` and `v44/gate-*` branches.',
42+
'',
43+
'## V44 promotion addendum: canonical posture repair',
44+
].join('\n')
45+
);
46+
47+
writeFileSync(specPath, staleSpec);
48+
49+
const report = protocol.buildV21SpecFamilyReport({
50+
repoRoot: tempDir,
51+
version: 'V44',
52+
mode: 'promoted',
53+
currentTarget: 'V44',
54+
});
55+
56+
assert.equal(report.passed, false);
57+
assert.ok(
58+
report.failures.some((failure) => failure.includes('promoted source-of-truth hierarchy')),
59+
`expected promoted source-of-truth failure, got: ${report.failures.join('; ')}`
60+
);
61+
} finally {
62+
rmSync(tempDir, { recursive: true, force: true });
63+
}
64+
});

0 commit comments

Comments
 (0)