@rasensio/aidlc 1.57.0 → 1.58.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/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAcH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAwCtC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAM,GAAG,SAA2B,GAC1C,OAAO,CAQT"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAcH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiCpC;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAyCtC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAM,GAAG,SAA2B,GAC1C,OAAO,CAQT"}
package/dist/cli.js CHANGED
@@ -30,6 +30,7 @@ import { registerTemplates } from './commands/templates.js';
30
30
  import { registerTransition } from './commands/transition.js';
31
31
  import { registerAmend } from './commands/amend.js';
32
32
  import { registerCrossCheck } from './commands/cross-check.js';
33
+ import { registerRevert } from './commands/revert.js';
33
34
  import { registerDiscover } from './commands/discover.js';
34
35
  import { registerAddAction } from './commands/add-action.js';
35
36
  import { registerDocs } from './commands/docs.js';
@@ -73,6 +74,7 @@ export function buildProgram() {
73
74
  registerTransition(program);
74
75
  registerAmend(program);
75
76
  registerCrossCheck(program);
77
+ registerRevert(program);
76
78
  registerDiscover(program);
77
79
  registerAddAction(program);
78
80
  registerDocs(program);
package/dist/cli.js.map CHANGED
@@ -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0E;QAC1E,qEAAqE;QACrE,MAAM,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC;AACH,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `aidlc revert <instance> --task T<n> | --phase implementation` — undo a
3
+ * task's commits by task id instead of by hunting for hashes.
4
+ *
5
+ * The roadmap item's one hard rule is "show the plan and ask first", so the
6
+ * command is a funnel of refusals, then a printed plan, then a question. Every
7
+ * refusal happens before git is asked to write anything, and the only write
8
+ * path is `revert/apply.ts`, which leaves the branch as it found it on any
9
+ * failure.
10
+ *
11
+ * Requirements: revert-by-task/AC-4, AC-5, AC-7, AC-8, AC-9, AC-10, AC-12,
12
+ * AC-13, AC-14, AC-17, AC-18, AC-19, AC-20, AC-21, AC-22
13
+ */
14
+ import type { Command } from 'commander';
15
+ import { type Prompter } from '../core/prompt.js';
16
+ export interface RevertOpts {
17
+ task?: string;
18
+ phase?: string;
19
+ dryRun?: boolean;
20
+ yes?: boolean;
21
+ override?: boolean;
22
+ }
23
+ export interface RevertDeps {
24
+ prompter?: Prompter;
25
+ projectRoot?: string;
26
+ out?: (line: string) => void;
27
+ err?: (line: string) => void;
28
+ }
29
+ /**
30
+ * Run the command. Returns the exit code rather than setting it, so tests read
31
+ * it directly; the commander action copies it to `process.exitCode`.
32
+ */
33
+ export declare function runRevert(instance: string, opts: RevertOpts, deps?: RevertDeps): Promise<number>;
34
+ export declare function registerRevert(program: Command): void;
35
+ //# sourceMappingURL=revert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revert.d.ts","sourceRoot":"","sources":["../../src/commands/revert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAanE,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAWD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA6I1G;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAarD"}
@@ -0,0 +1,184 @@
1
+ /**
2
+ * `aidlc revert <instance> --task T<n> | --phase implementation` — undo a
3
+ * task's commits by task id instead of by hunting for hashes.
4
+ *
5
+ * The roadmap item's one hard rule is "show the plan and ask first", so the
6
+ * command is a funnel of refusals, then a printed plan, then a question. Every
7
+ * refusal happens before git is asked to write anything, and the only write
8
+ * path is `revert/apply.ts`, which leaves the branch as it found it on any
9
+ * failure.
10
+ *
11
+ * Requirements: revert-by-task/AC-4, AC-5, AC-7, AC-8, AC-9, AC-10, AC-12,
12
+ * AC-13, AC-14, AC-17, AC-18, AC-19, AC-20, AC-21, AC-22
13
+ */
14
+ import { readFileSync, statSync } from 'node:fs';
15
+ import { join } from 'node:path';
16
+ import { openClaimStore, isStale as isClaimStale } from '../concurrency/claim-store.js';
17
+ import { loadClaimTimeoutMinutes } from '../cost/config.js';
18
+ import { defaultPrompter } from '../core/prompt.js';
19
+ import { resolveProjectRoot } from '../core/project-root.js';
20
+ import { applyRevert } from '../revert/apply.js';
21
+ import { branchCommits, checkRepo } from '../revert/commits.js';
22
+ import { buildPlan, describeSelector, formatPlan, taskList } from '../revert/plan.js';
23
+ import { loadSnapshot } from '../state/snapshot-store.js';
24
+ import { parseTasks } from '../tasks/parser.js';
25
+ /** The instance-name rule from `concurrency/claim-store.ts`, checked before any path is built. */
26
+ const INSTANCE_NAME_RE = /^[a-z0-9][a-z0-9-]*$/;
27
+ const TASK_ID_RE = /^T?([1-9][0-9]*)$/i;
28
+ const REPO_REASONS = {
29
+ 'not-a-repo': 'this project is not inside a git work tree',
30
+ 'no-main': 'no local `main` branch — revert compares the current branch with `main`',
31
+ 'on-main': 'HEAD is on `main`; reverting merged work on `main` is out of scope — ' +
32
+ 'run this on the instance branch before it merges',
33
+ dirty: 'tracked files have uncommitted changes — commit or set them aside first',
34
+ };
35
+ /**
36
+ * Run the command. Returns the exit code rather than setting it, so tests read
37
+ * it directly; the commander action copies it to `process.exitCode`.
38
+ */
39
+ export async function runRevert(instance, opts, deps = {}) {
40
+ const out = deps.out ?? ((l) => process.stdout.write(`${l}\n`));
41
+ const err = deps.err ?? ((l) => process.stderr.write(`${l}\n`));
42
+ const prompter = deps.prompter ?? defaultPrompter;
43
+ const refuse = (message) => {
44
+ err(`✗ ${message}`);
45
+ err('Nothing changed.');
46
+ return 1;
47
+ };
48
+ // AC-5, AC-4: exactly one selector, and only the phase that has commits.
49
+ if ((opts.task === undefined) === (opts.phase === undefined)) {
50
+ return refuse('give exactly one of --task T<n> or --phase implementation');
51
+ }
52
+ let selector;
53
+ if (opts.task !== undefined) {
54
+ const m = TASK_ID_RE.exec(opts.task.trim());
55
+ if (!m)
56
+ return refuse(`"${opts.task}" is not a task id — use the form T3`);
57
+ selector = { kind: 'task', task: Number(m[1]) };
58
+ }
59
+ else {
60
+ if (opts.phase !== 'implementation') {
61
+ return refuse(`only --phase implementation can be reverted: implementation commits are the ones ` +
62
+ `tied to tasks. A phase's documents are changed with \`aidlc amend ${instance}\`.`);
63
+ }
64
+ selector = { kind: 'phase' };
65
+ }
66
+ // AC-21: the name is validated before it builds a path or reaches git.
67
+ if (!INSTANCE_NAME_RE.test(instance)) {
68
+ return refuse(`"${instance}" is not a valid instance name (lowercase letters, digits and hyphens)`);
69
+ }
70
+ const projectRoot = deps.projectRoot ?? resolveProjectRoot();
71
+ const stateDir = join(projectRoot, '.aidlc', 'state');
72
+ let isDir = false;
73
+ try {
74
+ isDir = statSync(join(stateDir, instance)).isDirectory();
75
+ }
76
+ catch {
77
+ // Missing — reported below.
78
+ }
79
+ if (!isDir) {
80
+ return refuse(`no instance "${instance}" — .aidlc/state/${instance}/ does not exist`);
81
+ }
82
+ // AC-19: after implementation closes, testing has passed over this code.
83
+ let currentPhase;
84
+ try {
85
+ currentPhase = loadSnapshot(stateDir, instance, 'instance.yaml').current_phase;
86
+ }
87
+ catch {
88
+ return refuse(`cannot read .aidlc/state/${instance}/instance.yaml`);
89
+ }
90
+ if (currentPhase !== 'implementation') {
91
+ return refuse(`${instance} is in the ${currentPhase} phase; revert works only during implementation`);
92
+ }
93
+ // AC-20: the same live-claim rule `aidlc amend` applies.
94
+ if (!opts.override) {
95
+ const timeoutMinutes = loadClaimTimeoutMinutes(projectRoot);
96
+ let live = false;
97
+ try {
98
+ const claim = openClaimStore(projectRoot, timeoutMinutes).read(instance);
99
+ live = claim !== null && !isClaimStale(claim, timeoutMinutes);
100
+ }
101
+ catch {
102
+ // An unopenable claim store is not evidence of a claim.
103
+ }
104
+ if (!live) {
105
+ return refuse(`no live claim on '${instance}' — run \`aidlc claim ${instance}\` first, ` +
106
+ `or pass --override to revert without one`);
107
+ }
108
+ }
109
+ // AC-7: a task id the plan does not define is a typo, not an empty result.
110
+ if (selector.kind === 'task') {
111
+ let defined = false;
112
+ try {
113
+ const content = readFileSync(join(stateDir, instance, 'tasks.md'), 'utf8');
114
+ defined = parseTasks(content).tasks.some((t) => t.id === selector.task);
115
+ }
116
+ catch {
117
+ // No tasks.md: no task is defined.
118
+ }
119
+ if (!defined)
120
+ return refuse(`T${selector.task} is not a task in .aidlc/state/${instance}/tasks.md`);
121
+ }
122
+ // AC-18, AC-21, AC-22.
123
+ const repo = checkRepo(projectRoot);
124
+ if (!repo.ok)
125
+ return refuse(REPO_REASONS[repo.reason]);
126
+ const result = buildPlan(instance, selector, branchCommits(projectRoot));
127
+ if (!result.ok) {
128
+ if (result.reason === 'merge-commit') {
129
+ return refuse(`${result.short} "${result.subject}" is a merge commit; revert it by hand`);
130
+ }
131
+ const trailer = selector.kind === 'task' ? `Task: ${instance}/T${selector.task}` : `Task: ${instance}/T<n>`;
132
+ return refuse(`no commit in main..HEAD carries the trailer "${trailer}" (or all are already reverted)`);
133
+ }
134
+ const { plan } = result;
135
+ for (const line of formatPlan(instance, plan, repo.branch))
136
+ out(line);
137
+ if (opts.dryRun) {
138
+ out('Dry run — nothing changed.');
139
+ return 0;
140
+ }
141
+ if (!opts.yes) {
142
+ const answer = await prompter.confirm({
143
+ message: `Undo ${describeSelector(plan.selector)} (${plan.commits.length} commit${plan.commits.length === 1 ? '' : 's'})?`,
144
+ initialValue: false,
145
+ });
146
+ if (!answer.ok && answer.reason === 'no-tty') {
147
+ return refuse('no terminal to ask in — re-run with --yes to revert as planned above');
148
+ }
149
+ if (!answer.ok || !answer.value) {
150
+ out('Nothing changed.');
151
+ return 0;
152
+ }
153
+ }
154
+ const applied = applyRevert(projectRoot, instance, plan);
155
+ if (!applied.ok) {
156
+ switch (applied.reason) {
157
+ case 'conflict':
158
+ return refuse(`undoing ${applied.short} "${applied.subject}" conflicts with later work on this branch; ` +
159
+ `the revert was abandoned`);
160
+ case 'empty':
161
+ return refuse('the selected commits change nothing outside .aidlc/state/ and no checkbox needs resetting');
162
+ case 'commit-failed':
163
+ return refuse(`git commit failed: ${applied.detail}`);
164
+ }
165
+ }
166
+ out(`✓ Reverted as ${applied.short}.`);
167
+ out(applied.reset.length > 0 ? `Reset to open: ${taskList(applied.reset)}.` : 'No checkbox needed resetting.');
168
+ return 0;
169
+ }
170
+ export function registerRevert(program) {
171
+ program
172
+ .command('revert')
173
+ .description("Undo a task's commits (found by their Task: trailer) after showing the plan")
174
+ .argument('<instance>', 'Lifecycle instance name')
175
+ .option('--task <id>', 'Task to undo, e.g. T3')
176
+ .option('--phase <phase>', 'Undo every task commit of the phase (implementation only)')
177
+ .option('--dry-run', 'Print the plan; change nothing')
178
+ .option('--yes', 'Revert without asking (needed without a terminal)')
179
+ .option('--override', 'Revert without a live claim on the instance')
180
+ .action(async (instance, opts) => {
181
+ process.exitCode = await runRevert(instance, opts);
182
+ });
183
+ }
184
+ //# sourceMappingURL=revert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revert.js","sourceRoot":"","sources":["../../src/commands/revert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAiB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAiB,MAAM,mBAAmB,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,kGAAkG;AAClG,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAChD,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAiBxC,MAAM,YAAY,GA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YAAY,EAAE,SAAS,UAAU,EAM7C,CAAC"}
1
+ {"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../../src/menu/roster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/E,MAAM,WAAW,SAAS;IACxB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC;CAC/B;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,SAAS,EAqBtC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAyCvD,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAM7C,CAAC"}
@@ -82,6 +82,8 @@ export const EXCLUSIONS = {
82
82
  'cross-check': 'needs an instance at the start of its implementation phase, and the menu reads no project ' +
83
83
  'state so it cannot tell which one that is; the implementation skill offers it at that ' +
84
84
  'moment (cross-artifact-check/AC-17, AC-18).',
85
+ revert: 'needs an instance in its implementation phase and a task id, and the menu reads no project ' +
86
+ 'state so it cannot tell which; the implementation skill names it (revert-by-task/AC-1, AC-23).',
85
87
  };
86
88
  /** Bucket order for grouping; matches the order entries appear in `ROSTER`. */
87
89
  export const BUCKET_ORDER = [
@@ -1 +1 @@
1
- {"version":3,"file":"roster.js","sourceRoot":"","sources":["../../src/menu/roster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAkBH;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commits as one new commit (revert-by-task D2).
3
+ *
4
+ * The working tree was clean when this starts (`checkRepo`, AC-18), so every
5
+ * failure path can return to the recorded `HEAD` with `reset --hard` and lose
6
+ * nothing but what this run wrote (AC-17).
7
+ *
8
+ * Lifecycle state is never reverted by git: a task commit may carry its own
9
+ * `[x]`, phase YAML or cost records, and undoing those would rewind state by
10
+ * accident. `.aidlc/state/` is restored from `HEAD` after the revert, and the
11
+ * only state change is the checkbox reset this module writes (D3, AC-16).
12
+ *
13
+ * The new commit carries no `Task:` trailer — it would otherwise be selected
14
+ * by the next `--task` run and undone, re-applying the work.
15
+ *
16
+ * Requirements: revert-by-task/AC-15, AC-16, AC-17
17
+ */
18
+ import { type Plan } from './plan.js';
19
+ export type ApplyResult = {
20
+ ok: true;
21
+ sha: string;
22
+ short: string;
23
+ reset: number[];
24
+ } | {
25
+ ok: false;
26
+ reason: 'conflict';
27
+ short: string;
28
+ subject: string;
29
+ } | {
30
+ ok: false;
31
+ reason: 'empty';
32
+ } | {
33
+ ok: false;
34
+ reason: 'commit-failed';
35
+ detail: string;
36
+ };
37
+ /** The commit message: subject, one summary line, then git's own revert lines. */
38
+ export declare function revertMessage(instance: string, plan: Plan): string;
39
+ export declare function applyRevert(projectRoot: string, instance: string, plan: Plan): ApplyResult;
40
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/revert/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,EAA8B,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAElE,MAAM,MAAM,WAAW,GACnB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACzD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACjE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC9B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAI3D,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAelE;AAgDD,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,WAAW,CA0D1F"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Undo a plan's commits as one new commit (revert-by-task D2).
3
+ *
4
+ * The working tree was clean when this starts (`checkRepo`, AC-18), so every
5
+ * failure path can return to the recorded `HEAD` with `reset --hard` and lose
6
+ * nothing but what this run wrote (AC-17).
7
+ *
8
+ * Lifecycle state is never reverted by git: a task commit may carry its own
9
+ * `[x]`, phase YAML or cost records, and undoing those would rewind state by
10
+ * accident. `.aidlc/state/` is restored from `HEAD` after the revert, and the
11
+ * only state change is the checkbox reset this module writes (D3, AC-16).
12
+ *
13
+ * The new commit carries no `Task:` trailer — it would otherwise be selected
14
+ * by the next `--task` run and undone, re-applying the work.
15
+ *
16
+ * Requirements: revert-by-task/AC-15, AC-16, AC-17
17
+ */
18
+ import { readFileSync, writeFileSync } from 'node:fs';
19
+ import { join } from 'node:path';
20
+ import { instancePath } from '../state/snapshot-store.js';
21
+ import { resetDone } from '../tasks/reset.js';
22
+ import { git } from './commits.js';
23
+ import { describeSelector, taskList } from './plan.js';
24
+ const STATE_DIR = '.aidlc/state';
25
+ /** The commit message: subject, one summary line, then git's own revert lines. */
26
+ export function revertMessage(instance, plan) {
27
+ const n = plan.commits.length;
28
+ const tagged = plan.selector.kind === 'task'
29
+ ? `Task: ${instance}/T${plan.selector.task}`
30
+ : `a task of ${instance}`;
31
+ return [
32
+ `revert(${instance}): undo ${describeSelector(plan.selector)}`,
33
+ '',
34
+ `Undoes ${n} commit${n === 1 ? '' : 's'} tagged with ${tagged}. ` +
35
+ `Resets ${taskList(plan.resetTasks)} in tasks.md.`,
36
+ '',
37
+ ...plan.commits.map((c) => `This reverts commit ${c.sha}.`),
38
+ '',
39
+ ].join('\n');
40
+ }
41
+ function abandon(projectRoot, head) {
42
+ // `--quit` clears any sequencer state a failed revert left; it fails
43
+ // harmlessly when there is none.
44
+ try {
45
+ git(projectRoot, ['revert', '--quit']);
46
+ }
47
+ catch {
48
+ /* nothing in progress */
49
+ }
50
+ git(projectRoot, ['reset', '-q', '--hard', head]);
51
+ }
52
+ /**
53
+ * After git stopped a revert, resolve it when every conflict is under
54
+ * `.aidlc/state/`, and say whether it did. A task commit usually ticks its own
55
+ * box, so undoing it collides with the next task's tick on the adjacent line;
56
+ * state is restored from `HEAD` regardless (D3), so taking `HEAD`'s state now
57
+ * loses nothing. No unmerged path at all means git failed for another reason.
58
+ */
59
+ function resolvedInState(projectRoot) {
60
+ try {
61
+ const paths = git(projectRoot, ['diff', '--name-only', '-z', '--diff-filter=U']).split('\0').filter(Boolean);
62
+ if (paths.length === 0 || !paths.every((p) => p.startsWith(`${STATE_DIR}/`)))
63
+ return false;
64
+ git(projectRoot, ['restore', '--source=HEAD', '--staged', '--worktree', '--', STATE_DIR]);
65
+ // Clears the stopped revert so the next commit can be undone.
66
+ git(projectRoot, ['revert', '--quit']);
67
+ return true;
68
+ }
69
+ catch {
70
+ return false;
71
+ }
72
+ }
73
+ function isTracked(projectRoot, path) {
74
+ try {
75
+ git(projectRoot, ['ls-files', '--error-unmatch', '--', path]);
76
+ return true;
77
+ }
78
+ catch {
79
+ return false;
80
+ }
81
+ }
82
+ function firstLine(err) {
83
+ const e = err;
84
+ const text = (e.stderr || e.message || String(err)).trim();
85
+ return text.split('\n')[0] ?? '';
86
+ }
87
+ export function applyRevert(projectRoot, instance, plan) {
88
+ const head = git(projectRoot, ['rev-parse', 'HEAD']).trim();
89
+ // Validates the instance name as a single path segment before it reaches git.
90
+ const tasksAbs = join(instancePath(join(projectRoot, STATE_DIR), instance), 'tasks.md');
91
+ const tasksRel = `${STATE_DIR}/${instance}/tasks.md`;
92
+ // Newest first, so each inverse applies over the tree its successor left.
93
+ for (const c of plan.commits) {
94
+ try {
95
+ git(projectRoot, ['revert', '--no-commit', c.sha]);
96
+ }
97
+ catch {
98
+ if (!resolvedInState(projectRoot)) {
99
+ abandon(projectRoot, head);
100
+ return { ok: false, reason: 'conflict', short: c.short, subject: c.subject };
101
+ }
102
+ }
103
+ }
104
+ const stateTracked = git(projectRoot, ['ls-tree', '-d', '--name-only', 'HEAD', '--', STATE_DIR]).trim() !== '';
105
+ const stateStaged = git(projectRoot, ['diff', '--cached', '--name-only', '--', STATE_DIR]).trim() !== '';
106
+ if (stateTracked || stateStaged) {
107
+ git(projectRoot, ['restore', '--source=HEAD', '--staged', '--worktree', '--', STATE_DIR]);
108
+ }
109
+ let tasksContent = null;
110
+ try {
111
+ tasksContent = readFileSync(tasksAbs, 'utf8');
112
+ }
113
+ catch {
114
+ /* no tasks.md: nothing to reset */
115
+ }
116
+ const reset = tasksContent === null ? { content: '', reset: [] } : resetDone(tasksContent, plan.resetTasks);
117
+ const tasksTracked = reset.reset.length > 0 && isTracked(projectRoot, tasksRel);
118
+ if (tasksTracked) {
119
+ writeFileSync(tasksAbs, reset.content);
120
+ git(projectRoot, ['add', '--', tasksRel]);
121
+ }
122
+ try {
123
+ git(projectRoot, ['diff', '--cached', '--quiet']);
124
+ abandon(projectRoot, head);
125
+ return { ok: false, reason: 'empty' };
126
+ }
127
+ catch {
128
+ /* staged changes exist — the normal case */
129
+ }
130
+ try {
131
+ git(projectRoot, ['commit', '-q', '-F', '-'], revertMessage(instance, plan));
132
+ }
133
+ catch (err) {
134
+ abandon(projectRoot, head);
135
+ return { ok: false, reason: 'commit-failed', detail: firstLine(err) };
136
+ }
137
+ // An untracked (ignored) tasks.md cannot ride in the commit; write it only
138
+ // once the commit exists, so a failure above leaves it untouched.
139
+ if (reset.reset.length > 0 && !tasksTracked)
140
+ writeFileSync(tasksAbs, reset.content);
141
+ const sha = git(projectRoot, ['rev-parse', 'HEAD']).trim();
142
+ return { ok: true, sha, short: sha.slice(0, 7), reset: reset.reset };
143
+ }
144
+ //# sourceMappingURL=apply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/revert/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAa,MAAM,WAAW,CAAC;AAQlE,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,kFAAkF;AAClF,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,IAAU;IACxD,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM;QAC3B,CAAC,CAAC,SAAS,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;QAC5C,CAAC,CAAC,aAAa,QAAQ,EAAE,CAAC;IAC9B,OAAO;QACL,UAAU,QAAQ,WAAW,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAC9D,EAAE;QACF,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAA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,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;AACvE,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Git reads for `aidlc revert`: is this a branch we may revert on, and which
3
+ * commits has it made since it left `main`.
4
+ *
5
+ * `main` is the base branch the rest of the CLI hard-codes
6
+ * (`concurrency/worktree.ts`, `autopilot/driver.ts`); merged work on `main` is
7
+ * out of scope (revert-by-task/AC-22). Every call is `execFileSync` with an
8
+ * argument array — no shell string ever carries a name from argv.
9
+ *
10
+ * Requirements: revert-by-task/AC-2, AC-3, AC-6, AC-9, AC-18, AC-21, AC-22
11
+ */
12
+ import { type TaskRef } from './trailers.js';
13
+ /** One commit in `main..HEAD`. */
14
+ export interface BranchCommit {
15
+ sha: string;
16
+ short: string;
17
+ subject: string;
18
+ /** Parent count; more than one is a merge (AC-9). */
19
+ parents: number;
20
+ /** Tasks named by well-formed `Task:` trailers. */
21
+ tasks: TaskRef[];
22
+ /** Full shas this commit's message says it reverts (AC-6). */
23
+ reverts: string[];
24
+ }
25
+ export type RepoMiss = 'not-a-repo' | 'no-main' | 'on-main' | 'dirty';
26
+ export type RepoCheck = {
27
+ ok: true;
28
+ branch: string;
29
+ } | {
30
+ ok: false;
31
+ reason: RepoMiss;
32
+ };
33
+ /** Run git in the project root and return stdout; throws on a non-zero exit. */
34
+ export declare function git(projectRoot: string, args: string[], input?: string): string;
35
+ /**
36
+ * The preconditions every revert needs, in the order the command reports
37
+ * them: a work tree, a `main` branch, not standing on it, and no uncommitted
38
+ * change to a tracked file (untracked files cannot be lost by a revert and do
39
+ * not block it).
40
+ */
41
+ export declare function checkRepo(projectRoot: string): RepoCheck;
42
+ /** Commits reachable from HEAD and not from `main`, newest first. */
43
+ export declare function branchCommits(projectRoot: string): BranchCommit[];
44
+ //# sourceMappingURL=commits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commits.d.ts","sourceRoot":"","sources":["../../src/revert/commits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAkC,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7E,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtE,MAAM,MAAM,SAAS,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvF,gFAAgF;AAChF,wBAAgB,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAO/E;AAWD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAiBxD;AAWD,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,EAAE,CAsBjE"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Git reads for `aidlc revert`: is this a branch we may revert on, and which
3
+ * commits has it made since it left `main`.
4
+ *
5
+ * `main` is the base branch the rest of the CLI hard-codes
6
+ * (`concurrency/worktree.ts`, `autopilot/driver.ts`); merged work on `main` is
7
+ * out of scope (revert-by-task/AC-22). Every call is `execFileSync` with an
8
+ * argument array — no shell string ever carries a name from argv.
9
+ *
10
+ * Requirements: revert-by-task/AC-2, AC-3, AC-6, AC-9, AC-18, AC-21, AC-22
11
+ */
12
+ import { execFileSync } from 'node:child_process';
13
+ import { parseTaskTrailer, revertedShas } from './trailers.js';
14
+ /** Run git in the project root and return stdout; throws on a non-zero exit. */
15
+ export function git(projectRoot, args, input) {
16
+ return execFileSync('git', args, {
17
+ cwd: projectRoot,
18
+ encoding: 'utf8',
19
+ input,
20
+ stdio: ['pipe', 'pipe', 'pipe'],
21
+ });
22
+ }
23
+ function succeeds(projectRoot, args) {
24
+ try {
25
+ git(projectRoot, args);
26
+ return true;
27
+ }
28
+ catch {
29
+ return false;
30
+ }
31
+ }
32
+ /**
33
+ * The preconditions every revert needs, in the order the command reports
34
+ * them: a work tree, a `main` branch, not standing on it, and no uncommitted
35
+ * change to a tracked file (untracked files cannot be lost by a revert and do
36
+ * not block it).
37
+ */
38
+ export function checkRepo(projectRoot) {
39
+ if (!succeeds(projectRoot, ['rev-parse', '--is-inside-work-tree'])) {
40
+ return { ok: false, reason: 'not-a-repo' };
41
+ }
42
+ if (!succeeds(projectRoot, ['rev-parse', '--verify', '--quiet', 'refs/heads/main'])) {
43
+ return { ok: false, reason: 'no-main' };
44
+ }
45
+ let branch = '';
46
+ try {
47
+ branch = git(projectRoot, ['symbolic-ref', '-q', 'HEAD']).trim();
48
+ }
49
+ catch {
50
+ // Detached HEAD: main..HEAD is still well defined, so it is allowed.
51
+ }
52
+ if (branch === 'refs/heads/main')
53
+ return { ok: false, reason: 'on-main' };
54
+ const dirty = git(projectRoot, ['status', '--porcelain', '--untracked-files=no']).trim();
55
+ if (dirty !== '')
56
+ return { ok: false, reason: 'dirty' };
57
+ return { ok: true, branch: branch.replace(/^refs\/heads\//, '') || 'HEAD' };
58
+ }
59
+ // NUL separates every field, and `-z` ends every record with one. It is the
60
+ // only byte no message can carry: `git commit` refuses a NUL, and git cuts a
61
+ // hand-built message's output at one. Other control characters survive in a
62
+ // message — a body carrying the old \x1e/\x1f separators forged a second
63
+ // record naming a commit on main (revert-by-task/AC-2). Trailer values are
64
+ // unfolded, so a newline cannot occur inside one and separates them.
65
+ const FIELDS = ['%H', '%h', '%P', '%s', '%(trailers:key=Task,valueonly,unfold,separator=%x0a)', '%b'];
66
+ const FORMAT = FIELDS.join('%x00');
67
+ /** Commits reachable from HEAD and not from `main`, newest first. */
68
+ export function branchCommits(projectRoot) {
69
+ const out = git(projectRoot, ['log', '-z', `--format=${FORMAT}`, 'main..HEAD']);
70
+ const fields = out.split('\0');
71
+ fields.pop(); // the empty string after the last record's terminator
72
+ const commits = [];
73
+ for (let i = 0; i + FIELDS.length <= fields.length; i += FIELDS.length) {
74
+ const [sha, short, parents, subject, trailers, body] = fields.slice(i, i + FIELDS.length);
75
+ const tasks = [];
76
+ for (const value of trailers.split('\n')) {
77
+ const ref = parseTaskTrailer(value);
78
+ if (ref)
79
+ tasks.push(ref);
80
+ }
81
+ commits.push({
82
+ sha,
83
+ short,
84
+ subject,
85
+ parents: parents.trim() === '' ? 0 : parents.trim().split(' ').length,
86
+ tasks,
87
+ reverts: revertedShas(body),
88
+ });
89
+ }
90
+ return commits;
91
+ }
92
+ //# sourceMappingURL=commits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commits.js","sourceRoot":"","sources":["../../src/revert/commits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAgB,MAAM,eAAe,CAAC;AAmB7E,gFAAgF;AAChF,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,IAAc,EAAE,KAAc;IACrE,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;QAC/B,GAAG,EAAE,WAAW;QAChB,QAAQ,EAAE,MAAM;QAChB,KAAK;QACL,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KAChC,C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,GAAG;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,IAAI,CAAC;YACX,GAAG;YACH,KAAK;YACL,OAAO;YACP,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM;YACrE,KAAK;YACL,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC;SAC5B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Choose the commits a revert undoes and say so before anything changes.
3
+ *
4
+ * Pure: takes the branch's commits as `branchCommits()` returns them (newest
5
+ * first) and decides. The plan is the whole safety story the roadmap item
6
+ * asks for — "it must show the plan and ask first" — so every commit that also
7
+ * belongs to another task is marked `shared` in words, never by colour alone
8
+ * (revert-by-task/AC-11).
9
+ *
10
+ * Requirements: revert-by-task/AC-2, AC-3, AC-6, AC-8, AC-9, AC-10, AC-11
11
+ */
12
+ import type { BranchCommit } from './commits.js';
13
+ /** `--task T<n>` or `--phase implementation` (every task of the instance). */
14
+ export type Selector = {
15
+ kind: 'task';
16
+ task: number;
17
+ } | {
18
+ kind: 'phase';
19
+ };
20
+ export interface PlanCommit {
21
+ sha: string;
22
+ short: string;
23
+ subject: string;
24
+ /** This instance's tasks the commit names, ascending. */
25
+ tasks: number[];
26
+ /** Of those, the ones the selector did not ask for (AC-11). */
27
+ shared: number[];
28
+ }
29
+ export interface Plan {
30
+ selector: Selector;
31
+ /** Newest first — the order they are undone in. */
32
+ commits: PlanCommit[];
33
+ /** Every task of this instance a selected commit names, ascending. */
34
+ resetTasks: number[];
35
+ }
36
+ export type PlanResult = {
37
+ ok: true;
38
+ plan: Plan;
39
+ } | {
40
+ ok: false;
41
+ reason: 'no-commits';
42
+ } | {
43
+ ok: false;
44
+ reason: 'merge-commit';
45
+ short: string;
46
+ subject: string;
47
+ };
48
+ export declare function buildPlan(instance: string, selector: Selector, commits: BranchCommit[]): PlanResult;
49
+ /** `T3` or `T3, T4`. */
50
+ export declare function taskList(ids: number[]): string;
51
+ /** What the selector names, for the plan heading and the commit subject. */
52
+ export declare function describeSelector(selector: Selector): string;
53
+ /** The plan as printed before the question (AC-10, AC-11). */
54
+ export declare function formatPlan(instance: string, plan: Plan, branch: string): string[];
55
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/revert/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,8EAA8E;AAC9E,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,mDAAmD;IACnD,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,sEAAsE;IACtE,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,UAAU,GAClB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GACxB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACnC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAI1E,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,YAAY,EAAE,GACtB,UAAU,CAoBZ;AAED,wBAAwB;AACxB,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,CAE9C;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE3D;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAajF"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Choose the commits a revert undoes and say so before anything changes.
3
+ *
4
+ * Pure: takes the branch's commits as `branchCommits()` returns them (newest
5
+ * first) and decides. The plan is the whole safety story the roadmap item
6
+ * asks for — "it must show the plan and ask first" — so every commit that also
7
+ * belongs to another task is marked `shared` in words, never by colour alone
8
+ * (revert-by-task/AC-11).
9
+ *
10
+ * Requirements: revert-by-task/AC-2, AC-3, AC-6, AC-8, AC-9, AC-10, AC-11
11
+ */
12
+ const ascending = (a, b) => a - b;
13
+ export function buildPlan(instance, selector, commits) {
14
+ // A commit can only revert an older one, so collecting across the whole
15
+ // range is the same as "a later commit reverts it" (AC-6).
16
+ const undone = new Set(commits.flatMap((c) => c.reverts));
17
+ const selected = [];
18
+ for (const c of commits) {
19
+ if (undone.has(c.sha))
20
+ continue;
21
+ const tasks = [...new Set(c.tasks.filter((t) => t.instance === instance).map((t) => t.task))]
22
+ .sort(ascending);
23
+ if (tasks.length === 0)
24
+ continue;
25
+ if (selector.kind === 'task' && !tasks.includes(selector.task))
26
+ continue;
27
+ if (c.parents > 1)
28
+ return { ok: false, reason: 'merge-commit', short: c.short, subject: c.subject };
29
+ const shared = selector.kind === 'task' ? tasks.filter((t) => t !== selector.task) : [];
30
+ selected.push({ sha: c.sha, short: c.short, subject: c.subject, tasks, shared });
31
+ }
32
+ if (selected.length === 0)
33
+ return { ok: false, reason: 'no-commits' };
34
+ const resetTasks = [...new Set(selected.flatMap((c) => c.tasks))].sort(ascending);
35
+ return { ok: true, plan: { selector, commits: selected, resetTasks } };
36
+ }
37
+ /** `T3` or `T3, T4`. */
38
+ export function taskList(ids) {
39
+ return ids.map((n) => `T${n}`).join(', ');
40
+ }
41
+ /** What the selector names, for the plan heading and the commit subject. */
42
+ export function describeSelector(selector) {
43
+ return selector.kind === 'task' ? `T${selector.task}` : 'the implementation phase';
44
+ }
45
+ /** The plan as printed before the question (AC-10, AC-11). */
46
+ export function formatPlan(instance, plan, branch) {
47
+ const n = plan.commits.length;
48
+ const lines = [
49
+ `Plan: undo ${describeSelector(plan.selector)} of ${instance} — ` +
50
+ `${n} commit${n === 1 ? '' : 's'} on ${branch} since main, newest first:`,
51
+ ];
52
+ for (const c of plan.commits) {
53
+ const shared = c.shared.length > 0 ? ` — shared: also ${taskList(c.shared)}` : '';
54
+ lines.push(` ${c.short} ${c.subject} [${taskList(c.tasks)}]${shared}`);
55
+ }
56
+ lines.push(`Tasks reset to open in tasks.md (if done): ${taskList(plan.resetTasks)}`);
57
+ lines.push('Nothing under .aidlc/state/ changes except those checkboxes.');
58
+ return lines;
59
+ }
60
+ //# sourceMappingURL=plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/revert/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA8BH,MAAM,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AAE1D,MAAM,UAAU,SAAS,CACvB,QAAgB,EAChB,QAAkB,EAClB,OAAuB;IAEvB,wEAAwE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C,GAAG,OAAO,MAAM,4BAA4B;KAC5E,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,OAAO,MAAM,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;IAC5E,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,8CAA8C,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACtF,KAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;IAC3E,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Pure readers for the two commit-message lines `aidlc revert` trusts: the
3
+ * `Task:` trailer that ties a commit to a task, and git's own
4
+ * `This reverts commit <sha>.` line that marks one as already undone.
5
+ *
6
+ * Nothing here reads subjects. A subject mentioning "T3" for another reason
7
+ * must never select a commit (revert-by-task D1).
8
+ *
9
+ * Requirements: revert-by-task/AC-2, AC-3, AC-6
10
+ */
11
+ /** One task a commit's trailer names. */
12
+ export interface TaskRef {
13
+ instance: string;
14
+ /** n in T<n>. */
15
+ task: number;
16
+ }
17
+ /**
18
+ * Parse one `Task:` trailer value (`<instance>/T<n>`).
19
+ *
20
+ * @returns null for anything else — an unqualified `T3` or free text names no
21
+ * task, so it selects nothing.
22
+ */
23
+ export declare function parseTaskTrailer(value: string): TaskRef | null;
24
+ /** Full shas named by `This reverts commit <sha>.` lines in a commit body. */
25
+ export declare function revertedShas(body: string): string[];
26
+ //# sourceMappingURL=trailers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trailers.d.ts","sourceRoot":"","sources":["../../src/revert/trailers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,yCAAyC;AACzC,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAQD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAG9D;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEnD"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Pure readers for the two commit-message lines `aidlc revert` trusts: the
3
+ * `Task:` trailer that ties a commit to a task, and git's own
4
+ * `This reverts commit <sha>.` line that marks one as already undone.
5
+ *
6
+ * Nothing here reads subjects. A subject mentioning "T3" for another reason
7
+ * must never select a commit (revert-by-task D1).
8
+ *
9
+ * Requirements: revert-by-task/AC-2, AC-3, AC-6
10
+ */
11
+ // Instance names are lowercase kebab-case single segments; task ids carry no
12
+ // leading zero, matching the tasks.md grammar (tasks/parser.ts).
13
+ const TASK_TRAILER_RE = /^([a-z0-9][a-z0-9-]*)\/T([1-9][0-9]*)$/;
14
+ const REVERTS_RE = /^This reverts commit ([0-9a-f]{40})\.?\s*$/gm;
15
+ /**
16
+ * Parse one `Task:` trailer value (`<instance>/T<n>`).
17
+ *
18
+ * @returns null for anything else — an unqualified `T3` or free text names no
19
+ * task, so it selects nothing.
20
+ */
21
+ export function parseTaskTrailer(value) {
22
+ const m = TASK_TRAILER_RE.exec(value.trim());
23
+ return m ? { instance: m[1], task: Number(m[2]) } : null;
24
+ }
25
+ /** Full shas named by `This reverts commit <sha>.` lines in a commit body. */
26
+ export function revertedShas(body) {
27
+ return [...body.matchAll(REVERTS_RE)].map((m) => m[1]);
28
+ }
29
+ //# sourceMappingURL=trailers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trailers.js","sourceRoot":"","sources":["../../src/revert/trailers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,6EAA6E;AAC7E,iEAAiE;AACjE,MAAM,eAAe,GAAG,wCAAwC,CAAC;AAEjE,MAAM,UAAU,GAAG,8CAA8C,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7C,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Reset done tasks back to open in tasks.md — the one state change
3
+ * `aidlc revert` makes (revert-by-task/AC-16, D3).
4
+ *
5
+ * Line positions come from `parseTasks()`, so a line the parser does not read
6
+ * as a task is never rewritten. Open and deferred tasks are left exactly as
7
+ * written: a deferral carries a dated reason that a revert does not cancel.
8
+ */
9
+ /**
10
+ * Turn `- [x] T<n>:` into `- [ ] T<n>:` for each id in `ids` that is done.
11
+ *
12
+ * @returns the new content and the ids actually reset, ascending.
13
+ */
14
+ export declare function resetDone(content: string, ids: number[]): {
15
+ content: string;
16
+ reset: number[];
17
+ };
18
+ //# sourceMappingURL=reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../src/tasks/reset.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAW9F"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Reset done tasks back to open in tasks.md — the one state change
3
+ * `aidlc revert` makes (revert-by-task/AC-16, D3).
4
+ *
5
+ * Line positions come from `parseTasks()`, so a line the parser does not read
6
+ * as a task is never rewritten. Open and deferred tasks are left exactly as
7
+ * written: a deferral carries a dated reason that a revert does not cancel.
8
+ */
9
+ import { parseTasks } from './parser.js';
10
+ /**
11
+ * Turn `- [x] T<n>:` into `- [ ] T<n>:` for each id in `ids` that is done.
12
+ *
13
+ * @returns the new content and the ids actually reset, ascending.
14
+ */
15
+ export function resetDone(content, ids) {
16
+ const wanted = new Set(ids);
17
+ const lines = content.split('\n');
18
+ const reset = [];
19
+ for (const task of parseTasks(content).tasks) {
20
+ if (!wanted.has(task.id) || task.state !== 'done')
21
+ continue;
22
+ const i = task.line - 1;
23
+ lines[i] = lines[i].replace(/^-(\s+)\[x\]/, '-$1[ ]');
24
+ reset.push(task.id);
25
+ }
26
+ return { content: lines.join('\n'), reset };
27
+ }
28
+ //# sourceMappingURL=reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset.js","sourceRoot":"","sources":["../../src/tasks/reset.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,GAAa;IACtD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM;YAAE,SAAS;QAC5D,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACxB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QACtD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;AAC9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasensio/aidlc",
3
- "version": "1.57.0",
3
+ "version": "1.58.0",
4
4
  "description": "AI Development Lifecycle Framework — structured lifecycle guidance for AI coding agents across platforms",
5
5
  "homepage": "https://aidlc.rodrigoasensio.com",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "commander": "15.0.0",
32
32
  "picomatch": "4.0.5",
33
33
  "yaml": "2.9.0",
34
- "@rasensio/aidlc-content": "1.57.0"
34
+ "@rasensio/aidlc-content": "1.58.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "22.15.32",