gcf-harness-aif-ext 0.21.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/commands/harness.js +2 -24
- package/commands/run.js +86 -10
- package/extension.json +1 -1
- package/node_modules/gcf-session/lib/activity.js +9 -5
- package/node_modules/gcf-session/lib/chat.js +16 -3
- package/node_modules/gcf-session/lib/session.js +3 -1
- package/node_modules/gcf-session/package.json +1 -1
- package/package.json +2 -2
- package/skills/gcf-run/SKILL.md +9 -5
package/README.md
CHANGED
|
@@ -47,6 +47,8 @@ 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.22.0 (bundled gcf-session 0.18.1, core up to 0.23): a subagent's lines in a run log read `subagent:`, `subagent tool:`, `subagent tool error:`. A main batch stops when a card ended with its work uncommitted and left new paths outside `gcf/`: the rest read `skipped`, and no card is built on top. Past the answer time a `--ask d1` question says block and picks no option, recommended or not; `--ask all` still takes the recommended one. gcf-run: an environment stop this machine's tools can clear is no question and no block; a `notes:` line against a slot wins, and the run rewrites that slot of its own card.
|
|
51
|
+
|
|
50
52
|
0.21.2 changes no code: its peer range adds core 0.22.
|
|
51
53
|
|
|
52
54
|
0.21.1: `/gcf-run` treats a `format:` line of `gcf plan check` (core 0.21: the plan's form against the plan profile) as polish its improve passes apply, never a block. It takes core 0.20 or 0.21 (the peer range of 0.21.0 left 0.21 out).
|
package/commands/harness.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
DEFAULT_AGENT,
|
|
18
18
|
DEFAULT_TIMEOUT_MIN,
|
|
19
19
|
MAIN_RUN,
|
|
20
|
+
loosePaths,
|
|
20
21
|
queueOf,
|
|
21
22
|
stopOf,
|
|
22
23
|
} from './run.js';
|
|
@@ -446,30 +447,7 @@ export function gateEach(report, ids) {
|
|
|
446
447
|
return { items: Object.fromEntries(named.map((id) => [id, gate(report, [id])])) };
|
|
447
448
|
}
|
|
448
449
|
|
|
449
|
-
|
|
450
|
-
* The checkout's uncommitted paths outside `gcf/` and `GLOSSARY.md`, untracked ones too (a new
|
|
451
|
-
* folder as one): a main run's code lands among them, so the board warns before its click (Tails
|
|
452
|
-
* "Первым" 6). The moves' own refusals guard `gcf/` and the glossary (core 0.21's gate scope).
|
|
453
|
-
* Null outside a git checkout.
|
|
454
|
-
*/
|
|
455
|
-
export function loosePaths(dir) {
|
|
456
|
-
// No optional locks: a main run's agent may be committing in the same checkout.
|
|
457
|
-
const args = [
|
|
458
|
-
...['--no-optional-locks', 'status', '--porcelain', '-z', '--', '.'],
|
|
459
|
-
...[':(exclude)gcf', ':(exclude)GLOSSARY.md'],
|
|
460
|
-
];
|
|
461
|
-
const res = spawnSync('git', args, { cwd: dir, encoding: 'utf8' });
|
|
462
|
-
if (res.status !== 0) return null;
|
|
463
|
-
const parts = res.stdout.split('\0').filter(Boolean);
|
|
464
|
-
const paths = [];
|
|
465
|
-
// A rename or a copy gives its old path as the next part: the new one names it.
|
|
466
|
-
for (let i = 0; i < parts.length; i++) {
|
|
467
|
-
paths.push(parts[i].slice(3));
|
|
468
|
-
if (/^(?:[RC].|.[RC])/.test(parts[i])) i++;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
return paths;
|
|
472
|
-
}
|
|
450
|
+
export { loosePaths };
|
|
473
451
|
|
|
474
452
|
/**
|
|
475
453
|
* `gate --each` as text: each item's answer, then the loose paths.
|
package/commands/run.js
CHANGED
|
@@ -41,10 +41,17 @@ import { milestones } from './milestones.js';
|
|
|
41
41
|
import { readState } from '../hooks/implement-guard.js';
|
|
42
42
|
import { logMetrics, metricsDir } from '../hooks/metrics.js';
|
|
43
43
|
|
|
44
|
-
/** What the operator's silence says in a run's chat, past the answer timeout. */
|
|
44
|
+
/** What the operator's silence says in a run's chat, past the answer timeout (`ask: all`). */
|
|
45
45
|
export const DEFAULT_ANSWER =
|
|
46
46
|
'No answer came in time: take your safe default, or block the item with your question.';
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Its words with `ask: d1`: such a question is the operator's alone, so silence picks no option,
|
|
50
|
+
* not even the one the agent recommended.
|
|
51
|
+
*/
|
|
52
|
+
export const D1_ANSWER =
|
|
53
|
+
"No answer came in time: this question is the operator's to answer. Block the item with it and pick nothing.";
|
|
54
|
+
|
|
48
55
|
/** The denial of a question card in a run that asks the operator nothing (`chat.ask: none`). */
|
|
49
56
|
export const ASK_NONE =
|
|
50
57
|
'answer it yourself and write your choice into the plan: this run asks the operator nothing';
|
|
@@ -142,12 +149,15 @@ export function json(res, what) {
|
|
|
142
149
|
try {
|
|
143
150
|
return JSON.parse(res.out);
|
|
144
151
|
} catch (e) {
|
|
145
|
-
//
|
|
146
|
-
// a git failure's first line is its progress
|
|
152
|
+
// Core 0.22.2's refusal is its words alone. An older core's is the `Error: <message>` node
|
|
153
|
+
// prints over its stack, every line of it: a git failure's first line is its progress.
|
|
147
154
|
const text = res.err || res.out;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
// Only a crash opens with its frame or its header: a later `Error: …` line is the words' own.
|
|
156
|
+
const crash = /^(.+:\d+|\w*Error: .*)\r?$/.test(text.trimStart().split('\n', 1)[0]);
|
|
157
|
+
const header = crash
|
|
158
|
+
? (text.match(/^\w*Error: ([\s\S]*?)\r?\n {4}at /m) ?? text.match(/^\w*Error: (.+)$/m))
|
|
159
|
+
: null;
|
|
160
|
+
const why = header?.[1] ?? text;
|
|
151
161
|
throw new Error(`ai-factory gcf ${what} gave no report: ${why.replace(/\r/g, '').trim()}`, {
|
|
152
162
|
cause: e,
|
|
153
163
|
});
|
|
@@ -903,10 +913,13 @@ export function chatOf({ answerMin = null, graceMs }, config = {}) {
|
|
|
903
913
|
const answerMs = (answerMin ?? config.answer_timeout_min ?? CHAT_TIMEOUT_MIN) * 60_000;
|
|
904
914
|
|
|
905
915
|
// `graceMs`: the tests' shorter wait for a read echo (chat.js READ_GRACE_MS).
|
|
916
|
+
const ask = answerMs > 0 ? (config.ask ?? 'd1') : 'none';
|
|
917
|
+
|
|
906
918
|
return {
|
|
907
919
|
answerMs,
|
|
908
|
-
ask
|
|
909
|
-
defaultAnswer: DEFAULT_ANSWER,
|
|
920
|
+
ask,
|
|
921
|
+
defaultAnswer: ask === 'd1' ? D1_ANSWER : DEFAULT_ANSWER,
|
|
922
|
+
silencePicks: ask !== 'd1',
|
|
910
923
|
askNone: ASK_NONE,
|
|
911
924
|
...(graceMs && { graceMs }),
|
|
912
925
|
};
|
|
@@ -979,16 +992,27 @@ async function runMain(projectDir, ids, releaseMain, ctx) {
|
|
|
979
992
|
const items = [];
|
|
980
993
|
try {
|
|
981
994
|
for (const [n, id] of ids.entries()) {
|
|
995
|
+
const loose = loosePaths(projectDir);
|
|
982
996
|
// Its mark holds it from its claim on: the queue lets it go then.
|
|
983
997
|
// Advisory only: a write refused (a file held by a scanner) leaves the item run as it is.
|
|
984
998
|
const dequeue = () => {
|
|
985
999
|
try {
|
|
986
1000
|
writeAtomic(queueOf(logs), `${ids.slice(n + 1).join('\n')}\n`);
|
|
987
|
-
} catch {
|
|
1001
|
+
} catch {
|
|
1002
|
+
// Advisory, as above.
|
|
1003
|
+
}
|
|
988
1004
|
};
|
|
989
1005
|
|
|
990
1006
|
items.push(await mainItem(projectDir, id, { ...ctx, dequeue }));
|
|
991
1007
|
await postEnd(ctx, items.at(-1));
|
|
1008
|
+
const left = leftBehind(projectDir, items.at(-1), loose);
|
|
1009
|
+
if (left) {
|
|
1010
|
+
items.at(-1).left = left.paths;
|
|
1011
|
+
items.push(
|
|
1012
|
+
...ids.slice(n + 1).map((rest) => ({ id: rest, result: 'skipped', reason: left.reason })),
|
|
1013
|
+
);
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
992
1016
|
}
|
|
993
1017
|
} finally {
|
|
994
1018
|
await rm(queueOf(logs), { force: true });
|
|
@@ -998,6 +1022,55 @@ async function runMain(projectDir, ids, releaseMain, ctx) {
|
|
|
998
1022
|
return items;
|
|
999
1023
|
}
|
|
1000
1024
|
|
|
1025
|
+
/**
|
|
1026
|
+
* The checkout's uncommitted paths outside `gcf/` and `GLOSSARY.md`, untracked ones too (a new
|
|
1027
|
+
* folder as one): a main run's code lands among them, so the board warns before its click (Tails
|
|
1028
|
+
* "Первым" 6). The moves' own refusals guard `gcf/` and the glossary (core 0.21's gate scope).
|
|
1029
|
+
* Null outside a git checkout.
|
|
1030
|
+
*/
|
|
1031
|
+
export function loosePaths(dir) {
|
|
1032
|
+
// No optional locks: a main run's agent may be committing in the same checkout.
|
|
1033
|
+
const args = [
|
|
1034
|
+
...['--no-optional-locks', 'status', '--porcelain', '-z', '--', '.'],
|
|
1035
|
+
...[':(exclude)gcf', ':(exclude)GLOSSARY.md'],
|
|
1036
|
+
];
|
|
1037
|
+
const res = spawnSync('git', args, { cwd: dir, encoding: 'utf8' });
|
|
1038
|
+
if (res.status !== 0) return null;
|
|
1039
|
+
const parts = res.stdout.split('\0').filter(Boolean);
|
|
1040
|
+
const paths = [];
|
|
1041
|
+
// A rename or a copy gives its old path as the next part: the new one names it.
|
|
1042
|
+
for (let i = 0; i < parts.length; i++) {
|
|
1043
|
+
paths.push(parts[i].slice(3));
|
|
1044
|
+
if (/^(?:[RC].|.[RC])/.test(parts[i])) i++;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
return paths;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
// The results that mean an item's work is committed.
|
|
1051
|
+
const COMMITTED = ['submit', 'close', 'decide', 'deferred'];
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Why a main batch goes no further, or null: `item` ended with its work not committed and left
|
|
1055
|
+
* paths that were not loose before it (`loose`), and the next item would build on top of them. A
|
|
1056
|
+
* plan under `.ai-factory/` is no such work: a block at the plan's stage leaves one by design.
|
|
1057
|
+
* shortcut: a path already loose before it and changed again passes as a human's, as the status
|
|
1058
|
+
* alone cannot tell them apart; comparing hashes would.
|
|
1059
|
+
*/
|
|
1060
|
+
function leftBehind(dir, item, loose) {
|
|
1061
|
+
if (COMMITTED.includes(item.result) || !loose) return null;
|
|
1062
|
+
const fresh = (loosePaths(dir) ?? []).filter(
|
|
1063
|
+
(p) => !loose.includes(p) && !p.startsWith('.ai-factory/'),
|
|
1064
|
+
);
|
|
1065
|
+
if (!fresh.length) return null;
|
|
1066
|
+
const shown = `${fresh.slice(0, 3).join(', ')}${fresh.length > 3 ? '…' : ''}`;
|
|
1067
|
+
|
|
1068
|
+
return {
|
|
1069
|
+
paths: fresh,
|
|
1070
|
+
reason: `${item.id} left uncommitted work (${shown}): the rest of the batch waits for it`,
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1001
1074
|
/** The items a main run has yet to reach, one id a line. */
|
|
1002
1075
|
export const queueOf = (logs) => path.join(logs, `${MAIN_RUN}.queue`);
|
|
1003
1076
|
|
|
@@ -1300,7 +1373,8 @@ const modeOf = (mode, board, item) => mode ?? item?.run_mode ?? board.run_mode ?
|
|
|
1300
1373
|
* `run_mode`, else the project's. Items of two modes are two parts at once under one gate, one
|
|
1301
1374
|
* report: the main part in the checkout, one item after another, the worktree part beside it;
|
|
1302
1375
|
* a branch it verifies merges when the main part ends. `gate(ids)` answers `{pass, reason}`; a
|
|
1303
|
-
* session past `timeoutMs` is stopped with all it started, and its item stays ready. `fresh` starts
|
|
1376
|
+
* session past `timeoutMs` is stopped with all it started, and its item stays ready. `fresh` starts
|
|
1377
|
+
* new sessions where kept ones would resume;
|
|
1304
1378
|
* `waitLimit` holds each session while the account's usage limit is known to reset ahead.
|
|
1305
1379
|
* `chat` ({answerMs}) keeps each session open to the operator (docs/Chat-Plan.md).
|
|
1306
1380
|
* The core's moves it and its agents make name the run as their maker (`GCF-By`); the variable
|
|
@@ -1404,6 +1478,7 @@ export function runEndOf(i, projectDir, launch = null) {
|
|
|
1404
1478
|
} catch {
|
|
1405
1479
|
// Archived with its item: nothing left.
|
|
1406
1480
|
}
|
|
1481
|
+
|
|
1407
1482
|
const steps = (launch?.events ?? []).filter((e) => e.type === 'step');
|
|
1408
1483
|
const dod = steps.findLast((e) => e.step === 'dod');
|
|
1409
1484
|
const review = steps.findLast((e) => e.step === 'review');
|
|
@@ -1439,6 +1514,7 @@ export function runEvents(file) {
|
|
|
1439
1514
|
} catch {
|
|
1440
1515
|
return [];
|
|
1441
1516
|
}
|
|
1517
|
+
|
|
1442
1518
|
const events = lines.flatMap((l) => {
|
|
1443
1519
|
try {
|
|
1444
1520
|
return l.trim() ? [JSON.parse(l)] : [];
|
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.
|
|
4
|
+
"version": "0.22.0",
|
|
5
5
|
"description": "GCF orchestration harness for Claude Code: one-command card pipeline, readset guard",
|
|
6
6
|
"skills": [
|
|
7
7
|
"skills/gcf-run",
|
|
@@ -27,6 +27,7 @@ const whole = (text) => {
|
|
|
27
27
|
? `${line.slice(0, LOG_MAX)}… (${line.length - LOG_MAX} more characters)`
|
|
28
28
|
: line;
|
|
29
29
|
};
|
|
30
|
+
|
|
30
31
|
const LOG_MAX = 8000;
|
|
31
32
|
|
|
32
33
|
/** The first `n` non-empty lines of a text, trimmed, on one line. */
|
|
@@ -148,13 +149,16 @@ export function activity(line, now = new Date()) {
|
|
|
148
149
|
function logged(e, now) {
|
|
149
150
|
const at = `[${clock(now)}]`;
|
|
150
151
|
const content = Array.isArray(e.message?.content) ? e.message.content : [];
|
|
152
|
+
// A subagent's lines say whose they are.
|
|
153
|
+
const sub = e.parent_tool_use_id != null;
|
|
151
154
|
if (e.type === 'system') return system(e, at);
|
|
152
|
-
if (e.type === 'assistant') return { ...said(content, at), ...contextOf(e) };
|
|
155
|
+
if (e.type === 'assistant') return { ...said(content, at, sub), ...contextOf(e) };
|
|
153
156
|
if (e.type === 'user') {
|
|
154
157
|
const errors = content.filter((b) => b.type === 'tool_result' && b.is_error);
|
|
158
|
+
const head = sub ? 'subagent tool error' : 'tool error';
|
|
155
159
|
|
|
156
160
|
return {
|
|
157
|
-
lines: errors.map((b) => `${at}
|
|
161
|
+
lines: errors.map((b) => `${at} ${head}: ${whole(resultText(b.content))}`),
|
|
158
162
|
// A refused or failed call wrote nothing: its write does not count.
|
|
159
163
|
...(errors.length ? { failed: errors.map((b) => String(b.tool_use_id)) } : {}),
|
|
160
164
|
};
|
|
@@ -415,16 +419,16 @@ function contextOf(e) {
|
|
|
415
419
|
}
|
|
416
420
|
|
|
417
421
|
/** An assistant turn: its tool calls and its text, which may be the usage-limit message. */
|
|
418
|
-
function said(content, at) {
|
|
422
|
+
function said(content, at, sub) {
|
|
419
423
|
const texts = content.filter((b) => b.type === 'text').map((b) => b.text);
|
|
420
424
|
|
|
421
425
|
return {
|
|
422
426
|
...(texts.map((t) => limitIn(t)).find((l) => l.limit) ?? {}),
|
|
423
427
|
lines: content.flatMap((b) => {
|
|
424
|
-
if (b.type === 'tool_use') return [`${at} ${toolLine(b)}`];
|
|
428
|
+
if (b.type === 'tool_use') return [`${at} ${sub ? 'subagent ' : ''}${toolLine(b)}`];
|
|
425
429
|
const text = b.type === 'text' ? cut(firstLines(b.text, 2), 300) : '';
|
|
426
430
|
|
|
427
|
-
return text ? [`${at} agent: ${text}`] : [];
|
|
431
|
+
return text ? [`${at} ${sub ? 'subagent' : 'agent'}: ${text}`] : [];
|
|
428
432
|
}),
|
|
429
433
|
};
|
|
430
434
|
}
|
|
@@ -198,11 +198,12 @@ function readRaw(file, from, to) {
|
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
200
|
* A question card's answers past the timeout: each one's recommended option, or `fallback`.
|
|
201
|
+
* `picks: false`: `fallback` alone, for a question only the operator may answer.
|
|
201
202
|
*/
|
|
202
|
-
export function defaultAnswers(questions = [], fallback = DEFAULT_ANSWER) {
|
|
203
|
+
export function defaultAnswers(questions = [], fallback = DEFAULT_ANSWER, { picks = true } = {}) {
|
|
203
204
|
return Object.fromEntries(
|
|
204
205
|
questions.map((q) => {
|
|
205
|
-
const pick = (q.options ?? []).find((o) => RECOMMENDED.test(o.label ?? ''));
|
|
206
|
+
const pick = picks && (q.options ?? []).find((o) => RECOMMENDED.test(o.label ?? ''));
|
|
206
207
|
|
|
207
208
|
return [q.question, pick ? pick.label.replace(RECOMMENDED, '') : fallback];
|
|
208
209
|
}),
|
|
@@ -684,7 +685,13 @@ function waitCards(c) {
|
|
|
684
685
|
waitFor(c, 'card', () => {
|
|
685
686
|
for (const [rid, card] of [...c.cards])
|
|
686
687
|
if (card.approval) void decided(c, rid, { allow: false, by: 'timeout' });
|
|
687
|
-
else
|
|
688
|
+
else
|
|
689
|
+
answer(
|
|
690
|
+
c,
|
|
691
|
+
rid,
|
|
692
|
+
defaultAnswers(card.questions, c.defaultAnswer, { picks: c.silencePicks }),
|
|
693
|
+
'timeout',
|
|
694
|
+
);
|
|
688
695
|
});
|
|
689
696
|
}
|
|
690
697
|
|
|
@@ -756,12 +763,15 @@ export function taskGate(c, e, now, later) {
|
|
|
756
763
|
|
|
757
764
|
return false;
|
|
758
765
|
}
|
|
766
|
+
|
|
759
767
|
c.taskAt.set(e.id, now);
|
|
760
768
|
}
|
|
769
|
+
|
|
761
770
|
if (held) {
|
|
762
771
|
clearTimeout(held.timer);
|
|
763
772
|
c.taskHeld.delete(e.id);
|
|
764
773
|
}
|
|
774
|
+
|
|
765
775
|
if (e.phase === 'end') c.taskAt.delete(e.id);
|
|
766
776
|
|
|
767
777
|
return true;
|
|
@@ -845,6 +855,7 @@ const SEEN = {
|
|
|
845
855
|
const last = flushed(c, e.id);
|
|
846
856
|
if (!c.closed) SEEN.task(c, last);
|
|
847
857
|
};
|
|
858
|
+
|
|
848
859
|
if (!taskGate(c, e, Date.now(), later)) return;
|
|
849
860
|
const prompt = e.phase === 'start' ? e.prompt : null;
|
|
850
861
|
post(c, {
|
|
@@ -954,6 +965,8 @@ const CHAT_DEFAULTS = {
|
|
|
954
965
|
graceMs: READ_GRACE_MS,
|
|
955
966
|
steps: { see: () => [] },
|
|
956
967
|
defaultAnswer: DEFAULT_ANSWER,
|
|
968
|
+
// Whether silence on a question takes its recommended option.
|
|
969
|
+
silencePicks: true,
|
|
957
970
|
askNone: ASK_NONE,
|
|
958
971
|
encode: claudeInput,
|
|
959
972
|
approvals: false,
|
|
@@ -41,7 +41,8 @@ function absorb(seen, a) {
|
|
|
41
41
|
* flags the session past its share or at a compaction (`handoff.flag`), and calls `stop` once it
|
|
42
42
|
* works on past more. `windowOf(model)` is the window the share is taken of. A run's `fresh`
|
|
43
43
|
* session (no resume) over the share at its first reading starts there: a fresh one after it,
|
|
44
|
-
* on the same prompt, would too, so the share does not hand it over (a live run at 10%, 2026-11-03:
|
|
44
|
+
* on the same prompt, would too, so the share does not hand it over (a live run at 10%, 2026-11-03:
|
|
45
|
+
* three sessions of 19% each
|
|
45
46
|
* handed over before any work, and the item blocked); a compaction still does.
|
|
46
47
|
*/
|
|
47
48
|
function handoffWatch(handoff, windowOf, write, { stop, onFlag, fresh = false }) {
|
|
@@ -84,6 +85,7 @@ function handoffWatch(handoff, windowOf, write, { stop, onFlag, fresh = false })
|
|
|
84
85
|
`context_handoff_pct ${handoff.pct}: a fresh session would start there too; raise it`,
|
|
85
86
|
]);
|
|
86
87
|
}
|
|
88
|
+
|
|
87
89
|
if (!w.flagged && (compacted || (share >= handoff.pct && !w.under))) flag(win, pct, compacted);
|
|
88
90
|
// A project chat hands over by its summary turn, which goes on past the flag (AD-42).
|
|
89
91
|
if (handoff.soft) return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcf-session",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.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",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcf-harness-aif-ext",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
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.20.0 <0.
|
|
31
|
+
"gcf-aif-ext": ">=0.20.0 <0.24.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"gcf-session": "file:../gcf-session"
|
package/skills/gcf-run/SKILL.md
CHANGED
|
@@ -58,7 +58,11 @@ forbidden_behaviors:
|
|
|
58
58
|
- a ticked task whose code aif-implement's re-entry check finds missing stays pending and gets implemented, with no question to the human
|
|
59
59
|
- at aif-implement's last question, verify or commit, pick neither: go on with step 13, which verifies, and steps 14-16, which review and commit
|
|
60
60
|
- an aif-implement question none of these name: answer it by the same rule - the changes stay uncommitted and unstashed, the plan's tasks go on, and GCF commits and moves the item
|
|
61
|
-
- do not leave a task ticked that the tune note or the
|
|
61
|
+
- do not leave a task ticked that the tune note, the answer, an amend or a decision from the run's chat reopens: untick it and add the note before step 13, or aif-implement's re-entry check ticks it again over the old code
|
|
62
|
+
- a `notes:` line that contradicts a slot of the card is the human's word: build by it, ask nothing, and rewrite that slot of your own card by it in your commit, as only the slots reach the documents of the systems
|
|
63
|
+
- a decision from the run's chat that contradicts a slot goes the same way
|
|
64
|
+
- do not ask about or block on what stops your tools here and this machine's tools can clear: a held file, an application holding a lock, a stopped service
|
|
65
|
+
- clear such a stop within the deny rules, do the work, and put it back as it was; how comes from the project's rules
|
|
62
66
|
- do not route a command the permission system refused through a script, a wrapper or another spelling or shell (a full exe path, `cmd /c`, `node`, `npm run`)
|
|
63
67
|
- do not write a refused command into a DoD command or a config that `ai-factory gcf` runs
|
|
64
68
|
- a dedicated tool doing the same job (Read, Grep, Glob, Edit) is no wrapper, nor is a refused pipe or `;` chain split into single allowed commands
|
|
@@ -81,12 +85,12 @@ workflow:
|
|
|
81
85
|
4. of those children, keep one per subsystem unless every child sharing it says `parallel: ok`; the rest wait for the next run; an empty list: report "nothing to run" and stop
|
|
82
86
|
5. gate: run `ai-factory gcf-harness gate <item-ids...>` over the whole batch; a non-zero exit is a failed gate, its stderr line is the reason
|
|
83
87
|
6. readset: run `ai-factory gcf context <item-id> --json --readset`; it writes `.gcf-session/readset.json` for this session itself; `over_budget: true` stops the run with a D1 question naming the subsystem
|
|
84
|
-
7. plan: run aif-plan full for the item into its `plan:` path, by default `.ai-factory/plans/<id>.md`, reading only the readset files; an existing plan (the item came back after a tune, an unblock or
|
|
88
|
+
7. plan: run aif-plan full for the item into its `plan:` path, by default `.ai-factory/plans/<id>.md`, reading only the readset files; an existing plan (the item came back after a tune, an unblock, a continue or an amend) is kept, not rewritten
|
|
85
89
|
8. improve the plan in passes, each pass a fresh subagent that reads only the plan and the readset and applies aif-improve without questions, writing each default it picks into the plan
|
|
86
90
|
9. each pass also checks every task against the `invariant` of each pillar in `gcf/PILLARS.md`: the pass reworks a task that breaks one, and a conflict no rework removes is a pillar conflict of step 12
|
|
87
91
|
10. after each pass run `ai-factory gcf plan check <id>`; a failure blocks the item with its reason; a pass with no blocking finding ends the loop - the plan converged, its polish applied
|
|
88
92
|
11. passes <= `plan_passes` from `gcf/config.yml` (3 by default); a blocking finding left after the last pass: run `ai-factory gcf block <id> --reason "plan did not converge: <the finding>"` and stop
|
|
89
|
-
12. a question only the human can answer - a save format, a public API, a new dependency, a pillar conflict: run `ai-factory gcf block <id> --reason "<question>"` and stop
|
|
93
|
+
12. a question only the human can answer - a save format, a public API, a new dependency, a pillar conflict, and no other: run `ai-factory gcf block <id> --reason "<question>"` and stop
|
|
90
94
|
13. run the aif-implement skill on `@<plan path>`, write the item's `live:` delta, then run `ai-factory gcf verify <id>` and check the item's negative constraints; a non-zero exit is a red DoD; attempts <= `dod_attempts`, each with a diagnosis
|
|
91
95
|
14. review the diff with a fresh subagent; fix what it finds before the commit; DoD still red after the attempts: commit no code, run `ai-factory gcf block <id> --reason "<diagnosis>"` - its commit carries the item file with its delta
|
|
92
96
|
15. the reviewer also answers the `review_question` of each pillar in `gcf/PILLARS.md` over the diff: an answer that breaks the pillar is a finding
|
|
@@ -94,8 +98,8 @@ workflow:
|
|
|
94
98
|
17. gate `verdict` or `decision`: run `ai-factory gcf submit <id>`; gate `auto`: `ai-factory gcf close <id>` - a soft unit closes unplayed; the core defers what the gates defer; never pass `--unverified`, the human's call
|
|
95
99
|
18. a dependency still waiting for its verdict refuses the close: run `ai-factory gcf block <id> --reason "waits for <dep>"`
|
|
96
100
|
19. close the run: delete `.gcf-session/readset.json`; report a row per plan pass: pass, blocking, polish, result; hand the human `ai-factory gcf playtest session` when the audit's `play_milestone` is set or an item waits for its verdict
|
|
97
|
-
20. after a tune verdict or an
|
|
98
|
-
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
|
|
101
|
+
20. after a tune verdict, an unblock or an amend, re-enter this pipeline at step 5: the gates re-run because the counters moved
|
|
102
|
+
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:`, a slot the human's word contradicts, and new inbox entries (`ai-factory gcf inbox add --category <c>`)
|
|
99
103
|
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
|
|
100
104
|
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
|
|
101
105
|
24. with `--worktree`, step 17 is: commit everything but `gcf/.metrics`, then run `ai-factory gcf verify <id> --mark`; the harness merges the branch
|