@rasensio/aidlc 2.27.0 → 2.29.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.
- package/README.md +2 -1
- package/dist/autopilot/driver.d.ts +69 -7
- package/dist/autopilot/driver.d.ts.map +1 -1
- package/dist/autopilot/driver.js +371 -118
- package/dist/autopilot/driver.js.map +1 -1
- package/dist/autopilot/gitlab.d.ts +9 -0
- package/dist/autopilot/gitlab.d.ts.map +1 -1
- package/dist/autopilot/gitlab.js +21 -0
- package/dist/autopilot/gitlab.js.map +1 -1
- package/dist/autopilot/outcome.d.ts +72 -0
- package/dist/autopilot/outcome.d.ts.map +1 -0
- package/dist/autopilot/outcome.js +107 -0
- package/dist/autopilot/outcome.js.map +1 -0
- package/dist/autopilot/result.d.ts.map +1 -1
- package/dist/autopilot/result.js +8 -1
- package/dist/autopilot/result.js.map +1 -1
- package/dist/autopilot/retro.d.ts +7 -3
- package/dist/autopilot/retro.d.ts.map +1 -1
- package/dist/autopilot/retro.js +6 -2
- package/dist/autopilot/retro.js.map +1 -1
- package/dist/autopilot/state.d.ts +16 -1
- package/dist/autopilot/state.d.ts.map +1 -1
- package/dist/autopilot/state.js.map +1 -1
- package/dist/autopilot/team.d.ts +21 -1
- package/dist/autopilot/team.d.ts.map +1 -1
- package/dist/autopilot/team.js +27 -2
- package/dist/autopilot/team.js.map +1 -1
- package/dist/autopilot/typed.d.ts +10 -0
- package/dist/autopilot/typed.d.ts.map +1 -1
- package/dist/autopilot/typed.js +21 -0
- package/dist/autopilot/typed.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -0
- package/dist/cli.js.map +1 -1
- package/dist/closeout/gate-criterion.d.ts +33 -0
- package/dist/closeout/gate-criterion.d.ts.map +1 -0
- package/dist/closeout/gate-criterion.js +61 -0
- package/dist/closeout/gate-criterion.js.map +1 -0
- package/dist/closeout/hand-closeout.d.ts +43 -0
- package/dist/closeout/hand-closeout.d.ts.map +1 -0
- package/dist/closeout/hand-closeout.js +139 -0
- package/dist/closeout/hand-closeout.js.map +1 -0
- package/dist/closeout/outcome.d.ts +38 -0
- package/dist/closeout/outcome.d.ts.map +1 -0
- package/dist/closeout/outcome.js +141 -0
- package/dist/closeout/outcome.js.map +1 -0
- package/dist/commands/autopilot.d.ts +11 -1
- package/dist/commands/autopilot.d.ts.map +1 -1
- package/dist/commands/autopilot.js +97 -4
- package/dist/commands/autopilot.js.map +1 -1
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +51 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +5 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/transition.d.ts.map +1 -1
- package/dist/commands/transition.js +70 -1
- package/dist/commands/transition.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +23 -4
- package/dist/commands/update.js.map +1 -1
- package/dist/compile/register-template.d.ts +12 -9
- package/dist/compile/register-template.d.ts.map +1 -1
- package/dist/compile/register-template.js +14 -31
- package/dist/compile/register-template.js.map +1 -1
- package/dist/compile/resource-template.d.ts +45 -0
- package/dist/compile/resource-template.d.ts.map +1 -0
- package/dist/compile/resource-template.js +53 -0
- package/dist/compile/resource-template.js.map +1 -0
- package/dist/compile/skill-metadata.d.ts +22 -1
- package/dist/compile/skill-metadata.d.ts.map +1 -1
- package/dist/compile/skill-metadata.js +55 -8
- package/dist/compile/skill-metadata.js.map +1 -1
- package/dist/compile/system-template.d.ts +38 -0
- package/dist/compile/system-template.d.ts.map +1 -0
- package/dist/compile/system-template.js +40 -0
- package/dist/compile/system-template.js.map +1 -0
- package/dist/concurrency/common-dir.d.ts +13 -0
- package/dist/concurrency/common-dir.d.ts.map +1 -1
- package/dist/concurrency/common-dir.js +9 -8
- package/dist/concurrency/common-dir.js.map +1 -1
- package/dist/concurrency/gitattributes.d.ts +2 -2
- package/dist/concurrency/gitattributes.d.ts.map +1 -1
- package/dist/concurrency/gitattributes.js +5 -14
- package/dist/concurrency/gitattributes.js.map +1 -1
- package/dist/console/operator/read.d.ts.map +1 -1
- package/dist/console/operator/read.js +2 -1
- package/dist/console/operator/read.js.map +1 -1
- package/dist/core/next-steps.d.ts.map +1 -1
- package/dist/core/next-steps.js +8 -0
- package/dist/core/next-steps.js.map +1 -1
- package/dist/core/project-version.d.ts +52 -0
- package/dist/core/project-version.d.ts.map +1 -0
- package/dist/core/project-version.js +188 -0
- package/dist/core/project-version.js.map +1 -0
- package/dist/core/template-resolver.d.ts.map +1 -1
- package/dist/core/template-resolver.js +90 -8
- package/dist/core/template-resolver.js.map +1 -1
- package/dist/core/types.d.ts +4 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/cost/dedupe-history.d.ts.map +1 -1
- package/dist/cost/dedupe-history.js +3 -2
- package/dist/cost/dedupe-history.js.map +1 -1
- package/dist/cost/gitignore.d.ts +9 -4
- package/dist/cost/gitignore.d.ts.map +1 -1
- package/dist/cost/gitignore.js +16 -5
- package/dist/cost/gitignore.js.map +1 -1
- package/dist/cost/ledger.d.ts +1 -4
- package/dist/cost/ledger.d.ts.map +1 -1
- package/dist/cost/ledger.js +25 -21
- package/dist/cost/ledger.js.map +1 -1
- package/dist/cost/purge.d.ts.map +1 -1
- package/dist/cost/purge.js +3 -2
- package/dist/cost/purge.js.map +1 -1
- package/dist/cost/record-paths.d.ts +42 -0
- package/dist/cost/record-paths.d.ts.map +1 -0
- package/dist/cost/record-paths.js +119 -0
- package/dist/cost/record-paths.js.map +1 -0
- package/dist/cost/rederive.d.ts.map +1 -1
- package/dist/cost/rederive.js +4 -3
- package/dist/cost/rederive.js.map +1 -1
- package/dist/cost/sessions.d.ts +1 -1
- package/dist/cost/sessions.d.ts.map +1 -1
- package/dist/cost/sessions.js +22 -12
- package/dist/cost/sessions.js.map +1 -1
- package/dist/discover/scanner.d.ts +11 -1
- package/dist/discover/scanner.d.ts.map +1 -1
- package/dist/discover/scanner.js +23 -2
- package/dist/discover/scanner.js.map +1 -1
- package/dist/doctor/migrations/cost-gitignore.d.ts.map +1 -1
- package/dist/doctor/migrations/cost-gitignore.js +18 -8
- package/dist/doctor/migrations/cost-gitignore.js.map +1 -1
- package/dist/doctor/migrations/cost-records-out-of-git.d.ts +39 -0
- package/dist/doctor/migrations/cost-records-out-of-git.d.ts.map +1 -0
- package/dist/doctor/migrations/cost-records-out-of-git.js +158 -0
- package/dist/doctor/migrations/cost-records-out-of-git.js.map +1 -0
- package/dist/doctor/migrations/decision-register-location.d.ts +59 -0
- package/dist/doctor/migrations/decision-register-location.d.ts.map +1 -0
- package/dist/doctor/migrations/decision-register-location.js +226 -0
- package/dist/doctor/migrations/decision-register-location.js.map +1 -0
- package/dist/doctor/migrations/deployment-outcome.d.ts +29 -0
- package/dist/doctor/migrations/deployment-outcome.d.ts.map +1 -0
- package/dist/doctor/migrations/deployment-outcome.js +89 -0
- package/dist/doctor/migrations/deployment-outcome.js.map +1 -0
- package/dist/doctor/migrations/index.d.ts.map +1 -1
- package/dist/doctor/migrations/index.js +16 -0
- package/dist/doctor/migrations/index.js.map +1 -1
- package/dist/doctor/migrations/nested-gitignore.d.ts +2 -2
- package/dist/doctor/migrations/nested-gitignore.js +2 -2
- package/dist/doctor/migrations/tracked-nested-ignored.d.ts.map +1 -1
- package/dist/doctor/migrations/tracked-nested-ignored.js +4 -1
- package/dist/doctor/migrations/tracked-nested-ignored.js.map +1 -1
- package/dist/doctor/migrations/untrack-cost-ephemera.d.ts +3 -1
- package/dist/doctor/migrations/untrack-cost-ephemera.d.ts.map +1 -1
- package/dist/doctor/migrations/untrack-cost-ephemera.js +3 -1
- package/dist/doctor/migrations/untrack-cost-ephemera.js.map +1 -1
- package/dist/knowledge/index/sqlite-index.d.ts.map +1 -1
- package/dist/knowledge/index/sqlite-index.js +13 -0
- package/dist/knowledge/index/sqlite-index.js.map +1 -1
- package/dist/knowledge/storable.d.ts +6 -3
- package/dist/knowledge/storable.d.ts.map +1 -1
- package/dist/knowledge/storable.js +10 -6
- package/dist/knowledge/storable.js.map +1 -1
- package/dist/metrics/report.d.ts.map +1 -1
- package/dist/metrics/report.js +2 -1
- package/dist/metrics/report.js.map +1 -1
- package/dist/setup/setup-compute.d.ts +5 -0
- package/dist/setup/setup-compute.d.ts.map +1 -1
- package/dist/setup/setup-compute.js +1 -0
- package/dist/setup/setup-compute.js.map +1 -1
- package/dist/setup/tier-models.d.ts +51 -0
- package/dist/setup/tier-models.d.ts.map +1 -0
- package/dist/setup/tier-models.js +175 -0
- package/dist/setup/tier-models.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move a decision register from the folder it first shipped in to `.aidlc/decisions/`
|
|
3
|
+
* (move-decision-register-into-aidlc/AC-3 … AC-9).
|
|
4
|
+
*
|
|
5
|
+
* The register is the project's own record, so the move is a rename and never a
|
|
6
|
+
* read-then-write: its bytes are not opened. An existing target is never overwritten —
|
|
7
|
+
* with both files present the `report`-tier sibling says so and nothing moves (AC-6).
|
|
8
|
+
* Nothing is staged or committed (AC-8): `git status` shows the whole change, and
|
|
9
|
+
* `git checkout`/`git clean` undoes it.
|
|
10
|
+
*
|
|
11
|
+
* **The old folder is written as segments**, never as one string. AC-1 asks that nothing
|
|
12
|
+
* in `packages/` name it; this module is the one place that must still know it, to move
|
|
13
|
+
* it (design D4).
|
|
14
|
+
*
|
|
15
|
+
* **Two ids.** `both` must be stated on every run and must never apply, which is exactly
|
|
16
|
+
* the `report` tier; folding it into the `safe` move would need a pending result the
|
|
17
|
+
* runner then applies (design D5).
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import { execFileSync } from 'node:child_process';
|
|
22
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmdirSync, writeFileSync } from 'node:fs';
|
|
23
|
+
import { join } from 'node:path';
|
|
24
|
+
import { REGISTER_PATH, REGISTER_SEGMENTS } from '../../compile/register-template.js';
|
|
25
|
+
import { KNOWLEDGE_DIR } from '../../knowledge/types.js';
|
|
26
|
+
import { YamlSourceStore } from '../../knowledge/yaml-source.js';
|
|
27
|
+
/** The folder the register shipped in, as segments (design D4). */
|
|
28
|
+
export const LEGACY_DIR_SEGMENTS = ['docs', 'adr'];
|
|
29
|
+
/** For messages and the `git grep` pattern. */
|
|
30
|
+
export const LEGACY_DIR = LEGACY_DIR_SEGMENTS.join('/');
|
|
31
|
+
export const LEGACY_REGISTER_PATH = `${LEGACY_DIR}/decision-register.md`;
|
|
32
|
+
const README = 'README.md';
|
|
33
|
+
const NEW_DIR_SEGMENTS = REGISTER_SEGMENTS.slice(0, -1);
|
|
34
|
+
const NEW_DIR = NEW_DIR_SEGMENTS.join('/');
|
|
35
|
+
/** Paths under these hold history: listed, never asked to change (AC-5). */
|
|
36
|
+
const HISTORY_PREFIXES = ['.aidlc/state/', '.aidlc/roadmap/done/'];
|
|
37
|
+
export function registerLocation(projectRoot) {
|
|
38
|
+
const legacy = existsSync(join(projectRoot, ...LEGACY_DIR_SEGMENTS, 'decision-register.md'));
|
|
39
|
+
const current = existsSync(join(projectRoot, ...REGISTER_SEGMENTS));
|
|
40
|
+
if (legacy && current)
|
|
41
|
+
return 'both';
|
|
42
|
+
if (legacy)
|
|
43
|
+
return 'legacy';
|
|
44
|
+
return current ? 'current' : 'none';
|
|
45
|
+
}
|
|
46
|
+
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
47
|
+
/**
|
|
48
|
+
* A whole `source:` line naming the old path: indent, the key, the path bare or in one
|
|
49
|
+
* matching pair of quotes, trailing spaces, and a `\r` kept with the line.
|
|
50
|
+
*/
|
|
51
|
+
const SOURCE_LINE = new RegExp(`^(\\s*source:\\s+)(['"]?)${escapeRe(LEGACY_REGISTER_PATH)}\\2(\\s*\\r?)$`);
|
|
52
|
+
/**
|
|
53
|
+
* Rewrite matching `source:` lines; every other byte is returned unchanged (AC-4).
|
|
54
|
+
*
|
|
55
|
+
* Line edits, not a YAML round-trip: re-dumping would reflow long descriptions (design D3).
|
|
56
|
+
* A `description:` naming the path is not a `source:` line, so it is left alone and turns
|
|
57
|
+
* up in the remaining-mentions list instead.
|
|
58
|
+
*/
|
|
59
|
+
export function rewriteSourceLines(text) {
|
|
60
|
+
let count = 0;
|
|
61
|
+
const lines = text.split('\n').map((line) => {
|
|
62
|
+
const m = SOURCE_LINE.exec(line);
|
|
63
|
+
if (!m)
|
|
64
|
+
return line;
|
|
65
|
+
count++;
|
|
66
|
+
return `${m[1]}${m[2]}${REGISTER_PATH}${m[2]}${m[3]}`;
|
|
67
|
+
});
|
|
68
|
+
return { text: lines.join('\n'), count };
|
|
69
|
+
}
|
|
70
|
+
/** Knowledge files holding at least one legacy `source:` line, with their counts. */
|
|
71
|
+
export function legacyPointers(projectRoot) {
|
|
72
|
+
const dir = join(projectRoot, KNOWLEDGE_DIR);
|
|
73
|
+
const found = [];
|
|
74
|
+
for (const file of new YamlSourceStore(dir).listSourceFiles()) {
|
|
75
|
+
let text;
|
|
76
|
+
try {
|
|
77
|
+
text = readFileSync(join(dir, file), 'utf8');
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const { count } = rewriteSourceLines(text);
|
|
83
|
+
if (count > 0)
|
|
84
|
+
found.push({ file: `${KNOWLEDGE_DIR}/${file}`, count });
|
|
85
|
+
}
|
|
86
|
+
return found;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Tracked files still naming the old folder; null outside git (AC-5).
|
|
90
|
+
*
|
|
91
|
+
* Only tracked files are searched. The two moved files are excluded by name, since the
|
|
92
|
+
* index still holds them at the old path until the owner commits. Every listed file is
|
|
93
|
+
* read by git, never written here.
|
|
94
|
+
*/
|
|
95
|
+
export function remainingMentions(projectRoot, gitCommonDir) {
|
|
96
|
+
if (gitCommonDir === null)
|
|
97
|
+
return null;
|
|
98
|
+
let out;
|
|
99
|
+
try {
|
|
100
|
+
out = execFileSync('git', [
|
|
101
|
+
'grep', '-l', '-z', '-F', `${LEGACY_DIR}/`, '--', '.',
|
|
102
|
+
`:(exclude)${LEGACY_REGISTER_PATH}`,
|
|
103
|
+
`:(exclude)${LEGACY_DIR}/${README}`,
|
|
104
|
+
], { cwd: projectRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
// Exit 1 is git grep's "no match"; anything else means the list cannot be trusted.
|
|
108
|
+
if (err.status === 1)
|
|
109
|
+
return { live: [], history: [] };
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
const files = out.split('\0').filter((f) => f.length > 0).sort();
|
|
113
|
+
const isHistory = (f) => HISTORY_PREFIXES.some((p) => f.startsWith(p));
|
|
114
|
+
return { live: files.filter((f) => !isHistory(f)), history: files.filter(isHistory) };
|
|
115
|
+
}
|
|
116
|
+
function pointerPhrase(pointers) {
|
|
117
|
+
const fields = pointers.reduce((n, p) => n + p.count, 0);
|
|
118
|
+
return `point ${fields} knowledge source field(s) in ${pointers.length} file(s) at ${REGISTER_PATH}`;
|
|
119
|
+
}
|
|
120
|
+
function legacyDirWouldEmpty(projectRoot, readmeMoves) {
|
|
121
|
+
const moving = new Set(['decision-register.md', ...(readmeMoves ? [README] : [])]);
|
|
122
|
+
try {
|
|
123
|
+
return readdirSync(join(projectRoot, ...LEGACY_DIR_SEGMENTS)).every((f) => moving.has(f));
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function readmeMoves(projectRoot) {
|
|
130
|
+
return (existsSync(join(projectRoot, ...LEGACY_DIR_SEGMENTS, README)) &&
|
|
131
|
+
!existsSync(join(projectRoot, ...NEW_DIR_SEGMENTS, README)));
|
|
132
|
+
}
|
|
133
|
+
function mentionsBlock(m) {
|
|
134
|
+
if (m === null)
|
|
135
|
+
return `Files still naming ${LEGACY_DIR}/ are not listed: that needs git.`;
|
|
136
|
+
const total = m.live.length + m.history.length;
|
|
137
|
+
if (total === 0)
|
|
138
|
+
return `No other tracked file names ${LEGACY_DIR}/.`;
|
|
139
|
+
const lines = [`${total} tracked file(s) still name ${LEGACY_DIR}/.`];
|
|
140
|
+
if (m.live.length > 0)
|
|
141
|
+
lines.push('Update these:', ...m.live.map((f) => ` ${f}`));
|
|
142
|
+
if (m.history.length > 0)
|
|
143
|
+
lines.push('Left as written (history):', ...m.history.map((f) => ` ${f}`));
|
|
144
|
+
return lines.join('\n');
|
|
145
|
+
}
|
|
146
|
+
export const decisionRegisterLocation = {
|
|
147
|
+
id: 'decision-register-location',
|
|
148
|
+
tier: 'safe',
|
|
149
|
+
check(ctx) {
|
|
150
|
+
const where = registerLocation(ctx.projectRoot);
|
|
151
|
+
// Never `applicable: false`: the runner prints a not-applicable result on every run,
|
|
152
|
+
// and a second run must say nothing about the register (AC-7).
|
|
153
|
+
const clean = { applicable: true, pending: false };
|
|
154
|
+
if (where !== 'legacy' && where !== 'current')
|
|
155
|
+
return clean;
|
|
156
|
+
const pointers = legacyPointers(ctx.projectRoot);
|
|
157
|
+
if (where === 'current') {
|
|
158
|
+
// A hand move, or a run that stopped after the rename: finish the rewrite (design D6).
|
|
159
|
+
if (pointers.length === 0)
|
|
160
|
+
return clean;
|
|
161
|
+
return { applicable: true, pending: true, description: `would ${pointerPhrase(pointers)}` };
|
|
162
|
+
}
|
|
163
|
+
const readme = readmeMoves(ctx.projectRoot);
|
|
164
|
+
let description = `would move ${LEGACY_REGISTER_PATH} to ${REGISTER_PATH}`;
|
|
165
|
+
if (readme)
|
|
166
|
+
description += ` and ${LEGACY_DIR}/${README} to ${NEW_DIR}/${README}`;
|
|
167
|
+
if (legacyDirWouldEmpty(ctx.projectRoot, readme))
|
|
168
|
+
description += `, and remove the empty ${LEGACY_DIR}/`;
|
|
169
|
+
if (pointers.length > 0)
|
|
170
|
+
description += `, then ${pointerPhrase(pointers)}`;
|
|
171
|
+
return { applicable: true, pending: true, description };
|
|
172
|
+
},
|
|
173
|
+
apply(ctx) {
|
|
174
|
+
const root = ctx.projectRoot;
|
|
175
|
+
const where = registerLocation(root);
|
|
176
|
+
if (where !== 'legacy' && where !== 'current') {
|
|
177
|
+
return { changed: false, summary: 'nothing to do' };
|
|
178
|
+
}
|
|
179
|
+
const done = [];
|
|
180
|
+
if (where === 'legacy') {
|
|
181
|
+
const target = join(root, ...REGISTER_SEGMENTS);
|
|
182
|
+
// renameSync replaces an existing target on POSIX; this check is what keeps AC-6 true.
|
|
183
|
+
if (existsSync(target))
|
|
184
|
+
return { changed: false, summary: 'nothing to do' };
|
|
185
|
+
mkdirSync(join(root, ...NEW_DIR_SEGMENTS), { recursive: true });
|
|
186
|
+
renameSync(join(root, ...LEGACY_DIR_SEGMENTS, 'decision-register.md'), target);
|
|
187
|
+
done.push(`moved ${LEGACY_REGISTER_PATH} to ${REGISTER_PATH}`);
|
|
188
|
+
if (readmeMoves(root)) {
|
|
189
|
+
renameSync(join(root, ...LEGACY_DIR_SEGMENTS, README), join(root, ...NEW_DIR_SEGMENTS, README));
|
|
190
|
+
done.push(`moved ${LEGACY_DIR}/${README} to ${NEW_DIR}/${README}`);
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
// rmdirSync refuses a folder that is not empty: the AC-3 guard twice over.
|
|
194
|
+
rmdirSync(join(root, ...LEGACY_DIR_SEGMENTS));
|
|
195
|
+
done.push(`removed the empty ${LEGACY_DIR}/`);
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
// other files live there; the folder stays
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const pointers = legacyPointers(root);
|
|
202
|
+
for (const { file } of pointers) {
|
|
203
|
+
const path = join(root, ...file.split('/'));
|
|
204
|
+
writeFileSync(path, rewriteSourceLines(readFileSync(path, 'utf8')).text, 'utf8');
|
|
205
|
+
}
|
|
206
|
+
if (pointers.length > 0)
|
|
207
|
+
done.push(pointerPhrase(pointers).replace(/^point/, 'pointed'));
|
|
208
|
+
const summary = [done.join('; '), mentionsBlock(remainingMentions(root, ctx.gitCommonDir))].join('\n');
|
|
209
|
+
return { changed: true, summary };
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
export const decisionRegisterTwoCopies = {
|
|
213
|
+
id: 'decision-register-two-copies',
|
|
214
|
+
tier: 'report',
|
|
215
|
+
check(ctx) {
|
|
216
|
+
if (registerLocation(ctx.projectRoot) !== 'both')
|
|
217
|
+
return { applicable: true, pending: false };
|
|
218
|
+
return {
|
|
219
|
+
applicable: true,
|
|
220
|
+
pending: true,
|
|
221
|
+
description: `two decision registers: ${LEGACY_REGISTER_PATH} and ${REGISTER_PATH}. ` +
|
|
222
|
+
'Nothing was moved. Keep the one you want and delete the other.',
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
//# sourceMappingURL=decision-register-location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-register-location.js","sourceRoot":"","sources":["../../../src/doctor/migrations/decision-register-location.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAA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AI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACpC,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAc;IAClD,EAAE,EAAE,8BAA8B;IAClC,IAAI,EAAE,QAAQ;IACd,KAAK,CAAC,GAAG;QACP,IAAI,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,MAAM;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC9F,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EACT,2BAA2B,oBAAoB,QAAQ,aAAa,IAAI;gBACxE,gEAAgE;SACnE,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `deployment-outcome` (report tier): completed instances whose deployment record says nothing
|
|
3
|
+
* about what happened after the merge (closeout-requires-outcome-half/AC-15, AC-16, AC-17).
|
|
4
|
+
*
|
|
5
|
+
* Leaving deployment now needs a written `## Outcome`, but every instance closed before that
|
|
6
|
+
* was "complete" by its artifact status alone. This names them so they can be backfilled. It
|
|
7
|
+
* reads with `readOutcome`, the transition's own reader, so doctor and the transition cannot
|
|
8
|
+
* disagree about what counts as written (design D1).
|
|
9
|
+
*
|
|
10
|
+
* **Why `report`.** The remedy is writing what happened, which doctor cannot know; a confirm
|
|
11
|
+
* tier would turn doctor's exit code red for history (AC-15).
|
|
12
|
+
*
|
|
13
|
+
* **Capped at 20 lines**, as `bare-ac-in-tests` is: this repo has ~180 such records, and a
|
|
14
|
+
* block that scrolls is one nobody reads. The header counts all of them (AC-16).
|
|
15
|
+
*
|
|
16
|
+
* Reads `ctx.projectRoot`: state is committed, so a branch is judged on its own tree.
|
|
17
|
+
*/
|
|
18
|
+
import type { Migration } from '../types.js';
|
|
19
|
+
export declare const MAX_LISTED = 20;
|
|
20
|
+
export interface UnwrittenOutcome {
|
|
21
|
+
instance: string;
|
|
22
|
+
/** Project-relative. */
|
|
23
|
+
record: string;
|
|
24
|
+
why: string;
|
|
25
|
+
}
|
|
26
|
+
/** Every completed instance whose record is missing or unwritten, in sorted instance order. */
|
|
27
|
+
export declare function unwrittenOutcomes(projectRoot: string): UnwrittenOutcome[];
|
|
28
|
+
export declare const deploymentOutcome: Migration;
|
|
29
|
+
//# sourceMappingURL=deployment-outcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-outcome.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/deployment-outcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1D,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAID,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAsCzE;AAED,eAAO,MAAM,iBAAiB,EAAE,SAoB/B,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `deployment-outcome` (report tier): completed instances whose deployment record says nothing
|
|
3
|
+
* about what happened after the merge (closeout-requires-outcome-half/AC-15, AC-16, AC-17).
|
|
4
|
+
*
|
|
5
|
+
* Leaving deployment now needs a written `## Outcome`, but every instance closed before that
|
|
6
|
+
* was "complete" by its artifact status alone. This names them so they can be backfilled. It
|
|
7
|
+
* reads with `readOutcome`, the transition's own reader, so doctor and the transition cannot
|
|
8
|
+
* disagree about what counts as written (design D1).
|
|
9
|
+
*
|
|
10
|
+
* **Why `report`.** The remedy is writing what happened, which doctor cannot know; a confirm
|
|
11
|
+
* tier would turn doctor's exit code red for history (AC-15).
|
|
12
|
+
*
|
|
13
|
+
* **Capped at 20 lines**, as `bare-ac-in-tests` is: this repo has ~180 such records, and a
|
|
14
|
+
* block that scrolls is one nobody reads. The header counts all of them (AC-16).
|
|
15
|
+
*
|
|
16
|
+
* Reads `ctx.projectRoot`: state is committed, so a branch is judged on its own tree.
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
19
|
+
import { join } from 'node:path';
|
|
20
|
+
import { DEPLOYMENT_RECORD, recordPath } from '../../closeout/gate-criterion.js';
|
|
21
|
+
import { readOutcome, unwrittenReason } from '../../closeout/outcome.js';
|
|
22
|
+
export const MAX_LISTED = 20;
|
|
23
|
+
const COMPLETE_RE = /^status:\s*complete\s*$/m;
|
|
24
|
+
/** Every completed instance whose record is missing or unwritten, in sorted instance order. */
|
|
25
|
+
export function unwrittenOutcomes(projectRoot) {
|
|
26
|
+
const stateDir = join(projectRoot, '.aidlc', 'state');
|
|
27
|
+
let names;
|
|
28
|
+
try {
|
|
29
|
+
names = readdirSync(stateDir, { withFileTypes: true })
|
|
30
|
+
.filter((d) => d.isDirectory())
|
|
31
|
+
.map((d) => d.name)
|
|
32
|
+
.sort();
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
const found = [];
|
|
38
|
+
for (const instance of names) {
|
|
39
|
+
const dir = join(stateDir, instance);
|
|
40
|
+
let phase;
|
|
41
|
+
try {
|
|
42
|
+
phase = readFileSync(join(dir, 'phase-deployment.yaml'), 'utf8');
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (!COMPLETE_RE.test(phase))
|
|
48
|
+
continue;
|
|
49
|
+
const record = recordPath(instance);
|
|
50
|
+
const file = join(dir, DEPLOYMENT_RECORD);
|
|
51
|
+
if (!existsSync(file)) {
|
|
52
|
+
found.push({ instance, record, why: `no ${DEPLOYMENT_RECORD}` });
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
let verdict;
|
|
56
|
+
try {
|
|
57
|
+
verdict = readOutcome(readFileSync(file, 'utf8'));
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
found.push({ instance, record, why: `${DEPLOYMENT_RECORD} cannot be read` });
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
// A nothing-deployed record is written, so it is not listed (AC-17).
|
|
64
|
+
if (!verdict.written)
|
|
65
|
+
found.push({ instance, record, why: unwrittenReason(verdict.kind) });
|
|
66
|
+
}
|
|
67
|
+
return found;
|
|
68
|
+
}
|
|
69
|
+
export const deploymentOutcome = {
|
|
70
|
+
id: 'deployment-outcome',
|
|
71
|
+
tier: 'report',
|
|
72
|
+
check(ctx) {
|
|
73
|
+
const found = unwrittenOutcomes(ctx.projectRoot);
|
|
74
|
+
if (found.length === 0)
|
|
75
|
+
return { applicable: true, pending: false };
|
|
76
|
+
const listed = found.slice(0, MAX_LISTED).map((f) => ` ${f.record} — ${f.why}`);
|
|
77
|
+
const more = found.length - listed.length;
|
|
78
|
+
if (more > 0)
|
|
79
|
+
listed.push(` … and ${more} more`);
|
|
80
|
+
return {
|
|
81
|
+
applicable: true,
|
|
82
|
+
pending: true,
|
|
83
|
+
description: `${found.length} completed instance(s) have no written ## Outcome in their deployment record; ` +
|
|
84
|
+
'backfill each with what happened after the merge, or "Nothing deployed — <reason>":\n' +
|
|
85
|
+
listed.join('\n'),
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=deployment-outcome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-outcome.js","sourceRo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AAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QACjF,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC1C,IAAI,IAAI,GAAG,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,CAAC;QAElD,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EACT,GAAG,KAAK,CAAC,MAAM,gFAAgF;gBAC/F,uFAAuF;gBACvF,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;SACpB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA6C7C,eAAO,MAAM,UAAU,EAAE,SAAS,EA2IjC,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { knowledgeGitignore } from './knowledge-gitignore.js';
|
|
|
10
10
|
import { gitattributes } from './gitattributes.js';
|
|
11
11
|
import { shippedActions } from './shipped-actions.js';
|
|
12
12
|
import { untrackCostEphemera } from './untrack-cost-ephemera.js';
|
|
13
|
+
import { costRecordsOutOfGit } from './cost-records-out-of-git.js';
|
|
13
14
|
import { trackedNestedIgnored } from './tracked-nested-ignored.js';
|
|
14
15
|
import { pruneSessionStash } from './prune-session-stash.js';
|
|
15
16
|
import { pruneCostLocks } from './prune-cost-locks.js';
|
|
@@ -35,9 +36,11 @@ import { roadmapMergedDone, roadmapMergedUnrecorded } from './roadmap-merged-ite
|
|
|
35
36
|
import { findingsFilenameMigration } from './findings-filename.js';
|
|
36
37
|
import { roadmapSyncGhMissing } from './roadmap-sync-gh-missing.js';
|
|
37
38
|
import { knowledgeStaleSources } from './knowledge-stale-sources.js';
|
|
39
|
+
import { decisionRegisterLocation, decisionRegisterTwoCopies } from './decision-register-location.js';
|
|
38
40
|
import { artifactSourceDrift } from './artifact-source-drift.js';
|
|
39
41
|
import { contextDocStale } from './context-doc-stale.js';
|
|
40
42
|
import { bareAcInTests } from './bare-ac-in-tests.js';
|
|
43
|
+
import { deploymentOutcome } from './deployment-outcome.js';
|
|
41
44
|
import { complianceLayerUnowned, complianceNoticeMissing, compliancePackMissingLayer, compliancePackProvenance, compliancePackUnregistered, } from './compliance-pack-drift.js';
|
|
42
45
|
export const MIGRATIONS = [
|
|
43
46
|
costGitignore,
|
|
@@ -105,6 +108,10 @@ export const MIGRATIONS = [
|
|
|
105
108
|
// but keeping the roadmap migrations adjacent is how a reader finds them all.
|
|
106
109
|
roadmapSyncGhMissing,
|
|
107
110
|
untrackCostEphemera,
|
|
111
|
+
// Confirm tier, directly after the untrack for the same reason it sits after the ignore
|
|
112
|
+
// migrations: the old record files it untracks fall under cost-gitignore's lines at once
|
|
113
|
+
// (finished-work-tidies-itself/AC-2).
|
|
114
|
+
costRecordsOutOfGit,
|
|
108
115
|
// Report tier, beside the untrack it defers to: it skips every path untrack-cost-ephemera
|
|
109
116
|
// offers to untrack, so the two never name one file twice. It only reads, so the
|
|
110
117
|
// position is reading order, not correctness (nested-gitignores-ignore-themselves/AC-9).
|
|
@@ -144,6 +151,12 @@ export const MIGRATIONS = [
|
|
|
144
151
|
// Report tier: no legitimate remedy exists, so it states the condition and never
|
|
145
152
|
// gates doctor's exit code (compliance-packs/AC-91).
|
|
146
153
|
complianceNoticeMissing,
|
|
154
|
+
// Safe tier, then report tier, directly before knowledge-stale-sources, and it is
|
|
155
|
+
// load-bearing: the move rewrites the graph's `source:` pointers to the register, so the
|
|
156
|
+
// stale-sources check that follows sees the new path resolve instead of reporting every
|
|
157
|
+
// pointer as broken in the same run (move-decision-register-into-aidlc/AC-4).
|
|
158
|
+
decisionRegisterLocation,
|
|
159
|
+
decisionRegisterTwoCopies,
|
|
147
160
|
// Report tier, ordered last: the only migration that reads the whole knowledge graph,
|
|
148
161
|
// so putting the one parse-bound check at the end leaves every cheap repair already
|
|
149
162
|
// reported by the time it runs. It depends on nothing above it — `knowledge-gitignore`
|
|
@@ -162,6 +175,9 @@ export const MIGRATIONS = [
|
|
|
162
175
|
// looking at neither.
|
|
163
176
|
artifactSourceDrift,
|
|
164
177
|
contextDocStale,
|
|
178
|
+
// Report tier, with the other long blocks at the end: it depends on nothing above, so the
|
|
179
|
+
// position is reading order only (closeout-requires-outcome-half/AC-15).
|
|
180
|
+
deploymentOutcome,
|
|
165
181
|
// Report tier, last: it depends on nothing above and can print a long block, so every
|
|
166
182
|
// cheap repair is already reported by the time it runs (doctor-flags-bare-ac-in-tests/AC-3).
|
|
167
183
|
bareAcInTests,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC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;IAC9E,oBAAoB;IACpB,mBAAmB;IACnB,0FAA0F;IAC1F,iFAAiF;IACjF,yFAAyF;IACzF,oBAAoB;IACpB,iBAAiB;IACjB,cAAc;IACd,wBAAwB;IACxB,aAAa;IACb,kBAAkB;IAClB,6EAA6E;IAC7E,6EAA6E;IAC7E,4EAA4E;IAC5E,eAAe;IACf,eAAe;IACf,gFAAgF;IAChF,iEAAiE;IACjE,iBAAiB;IACjB,yEAAyE;IACzE,0EAA0E;IAC1E,eAAe;IACf,sFAAsF;IACtF,sFAAsF;IACtF,qFAAqF;IACrF,uDAAuD;IACvD,EAAE;IACF,iFAAiF;IACjF,qFAAqF;IACrF,wFAAwF;IACxF,gDAAgD;IAChD,wFAAwF;IACxF,mFAAmF;IACnF,iFAAiF;IACjF,wBAAwB;IACxB,0BAA0B;IAC1B,0BAA0B;IAC1B,sBAAsB;IACtB,iFAAiF;IACjF,qDAAqD;IACrD,uBAAuB;IACvB,sFAAsF;IACtF,oFAAoF;IACpF,uFAAuF;IACvF,uFAAuF;IACvF,oEAAoE;IACpE,qBAAqB;IACrB,gFAAgF;IAChF,kFAAkF;IAClF,+EAA+E;IAC/E,6CAA6C;IAC7C,8CAA8C;IAC9C,EAAE;IACF,6EAA6E;IAC7E,6EAA6E;IAC7E,iFAAiF;IACjF,sBAAsB;IACtB,mBAAmB;IACnB,eAAe;IACf,sFAAsF;IACtF,6FAA6F;IAC7F,aAAa;CACd,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,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C7E,iFAAiF;IACjF,sBAAsB;IACtB,mBAAmB;IACnB,eAAe;IACf,0FAA0F;IAC1F,yEAAyE;IACzE,iBAAiB;IACjB,sFAAsF;IACtF,6FAA6F;IAC7F,aAAa;CACd,CAAC"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Ignore rules live in a .gitignore INSIDE the governed directory — the
|
|
5
5
|
* project root .gitignore is never modified. Lines are SELECTIVE, not '*':
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* a governed directory can hold files git should track beside the ones it
|
|
7
|
+
* should not (`.aidlc/state/` holds both). Do not simplify to '*'.
|
|
8
8
|
*
|
|
9
9
|
* The files never list themselves. They are committed so a new worktree gets
|
|
10
10
|
* them from git before any `aidlc` command runs there; older versions wrote a
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Ignore rules live in a .gitignore INSIDE the governed directory — the
|
|
5
5
|
* project root .gitignore is never modified. Lines are SELECTIVE, not '*':
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* a governed directory can hold files git should track beside the ones it
|
|
7
|
+
* should not (`.aidlc/state/` holds both). Do not simplify to '*'.
|
|
8
8
|
*
|
|
9
9
|
* The files never list themselves. They are committed so a new worktree gets
|
|
10
10
|
* them from git before any `aidlc` command runs there; older versions wrote a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracked-nested-ignored.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/tracked-nested-ignored.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tracked-nested-ignored.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/tracked-nested-ignored.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAY7C;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAOxE;AAOD,eAAO,MAAM,oBAAoB,EAAE,SA2BlC,CAAC"}
|
|
@@ -17,6 +17,7 @@ import { trackedFiles } from '../git.js';
|
|
|
17
17
|
import { COST_IGNORE_LINES } from '../../cost/gitignore.js';
|
|
18
18
|
import { KNOWLEDGE_IGNORE_LINES } from '../../knowledge/gitignore.js';
|
|
19
19
|
import { EPHEMERA_PATHSPECS } from './untrack-cost-ephemera.js';
|
|
20
|
+
import { legacyRecordFiles } from './cost-records-out-of-git.js';
|
|
20
21
|
const GOVERNED = [
|
|
21
22
|
{ dir: '.aidlc/knowledge', lines: KNOWLEDGE_IGNORE_LINES },
|
|
22
23
|
{ dir: '.aidlc/cost', lines: COST_IGNORE_LINES },
|
|
@@ -48,8 +49,10 @@ export const trackedNestedIgnored = {
|
|
|
48
49
|
return { applicable: false, reason: 'requires a git repository' };
|
|
49
50
|
}
|
|
50
51
|
const tracked = trackedFiles(ctx.projectRoot, GOVERNED.map((g) => g.dir));
|
|
52
|
+
// The tracked unattributed ledger is cost-records-out-of-git's to move.
|
|
53
|
+
const moving = new Set(legacyRecordFiles(ctx.projectRoot));
|
|
51
54
|
const matched = tracked.filter((path) => {
|
|
52
|
-
if (ownedByUntrack(path))
|
|
55
|
+
if (ownedByUntrack(path) || moving.has(path))
|
|
53
56
|
return false;
|
|
54
57
|
const governed = GOVERNED.find((g) => path.startsWith(`${g.dir}/`));
|
|
55
58
|
if (!governed)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracked-nested-ignored.js","sourceRoot":"","sources":["../../../src/doctor/migrations/tracked-nested-ignored.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yB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I,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACtE,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,qGAAqG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SACxJ,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* The printed command is exactly what apply() executes (NFR). Pathspecs
|
|
8
8
|
* include the mistaken `.aidlc/costs/` plural path seen in the wild.
|
|
9
|
-
*
|
|
9
|
+
* The ledgers and session logs are not ephemera: cost-records-out-of-git
|
|
10
|
+
* moves them to the git common directory before untracking them, so they
|
|
11
|
+
* are never listed here (finished-work-tidies-itself/AC-10).
|
|
10
12
|
*/
|
|
11
13
|
import type { Migration } from '../types.js';
|
|
12
14
|
export declare const EPHEMERA_PATHSPECS: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"untrack-cost-ephemera.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/untrack-cost-ephemera.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"untrack-cost-ephemera.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/untrack-cost-ephemera.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,kBAAkB,UAK9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,SAuCjC,CAAC"}
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* The printed command is exactly what apply() executes (NFR). Pathspecs
|
|
8
8
|
* include the mistaken `.aidlc/costs/` plural path seen in the wild.
|
|
9
|
-
*
|
|
9
|
+
* The ledgers and session logs are not ephemera: cost-records-out-of-git
|
|
10
|
+
* moves them to the git common directory before untracking them, so they
|
|
11
|
+
* are never listed here (finished-work-tidies-itself/AC-10).
|
|
10
12
|
*/
|
|
11
13
|
import { execFileSync } from 'node:child_process';
|
|
12
14
|
import { trackedFiles, hasStagedChanges, shellQuote } from '../git.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"untrack-cost-ephemera.js","sourceRoot":"","sources":["../../../src/doctor/migrations/untrack-cost-ephemera.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"untrack-cost-ephemera.js","sourceRoot":"","sources":["../../../src/doctor/migrations/untrack-cost-ephemera.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,6BAA6B;IAC7B,yBAAyB;IACzB,mBAAmB;IACnB,cAAc;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAc;IAC5C,EAAE,EAAE,uBAAuB;IAC3B,IAAI,EAAE,SAAS;IACf,KAAK,CAAC,GAAG;QACP,IAAI,GAAG,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YAC9B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;QACpE,CAAC;QACD,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACpE,MAAM,QAAQ,GAAG,CAAC,sBAAsB,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC3E,IAAI,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACtC,OAAO;gBACL,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,iBAAiB,KAAK,CAAC,MAAM,kCAAkC;gBAC5E,QAAQ;gBACR,OAAO,EACL,mHAAmH;aACtH,CAAC;QACJ,CAAC;QACD,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,iBAAiB,KAAK,CAAC,MAAM,uDAAuD;YACjG,QAAQ;SACT,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAChE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;QAC9E,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,EAAE;YACjE,GAAG,EAAE,GAAG,CAAC,WAAW;YACpB,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC;SACpC,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,aAAa,KAAK,CAAC,MAAM,uEAAuE;SAC1G,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-index.d.ts","sourceRoot":"","sources":["../../../src/knowledge/index/sqlite-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"sqlite-index.d.ts","sourceRoot":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iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,EAAE;IAO7C,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,EAAE;IAO3C,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE;IAY/C,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAW9C,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,WAAW,GAAE,MAAM,GAAG,IAAW,GAAG,IAAI;IAiCnG,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAcrC,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAI/C,OAAO,CAAC,gBAAgB;IAMxB,KAAK,IAAI,IAAI;IAQb,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,SAAS;CAOlB;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKxD"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import { DatabaseSync } from 'node:sqlite';
|
|
15
15
|
import { join } from 'node:path';
|
|
16
16
|
import { mkdirSync } from 'node:fs';
|
|
17
|
+
import { unstorableEntityReason, unstorableRelationshipReason } from '../storable.js';
|
|
17
18
|
import { AGENT_INFERRED_SOURCE } from '../types.js';
|
|
18
19
|
import { IndexOutdatedError } from './knowledge-index.js';
|
|
19
20
|
/** Filename of the index database inside the knowledge directory. */
|
|
@@ -147,6 +148,13 @@ export class SqliteIndex {
|
|
|
147
148
|
return row ? rowToEntity(row) : undefined;
|
|
148
149
|
}
|
|
149
150
|
upsertEntity(entity) {
|
|
151
|
+
// Checked here, not left to `node:sqlite`: Node 22 throws on a boolean or an
|
|
152
|
+
// `undefined`, Node 26 binds them as 1 and NULL. Throwing before `.run` writes no
|
|
153
|
+
// row, and inside `rebuild` reaches its ROLLBACK
|
|
154
|
+
// (full-suite-green-on-every-supported-node/AC-2, design D1).
|
|
155
|
+
const reason = unstorableEntityReason(entity);
|
|
156
|
+
if (reason !== null)
|
|
157
|
+
throw new Error(`cannot index entity '${entity.id}': ${reason}`);
|
|
150
158
|
this.db
|
|
151
159
|
.prepare(`INSERT OR REPLACE INTO entities
|
|
152
160
|
(id, type, name, description, confidence, source, author, tags, last_verified, metadata, source_file)
|
|
@@ -259,6 +267,11 @@ export class SqliteIndex {
|
|
|
259
267
|
// Relationships
|
|
260
268
|
// -------------------------------------------------------------------------
|
|
261
269
|
upsertRelationship(rel) {
|
|
270
|
+
// As in upsertEntity: refuse before binding (full-suite-green-on-every-supported-node/AC-3).
|
|
271
|
+
const reason = unstorableRelationshipReason(rel);
|
|
272
|
+
if (reason !== null) {
|
|
273
|
+
throw new Error(`cannot index relationship '${rel.from}' -> '${rel.to}': ${reason}`);
|
|
274
|
+
}
|
|
262
275
|
this.db
|
|
263
276
|
.prepare(`INSERT OR REPLACE INTO relationships
|
|
264
277
|
(from_entity, to_entity, type, metadata, last_verified)
|