gcf-aif-ext 0.29.2 → 0.32.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/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
@@ -50,6 +50,15 @@ Updating preserves `gcf/`, `cnlp.config.json` and the pre-commit hook. Run `ai-f
50
50
 
51
51
  On Windows, run `extension add` and `extension update` from PowerShell or cmd, not Git Bash: the installer unpacks with `tar`, and Git Bash's GNU tar reads `C:\…` as a remote host (`Cannot connect to C: resolve failed`). The Windows `tar.exe` handles it.
52
52
 
53
+ ### 0.32.0
54
+
55
+ Update together with gcf-board 0.32.0 (`gcf board --json` is `schema: 6`; each refuses the other's old schema) and gcf-harness-aif-ext 0.31.0 ([Fallback-Fidelity-Plan](https://github.com/VirtualMaestro/GCF/blob/main/docs/Fallback-Fidelity-Plan.md)). Then run `ai-factory gcf init`: the `AGENTS.md` block changed.
56
+
57
+ - **`run_mode` is `main` by default.** To keep parallel runs in worktrees, set `run_mode: worktree` in `gcf/config.yml` (or Settings). An item whose worktree copy or `work/<id>` branch still lives runs in `worktree` until the copy closes, whatever the default; a kept session resumes where it ran. `gcf audit` says `run_mode is main by default now; set worktree to keep parallel runs` while `run_mode` is unset and worktree copies live. The board read gives each card `runs_in`: its own `run_mode`, else its kept session's place, else `worktree` while its copy lives, else the project's.
58
+ - **Review defaults:** `review.plan` is `codex:astra:medium`, `claude:fable:medium`, `claude:fable:medium`; `review.code` is `codex:sol:high`, `claude:opus:high`. Lists already in `gcf/config.yml` stay as they are.
59
+ - **Stand-ins:** a review row that cannot make its pass gives way to the next of its stand-ins: a Codex `medium` row to `claude:fable:medium`, then `claude:opus:high`; a Codex `high` row to `claude:opus:high`; `claude:fable:medium` to `claude:opus:high`; any other row has none. After the last one, the session's own model makes the pass. `gcf review row --json` gives the row's `fallback`; the board read carries the table as `review_fallback`.
60
+ - **`gcf plan pass --for <row>`:** a pass made by a stand-in or by the session records the row it stands for (`, for agent:model:effort` in the pass line); the verdict counts the same. An older board loses the Passes fold on such a line: update it together.
61
+
53
62
  ### 0.27.0
54
63
 
55
64
  - **`gcf changes push` and `gcf changes pull`** ([Push-Plan](https://github.com/VirtualMaestro/GCF/blob/main/docs/Push-Plan.md)): the board's Push and Pull. Push sends the main checkout's branch to its upstream, fast-forward only: no `+`, no `--force`, no `--no-verify`, and no flag that adds one. With no upstream it pushes to `origin`, or the only remote, with `-u`; `--remote <name>` picks another. Pull is `fetch` and `merge --ff-only` of the same target: a branch with commits of its own over the remote's is refused as `diverged`, main untouched, and the merge is the agent's (`git pull --no-rebase`). Pull claims the checkout as a build by click does: no run starts meanwhile.
@@ -200,6 +209,7 @@ The functional base, part A (docs/Base-A-Plan.md). Update together with gcf-harn
200
209
 
201
210
  - `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
211
  - `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`.
212
+ - `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
213
  - `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
214
 
205
215
  ### 0.13.0
@@ -306,7 +316,7 @@ Update together with gcf-harness-aif-ext 0.12.0 and gcf-board 0.6.0 (docs/Sessio
306
316
  - `ai-factory gcf question answer <q-id> --text="<answer>"` writes the human's answer into its record of `gcf/open-questions.md` and commits. An answered D1 no longer blocks its units; the next agent on the unit puts the answer into its slot (`answer: q-NNN`) and removes the record. `gcf board --json` questions carry `question`, `proposed`, `blocks` and `answer`.
307
317
  - `ai-factory gcf claim <id>` / `release <id>`: an agent session working an item in the main checkout marks it running. The session's own `context`, `plan check` and `verify` on the item keep the mark fresh (so do a harness run on main and its readset-guard hook), a move on the item clears it, and 2 hours without either expire it. The board and the audit read it as `running`, so a harness run does not take the item, and the core refuses any move on it but the session's own (`submit`, `close`, `block` with `--claimed`). The mark names its owner (`GCF_RUN_OWNER` of a harness run, else `CLAUDE_CODE_SESSION_ID`): another owner's claim and `--claimed` moves are refused while it is fresh.
308
318
  - `prioritize` leaves the rank of a ready item it does not name (a running one): the named items take the free ranks around it.
309
- - `run_mode: worktree | main` in `gcf/config.yml` (Methodology §7): a project whose agent works through an editor bound to the project folder sets `main`. `gcf board --json` carries it.
319
+ - `run_mode: main | worktree` in `gcf/config.yml` (Methodology §7): `main` by default (one card at a time in the project folder); set `worktree` to keep parallel runs, each in its own copy. A card the harness keeps a session record of (`.gcf-session/runs/<id>.agent.json` `mode`) runs where that session ran, and one whose worktree copy or `work/<id>` branch lives runs in `worktree` until it is closed, whatever the default (its own `run_mode` comes first); `gcf audit` names a project that leaves `run_mode` unset while such copies live. `gcf board --json` carries the project's mode and each item's `runs_in`.
310
320
  - `/gcf-card` cuts several items along subsystem boundaries, marks two items of one subsystem that change different files `parallel: ok`, ranks them with `prioritize`, and keeps `depends` for real needs only.
311
321
 
312
322
  ### 0.6.0
@@ -426,7 +436,7 @@ Every move of an item makes one commit `gcf(<move>): <id>` with every file it to
426
436
  **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
437
 
428
438
 
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>`.
439
+ 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 Codex astra·medium and fable·medium ×2 for the plan, Codex sol·high and opus·high for the code); row k makes pass k, the next only while the last found something blocking. A row that cannot make its pass gives way to a model of its size (Fallback-Fidelity-Plan d2): Codex medium to fable·medium then opus·high, Codex high and fable·medium to opus·high, any other to none; `gcf board --json` carries the rules as `review_fallback`. `gcf review row <id> --kind plan|code --pass k [--diff] --json` names the row and its `fallback` (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 [--for agent:model:effort]] [--kind code]` records each pass (`, for` the row, when someone else made it: `self` or a stand-in) 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
440
 
431
441
  ## Docs
432
442
 
package/commands/gcf.js CHANGED
@@ -1541,7 +1541,11 @@ function registerAgent(item) {
1541
1541
  .description(
1542
1542
  "Set where an item's runs go: main or worktree over the project's run_mode (commit)",
1543
1543
  )
1544
- .requiredOption('--run <mode>', "main, worktree, or default: the project's run_mode")
1544
+ .requiredOption(
1545
+ '--run <mode>',
1546
+ 'main, worktree, or default: where its kept session ran, else its live worktree copy, ' +
1547
+ "else the project's run_mode",
1548
+ )
1545
1549
  .option('--no-commit', 'skip the commit (tests only)')
1546
1550
  .action(async (id, o) => {
1547
1551
  const r = await (
@@ -2119,7 +2123,12 @@ function registerPlanPasses(plan) {
2119
2123
  )
2120
2124
  .requiredOption('--blocking <n>', 'findings that block the plan')
2121
2125
  .requiredOption('--polish <n>', 'findings that only polish it')
2122
- .option('--by <reviewer>', 'the pass was made by another reviewer (codex)')
2126
+ .option('--by <reviewer>', 'who made the pass: agent:model:effort (gcf review row), or self')
2127
+ .option(
2128
+ '--for <row>',
2129
+ 'the row the pass was asked of (agent:model:effort) when --by stood in for it',
2130
+ )
2131
+ .option('--kind <kind>', 'plan (## Passes) or code (## Reviews)', 'plan')
2123
2132
  .option('--json', 'machine output')
2124
2133
  .action(async (id, o) => {
2125
2134
  await touchSession(id);
@@ -2129,51 +2138,98 @@ function registerPlanPasses(plan) {
2129
2138
  blocking: Number(o.blocking),
2130
2139
  polish: Number(o.polish),
2131
2140
  by: o.by,
2141
+ for: o.for,
2142
+ kind: o.kind,
2132
2143
  });
2133
2144
  out(o.json, r, (x) => `pass ${x.pass}: ${x.verdict} (${x.passes.join(', ')})`);
2134
2145
  });
2135
- plan
2146
+ }
2147
+
2148
+ /**
2149
+ * The review passes of a plan and of the code (Operator-Tasks-Plan t2): who makes pass k, and the
2150
+ * stop when the rows are over with a blocking finding open, which blocks the card for the
2151
+ * operator's more or accept.
2152
+ */
2153
+ function registerReview(gcf) {
2154
+ const review = gcf.command('review').description('The review passes of a work item');
2155
+ review
2156
+ .command('row <id>')
2157
+ .description(
2158
+ 'Who makes pass k of the plan or code review (review.plan|code of gcf/config.yml; past ' +
2159
+ 'the rows, the last); --diff writes the code diff the reviewer reads',
2160
+ )
2161
+ .requiredOption('--kind <kind>', 'plan or code')
2162
+ .requiredOption('--pass <k>', 'the pass number, 1 or more')
2163
+ .option('--diff', 'code: write .gcf-session/review/<id>.diff and name it')
2164
+ .option('--json', 'machine output')
2165
+ .action(async (id, o) => {
2166
+ await touchSession(id);
2167
+ const r = await (
2168
+ await lib('review')
2169
+ ).reviewRow(process.cwd(), id, { kind: o.kind, pass: Number(o.pass), diff: o.diff });
2170
+ out(o.json, r, (x) =>
2171
+ [
2172
+ `pass ${x.pass}: ${x.by ?? 'no review'}`,
2173
+ ...(x.fallback.length
2174
+ ? [`fallback: ${x.fallback.map((f) => `${f.agent}:${f.model}:${f.effort}`).join(', ')}`]
2175
+ : []),
2176
+ ...(x.diff ? [`diff: ${x.diff.file}`] : []),
2177
+ ].join('\n'),
2178
+ );
2179
+ });
2180
+ review
2136
2181
  .command('stall <id>')
2137
2182
  .description(
2138
- 'Planning does not converge: block the card with its passes (commit gcf(plan_stall))',
2183
+ 'The review does not converge: block the card with its passes (commit gcf(plan_stall))',
2139
2184
  )
2140
2185
  .requiredOption('--passes <list>', 'the blocking findings of each pass, comma-separated')
2186
+ .option('--kind <kind>', 'plan or code', 'plan')
2141
2187
  .option('--reason <text>', 'what keeps it from converging')
2188
+ .option('--base <commit>', "code: the commit the card's work started from")
2142
2189
  .action(async (id, o) => {
2143
2190
  const passes = splitList(o.passes).map(Number);
2144
2191
  const r = await (
2145
2192
  await lib('work-ops')
2146
2193
  ).stallItem(process.cwd(), id, {
2147
2194
  passes,
2195
+ kind: o.kind,
2148
2196
  reason: o.reason,
2197
+ base: o.base,
2149
2198
  });
2150
- console.log(`${r.id} → blocked: planning does not converge · ${r.stall.passes.join(', ')}`);
2199
+ const what = r.kind === 'code' ? 'code review' : 'planning';
2200
+ console.log(`${r.id} → blocked: ${what} does not converge · ${r.stall.passes.join(', ')}`);
2151
2201
  });
2152
- registerStallAnswers(plan);
2202
+ registerStallAnswers(review);
2153
2203
  }
2154
2204
 
2155
- /** The operator's two answers to a planning stall (Hold-Plan d16). */
2156
- function registerStallAnswers(plan) {
2157
- plan
2205
+ /** The operator's two answers to a review stall (Hold-Plan d16, t2 d6); the kind is the stall's. */
2206
+ function registerStallAnswers(review) {
2207
+ review
2158
2208
  .command('more <id>')
2159
- .description("The operator's answer to a stall: N more passes, back to ready")
2209
+ .description("The operator's answer to a stall: N more passes on the last row, back to ready")
2160
2210
  .requiredOption('--passes <n>', 'how many more passes')
2211
+ .option('--kind <kind>', 'plan or code (default: the stall the card stands on)')
2161
2212
  .action(async (id, o) => {
2162
- await operatorOnly('plan more');
2213
+ await operatorOnly('review more');
2163
2214
  const r = await (
2164
2215
  await lib('work-ops')
2165
2216
  ).answerStall(process.cwd(), id, {
2166
2217
  more: Number(o.passes),
2218
+ kind: o.kind,
2167
2219
  });
2168
- console.log(`${r.id} → ready: ${r.stall.more} more pass(es) past plan_passes`);
2220
+ console.log(`${r.id} → ready: ${r.stall.more} more ${r.kind} pass(es) past the rows`);
2169
2221
  });
2170
- plan
2222
+ review
2171
2223
  .command('accept <id>')
2172
- .description("The operator's answer to a stall: implement the plan as it is, back to ready")
2173
- .action(async (id) => {
2174
- await operatorOnly('plan accept');
2175
- const r = await (await lib('work-ops')).answerStall(process.cwd(), id, { accept: true });
2176
- console.log(`${r.id} → ready: the plan goes to implementation as it is`);
2224
+ .description("The operator's answer to a stall: the plan or the code goes on as it is")
2225
+ .option('--kind <kind>', 'plan or code (default: the stall the card stands on)')
2226
+ .action(async (id, o) => {
2227
+ await operatorOnly('review accept');
2228
+ const r = await (
2229
+ await lib('work-ops')
2230
+ ).answerStall(process.cwd(), id, { accept: true, kind: o.kind });
2231
+ const goes = r.kind === 'code' ? 'the code goes on to its commit' : 'the plan goes on';
2232
+ console.log(`${r.id} → ready: ${goes} as it is`);
2177
2233
  });
2178
2234
  }
2179
2235
 
@@ -2553,6 +2609,7 @@ export function register(program) {
2553
2609
  registerLessons(gcf);
2554
2610
  registerLive(gcf);
2555
2611
  registerPlan(gcf);
2612
+ registerReview(gcf);
2556
2613
  registerVerify(gcf);
2557
2614
  registerIntegrate(gcf);
2558
2615
  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.2",
4
+ "version": "0.32.0",
5
5
  "description": "Game Context Framework for AI Factory",
6
6
  "skills": [
7
7
  "skills/gcf-init",
@@ -190,9 +190,9 @@ export const DENY_GROUPS = [
190
190
  'ai-factory gcf verdict*',
191
191
  'ai-factory gcf question answer*',
192
192
  'ai-factory gcf unblock*',
193
- // The operator's answers to planning that does not converge (Hold-Plan d16).
194
- 'ai-factory gcf plan more*',
195
- '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*',
196
196
  'ai-factory gcf item gates*',
197
197
  'ai-factory gcf item amend*',
198
198
  'ai-factory gcf phase next*',
@@ -214,6 +214,8 @@ export const DENY_GROUPS = [
214
214
  'ai-factory gcf-harness stop*',
215
215
  // The operator's Hold of an item or the project (Hold-Plan d6): an agent holds nothing.
216
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*',
217
219
  // The operator's chat input: an agent answering its own question would be no answer.
218
220
  'ai-factory gcf-harness chat*',
219
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';
@@ -18,6 +26,7 @@ import { inboxVocabulary } from './domain.js';
18
26
  import { gatePolicy, verdictDeferred } from './gates.js';
19
27
  import { milestoneState } from './milestone-state.js';
20
28
  import { mainWork } from './shelf.js';
29
+ import { cardRunMode, liveCopies } from './integrate.js';
21
30
  import { playOnIssues } from './play-on.js';
22
31
  import { platformsOf } from './playtest-list.js';
23
32
 
@@ -85,6 +94,8 @@ function runningOf(projectDir, id) {
85
94
  * @property {{legacy: boolean, bad_names: string[], untitled: string[], broken_links: string[],
86
95
  * orphan_dirs: string[], unmigrated: string[], unknown_category: string[],
87
96
  * unsorted: string[]}} inbox
97
+ * @property {string | null} [review_migration]
98
+ * @property {boolean} [run_mode_default] run_mode unset while worktree copies live
88
99
  */
89
100
 
90
101
  /**
@@ -95,6 +106,8 @@ function runningOf(projectDir, id) {
95
106
  export async function audit(projectDir) {
96
107
  const root = path.join(path.resolve(projectDir), 'gcf');
97
108
  const config = await readConfig(root);
109
+ const raw = await readRawConfig(root);
110
+ const live = liveCopies(projectDir);
98
111
  const items = await listItems(root);
99
112
  const systems = await listSystems(root);
100
113
  const ledger = await buildLedger(projectDir);
@@ -131,10 +144,14 @@ export async function audit(projectDir) {
131
144
  stale_questions: staleQuestions(projectDir, root, config),
132
145
  inbox: await inboxProblems(root, inboxVocabulary()),
133
146
  play_on: playOnIssues(items, config, await platformsOf(root)),
147
+ // A config from before the review rows (Operator-Tasks-Plan t2 d1): the command that moves it.
148
+ review_migration: reviewMigration(raw),
149
+ // run_mode unset while worktree copies live (Fallback-Fidelity-Plan d1): main by default now.
150
+ run_mode_default: (raw.run_mode ?? null) === null && live.size > 0,
134
151
  };
135
152
  // The harness gate reads everything from this one report — it never parses gcf/ itself.
136
153
  Object.assign(report, { schema: config.schema, gates: config.gates });
137
- report.items = items.map((c) => itemRow(projectDir, config, c));
154
+ report.items = items.map((c) => itemRow(projectDir, config, live, c));
138
155
  // The card whose unfinished work lies in the folder (lib/shelf.js): the next claim shelves it.
139
156
  const work = mainWork(projectDir);
140
157
  if (work) report.main_work = work;
@@ -154,7 +171,7 @@ export async function audit(projectDir) {
154
171
  }
155
172
 
156
173
  /** An item as the report lists it for the harness gate. */
157
- function itemRow(projectDir, config, c) {
174
+ function itemRow(projectDir, config, live, c) {
158
175
  return {
159
176
  id: c.data.id,
160
177
  type: c.data.type,
@@ -167,8 +184,13 @@ function itemRow(projectDir, config, c) {
167
184
  parallel: c.data.parallel ?? 'serial',
168
185
  priority: c.data.priority ?? null,
169
186
  milestone: c.data.milestone ?? null,
170
- // Where its run goes: its own run_mode, else the project's (an autopilot batches by it).
171
- run_mode: c.data.run_mode ?? config.run_mode,
187
+ // Where its run goes: its own run_mode, where its kept session ran, worktree while its copy
188
+ // lives, else the project's (an autopilot batches by it).
189
+ run_mode: cardRunMode(projectDir, String(c.data.id), {
190
+ own: c.data.run_mode,
191
+ project: config.run_mode,
192
+ live,
193
+ }),
172
194
  // The gates in force (docs/Autonomy-Plan.md, B); `deferred`: its submit closes unplayed.
173
195
  gates: gatePolicy(config, c.data),
174
196
  deferred: verdictDeferred(config, c.data),
@@ -408,10 +430,19 @@ const docAlerts = (report) => [
408
430
  Object.keys(report.linter).length && 'П2 linter findings in systems docs',
409
431
  report.index_drift && 'INDEX drift (regenerate)',
410
432
  report.design?.blocking && `${report.design.blocking} blocking design finding(s)`,
433
+ ...configAlerts(report),
411
434
  ...playOnAlerts(report.play_on),
412
435
  ...inboxAlerts(report.inbox),
413
436
  ];
414
437
 
438
+ /** Alerts about gcf/config.yml. @param {AuditReport} report */
439
+ const configAlerts = (report) => [
440
+ report.review_migration &&
441
+ `plan_passes and plan_review: are gone, review.plan holds the passes: ` +
442
+ report.review_migration,
443
+ report.run_mode_default && 'run_mode is main by default now; set worktree to keep parallel runs',
444
+ ];
445
+
415
446
  /** A card's play_on and played_on name builds (docs/Handoff-Plan.md d8). */
416
447
  const playOnAlerts = (p) => [
417
448
  p.errors.length && `${p.errors.length} play_on name(s) of no build`,
package/lib/board.js CHANGED
@@ -5,11 +5,11 @@ import { readFile } from 'node:fs/promises';
5
5
  import { existsSync } from 'node:fs';
6
6
  import path from 'node:path';
7
7
  import { buildLedger } from './ledger.js';
8
- import { readConfig } from './gcf-paths.js';
8
+ import { readConfig, REVIEW_FALLBACK } from './gcf-paths.js';
9
9
  import { readLive } from './live.js';
10
10
  import { filesUnder, listInbox } from './inbox.js';
11
11
  import { phaseStatus } from './phase.js';
12
- import { verifiedBranches, worktreeOf } from './integrate.js';
12
+ import { cardRunMode, liveCopies, verifiedBranches, worktreeOf } from './integrate.js';
13
13
  import { resolveInside } from './safe-path.js';
14
14
  import { wipOf } from './audit-core.js';
15
15
  import { MAIN_RUN, lockedItem, runHolder } from './main-lock.js';
@@ -32,7 +32,7 @@ import { handoffOf } from './handoff.js';
32
32
 
33
33
  // The version of the JSON below (Methodology §11): a board refuses one it does not know. Bump it
34
34
  // when a field changes meaning or goes away; a new field does not bump it.
35
- export const BOARD_SCHEMA = 5;
35
+ export const BOARD_SCHEMA = 6;
36
36
 
37
37
  /**
38
38
  * Plan progress `{tasks, done}` from its checkboxes and the plan's project path, both null
@@ -194,6 +194,12 @@ function logOf(projectDir, id) {
194
194
  * How the agent session of the item's last run ended, when the harness kept it for a rerun to
195
195
  * resume (`<id>.agent.json`): `{ended, resets?}`, or null. A file that is not a record is none.
196
196
  */
197
+ /** A kept record's reset, and whether the quota's reserve waits for it, not the limit (t1 d5). */
198
+ const resetsOf = (rec) =>
199
+ rec.resets
200
+ ? { resets: String(rec.resets), ...(rec.reserve === true ? { reserve: true } : {}) }
201
+ : {};
202
+
197
203
  async function resumeOf(projectDir, id) {
198
204
  try {
199
205
  const file = path.join(projectDir, '.gcf-session', 'runs', `${id}.agent.json`);
@@ -205,7 +211,7 @@ async function resumeOf(projectDir, id) {
205
211
 
206
212
  return {
207
213
  ended: String(rec.ended ?? ''),
208
- ...(rec.resets ? { resets: String(rec.resets) } : {}),
214
+ ...resetsOf(rec),
209
215
  ...(rec.handoffs ? { handoffs: Number(rec.handoffs) } : {}),
210
216
  };
211
217
  } catch {
@@ -329,7 +335,7 @@ async function handoffPart(projectDir, id, read) {
329
335
  return handoff ? { handoff } : {};
330
336
  }
331
337
 
332
- async function itemOf(projectDir, c, { verified, shelved, ledger, harness, config, links }) {
338
+ async function itemOf(projectDir, c, { verified, shelved, live, ledger, harness, config, links }) {
333
339
  const builds = itemBuilds(projectDir, String(c.data.id), c.data.status, links);
334
340
  const id = String(c.data.id);
335
341
  // A trailer counts only while the item waits on main for its integrate.
@@ -363,6 +369,13 @@ async function itemOf(projectDir, c, { verified, shelved, ledger, harness, confi
363
369
  running_kind: kind,
364
370
  resumable,
365
371
  resume,
372
+ // Where a run that asks no mode takes it (Fallback-Fidelity-Plan d1): its own, where its kept
373
+ // session ran, worktree while its copy lives, the project's.
374
+ runs_in: cardRunMode(projectDir, id, {
375
+ own: c.data.run_mode,
376
+ project: config.run_mode,
377
+ live,
378
+ }),
366
379
  verified: ready,
367
380
  // Its unfinished work waits on its branch (lib/shelf.js); a run brings it back.
368
381
  ...(shelved.has(id) ? { shelved: shelved.get(id) } : {}),
@@ -392,9 +405,12 @@ async function itemsOf(projectDir, { ledger, harness, config }) {
392
405
  const verified = verifiedOf(projectDir);
393
406
  const shelved = shelvedCards(projectDir);
394
407
  const links = linksOf(projectDir);
408
+ const live = liveCopies(projectDir);
395
409
  const items = [];
396
410
  for (const c of ledger.items)
397
- items.push(await itemOf(projectDir, c, { verified, shelved, ledger, harness, config, links }));
411
+ items.push(
412
+ await itemOf(projectDir, c, { verified, shelved, live, ledger, harness, config, links }),
413
+ );
398
414
  inRunOrder(items);
399
415
  // When the wait began: the time of the commit `since` names (Board-PRD §13).
400
416
  const times = commitTimes(
@@ -446,8 +462,10 @@ export async function board(projectDir) {
446
462
  },
447
463
  // A run's chat with the operator (`chat:` in config.yml): what it asks, how long it waits.
448
464
  chat: config.chat,
449
- // The plan's outside reviewer (`plan_review:`, Hold-Plan d17): null when not set.
450
- plan_review: config.plan_review ?? null,
465
+ // The review passes of the plan and the code (Operator-Tasks-Plan t2): the rows that hold.
466
+ review: config.review,
467
+ // Who makes a pass its row cannot make (Fallback-Fidelity-Plan d2): the rules, as data.
468
+ review_fallback: REVIEW_FALLBACK,
451
469
  // How the game is played: the project's targets and the running player; null when not set up.
452
470
  play: playFacts(projectDir, config),
453
471
  phase: await phaseOf(projectDir),
package/lib/changes.js CHANGED
@@ -552,7 +552,7 @@ async function rowOf(projectDir, p, worktree) {
552
552
  const said = (d) => /^(?!diff --git |index ).+/m.test(d);
553
553
 
554
554
  /** `text` by the limits; `overrun`: git's pipe was cut, or the file longer than was read. */
555
- function cutOf(text, overrun = false) {
555
+ export function cutOf(text, overrun = false) {
556
556
  const clean = text.replace(/\r$/gm, '');
557
557
  const lines = clean.split('\n');
558
558
  const total = lines.at(-1) === '' ? lines.length - 1 : lines.length;