halfcycle 0.3.31 → 0.3.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../src/build-record/assemble.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,KAAK,EACX,MAAM,YAAY,CAAC;AAMpB;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,KAAK,CAOrF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,GAAG,OAAO,CAOlG;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAErE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,GAAG,aAAa,CAqB9E"}
@@ -1,124 +0,0 @@
1
- /**
2
- * The phase-close record — the commit a phase actually closed at, written down
3
- * at the close.
4
- *
5
- * WHY IT EXISTS. A Build Record says which commit its phase closed at. That
6
- * value used to be resolved when the record was ASSEMBLED, by asking git for the
7
- * working tree's CURRENT HEAD — so closing on Monday and assembling on Friday
8
- * produced a record naming Friday's commit while claiming to describe Monday's
9
- * close, and nothing in the system could tell the difference. The close now
10
- * writes the pair down and the assembler re-derives neither.
11
- *
12
- * ONE HOME FOR THE NAME, WHICH IS THE WHOLE RISK. The writer below and the
13
- * reader in `sources.ts` (`readPhaseClose`) both build the filename by calling
14
- * `closeRecordPath` here, which builds it by calling `renderPhaseSegment` — the
15
- * one renderer every other phase-scoped filename in this package goes through.
16
- * The two ends cannot disagree about the name because there is only one
17
- * expression of it; no caller concatenates a prefix of its own.
18
- *
19
- * THE IDENTITY IS ASSERTED BEFORE THE JOIN, and that is not a second copy of the
20
- * rule (INV-023). The DECISION is `isValidPhaseIdentity`, which has one home in
21
- * `@halfcycle/events`; what this site adds is the location the refusal owes its
22
- * reader, which the renderer's own refusal cannot name because it writes nothing
23
- * and has no opinion about where its caller's file lives. `close-phase` reaches
24
- * neither `validateNarrated` nor `writeBuildRecord`, so without this assertion
25
- * the close path would compose a client-repo filename from an unvalidated value.
26
- *
27
- * WHERE IT LANDS, AND WHY THAT PLACEMENT COSTS NOTHING. `.workbench` is the
28
- * declared Zone-B root (`install.ts`, `ZONE_B_DIR`); it is gitignored and the
29
- * egress gate excludes it. So the close record declares no client-tree artefact
30
- * kind, needs no allowlisted path, and cannot be delivered anywhere. It sits
31
- * beside the operator-authored assembler input, as its OWN file so that
32
- * machine-written and hand-written content stay apart.
33
- *
34
- * THE COMMIT AND THE DATE MOVE TOGETHER, on both paths. The writer records both
35
- * or writes nothing; the reader accepts both or refuses the file. A record
36
- * carrying one without the other would be a close half-described, and the
37
- * absence wording in the rendered record would have to speak for a pair it only
38
- * half covers.
39
- *
40
- * INV-001: `packages/bundle` is shippable and its import allowlist is exactly
41
- * {packages/core, packages/events}. This module imports `@halfcycle/events`,
42
- * Node builtins and its own package; the git call is `node:child_process`, as
43
- * the assembler's own git read always did.
44
- */
45
- import { type PhaseIdentity } from '@halfcycle/events';
46
- /** The close record's format string — a single literal, one home. */
47
- export declare const CLOSE_RECORD_FORMAT: "halfcycle-phase-close/v1";
48
- /**
49
- * The Zone-B directory the close record shares with the assembler's own input
50
- * file, relative to the repository root. One home, so the CLI's reader, the
51
- * close-side writer and the assembler-side reader all name one directory.
52
- */
53
- export declare const BUILD_RECORD_ZONE_B_DIR: string;
54
- /**
55
- * What a close wrote down about the repository, as it sits on disk.
56
- *
57
- * The file is local and machine-written. Nothing reconciles it against the
58
- * repository afterwards: if it is hand-edited, every later reader believes it,
59
- * exactly as for the assembler's other local inputs.
60
- */
61
- export interface PhaseCloseRecord {
62
- /** Which version of this file's layout was written. */
63
- format: typeof CLOSE_RECORD_FORMAT;
64
- /** The phase that closed, as it was named. */
65
- phase: PhaseIdentity;
66
- /** The commit the repository was on when the phase closed. */
67
- closeCommit: string;
68
- /** The date of that commit, as YYYY-MM-DD. */
69
- closedDate: string;
70
- }
71
- /** What writing the close record did, so the caller can say it plainly. */
72
- export type CloseRecordOutcome = {
73
- /** The close was written down on this machine. */
74
- recorded: true;
75
- /** The file it was written to. */
76
- path: string;
77
- /** The commit the repository was on. */
78
- closeCommit: string;
79
- /** The date of that commit. */
80
- closedDate: string;
81
- } | {
82
- /** Nothing was written down about this close. */
83
- recorded: false;
84
- /** The file that would have been written, or null when even that could not be named. */
85
- path: string | null;
86
- /** Why nothing was written, in words that can be printed as-is. */
87
- reason: string;
88
- };
89
- /**
90
- * Thrown when a close record is on disk but is not one this reader can trust.
91
- *
92
- * Deliberately NOT the assembler's missing-source error: the file is present, and
93
- * calling a present-but-broken input "missing" is the mislabelling that sends a
94
- * reader looking for something that is right there.
95
- */
96
- export declare class InvalidCloseRecordError extends Error {
97
- constructor(path: string, detail: string);
98
- }
99
- /**
100
- * The file a phase's close is recorded in.
101
- *
102
- * Refuses an identity that cannot safely name a file BEFORE composing the path,
103
- * naming the only directory a close record is ever written into.
104
- */
105
- export declare function closeRecordPath(repoRoot: string, phase: PhaseIdentity): string;
106
- /**
107
- * Write down the commit a phase closed at.
108
- *
109
- * Never throws. Every way this can fail — an identity that cannot name a file, a
110
- * repository whose HEAD cannot be read, a directory that cannot be written — is
111
- * returned as a `recorded: false` outcome carrying a printable reason, because
112
- * the phase has already closed by the time this runs and a raise here would
113
- * report a successful close as a failure.
114
- */
115
- export declare function writeCloseRecord(repoRoot: string, phase: PhaseIdentity): CloseRecordOutcome;
116
- /**
117
- * Validate a parsed close record and return it, or throw naming what is wrong.
118
- *
119
- * Lives here rather than in the reader so the file's SHAPE has one home: the
120
- * writer above builds it and this checks it, and neither restates the other's
121
- * keys. The pair check is the read-side half of "both move together".
122
- */
123
- export declare function parseCloseRecord(path: string, parsed: unknown): PhaseCloseRecord;
124
- //# sourceMappingURL=close-record.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"close-record.d.ts","sourceRoot":"","sources":["../../src/build-record/close-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAKH,OAAO,EAAgD,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGrG,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,EAAG,0BAAmC,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAAmC,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,8CAA8C;IAC9C,KAAK,EAAE,aAAa,CAAC;IACrB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,2EAA2E;AAC3E,MAAM,MAAM,kBAAkB,GAC1B;IACE,kDAAkD;IAClD,QAAQ,EAAE,IAAI,CAAC;IACf,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB,GACD;IACE,iDAAiD;IACjD,QAAQ,EAAE,KAAK,CAAC;IAChB,wFAAwF;IACxF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN;;;;;;GAMG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAIzC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAG9E;AAmCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,kBAAkB,CAgC3F;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,gBAAgB,CAiChF"}
@@ -1,111 +0,0 @@
1
- /**
2
- * Source loading + fail-loud validation for the Build-Record assembler.
3
- *
4
- * INV-001 (local by construction): every source is a LOCAL file. The guard-eval
5
- * log is a phase-scoped JSONL file the runner wrote locally (E2-T-03b) and the
6
- * close commit/date come from the phase's own close record — never a hosted
7
- * store call, and since `phase-close-commit` never a live git call either. This
8
- * module imports only @halfcycle/events (for the wire schema), Node builtins and
9
- * its own package.
10
- *
11
- * INV-007: the guard-eval log is parsed through `guardEvalRunSchema` from
12
- * @halfcycle/events, so only the FiredGuard-safe fields survive. A line
13
- * carrying an undeclared field rejects on parse (`.strict()`), so the asset
14
- * cannot enter the record even via a malformed log line.
15
- *
16
- * Fail-loud (AC2): a missing required source throws `MissingSourceError` naming
17
- * the input. Nothing is blanked or invented.
18
- */
19
- import { type GuardEvalRun, type PhaseIdentity } from '@halfcycle/events';
20
- import type { BuildRecordSources, NarratedSource, OrchestrationStateSource, PhaseCloseSource } from './types.js';
21
- import { type SeedGuard } from './types.js';
22
- /** Thrown when a required source artefact is missing — fail loud, never blank. */
23
- export declare class MissingSourceError extends Error {
24
- constructor(sourceName: string, detail: string);
25
- }
26
- /**
27
- * Read the runner's LOCAL phase-scoped guard-eval log and project it to the
28
- * record's active-guard catalogue (`seedGuards`).
29
- *
30
- * The log is JSONL — one `GuardEvalRun` per line (E2-T-03b format). Every line
31
- * is validated through `guardEvalRunSchema`, so the guard rows are FiredGuard
32
- * (INV-007-safe) by construction. The catalogue is the deduped set of
33
- * `(patternRef, severity)` across every fired guard in the phase, sorted by
34
- * patternRef — deterministic (INV-009). `explanation` is dropped for the
35
- * catalogue (a catalogue entry is not a specific firing).
36
- *
37
- * A missing/empty log is NOT silently blanked — the caller decides whether an
38
- * empty guard set is legal for the phase (a phase with matchers should have
39
- * fired at least once). This function reports what it found; `readGuardEvalLog`
40
- * fails loud when the file is absent.
41
- */
42
- export declare function projectSeedGuards(runs: GuardEvalRun[]): SeedGuard[];
43
- /**
44
- * Read + parse the phase-scoped guard-eval log file, whose name comes from
45
- * `renderPhaseSegment` — the same renderer the writer uses, so the reader cannot
46
- * drift from it by inspection. The identity is a name or a number; an unsafe one
47
- * is refused by the renderer before any path is joined.
48
- *
49
- * Every line is legacy-normalised (see `normalizeLegacyLine`) then validated
50
- * through the strict `guardEvalRunSchema` — a mixed-era log (pre-amendment lines
51
- * with no `runId`/`outcome`, plus new-era `evaluated`/failure/`unconfigured`
52
- * lines) assembles cleanly, while an undeclared field still rejects. Fails loud
53
- * when the log file is absent (a required source per the field→source map).
54
- */
55
- export declare function readGuardEvalLog(logDir: string, phaseId: PhaseIdentity): GuardEvalRun[];
56
- /**
57
- * Load the orchestration-state task map; fail loud if the file is absent.
58
- * The filename is produced by `renderPhaseSegment`, so this reader and the
59
- * Build-Record writer name a phase the same way by construction.
60
- */
61
- export declare function readOrchestrationState(phasesDir: string, phaseId: PhaseIdentity): OrchestrationStateSource;
62
- /**
63
- * Read what the phase's close recorded about the repository.
64
- *
65
- * THIS REPLACED A GIT CALL, and the replacement is the feature. The assembler
66
- * used to run `git rev-parse --short HEAD` here, at ASSEMBLY time, so the commit
67
- * and date a record named were a function of when someone happened to assemble
68
- * it — close on Monday, assemble on Friday, and the record described Friday
69
- * while claiming to describe the close. Nothing re-derives either value now.
70
- *
71
- * The filename comes from `closeRecordPath` — the same function the close-side
72
- * writer calls, which builds it through the same renderer every other
73
- * phase-scoped filename here goes through. Writer and reader cannot drift.
74
- *
75
- * AN ABSENT FILE IS ABSENCE, not a failure, and it is the one required-source
76
- * reader here that does not fail loud. Closing a phase has never needed git, so
77
- * a close that recorded nothing is legitimate — as is a close made before this
78
- * file existed, whose commit is simply unrecoverable. Both read as `null` and
79
- * the record says so. A PRESENT file that cannot be trusted still fails loud,
80
- * because that is a broken input rather than an absent one.
81
- */
82
- export declare function readPhaseClose(repoRoot: string, phaseId: PhaseIdentity): PhaseCloseSource;
83
- /**
84
- * Validate that a caller-supplied narrated bundle has every required field.
85
- * The narrated fields are lifted from prose artefacts (phase doc, acceptance
86
- * report, COE notes, ENGAGEMENT ledger) by the loader; this guard makes the
87
- * "missing source fails loud" contract hold for them too.
88
- *
89
- * It also refuses an unsafe `phase.id` (INV-023). That field is not merely data:
90
- * it is copied into the assembled record and interpolated into the record's own
91
- * output filename, so it is the one narrated field that decides where the record
92
- * is written. It is validated here because this is where every route converges.
93
- */
94
- export declare function validateNarrated(narrated: NarratedSource): NarratedSource;
95
- /**
96
- * Assemble the complete `BuildRecordSources` bundle from a phase's local
97
- * artefacts. This is the local-by-construction (INV-001) loader: it reads the
98
- * orchestration state, the runner's local guard-eval log, the phase's own close
99
- * record, and the caller-lifted narrated + touched-invariants inputs. Every
100
- * required source is present or it throws — with one deliberate exception named
101
- * at `readPhaseClose`, whose absence is a legitimate answer rather than a gap.
102
- */
103
- export declare function loadSources(opts: {
104
- repoRoot: string;
105
- phasesDir: string;
106
- guardEvalLogDir: string;
107
- phaseId: PhaseIdentity;
108
- narrated: NarratedSource;
109
- touchedInvariants: string[];
110
- }): BuildRecordSources;
111
- //# sourceMappingURL=sources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/build-record/sources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAI9D,kFAAkF;AAClF,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI/C;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,CAwBnE;AAwED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,YAAY,EAAE,CAoBvF;AAMD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,GACrB,wBAAwB,CAsB1B;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,gBAAgB,CAyBzF;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CA2BzE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,cAAc,CAAC;IACzB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,GAAG,kBAAkB,CAerB"}
@@ -1,29 +0,0 @@
1
- /**
2
- * The v1 Build-Record markdown renderer.
3
- *
4
- * The FIXED PROSE (headings, the format note, section captions) is the
5
- * vault-canonical v1 template — method content, not authored per-record. Every
6
- * DATA SLOT is projected from the assembled JSON record, so the `.md` and the
7
- * `.json` cannot disagree on data (AC1): there is no independent data source for
8
- * the markdown. This function is a pure `BuildRecordV1 -> string`.
9
- *
10
- * INV-007: it renders only record fields — the record already excludes the
11
- * asset, so the markdown cannot leak it.
12
- *
13
- * EVERY STRING BELOW IS WRITTEN INTO THE CLIENT'S OWN REPOSITORY and read by
14
- * them as prose, so none of it may carry Halfcycle-internal vocabulary: no
15
- * invariant id, no `packages/*` path, no issue number, no org name. An invariant
16
- * id is not openable by a client — it points into a register they do not have —
17
- * so in the record it reads as an unexplained code beside a claim about their
18
- * own build. The rule the id names goes into the prose in client-safe words and
19
- * the id itself stays here, in this docblock, where the mechanism belongs.
20
- * `packages/bundle/test/published-entry-vocabulary.test.ts` scans the published
21
- * entry for exactly these tokens, and `build-record.test.ts` checks the EMITTED
22
- * markdown rather than this source.
23
- */
24
- import type { BuildRecordV1 } from './types.js';
25
- /**
26
- * Render the v1 markdown companion. Fixed prose + projected data slots only.
27
- */
28
- export declare function renderBuildRecordMarkdown(record: BuildRecordV1): string;
29
- //# sourceMappingURL=template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/build-record/template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,YAAY,CAAC;AAsD3D;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAiFvE"}
@@ -1,200 +0,0 @@
1
- /**
2
- * Build-Record v1 types — the shape the assembler emits and the typed source
3
- * bundle it projects from.
4
- *
5
- * INV-001: this module imports ONLY from @halfcycle/events (the INV-007-safe
6
- * FiredGuard / GuardEvalRun shapes) — no hosted package, no guard-engine, no
7
- * GuardRecord. The guard input can therefore not carry the asset even in
8
- * principle: the wire types physically lack matcher/channel/version/scope/
9
- * addedFrom/generalisedFrom.
10
- *
11
- * INV-007: `SeedGuard` is a strict subset of FiredGuard (`patternRef` +
12
- * `severity`, optional per-firing `explanation`). It is the ONLY guard-derived
13
- * shape in the record. There is no path from a `GuardRecord` to this file.
14
- */
15
- import type { FiredGuard, GuardEvalRun, PhaseIdentity } from '@halfcycle/events';
16
- /** The v1 format string — a single literal, one home. */
17
- export declare const BUILD_RECORD_FORMAT: "halfcycle-build-record/v1";
18
- /**
19
- * The one and only guard-derived shape in a Build Record (INV-007-safe).
20
- *
21
- * `patternRef` + `severity` are the active-guard catalogue projection; a
22
- * specific firing may additionally carry a plain-language `explanation`. This
23
- * type is a strict *subset* of the wire `FiredGuard` — it drops `guardId`
24
- * (not a record field) and cannot express `matcher`/`channel`/`version`/
25
- * `scope`/`addedFrom`/`generalisedFrom` because those do not exist on
26
- * `FiredGuard` either. The subset relationship is asserted at compile time by
27
- * `projectSeedGuard` below.
28
- */
29
- export interface SeedGuard {
30
- patternRef: string;
31
- severity: FiredGuard['severity'];
32
- explanation?: string;
33
- }
34
- /**
35
- * Project a wire FiredGuard down to the record's INV-007-safe SeedGuard.
36
- *
37
- * This is the ONLY constructor of a SeedGuard from guard data. It reads exactly
38
- * three fields; the wire type has no others of interest and physically cannot
39
- * carry the asset. `includeExplanation` distinguishes a specific firing (keep
40
- * the plain-language `explanation`) from the active-guard catalogue projection
41
- * (drop it — a catalogue entry is not a firing).
42
- */
43
- export declare function projectSeedGuard(fired: Pick<FiredGuard, 'patternRef' | 'severity' | 'explanation'>, includeExplanation: boolean): SeedGuard;
44
- /** `delivered` block — what the phase shipped (from orchestration state + phase doc). */
45
- export interface Delivered {
46
- packages: string[];
47
- services: string[];
48
- tools: string[];
49
- deployment: Record<string, unknown>;
50
- dogfood: string;
51
- }
52
- /** A Done-when result slot. */
53
- export interface DoneWhenResult {
54
- result: string;
55
- detail: string;
56
- }
57
- /** The acceptance-walk projection (walker ≠ builder, INV-009). */
58
- export interface Acceptance {
59
- walker: string;
60
- verdict: string;
61
- findings: number;
62
- doneWhen: Record<string, DoneWhenResult>;
63
- inv002ProdBypassProbe?: DoneWhenResult;
64
- }
65
- export interface GatesEarnedKeep {
66
- defectsCaughtPreHuman: number;
67
- named: string[];
68
- bugsReachingHumanWalk: number;
69
- }
70
- export interface Instruments {
71
- marginalCostSelfAccounting: string;
72
- coeAddRate: {
73
- seamNew: number;
74
- seamRepeat: number;
75
- modelLimitation: number;
76
- notes: string;
77
- };
78
- }
79
- export interface Tasks {
80
- planned: number;
81
- landed: number;
82
- cancelled: string[];
83
- }
84
- /**
85
- * The v1 Build Record — the JSON companion. Field order matters for the seed.
86
- *
87
- * `phase.id` is a `PhaseIdentity` — a name OR a number — because a phase is
88
- * identified by whatever the client called it, and three of this repo's own
89
- * phases are numbered while twenty-four are named. The widening is deliberately
90
- * NOT a narrowing to `string`: `docs/build-records/phase-0.json` carries the
91
- * JSON number `0`, the assembler copies the identity through untransformed, and
92
- * `packages/bundle/test/build-record-phase0.test.ts` deep-equals the two. Under
93
- * the union that conformance seed passes with no fixture edit; under `string`
94
- * alone it would have needed a re-conform and a second operator approval.
95
- *
96
- * `closeCommit` and `closedDate` ADMIT ABSENCE, which is the v1 shape moving
97
- * rather than a field being added. Both were required strings, on the premise
98
- * that a record could always be given them because they were derived from git at
99
- * assembly time. They are now captured at the close, and a client with no git
100
- * closes successfully — so the pair has a legitimate "not recorded" state, and a
101
- * required string could only have been satisfied by inventing one or by
102
- * refusing to assemble the record at all. The conformance seed carries strings
103
- * in both and is unaffected: widening a field admits the value it already held.
104
- */
105
- export interface BuildRecordV1 {
106
- format: typeof BUILD_RECORD_FORMAT;
107
- engagement: string;
108
- engagementType: string;
109
- phase: {
110
- id: PhaseIdentity;
111
- name: string;
112
- };
113
- status: string;
114
- /** The date the phase closed, or null when the close recorded none. */
115
- closedDate: string | null;
116
- /** The commit the phase closed at, or null when the close recorded none. */
117
- closeCommit: string | null;
118
- thesis: string;
119
- thesisHeld: boolean;
120
- delivered: Delivered;
121
- seedGuards: SeedGuard[];
122
- acceptance: Acceptance;
123
- gatesEarnedKeep: GatesEarnedKeep;
124
- instruments: Instruments;
125
- invariantsExercised: string[];
126
- deviations: string[];
127
- tasks: Tasks;
128
- }
129
- /**
130
- * Orchestration-state projection: task terminal states + engagement identity.
131
- * Loaded from the phase-scoped orchestration-state file, whose name is produced
132
- * by `renderPhaseSegment` and never spelled out here (Zone-B process artefact).
133
- * Terminal states: `merged`/`done` → landed; `cancelled` → cancelled.
134
- */
135
- export interface OrchestrationStateSource {
136
- tasks: Record<string, {
137
- status: string;
138
- }>;
139
- }
140
- /** Narrated-artefact source — the fields lifted verbatim from prose artefacts.
141
- *
142
- * These are NOT re-derived by the assembler; they are lifted from the phase
143
- * doc (thesis, phase name), the acceptance-walk report (verdict/findings/
144
- * done-when results), the COE pass notes (gates/instruments) and the ENGAGEMENT
145
- * ledger (status/close row/deviations). The assembler's job is projection +
146
- * derivation, not prose parsing; the loader layer supplies these already-lifted
147
- * so the invariant-bearing core stays testable and prose-format-agnostic.
148
- */
149
- export interface NarratedSource {
150
- engagement: string;
151
- engagementType: string;
152
- phase: {
153
- id: PhaseIdentity;
154
- name: string;
155
- };
156
- status: string;
157
- thesis: string;
158
- delivered: Delivered;
159
- acceptance: Acceptance;
160
- gatesEarnedKeep: GatesEarnedKeep;
161
- instruments: Instruments;
162
- deviations: string[];
163
- }
164
- /**
165
- * What the phase's close recorded about the repository.
166
- *
167
- * NOT resolved at assembly time, which is the change this type carries. Both
168
- * values are captured when the phase closes and read back from the local close
169
- * record (`close-record.ts`), so assembling the same phase twice returns the
170
- * same document however much work has happened since.
171
- *
172
- * `null` on both is a close that recorded neither — a client with no git, no
173
- * repository or no commit yet closes successfully and this reads as absence
174
- * rather than as a blank or a value derived later. The pair moves together on
175
- * both paths, so one is never null while the other is a string.
176
- */
177
- export interface PhaseCloseSource {
178
- /** The commit the repository was on when the phase closed, or null if none was recorded. */
179
- closeCommit: string | null;
180
- /** The date of that commit, or null if none was recorded. */
181
- closedDate: string | null;
182
- }
183
- /**
184
- * The complete typed source bundle. Every required source is present or the
185
- * assembler fails loudly (see `assembleBuildRecord`). The guard-eval log is
186
- * supplied as already-read `GuardEvalRun` records (INV-007-safe by type).
187
- */
188
- export interface BuildRecordSources {
189
- orchestration: OrchestrationStateSource;
190
- narrated: NarratedSource;
191
- close: PhaseCloseSource;
192
- /** The runner's LOCAL guard-eval log for the phase (INV-007-safe wire records). */
193
- guardEvalRuns: GuardEvalRun[];
194
- /**
195
- * The delivered feature specs' `Touches` invariant IDs, per spec — the raw
196
- * union input for `invariantsExercised` (deduped + sorted by the assembler).
197
- */
198
- touchedInvariants: string[];
199
- }
200
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/build-record/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEjF,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,EAAG,2BAAoC,CAAC;AAExE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,UAAU,GAAG,aAAa,CAAC,EAClE,kBAAkB,EAAE,OAAO,GAC1B,SAAS,CAOX;AAED,yFAAyF;AACzF,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,+BAA+B;AAC/B,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;C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