gcf-aif-ext 0.29.1 → 0.31.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.
Files changed (54) hide show
  1. package/GLOSSARY.md +1 -1
  2. package/README.md +2 -1
  3. package/commands/gcf.js +176 -74
  4. package/extension.json +1 -1
  5. package/hooks/pre-commit.js +2 -0
  6. package/lib/agent-permissions.js +11 -6
  7. package/lib/audit-core.js +43 -19
  8. package/lib/board.js +10 -4
  9. package/lib/changes.js +2 -1
  10. package/lib/commit-files.js +2 -1
  11. package/lib/commit-move.js +114 -0
  12. package/lib/config-doc.js +22 -0
  13. package/lib/config-set.js +189 -83
  14. package/lib/design-check.js +8 -3
  15. package/lib/design-parts.js +111 -80
  16. package/lib/devices.js +3 -8
  17. package/lib/domain.js +17 -12
  18. package/lib/edits.js +7 -3
  19. package/lib/frozen.js +24 -0
  20. package/lib/gate.js +1 -1
  21. package/lib/gcf-paths.js +81 -11
  22. package/lib/git.js +18 -4
  23. package/lib/handoff.js +25 -10
  24. package/lib/history.js +1 -1
  25. package/lib/inbox-categories.js +32 -39
  26. package/lib/inbox.js +46 -34
  27. package/lib/integrate.js +3 -12
  28. package/lib/ledger.js +1 -1
  29. package/lib/lessons.js +4 -1
  30. package/lib/metrics.js +1 -0
  31. package/lib/migrate.js +1 -1
  32. package/lib/milestone-state.js +1 -1
  33. package/lib/phase.js +1 -1
  34. package/lib/pillars.js +1 -1
  35. package/lib/plan-check.js +80 -43
  36. package/lib/play-notes.js +115 -21
  37. package/lib/play.js +63 -12
  38. package/lib/playtest-list.js +1 -1
  39. package/lib/push.js +2 -1
  40. package/lib/questions.js +1 -1
  41. package/lib/review.js +106 -0
  42. package/lib/session-mark.js +21 -2
  43. package/lib/shelf.js +1 -0
  44. package/lib/systems-doc.js +27 -17
  45. package/lib/unit-ops.js +31 -109
  46. package/lib/validate-item.js +30 -7
  47. package/lib/verdict-fs.js +2 -1
  48. package/lib/verify-stamp.js +7 -2
  49. package/lib/verify.js +6 -2
  50. package/lib/work-ops.js +197 -104
  51. package/package.json +3 -3
  52. package/schemas/item.schema.json +24 -9
  53. package/templates/agents-block.md +9 -1
  54. package/templates/config.yml +15 -10
package/GLOSSARY.md CHANGED
@@ -34,5 +34,5 @@ terms:
34
34
  avoid: quota buffer
35
35
 
36
36
  - term: planning stall
37
- means: a plan whose improve passes keep finding blocking issues past `plan_passes`: the item waits for the human's more passes or implement as is
37
+ means: a plan or code whose review passes still find blocking issues when the rows of `review.plan|code` are over: the item waits for the human's more passes or go on as is
38
38
  avoid: non-convergence
package/README.md CHANGED
@@ -200,6 +200,7 @@ The functional base, part A (docs/Base-A-Plan.md). Update together with gcf-harn
200
200
 
201
201
  - `session_timeout_min` in `gcf/config.yml` (120): minutes one agent session on an item may run; above 0 (`gcf config set session_timeout_min --value=90`). The harness takes it when `run` has no `--timeout`.
202
202
  - `agent.model` and `agent.effort`: what an item or a chat thread without its own runs on (`gcf config set agent.model --value=sonnet`; empty or `default` takes it off). One plain word each, as an item's; a setting of kind `word` with `presets: model|effort` (the board suggests the agent's presets). `gcf board --json` carries them in `agent`, and `session_timeout_min` beside `context`.
203
+ - `config set` (core 0.30, Operator-Tasks-Plan t3): each setting of `gcf config` carries `title`, `hint` and `help` (its long text, with its key and file; `label` holds the same text), a number its `min`, `max`, `step` and `unit`, a setting with no default by its sense an `example`. A number outside its range is refused, from the CLI and the board alike. An empty `--value=` takes any key off, a mode or a command too (`gates.*`, `run_mode`, `chat.ask`, `dod.*`), so its default holds. `--pair` takes a list's lines too.
203
204
  - `gcf board --json` adds `items[].attachments` (the files `gcf item attach` gave it, project paths) and offers no `run` move to a feature (the run gate refuses one).
204
205
 
205
206
  ### 0.13.0
@@ -426,7 +427,7 @@ Every move of an item makes one commit `gcf(<move>): <id>` with every file it to
426
427
  **CNLP profiles and a work item schema** for the documents the agent reads — one profile per unit type, shared by a unit and its item — plus injections into `aif-plan`, `aif-review` and `aif-commit`.
427
428
 
428
429
 
429
- Improve passes (Hold-Plan): `gcf plan pass <id> --blocking N --polish M` records each pass in the plan's `## Passes` and answers continue, converged or stalled; `gcf plan stall` blocks a plan that does not converge, and the human answers with `gcf plan more <id> --passes N` or `gcf plan accept <id>`.
430
+ Review passes (Hold-Plan, Operator-Tasks-Plan t2): `review.plan` and `review.code` of `gcf/config.yml` are lists of rows `{agent: claude|codex, model, effort}` (`gcf config set review.plan --value "claude:opus:high, codex:astra:medium"`, `none`: no review; defaults opus·high ×2 and Codex astra·medium for the plan, opus·high ×2 for the code); row k makes pass k, the next only while the last found something blocking. `gcf review row <id> --kind plan|code --pass k [--diff] --json` names the row (and writes the code's diff for the reviewer to `.gcf-session/review/<id>.diff`: from where the card's work started to the disk, new files in, `gcf/` and `no_diff` out). `gcf plan pass <id> --blocking N --polish M [--by agent:model:effort] [--kind code]` records each pass in the plan's `## Passes` (the code's `## Reviews`) and answers continue, converged or stalled; `gcf review stall <id> --kind plan|code` blocks a review that does not converge (`stall.plan|code`; a card's old `stall` is the plan's), and the human answers with `gcf review more <id> --passes N` or `gcf review accept <id>`. `plan_passes` and `plan_review:` are gone: `gcf audit` names the one `config set review.plan` command that moves them, and that set drops them.
430
431
 
431
432
  ## Docs
432
433
 
package/commands/gcf.js CHANGED
@@ -413,19 +413,30 @@ function itemLines(c, linesOf) {
413
413
  ];
414
414
  }
415
415
 
416
- /** The session sheet: the build, then per item what to check and how to get there. */
417
- export function sessionText(s, linesOf = null) {
418
- const lines = sessionHead(s);
419
- const decide = s.decisions.length
416
+ /** The sheet's decisions: a go or a no each, none when there are none. */
417
+ function decideLines(decisions) {
418
+ return decisions.length
420
419
  ? [
421
420
  '',
422
421
  '## decide: no verdict, a go or a no; play it first where the build shows it',
423
- ...s.decisions.map(
424
- (d) => `[ ] ${d.id} [${d.system.join(',')}] ${d.title ?? d.intent ?? ''}`,
425
- ),
422
+ ...decisions.map((d) => `[ ] ${d.id} [${d.system.join(',')}] ${d.title ?? d.intent ?? ''}`),
426
423
  ]
427
424
  : [];
428
- if (!s.items.length) return [...lines, 'nothing waits for a playtest', ...decide].join('\n');
425
+ }
426
+
427
+ /** A milestone's head on the sheet (`m` null: no milestone): how to play it, what holds it. */
428
+ function sliceHead(m) {
429
+ const head = ['', m ? `# ${m.name}${m.goal ? `: ${m.goal}` : ''}` : '# no milestone'];
430
+ if (m?.play) head.push(`play: ${m.play}`);
431
+ if (m && (m.building || m.blocked))
432
+ head.push(`still building ${m.building}, blocked ${m.blocked}`);
433
+
434
+ return head;
435
+ }
436
+
437
+ /** The sheet's items, slice by slice, each with what to check and how to get there. */
438
+ function itemsLines(s, linesOf) {
439
+ const lines = [];
429
440
  let group = null;
430
441
  let slice;
431
442
  const known = new Map((s.milestones ?? []).map((m) => [m.name, m]));
@@ -433,27 +444,36 @@ export function sessionText(s, linesOf = null) {
433
444
  // its question first, then system by system.
434
445
  for (const c of s.items) {
435
446
  const m = known.get(c.milestone) ?? null;
436
- if (slice === undefined || (m?.name ?? null) !== slice) {
437
- lines.push('', m ? `# ${m.name}${m.goal ? `: ${m.goal}` : ''}` : '# no milestone');
438
- if (m?.play) lines.push(`play: ${m.play}`);
439
- if (m && (m.building || m.blocked))
440
- lines.push(`still building ${m.building}, blocked ${m.blocked}`);
441
- slice = m?.name ?? null;
447
+ const name = m?.name ?? null;
448
+ if (slice === undefined || name !== slice) {
449
+ lines.push(...sliceHead(m));
450
+ slice = name;
442
451
  group = null;
443
452
  }
444
453
 
445
454
  const system = c.system[0] ?? '(no subsystem)';
446
455
  if (system !== group) lines.push('', `## ${system}`);
447
456
  group = system;
448
- lines.push(
449
- '',
450
- `[ ] ${c.id} (${c.status}) [${c.system.join(',')}] ${c.title ?? c.intent ?? ''}`,
451
- );
457
+ lines.push('', cardHead(c));
452
458
  lines.push(...itemLines(c, linesOf));
453
459
  }
454
460
 
461
+ return lines;
462
+ }
463
+
464
+ /** An item's head line on the sheet: its box to tick, status, subsystems and title. */
465
+ const cardHead = (c) =>
466
+ `[ ] ${c.id} (${c.status}) [${c.system.join(',')}] ${c.title ?? c.intent ?? ''}`;
467
+
468
+ /** The session sheet: the build, then per item what to check and how to get there. */
469
+ export function sessionText(s, linesOf = null) {
470
+ const lines = sessionHead(s);
471
+ const decide = decideLines(s.decisions);
472
+ if (!s.items.length) return [...lines, 'nothing waits for a playtest', ...decide].join('\n');
473
+
455
474
  return [
456
475
  ...lines,
476
+ ...itemsLines(s, linesOf),
457
477
  ...decide,
458
478
  '',
459
479
  'after play: a verdict per item — /gcf-verdict <id> keep|tune|kill;',
@@ -616,7 +636,7 @@ function registerPlayQueue(playtest, jsonOf) {
616
636
  .description("The devices a target's script finds, each under the plays_on row it fits")
617
637
  .option('--json', 'machine output')
618
638
  .action(async (target, o) => {
619
- const r = await (await lib('devices')).devicesOf(process.cwd(), target);
639
+ const r = await (await lib('play')).devicesOf(process.cwd(), target);
620
640
  out(jsonOf(o), r, devicesText);
621
641
  if (r.problem) process.exitCode = 1;
622
642
  });
@@ -996,6 +1016,10 @@ function registerDesignParts(design) {
996
1016
  r.applied.length ? `saved ${r.applied.join(', ')}${shortHash(r.hash)}` : 'nothing changed',
997
1017
  );
998
1018
  });
1019
+ registerDesignDrafts(design, parts);
1020
+ }
1021
+
1022
+ function registerDesignDrafts(design, parts) {
999
1023
  design
1000
1024
  .command('discard [files...]')
1001
1025
  .description(
@@ -1098,6 +1122,11 @@ function registerChanges(gcf) {
1098
1122
  : 'nothing uncommitted',
1099
1123
  );
1100
1124
  });
1125
+ registerChangesFiles(group, { changes, TREE, allOf });
1126
+ registerChangesCommit(group, allOf);
1127
+ }
1128
+
1129
+ function registerChangesFiles(group, { changes, TREE, allOf }) {
1101
1130
  group
1102
1131
  .command('diff')
1103
1132
  .description("A text file's diff against the tree's base")
@@ -1136,7 +1165,6 @@ function registerChanges(gcf) {
1136
1165
  ).changeFile(process.cwd(), o.path, o.side, { worktree: o.worktree });
1137
1166
  out(true, r);
1138
1167
  });
1139
- registerChangesCommit(group, allOf);
1140
1168
  }
1141
1169
 
1142
1170
  function registerChangesCommit(group, allOf) {
@@ -1282,6 +1310,10 @@ function registerMoves(gcf) {
1282
1310
  ).doneUnit(process.cwd(), id, { constraints: o.constraint, commit: o.commit });
1283
1311
  console.log(`done ${r.id}${r.hash ? ` (${r.hash.slice(0, 7)})` : ''}`);
1284
1312
  });
1313
+ registerDrop(gcf, ops);
1314
+ }
1315
+
1316
+ function registerDrop(gcf, ops) {
1285
1317
  removeOptions(
1286
1318
  gcf
1287
1319
  .command('drop <id>')
@@ -1339,6 +1371,14 @@ function registerItemShow(item) {
1339
1371
  function registerItem(gcf) {
1340
1372
  const item = gcf.command('item').description('Work items in gcf/work/ (Methodology §3)');
1341
1373
  registerItemShow(item);
1374
+ registerItemNew(item);
1375
+ registerAttach(item);
1376
+ registerAgent(item);
1377
+ registerAmend(item);
1378
+ registerHistory(item);
1379
+ }
1380
+
1381
+ function registerItemNew(item) {
1342
1382
  item
1343
1383
  .command('new [id]')
1344
1384
  .description(
@@ -1375,40 +1415,39 @@ function registerItem(gcf) {
1375
1415
  .option('--commit', 'commit it (gcf(item)): for a caller with no console, e.g. a board')
1376
1416
  .option('--dry-run', 'print the id it would take and the checks; write nothing')
1377
1417
  .option('--proposal <key>', "the board's proposal it makes, <thread>/<id>: its commit names it")
1378
- .action(async (id, o) => {
1379
- if (o.note !== undefined && o.noteFile !== undefined)
1380
- throw new Error('give the note once: --note=<text> or --note-file <path|->');
1381
- const { newItem } = await lib('work-ops');
1382
- const r = await newItem(process.cwd(), {
1383
- id,
1384
- type: o.type,
1385
- gate: o.gate,
1386
- title: o.title,
1387
- parent: o.parent,
1388
- system: splitList(o.system),
1389
- depends: splitList(o.depends),
1390
- severity: o.severity,
1391
- blocked: o.blocked,
1392
- from: o.from,
1393
- reopens: o.reopens,
1394
- milestone: o.milestone,
1395
- version: o.release,
1396
- channel: o.channel,
1397
- model: o.model,
1398
- effort: o.effort,
1399
- note: o.noteFile === undefined ? o.note : readTextFile(o.noteFile),
1400
- priority: o.priority === undefined ? undefined : Number(o.priority),
1401
- commit: o.commit === true,
1402
- dryRun: o.dryRun === true,
1403
- proposal: o.proposal,
1404
- });
1405
- // The id first: a caller that gave a title reads it from here.
1406
- console.log(`${r.id} ${r.item}${shortHash(r.hash)}`);
1407
- });
1408
- registerAttach(item);
1409
- registerAgent(item);
1410
- registerAmend(item);
1411
- registerHistory(item);
1418
+ .action(itemNew);
1419
+ }
1420
+
1421
+ /** `item new`'s action. */
1422
+ async function itemNew(id, o) {
1423
+ if (o.note !== undefined && o.noteFile !== undefined)
1424
+ throw new Error('give the note once: --note=<text> or --note-file <path|->');
1425
+ const { newItem } = await lib('work-ops');
1426
+ const r = await newItem(process.cwd(), {
1427
+ id,
1428
+ type: o.type,
1429
+ gate: o.gate,
1430
+ title: o.title,
1431
+ parent: o.parent,
1432
+ system: splitList(o.system),
1433
+ depends: splitList(o.depends),
1434
+ severity: o.severity,
1435
+ blocked: o.blocked,
1436
+ from: o.from,
1437
+ reopens: o.reopens,
1438
+ milestone: o.milestone,
1439
+ version: o.release,
1440
+ channel: o.channel,
1441
+ model: o.model,
1442
+ effort: o.effort,
1443
+ note: o.noteFile === undefined ? o.note : readTextFile(o.noteFile),
1444
+ priority: o.priority === undefined ? undefined : Number(o.priority),
1445
+ commit: o.commit === true,
1446
+ dryRun: o.dryRun === true,
1447
+ proposal: o.proposal,
1448
+ });
1449
+ // The id first: a caller that gave a title reads it from here.
1450
+ console.log(`${r.id} ${r.item}${shortHash(r.hash)}`);
1412
1451
  }
1413
1452
 
1414
1453
  function registerAmend(item) {
@@ -1577,6 +1616,11 @@ function registerItemMoves(gcf) {
1577
1616
  console.log(`ranked ${r.ids.join(', ')}${shortHash(r.hash)}`);
1578
1617
  });
1579
1618
  registerDepends(gcf);
1619
+ registerQuestion(gcf);
1620
+ registerItemEnds(gcf, ops);
1621
+ }
1622
+
1623
+ function registerQuestion(gcf) {
1580
1624
  const question = gcf.command('question').description('Open questions (gcf/open-questions.md)');
1581
1625
  question
1582
1626
  .command('answer <qid>')
@@ -1623,6 +1667,9 @@ function registerItemMoves(gcf) {
1623
1667
  );
1624
1668
  console.log(`${r.id}${shortHash(r.hash)}`);
1625
1669
  });
1670
+ }
1671
+
1672
+ function registerItemEnds(gcf, ops) {
1626
1673
  gcf
1627
1674
  .command('submit <id>')
1628
1675
  .description('ready → awaiting-verdict / awaiting-decision (commit gcf(submit))')
@@ -1732,7 +1779,7 @@ async function inboxMove(commit, message, plan, key) {
1732
1779
  return null;
1733
1780
  }
1734
1781
 
1735
- const { commitMove } = await lib('unit-ops');
1782
+ const { commitMove } = await lib('commit-move');
1736
1783
  const loose = (await lib('inbox')).untrackedEntries(process.cwd());
1737
1784
 
1738
1785
  return commitMove(process.cwd(), message, {
@@ -1748,7 +1795,7 @@ async function inboxMove(commit, message, plan, key) {
1748
1795
 
1749
1796
  /** A work/ branch's gcf/ state is main's: an inbox entry is tagged or erased on main. */
1750
1797
  async function refuseOnWork(what) {
1751
- const { onWorkBranch } = await lib('unit-ops');
1798
+ const { onWorkBranch } = await lib('commit-move');
1752
1799
  if (onWorkBranch(process.cwd()))
1753
1800
  throw new Error(`${what} on main: a work/ branch records no inbox move`);
1754
1801
  }
@@ -1797,6 +1844,10 @@ function registerInboxSort(inbox) {
1797
1844
  const hash = await inboxMove(o.commit, `gcf(inbox): ${what} ${id}`, plan, key);
1798
1845
  console.log(`${id} ${o.off ? 'back from Later' : 'in Later'}${shortHash(hash)}`);
1799
1846
  });
1847
+ registerInboxCategories(inbox);
1848
+ }
1849
+
1850
+ function registerInboxCategories(inbox) {
1800
1851
  inbox
1801
1852
  .command('categories')
1802
1853
  .description('The categories an entry may have, and who may file each')
@@ -1881,6 +1932,7 @@ function registerInboxDrop(inbox) {
1881
1932
  );
1882
1933
  if (!committed)
1883
1934
  spawnSync('git', ['rm', '--cached', '-q', '--ignore-unmatch', '--', ...plan.files], {
1935
+ windowsHide: true,
1884
1936
  cwd: process.cwd(),
1885
1937
  stdio: 'ignore',
1886
1938
  });
@@ -2067,7 +2119,8 @@ function registerPlanPasses(plan) {
2067
2119
  )
2068
2120
  .requiredOption('--blocking <n>', 'findings that block the plan')
2069
2121
  .requiredOption('--polish <n>', 'findings that only polish it')
2070
- .option('--by <reviewer>', 'the pass was made by another reviewer (codex)')
2122
+ .option('--by <reviewer>', 'who made the pass: agent:model:effort (gcf review row), or self')
2123
+ .option('--kind <kind>', 'plan (## Passes) or code (## Reviews)', 'plan')
2071
2124
  .option('--json', 'machine output')
2072
2125
  .action(async (id, o) => {
2073
2126
  await touchSession(id);
@@ -2077,51 +2130,94 @@ function registerPlanPasses(plan) {
2077
2130
  blocking: Number(o.blocking),
2078
2131
  polish: Number(o.polish),
2079
2132
  by: o.by,
2133
+ kind: o.kind,
2080
2134
  });
2081
2135
  out(o.json, r, (x) => `pass ${x.pass}: ${x.verdict} (${x.passes.join(', ')})`);
2082
2136
  });
2083
- plan
2137
+ }
2138
+
2139
+ /**
2140
+ * The review passes of a plan and of the code (Operator-Tasks-Plan t2): who makes pass k, and the
2141
+ * stop when the rows are over with a blocking finding open, which blocks the card for the
2142
+ * operator's more or accept.
2143
+ */
2144
+ function registerReview(gcf) {
2145
+ const review = gcf.command('review').description('The review passes of a work item');
2146
+ review
2147
+ .command('row <id>')
2148
+ .description(
2149
+ 'Who makes pass k of the plan or code review (review.plan|code of gcf/config.yml; past ' +
2150
+ 'the rows, the last); --diff writes the code diff the reviewer reads',
2151
+ )
2152
+ .requiredOption('--kind <kind>', 'plan or code')
2153
+ .requiredOption('--pass <k>', 'the pass number, 1 or more')
2154
+ .option('--diff', 'code: write .gcf-session/review/<id>.diff and name it')
2155
+ .option('--json', 'machine output')
2156
+ .action(async (id, o) => {
2157
+ await touchSession(id);
2158
+ const r = await (
2159
+ await lib('review')
2160
+ ).reviewRow(process.cwd(), id, { kind: o.kind, pass: Number(o.pass), diff: o.diff });
2161
+ out(o.json, r, (x) =>
2162
+ [
2163
+ `pass ${x.pass}: ${x.by ?? 'no review'}`,
2164
+ ...(x.diff ? [`diff: ${x.diff.file}`] : []),
2165
+ ].join('\n'),
2166
+ );
2167
+ });
2168
+ review
2084
2169
  .command('stall <id>')
2085
2170
  .description(
2086
- 'Planning does not converge: block the card with its passes (commit gcf(plan_stall))',
2171
+ 'The review does not converge: block the card with its passes (commit gcf(plan_stall))',
2087
2172
  )
2088
2173
  .requiredOption('--passes <list>', 'the blocking findings of each pass, comma-separated')
2174
+ .option('--kind <kind>', 'plan or code', 'plan')
2089
2175
  .option('--reason <text>', 'what keeps it from converging')
2176
+ .option('--base <commit>', "code: the commit the card's work started from")
2090
2177
  .action(async (id, o) => {
2091
2178
  const passes = splitList(o.passes).map(Number);
2092
2179
  const r = await (
2093
2180
  await lib('work-ops')
2094
2181
  ).stallItem(process.cwd(), id, {
2095
2182
  passes,
2183
+ kind: o.kind,
2096
2184
  reason: o.reason,
2185
+ base: o.base,
2097
2186
  });
2098
- console.log(`${r.id} → blocked: planning does not converge · ${r.stall.passes.join(', ')}`);
2187
+ const what = r.kind === 'code' ? 'code review' : 'planning';
2188
+ console.log(`${r.id} → blocked: ${what} does not converge · ${r.stall.passes.join(', ')}`);
2099
2189
  });
2100
- registerStallAnswers(plan);
2190
+ registerStallAnswers(review);
2101
2191
  }
2102
2192
 
2103
- /** The operator's two answers to a planning stall (Hold-Plan d16). */
2104
- function registerStallAnswers(plan) {
2105
- plan
2193
+ /** The operator's two answers to a review stall (Hold-Plan d16, t2 d6); the kind is the stall's. */
2194
+ function registerStallAnswers(review) {
2195
+ review
2106
2196
  .command('more <id>')
2107
- .description("The operator's answer to a stall: N more passes, back to ready")
2197
+ .description("The operator's answer to a stall: N more passes on the last row, back to ready")
2108
2198
  .requiredOption('--passes <n>', 'how many more passes')
2199
+ .option('--kind <kind>', 'plan or code (default: the stall the card stands on)')
2109
2200
  .action(async (id, o) => {
2110
- await operatorOnly('plan more');
2201
+ await operatorOnly('review more');
2111
2202
  const r = await (
2112
2203
  await lib('work-ops')
2113
2204
  ).answerStall(process.cwd(), id, {
2114
2205
  more: Number(o.passes),
2206
+ kind: o.kind,
2115
2207
  });
2116
- console.log(`${r.id} → ready: ${r.stall.more} more pass(es) past plan_passes`);
2208
+ console.log(`${r.id} → ready: ${r.stall.more} more ${r.kind} pass(es) past the rows`);
2117
2209
  });
2118
- plan
2210
+ review
2119
2211
  .command('accept <id>')
2120
- .description("The operator's answer to a stall: implement the plan as it is, back to ready")
2121
- .action(async (id) => {
2122
- await operatorOnly('plan accept');
2123
- const r = await (await lib('work-ops')).answerStall(process.cwd(), id, { accept: true });
2124
- console.log(`${r.id} → ready: the plan goes to implementation as it is`);
2212
+ .description("The operator's answer to a stall: the plan or the code goes on as it is")
2213
+ .option('--kind <kind>', 'plan or code (default: the stall the card stands on)')
2214
+ .action(async (id, o) => {
2215
+ await operatorOnly('review accept');
2216
+ const r = await (
2217
+ await lib('work-ops')
2218
+ ).answerStall(process.cwd(), id, { accept: true, kind: o.kind });
2219
+ const goes = r.kind === 'code' ? 'the code goes on to its commit' : 'the plan goes on';
2220
+ console.log(`${r.id} → ready: ${goes} as it is`);
2125
2221
  });
2126
2222
  }
2127
2223
 
@@ -2222,6 +2318,11 @@ function registerSettings(gcf) {
2222
2318
  .join('\n'),
2223
2319
  );
2224
2320
  });
2321
+ registerConfigSet(config);
2322
+ registerPermissions(gcf);
2323
+ }
2324
+
2325
+ function registerConfigSet(config) {
2225
2326
  config
2226
2327
  .command('set [key]')
2227
2328
  .description(
@@ -2274,7 +2375,6 @@ function registerSettings(gcf) {
2274
2375
  : '';
2275
2376
  console.log(r.unchanged ? `${now} (unchanged)` : `${now}${shortHash(r.hash)}${note}`);
2276
2377
  });
2277
- registerPermissions(gcf);
2278
2378
  }
2279
2379
 
2280
2380
  /** `gcf permissions`: the deny groups and custom rules of agent runs. */
@@ -2378,6 +2478,7 @@ function registerHooksInstall(gcf) {
2378
2478
  // --git-path resolves the hooks dir for a plain repo, a worktree and a submodule alike,
2379
2479
  // where a bare existsSync('.git') passes on a worktree and then fails with ENOTDIR.
2380
2480
  const res = spawnSync('git', ['rev-parse', '--git-path', 'hooks'], {
2481
+ windowsHide: true,
2381
2482
  cwd: process.cwd(),
2382
2483
  encoding: 'utf8',
2383
2484
  });
@@ -2496,6 +2597,7 @@ export function register(program) {
2496
2597
  registerLessons(gcf);
2497
2598
  registerLive(gcf);
2498
2599
  registerPlan(gcf);
2600
+ registerReview(gcf);
2499
2601
  registerVerify(gcf);
2500
2602
  registerIntegrate(gcf);
2501
2603
  registerBoard(gcf);
package/extension.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/lee-to/ai-factory/2.x/schemas/extension.schema.json",
3
3
  "name": "gcf-aif-ext",
4
- "version": "0.29.1",
4
+ "version": "0.31.0",
5
5
  "description": "Game Context Framework for AI Factory",
6
6
  "skills": [
7
7
  "skills/gcf-init",
@@ -24,6 +24,7 @@ const fail = (msg) => {
24
24
  function git(args) {
25
25
  // quotePath off: a non-ASCII path in the refusal reads as itself, not as octal escapes.
26
26
  const res = spawnSync('git', ['-c', 'core.quotePath=false', ...args], {
27
+ windowsHide: true,
27
28
  cwd: projectDir,
28
29
  encoding: 'utf8',
29
30
  });
@@ -74,6 +75,7 @@ if (problems.length) fail(problems[0]);
74
75
  await writeIndex(root);
75
76
  // An unstaged INDEX (gitignored, locked index) would leave the commit without the row it validated.
76
77
  const added = spawnSync('git', ['add', '--', path.join(root, 'INDEX.md')], {
78
+ windowsHide: true,
77
79
  cwd: projectDir,
78
80
  stdio: 'ignore',
79
81
  });
@@ -7,10 +7,10 @@
7
7
  import { readFile } from 'node:fs/promises';
8
8
  import { existsSync } from 'node:fs';
9
9
  import path from 'node:path';
10
- import { commitMove } from './unit-ops.js';
10
+ import { commitMove } from './commit-move.js';
11
11
  import { atomicWrite } from './safe-path.js';
12
12
  import { gcfRoot, RUN_WORD } from './gcf-paths.js';
13
- import { configDoc, ensureMap } from './config-set.js';
13
+ import { configDoc, ensureMap } from './config-doc.js';
14
14
 
15
15
  const GROUPS_SHAPE = 'gcf/config.yml: agent.groups must map a group id to true or false';
16
16
 
@@ -94,7 +94,10 @@ function claudePath(pattern) {
94
94
  return pattern.startsWith('/') && !pattern.startsWith('//') ? `/${pattern}` : pattern;
95
95
  }
96
96
 
97
- /** A rule as the operator reads it: `shell: git push --force*`. */
97
+ /**
98
+ * A rule as the operator reads it: `shell: git push --force*`.
99
+ * @public gcf.js imports lib modules by name at run time, out of knip's sight.
100
+ */
98
101
  export const ruleText = (r) => `${r.kind}: ${r.pattern}`;
99
102
 
100
103
  const sameRule = (a, b) => a?.kind === b?.kind && a?.pattern === b?.pattern;
@@ -187,9 +190,9 @@ export const DENY_GROUPS = [
187
190
  'ai-factory gcf verdict*',
188
191
  'ai-factory gcf question answer*',
189
192
  'ai-factory gcf unblock*',
190
- // The operator's answers to planning that does not converge (Hold-Plan d16).
191
- 'ai-factory gcf plan more*',
192
- 'ai-factory gcf plan accept*',
193
+ // The operator's answers to a review that does not converge (Hold-Plan d16, t2 d3).
194
+ 'ai-factory gcf review more*',
195
+ 'ai-factory gcf review accept*',
193
196
  'ai-factory gcf item gates*',
194
197
  'ai-factory gcf item amend*',
195
198
  'ai-factory gcf phase next*',
@@ -211,6 +214,8 @@ export const DENY_GROUPS = [
211
214
  'ai-factory gcf-harness stop*',
212
215
  // The operator's Hold of an item or the project (Hold-Plan d6): an agent holds nothing.
213
216
  'ai-factory gcf-harness hold*',
217
+ // Only the operator knows the limit was reset early; the wake lets the reserve go (t1 d1).
218
+ 'ai-factory gcf-harness wake*',
214
219
  // The operator's chat input: an agent answering its own question would be no answer.
215
220
  'ai-factory gcf-harness chat*',
216
221
  'ai-factory extension*',
package/lib/audit-core.js CHANGED
@@ -2,7 +2,15 @@ import { readFile } from 'node:fs/promises';
2
2
  import { existsSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { spawnSync } from 'node:child_process';
5
- import { listItems, listSystems, readConfig, tokensEst, legacyCards } from './gcf-paths.js';
5
+ import {
6
+ listItems,
7
+ listSystems,
8
+ readConfig,
9
+ readRawConfig,
10
+ reviewMigration,
11
+ tokensEst,
12
+ legacyCards,
13
+ } from './gcf-paths.js';
6
14
  import { lint } from './linter.js';
7
15
  import { drifted } from './index-gen.js';
8
16
  import { designCheck, gameMilestones, recordsIn } from './design-check.js';
@@ -23,7 +31,12 @@ import { platformsOf } from './playtest-list.js';
23
31
 
24
32
  function git(args, cwd) {
25
33
  // A blame of a long file overflows the 1 MiB default, and an overflow reads as a git failure.
26
- const res = spawnSync('git', args, { cwd, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
34
+ const res = spawnSync('git', args, {
35
+ windowsHide: true,
36
+ cwd,
37
+ encoding: 'utf8',
38
+ maxBuffer: 64 * 1024 * 1024,
39
+ });
27
40
 
28
41
  return res.status === 0 ? res.stdout.trim() : null;
29
42
  }
@@ -80,6 +93,7 @@ function runningOf(projectDir, id) {
80
93
  * @property {{legacy: boolean, bad_names: string[], untitled: string[], broken_links: string[],
81
94
  * orphan_dirs: string[], unmigrated: string[], unknown_category: string[],
82
95
  * unsorted: string[]}} inbox
96
+ * @property {string | null} [review_migration]
83
97
  */
84
98
 
85
99
  /**
@@ -126,10 +140,33 @@ export async function audit(projectDir) {
126
140
  stale_questions: staleQuestions(projectDir, root, config),
127
141
  inbox: await inboxProblems(root, inboxVocabulary()),
128
142
  play_on: playOnIssues(items, config, await platformsOf(root)),
143
+ // A config from before the review rows (Operator-Tasks-Plan t2 d1): the command that moves it.
144
+ review_migration: reviewMigration(await readRawConfig(root)),
129
145
  };
130
146
  // The harness gate reads everything from this one report — it never parses gcf/ itself.
131
147
  Object.assign(report, { schema: config.schema, gates: config.gates });
132
- report.items = items.map((c) => ({
148
+ report.items = items.map((c) => itemRow(projectDir, config, c));
149
+ // The card whose unfinished work lies in the folder (lib/shelf.js): the next claim shelves it.
150
+ const work = mainWork(projectDir);
151
+ if (work) report.main_work = work;
152
+ const design = await designCheck(projectDir);
153
+ checkItems(report, items, config, { projectDir, ledger });
154
+ report.design = {
155
+ blocking: design.blocking,
156
+ units: design.units.length,
157
+ ready: design.units.filter((u) => u.ready).length,
158
+ };
159
+ // Where each milestone stands, and what the autopilot builds and stops to play (Plan, D).
160
+ Object.assign(report, await milestoneState(projectDir, ledger, design.units));
161
+ lintSystems(report, systems);
162
+ report.first_line = firstLine(report);
163
+
164
+ return report;
165
+ }
166
+
167
+ /** An item as the report lists it for the harness gate. */
168
+ function itemRow(projectDir, config, c) {
169
+ return {
133
170
  id: c.data.id,
134
171
  type: c.data.type,
135
172
  gate: c.data.gate,
@@ -147,23 +184,7 @@ export async function audit(projectDir) {
147
184
  gates: gatePolicy(config, c.data),
148
185
  deferred: verdictDeferred(config, c.data),
149
186
  ...runningOf(projectDir, String(c.data.id)),
150
- }));
151
- // The card whose unfinished work lies in the folder (lib/shelf.js): the next claim shelves it.
152
- const work = mainWork(projectDir);
153
- if (work) report.main_work = work;
154
- const design = await designCheck(projectDir);
155
- checkItems(report, items, config, { projectDir, ledger });
156
- report.design = {
157
- blocking: design.blocking,
158
- units: design.units.length,
159
- ready: design.units.filter((u) => u.ready).length,
160
187
  };
161
- // Where each milestone stands, and what the autopilot builds and stops to play (Plan, D).
162
- Object.assign(report, await milestoneState(projectDir, ledger, design.units));
163
- lintSystems(report, systems);
164
- report.first_line = firstLine(report);
165
-
166
- return report;
167
188
  }
168
189
 
169
190
  /**
@@ -398,6 +419,9 @@ const docAlerts = (report) => [
398
419
  Object.keys(report.linter).length && 'П2 linter findings in systems docs',
399
420
  report.index_drift && 'INDEX drift (regenerate)',
400
421
  report.design?.blocking && `${report.design.blocking} blocking design finding(s)`,
422
+ report.review_migration &&
423
+ `plan_passes and plan_review: are gone, review.plan holds the passes: ` +
424
+ report.review_migration,
401
425
  ...playOnAlerts(report.play_on),
402
426
  ...inboxAlerts(report.inbox),
403
427
  ];