gcf-aif-ext 0.7.0 → 0.7.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 +4 -0
- package/extension.json +1 -1
- package/lib/board.js +30 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,6 +50,10 @@ Updating preserves `gcf/`, `cnlp.config.json` and the pre-commit hook. Run `ai-f
|
|
|
50
50
|
|
|
51
51
|
On Windows, run `extension add` and `extension update` from PowerShell or cmd, not Git Bash: the installer unpacks with `tar`, and Git Bash's GNU tar reads `C:\…` as a remote host (`Cannot connect to C: resolve failed`). The Windows `tar.exe` handles it.
|
|
52
52
|
|
|
53
|
+
### 0.7.1
|
|
54
|
+
|
|
55
|
+
- `gcf board --json`: a ready item's worktree with no run lock and no session mark is a run that stopped (a timeout, a stop, a crash), not a run: the item reads `running: false`, `resumable: true`, and keeps its moves; its next run resumes the worktree.
|
|
56
|
+
|
|
53
57
|
### 0.7.0
|
|
54
58
|
|
|
55
59
|
- `priority:` on an item: a rank, lower runs sooner. `ai-factory gcf prioritize <id> <id> …` ranks items in that order in one commit; `item new --priority <n>`. `gcf board --json` lists ranked items first and carries `priority`.
|
package/extension.json
CHANGED
package/lib/board.js
CHANGED
|
@@ -132,8 +132,28 @@ const SCALARS = [
|
|
|
132
132
|
'effort',
|
|
133
133
|
];
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Ranked items first, lower rank sooner. The unranked follow in dependency order: what can run
|
|
137
|
+
* now first, each item after every open item it depends on; file order breaks a tie.
|
|
138
|
+
*/
|
|
139
|
+
function inRunOrder(items) {
|
|
140
|
+
const byId = new Map(items.map((i) => [i.id, i]));
|
|
141
|
+
const depth = new Map();
|
|
142
|
+
const depthOf = (i) => {
|
|
143
|
+
if (depth.has(i.id)) return depth.get(i.id);
|
|
144
|
+
depth.set(i.id, 0); // a depends cycle stops here
|
|
145
|
+
const open = i.depends.map((d) => byId.get(d)).filter(Boolean);
|
|
146
|
+
depth.set(i.id, open.length ? 1 + Math.max(...open.map(depthOf)) : 0);
|
|
147
|
+
|
|
148
|
+
return depth.get(i.id);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// Two unranked items give NaN (Infinity - Infinity), which falls through to the depth.
|
|
152
|
+
return items.sort(
|
|
153
|
+
(a, b) => (a.priority ?? Infinity) - (b.priority ?? Infinity) || depthOf(a) - depthOf(b),
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
137
157
|
const LISTS = ['children', 'system', 'depends'];
|
|
138
158
|
|
|
139
159
|
/** One item of the board. */
|
|
@@ -141,12 +161,12 @@ async function itemOf(projectDir, c, verified) {
|
|
|
141
161
|
const id = String(c.data.id);
|
|
142
162
|
// A trailer counts only while the item waits on main for its integrate.
|
|
143
163
|
const ready = c.data.status === 'ready' && verified.has(id);
|
|
144
|
-
// `running` and `verify` are not stored (§4): a live harness run
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
164
|
+
// `running` and `verify` are not stored (§4): a live harness run lock or a fresh session mark
|
|
165
|
+
// is a run; a trailer is a passed DoD. A worktree with neither is a run that stopped (a
|
|
166
|
+
// timeout, a stop, a crash): the item is ready, and its next run resumes that worktree.
|
|
167
|
+
const running = runHolder(projectDir, id) !== null || sessionActive(projectDir, id);
|
|
168
|
+
const resumable =
|
|
169
|
+
!running && c.data.status === 'ready' && !ready && existsSync(worktreeOf(projectDir, id));
|
|
150
170
|
|
|
151
171
|
return {
|
|
152
172
|
id,
|
|
@@ -158,6 +178,7 @@ async function itemOf(projectDir, c, verified) {
|
|
|
158
178
|
...(c.data.severity ? { severity: c.data.severity } : {}),
|
|
159
179
|
...(c.data.blocked ? { blocked: c.data.blocked } : {}),
|
|
160
180
|
running,
|
|
181
|
+
resumable,
|
|
161
182
|
verified: ready,
|
|
162
183
|
// What a board may offer (§4.1): nothing while a run drives the item.
|
|
163
184
|
moves: running ? [] : movesOf(c.data),
|
|
@@ -173,7 +194,7 @@ export async function board(projectDir) {
|
|
|
173
194
|
const verified = verifiedOf(projectDir);
|
|
174
195
|
const items = [];
|
|
175
196
|
for (const c of ledger.items) items.push(await itemOf(projectDir, c, verified));
|
|
176
|
-
items
|
|
197
|
+
inRunOrder(items);
|
|
177
198
|
|
|
178
199
|
const config = await readConfig(root);
|
|
179
200
|
const live = await readLive(root);
|