gcf-harness-aif-ext 0.8.2 → 0.8.3

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
@@ -33,7 +33,7 @@ This installs the `gcf-run` and `gcf-run-ingest` skills and registers the `gcf-h
33
33
  ai-factory gcf-harness init # per project: .claude/settings.json + .gitignore
34
34
  ```
35
35
 
36
- It is **per project**, not global — run it again in every game repository: it adds the readset-guard `PreToolUse` entry to the project's `.claude/settings.json` (never `~/.claude`) and `.gcf-session/` to `.gitignore`. It also allows what an unattended `claude -p` run needs at least — `Edit`, `Write`, `Bash(git *)`, `Bash(ai-factory *)` — because print mode cannot ask and denies the rest; add your engine's tools yourself (for example `mcp__<editor-server>` for an editor driven over MCP). Commit `.claude/settings.json`: the rules apply to every Claude session in the project. It is idempotent — a re-run after moving or cloning the project repoints the hook at the new path — refuses when the `gcf` command is not registered, and refuses to rewrite a `settings.json` it cannot parse. It is a separate step for the same reason as `gcf hooks-install`: an AI Factory manifest cannot install Claude Code hooks.
36
+ It is **per project**, not global — run it again in every game repository: it adds the readset-guard `PreToolUse` entry to the project's `.claude/settings.json` (never `~/.claude`) and `.gcf-session/` to `.gitignore`. It also allows what an unattended `claude -p` run needs at least — `Edit`, `Write`, `Bash(git *)`, `Bash(ai-factory *)`, and the same two as `PowerShell(…)` rules, the tool the agent runs commands with on Windows — because print mode cannot ask and denies the rest; add your engine's tools yourself (for example `mcp__<editor-server>` for an editor driven over MCP). Commit `.claude/settings.json`: the rules apply to every Claude session in the project. It is idempotent — a re-run after moving or cloning the project repoints the hook at the new path — refuses when the `gcf` command is not registered, and refuses to rewrite a `settings.json` it cannot parse. It is a separate step for the same reason as `gcf hooks-install`: an AI Factory manifest cannot install Claude Code hooks.
37
37
 
38
38
  ## Upgrade
39
39
 
@@ -4,7 +4,7 @@
4
4
  // allows what a headless agent run needs (AGENT_ALLOW).
5
5
  // `ai-factory gcf-harness gate <ids…>` — the /gcf-run gate as code (Harness-PRD §4.3).
6
6
  import { readFile, writeFile, mkdir, appendFile } from 'node:fs/promises';
7
- import { existsSync, readFileSync } from 'node:fs';
7
+ import { existsSync, readFileSync, realpathSync } from 'node:fs';
8
8
  import { spawnSync } from 'node:child_process';
9
9
  import path from 'node:path';
10
10
  import { fileURLToPath } from 'node:url';
@@ -212,8 +212,16 @@ function registerGuard(settings, command) {
212
212
  }
213
213
 
214
214
  // What a headless `claude -p` run needs at least: it cannot ask, so anything not allowed is
215
- // denied. The engine's own tools (an editor's MCP server) are the project's to add.
216
- const AGENT_ALLOW = ['Edit', 'Write', 'Bash(git *)', 'Bash(ai-factory *)'];
215
+ // denied. The engine's own tools (an editor's MCP server) are the project's to add. On Windows
216
+ // the agent runs commands through its PowerShell tool, which Bash rules do not cover.
217
+ const AGENT_ALLOW = [
218
+ 'Edit',
219
+ 'Write',
220
+ 'Bash(git *)',
221
+ 'Bash(ai-factory *)',
222
+ 'PowerShell(git *)',
223
+ 'PowerShell(ai-factory *)',
224
+ ];
217
225
 
218
226
  /** Adds the rules the settings do not hold yet; returns the ones added. */
219
227
  function allowAgent(settings) {
@@ -401,7 +409,9 @@ async function runItems(ids, opts) {
401
409
  if (!(minutes > 0)) throw new Error('--timeout is a number of minutes above 0');
402
410
  if (opts.mode && !['worktree', 'main'].includes(opts.mode))
403
411
  throw new Error('--mode is worktree or main');
404
- const r = await run(process.cwd(), [...new Set(ids)], {
412
+ // The true-case path: Claude Code trusts a folder by its exact path, and a shell or a board
413
+ // may hand over c: for C:, which turns off every allow rule of the project.
414
+ const r = await run(realpathSync.native(process.cwd()), [...new Set(ids)], {
405
415
  agent: opts.agent,
406
416
  gate: (batch) => gate(auditReport(), batch),
407
417
  timeoutMs: minutes * 60_000,
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.8.2",
4
+ "version": "0.8.3",
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.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "GCF orchestration harness for Claude Code: one-command card pipeline, readset guard",
5
5
  "type": "module",
6
6
  "license": "MIT",