gcf-aif-ext 0.12.0 → 0.12.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/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.12.0",
4
+ "version": "0.12.2",
5
5
  "description": "Game Context Framework for AI Factory",
6
6
  "skills": [
7
7
  "skills/gcf-init",
package/lib/config-set.js CHANGED
@@ -146,6 +146,28 @@ export const SETTINGS = [
146
146
 
147
147
  const BY_KEY = new Map(SETTINGS.map((s) => [s.key, s]));
148
148
 
149
+ // What a settings screen groups the keys under, in its order.
150
+ /** @type {[string, string[]][]} */
151
+ const GROUPS = [
152
+ ['Language', ['language.ui', 'language.artifacts']],
153
+ ['Runs', ['run_mode', 'plan_passes', 'dod_attempts']],
154
+ ['Checks (DoD)', ['dod.test', 'dod.build', 'dod_timeout_min']],
155
+ ['Chat', ['chat.ask', 'chat.answer_timeout_min']],
156
+ ['Context', ['context_handoff_pct', 'context_window', 'auto_compact_pct']],
157
+ [
158
+ 'Limits',
159
+ [
160
+ 'wip_built_limit',
161
+ 'tune_limit',
162
+ 'unplayed_warn_after',
163
+ 'built_stale_after_commits',
164
+ 'question_stale_after_commits',
165
+ ],
166
+ ],
167
+ ['Design import', ['context_budget', 'pillars_budget', 'envelope_default_spread']],
168
+ ];
169
+ const GROUP_OF = new Map(GROUPS.flatMap(([group, keys]) => keys.map((k) => [k, group])));
170
+
149
171
  /** The default a setting holds while its file does not set it; the artifacts follow the ui. */
150
172
  function defaultOf(s, aif) {
151
173
  const [head, sub] = s.key.split('.');
@@ -158,9 +180,9 @@ function defaultOf(s, aif) {
158
180
  }
159
181
 
160
182
  /**
161
- * Each setting with what its file sets (null: not set, the default holds) and its default:
162
- * what a settings screen shows. `raw` is the parsed config.yml, before the defaults; `aif` the
163
- * parsed `.ai-factory/config.yaml`.
183
+ * Each setting with its group, what its file sets (null: not set, the default holds) and its
184
+ * default: what a settings screen shows, by group. `raw` is the parsed config.yml, before the
185
+ * defaults; `aif` the parsed `.ai-factory/config.yaml`.
164
186
  */
165
187
  export function settingsOf(raw, aif = {}) {
166
188
  return SETTINGS.map((s) => {
@@ -174,7 +196,12 @@ export function settingsOf(raw, aif = {}) {
174
196
  // AI Factory's file is not checked by GCF's rules: a value that is no language shows unset.
175
197
  const shown = s.file ? languageIn(aif, sub) : value;
176
198
 
177
- return { ...s, value: shown, default: defaultOf(s, aif) };
199
+ return {
200
+ ...s,
201
+ group: GROUP_OF.get(s.key) ?? 'Other',
202
+ value: shown,
203
+ default: defaultOf(s, aif),
204
+ };
178
205
  });
179
206
  }
180
207
 
package/lib/domain.js CHANGED
@@ -20,6 +20,10 @@ const COLUMN_TEXT = {
20
20
  parked: ['parked', 'A bug kept as a known issue; unblock takes it back to ready'],
21
21
  };
22
22
 
23
+ // The statuses where only the operator moves an item on (Board-PRD §1.3, "waiting for me"):
24
+ // a verdict, a decision, a playtest, an unblock. Parked waits by choice, not on the operator.
25
+ const HUMAN = new Set(['blocked', 'awaiting-verdict', 'awaiting-decision', 'unplayed']);
26
+
23
27
  const GATE_HELP = {
24
28
  verdict: 'Closed by a playtest: keep, tune or kill',
25
29
  auto: 'Closed by the run itself when its checks are green; no playtest',
@@ -82,17 +86,24 @@ const ITEM_SPECS = {
82
86
  fields: [CONSTRAINT, UNVERIFIED, UNTICKED],
83
87
  rare: true,
84
88
  },
85
- 'verdict:keep': verdict('keep', 'Played and kept: it goes to history', [
86
- { key: 'note', label: 'Note', kind: 'text' },
87
- CONSTRAINT,
88
- ]),
89
+ // A keep stores no note (`gcf verdict --note` is a tune's remark, a kill's reason).
90
+ 'verdict:keep': verdict('keep', 'Played and kept: it goes to history', [CONSTRAINT]),
89
91
  'verdict:tune': verdict('tune', 'Played; needs a change: back to ready with the note', [
90
92
  { key: 'note', label: 'What to change', kind: 'longtext', required: true },
91
93
  ]),
92
94
  'verdict:kill': verdict(
93
95
  'kill',
94
96
  'Played and rejected: it goes to the graveyard',
95
- [{ key: 'note', label: 'Why', kind: 'longtext' }, REMOVE],
97
+ [
98
+ { key: 'note', label: 'Why', kind: 'longtext' },
99
+ {
100
+ key: 'tags',
101
+ label: 'Graveyard tags',
102
+ kind: 'tags',
103
+ help: 'How the graveyard finds it again; its systems when none',
104
+ },
105
+ REMOVE,
106
+ ],
96
107
  true,
97
108
  ),
98
109
  'decide:go': decide('go', 'Approved: it goes to history as decided'),
@@ -430,6 +441,7 @@ export function domainOf(extensions = {}) {
430
441
  status,
431
442
  label: COLUMN_TEXT[status][0],
432
443
  help: COLUMN_TEXT[status][1],
444
+ ...(HUMAN.has(status) && { human: true }),
433
445
  })),
434
446
  moves: {
435
447
  ...(harness && { run: RUN }),
package/lib/integrate.js CHANGED
@@ -39,6 +39,14 @@ export async function excludeSession(projectDir) {
39
39
 
40
40
  const METRICS = ':(exclude)gcf/.metrics';
41
41
 
42
+ /** A worktree's own audit and context lines in gcf/.metrics are no work to keep: dropped. */
43
+ function dropLogs(dir) {
44
+ // Staged ones too: checkout restores from the index.
45
+ git(dir, ['reset', '-q', '--', 'gcf/.metrics'], { check: false });
46
+ git(dir, ['checkout', '--', 'gcf/.metrics'], { check: false });
47
+ git(dir, ['clean', '-fdq', '--', 'gcf/.metrics'], { check: false });
48
+ }
49
+
42
50
  /**
43
51
  * A merge stopped on gcf/INDEX.md alone: both sides counted something (an inbox entry a branch
44
52
  * added, a move on main). The index is generated, so it is written again and the merge goes on,
@@ -69,6 +77,8 @@ async function mergedPastIndex(dir) {
69
77
  async function syncWithMain(projectDir, dir) {
70
78
  const main = git(projectDir, ['rev-parse', '--abbrev-ref', 'HEAD']).out;
71
79
  if (main === 'HEAD' || main.startsWith('work/')) return {};
80
+ // An earlier run's lines in the worktree's logs would stop main's newer logs merging in.
81
+ dropLogs(dir);
72
82
  const res = git(dir, ['merge', '--no-edit', '-m', `gcf(sync): ${main}`, main], { check: false });
73
83
  if (res.ok || (await mergedPastIndex(dir))) return {};
74
84
  if (git(dir, ['rev-parse', '-q', '--verify', 'MERGE_HEAD'], { check: false }).ok)
@@ -151,9 +161,7 @@ function cleanUp(projectDir, id, { force = false } = {}) {
151
161
  const notes = [];
152
162
  const dir = worktreeOf(projectDir, id);
153
163
  if (existsSync(dir)) {
154
- // The run's own audit and context lines are no work to keep.
155
- git(dir, ['checkout', '--', 'gcf/.metrics'], { check: false });
156
- git(dir, ['clean', '-fdq', '--', 'gcf/.metrics'], { check: false });
164
+ dropLogs(dir);
157
165
  const res = git(projectDir, ['worktree', 'remove', dir], { check: false });
158
166
  if (!res.ok) notes.push(`worktree kept: ${res.err}`);
159
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcf-aif-ext",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "Game Context Framework for AI Factory",
5
5
  "type": "module",
6
6
  "license": "MIT",