@sabaiway/agent-workflow-kit 14.39.0 → 14.41.0

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,6 +1,6 @@
1
1
  // source-size-core.mjs — the PURE READ core of the source-size practice (D-18): the ONE import point
2
- // for every surface that must ask about the practice without reaching a writer. It owns no logic and
3
- // no write API, and spawns only a read-only git query, so the read-graph purity suite
2
+ // for every surface that must ask about the practice without reaching a writer. It owns no logic but
3
+ // the layout setup's one bound form, no write API, and spawns only a read-only git query, so the read-graph purity suite
4
4
  // (test/read-graph-purity.test.mjs) stays true however the halves behind it move.
5
5
  //
6
6
  // The halves, each holding ONE rule set and each within the cap this practice declares:
@@ -9,13 +9,21 @@
9
9
  // • source-size-scope.mjs — which files are judged (D-6) and how big each one is (D-7)
10
10
  // • source-size-gate-cmd.mjs — whether a declared gate cmd IS this checker (the canonical matcher),
11
11
  // and which of the three tool claims it makes when it is not
12
+ // • source-size/index.mjs — the door of the size check's module: the kit's limits and their
13
+ // lines, the band and the layout count, the recorded ratchet as data
14
+ // and the layout setup
12
15
  //
13
- // Re-export only: a consumer imports the practice, never a particular half, so a later split moves
14
- // code without touching a single call site.
16
+ // Re-export only, but for readLayoutSetup: a consumer imports the practice, never a particular half, so
17
+ // a later split moves code without touching a single call site.
18
+
19
+ import { INITIAL_ADOPTION_REASON, SOURCE_SIZE_SCHEMA, loadSourceSizeConfig, validateSourceSizeConfig } from './source-size-config.mjs';
20
+ import { judgeTree, stopsOf } from './source-size-judge.mjs';
21
+ import { layoutSetupOf } from './source-size/index.mjs';
15
22
 
16
23
  export {
17
24
  SOURCE_SIZE_CONFIG_REL,
18
25
  SOURCE_SIZE_STOP,
26
+ SOURCE_SIZE_WARNING_PREFIX,
19
27
  SOURCE_SIZE_WHY,
20
28
  configFail,
21
29
  configPathFor,
@@ -28,10 +36,12 @@ export {
28
36
  export {
29
37
  AUTHORED_KEYS,
30
38
  INITIAL_ADOPTION_REASON,
39
+ LAYOUT_KEY,
31
40
  MACHINE_KEYS,
32
41
  REASON_MAX_BYTES,
33
42
  SOURCE_SIZE_DEFAULTS,
34
43
  SOURCE_SIZE_SCHEMA,
44
+ assertNoStoreRoot,
35
45
  loadSourceSizeConfig,
36
46
  practiceFacts,
37
47
  reasonDefect,
@@ -46,6 +56,31 @@ export {
46
56
  resolveScope,
47
57
  } from './source-size-scope.mjs';
48
58
 
59
+ export {
60
+ KIT_LIMITS,
61
+ SCHEMA1_REASON,
62
+ SPEC_STORE_ROOT,
63
+ applyOverride,
64
+ bandOf,
65
+ changesFor,
66
+ isRaise,
67
+ layoutCounts,
68
+ layoutDefect,
69
+ limitLines,
70
+ limitsDefect,
71
+ materialize,
72
+ migrateSchema1,
73
+ ownEntry,
74
+ planRecord,
75
+ projectLayout,
76
+ resolveLimits,
77
+ serialize,
78
+ walkSpecStore,
79
+ SETUP_ANSWERS,
80
+ checkTargetOf,
81
+ layoutSetupOf,
82
+ } from './source-size/index.mjs';
83
+
49
84
  export {
50
85
  SOURCE_SIZE_GATE_ID,
51
86
  SOURCE_SIZE_TOOL_PATH,
@@ -57,3 +92,14 @@ export {
57
92
  // The claim vocabulary itself — a consumer naming an outcome imports the name, never a string
58
93
  // literal it could misspell into a silently-never-true comparison.
59
94
  export { CHECKER_CLAIM } from './checker-claim.mjs';
95
+
96
+ // readLayoutSetup(root, deps) → the layout setup's answer for a project, the one bound form the advisor
97
+ // and the git-hooks leaf ask: the loader, the tree judge and its stop filter, the absent config the
98
+ // check judges (schema 2 under the kit's values) and the reason the record's first entries take.
99
+ export const readLayoutSetup = (root, deps = {}) => layoutSetupOf(root, {
100
+ loadSourceSizeConfig,
101
+ judgeTree,
102
+ stopsOf,
103
+ absentConfig: validateSourceSizeConfig({ schema: SOURCE_SIZE_SCHEMA }),
104
+ reason: INITIAL_ADOPTION_REASON,
105
+ }, deps);
@@ -1,114 +1,180 @@
1
1
  // source-size-judge.mjs — the verdict as FACTS, never as words, and the ONE projection everything
2
- // else reads. Measures every in-scope file once, projects the record the regenerator WOULD write for
3
- // it, and states each difference against what is recorded today. The rendering half turns those
4
- // differences into words; the writer half turns the very same projection into the file — so the
5
- // checker can never demand something the regenerator would not do, nor pass a tree the regenerator
6
- // would rewrite.
2
+ // else reads: every in-scope file and judged directory measured once, the record the regenerator
3
+ // WOULD write projected, and each difference against today's record stated — so the checker can
4
+ // never demand what the regenerator would not do, nor, on a present config, pass a tree whose regeneration would raise.
7
5
  //
8
- // The ratchet, stated once (D-3, D-4): a recorded size is DEBT, not permission. It may not grow
9
- // (that is a raise, and a raise is reasoned); it may not sit ABOVE what the tree measures (a stale
10
- // record is headroom nobody earned); it may not outlive the violation it records (a file back under
11
- // the cap keeps no record); and a record whose file is gone is an error, because that is what makes
12
- // a split or a rename visible instead of silent. The per-root budget rides the same rules over the
13
- // summed LINES of the root — splitting one file into six buys no headroom at all.
6
+ // The ratchet (D-3, D-4): a recorded size is DEBT, not permission. Each limit is judged with its
7
+ // band; a finding STOPS exactly when the regeneration would RAISE (beyond the band with no record, a
8
+ // record that grew, an unrecorded root) and WARNS otherwise (within the band, a record above the
9
+ // tree, no longer needed or gone). Each root's summed LINES ride the same ratchet with no band.
14
10
  //
15
11
  // Dependency-free, Node >= 22. No writes, no side effects on import.
16
12
 
17
- import { measureFile, resolveScope } from './source-size-scope.mjs';
13
+ import { measureFile, resolveScope, specStoreEntries } from './source-size-scope.mjs';
14
+ import { scopeFail } from './source-size-refusal.mjs';
15
+ import { SPEC_STORE_ROOT, bandOf, changesFor, isRaise, layoutCounts, ownEntry, projectLayout } from './source-size/index.mjs';
18
16
 
19
17
  export const DIMENSIONS = Object.freeze(['lines', 'maxLineBytes']);
18
+ const LAYOUT_DIMENSIONS = Object.freeze(['entries', 'depth']);
19
+ export const STOP = 'stop';
20
+ export const WARNING = 'warning';
20
21
 
21
- // The measured dimension names ARE the baseline-entry keys; `defaults` spells the line cap
22
- // differently, so the two vocabularies are bridged in exactly one place.
23
- export const DEFAULT_KEY = Object.freeze({ lines: 'maxLines', maxLineBytes: 'maxLineBytes' });
22
+ // The kit limit each measured dimension is judged against.
23
+ const LIMIT_OF = Object.freeze({ lines: 'lines-per-file', maxLineBytes: 'bytes-per-line', entries: 'entries-per-directory', depth: 'depth' });
24
+ const ceilingOf = ({ value, tolerance }) => value + bandOf(value, tolerance);
25
+ const withinBand = (value, limit) => value > limit.value && value <= ceilingOf(limit);
24
26
 
25
- // THE projection: a record exists for a dimension exactly while that dimension violates the declared
26
- // default. An entry pinning a dimension that was never over the cap would make the ratchet refuse
27
- // later changes nobody chose, so the entry appears with the violation and disappears with it.
28
- export const recordFor = (measured, defaults) => Object.fromEntries(
29
- DIMENSIONS.filter((dimension) => measured[dimension] > defaults[DEFAULT_KEY[dimension]])
27
+ // THE projection: a record exists for a dimension exactly while that dimension is beyond its band. A
28
+ // value within the band warns and carries no record, so a record of one is obsolete.
29
+ export const recordFor = (measured, limits) => Object.fromEntries(
30
+ DIMENSIONS.filter((dimension) => measured[dimension] > ceilingOf(limits[LIMIT_OF[dimension]]))
30
31
  .map((dimension) => [dimension, measured[dimension]]),
31
32
  );
32
33
 
33
- // A change is a RAISE when it puts a number where there was none, or a bigger one where there was a
34
- // smaller — the whole class a human's reason is required for. Everything else lowers or removes.
35
- export const isRaise = ({ from, to }) => to !== null && (from === null || to > from);
36
-
37
- // A recorded entry is read by OWN key only. A declared root may legitimately be named like an
38
- // Object.prototype member ("constructor", "toString"), and a plain lookup would then answer with an
39
- // INHERITED value — which reads as "already recorded", so the raise goes unnoticed and the entry is
40
- // written with no reason at all, producing a config this tool's own validator refuses.
41
- export const ownEntry = (map, key) => (Object.hasOwn(map, key) ? map[key] : undefined);
42
-
43
- // changesFor(target, projected, recorded) → the per-dimension old→new pairs that actually differ.
44
- // The refusal, the printed delta and the reason an entry ends up with all read THIS.
45
- export const changesFor = (target, projected, recorded) => DIMENSIONS
46
- .map((dimension) => ({
47
- target,
48
- dimension,
49
- from: recorded && Object.hasOwn(recorded, dimension) ? recorded[dimension] : null,
50
- to: Object.hasOwn(projected, dimension) ? projected[dimension] : null,
51
- }))
52
- .filter(({ from, to }) => from !== to);
53
-
54
- const GROWTH_KINDS = new Set(['over-default', 'grew', 'aggregate-grew', 'aggregate-unrecorded']);
55
-
34
+ const BAND_KINDS = new Set(['within-band', 'root-band', 'dir-band']);
56
35
  // D-9: the unmechanizable question — real decomposition, or the same coupling spread thinner? — is
57
36
  // asked exactly where a record went DOWN or disappeared, and the checker itself raises it there.
58
- const LOWERED_KINDS = new Set(['stale', 'record-obsolete', 'entry-gone']);
37
+ const LOWERED_KINDS = new Set(['stale', 'record-obsolete', 'entry-gone', 'root-stale', 'root-gone', 'dir-stale', 'dir-obsolete', 'dir-gone']);
59
38
 
60
- export const hasGrowth = (findings) => findings.some((f) => GROWTH_KINDS.has(f.kind));
39
+ export const stopsOf = (findings) => findings.filter((f) => f.severity === STOP);
40
+ export const warningsOf = (findings) => findings.filter((f) => f.severity === WARNING);
41
+ export const bandWarningsOf = (findings) => findings.filter((f) => BAND_KINDS.has(f.kind));
42
+ // The warnings a write leaves standing: a value within its band, one whose obsolete record it drops included.
43
+ const BAND_OF_OBSOLETE = Object.freeze({ 'record-obsolete': 'within-band', 'dir-obsolete': 'dir-band' });
44
+ export const standingWarningsOf = (findings) => findings.flatMap((f) => {
45
+ if (BAND_KINDS.has(f.kind)) return [f];
46
+ const kind = BAND_OF_OBSOLETE[f.kind];
47
+ return kind && f.dimension !== 'depth' && f.actual > f.allowed && f.actual <= f.ceiling ? [{ ...f, kind }] : [];
48
+ });
61
49
  export const hasLoweredRecord = (findings) => findings.some((f) => LOWERED_KINDS.has(f.kind));
62
50
 
63
- const findingOfChange = (rel, { dimension, from, to }, measured, defaults) => {
64
- const allowed = defaults[DEFAULT_KEY[dimension]];
65
- if (from === null) return { kind: 'over-default', rel, dimension, actual: to, allowed };
66
- // `to === null` — the file is back under the cap, so the projection records nothing. The measured
67
- // value is what the reader needs to see; the record is simply obsolete.
68
- if (to === null) return { kind: 'record-obsolete', rel, dimension, actual: measured[dimension], allowed, recorded: from };
69
- return to > from
70
- ? { kind: 'grew', rel, dimension, actual: to, recorded: from }
71
- : { kind: 'stale', rel, dimension, actual: to, recorded: from };
51
+ // One rule for every recorded number: a raise stops, any other change warns. `kinds` names no record
52
+ // yet, grew, lowered and no longer needed in the target's own vocabulary.
53
+ const changeFinding = (target, { dimension, from, to }, actual, limits, kinds) => ({
54
+ kind: kinds[from === null ? 0 : to === null ? 3 : to > from ? 1 : 2], severity: isRaise({ from, to }) ? STOP : WARNING, ...target, dimension,
55
+ actual, allowed: limits[LIMIT_OF[dimension]].value, ceiling: ceilingOf(limits[LIMIT_OF[dimension]]), ...(from === null ? {} : { recorded: from }),
56
+ });
57
+ const bandFinding = (kind, target, dimension, actual, limit) => ({ kind, severity: WARNING, ...target, dimension, actual, allowed: limit.value, ceiling: ceilingOf(limit) });
58
+
59
+ const FILE_KINDS = ['over-default', 'grew', 'stale', 'record-obsolete'];
60
+ const DIR_KINDS = ['dir-over', 'dir-grew', 'dir-stale', 'dir-obsolete'];
61
+
62
+ const fileFindings = (rel, measured, projected, recorded, limits) => {
63
+ const changes = changesFor(rel, projected, recorded);
64
+ return [
65
+ ...changes.map((change) => changeFinding({ rel }, change, measured[change.dimension], limits, FILE_KINDS)),
66
+ ...DIMENSIONS.filter((d) => withinBand(measured[d], limits[LIMIT_OF[d]]) && !changes.some((c) => c.dimension === d))
67
+ .map((d) => bandFinding('within-band', { rel }, d, measured[d], limits[LIMIT_OF[d]])),
68
+ ];
72
69
  };
73
70
 
74
71
  const judgeAggregate = (rootLines, aggregate) => {
75
72
  const findings = [];
76
73
  for (const [root, actual] of rootLines) {
77
- if (!Object.hasOwn(aggregate, root)) {
78
- findings.push({ kind: 'aggregate-unrecorded', root, actual });
79
- continue;
80
- }
81
- const value = aggregate[root].lines;
82
- if (actual > value) findings.push({ kind: 'aggregate-grew', root, actual, recorded: value });
83
- else if (actual < value) findings.push({ kind: 'aggregate-stale', root, actual, recorded: value });
74
+ const recorded = ownEntry(aggregate, root)?.lines;
75
+ if (recorded === undefined) findings.push({ kind: 'aggregate-unrecorded', severity: STOP, root, actual });
76
+ else if (actual > recorded) findings.push({ kind: 'aggregate-grew', severity: STOP, root, actual, recorded });
77
+ else if (actual < recorded) findings.push({ kind: 'aggregate-stale', severity: WARNING, root, actual, recorded });
84
78
  }
85
- // The recorded set must MIRROR the declared roots: a budget nobody declares any more is a leftover
86
- // that hides its own root's disappearance, and deleting an entry must never be a way to disarm it.
79
+ // The recorded set must MIRROR the declared roots: a budget nobody declares any more warns until
80
+ // the writer drops it, and deleting an entry must never be a way to disarm it.
87
81
  for (const root of Object.keys(aggregate)) {
88
- if (!rootLines.has(root)) findings.push({ kind: 'aggregate-root-gone', root, recorded: aggregate[root].lines });
82
+ if (!rootLines.has(root)) findings.push({ kind: 'aggregate-root-gone', severity: WARNING, root, recorded: aggregate[root].lines });
89
83
  }
90
84
  return findings;
91
85
  };
92
86
 
93
- // judgeTree(cwd, config) → { scope, measured, projected, rootLines, findings }. EVERY in-scope file
94
- // is measured, recorded or not: the fail-closed scope rule has no baseline exception, so an
95
- // unreadable or non-UTF-8 file refuses even when its size is recorded debt.
96
- export const judgeTree = (cwd, config, deps = {}) => {
87
+ // A directory is keyed by its repo-relative path, a root's own by its declared name. A name that is
88
+ // not lossless UTF-8 is counted, and refused only once a record would have to carry it.
89
+ const measureLayout = (cwd, config, scope, deps) => {
90
+ const counted = config.roots.map((root) => [root, scope.layout.get(root)]);
91
+ const store = specStoreEntries(cwd, deps);
92
+ if (store !== null) counted.push([SPEC_STORE_ROOT, store]);
93
+ const roots = new Map();
94
+ const directories = new Map();
95
+ const undecodable = [];
96
+ for (const [root, entries] of counted) {
97
+ const counts = layoutCounts(entries);
98
+ roots.set(root, counts.files);
99
+ const base = Buffer.from(root, 'utf8').toString('latin1');
100
+ for (const [below, facts] of counts.directories) {
101
+ const bytes = Buffer.from(below === '' ? base : root === '.' ? below : `${base}/${below}`, 'latin1');
102
+ const key = bytes.toString('utf8');
103
+ if (Buffer.from(key, 'utf8').equals(bytes)) directories.set(key, facts);
104
+ else undecodable.push({ bytes, facts });
105
+ }
106
+ }
107
+ return { roots, directories, undecodable };
108
+ };
109
+
110
+ // The absent config records nothing, so the roots' files a first write would record are no findings.
111
+ const rootFindings = (measured, projected, recorded, tolerance) => {
112
+ const findings = [];
113
+ for (const [root, actual] of measured.roots) {
114
+ const was = ownEntry(recorded.roots, root)?.files ?? null;
115
+ const ceiling = was === null ? undefined : was + bandOf(was, tolerance);
116
+ if (was === null) findings.push({ kind: 'root-unrecorded', severity: STOP, root, actual });
117
+ else if (projected.roots[root] > was) findings.push({ kind: 'root-grew', severity: STOP, root, actual, recorded: was, ceiling });
118
+ else if (projected.roots[root] < was) findings.push({ kind: 'root-stale', severity: WARNING, root, actual, recorded: was });
119
+ else if (actual > was) findings.push({ kind: 'root-band', severity: WARNING, root, actual, recorded: was, ceiling });
120
+ }
121
+ for (const [root, was] of Object.entries(recorded.roots)) {
122
+ if (!measured.roots.has(root)) findings.push({ kind: 'root-gone', severity: WARNING, root, recorded: was.files });
123
+ }
124
+ return findings;
125
+ };
126
+
127
+ // A recorded dimension is judged as a file's; within its band warns, depth one level past the value.
128
+ const directoryFindings = (directories, projected, recorded, limits) => {
129
+ const findings = [];
130
+ for (const dir of Object.keys(recorded).filter((key) => !directories.has(key))) {
131
+ findings.push({ kind: 'dir-gone', severity: WARNING, dir, recorded: recorded[dir] });
132
+ }
133
+ for (const [dir, facts] of directories) {
134
+ const was = ownEntry(recorded, dir);
135
+ const changes = changesFor(dir, projected[dir] ?? {}, was, LAYOUT_DIMENSIONS);
136
+ const actual = { entries: facts.entries, depth: facts.reach };
137
+ findings.push(...changes.map((change) => changeFinding({ dir }, change, actual[change.dimension], limits, DIR_KINDS)));
138
+ const entries = limits['entries-per-directory'];
139
+ if (withinBand(facts.entries, entries) && !(was && Object.hasOwn(was, 'entries'))) findings.push(bandFinding('dir-band', { dir }, 'entries', facts.entries, entries));
140
+ if (facts.depth === limits.depth.value + 1 && withinBand(facts.reach, limits.depth)) findings.push(bandFinding('dir-band', { dir }, 'depth', facts.reach, limits.depth));
141
+ }
142
+ return findings;
143
+ };
144
+
145
+ const judgeLayout = (cwd, config, scope, deps, { absent }) => {
146
+ const measured = measureLayout(cwd, config, scope, deps);
147
+ const { limits } = config;
148
+ const unkeyable = measured.undecodable.find(({ facts }) => facts.entries > ceilingOf(limits['entries-per-directory']) || facts.depth === ceilingOf(limits.depth) + 1);
149
+ if (unkeyable) throw scopeFail(`a judged directory's NAME is not valid UTF-8 (bytes ${unkeyable.bytes.toString('hex')}) and it is beyond its band — its record could not be keyed losslessly, so nothing is judged; rename it`);
150
+ const recorded = config.layout ?? { roots: {}, directories: {} };
151
+ const projected = projectLayout(measured, config.layout, limits);
152
+ const lossy = new Map(measured.undecodable.map(({ bytes, facts }) => [bytes.toString('utf8'), facts]));
153
+ const findings = [
154
+ ...(absent ? [] : rootFindings(measured, projected, recorded, limits['files-per-root'].tolerance)),
155
+ ...directoryFindings(measured.directories, projected.directories, recorded.directories, limits),
156
+ ...directoryFindings(lossy, {}, {}, limits),
157
+ ];
158
+ return { measured, projected, findings };
159
+ };
160
+
161
+ // judgeTree(cwd, config, deps, { layout, absent }) → { scope, measured, projected, rootLines, layout,
162
+ // findings }. EVERY in-scope file is measured, recorded or not: an unreadable or non-UTF-8 file
163
+ // refuses even when its size is recorded debt. An absent config's aggregate is no finding.
164
+ export const judgeTree = (cwd, config, deps = {}, { layout = false, absent = false } = {}) => {
97
165
  const scope = resolveScope(cwd, config, deps);
98
166
  const measured = new Map(scope.files.map((rel) => [rel, measureFile(cwd, rel, deps)]));
99
- const projected = new Map(scope.files.map((rel) => [rel, recordFor(measured.get(rel), config.defaults)]));
167
+ const projected = new Map(scope.files.map((rel) => [rel, recordFor(measured.get(rel), config.limits)]));
100
168
  const baseline = config.baseline ?? {};
101
- const findings = [];
102
- for (const rel of scope.files) {
103
- findings.push(...changesFor(rel, projected.get(rel), ownEntry(baseline, rel))
104
- .map((change) => findingOfChange(rel, change, measured.get(rel), config.defaults)));
105
- }
169
+ const findings = scope.files.flatMap((rel) => fileFindings(rel, measured.get(rel), projected.get(rel), ownEntry(baseline, rel), config.limits));
106
170
  for (const rel of Object.keys(baseline)) {
107
- if (!measured.has(rel)) findings.push({ kind: 'entry-gone', rel, recorded: baseline[rel] });
171
+ if (!measured.has(rel)) findings.push({ kind: 'entry-gone', severity: WARNING, rel, recorded: baseline[rel] });
108
172
  }
109
173
  const rootLines = new Map(
110
174
  [...scope.perRoot].map(([root, files]) => [root, files.reduce((sum, rel) => sum + measured.get(rel).lines, 0)]),
111
175
  );
112
- findings.push(...judgeAggregate(rootLines, config.aggregate ?? {}));
113
- return { scope, measured, projected, rootLines, findings };
176
+ if (!absent) findings.push(...judgeAggregate(rootLines, config.aggregate ?? {}));
177
+ const judged = layout ? judgeLayout(cwd, config, scope, deps, { absent }) : null;
178
+ if (judged) findings.push(...judged.findings);
179
+ return { scope, measured, projected, rootLines, layout: judged, findings };
114
180
  };
@@ -3,9 +3,10 @@
3
3
  // as one raised by the config reader:
4
4
  // • exit 2 — the INPUTS are unusable (usage, a malformed config, a failed enumeration); the
5
5
  // practice could not judge anything, and no step it could name would change that.
6
- // • exit 1 — the practice REFUSED: a violation, a stale record, an unverifiable in-scope source
7
- // file, or a declared state the reader must move on (an absent or unminted config). Every one of
8
- // these carries a step the reader can perform.
6
+ // • exit 1 — the practice REFUSED: a stop (beyond a band with no record, a record that grew, an
7
+ // unrecorded root), an unverifiable in-scope source file, or a declared state the reader must move
8
+ // on (an unminted config, a schema-1 one at --check, an absent one under --adopt and --override).
9
+ // Every one of these carries a step the reader can perform.
9
10
  // • every refusal names the config of the project it ACTUALLY judged, absolute: under a foreign or
10
11
  // relative --cwd a repo-relative name points at whatever directory the reader happens to be in.
11
12
  // • the WHY rides the RENDERED refusals only — the ones the report composes (absent / unminted /
@@ -27,6 +28,10 @@ export const SOURCE_SIZE_CONFIG_REL = 'docs/ai/source-size.json';
27
28
  // states the practice's FACTS instead — caps, recorded count, aggregate — and never this sentence.
28
29
  export const SOURCE_SIZE_WHY = 'A module you can hold whole is the unit of review, test pairing and safe edit; the caps turn size drift into recorded, reasoned debt instead of invisible growth.';
29
30
 
31
+ // Every warning the check prints is one line under this anchored prefix, so the gate runner can echo
32
+ // a green check's warnings and nothing else of its output.
33
+ export const SOURCE_SIZE_WARNING_PREFIX = 'source-size: WARNING — ';
34
+
30
35
  export const configPathFor = (cwd) => resolve(cwd, 'docs', 'ai', 'source-size.json');
31
36
 
32
37
  export const SOURCE_SIZE_STOP = 'SOURCE_SIZE_STOP';