harness-everything 0.57.3 → 0.58.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.
Files changed (44) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.releaserc.json +2 -0
  4. package/CHANGELOG.md +15 -0
  5. package/benchmarks/results/live-host/agy-2026-11-22/README.md +49 -0
  6. package/benchmarks/results/live-host/agy-2026-11-23/README.md +48 -0
  7. package/ci/action-gate.test.js +162 -0
  8. package/ci/doc-capability-consistency.test.js +11 -1
  9. package/ci/mechanism-2aa-codex-action-gate-policy.test.js +37 -0
  10. package/ci/mechanism-2ao-plugin-sync.test.js +235 -2
  11. package/ci/mechanism-2w-platform-compatibility.test.js +13 -2
  12. package/ci/mechanism-2x-release-automation.test.js +3 -1
  13. package/ci/mechanism-agy-hooks.test.js +1096 -0
  14. package/ci/mechanism-agy-plugin-package.test.js +76 -0
  15. package/docs/codex-action-gate.md +2 -0
  16. package/docs/platform-capabilities.md +3 -1
  17. package/docs/platform-compatibility.json +34 -1
  18. package/hooks/scripts/action-gate.js +71 -5
  19. package/hooks/scripts/agy-post-tool.js +124 -0
  20. package/hooks/scripts/agy-pre-invocation.js +185 -0
  21. package/hooks/scripts/agy-pre-tool.js +158 -0
  22. package/hooks/scripts/agy-session-start.js +54 -0
  23. package/hooks/scripts/agy-stop.js +152 -0
  24. package/hooks/scripts/lib/agy-adapter-core.js +168 -0
  25. package/hooks/scripts/state-persist.js +50 -10
  26. package/opencode-plugin/plugin.json +1 -1
  27. package/package.json +1 -1
  28. package/plugins/harness-everything/.antigravity-plugin/plugin.json +18 -0
  29. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  30. package/plugins/harness-everything/hooks/scripts/action-gate.js +71 -5
  31. package/plugins/harness-everything/hooks/scripts/agy-post-tool.js +124 -0
  32. package/plugins/harness-everything/hooks/scripts/agy-pre-invocation.js +185 -0
  33. package/plugins/harness-everything/hooks/scripts/agy-pre-tool.js +158 -0
  34. package/plugins/harness-everything/hooks/scripts/agy-session-start.js +54 -0
  35. package/plugins/harness-everything/hooks/scripts/agy-stop.js +152 -0
  36. package/plugins/harness-everything/hooks/scripts/lib/agy-adapter-core.js +168 -0
  37. package/plugins/harness-everything/hooks/scripts/state-persist.js +50 -10
  38. package/plugins/harness-everything/hooks.json +44 -0
  39. package/plugins/harness-everything/plugin.json +1 -1
  40. package/plugins/harness-everything/rules/AGENTS.md +111 -0
  41. package/sbom.cdx.json +7 -7
  42. package/scripts/plugin-sync.js +105 -14
  43. package/scripts/sync-openai-plugin.js +16 -1
  44. package/scripts/sync-release-version.js +1 -0
@@ -10,7 +10,7 @@
10
10
  "name": "harness-everything",
11
11
  "source": "./",
12
12
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
13
- "version": "0.57.3",
13
+ "version": "0.58.0",
14
14
  "author": {
15
15
  "name": "Miya Daniel"
16
16
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "harness-everything",
3
3
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
4
- "version": "0.57.3",
4
+ "version": "0.58.0",
5
5
  "author": {
6
6
  "name": "Miya Daniel"
7
7
  },
package/.releaserc.json CHANGED
@@ -93,8 +93,10 @@
93
93
  "*/**/SKILL.md",
94
94
  "plugins/harness-everything/plugin.json",
95
95
  "plugins/harness-everything/.codex-plugin/plugin.json",
96
+ "plugins/harness-everything/.antigravity-plugin/plugin.json",
96
97
  "plugins/harness-everything/skills",
97
98
  "plugins/harness-everything/hooks",
99
+ "plugins/harness-everything/rules",
98
100
  "opencode-plugin/plugin.json"
99
101
  ],
100
102
  "message": "chore(release): ${nextRelease.version} [skip ci]"
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.58.0](https://github.com/dyphn1/Harness-everything/compare/v0.57.4...v0.58.0) (2026-11-23)
6
+
7
+ ### Features
8
+
9
+ * **plugin:** add native antigravity plugin and lifecycle hooks ([#513](https://github.com/dyphn1/Harness-everything/issues/513)) ([2c9cd88](https://github.com/dyphn1/Harness-everything/commit/2c9cd881c18ca3e72bcd79b9493cfb5761196022)), closes [#510](https://github.com/dyphn1/Harness-everything/issues/510)
10
+
11
+ ## [0.57.4](https://github.com/dyphn1/Harness-everything/compare/v0.57.3...v0.57.4) (2026-11-22)
12
+
13
+ ### Bug Fixes
14
+
15
+ * **action-gate:** defer routine codex issue comments and completed closes ([6cdbb10](https://github.com/dyphn1/Harness-everything/commit/6cdbb108aa5c5d565abe04f9d4bf2dfd1b264448)), closes [#508](https://github.com/dyphn1/Harness-everything/issues/508)
16
+ * **action-gate:** keep ownerless issue repository selectors gated ([a82d2a8](https://github.com/dyphn1/Harness-everything/commit/a82d2a81787600bb96c19bdb606f6af482ee6421))
17
+
5
18
  ## [0.57.3](https://github.com/dyphn1/Harness-everything/compare/v0.57.2...v0.57.3) (2026-11-22)
6
19
 
7
20
  ### Bug Fixes
@@ -190,6 +203,8 @@ All notable changes to this project are documented in this file.
190
203
 
191
204
  ## [Unreleased]
192
205
 
206
+ - Codex defers exact Issue comments and completed closes to native host permissions (#508).
207
+
193
208
  - OpenCode V2: accept the live `shell` tool name alongside `bash` for ledger lesson injection and turn observations, with live-shape mechanism rows (#509).
194
209
 
195
210
  - Error-ledger lesson injection (#394): ledger records gain optional `match` rules; a shared matcher carries matched Cue/Lesson text into Claude Code, Codex and OpenCode V2 context at a `git commit` action and its commitlint failure (mechanism evidence; OpenCode V1 delivery unchecked). ROUTE-001 is superseded.
@@ -0,0 +1,49 @@
1
+ # Evidence: Google Antigravity (AGY) Plugin & Lifecycle Hooks
2
+
3
+ This records the package architecture and deterministic mechanism verification of the native Google Antigravity (AGY) plugin and lifecycle hook integration on macOS.
4
+
5
+ - Date: 2026-11-22 (updated 2026-11-23 after sync to `0.57.4`)
6
+ - Host: Google Antigravity (AGY) IDE / CLI runtime (mechanism tests under Node.js on macOS; see [agy-2026-11-23](../agy-2026-11-23/README.md) for partial live-host evidence on Antigravity 2.0 Desktop App `2.34.0`, and Issue #514 for remaining unchecked surfaces)
7
+ - Repository branch under test: `feat/510-agy-plugin` (Issue #510, PR #513)
8
+ - Packaged plugin: `plugins/harness-everything/` (version `0.57.4`)
9
+ - Manifest targets: `.antigravity-plugin/plugin.json`, `rules/AGENTS.md`, and root `hooks.json`
10
+
11
+ ## Verified Capabilities (Mechanism Only)
12
+
13
+ ### 1. Packaging & Manifest Lockstep (Phase 1)
14
+ - Manifest: `plugins/harness-everything/.antigravity-plugin/plugin.json` conforms to the AGY Customization System specification (`name`, `version`, `author`, `homepage`, `repository`, `license`, `keywords`).
15
+ - Rules Integration: `plugins/harness-everything/rules/AGENTS.md` is synchronized from the repository root `AGENTS.md` byte-for-byte.
16
+ - Hook Runtime Parity: Packaged `plugins/harness-everything/hooks/scripts/agy-*.js` and `lib/agy-adapter-core.js` match repository `hooks/scripts/` byte-for-byte.
17
+ - Canonical Skills: All 28 canonical skills are present in `plugins/harness-everything/skills/` with required `## USE FOR:` / `## DO NOT USE FOR:` routing sections.
18
+ - Verified by: `npm test` (`ci/mechanism-agy-plugin-package.test.js`, auto-discovered by `ci/mechanism-test.js`).
19
+
20
+ ### 2. Lifecycle Hook Enforcement (Phase 2 — Mechanism Verified)
21
+ The AGY plugin provides lifecycle adapters communicating over `stdin`/`stdout` using the AGY protojson camelCase format:
22
+ - `SessionStart` (`agy-session-start.js`): Binds session workspace identity from `conversationId` + `workspacePaths`/`cwd` and injects the active Harness OS banner.
23
+ - `PreInvocation` (`agy-pre-invocation.js`): Invokes the Kernel Router once per user turn (deduplicated per turn via session state + `invocationNum` guard), injecting routing context via `injectSteps` and bridging `conversationId` to `workflow-run.json`.
24
+ - `PreToolUse` (`agy-pre-tool.js`): Intercepts `run_command`, `write_file`, `edit_file`, `write_to_file`, `replace_file_content`, and `multi_replace_file_content`:
25
+ - Enforces canonicalized (`fs.realpathSync`) filesystem containment across `workspacePaths`, `cwd`, and `artifactDirectoryPath`; denies missing/empty paths and out-of-bounds or symlink-escaped targets.
26
+ - Invokes canonical Action Gate policies (`action-gate.js`) with normalized `args.Cwd` and `toolCall.id` to reject destructive operations, force-pushes, publish, and hard reset.
27
+ - `PostToolUse` (`agy-post-tool.js`): Normalizes `run_command` (`Cwd`) and file-write (`file_path`) payloads, passing `--agy` to `state-persist.js` so `error` strings and non-zero exit codes record `failed`, explicit `exitCode === 0` advances verification or clears `failed`, and unknown shell outcomes (omitted `error`/`exitCode`) grant no verification credit and preserve `failed` state while retaining `lastEditAt` edit tracking.
28
+ - `Stop` (`agy-stop.js`): Implements Verify-Before-Claim using normalized `conversationId` + `workspacePaths`/`cwd` workspace resolution, returning `{"decision": "continue", "reason": "..."}` on unresolved failures or unverified edits while returning `{"decision": "allow"}` on verified/clean sessions, compatibility recursion guards (`continuationActive`/`stop_hook_active`), and explicit abnormal `terminationReason` values (while still evaluating `NO_TOOL_CALL`, `model_stop`, and empty/normal reasons).
29
+ - Verified by: `npm test` (`ci/mechanism-agy-hooks.test.js`, auto-discovered by `ci/mechanism-test.js`).
30
+
31
+ ### 3. Automated Synchronization & CLI (Phase 3 — Mechanism Verified)
32
+ - `scripts/plugin-sync.sh` and `scripts/plugin-sync.js` support `--host agy` (and `--host all`):
33
+ - Under default `--host all`, requires AGY CLI (`agy`) or an existing AGY install (`.antigravity-plugin/plugin.json` under `.agents/plugins/` or `~/.gemini/config/plugins/`), skipping unrelated Codex `.agents/` directories.
34
+ - Supports explicit `--host agy` to install/update and `--dry-run` (reporting `status: "dry-run"` without mutating disk).
35
+ - Performs atomic staged replacement with rollback on failure, cleaning obsolete files and replacing partial/corrupted target directories cleanly.
36
+ - Verified by: `npm run test:plugin:hosts` (`ci/mechanism-2ao-plugin-sync.test.js`).
37
+
38
+ ## Repository Verification Summary
39
+
40
+ | Gate | Command | Result |
41
+ |---|---|---|
42
+ | Full Local Suite (incl. AGY package, hooks & host sync) | `npm run verify:all` | PASS |
43
+ | AGY Plugin Package | `node ci/mechanism-agy-plugin-package.test.js` | PASS |
44
+ | AGY Lifecycle Hooks | `node ci/mechanism-agy-hooks.test.js` | PASS |
45
+ | Host Plugin Synchronization | `npm run test:plugin:hosts` | PASS |
46
+ | Consistency & Contract | `npm run test:consistency` | PASS |
47
+ | Release Lockstep | `npm run test:release` | PASS |
48
+ | OpenAI Plugin Package | `npm run test:plugin:openai` | PASS |
49
+ | Documentation Sync | `npm run docs:sync` | PASS |
@@ -0,0 +1,48 @@
1
+ # Live-Host Evidence: Google Antigravity (AGY) 2.34.0 & CLI 1.5.15 (macOS, Partial)
2
+
3
+ Sanitized live-host verification of the native Google Antigravity (AGY) plugin and lifecycle hooks on Antigravity 2.0 Desktop App `2.34.0` and `agy` CLI `1.5.15`. This establishes **partial** live-host coverage on macOS and records observed host limitations explicitly; remaining surfaces (`/hooks` TUI view, full project-scope `harness-everything` isolation, IDE-specific write tools, live `PostToolUse` shell `exitCode: 0` verification credit, and live `Stop` `model_stop`) stay open in Issue #514.
4
+
5
+ ## Environment & Scope
6
+
7
+ | Field | Value |
8
+ |---|---|
9
+ | Date | 2026-11-23 |
10
+ | Host | Antigravity 2.0 Desktop App `2.34.0` (Language Server `hub-2.34.0`) + `agy` CLI `1.5.15` |
11
+ | OS / Runtime | macOS `26.6.2` (Build `25G83`), Node `v24.22.1` |
12
+ | Install Scope | Global: `<HOME>/.gemini/config/plugins/harness-everything` (plus temp project-scope `.agents/plugins/` hook probe via `agy --print`) |
13
+ | Sync Operation | `node scripts/plugin-sync.js --host agy --json` → `status: "synchronized"`, `action: "update"` |
14
+ | Branch / Package | `feat/510-agy-plugin` (PR #513), package version `0.57.4` |
15
+
16
+ ## Live Observations (Desktop App `2.34.0`)
17
+
18
+ | Surface | Result | Sanitized Evidence |
19
+ |---|---|---|
20
+ | Plugin load & discovery | **Observed live** | `GetAllPlugins` RPC returned `name: "harness-everything"`, `disabled: false`, `isGlobal: true`, `skillCount: 28`, `rules: [".../rules/AGENTS.md"]`, `hasHooksJson: true` (`hooksJsonLen: 1037`). |
21
+ | `SessionStart` | **Observed live** | Injected `Harness Skills OS active. Operating under AGENTS.md invariant-first routing.` at step 1 of a user-initiated AGY conversation (`<conv-id>`). |
22
+ | `PreInvocation` | **Observed live** | Injected `[Tier Routing Pre-check]` and persisted `workflow-run.json` keyed by `conversationId`. Before the per-turn dedup fix it repeated on every model call; after syncing the fixed `agy-pre-invocation.js`, mid-turn repeated injections stopped completely. |
23
+ | `PreToolUse` (`write_file` allow) | **Observed live** | `write_file` inside `artifactDirectoryPath` (`<appData>/brain/<conv-id>/.system_generated/swarm/plan.json`) was denied prior to the fix and **ALLOWED** (`Created file.`) after syncing. |
24
+ | `PreToolUse` (`write_file` deny) | **Observed live** | `write_file` outside workspace (`/tmp/agy-live-oob-probe.txt`) **DENIED** by AGY: `tool call denied by pre-tool hook: Harness boundary guard: modification outside workspace root is forbidden (/tmp/agy-live-oob-probe.txt).` |
25
+ | `PreToolUse` (`run_command` allow) | **Observed live** | Safe command `echo agy-live-allow-ok` **ALLOWED** (exit 0). |
26
+ | `PreToolUse` (`run_command` deny) | **Observed live** | Destructive command `git -C /tmp/nonexistent-agy-probe push --force origin main` **DENIED** via canonical Action Gate: `tool call denied by pre-tool hook: [Harness actionGate:git-force-push] Force-pushing can rewrite remote history.` |
27
+ | `PostToolUse` (edit state & shell outcome) | **Observed live (partial)** | Fired live and persisted `handoff-state.json` edit timestamps (`lastEditAt`: `1795394108668` → `1795394132329`). Prior to the P1-B `--agy` fix, running `npm run test:portability` with omitted `exitCode` and absent `error` inferred success (`lastVerifyAt: 1795394172552`, `lastVerifyExitCode: null`). After P1-B, omitted `exitCode`/`error` is treated as `unknown` (`host-limited / UNCHECKED` for live shell verification credit; explicit `exitCode === 0` is required to advance `lastVerifyAt` or clear `failed`). |
28
+ | `PostToolUse` (shell non-zero exit) | **Host-limited / Unverified** | On `node -e "process.exit(1)"` (exit code 1), AGY `2.34.0` `PostToolUse` omitted both `exitCode` and `error`, leaving `handoff-state.json` at `status: "idle"` rather than `"failed"`. |
29
+ | `Stop` (Verify-Before-Claim) | **Observed live (partial)** | On `2.34.0`, blocked termination when `lastEditAt > lastVerifyAt` (`Stop hook blocked termination: Harness Verify-Before-Claim: unverified edits exist in session.`), and allowed clean termination once `lastVerifyAt >= lastEditAt`. After P1-A/P2 fixes, allowed `Stop` returns `{"decision":"allow"}` (previously `{}` during the `2.34.0` run), and `model_stop` evaluates `handoff-state.json` rather than bypassing (mechanism-verified; live `model_stop` remains `UNCHECKED`). |
30
+
31
+ ## Live Observations (`agy` CLI `1.5.15`)
32
+
33
+ | Surface | Result | Sanitized Evidence |
34
+ |---|---|---|
35
+ | `agy --version` | **Observed live** | `1.5.15` (`<HOME>/.local/bin/agy`). |
36
+ | `agy plugin validate --json` | **Observed live** | Exited `0` on `plugins/harness-everything`: `manifest: ".antigravity-plugin/plugin.json"`, `name: "harness-everything"`, `agentPluginsSpec: false`, `components: { agents: 0, hooks: 1, mcpServers: 0, rules: 1, sidecars: 0, skills: 28 }`. Reported 2 multi-host warnings (`hooks/hooks.json` never loaded; `plugin.json` ignored because `.antigravity-plugin/plugin.json` takes precedence) + 1 note (`no logo`). |
37
+ | `agy plugin validate --strict --json` | **Observed live** | Exited `1` (`Error: validation failed in strict mode: 2 warnings`) due to the 2 multi-host packaging warnings above. |
38
+ | `agy plugin list --json` | **Observed live** | Listed global `<HOME>/.gemini/config/plugins/harness-everything` (`enabled: true`, `version: "0.57.4"`, 28 skills, `rules: ["AGENTS.md"]`, `hooks: ["harness-everything"]`). In a temporary project directory with candidate plugin roots (`.agents/plugins/`, `.antigravity/plugins/`, `.gemini/plugins/`, `.gemini/config/plugins/`, `.claude/plugins/`), `agy plugin list --json` reported global-only plugins. |
39
+ | Project-scope `.agents/plugins/` hook discovery (`agy --print`) | **Observed live (probe)** | Running `agy --print` in a temporary workspace (`/tmp/agy-hook-probe`) with a temporary project-scope `.agents/plugins/probe-hooks/` plugin discovered and loaded project-scope `hooks.json` (`hooks_manager.go:54] loaded 2 named hooks from 2 hooks.json file(s)`) and executed all 5 lifecycle hooks (`SessionStart`, `PreInvocation`, `PreToolUse`, `PostToolUse`, `Stop`). |
40
+ | CLI `PostToolUse` shell exit-1 & write dispatch | **Host-limited / Observed live** | In the live `agy --print` session, `run_command` (`node -e "process.exit(1)"`) printed `Command exited with code 1.` in stream output, **but** `PostToolUse` stdin payload had `"error": ""` with no `exitCode` and no `toolResponse` (confirming the `2.34.0` shell-outcome omission on CLI `1.5.15`). Even when prompted for `write_to_file`, CLI dispatched `toolCall.name: "write_file"` (`args: { Content, Overwrite, Path }`). `Stop` payload carried `continuationActive: false`, `executionNum: 0` (then `1`), `fullyIdle: true`, `terminationReason: "NO_TOOL_CALL"`, `error: ""`. |
41
+
42
+ ## Explicit Evidence Boundaries
43
+
44
+ - **Global scope vs. project scope**: Full `harness-everything` execution is live-verified only in `<HOME>/.gemini/config/plugins/harness-everything` on Desktop App `2.34.0` and `agy` CLI `1.5.15` (macOS). Temporary `.agents/plugins/` hook discovery is live-verified via `probe-hooks` on `agy --print`, while full project-scope `harness-everything` isolation without global install, Desktop App project scope, `/hooks` TUI inspection, and Windows/Linux hosts remain `UNCHECKED` (Issue #514).
45
+ - **IDE write tools**: Both Desktop App `2.34.0` and CLI `1.5.15` dispatched `write_file` (even when prompted for `write_to_file`). IDE-specific tools (`write_to_file`, `replace_file_content`, `multi_replace_file_content`) remain **mechanism verified** only (`ci/mechanism-agy-hooks.test.js`), `host-limited / UNCHECKED` live.
46
+ - **`PostToolUse` shell outcome & verification credit**: Observed as **host-limited** on both Desktop `2.34.0` and CLI `1.5.15` because non-zero shell commands (`exit 1`) omitted `error` and `exitCode` in `PostToolUse`. After P1-B, unknown shell outcomes grant no verification credit and preserve any `failed` state; live shell `exitCode: 0` verification credit remains `UNCHECKED`. (`lastVerifyExitCode: null` in the earlier `2.34.0` capture was inferred from absent `error` before P1-B and is now `host-limited / UNCHECKED`.)
47
+ - **`Stop` continuation/termination paths**: Live runs observed `NO_TOOL_CALL`, `fullyIdle: true`, and `executionNum: 0/1`. `agy-stop.js` returns `{"decision":"allow"}` on permitted stops, evaluates `model_stop` and empty/normal reasons against `handoff-state.json`, exempts only explicit abnormal `terminationReason` values, and keeps `continuationActive`/`stop_hook_active` as compatibility recursion guards (not official documented Stop input fields). Live `model_stop` execution remains `UNCHECKED` (mechanism-verified in `ci/mechanism-agy-hooks.test.js`).
48
+ - **Companion mechanism record**: See [agy-2026-11-22](../agy-2026-11-22/README.md) for package and deterministic mechanism verification.
@@ -438,6 +438,168 @@ try {
438
438
  check(actionGate.evaluatePreToolUse(creation, { host: 'codex', sessionDir, ruleTable: table }).kind === 'block', 'PR creation still honors the documented explicit required gate');
439
439
  }
440
440
 
441
+ const issueCommentTools = [
442
+ 'mcp__codex_apps__github__add_comment_to_issue',
443
+ 'mcp__codex_apps__github_add_comment_to_issue',
444
+ ];
445
+ const issueCompletedCloseTools = [
446
+ 'mcp__codex_apps__github__update_issue',
447
+ 'mcp__codex_apps__github_update_issue',
448
+ ];
449
+ const issueCommentInput = { repo_full_name: 'dyphn1/Harness-everything', pr_number: 502, comment: 'routine fixture comment' };
450
+ const issueCloseInput = { repository_full_name: 'dyphn1/Harness-everything', issue_number: 502, state: 'closed', state_reason: 'completed' };
451
+ const issuePayload = (tool, input, id, extra = {}) => ({
452
+ ...payload('', { tool, toolUseId: id }),
453
+ tool_name: tool,
454
+ tool_input: input,
455
+ ...extra,
456
+ });
457
+
458
+ for (const [tools, input, id, expectedRule, operation] of [
459
+ [issueCommentTools, issueCommentInput, 'issue-comment-positive', 'routine-issue-comment', 'Issue comment'],
460
+ [issueCompletedCloseTools, issueCloseInput, 'issue-close-positive', 'routine-issue-completed-close', 'Issue completed-close'],
461
+ ]) {
462
+ for (const tool of tools) {
463
+ const candidate = issuePayload(tool, input, id + '-' + tools.indexOf(tool));
464
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
465
+ check(result.kind === 'allow' && result.exitCode === 0 && result.stdout === null, operation + ' exact Codex tool defers to host');
466
+ check(result.record && result.record.disposition === 'deferred-to-host' && result.record.matchedRule === expectedRule, operation + ' records its distinct host-deferred id');
467
+ const descriptor = result.descriptor || (result.record && result.record.actionDescriptor);
468
+ check(descriptor && descriptor.action === 'mutate' && descriptor.classification === 'gated', operation + ' remains a gated mutation');
469
+ check(!Object.prototype.hasOwnProperty.call(result, 'permissionDecision'), operation + ' emits no Harness permission decision');
470
+ }
471
+ }
472
+
473
+ const issueInvalidInputs = [
474
+ ['comment null arguments', issueCommentTools[0], null],
475
+ ['comment missing repo selector', issueCommentTools[0], { pr_number: 502, comment: 'comment' }],
476
+ ['comment empty repo selector', issueCommentTools[0], { ...issueCommentInput, repo_full_name: ' ' }],
477
+ ['comment ownerless repo selector', issueCommentTools[0], { ...issueCommentInput, repo_full_name: 'repo-only' }],
478
+ ['comment wrong repo selector type', issueCommentTools[0], { ...issueCommentInput, repo_full_name: 502 }],
479
+ ['comment invalid issue selector', issueCommentTools[0], { ...issueCommentInput, pr_number: 0 }],
480
+ ['comment fractional issue selector', issueCommentTools[0], { ...issueCommentInput, pr_number: 1.5 }],
481
+ ['comment string issue selector', issueCommentTools[0], { ...issueCommentInput, pr_number: '502' }],
482
+ ['comment missing text', issueCommentTools[0], { ...issueCommentInput, comment: '' }],
483
+ ['comment whitespace text', issueCommentTools[0], { ...issueCommentInput, comment: ' ' }],
484
+ ['comment invalid text type', issueCommentTools[0], { ...issueCommentInput, comment: null }],
485
+ ['comment extra null key', issueCommentTools[0], { ...issueCommentInput, unknown: null }],
486
+ ['close missing repo selector', issueCompletedCloseTools[0], { issue_number: 502, state: 'closed', state_reason: 'completed' }],
487
+ ['close missing issue selector', issueCompletedCloseTools[0], { ...issueCloseInput, issue_number: null }],
488
+ ['close empty repo selector', issueCompletedCloseTools[0], { ...issueCloseInput, repository_full_name: '' }],
489
+ ['close ownerless repo selector', issueCompletedCloseTools[0], { ...issueCloseInput, repository_full_name: 'repo-only' }],
490
+ ['close wrong repo selector type', issueCompletedCloseTools[0], { ...issueCloseInput, repository_full_name: 502 }],
491
+ ['close string issue selector', issueCompletedCloseTools[0], { ...issueCloseInput, issue_number: '502' }],
492
+ ['close wrong state', issueCompletedCloseTools[0], { ...issueCloseInput, state: 'open' }],
493
+ ['close reopened state', issueCompletedCloseTools[0], { ...issueCloseInput, state: 'reopened' }],
494
+ ['close wrong reason', issueCompletedCloseTools[0], { ...issueCloseInput, state_reason: 'not_planned' }],
495
+ ['close duplicate reason', issueCompletedCloseTools[0], { ...issueCloseInput, state_reason: 'duplicate' }],
496
+ ['close reopened reason', issueCompletedCloseTools[0], { ...issueCloseInput, state_reason: 'reopened' }],
497
+ ['close null reason', issueCompletedCloseTools[0], { ...issueCloseInput, state_reason: null }],
498
+ ['close missing state', issueCompletedCloseTools[0], { repository_full_name: issueCloseInput.repository_full_name, issue_number: 502, state_reason: 'completed' }],
499
+ ['close missing reason', issueCompletedCloseTools[0], { repository_full_name: issueCloseInput.repository_full_name, issue_number: 502, state: 'closed' }],
500
+ ['close null extra key', issueCompletedCloseTools[0], { ...issueCloseInput, title: null }],
501
+ ];
502
+ for (const [name, tool, input] of issueInvalidInputs) {
503
+ const result = actionGate.evaluatePreToolUse(issuePayload(tool, input, 'issue-invalid-' + name.replace(/[^a-z0-9]+/gi, '-')), {
504
+ host: 'codex', sessionDir, ruleTable: table,
505
+ });
506
+ check(result.kind === 'block' && result.exitCode === 2 && result.record.disposition === 'rejected'
507
+ && result.rule && result.rule.id === 'structured-mutate', name + ' remains gated');
508
+ }
509
+ for (const key of ['title', 'body', 'labels', 'assignees', 'milestone']) {
510
+ const input = { ...issueCloseInput, [key]: null };
511
+ const result = actionGate.evaluatePreToolUse(issuePayload(issueCompletedCloseTools[0], input, 'issue-close-extra-' + key), {
512
+ host: 'codex', sessionDir, ruleTable: table,
513
+ });
514
+ check(result.kind === 'block' && result.exitCode === 2, 'completed-close rejects extra ' + key + ' even when null');
515
+ }
516
+
517
+ for (const tool of [
518
+ 'add_comment_to_issue',
519
+ 'mcp__github__add_comment_to_issue',
520
+ 'mcp__codex_apps__github__add_comment_to_issues',
521
+ 'mcp__codex_apps__github_add_comment_to_issue_extra',
522
+ 'mcp__demo__add_comment_to_issue',
523
+ 'mcp__codex_apps__github__foo_add_comment_to_issue',
524
+ 'mcp__github__update_issue',
525
+ 'mcp__codex_apps__github_update_issues',
526
+ 'local__mcp__codex_apps__github_update_issue',
527
+ ]) {
528
+ const input = tool.includes('comment') ? issueCommentInput : issueCloseInput;
529
+ const result = actionGate.evaluatePreToolUse(issuePayload(tool, input, 'issue-spoof-' + tool.replace(/[^a-z0-9]+/gi, '-')), {
530
+ host: 'codex', sessionDir, ruleTable: table,
531
+ });
532
+ check(result.kind === 'block' && result.exitCode === 2, 'near-match or other provider ' + tool + ' stays gated');
533
+ }
534
+
535
+ for (const action of ['delete', 'publish', 'deploy', 'send']) {
536
+ const candidate = issuePayload(issueCommentTools[0], issueCommentInput, 'issue-high-risk-' + action, {
537
+ action_descriptor: { toolFamily: 'shell', action },
538
+ });
539
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
540
+ check(result.kind === 'block' && result.exitCode === 2, 'explicit higher-risk ' + action + ' descriptor stays gated');
541
+ check(result.record.actionDescriptor.toolFamily === 'mcp', 'actual Issue tool identity overrides a spoofed shell family');
542
+ }
543
+ for (const action of ['read', 'unknown']) {
544
+ const candidate = issuePayload(issueCommentTools[0], issueCommentInput, 'issue-downgrade-' + action, {
545
+ action_descriptor: { toolFamily: 'shell', action },
546
+ });
547
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
548
+ check(result.kind === 'allow' && result.record.matchedRule === 'routine-issue-comment'
549
+ && result.record.actionDescriptor.toolFamily === 'mcp' && result.record.actionDescriptor.action === 'mutate',
550
+ 'explicit ' + action + ' descriptor cannot downgrade the exact Issue mutation');
551
+ }
552
+
553
+ for (const host of ['claude', 'opencode', 'unknown']) {
554
+ const candidate = issuePayload(issueCommentTools[0], issueCommentInput, 'issue-host-' + host);
555
+ const result = actionGate.evaluatePreToolUse(candidate, { host, sessionDir, ruleTable: table });
556
+ check(result.rule && result.rule.id === 'structured-mutate', host + ' issue comment keeps its existing mutation gate');
557
+ }
558
+
559
+ for (const operation of [
560
+ [issueCommentTools[0], issueCommentInput, 'comment'],
561
+ [issueCompletedCloseTools[0], issueCloseInput, 'close'],
562
+ ]) {
563
+ for (let requiredAt = 0; requiredAt < 4; requiredAt++) {
564
+ const optionalHints = Object.assign({}, ...gateEnvelopes({ required: false }));
565
+ const hints = { ...optionalHints, ...gateEnvelopes({ required: true })[requiredAt] };
566
+ const candidate = issuePayload(operation[0], operation[1], 'issue-required-' + operation[2] + '-' + requiredAt, hints);
567
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
568
+ check(result.kind === 'block' && result.exitCode === 2 && result.record.disposition === 'rejected', 'required actionGate envelope ' + requiredAt + ' wins for issue ' + operation[2]);
569
+ }
570
+ }
571
+
572
+ const issueAuditCases = [
573
+ [issueCommentTools[0], { ...issueCommentInput, comment: 'audit comment one' }, 'issue-audit-one', 'success'],
574
+ [issueCommentTools[0], { ...issueCommentInput, comment: 'audit comment two' }, 'issue-audit-two', 'failure'],
575
+ [issueCompletedCloseTools[0], issueCloseInput, 'issue-audit-close-success', 'success'],
576
+ [issueCompletedCloseTools[0], issueCloseInput, 'issue-audit-close-failure', 'failure'],
577
+ ];
578
+ const issueAuditPres = issueAuditCases.map(([tool, input, id]) => {
579
+ const candidate = issuePayload(tool, input, id);
580
+ return { candidate, result: actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table }) };
581
+ });
582
+ for (let index = 0; index < issueAuditCases.length; index++) {
583
+ const [tool, input, id, outcome] = issueAuditCases[index];
584
+ const { candidate, result } = issueAuditPres[index];
585
+ check(result.record && result.record.disposition === 'deferred-to-host', id + ' has an independent pre-action audit record');
586
+ check(result.record && result.record.commandHash === actionGate.hashExact(actionGate.exactPayloadText(candidate)), id + ' records the exact payload hash');
587
+ check(result.record && !JSON.stringify(result.record).includes(input.comment || 'routine fixture comment'), id + ' audit does not persist comment text');
588
+ const post = actionGate.finalizeExecution(candidate, outcome, { sessionDir });
589
+ check(post.record && post.record.disposition === 'executed' && post.record.executionOutcome === outcome, id + ' PostToolUse outcome is accurate');
590
+ check(post.record && Boolean(post.record.executionFailure) === (outcome === 'failure'), id + ' failure flag matches outcome');
591
+ }
592
+ check(issueAuditPres[0].result.record.commandHash !== issueAuditPres[1].result.record.commandHash, 'different issue comments have different audit hashes');
593
+ const alteredIssue = {
594
+ ...issueAuditPres[0].candidate,
595
+ tool_input: { ...issueAuditPres[0].candidate.tool_input, comment: 'changed after PreToolUse' },
596
+ };
597
+ check(actionGate.finalizeExecution(alteredIssue, 'success', { sessionDir }).record.disposition === 'integrity-violation', 'changed issue payload cannot reuse a deferred audit record');
598
+ const unexecutedIssue = issuePayload(issueCommentTools[0], { ...issueCommentInput, comment: 'never executed' }, 'issue-unexecuted-stop');
599
+ actionGate.evaluatePreToolUse(unexecutedIssue, { host: 'codex', sessionDir, ruleTable: table });
600
+ const issueStop = actionGate.rejectPendingAtStop(unexecutedIssue, { sessionDir });
601
+ check(issueStop.rejected > 0 && readAudit(sessionDir, unexecutedIssue.tool_use_id).disposition === 'rejected', 'Stop rejects an unexecuted issue deferral');
602
+
441
603
 
442
604
  } catch (err) {
443
605
  console.error(err.stack || err.message);
@@ -191,6 +191,7 @@ for (const rel of OPENCODE_SURFACES) {
191
191
  const matrix = JSON.parse(read('docs/platform-compatibility.json'));
192
192
  const opencode = matrix.platforms.find(platform => platform.id === 'opencode');
193
193
  const codex = matrix.platforms.find(platform => platform.id === 'codex');
194
+ const agy = matrix.platforms.find(platform => platform.id === 'agy');
194
195
  for (const dimension of ['hooksLifecycle', 'liveHostVerification']) {
195
196
  if (opencode?.capabilities[dimension]?.status !== 'Partial') {
196
197
  fail(`OpenCode ${dimension}: must remain Partial`);
@@ -208,7 +209,16 @@ if (codex?.capabilities.liveHostVerification.status !== 'Partial') {
208
209
  if (codex?.capabilities.liveHostVerification.evidence !== 'benchmarks/results/live-host/codex-2026-10-13/README.md') {
209
210
  fail('Codex liveHostVerification: missing exact retained artifact path');
210
211
  }
211
- for (const platform of matrix.platforms.filter(platform => !['opencode', 'codex'].includes(platform.id))) {
212
+ if (agy?.capabilities.hooksLifecycle.status !== 'Partial') {
213
+ fail('AGY hooksLifecycle: expected Partial status matching bounded live/mechanism evidence');
214
+ }
215
+ if (agy?.capabilities.liveHostVerification.status !== 'Partial') {
216
+ fail('AGY liveHostVerification: expected Partial status with preserved evidence');
217
+ }
218
+ if (agy?.capabilities.liveHostVerification.evidence !== 'benchmarks/results/live-host/agy-2026-11-23/README.md') {
219
+ fail('AGY liveHostVerification: missing exact retained artifact path');
220
+ }
221
+ for (const platform of matrix.platforms.filter(platform => !['opencode', 'codex', 'agy'].includes(platform.id))) {
212
222
  if (platform.capabilities.liveHostVerification.status !== 'Unknown') {
213
223
  fail(`${platform.id}: liveHostVerification must remain Unknown without its own evidence`);
214
224
  }
@@ -163,6 +163,43 @@ try {
163
163
  assert.notStrictEqual(denied.record.commandHash, hash);
164
164
  }
165
165
  }
166
+ for (const [gateName, gate] of [
167
+ ['canonical', actionGate],
168
+ ['packaged', require(path.join(pluginRoot, 'hooks', 'scripts', 'action-gate.js'))],
169
+ ]) {
170
+ for (const [tool, input, expectedRule, outcome] of [
171
+ ['mcp__codex_apps__github__add_comment_to_issue', {
172
+ repo_full_name: 'dyphn1/Harness-everything', pr_number: 502, comment: 'private issue comment fixture',
173
+ }, 'routine-issue-comment', 'success'],
174
+ ['mcp__codex_apps__github_update_issue', {
175
+ repository_full_name: 'dyphn1/Harness-everything', issue_number: 502, state: 'closed', state_reason: 'completed',
176
+ }, 'routine-issue-completed-close', 'failure'],
177
+ ]) {
178
+ const candidate = {
179
+ ...payload('', { toolUseId: `${gateName}-${expectedRule}`, turnId: 'issue-turn' }),
180
+ tool_name: tool,
181
+ tool_input: input,
182
+ };
183
+ const pre = gate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
184
+ assert.strictEqual(pre.kind, 'allow', `${gateName} ${expectedRule} defers to host`);
185
+ assert.strictEqual(pre.stdout, null);
186
+ assert.strictEqual(Object.prototype.hasOwnProperty.call(pre, 'permissionDecision'), false);
187
+ assert.strictEqual(pre.record.disposition, 'deferred-to-host');
188
+ assert.strictEqual(pre.record.matchedRule, expectedRule);
189
+ assert.strictEqual(pre.record.host, 'codex');
190
+ assert.strictEqual(pre.record.toolUseId, candidate.tool_use_id);
191
+ assert.strictEqual(pre.record.actionDescriptor.action, 'mutate');
192
+ assert.strictEqual(pre.record.actionDescriptor.classification, 'gated');
193
+ const hash = gate.hashExact(gate.exactPayloadText(candidate));
194
+ assert.strictEqual(pre.record.commandHash, hash);
195
+ assert.strictEqual(pre.record.actionDescriptor.payloadHash, hash);
196
+ assert.ok(!JSON.stringify(pre.record).includes('private issue comment fixture'));
197
+ const post = gate.finalizeExecution(candidate, outcome, { sessionDir });
198
+ assert.strictEqual(post.record.disposition, 'executed');
199
+ assert.strictEqual(post.record.executionOutcome, outcome);
200
+ assert.strictEqual(post.record.commandHash, hash);
201
+ }
202
+ }
166
203
  const metadataEntry = preAdapter.processPayload({
167
204
  ...payload('', { toolUseId: 'metadata-entry' }),
168
205
  tool_name: 'mcp__codex_apps__github_update_pull_request',