gcf-harness-aif-ext 0.16.1 → 0.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -47,6 +47,10 @@ Updating keeps the hook entry valid — it points into the extension's install d
47
47
 
48
48
  0.5.1 is a fix release. During a run, `gcf/config.yml` is always readable, and a Grep inside `gcf/` reads only readset files. An import breaks a `depends:` cycle the pair checks closed and asks a D1 about it. It cuts a section longer than a segment at paragraphs, and lens and pair prompts carry a window around the quote. `/gcf-run` checks the plan against each pillar's invariant and asks each pillar's review question over the diff. Use it with core 0.4.1, which brings the parent feature into the readset.
49
49
 
50
+ 0.18.1 runs an item with no model or effort of its own and none in the project on the agent's default, Opus / High (bundled gcf-session 0.17.0, Board-PRD decision 36); `run-log.csv` records the model and effort that ran.
51
+
52
+ 0.18.0 needs gcf-aif-ext 0.18.0 (docs/Round6-Functional-Plan.md): `/gcf-run` files its inbox entries with a category (`inbox add --category <c>`), as the core now asks of an agent; the bundled session engine offers `fable` among claude's model presets. After the update run `ai-factory gcf inbox migrate` once: it writes the entries from before the categories in one commit.
53
+
50
54
  0.16.1 needs gcf-aif-ext 0.16.1: an older core would merge a worktree branch under a main run's agent (Board-PRD decision 28). Without `--mode` each item runs where its own `run_mode` says, else the project's; a batch of both is two parts at once under one gate, one report (`mode: main+worktree`, in the order the items came). A main run's own sessions still run `gcf integrate` at their start, as before. A main run names the items it has yet to reach in `.gcf-session/runs/.main-run.queue`, and the gate counts them as running, so a worktree run beside it cannot take them. While a main run holds the checkout, core 0.16 merges nothing: a worktree item whose branch is green reads `verified` ("its branch merges when that run ends"), and the main run merges it as it ends (its `orphans`).
51
55
 
52
56
  0.15.0 works with gcf-aif-ext 0.14.0 or 0.15.0. A run on main refreshes and, at the end, clears its item's session mark only while the mark is its own (`GCF_RUN_OWNER`) or names nobody: a mark another session claimed after a `gcf release` by hand stays that session's.
@@ -55,7 +59,7 @@ Updating keeps the hook entry valid — it points into the extension's install d
55
59
 
56
60
  0.13.0 keeps its past runs for the board (docs/Board-V2-Data-Plan.md) and needs gcf-aif-ext 0.13.0 for the moves' `GCF-By`. `run-log.csv` lines get six columns at their end (`run_id, started, model, effort, log_from, log_to`; older lines still read); `ai-factory gcf-harness runs [--item <id>] [--limit <n>] --json` lists the runs; `run --model <m> --effort <e>` runs every item on another model for that run only, the item unchanged; a run sets `GCF_MOVE_BY=run` for its core calls and its agents.
57
61
 
58
- 0.12.2 reads an item as it starts it: in a main-mode batch, an item the run has yet to reach takes a model or effort set meanwhile (`ai-factory gcf item agent`, core 0.12.3; a worktree run locks its items first). A stored `default` gives no `--model` or `--effort` flag.
62
+ 0.12.2 reads an item as it starts it: in a main-mode batch, an item the run has yet to reach takes a model or effort set meanwhile (`ai-factory gcf item agent`, core 0.12.3; a worktree run locks its items first). A stored `default` takes the project's setting, else the agent's default (claude: `opus`, `high`; Board-PRD decision 36).
59
63
 
60
64
  0.12.0 moves the session mechanics into the bundled session engine `gcf-session` (docs/Session-Engine.md) and needs gcf-aif-ext 0.12.0: a core without neutral rules (`agent.rules`) is refused before any item is claimed. The hooks keep their files and matchers: no new `init` is needed.
61
65
  - **The usage limit waits.** A session cut by the limit with a known reset waits for it (plus 60 s) and goes on in the same session. Before the wait its record is written (`<id>.agent.json`, `ended: limit`, `resets` as ISO), so a run killed meanwhile resumes the same session; the chat gets `limit {until}`; the wait does not count against `--timeout`; `gcf-harness stop` ends it. It does not wait for the week's limit, an unknown reset, a reset over 6 h away, an item's third limit in a run, or a lessons turn: those end `paused` as before. `--wait-limit` (a queued start from the board) also holds each session while a known reset is ahead. `--json` says `limit_wait: true`.
package/commands/run.js CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  chatOut,
24
24
  claim,
25
25
  clock,
26
+ defaultsOf,
26
27
  killTree,
27
28
  permissions,
28
29
  postTo,
@@ -128,20 +129,22 @@ const RUN_WORD = /^[A-Za-z0-9][\w.-]*$/;
128
129
  /**
129
130
  * What one item runs on: the run's override (`run --model|--effort`, this run only) over the
130
131
  * item's own `model:` and `effort:`, over the project's (`agent.model|effort` of
131
- * gcf/config.yml); null or `default` at one level falls to the next, none at all leaves it to
132
- * the agent. The values go into a
132
+ * gcf/config.yml), over the agent's `defaults` (gcf-session `defaultsOf`, claude's Opus and High,
133
+ * Board-PRD decision 36); null or `default` at one level falls to the next. The values go into a
133
134
  * shell command, and an item file can be edited by hand: a value that is not one plain word is
134
135
  * refused.
135
136
  * @param {any} item
136
137
  * @param {{model?: string | null, effort?: string | null}} [override]
137
138
  * @param {{model?: string | null, effort?: string | null}} [project]
139
+ * @param {{model?: string | null, effort?: string | null}} [defaults]
138
140
  */
139
- export function choiceOf(item, override = {}, project = {}) {
141
+ export function choiceOf(item, override = {}, project = {}, defaults = {}) {
140
142
  const set = (v) => (v === null || v === undefined || v === 'default' ? null : String(v));
141
143
  /** @type {{model: string | null, effort: string | null}} */
142
144
  const out = { model: null, effort: null };
143
145
  for (const k of /** @type {const} */ (['model', 'effort'])) {
144
- const v = set(override?.[k]) ?? set(item?.[k]) ?? set(project?.[k]);
146
+ const v =
147
+ [override, item, project, defaults].map((l) => set(l?.[k])).find((x) => x !== null) ?? null;
145
148
  if (v !== null && !RUN_WORD.test(v)) throw new Error(`${k}: ${v} is not one plain word`);
146
149
  out[k] = v;
147
150
  }
@@ -158,7 +161,7 @@ export function choiceOf(item, override = {}, project = {}) {
158
161
  * @param {{model?: string | null, effort?: string | null}} [project]
159
162
  */
160
163
  export function agentFor(agent, item, override = {}, project = {}) {
161
- const flags = Object.entries(choiceOf(item, override, project))
164
+ const flags = Object.entries(choiceOf(item, override, project, defaultsOf(agent)))
162
165
  .filter(([, v]) => v !== null)
163
166
  .map(([k, v]) => `--${k} ${v}`);
164
167
 
@@ -1199,7 +1202,7 @@ function commandsOf(core, agent, board, override) {
1199
1202
 
1200
1203
  return {
1201
1204
  agent: agentFor(agent, item, override, b.agent),
1202
- choice: choiceOf(item, override, b.agent),
1205
+ choice: choiceOf(item, override, b.agent, defaultsOf(agent)),
1203
1206
  };
1204
1207
  };
1205
1208
  const agentOf = async (id) => {
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-harness-aif-ext",
4
- "version": "0.16.1",
4
+ "version": "0.18.2",
5
5
  "description": "GCF orchestration harness for Claude Code: one-command card pipeline, readset guard",
6
6
  "skills": [
7
7
  "skills/gcf-run",
@@ -15,6 +15,20 @@ export const clock = (now = new Date()) => now.toTimeString().slice(0, 8);
15
15
 
16
16
  const cut = (text, max) => (text.length > max ? `${text.slice(0, max - 1)}…` : text);
17
17
 
18
+ /**
19
+ * A text whole on one line: the board cuts what it shows (Tails 2026-10-25, the log cut it as
20
+ * it wrote). A failing test run's output is tens of kilobytes: past `LOG_MAX` it says how much
21
+ * more there was.
22
+ */
23
+ const whole = (text) => {
24
+ const line = firstLines(text, Infinity);
25
+
26
+ return line.length > LOG_MAX
27
+ ? `${line.slice(0, LOG_MAX)}… (${line.length - LOG_MAX} more characters)`
28
+ : line;
29
+ };
30
+ const LOG_MAX = 8000;
31
+
18
32
  /** The first `n` non-empty lines of a text, trimmed, on one line. */
19
33
  const firstLines = (text, n) =>
20
34
  String(text)
@@ -30,7 +44,7 @@ const TELLING = ['file_path', 'command', 'pattern', 'url', 'description'];
30
44
  function toolLine(use) {
31
45
  const key = TELLING.find((k) => typeof use.input?.[k] === 'string');
32
46
 
33
- return key ? `tool: ${use.name} ${cut(firstLines(use.input[key], 1), 120)}` : `tool: ${use.name}`;
47
+ return key ? `tool: ${use.name} ${whole(use.input[key])}` : `tool: ${use.name}`;
34
48
  }
35
49
 
36
50
  /** A tool result's text: a string, or a list of text blocks. */
@@ -115,7 +129,7 @@ function limitIn(text, whole = true) {
115
129
  * @returns {{lines: string[], events: Neutral[], cost?: Cost, session_id?: string,
116
130
  * limit?: {resets: string | null},
117
131
  * context?: number, turn?: string, model?: string, windows?: Record<string, number>,
118
- * compacted?: boolean, failed?: string[], quota?: Record<string, unknown>}}
132
+ * compacted?: boolean, failed?: string[], quota?: Record<string, unknown>, errored?: boolean}}
119
133
  */
120
134
  export function activity(line, now = new Date()) {
121
135
  let e;
@@ -140,9 +154,7 @@ function logged(e, now) {
140
154
  const errors = content.filter((b) => b.type === 'tool_result' && b.is_error);
141
155
 
142
156
  return {
143
- lines: errors.map(
144
- (b) => `${at} tool error: ${cut(firstLines(resultText(b.content), 1), 300)}`,
145
- ),
157
+ lines: errors.map((b) => `${at} tool error: ${whole(resultText(b.content))}`),
146
158
  // A refused or failed call wrote nothing: its write does not count.
147
159
  ...(errors.length ? { failed: errors.map((b) => String(b.tool_use_id)) } : {}),
148
160
  };
@@ -317,6 +329,11 @@ const quotaOf = (e) =>
317
329
  * agent's context summarized; the rest (hooks, thinking) give nothing.
318
330
  */
319
331
  function system(e, at) {
332
+ // A deny rule of the settings refused a call: a line of its own, not one tool error among many.
333
+ if (e.subtype === 'permission_denied')
334
+ return {
335
+ lines: [`${at} denied: ${[e.tool_name, whole(e.message ?? '')].filter(Boolean).join(' ')}`],
336
+ };
320
337
  if (e.subtype === 'compact_boundary')
321
338
  return { lines: [`${at} compacted: the agent's context was summarized`], compacted: true };
322
339
  if (e.subtype !== 'init' || typeof e.session_id !== 'string') return { lines: [] };
@@ -372,6 +389,7 @@ function ended(e, at) {
372
389
  lines: [...text, `${at} ${summary(e, cost, Boolean(limit.limit))}`],
373
390
  // The reply itself: a lessons turn answers with its JSON here.
374
391
  ...(typeof e.result === 'string' ? { result: e.result } : {}),
392
+ ...(e.is_error ? { errored: true } : {}),
375
393
  cost,
376
394
  ...limit,
377
395
  ...(windows.length ? { windows: Object.fromEntries(windows) } : {}),
@@ -219,12 +219,17 @@ export const claude = {
219
219
  .join(' '),
220
220
  /**
221
221
  * What an operator picks a session's model and effort from (Board-PRD decision 24); another
222
- * plain word goes too, and none leaves the choice to claude.
222
+ * plain word goes too.
223
223
  */
224
224
  presets: {
225
- model: ['opus', 'sonnet', 'haiku'],
225
+ model: ['fable', 'opus', 'sonnet', 'haiku'],
226
226
  effort: ['low', 'medium', 'high', 'xhigh', 'max'],
227
227
  },
228
+ /**
229
+ * What a session runs on when neither it nor the project picks (Board-PRD decision 36): aliases,
230
+ * never versions, so the machine's or the account's default never decides.
231
+ */
232
+ defaults: { model: 'opus', effort: 'high' },
228
233
  /** The flags of a picked model and effort (`{model?, effort?}`, plain words). */
229
234
  pickFlags: (pick) => PICKS.flatMap((k) => (pick?.[k] ? [`--${k} ${pick[k]}`] : [])).join(' '),
230
235
  /** The env a session adds: the guards read the session's own checkout. */
@@ -22,6 +22,7 @@ export const raw = {
22
22
  claude.command({ agent, flags, chat, prompt }),
23
23
  // An unknown command takes no claude flags of a model or effort.
24
24
  presets: { model: [], effort: [] },
25
+ defaults: {},
25
26
  pickFlags: () => '',
26
27
  };
27
28
 
@@ -31,9 +32,15 @@ export const raw = {
31
32
  */
32
33
  export const adapterFor = (command) =>
33
34
  /^claude(\s|$)/.test(command) ||
34
- (process.env.GCF_SESSION_AGENT && command === process.env.GCF_SESSION_AGENT)
35
+ // The stand-in with flags (a run's `--model opus`) is still the stand-in.
36
+ (process.env.GCF_SESSION_AGENT &&
37
+ (command === process.env.GCF_SESSION_AGENT ||
38
+ command.startsWith(`${process.env.GCF_SESSION_AGENT} `)))
35
39
  ? claude
36
40
  : raw;
37
41
 
38
42
  /** What an operator picks the model and effort of `command`'s sessions from. */
39
43
  export const presetsOf = (command) => adapterFor(command).presets;
44
+
45
+ /** What `command`'s sessions run on when neither they nor the project pick, `{model?, effort?}`. */
46
+ export const defaultsOf = (command) => adapterFor(command).defaults;
@@ -734,7 +734,7 @@ export function openChat(opts) {
734
734
  // A session that ended under a write to its stdin breaks the pipe: the end is its close.
735
735
  c.stdin.on('error', () => {});
736
736
  const from = opts.summary ? { summary: opts.summary } : {};
737
- // A project chat's session says the model and effort it was started with (null: the agent's).
737
+ // A project chat's session says the model and effort it was started with (null: none passed).
738
738
  const picked = opts.pick
739
739
  ? { model: opts.pick.model ?? null, effort: opts.pick.effort ?? null }
740
740
  : {};
@@ -31,7 +31,7 @@ export {
31
31
  export { addCost, beyond } from './cost.js';
32
32
  export { claim, clearDead, create, dead } from './lock.js';
33
33
  export { WIN, alive, byLine, killTree, sessions, spawnAgent, stopWithSessions } from './proc.js';
34
- export { adapterFor, presetsOf, raw } from './adapter/index.js';
34
+ export { adapterFor, defaultsOf, presetsOf, raw } from './adapter/index.js';
35
35
  export {
36
36
  NO_SESSION,
37
37
  PICKS,
@@ -258,7 +258,8 @@ async function after(j, ran, base) {
258
258
  prompt,
259
259
  resume: ran.session_id,
260
260
  timeoutMs,
261
- // One reply, past the work: no handoff watch, no quota, no chat.
261
+ // One reply, past the work: no handoff watch, no quota, no chat; the policy logs the reply.
262
+ ownReply: true,
262
263
  handoff: null,
263
264
  quota: null,
264
265
  chat: null,
@@ -17,6 +17,13 @@ const HALT_POLL_MS = 1000;
17
17
  /**
18
18
  * Keep what a session's activity told: the last of each, and the model's window from the result.
19
19
  */
20
+ /**
21
+ * A log line of the reply a caller reads (`ownReply`): the agent's words and the result's text,
22
+ * but an error's: it is why the turn gave no reply.
23
+ */
24
+ const replyLine = (l, a) =>
25
+ /^\[[\d:]+\] agent: /.test(l) || (!a.errored && a.result && l.endsWith(`result:\n${a.result}`));
26
+
20
27
  function absorb(seen, a) {
21
28
  seen.cost = a.cost ?? seen.cost;
22
29
  seen.result = a.result ?? seen.result;
@@ -234,6 +241,8 @@ function sessionTimeout(ms, onTimeout, onHalt) {
234
241
  * @property {any} [chat] the chat's options (chat.js `openChat`)
235
242
  * @property {() => boolean} [halt] the operator stopped the work: the session ends at once
236
243
  * @property {((events: import('./activity.js').Neutral[]) => void) | null} [observe]
244
+ * @property {boolean} [ownReply] the caller reads the reply and logs what it made of it: the log
245
+ * does not get the reply's text (a lessons turn's JSON)
237
246
  */
238
247
 
239
248
  /**
@@ -258,7 +267,7 @@ function sessionTimeout(ms, onTimeout, onHalt) {
258
267
  * handedOver: boolean, model?: string, window?: number, result?: string, waited: number}>}
259
268
  */
260
269
  export function runSession(s) {
261
- const { adapter, fd, timeoutMs, id, onSpawn, handoff, quota, chat, observe, halt } = s;
270
+ const { adapter, fd, timeoutMs, id, onSpawn, handoff, quota, chat, observe, halt, ownReply } = s;
262
271
 
263
272
  return new Promise((resolve) => {
264
273
  const child = launchSession(s);
@@ -301,7 +310,7 @@ export function runSession(s) {
301
310
  if (talk && open) talk.see(a.events);
302
311
  if (a.quota && quota) keepQuota(quota, a.quota);
303
312
  observe?.(a.events);
304
- write(a.lines);
313
+ write(ownReply ? a.lines.filter((l) => !replyLine(l, a)) : a.lines);
305
314
  if (open && a.context !== undefined) shown?.(a.context, seen.model);
306
315
  if (open) watch.see(a, seen.model);
307
316
  });
@@ -78,6 +78,7 @@ const markOf = (dir, kind, key) => path.join(chatsDir(dir), kind, key);
78
78
  export function readThread(dir, t) {
79
79
  return {
80
80
  entry: null,
81
+ start: null,
81
82
  ...JSON.parse(readFileSync(path.join(threadDir(dir, t), 'thread.json'), 'utf8')),
82
83
  };
83
84
  }
@@ -100,12 +101,12 @@ function keepTrying(dir, t, rec) {
100
101
  // A picked model or effort goes into the agent's shell command: one plain word, no flag.
101
102
  const PICK_WORD = /^[A-Za-z0-9][\w.-]*$/;
102
103
 
103
- // The pick that leaves the choice to the agent.
104
+ // The pick that takes the thread's own off: the project's then holds, else the agent's defaults.
104
105
  const AGENT_DEFAULT = 'default';
105
106
 
106
107
  const pickFile = (td) => path.join(td, 'agent.json');
107
108
 
108
- /** A pick's word, or null for the agent's own: none, `default`, or a word that is not plain. */
109
+ /** A pick's word, or null for none of its own: none, `default`, or a word that is not plain. */
109
110
  const wordOf = (v) =>
110
111
  typeof v === 'string' && v !== AGENT_DEFAULT && PICK_WORD.test(v) ? v : null;
111
112
 
@@ -122,12 +123,15 @@ function pickIn(td) {
122
123
  }
123
124
  }
124
125
 
125
- /** The model and effort thread `t`'s sessions run on, `{model?, effort?}`; none: the agent's. */
126
+ /**
127
+ * The model and effort thread `t` picked, `{model?, effort?}`; none: the project's, else the
128
+ * agent's defaults (Board-PRD decision 36).
129
+ */
126
130
  export const threadAgent = (dir, t) => pickIn(threadDir(dir, t));
127
131
 
128
132
  /**
129
133
  * Pick the model and effort of thread `t` (Board-PRD decision 24): each a plain word, `default`
130
- * or null the agent's own choice, one left out kept as it is. Its next session takes them (a
134
+ * or null takes the thread's own off, one left out kept as it is. Its next session takes them (a
131
135
  * resume or a fresh agent); the live one keeps its own. Returns the pick kept. A word that is not
132
136
  * plain is a RangeError.
133
137
  * @param {{model?: string | null, effort?: string | null}} pick
@@ -211,10 +215,13 @@ function markOnce(dir, [kind, key], t, last = false) {
211
215
  /**
212
216
  * A new thread, its id; bound to `item` or to inbox `entry`, the one it already has (AD-46).
213
217
  * Ids and the marks are made exclusively: two at once never take one id, nor give an item or an
214
- * entry two threads. Both `item` and `entry` is a RangeError.
218
+ * entry two threads. Both `item` and `entry` is a RangeError. `start` is what the caller started
219
+ * the thread for (a board's design start, `{id, …}`), kept in the record as given: every session
220
+ * of the thread, a handoff's too, runs by it. A started thread is bound to nothing.
215
221
  */
216
- export function createThread(dir, { item = null, entry = null } = {}) {
222
+ export function createThread(dir, { item = null, entry = null, start = null } = {}) {
217
223
  if (item && entry) throw new RangeError('a thread is bound to an item or an entry, not both');
224
+ if (start && (item || entry)) throw new RangeError('a started thread is bound to nothing');
218
225
  const [kind, key] = item ? ['items', item] : ['entries', entry];
219
226
  const had = key ? boundTo(dir, kind, key) : null;
220
227
  if (had) return had;
@@ -224,7 +231,7 @@ export function createThread(dir, { item = null, entry = null } = {}) {
224
231
  if (won !== t) return won;
225
232
 
226
233
  const now = new Date().toISOString();
227
- writeThread(dir, t, { id: t, item, entry, sessions: [], created_at: now, in_at: 0 });
234
+ writeThread(dir, t, { id: t, item, entry, start, sessions: [], created_at: now, in_at: 0 });
228
235
 
229
236
  return t;
230
237
  }
@@ -344,7 +351,8 @@ function flagsOf({ dir, td, spec, adapter }, settings) {
344
351
  * sessions (AD-41), each resumed from the one before, a fresh one after a handoff (AD-42).
345
352
  * `spec` (its `spec.json`): `agent`, `rules` `{deny, ask, allow}`, `mcp` (config files),
346
353
  * `answerMin`, `handoffPct`, `window`, `skill`, `mainLock`, `timeoutMin`, `pick` (the project's
347
- * model and effort, under the thread's own). `stopped()` says the operator stopped it.
354
+ * model and effort, under the thread's own, over the agent's defaults). `stopped()` says the
355
+ * operator stopped it.
348
356
  * @param {{stopped?: () => boolean}} [opts]
349
357
  */
350
358
  export async function runThread(dir, t, spec, opts = {}) {
@@ -580,8 +588,9 @@ function jobOf(s, record) {
580
588
  prompt: (kind, _caps, rec) => (rec?.ended === 'limit' ? AFTER_LIMIT : null),
581
589
  // The flags come before the chat of each session (job.js): the chat says what they picked.
582
590
  flags: (kind) => {
583
- // The thread's own pick over the project's (`spec.pick`, as the thread's agent started).
584
- s.pick = { ...wordsOf(spec.pick), ...pickIn(s.td) };
591
+ // The thread's own pick over the project's (`spec.pick`, as the thread's agent started),
592
+ // over the agent's defaults (Board-PRD decision 36).
593
+ s.pick = { ...s.adapter.defaults, ...wordsOf(spec.pick), ...pickIn(s.td) };
585
594
 
586
595
  return s.flags(kind, s.summary, s.pick);
587
596
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcf-session",
3
- "version": "0.14.0",
3
+ "version": "0.17.1",
4
4
  "private": true,
5
5
  "description": "The session engine of GCF: one agent session and a run as a chain of them, the chat protocol, the provider adapters. Bundled by gcf-harness-aif-ext and gcf-board, never published.",
6
6
  "type": "module",
@@ -15,7 +15,7 @@ export type ChatEvent = At &
15
15
  kind: 'start' | 'resume' | 'handoff';
16
16
  v?: number;
17
17
  summary?: string;
18
- /** A project chat's: the model and effort it started with; null, the agent's own. */
18
+ /** A project chat's: the model and effort it started with; null, the agent's own default. */
19
19
  model?: string | null;
20
20
  effort?: string | null;
21
21
  }
@@ -136,11 +136,19 @@ export interface Thread {
136
136
  item: string | null;
137
137
  /** The inbox entry the thread drafts an item from (Draft with agent); null for none. */
138
138
  entry: string | null;
139
+ /** What the thread was started for (a board's design start); null for none. */
140
+ start: ThreadStart | null;
139
141
  sessions: { session_id?: string; ended: string; kind: string; summary?: string }[];
140
142
  created_at: string;
141
143
  in_at: number;
142
144
  }
143
145
 
146
+ /** A start a thread runs by: its id, and what the caller gave it (a file, a unit, a text). */
147
+ export interface ThreadStart {
148
+ id: string;
149
+ [key: string]: string;
150
+ }
151
+
144
152
  /** How a thread runs, `chats/<t>/spec.json`: the center writes it. */
145
153
  export interface ThreadSpec {
146
154
  agent: string;
@@ -156,7 +164,10 @@ export interface ThreadSpec {
156
164
  pick?: AgentPick;
157
165
  }
158
166
 
159
- /** The model and effort an operator picked, `chats/<t>/agent.json`: none, the agent's own. */
167
+ /**
168
+ * The model and effort an operator picked, `chats/<t>/agent.json`: none, the project's, else the
169
+ * agent's defaults (`defaultsOf`, Board-PRD decision 36).
170
+ */
160
171
  export interface AgentPick {
161
172
  model?: string;
162
173
  effort?: string;
@@ -175,9 +186,11 @@ export declare function setThreadAgent(
175
186
  pick: { model?: string | null; effort?: string | null },
176
187
  ): AgentPick;
177
188
  export declare function presetsOf(agent: string): AgentPresets;
189
+ /** What `agent`'s sessions run on when neither they nor the project pick (decision 36). */
190
+ export declare function defaultsOf(agent: string): AgentPick;
178
191
  export declare function createThread(
179
192
  dir: string,
180
- opts?: { item?: string | null; entry?: string | null },
193
+ opts?: { item?: string | null; entry?: string | null; start?: ThreadStart | null },
181
194
  ): string;
182
195
  export declare function threadOf(dir: string, item: string): string | null;
183
196
  export declare function threadOfEntry(dir: string, entry: string): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcf-harness-aif-ext",
3
- "version": "0.16.1",
3
+ "version": "0.18.2",
4
4
  "description": "GCF orchestration harness for Claude Code: one-command card pipeline, readset guard",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "prepack": "node -e \"const p=require('./package.json'),e=require('./extension.json');if(p.version!==e.version)throw new Error('version mismatch: package.json '+p.version+' vs extension.json '+e.version);require('node:fs').statSync('node_modules/gcf-session/lib/index.js')\""
29
29
  },
30
30
  "peerDependencies": {
31
- "gcf-aif-ext": "^0.16.1"
31
+ "gcf-aif-ext": "^0.18.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "gcf-session": "file:../gcf-session"
@@ -83,7 +83,7 @@ workflow:
83
83
  18. a dependency still waiting for its verdict refuses the close: run `ai-factory gcf block <id> --reason "waits for <dep>"`
84
84
  19. close the run: delete `.gcf-session/readset.json`, run `ai-factory gcf playtest session` and hand its checklist to the human, with one report row per plan pass: pass, blocking, polish, result
85
85
  20. after a tune verdict or an unblock, re-enter this pipeline at step 5: the gates re-run because the counters moved
86
- 21. with `--worktree`: skip the integrate of step 1, steps 2-4 and the playtest of step 19, and change no `gcf/` file but the item's `live:` and new inbox entries (`ai-factory gcf inbox add`)
86
+ 21. with `--worktree`: skip the integrate of step 1, steps 2-4 and the playtest of step 19, and change no `gcf/` file but the item's `live:` and new inbox entries (`ai-factory gcf inbox add --category <c>`)
87
87
  22. with `--worktree`, every stop - a failed gate, an over budget readset, a failed plan check, a refused command, steps 11, 12, 14, 18 - writes `{"block": "<reason>"}` to `.gcf-session/outcome.json` and ends the session
88
88
  23. with `--worktree`, run no `ai-factory gcf block`, `submit` or `close`: the core refuses them on a `work/` branch, and the harness records the move on main
89
89
  24. with `--worktree`, step 17 is: commit everything but `gcf/.metrics`, then run `ai-factory gcf verify <id> --mark`; the harness merges the branch