gcf-harness-aif-ext 0.14.0 → 0.15.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 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.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.
51
+
50
52
  0.14.0 needs gcf-aif-ext 0.14.0 (docs/Base-A-Plan.md). Without `--timeout` a session's limit is `session_timeout_min` of `gcf/config.yml` (120 without it); an item without its own `model:` / `effort:` runs on the project's `agent.model` / `agent.effort` (the run's override still goes over both); `ai-factory gcf-harness gate --each [<id>…] --json` gives the gate of each named item (none: every ready one) run alone now, from one audit, `{items: {<id>: {pass, reason}}}`, exit 0: the board shows a refusal before the click. The bundled session engine offers Always for one MCP tool, marked `always_wide`.
51
53
 
52
54
  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.
@@ -104,7 +106,7 @@ Updating keeps the hook entry valid — it points into the extension's install d
104
106
  - `run_mode: main` in `gcf/config.yml` (or `run --mode main`): items run one after another in the main checkout, for an agent that works through an editor bound to the project folder. The item carries the core's session mark (`gcf claim`), not a run lock, so the agent records its own move; one run works the checkout at a time (`.gcf-session/runs/.main-run.lock`).
105
107
  - `gcf-harness next [N] --json`: the ready items that can run together now, by priority; each is taken while the batch with it passes the gate.
106
108
  - `gcf-harness stop <id>`: stops the session that works the item (its run lock names it); the run records no result for it and goes on with the rest. The item stays ready and its work is kept. Known limit: the session is killed at once, so a `gcf` move it was in the middle of may leave `.gcf-session/main.lock` behind (taken over once its pid is gone).
107
- - A run on main refreshes its item's mark every 5 minutes, and the readset-guard hook refreshes live marks on each read: a long build without a gcf command does not expire it.
109
+ - A run on main refreshes its item's mark every 5 minutes while the mark is its own, and the readset-guard hook refreshes live marks on each read: a long build without a gcf command does not expire it.
108
110
  - `run` refuses an id that is not a slug before it names a lock file or builds the agent's command line.
109
111
  - The gate lets a session through for the item its own run marked (`GCF_RUN_ITEM`); `/gcf-run` outside a worktree claims each item after its gate and releases one it leaves without a move.
110
112
 
package/commands/run.js CHANGED
@@ -3,7 +3,15 @@
3
3
  // verified branches a dead run left; an agent that needs the human leaves `outcome.json` in its
4
4
  // worktree, and the block is recorded on main — a worktree never writes gcf/ status.
5
5
  import { spawnSync } from 'node:child_process';
6
- import { existsSync, mkdirSync, rmSync, utimesSync, writeFileSync, writeSync } from 'node:fs';
6
+ import {
7
+ existsSync,
8
+ mkdirSync,
9
+ readFileSync,
10
+ rmSync,
11
+ utimesSync,
12
+ writeFileSync,
13
+ writeSync,
14
+ } from 'node:fs';
7
15
  import { mkdir, open, readFile, rm, writeFile } from 'node:fs/promises';
8
16
  import path from 'node:path';
9
17
  import { fileURLToPath } from 'node:url';
@@ -668,8 +676,12 @@ async function session(r, { core, logs, timeoutMs, fresh, launch, waitLimit, lim
668
676
  };
669
677
 
670
678
  // On main the item carries a session mark; a stage with no gcf command must not expire it.
671
- const mark = path.join(logs, `${r.id}.session`);
672
- const keep = r.main ? setInterval(() => touch(mark), 5 * 60_000) : null;
679
+ // Only this run's: after a `release` by hand another session may have claimed it meanwhile.
680
+ const keep = r.main
681
+ ? setInterval(() => {
682
+ if (markOwner(logs, r.id) === process.env.GCF_RUN_OWNER) touch(markOf(logs, r.id));
683
+ }, 5 * 60_000)
684
+ : null;
673
685
  // The bytes of the item's log this run writes: every run appends to the one file (run-log).
674
686
  let from = 0;
675
687
  const span = async () => (log ? { from, to: (await log.stat()).size } : null);
@@ -703,6 +715,17 @@ async function session(r, { core, logs, timeoutMs, fresh, launch, waitLimit, lim
703
715
  }
704
716
  }
705
717
 
718
+ const markOf = (logs, id) => path.join(logs, `${id}.session`);
719
+
720
+ /** The owner item `id`'s session mark names; null with no mark or none named. */
721
+ function markOwner(logs, id) {
722
+ try {
723
+ return readFileSync(markOf(logs, id), 'utf8').split('\n')[1]?.trim() || null;
724
+ } catch {
725
+ return null;
726
+ }
727
+ }
728
+
706
729
  /** Refresh a file's time, when it is still there. */
707
730
  function touch(file) {
708
731
  try {
@@ -922,8 +945,10 @@ async function mainItem(projectDir, id, ctx) {
922
945
  r = { id, error: e.message };
923
946
  }
924
947
 
925
- // A refused claim leaves the mark alone: it is another session's.
926
- if (marked) await core(['release', id]);
948
+ // A refused claim leaves the mark alone: it is another session's; so is one another session
949
+ // claimed after a `release` by hand.
950
+ const owner = markOwner(logs, id);
951
+ if (marked && (!owner || owner === process.env.GCF_RUN_OWNER)) await core(['release', id]);
927
952
  if (r.handoffLimit) await core(['block', id, '--reason', HANDOFF_LIMIT]);
928
953
  const item = await mainResult(core, r);
929
954
  await remember(logs, r, item);
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.14.0",
4
+ "version": "0.15.0",
5
5
  "description": "GCF orchestration harness for Claude Code: one-command card pipeline, readset guard",
6
6
  "skills": [
7
7
  "skills/gcf-run",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcf-harness-aif-ext",
3
- "version": "0.14.0",
3
+ "version": "0.15.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.14.0"
31
+ "gcf-aif-ext": "^0.14.0 || ^0.15.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "gcf-session": "file:../gcf-session"