gcf-aif-ext 0.34.0 → 0.36.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 +26 -5
- package/commands/gcf.js +278 -55
- package/extension.json +1 -1
- package/lib/agent-permissions.js +28 -4
- package/lib/board.js +10 -2
- package/lib/changes.js +7 -1
- package/lib/commit-move.js +55 -10
- package/lib/config-set.js +52 -14
- package/lib/domain.js +144 -11
- package/lib/gcf-paths.js +13 -2
- package/lib/git.js +38 -14
- package/lib/inbox-categories.js +3 -0
- package/lib/inbox.js +69 -4
- package/lib/lessons.js +133 -4
- package/lib/plan-check.js +339 -37
- package/lib/review.js +111 -2
- package/lib/rules.js +428 -0
- package/lib/validate-item.js +9 -0
- package/lib/work-ops.js +106 -48
- package/package.json +1 -1
- package/profiles/plan.md +1 -1
- package/schemas/item.schema.json +4 -0
- package/skills/gcf-chat/SKILL.md +14 -10
- package/skills/gcf-triage/SKILL.md +19 -1
- package/templates/agents-block.md +14 -2
- package/templates/config.yml +10 -6
package/lib/work-ops.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createHash } from 'node:crypto';
|
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
import { parse, serialize } from './frontmatter.js';
|
|
12
12
|
import { buildLedger } from './ledger.js';
|
|
13
|
-
import { readConfig, RUN_MODES, RUN_WORD } from './gcf-paths.js';
|
|
13
|
+
import { readConfig, RUN_MODES, RUN_PHASES, RUN_WORD } from './gcf-paths.js';
|
|
14
14
|
import { atomicWrite, resolveInside } from './safe-path.js';
|
|
15
15
|
import { allowedFrom, decisionFits, FEATURE_ONLY, fromOf } from './transitions.js';
|
|
16
16
|
import { ITEM_TYPES, DEFAULT_GATE, GATES, SEVERITIES, UNIT_ITEM_TYPES } from './validate-item.js';
|
|
@@ -37,14 +37,14 @@ import {
|
|
|
37
37
|
revertDelta,
|
|
38
38
|
knownIssueOf,
|
|
39
39
|
} from './live.js';
|
|
40
|
-
import { inboxEntry,
|
|
40
|
+
import { entryIds, inboxEntry, planTakeGroup, untrackedEntries } from './inbox.js';
|
|
41
41
|
import { cycleMessage, dependsGraph, gameMilestones, pathTo } from './design-check.js';
|
|
42
42
|
import { refuseByPhase } from './phase.js';
|
|
43
43
|
import { locked, runHolder } from './main-lock.js';
|
|
44
44
|
import { dropAgentSession, ownsMark, releaseSession, sessionActive } from './session-mark.js';
|
|
45
45
|
import { clearCard, inSwitch, isShelved, leaveFolder, wholeOnShelf } from './shelf.js';
|
|
46
46
|
import { dropStamp, unverifiedProblem } from './verify-stamp.js';
|
|
47
|
-
import { planTicks } from './plan-check.js';
|
|
47
|
+
import { planTicks, snapshotFiles, stallOf } from './plan-check.js';
|
|
48
48
|
import {
|
|
49
49
|
commitPaths,
|
|
50
50
|
dirtyGcf,
|
|
@@ -249,6 +249,7 @@ async function finish(m, key, tail, commit) {
|
|
|
249
249
|
inputs: m.inputs,
|
|
250
250
|
key,
|
|
251
251
|
items: [...m.items],
|
|
252
|
+
proposal: m.proposal,
|
|
252
253
|
});
|
|
253
254
|
// A move on the item ends the session that worked it: the board stops showing it running,
|
|
254
255
|
// and no rerun resumes it.
|
|
@@ -896,7 +897,7 @@ async function tune(m, note) {
|
|
|
896
897
|
if (item.data.status === 'unplayed') unplay(m, item);
|
|
897
898
|
const body = note ? await upsertItemNote(item, 'tuning', note) : item.body;
|
|
898
899
|
const data = {
|
|
899
|
-
...newCycle(without(item.data, 'frozen')),
|
|
900
|
+
...newCycle(m, without(item.data, 'frozen')),
|
|
900
901
|
status: 'ready',
|
|
901
902
|
tune_count: tunes + 1,
|
|
902
903
|
since: null,
|
|
@@ -907,12 +908,19 @@ async function tune(m, note) {
|
|
|
907
908
|
|
|
908
909
|
/**
|
|
909
910
|
* The card back to planning (Hold-Plan d12): a new planning cycle, so the passes before it no
|
|
910
|
-
* longer count, and the operator's answer to an old stall goes with them.
|
|
911
|
+
* longer count, and the operator's answer to an old stall goes with them. A plan review stalled
|
|
912
|
+
* and not accepted drops its snapshot too: the next pass is full, not a diff blind to the stalled
|
|
913
|
+
* findings (Plan-Review-Rework-Plan d3).
|
|
911
914
|
*/
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
});
|
|
915
|
+
function newCycle(m, data) {
|
|
916
|
+
const stall = stallOf(m.item.data, 'plan');
|
|
917
|
+
if (stall && !stall.accepted) {
|
|
918
|
+
const { snap, next } = snapshotFiles(m.projectDir, String(m.item.data.id));
|
|
919
|
+
m.step(() => [snap, next].forEach((f) => rmSync(f, { force: true })));
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
return { ...without(data, 'stall'), plan_cycle: Number(data.plan_cycle ?? 0) + 1 };
|
|
923
|
+
}
|
|
916
924
|
|
|
917
925
|
// Where the operator played it: a note for the history, never a condition (Plan, C).
|
|
918
926
|
const playedNote = (playedOn) => (playedOn?.length ? ` (played on: ${playedOn.join('; ')})` : '');
|
|
@@ -1220,7 +1228,7 @@ async function unblockItemUnlocked(projectDir, id, opts = {}) {
|
|
|
1220
1228
|
const childDied = / child \S+ died/.test(String(m.item.data.blocked ?? ''));
|
|
1221
1229
|
const waits = m.item.data.type === 'feature' && childDied;
|
|
1222
1230
|
const data = {
|
|
1223
|
-
...newCycle(without(m.item.data, 'blocked')),
|
|
1231
|
+
...newCycle(m, without(m.item.data, 'blocked')),
|
|
1224
1232
|
status: waits ? 'awaiting-decision' : 'ready',
|
|
1225
1233
|
since: waits ? headHash(projectDir) : null,
|
|
1226
1234
|
};
|
|
@@ -1310,24 +1318,29 @@ function replaceNamed(body, text, item, order) {
|
|
|
1310
1318
|
return blocks.reduce((b, { key, lines }) => replaceBlock(b, key, lines, order ?? []), body);
|
|
1311
1319
|
}
|
|
1312
1320
|
|
|
1313
|
-
/**
|
|
1314
|
-
|
|
1321
|
+
/**
|
|
1322
|
+
* The inbox entries a fix takes (`--from in-a,in-b`): their words for `notes:` (a bullet each
|
|
1323
|
+
* when more than one), their pictures to the card, one by one.
|
|
1324
|
+
*/
|
|
1325
|
+
async function amendEntry(projectDir, m, ids, add) {
|
|
1315
1326
|
if (onWorkBranch(projectDir))
|
|
1316
1327
|
throw new Error('an inbox entry is taken on main: a work/ branch records no inbox move');
|
|
1317
1328
|
const id = String(m.item.data.id);
|
|
1318
|
-
const take = await
|
|
1329
|
+
const take = await planTakeGroup(m.root, ids, path.join(m.root, 'work', id, 'attachments'));
|
|
1319
1330
|
const taken = take.pictures.filter((f) => existsSync(f)).map((f) => path.basename(f));
|
|
1320
1331
|
if (taken.length)
|
|
1321
1332
|
throw new Error(`gcf/work/${id}/attachments/ already holds ${taken.join(', ')}: rename it`);
|
|
1322
|
-
const relink = (s) =>
|
|
1323
|
-
|
|
1333
|
+
const relink = (s) => take.relink(s, id);
|
|
1334
|
+
if (ids.length > 1) return { ...take, note: groupNote(take.entries, relink, add), relink };
|
|
1335
|
+
const [entry] = take.entries;
|
|
1336
|
+
const lines = entry.text.split('\n');
|
|
1324
1337
|
const rest = lines
|
|
1325
1338
|
.slice(lines.findIndex((l) => l.trim()) + 1)
|
|
1326
1339
|
.join('\n')
|
|
1327
1340
|
.trim();
|
|
1328
1341
|
|
|
1329
1342
|
// An entry of one line is its title: nothing of what it says may be lost with it.
|
|
1330
|
-
return { ...take, note: relink(rest ||
|
|
1343
|
+
return { ...take, note: relink(rest || entry.title), relink };
|
|
1331
1344
|
}
|
|
1332
1345
|
|
|
1333
1346
|
/**
|
|
@@ -1337,22 +1350,24 @@ async function amendEntry(projectDir, m, from) {
|
|
|
1337
1350
|
* writes nothing and may read a card a run holds: a form and a proposal show it.
|
|
1338
1351
|
* @param {string} projectDir
|
|
1339
1352
|
* @param {string} id
|
|
1340
|
-
* @param {{text?: string, add?: string, title?: string, from?: string, base?: string,
|
|
1341
|
-
* dryRun?: boolean, commit?: boolean}} [opts]
|
|
1353
|
+
* @param {{text?: string, add?: string, title?: string, from?: string | string[], base?: string,
|
|
1354
|
+
* dryRun?: boolean, commit?: boolean, proposal?: string}} [opts]
|
|
1342
1355
|
*/
|
|
1343
1356
|
async function amendItemUnlocked(projectDir, id, opts = {}) {
|
|
1344
1357
|
const { dryRun = false, commit = true } = opts;
|
|
1345
1358
|
const asked = amendAsked(opts);
|
|
1346
1359
|
const m = await begin(projectDir, id, 'amend', dryRun ? () => {} : refuseAmendLive);
|
|
1347
|
-
const
|
|
1360
|
+
const from = entryIds(asked.from);
|
|
1361
|
+
const entry = from.length ? await amendEntry(projectDir, m, from, asked.add) : null;
|
|
1348
1362
|
const { body, title } = await amendedCard(m.item, asked, entry);
|
|
1349
1363
|
const changes = amendChanges(m.item, title, body);
|
|
1350
1364
|
if (dryRun) return { id, base: amendBase(m.item), title, text: amendableText(body), changes };
|
|
1351
1365
|
refuseAmendPointless(m.item, { asked, base: opts.base, changes, entry });
|
|
1352
1366
|
if (entry) carryEntry(m, entry, commit);
|
|
1353
|
-
const data = newCycle(asked.title ? { ...m.item.data, title } : m.item.data);
|
|
1367
|
+
const data = newCycle(m, asked.title ? { ...m.item.data, title } : m.item.data);
|
|
1354
1368
|
m.step(() => writeItem(m.item, data, body));
|
|
1355
1369
|
if (m.item.data.status === 'ready') dropPlayNotesOf(m);
|
|
1370
|
+
m.proposal = opts.proposal;
|
|
1356
1371
|
|
|
1357
1372
|
return { id, changes, hash: await finish(m, 'amend', id, commit) };
|
|
1358
1373
|
}
|
|
@@ -1788,17 +1803,30 @@ async function setDependsUnlocked(projectDir, id, { add = [], remove = [], commi
|
|
|
1788
1803
|
return { id, depends, hash };
|
|
1789
1804
|
}
|
|
1790
1805
|
|
|
1806
|
+
/**
|
|
1807
|
+
* The field `gcf item agent` sets of `model` or `effort`: the item's own, or with `phase` the
|
|
1808
|
+
* phase's (`plan_model`); `keyOf('')` is the commit's word of the phase (`plan `, or none).
|
|
1809
|
+
*/
|
|
1810
|
+
function agentKeyOf(phase) {
|
|
1811
|
+
if (phase === undefined) return (k) => k;
|
|
1812
|
+
if (!RUN_PHASES.includes(phase)) throw new Error(`--phase is ${RUN_PHASES.join(' | ')}`);
|
|
1813
|
+
|
|
1814
|
+
return (k) => (k ? `${phase}_${k}` : `${phase} `);
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1791
1817
|
/**
|
|
1792
1818
|
* Set how item `id`'s runs go: its `model` and `effort`, each given one a plain word, `default`
|
|
1793
|
-
* taking the field off (the project's `agent.model|effort`, else Opus and High).
|
|
1794
|
-
* `
|
|
1819
|
+
* taking the field off (the project's `agent.model|effort`, else Opus and High). With `phase`
|
|
1820
|
+
* (`plan`, `implement`: Plan-Review-Rework-Plan d10) the phase's own `<phase>_model|effort`,
|
|
1821
|
+
* over the item's in that phase. One commit `gcf(item)`. A run in progress keeps
|
|
1795
1822
|
* its own; the item's next run takes the new value.
|
|
1796
1823
|
* @param {string} projectDir
|
|
1797
1824
|
* @param {string} id
|
|
1798
|
-
* @param {{model?: string, effort?: string, commit?: boolean}} [opts]
|
|
1825
|
+
* @param {{model?: string, effort?: string, phase?: string, commit?: boolean}} [opts]
|
|
1799
1826
|
*/
|
|
1800
|
-
async function setAgentUnlocked(projectDir, id, { model, effort, commit = true } = {}) {
|
|
1827
|
+
async function setAgentUnlocked(projectDir, id, { model, effort, phase, commit = true } = {}) {
|
|
1801
1828
|
if (model === undefined && effort === undefined) throw new Error('give --model or --effort');
|
|
1829
|
+
const keyOf = agentKeyOf(phase);
|
|
1802
1830
|
checkRunWords({ model, effort });
|
|
1803
1831
|
const ledger = await buildLedger(projectDir);
|
|
1804
1832
|
const item = ledger.item(id);
|
|
@@ -1806,15 +1834,17 @@ async function setAgentUnlocked(projectDir, id, { model, effort, commit = true }
|
|
|
1806
1834
|
refuseRunning(projectDir, id);
|
|
1807
1835
|
const data = { ...item.data };
|
|
1808
1836
|
for (const [k, v] of Object.entries({ model, effort }))
|
|
1809
|
-
if (v === AGENT_DEFAULT) delete data[k];
|
|
1810
|
-
else if (v !== undefined) data[k] = v;
|
|
1811
|
-
const
|
|
1837
|
+
if (v === AGENT_DEFAULT) delete data[keyOf(k)];
|
|
1838
|
+
else if (v !== undefined) data[keyOf(k)] = v;
|
|
1839
|
+
const [m, e] = RUN_KEYS.map((k) => data[keyOf(k)] ?? null);
|
|
1840
|
+
const result = { id, ...(phase && { phase }), model: m, effort: e };
|
|
1812
1841
|
// The values it has already: nothing to commit (a form sent as it was opened).
|
|
1813
|
-
if (RUN_KEYS.every((k) => data[k] === item.data[k]))
|
|
1814
|
-
|
|
1842
|
+
if (RUN_KEYS.every((k) => data[keyOf(k)] === item.data[keyOf(k)]))
|
|
1843
|
+
return { ...result, hash: null };
|
|
1844
|
+
const shown = (k) => `${k} ${data[keyOf(k)] ?? AGENT_DEFAULT}`;
|
|
1815
1845
|
const hash = await commitMove(
|
|
1816
1846
|
projectDir,
|
|
1817
|
-
`gcf(item): ${id} ${shown('model')}, ${shown('effort')}`,
|
|
1847
|
+
`gcf(item): ${id} ${keyOf('')}${shown('model')}, ${shown('effort')}`,
|
|
1818
1848
|
{
|
|
1819
1849
|
files: [item.file],
|
|
1820
1850
|
inputs: [item.file],
|
|
@@ -1971,7 +2001,8 @@ function parentWrite(ledger, spec) {
|
|
|
1971
2001
|
* its inbox entry's.
|
|
1972
2002
|
*/
|
|
1973
2003
|
async function titleForId(root, spec) {
|
|
1974
|
-
const
|
|
2004
|
+
const first = entryIds(spec.from)[0];
|
|
2005
|
+
const title = spec.title?.trim() || (first ? (await inboxEntry(root, first)).title : '');
|
|
1975
2006
|
if (!title)
|
|
1976
2007
|
throw new Error('a new item needs --title (or --from an inbox entry): its id comes from it');
|
|
1977
2008
|
|
|
@@ -2049,6 +2080,40 @@ async function newItemUnlocked(projectDir, given) {
|
|
|
2049
2080
|
return { id: spec.id, item: `gcf/work/${spec.id}.md`, hash };
|
|
2050
2081
|
}
|
|
2051
2082
|
|
|
2083
|
+
/**
|
|
2084
|
+
* The note of the one entry an item takes: the rest of its text past its title, the whole text
|
|
2085
|
+
* when the item's title is another. Its own title given back as it is (a board's "→ item")
|
|
2086
|
+
* counts as the same one.
|
|
2087
|
+
*/
|
|
2088
|
+
function entryNote({ title: own, text }, given, relink) {
|
|
2089
|
+
if (given !== undefined && given !== own && given !== relink(own)) return relink(text);
|
|
2090
|
+
const lines = text.split('\n');
|
|
2091
|
+
|
|
2092
|
+
return relink(
|
|
2093
|
+
lines
|
|
2094
|
+
.slice(lines.findIndex((l) => l.trim()) + 1)
|
|
2095
|
+
.join('\n')
|
|
2096
|
+
.trim(),
|
|
2097
|
+
);
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
/**
|
|
2101
|
+
* The note of a group of entries taken at once (Lessons-Review-Plan d3): a bullet each, its id
|
|
2102
|
+
* first. Refused past NOTE_MAX unless a note is given in its place: a card's run reads it whole.
|
|
2103
|
+
*/
|
|
2104
|
+
function groupNote(entries, relink, given) {
|
|
2105
|
+
const note = relink(
|
|
2106
|
+
entries.map(({ id, text }) => `- ${id}: ${text.replace(/\n(?=.)/g, '\n ')}`).join('\n'),
|
|
2107
|
+
);
|
|
2108
|
+
if (!given?.trim() && note.length > NOTE_MAX)
|
|
2109
|
+
throw new Error(
|
|
2110
|
+
`the ${entries.length} entries are ${note.length} characters, a note takes up to ` +
|
|
2111
|
+
`${NOTE_MAX}: shorten or split the group`,
|
|
2112
|
+
);
|
|
2113
|
+
|
|
2114
|
+
return note;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2052
2117
|
/**
|
|
2053
2118
|
* The inbox entry an item comes from (`--from`): its title for the item's unless one is given,
|
|
2054
2119
|
* the rest of its text for the item's `note:` (the whole text when the title is another), its
|
|
@@ -2057,7 +2122,8 @@ async function newItemUnlocked(projectDir, given) {
|
|
|
2057
2122
|
* one: raw input. No `from`: nothing to take.
|
|
2058
2123
|
*/
|
|
2059
2124
|
async function takeEntry(projectDir, root, spec) {
|
|
2060
|
-
|
|
2125
|
+
const ids = entryIds(spec.from);
|
|
2126
|
+
if (!ids.length)
|
|
2061
2127
|
return {
|
|
2062
2128
|
title: spec.title,
|
|
2063
2129
|
note: undefined,
|
|
@@ -2072,23 +2138,15 @@ async function takeEntry(projectDir, root, spec) {
|
|
|
2072
2138
|
// An empty folder a failed try left behind holds nothing to overwrite.
|
|
2073
2139
|
if (existsSync(pictures) && readdirSync(pictures).length)
|
|
2074
2140
|
throw new Error(`gcf/work/${spec.id}/attachments/ already exists`);
|
|
2075
|
-
const take = await
|
|
2076
|
-
const
|
|
2077
|
-
|
|
2078
|
-
// The entry's own title, given back as it is (a board's "→ item"), counts as the same one.
|
|
2079
|
-
// A blank --title is none: the entry's own goes.
|
|
2141
|
+
const take = await planTakeGroup(root, ids, pictures);
|
|
2142
|
+
const relink = (s) => take.relink(s, spec.id);
|
|
2143
|
+
// A blank --title is none: the first entry's own goes.
|
|
2080
2144
|
const given = spec.title?.trim() ? spec.title : undefined;
|
|
2081
|
-
const
|
|
2082
|
-
const
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
? lines
|
|
2087
|
-
.slice(first + 1)
|
|
2088
|
-
.join('\n')
|
|
2089
|
-
.trim()
|
|
2090
|
-
: text;
|
|
2091
|
-
const note = relink(rest);
|
|
2145
|
+
const title = relink(given ?? take.entries[0].title);
|
|
2146
|
+
const note =
|
|
2147
|
+
ids.length > 1
|
|
2148
|
+
? groupNote(take.entries, relink, spec.note)
|
|
2149
|
+
: entryNote(take.entries[0], given, relink);
|
|
2092
2150
|
const loose = spec.commit ? untrackedEntries(projectDir) : [];
|
|
2093
2151
|
|
|
2094
2152
|
return {
|
package/package.json
CHANGED
package/profiles/plan.md
CHANGED
|
@@ -48,5 +48,5 @@ custom_sections:
|
|
|
48
48
|
- none: a fact that fits no block belongs to the item or to a decision
|
|
49
49
|
|
|
50
50
|
enforcement:
|
|
51
|
-
- `ai-factory gcf plan check` lists every form problem as a `format:` line, and never blocks on one: a format line is polish
|
|
51
|
+
- `ai-factory gcf plan check` lists every form problem as a `format:` line, and never blocks on one: a format line is polish the plan's author applies; a size line says the plan holds fixture-level detail the implementer's tests own
|
|
52
52
|
- a plan already in work (a ticked task) is not asked to change its form
|
package/schemas/item.schema.json
CHANGED
|
@@ -130,6 +130,10 @@
|
|
|
130
130
|
},
|
|
131
131
|
"model": { "$ref": "#/definitions/textOrNull" },
|
|
132
132
|
"effort": { "$ref": "#/definitions/textOrNull" },
|
|
133
|
+
"plan_model": { "$ref": "#/definitions/textOrNull" },
|
|
134
|
+
"plan_effort": { "$ref": "#/definitions/textOrNull" },
|
|
135
|
+
"implement_model": { "$ref": "#/definitions/textOrNull" },
|
|
136
|
+
"implement_effort": { "$ref": "#/definitions/textOrNull" },
|
|
133
137
|
"run_mode": { "enum": ["main", "worktree", null] },
|
|
134
138
|
"version": {
|
|
135
139
|
"anyOf": [{ "type": "null" }, { "type": "string", "pattern": "^\\S+$" }]
|
package/skills/gcf-chat/SKILL.md
CHANGED
|
@@ -24,6 +24,7 @@ preconditions:
|
|
|
24
24
|
|
|
25
25
|
forbidden_behaviors:
|
|
26
26
|
- do not make the human's moves: `verdict`, `decide`, `question answer`, `unblock`, `item amend`, `phase next`, `pillar`, `permissions`, `config set`, `hooks-install`, `edits commit`, `edits discard`, `changes commit`; the rules refuse them
|
|
27
|
+
- do not run `rules add`, `rules save` or `lessons report` either: they are the human's moves too
|
|
27
28
|
- do not put a decision about a live item into the inbox or a new item: a run reads neither, and it blocks on what its card does not say; the decision goes into the card with `propose_amend`
|
|
28
29
|
- do not add a line to `notes:` that contradicts a slot of the card: replace the slot through `text`, as only the slots reach the documents of the systems
|
|
29
30
|
- do not run a verdict, a decision, an unblock or an answer: propose it to the human with its `propose_` tool
|
|
@@ -53,16 +54,19 @@ workflow:
|
|
|
53
54
|
8. a bug, an idea or a task that is new work: call `propose_item_new` with its title, type, subsystems and a note of what its run should know, no id: the core makes it from the title; note length <= 4000 characters
|
|
54
55
|
9. a raw thought that is not work yet: propose it for the inbox with `propose_inbox_add` and the category it is: `idea`, `request` (what only a person can give), `bug` or `finding` (a remark about the code), a detail word when one fits
|
|
55
56
|
10. a move the human asks for, or one the talk shows is due, that has a `propose_<move>` tool: call it with the `id` of the item, inbox entry or question it acts on, and say why in one line; name an item by its title with the id in brackets
|
|
56
|
-
11.
|
|
57
|
-
12.
|
|
58
|
-
13.
|
|
59
|
-
14.
|
|
60
|
-
15.
|
|
61
|
-
16.
|
|
62
|
-
17.
|
|
63
|
-
18.
|
|
64
|
-
19.
|
|
65
|
-
20.
|
|
57
|
+
11. several inbox entries of one cause go as one proposal: `ids` of `propose_inbox_later` and `propose_inbox_drop` (its `reason`, and `of` for what it duplicates or what did it), `from` of `propose_item_new` and of `propose_amend`
|
|
58
|
+
12. a standing rule for the project's agents: `propose_rules_add` with one line in `language.ui` that `own_rules` of `ai-factory gcf rules --json` lacks, the entries it settles in `from`
|
|
59
|
+
13. a lesson about GCF or the template: `propose_lessons_report` with the lessons in `from` and `to` as `framework` or `template`
|
|
60
|
+
14. a kill, a no or a wontfix: its reason is the human's words; the graveyard keeps it, and the move does not go without it
|
|
61
|
+
15. an open D1 question the talk answers: call `propose_question_answer` with its id and the human's words, or your draft when the human asks for one
|
|
62
|
+
16. an item to play: read its handoff (`ai-factory gcf item show <id>`, or `handoff` in the context file); say its main question, what to try, and which row of Play by platform is ready
|
|
63
|
+
17. then call `propose_play` with its `id`, a `target` and, for a target with devices, the `device` id: the human's click starts it and opens it, and the verdict stops it
|
|
64
|
+
18. the context file says no `play:` is set up and the project's `AGENTS.md` says how the game builds and starts: call `propose_play_setup` with those commands; say what is missing when it does not say
|
|
65
|
+
19. a Set up pass over a `play:` with no `plays_on`: propose `play.builds` with rows from the `platforms` of `gcf/game.md`, and targets with `build`, `for`, `devices` and `launches`
|
|
66
|
+
20. one `propose_play_setup` per build, named in `of`; a release command goes with `profile: release`; `auto_build` names the build a run's card gets
|
|
67
|
+
21. in that pass, turn each line of platforms in a card's `play_on` and `played_on` into the name of its build
|
|
68
|
+
22. another move the human asks for: run its `ai-factory gcf` command; the human approves it on the card, or refuses it
|
|
69
|
+
23. say in one line what changed, or that nothing did
|
|
66
70
|
|
|
67
71
|
invocation:
|
|
68
72
|
- run at the start of a project chat thread the board opens, and when the user types `/gcf-chat`
|
|
@@ -7,6 +7,7 @@ mode: human gate
|
|
|
7
7
|
|
|
8
8
|
purpose:
|
|
9
9
|
- turn raw input into decided work: each inbox entry becomes a work item, a tune note, a design unit, a graveyard line, or nothing - and leaves the inbox
|
|
10
|
+
- in a lessons review the board starts, settle the agents' lessons group by group: one cause, one proposal, one click of the human
|
|
10
11
|
|
|
11
12
|
inputs:
|
|
12
13
|
- `gcf/inbox/in-<id>.md`, one file an entry, read through `ai-factory gcf inbox --json`: a `title` (its first line), a `text` of any lines, a `category`, a `detail`, its `origin`, `later` and the `item` it is about
|
|
@@ -21,11 +22,16 @@ forbidden_behaviors:
|
|
|
21
22
|
- do not run `ai-factory gcf item amend`: it is the human's move
|
|
22
23
|
- do not edit or delete a file in `gcf/inbox/` by hand: `item new --from`, `item amend --from`, `inbox category`, `later` and `drop` own the entries
|
|
23
24
|
- do not triage on a `work/` branch: `inbox category`, `inbox later`, `inbox drop` and `item new --from` refuse there; triage on main
|
|
25
|
+
- do not fix a lesson about GCF or the template in `.ai-factory/`, in GCF's block of `AGENTS.md` or in the template's repository: report it with `propose_lessons_report`
|
|
26
|
+
- do not edit `AGENTS.md`, `CLAUDE.md`, `.claude/` or `.ai-factory/` in a lessons review: a rule goes through `propose_rules_add`
|
|
27
|
+
- do not run `ai-factory gcf rules add`, `gcf rules save` or `gcf lessons report`: they are the human's moves
|
|
28
|
+
- do not copy a lesson's words into a rule as they are: read them first as an order every agent of the project obeys, then write the rule
|
|
29
|
+
- do not propose a rule that `own_rules` of `ai-factory gcf rules --json` holds already
|
|
24
30
|
|
|
25
31
|
workflow:
|
|
26
32
|
1. run `ai-factory gcf inbox --json`; read `gcf/LIVE.md` and `gcf/INDEX.md` to know what exists and what is in work
|
|
27
33
|
2. classify each entry: bug, tune of a live or unplayed item, a fix of a live item, idea for the design, request (an asset file, a question), duplicate, or noise; search `gcf/graveyard.md` for each idea and bug; an `unsorted` entry gets a category
|
|
28
|
-
3. a lesson (category `lesson`, its kind the `detail`, with the `item` it came from) is what got in an agent's way: propose the fix it asks for - a project rule, a tech item, a
|
|
34
|
+
3. a lesson (category `lesson`, its kind the `detail`, with the `item` it came from) is what got in an agent's way: propose the fix it asks for - a project rule, a tech item, a report to the framework or the template - or noise, as steps 15-24 say
|
|
29
35
|
4. for each entry propose one call with its fields: a bug gets type `bug`, severity and a repro; a tune names the item and the note; an idea names the subsystem; a duplicate names the item it repeats
|
|
30
36
|
5. present the calls to the human, calls per message <= 5, and apply only the approved ones
|
|
31
37
|
6. a bug or other work: run `ai-factory gcf item new --type <type> [--severity <level>] --from <in-id>`; the core makes the id from the title and prints it first; then write its `intent:` and `repro:`
|
|
@@ -36,6 +42,18 @@ workflow:
|
|
|
36
42
|
11. a duplicate or noise: run `ai-factory gcf inbox drop <in-id>`
|
|
37
43
|
12. an entry the human sorts: `ai-factory gcf inbox category <in-id> --category <c> [--detail <word>]` (`inbox categories` lists them); one kept for later: `ai-factory gcf inbox later <in-id>`, left in the inbox
|
|
38
44
|
13. report what each entry became and how many entries remain
|
|
45
|
+
14. a lessons review the board starts names the ids of its lessons: run `ai-factory gcf inbox --json` and `ai-factory gcf rules --json`, read the live cards the lessons name and `gcf/graveyard.md`
|
|
46
|
+
15. group the lessons by cause, through their cards and their kinds; a lesson that `own_rules` or a card already settles is done
|
|
47
|
+
16. give each group one outcome: a new item, a fix of a live card, a rule, a report, an erase or Later; done and noise lessons of other causes go together as one erase by reason
|
|
48
|
+
17. groups per message <= 5; each group gets one line of what got in the agent's way and one proposal
|
|
49
|
+
18. a new item: `propose_item_new` with every id of the group in `from`; a fix of a live card: `propose_amend` with its `id` and the group in `from`
|
|
50
|
+
19. an item that improves the project's base is type `tech`; its note has `improves:` (rule-check, diagnostic, library, tool or architecture) and `lessons:` (the ids, their words, the `file:line`)
|
|
51
|
+
20. that note also has `change:` (what to build, in the project's words) and `done when:` (the project's DoD command that shows it)
|
|
52
|
+
21. a `library` or `architecture` change goes with the gate `verdict`; the other changes take the gate of their type
|
|
53
|
+
22. a rule: `propose_rules_add` with one line in `language.ui` in `text` and the group in `from`
|
|
54
|
+
23. a lesson about GCF or the template (kind `framework` or `template`): `propose_lessons_report` with the group in `from` and `to` as `framework` or `template`
|
|
55
|
+
24. an erase: `propose_inbox_drop` with the group in `ids`, its `reason` (`done`, `duplicate` or `noise`) and `of` for the card, entry or commit; Later: `propose_inbox_later` with the group in `ids`
|
|
56
|
+
25. the human splits a group in words ("separate in-a"): propose its parts again; when the human says next, go on with the next groups
|
|
39
57
|
|
|
40
58
|
invocation:
|
|
41
59
|
- run after a playtest session, after a CI run that added entries, or when the user asks to triage
|
|
@@ -20,7 +20,10 @@ gcf_work:
|
|
|
20
20
|
- before planning an item, run `ai-factory gcf context <id>` and read only the files it lists under `gcf/`
|
|
21
21
|
- an item's plan is in the plan form: blocks `context:`, `decisions:` (records `id`, `pick`, `why`), `tasks:` (`- [ ] t1 <action> (d1)`), `pillar_check:`, `verification:`, one idea a line
|
|
22
22
|
- `ai-factory gcf plan check <id>` lists the plan's form problems as `format:` lines: fix them, they never block
|
|
23
|
-
-
|
|
23
|
+
- in a plan review the reviewer only finds; you, the plan's author, check each finding against the code, give it a verdict (`accepted`; `rejected` or `downgraded` with a `reason`) and fix the plan
|
|
24
|
+
- record the pass with `ai-factory gcf plan pass <id> --findings <file.json> --json`; its verdict decides: continue, converged or stalled
|
|
25
|
+
- `gcf review row … --kind plan` also gives `mode`: `full` is the whole plan, `check` the fixes by the diff since the earlier pass; ask only the next pass; a blocking finding needs a `scenario`
|
|
26
|
+
- record a code review's pass with `--kind code --blocking <n> --polish <m>`
|
|
24
27
|
- `ai-factory gcf review row <id> --kind plan|code --pass <k> --json` names who makes review pass k, by `review.plan|code` of `gcf/config.yml`, and its `fallback`: the stand-ins in order when that row cannot make the pass
|
|
25
28
|
- a pass a stand-in or you made records both: `ai-factory gcf plan pass <id> … --by <who made it> --for <the row>`
|
|
26
29
|
- a `stalled` verdict: `ai-factory gcf review stall <id> --kind plan|code --passes <counts>` blocks the card
|
|
@@ -121,11 +124,19 @@ gcf_work:
|
|
|
121
124
|
- a new item's `--note "<text>"` (or `--note-file -` for several lines) says what its run should know; a note <= 4000 characters
|
|
122
125
|
- in the project chat (the gcf-chat skill) propose a new item with the `propose_item_new` tool of the `gcf` MCP server, not with `item new`: the human's click makes it
|
|
123
126
|
- a decision about a live item goes into its card with the human's `ai-factory gcf item amend <id>`, never into the inbox or a new item, which a run does not read
|
|
124
|
-
- its `--text` replaces the blocks it names, `--add` adds to `notes:`; `--title` and `--from <in-
|
|
127
|
+
- its `--text` replaces the blocks it names, `--add` adds to `notes:`; `--title` and `--from <in-ids>` go with them
|
|
125
128
|
- a decision that contradicts a slot replaces the slot through `--text`; a run that finds a `notes:` line against a slot builds by the note and rewrites that slot of its own card
|
|
126
129
|
- in the project chat propose these with their `propose_` tools and the `id` they act on: an amend, a block, a drop, a dependency change, an unblock, a verdict, a decision, an answer to an open question
|
|
127
130
|
- so are the inbox's add, category, Later and erase
|
|
131
|
+
- several inbox entries of one cause go as one move and one commit: `--from in-a,in-b` of `item new` and `item amend` (a bullet each in the note), `inbox later in-a in-b`
|
|
132
|
+
- an erase says why: `inbox drop in-a in-b --reason done|duplicate|noise|reported|amended [--of <id|hash>]`
|
|
133
|
+
- their proposals take `from` or `ids`, an erase its `reason` and `of`
|
|
128
134
|
- the human's click makes each of those proposals
|
|
135
|
+
- the project's own rules for its agents are lines under `## Project rules` of `AGENTS.md`, outside this block: `ai-factory gcf rules --json` reads them and both files
|
|
136
|
+
- `gcf rules add` and `gcf rules save` are the human's moves; in the project chat propose a rule with `propose_rules_add`: one line in `language.ui`
|
|
137
|
+
- `gcf rules diff --from <hash> --to <hash> --json` shows what commits changed in the agent's instructions: `AGENTS.md`, `CLAUDE.md`, `.claude/`, `.ai-factory/` outside its plans and archive
|
|
138
|
+
- a lesson about GCF or the template goes to the human's `gcf lessons report --to framework|template`, proposed with `propose_lessons_report`; never fix it in `.ai-factory/`, in this block or in the template
|
|
139
|
+
- a tech item that improves the project's base (a rule check, a diagnostic, a library, a tool, the architecture) has a note with `improves:`, `lessons:`, `change:` and `done when:`
|
|
129
140
|
- in the project chat propose a new item by its title, never an id
|
|
130
141
|
- in the project chat propose a verdict only after the human said in the talk that they played the item and how it felt, its note in the human's words; leave the `remove` of a kill, a no or a wontfix to the rule unless the human says otherwise
|
|
131
142
|
- a move refused for hand edits under `gcf/` ends its error with `gcf-refusal: {"code":"dirty","paths":[…]}`: `ai-factory gcf edits diff --path <path>` shows them; `gcf edits commit` and `gcf edits discard` are the human's moves, never the agent's
|
|
@@ -145,6 +156,7 @@ gcf_forbidden:
|
|
|
145
156
|
- do not give a verdict: `verdict` belongs to the human, through the gcf-verdict skill; nor a decision, but `go` or `no` of the spike you drive when the gates say `decision: agent`
|
|
146
157
|
- the core refuses the human's moves to a harness run and a board chat: bring the move to the human, or block the item with the question
|
|
147
158
|
- those moves are `verdict`, `decide`, `drop` of a work item, `unblock`, `item amend`, `question answer`, `config set`, `playtest setup`, `permissions`, `phase next`, `pillar`, `hooks-install`, `edits commit`, `edits discard`, `changes commit`
|
|
159
|
+
- so are `rules add`, `rules save` and `lessons report`
|
|
148
160
|
- a run's agent does not build the game to play nor start a player: the harness builds it at the run's end, and `dod.build` only checks the code
|
|
149
161
|
- in the project chat, when the human asks for a build, run `ai-factory gcf playtest build <id>` or `ai-factory gcf playtest build --main` yourself
|
|
150
162
|
- do not answer a `TBD` of a design unit yourself: ask the human and offer your draft as the proposed answer
|
package/templates/config.yml
CHANGED
|
@@ -25,15 +25,19 @@ auto_compact_pct: 0
|
|
|
25
25
|
# ask: d1
|
|
26
26
|
# answer_timeout_min: 15
|
|
27
27
|
# The review passes of a plan and of the code before its commit (Operator-Tasks-Plan t2): row k
|
|
28
|
-
# makes pass k (agent claude or codex; a Claude model alias, a Codex family or slug; an effort)
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
28
|
+
# makes pass k (agent claude or codex; a Claude model alias, a Codex family or slug; an effort).
|
|
29
|
+
# A plan pass reviews the whole plan when no pass has seen it yet (its first pass, or a plan from
|
|
30
|
+
# before this rule), else it checks only the author's fixes since the last pass seen, a new cycle
|
|
31
|
+
# after an amend too. A pass goes on while the last one left a blocking finding, accepted,
|
|
32
|
+
# rejected or downgraded; the rows over, the card blocks for you. An empty list: no review. Row 1
|
|
33
|
+
# of the plan goes on high effort: it makes a new plan's full review. A row that cannot make its
|
|
34
|
+
# pass (no Codex, its limit, a failure) gives way to a model of its size: Codex medium to Fable
|
|
35
|
+
# medium then Opus high, Codex high and Fable medium to Opus high. Uncomment to change, or set it
|
|
36
|
+
# in Settings
|
|
33
37
|
# (ai-factory gcf config set review.plan --value "claude:opus:high, codex:astra:medium"):
|
|
34
38
|
# review:
|
|
35
39
|
# plan:
|
|
36
|
-
# - {agent: codex, model: astra, effort:
|
|
40
|
+
# - {agent: codex, model: astra, effort: high}
|
|
37
41
|
# - {agent: claude, model: fable, effort: medium}
|
|
38
42
|
# - {agent: claude, model: fable, effort: medium}
|
|
39
43
|
# code:
|