harness-everything 1.5.3 → 1.6.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 (61) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.github/ISSUE_TEMPLATE/bug_report.yml +68 -0
  4. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.yml +33 -0
  6. package/.github/ISSUE_TEMPLATE/platform_compatibility.yml +80 -0
  7. package/.github/PULL_REQUEST_TEMPLATE.md +19 -0
  8. package/.github/dependabot.yml +13 -0
  9. package/.github/workflows/ci.yml +2 -2
  10. package/.github/workflows/release.yml +1 -1
  11. package/CHANGELOG.md +24 -0
  12. package/PRIVACY.md +34 -14
  13. package/README.md +76 -311
  14. package/ROADMAP.md +50 -0
  15. package/SECURITY.md +29 -8
  16. package/SUPPORT.md +4 -4
  17. package/TERMS.md +3 -3
  18. package/benchmarks/results/live-host/agy-2026-12-02-linux-loader/README.md +33 -0
  19. package/benchmarks/results/live-host/opencode-2026-12-02-450-steering/README.md +20 -0
  20. package/benchmarks/results/live-host/opencode-2026-12-02-450-steering/lifecycle.sanitized.jsonl +14 -0
  21. package/benchmarks/results/live-host/opencode-2026-12-02-450-steering/observations.sanitized.json +20 -0
  22. package/bin/cli.js +30 -7
  23. package/ci/action-gate.test.js +186 -0
  24. package/ci/installer-roundtrip.test.js +20 -0
  25. package/ci/lib/opencode-v2-driver.js +3 -1
  26. package/ci/mechanism-2aa-codex-action-gate-policy.test.js +21 -0
  27. package/ci/mechanism-2ap-sbom.test.js +6 -6
  28. package/ci/mechanism-2x-release-commit-message.test.js +34 -23
  29. package/ci/mechanism-341-opencode-lane.test.js +5 -1
  30. package/ci/mechanism-397-cycle-import.test.js +5 -1
  31. package/ci/mechanism-397-opencode-observations.test.js +260 -24
  32. package/ci/mechanism-548-bigint-identity.test.js +252 -5
  33. package/ci/mechanism-552-ledger-pairs.test.js +2 -0
  34. package/ci/mechanism-error-ledger-promote.test.js +122 -1
  35. package/ci/mechanism-system-one-install.test.js +50 -0
  36. package/ci/mechanism-task-git-authorization.test.js +14 -0
  37. package/docs/README.md +81 -0
  38. package/docs/codex-action-gate.md +1 -1
  39. package/docs/platform-capabilities.md +17 -5
  40. package/docs/platform-compatibility.json +6 -6
  41. package/docs/system-one-cycle.md +2 -1
  42. package/harness-everything/SKILL.md +1 -1
  43. package/harness-everything/scripts/system-one/cua_adapter.py +4 -2
  44. package/harness-everything/scripts/system-one/install.js +1 -5
  45. package/harness-everything/scripts/system-one/manifest.js +7 -3
  46. package/harness-everything/scripts/system-one/provider.js +3 -4
  47. package/hooks/scripts/action-gate.js +82 -2
  48. package/opencode-plugin/index.mjs +97 -35
  49. package/opencode-plugin/plugin.json +1 -1
  50. package/package.json +15 -2
  51. package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
  52. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  53. package/plugins/harness-everything/hooks/scripts/action-gate.js +82 -2
  54. package/plugins/harness-everything/plugin.json +1 -1
  55. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  56. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/cua_adapter.py +4 -2
  57. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/install.js +1 -5
  58. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/manifest.js +7 -3
  59. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/provider.js +3 -4
  60. package/sbom.cdx.json +7 -7
  61. package/scripts/system-one-cycle/package.js +2 -2
@@ -168,7 +168,7 @@ The Codex-only metadata exception checks the actual tool input, with all of thes
168
168
 
169
169
  Any additional key, including `state`, `base_branch`, `base`, `maintainer_can_modify`, `draft`, or an unknown key, prevents the exception, even when its value is null. Mixed metadata/high-risk inputs and similar operation names retain the existing Gate. Claude, OpenCode and unknown hosts retain their prior mutation rules. PR creation behavior is unchanged.
170
170
 
171
- Codex also defers only the exact Issue comment tools when their arguments are exactly `{ repo_full_name, pr_number, comment }` with a non-empty string comment, and the exact Issue update tools when their arguments are exactly `{ repository_full_name, issue_number, state: "closed", state_reason: "completed" }`. The comment connector uses `pr_number` for the Issue number. These remain `mutate`/`gated` actions and are audited as `routine-issue-comment` or `routine-issue-completed-close`; extra keys (including null), other states, required action gates, and other hosts stay gated.
171
+ Codex also defers only the exact Issue comment tools when their arguments are exactly `{ repo_full_name, pr_number, comment }` with a non-empty string comment, the exact Issue update tools when their arguments are exactly `{ repository_full_name, issue_number, state: "closed", state_reason: "completed" }`, and the exact confirmed GitHub MCP `create_issue` tools (`mcp__codex_apps__github__create_issue`, `mcp__codex_apps__github_create_issue`, `mcp__github__create_issue`) when their arguments contain exactly one valid repository selector (`repository_full_name` or `repo_full_name` as `owner/name`, or both single-segment `owner` and `repo`), a non-empty string `title`, and only optional typed `body` (string), `labels` (array of non-empty strings), `assignees` (array of non-empty strings), or `milestone` (positive safe integer). The comment connector uses `pr_number` for the Issue number. These remain `mutate`/`gated` actions (never downgraded to `read`/`unknown` or `shell`, and exact `mcp__*__create_issue` operations keep the same mutation-classification protection even for unknown providers) and are audited as `routine-issue-comment`, `routine-issue-completed-close`, or `routine-issue-create` with `deferred-to-host` and payload hash only (without storing raw title, body, or comment text); unknown providers (such as `mcp__demo__create_issue` or `mcp__get_provider__create_issue`), bare local-function `create_issue`, misleading names (`create_issues`, `foo_create_issue`), extra keys (including null), higher-risk descriptors, other states, required `actionGate` hints, and non-Codex hosts stay gated. These are deterministic mechanism rules, not live-host proof.
172
172
 
173
173
  ```mermaid
174
174
  flowchart LR
@@ -15,7 +15,7 @@ Statuses are intentionally explicit:
15
15
  - `Unsupported`: official host documentation explicitly rules out the capability.
16
16
  - `Unknown`: the capability or its current host behavior was not established.
17
17
 
18
- Codex, Antigravity (AGY), and OpenCode are `Partial` in `liveHostVerification`. The Codex artifact verifies user-hook compatibility capture for two consecutive turns on one Windows Codex CLI host; native plugin-hook mounting and other host/version combinations remain unverified. The AGY artifact covers global Desktop App `2.34.0` and `agy` CLI `1.5.15` (macOS), plus Windows Desktop and `agy` CLI `1.5.16` (`harness-everything` `1.0.1`), for plugin loading/validation and lifecycle hooks (including bounded 1-continuation `Stop` on Windows) under host-limited `PostToolUse` shell outcomes; IDE write tools, live `exitCode: 0` shell verification credit, live `model_stop`, and full project-scope isolation remain unverified. OpenCode supports the **V2 plugin API only** (OpenCode 1.x / V1 is unsupported): V2 live evidence covers one isolated `2.1.4` (macOS 26.6.2) long-lived server lifecycle trace (V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded`, and completion → verification → reminder delivery; standalone `opencode run` exits before verification finishes), earlier `2.1.3` macOS server-log load-only and `2.1.4` macOS workspace traces, and two isolated `2.4.1` (macOS 26.7.3) long-lived server runs establishing observation recording + idempotent training export (router/context injection indirectly observed via the model emitting the injected label contract, not a full injection trace) and mid-turn live steering delivery shape (witness-only for #450); ledger lessons, session create/delete reset, cancellation, global scope, npm-package install, and other versions/OSes remain unverified, while the retained OpenCode 1.18.31 (macOS) project-scope `.js` loading and edit/verification state artifact is historical/unsupported V1 evidence only. No fresh artifacts exist yet for the other surfaces, managed-workspace import, or public OpenAI approval.
18
+ Codex, Antigravity (AGY), and OpenCode are `Partial` in `liveHostVerification`. The Codex artifact verifies user-hook compatibility capture for two consecutive turns on one Windows Codex CLI host; native plugin-hook mounting and other host/version combinations remain unverified. The AGY artifact covers global Desktop App `2.34.0` and `agy` CLI `1.5.15` (macOS), plus Windows Desktop and `agy` CLI `1.5.16` (`harness-everything` `1.0.1`), for plugin loading/validation and lifecycle hooks (including bounded 1-continuation `Stop` on Windows) under host-limited `PostToolUse` shell outcomes; IDE write tools, live `exitCode: 0` shell verification credit, live `model_stop`, and full project-scope isolation remain unverified. OpenCode supports the **V2 plugin API only** (OpenCode 1.x / V1 is unsupported): V2 live evidence covers one isolated `2.1.4` (macOS 26.6.2) long-lived server lifecycle trace (V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded`, and completion → verification → reminder delivery; standalone `opencode run` exits before verification finishes), earlier `2.1.3` macOS server-log load-only and `2.1.4` macOS workspace traces, and two isolated `2.4.1` (macOS 26.7.3) long-lived server runs establishing observation recording + idempotent training export (router/context injection indirectly observed via the model emitting the injected label contract, not a full injection trace) and mid-turn live steering delivery shape (pre-fix witness for #450). A [2.4.1 Linux steering recheck](../benchmarks/results/live-host/opencode-2026-12-02-450-steering/README.md) observed two explicit unknown dispositions for a shared execution and a valid sequential control; session create/delete reset, cancellation, global scope, npm-package install, and untested host/version combinations remain unverified, while the retained OpenCode 1.18.31 (macOS) project-scope `.js` loading and edit/verification state artifact is historical/unsupported V1 evidence only. No fresh artifacts exist yet for the other surfaces, managed-workspace import, or public OpenAI approval.
19
19
 
20
20
  ### Codex PR metadata action-gate boundary
21
21
 
@@ -45,6 +45,13 @@ can therefore coexist with unresolved changes. The coordinator owns
45
45
  even when the hook is silent. The source and package fixtures cover these
46
46
  behaviors. Windows host delivery remains to be verified.
47
47
 
48
+ ### Antigravity Linux plugin loading
49
+
50
+ [AGY CLI 1.5.21 evidence](../benchmarks/results/live-host/agy-2026-12-02-linux-loader/README.md)
51
+ records validation, global installation and enabled-plugin discovery on
52
+ Debian 13.7. The project-only and clean control sessions stopped at
53
+ authentication before lifecycle evidence was available.
54
+
48
55
  ### Antigravity Windows shell handoff
49
56
 
50
57
  [AGY CLI 1.5.17 evidence](../benchmarks/results/live-host/agy-2026-11-26-516-read-only/README.md)
@@ -88,7 +95,7 @@ A shared matcher (`hooks/scripts/lib/ledger-match.js`) selects workspace ledger
88
95
  | Platform surface | Standalone skills | Plugin support | Hooks/lifecycle | Project scope | Global scope | Current evidence boundary |
89
96
  | --- | --- | --- | --- | --- | --- | --- |
90
97
  | Codex | `Supported` | `Mechanism verified` | `Partial`: user-hook compatibility capture is live-verified for `UserPromptSubmit` and `Stop` on one Windows Codex CLI host; native plugin hooks remain mechanism-verified | `.agents/skills/`, `AGENTS.md` | `~/.agents/skills/` | [Live evidence](../benchmarks/results/live-host/codex-2026-10-13/README.md) verifies two consecutive turns on Codex CLI 0.162.1; native plugin mounting, other lifecycle events, and other versions remain unverified. |
91
- | Antigravity (AGY) | `Supported` | `Partial` (`Mechanism verified`; global Desktop App `2.34.0` load and `agy` CLI `1.5.15` `validate`/`list --json` live-verified on macOS, plus `agy` CLI `1.5.16` `validate`/`list --json` on Windows; `validate --strict` fails on 2 multi-host warnings; temp `.agents/plugins/` hook discovery observed via `agy --print`) | `Partial`: `Mechanism verified` for all adapters; Desktop App `2.34.0` + CLI `1.5.15` (macOS) live-verified `SessionStart`, `PreInvocation` dedup, `PreToolUse` (`write_file`/`run_command`), `PostToolUse` edit tracking, and `Stop` (`NO_TOOL_CALL`); Windows Desktop + CLI `1.5.16` (`harness-everything` `1.0.1`) live-verified `SessionStart`, `PreInvocation`, and bounded 1-continuation `Stop`; `PostToolUse` omits `exitCode`/`error` on shell outcomes on macOS `2.34.0`/CLI `1.5.15` and Windows Desktop, so unknown shell outcomes grant no verification credit (`exitCode === 0` required); IDE write tools (`write_to_file`/`replace_file_content`/`multi_replace_file_content`) and live `model_stop` remain mechanism-only | `.agents/plugins/harness-everything/`, `.agents/rules/AGENTS.md` | `~/.gemini/config/plugins/harness-everything/` | [Mechanism evidence](../benchmarks/results/live-host/agy-2026-11-22/README.md) + [macOS partial live-host evidence](../benchmarks/results/live-host/agy-2026-11-23/README.md) + [Windows partial live-host evidence](../benchmarks/results/live-host/agy-2026-11-25/README.md); `/hooks` TUI view, full project-scope `harness-everything` isolation, IDE write tools, live shell `exitCode: 0` verification credit, and live `Stop` `model_stop` remain open in issue #514. |
98
+ | Antigravity (AGY) | `Supported` | `Partial` (`Mechanism verified`; global Desktop App `2.34.0` load and `agy` CLI `1.5.15` `validate`/`list --json` live-verified on macOS, plus `agy` CLI `1.5.16` `validate`/`list --json` on Windows and CLI `1.5.21` global validation, installation and discovery on Linux; `validate --strict` fails on 2 multi-host warnings; temp `.agents/plugins/` hook discovery observed via `agy --print`) | `Partial`: `Mechanism verified` for all adapters; Desktop App `2.34.0` + CLI `1.5.15` (macOS) live-verified `SessionStart`, `PreInvocation` dedup, `PreToolUse` (`write_file`/`run_command`), `PostToolUse` edit tracking, and `Stop` (`NO_TOOL_CALL`); Windows Desktop + CLI `1.5.16` (`harness-everything` `1.0.1`) live-verified `SessionStart`, `PreInvocation`, and bounded 1-continuation `Stop`; `PostToolUse` omits `exitCode`/`error` on shell outcomes on macOS `2.34.0`/CLI `1.5.15` and Windows Desktop, so unknown shell outcomes grant no verification credit (`exitCode === 0` required); IDE write tools (`write_to_file`/`replace_file_content`/`multi_replace_file_content`) and live `model_stop` remain mechanism-only | `.agents/plugins/harness-everything/`, `.agents/rules/AGENTS.md` | `~/.gemini/config/plugins/harness-everything/` | [Mechanism evidence](../benchmarks/results/live-host/agy-2026-11-22/README.md) + [macOS partial live-host evidence](../benchmarks/results/live-host/agy-2026-11-23/README.md) + [Windows partial live-host evidence](../benchmarks/results/live-host/agy-2026-11-25/README.md) + [Linux CLI loader evidence](../benchmarks/results/live-host/agy-2026-12-02-linux-loader/README.md); `/hooks` TUI view, full project-scope `harness-everything` isolation, IDE write tools, live shell `exitCode: 0` verification credit, and live `Stop` `model_stop` remain open in issue #514. |
92
99
  | ChatGPT / OpenAI Plugin | `Unknown` for a repository-local standalone path | `Mechanism verified` | `Partial`: local Work/Codex hooks are separate from ordinary Chat | Managed workspace marketplace | Not established | The public Skills-only bundle is mechanically reproducible; import, approval, and live behavior remain `Unknown`. |
93
100
  | Claude Code | `Supported` | `Supported` | `Mechanism verified` for Harness configuration | `.claude/skills/` | `~/.claude/skills/` | Native Claude surfaces and the state-specific plugin sync command are mechanically checked; fresh-host execution is not preserved here. |
94
101
  | OpenCode | `Supported` | `Partial` (V2 plugin API only; OpenCode 1.x / V1 unsupported; V2 default-export load verified live on OpenCode 2.1.3 macOS via server-log only, in the 2.1.4 macOS 26.6.2 V2 lifecycle trace and 2.1.4 macOS workspace trace, and in the 2.4.1 macOS 26.7.3 long-lived server runs; full router injection trace remains mechanism-tested on V2) | `Partial` (V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded`, and completion → verification → reminder delivery on a long-lived server are live-observed on OpenCode 2.1.4 macOS 26.6.2; observation recording + training export — with router/context injection indirectly observed as the model emitted the injected label contract — and mid-turn live steering delivery shape are live-observed on OpenCode 2.4.1 macOS 26.7.3 on a long-lived server; E-0003 ledger-lesson context delivery after a matched `git commit` is live-observed on OpenCode 2.4.1 macOS (paired run, after the action); full router/context injection trace, lesson delivery before the action, session create/delete reset, and cancellation remain mechanism-verified only; retained 1.18.31 project-scope `.js` loading and edit/verification state artifact is historical/unsupported V1 evidence) | `.opencode/skills/`, `.agents/skills/`, `.opencode/plugins/` | `~/.config/opencode/skills/`, `~/.agents/skills/`, `~/.config/opencode/plugins/` | **V2-only support boundary (#453):** OpenCode V2 plugin API family only (OpenCode 1.x / V1 unsupported; no validated minimum patch version claimed). Tested V2 live observations: an isolated [OpenCode 2.1.4/macOS 26.6.2 V2 lifecycle trace](../benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md) (one host/version/run establishing V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded` completion, and completion → verification → reminder delivery on a long-lived server; `opencode run --standalone` exits before verification finishes), V2 default-export load on OpenCode 2.1.3 (macOS, 2026-10-23, server-log evidence only), a separate [OpenCode 2.1.4/macOS session workspace trace](../benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md) observing `ctx.session.get({sessionID})` returning `location.directory` for two sessions matching setup (no mismatch test or V2 hook fire), and two isolated OpenCode 2.4.1/macOS 26.7.3 long-lived server runs (`OPENCODE_PASSWORD` required): [turn → export trace](../benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md) (observation recording for two turns + idempotent training export; router/context injection indirectly observed as the model emitted the injected label contract, not a full injection trace) and [steering trace](../benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md) (mid-turn live steering delivery shape, witness-only for #450). Full router/context injection trace, ledger lessons, session create/delete reset, cancellation, and workspace mismatch handling remain mechanism evidence only. [Retained historical/unsupported V1 evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md) (OpenCode 1.18.31, macOS) documents project-scope `.js` loading and edit/verification state in one V1 host session, with a post-reset final snapshot, hard lock only an interactive observation with no retained blocked-tool trace, and operator-seeded then agent-rewritten reflection; it is preserved as historical/unsupported evidence only and does not establish current V2 support. `.mjs` auto-discovery is silently ignored (issue #127); global scope, npm-package installation, and other host versions remain unverified (as do other OSes). |
@@ -257,8 +264,13 @@ coverage of every V2 release:
257
264
  control receives its own `execution.started` + `succeeded`). Witness-only for
258
265
  #450 observation overwrite/drop; no product fix this round.
259
266
 
260
- These observations establish bounded V2 lifecycle coverage on macOS,
261
- not full V2 lifecycle verification across all hooks or platforms. The adapter
267
+ - **OpenCode 2.4.1 (Debian 13.7, 2026-12-02):** a
268
+ [steering recheck](../benchmarks/results/live-host/opencode-2026-12-02-450-steering/README.md)
269
+ used a real long-lived server with a scripted local model endpoint. Two
270
+ distinct delivered prompts shared one execution and each recorded
271
+ `final-message-unavailable`. The next execution recorded a valid label.
272
+
273
+ The macOS and Linux traces cover the lifecycle paths described above. The adapter
262
274
  has deterministic V2 mechanism coverage (`ci/mechanism-2n-opencode-plugin.test.js`,
263
275
  V2 edit/verification/reminder/state shapes;
264
276
  `ci/mechanism-2p-opencode-v2-entrypoint.test.js`, V2-only export contract and
@@ -267,7 +279,7 @@ injection, fail-open router diagnostics on launch or runtime failure, turn
267
279
  capture, malformed-label export counts, and opt-out). Full router/context
268
280
  injection trace, ledger lessons, session create/delete reset, cancellation,
269
281
  and workspace mismatch handling remain mechanism evidence only; global scope,
270
- npm-package install, and other versions/OSes remain unverified.
282
+ npm-package install, and untested host/version combinations remain unverified.
271
283
 
272
284
  **Historical / unsupported V1 evidence:** retained evidence from the retired V1
273
285
  era documents project-scope `.js` loading and edit/verification state on
@@ -185,15 +185,15 @@
185
185
  ],
186
186
  "capabilities": {
187
187
  "standaloneSkills": {"status": "Supported", "paths": {"project": [".opencode/skills", ".agents/skills", ".claude/skills"], "global": ["~/.config/opencode/skills", "~/.agents/skills", "~/.claude/skills"]}},
188
- "pluginSupport": {"status": "Partial", "paths": {"project": [".opencode/plugins"], "global": ["~/.config/opencode/plugins"]}, "notes": "OpenCode V2 plugin API only; OpenCode 1.x / V1 is unsupported (#453). Default export ({ id, setup(ctx) }) is the only public surface. Tested V2 live observations: OpenCode 2.1.4 (macOS 26.6.2, isolated V2 lifecycle trace at benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md establishing V2 default-export load, tool hooks, event envelope + session.execution.succeeded, and completion -> verification -> reminder delivery on a long-lived server), OpenCode 2.1.3 (macOS, server-log load-only), OpenCode 2.1.4 (macOS, limited session workspace trace), and OpenCode 2.4.1 (macOS 26.7.3, long-lived server runs at benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md and benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md); no validated minimum patch version is claimed. Install under a .js filename because .mjs install names are silently ignored (issue #127). Retained OpenCode 1.18.31 (macOS) evidence (benchmarks/results/live-host/opencode-2026-09-16/README.md) is historical/unsupported V1 evidence only. Global scope, npm-package installation, and other host versions remain unverified (as do other OSes)."},
188
+ "pluginSupport": {"status": "Partial", "paths": {"project": [".opencode/plugins"], "global": ["~/.config/opencode/plugins"]}, "notes": "OpenCode V2 plugin API only; OpenCode 1.x / V1 is unsupported (#453). Default export ({ id, setup(ctx) }) is the only public surface. Tested V2 live observations: OpenCode 2.1.4 (macOS 26.6.2, isolated V2 lifecycle trace at benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md establishing V2 default-export load, tool hooks, event envelope + session.execution.succeeded, and completion -> verification -> reminder delivery on a long-lived server), OpenCode 2.1.3 (macOS, server-log load-only), OpenCode 2.1.4 (macOS, limited session workspace trace), and OpenCode 2.4.1 (macOS 26.7.3, long-lived server runs at benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md and benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md); no validated minimum patch version is claimed. Install under a .js filename because .mjs install names are silently ignored (issue #127). Retained OpenCode 1.18.31 (macOS) evidence (benchmarks/results/live-host/opencode-2026-09-16/README.md) is historical/unsupported V1 evidence only. Linux OpenCode 2.4.1 project-scope load and steering are recorded at benchmarks/results/live-host/opencode-2026-12-02-450-steering/README.md. Global scope, npm-package installation, and other host versions remain unverified."},
189
189
  "bundledSkills": {"status": "Partial", "notes": "Harness provides a standalone enforcement module; it is not an OpenCode bundled-skill package."},
190
- "hooksLifecycle": {"status": "Partial", "notes": "OpenCode V2 plugin API only (OpenCode 1.x / V1 unsupported). An isolated OpenCode 2.1.4 (macOS 26.6.2) V2 lifecycle trace (benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md) establishes V2 default-export load, V2 tool hooks (tool.execute.before/after), the V2 event envelope + session.execution.succeeded completion, and completion -> verification -> reminder delivery on a long-lived server (standalone opencode run exits before verification finishes). Two isolated OpenCode 2.4.1 (macOS 26.7.3) long-lived server runs establish observation recording + idempotent training export with router/context injection indirectly observed as the model emitted the injected label contract (benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md) and mid-turn live steering delivery shape as witness-only for #450 (benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md). Full router/context injection trace, ledger lessons, session create/delete reset, and cancellation were not exercised live and remain mechanism-verified only; OpenCode 2.1.3 evidence is load-only and the 2026-11-15 OpenCode 2.1.4 workspace trace did not fire V2 hooks. Retained historical/unsupported V1 evidence (benchmarks/results/live-host/opencode-2026-09-16/README.md) covers project-scope .js loading and edit/verification state on OpenCode 1.18.31 (macOS) from a post-reset snapshot predating Rule-of-3 retirement (hard lock was only an interactive observation with no retained blocked-tool trace; reflection was operator-seeded) and does not establish current V2 capability. Global scope, npm-package installation, and other host versions remain unverified (as do other OSes)."},
190
+ "hooksLifecycle": {"status": "Partial", "notes": "OpenCode V2 plugin API only (OpenCode 1.x / V1 unsupported). An isolated OpenCode 2.1.4 (macOS 26.6.2) V2 lifecycle trace (benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md) establishes V2 default-export load, V2 tool hooks (tool.execute.before/after), the V2 event envelope + session.execution.succeeded completion, and completion -> verification -> reminder delivery on a long-lived server (standalone opencode run exits before verification finishes). Two isolated OpenCode 2.4.1 (macOS 26.7.3) long-lived server runs establish observation recording + idempotent training export with router/context injection indirectly observed as the model emitted the injected label contract (benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md) and mid-turn live steering delivery shape as witness-only for #450 (benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md). Full router/context injection trace, ledger lessons, session create/delete reset, and cancellation were not exercised live and remain mechanism-verified only; OpenCode 2.1.3 evidence is load-only and the 2026-11-15 OpenCode 2.1.4 workspace trace did not fire V2 hooks. Retained historical/unsupported V1 evidence (benchmarks/results/live-host/opencode-2026-09-16/README.md) covers project-scope .js loading and edit/verification state on OpenCode 1.18.31 (macOS) from a post-reset snapshot predating Rule-of-3 retirement (hard lock was only an interactive observation with no retained blocked-tool trace; reflection was operator-seeded) and does not establish current V2 capability. Linux OpenCode 2.4.1 project-scope load and steering are recorded at benchmarks/results/live-host/opencode-2026-12-02-450-steering/README.md. Global scope, npm-package installation, and other host versions remain unverified."},
191
191
  "projectScope": {"status": "Partial", "paths": {"skills": [".opencode/skills", ".agents/skills"], "plugins": [".opencode/plugins"]}, "notes": "Project-scope V2 default-export load, tool hooks, session.execution.succeeded completion, and completion -> verification -> reminder delivery on a long-lived server were observed on one OpenCode 2.1.4 (macOS 26.6.2) run (benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md), alongside OpenCode 2.1.3 (macOS) server-log load, 2.1.4 (macOS) workspace field availability, and two OpenCode 2.4.1 (macOS 26.7.3) long-lived server runs establishing observation recording + training export (router/context injection indirectly observed via model-emitted label contract) and live steering delivery shape (benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md, benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md); full router/context injection trace, ledger lessons, session create/delete reset, and cancellation remain unverified live. Standalone skill discovery remains path-contract verified. Retained OpenCode 1.18.31 (macOS) artifact is historical/unsupported V1 evidence only."},
192
192
  "globalScope": {"status": "Mechanism verified", "paths": {"skills": ["~/.config/opencode/skills", "~/.agents/skills"], "plugins": ["~/.config/opencode/plugins"]}},
193
193
  "installUninstallSymmetry": {"status": "Unknown", "notes": "The adapter is manually copied; Harness does not own an OpenCode install/uninstall flow."},
194
194
  "assetsReferences": {"status": "Mechanism verified", "notes": "The adapter is self-contained and skill references are separately checked."},
195
195
  "updateSync": {"status": "Unknown", "notes": "No live OpenCode refresh or npm plugin update is preserved."},
196
- "liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md", "notes": "OpenCode V2 plugin API only; OpenCode 1.x / V1 is unsupported (#453). Tested V2 live evidence: one isolated OpenCode 2.1.4 (macOS 26.6.2) V2 lifecycle trace at benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md (V2 default-export load, V2 tool hooks, V2 event envelope + session.execution.succeeded completion, and completion -> verification -> reminder delivery on a long-lived server; standalone opencode run exits before verification finishes), OpenCode 2.1.3 (macOS, server-log load-only), OpenCode 2.1.4 (macOS, limited session workspace trace at benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md), and two isolated OpenCode 2.4.1 (macOS 26.7.3) long-lived server runs: benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md (observation recording + idempotent training export; router/context injection indirectly observed as the model emitted the injected label contract, not a full injection trace) and benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md (mid-turn live steering delivery shape, witness-only for #450); no validated minimum patch version is claimed. Full router/context injection trace, ledger lessons, session create/delete reset, and cancellation remain unverified live. The retained historical artifact at benchmarks/results/live-host/opencode-2026-09-16/README.md is historical/unsupported V1 evidence documenting project-scope .js loading and edit/verification state on OpenCode 1.18.31 (macOS), not current V2 capability or durable hard enforcement: final snapshot is post-reset (hardLock: false), hard lock was only an interactive observation with no retained blocked-tool trace, reflection was operator-seeded, and agent-controlled state deletion reset the former breaker before Rule-of-3 retirement. Global scope, npm-package installation, and other host versions remain unverified (as do other OSes)."}
196
+ "liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md", "notes": "OpenCode V2 plugin API only; OpenCode 1.x / V1 is unsupported (#453). Tested V2 live evidence: one isolated OpenCode 2.1.4 (macOS 26.6.2) V2 lifecycle trace at benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md (V2 default-export load, V2 tool hooks, V2 event envelope + session.execution.succeeded completion, and completion -> verification -> reminder delivery on a long-lived server; standalone opencode run exits before verification finishes), OpenCode 2.1.3 (macOS, server-log load-only), OpenCode 2.1.4 (macOS, limited session workspace trace at benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md), and two isolated OpenCode 2.4.1 (macOS 26.7.3) long-lived server runs: benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md (observation recording + idempotent training export; router/context injection indirectly observed as the model emitted the injected label contract, not a full injection trace) and benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md (mid-turn live steering delivery shape, witness-only for #450); no validated minimum patch version is claimed. Full router/context injection trace, ledger lessons, session create/delete reset, and cancellation remain unverified live. The retained historical artifact at benchmarks/results/live-host/opencode-2026-09-16/README.md is historical/unsupported V1 evidence documenting project-scope .js loading and edit/verification state on OpenCode 1.18.31 (macOS), not current V2 capability or durable hard enforcement: final snapshot is post-reset (hardLock: false), hard lock was only an interactive observation with no retained blocked-tool trace, reflection was operator-seeded, and agent-controlled state deletion reset the former breaker before Rule-of-3 retirement. Linux OpenCode 2.4.1 project-scope load and steering are recorded at benchmarks/results/live-host/opencode-2026-12-02-450-steering/README.md. Global scope, npm-package installation, and other host versions remain unverified."}
197
197
  }
198
198
  },
199
199
  {
@@ -290,15 +290,15 @@
290
290
  ],
291
291
  "capabilities": {
292
292
  "standaloneSkills": {"status": "Supported", "notes": "Harness bundles all 28 canonical skills in plugins/harness-everything/skills/ and syncs rules/AGENTS.md; standalone AGY skill-only targets are not separately registered in installer.js."},
293
- "pluginSupport": {"status": "Partial", "paths": {"manifest": [".antigravity-plugin/plugin.json"], "project": [".agents/plugins/harness-everything"], "global": ["~/.gemini/config/plugins/harness-everything"]}, "notes": "Package parity is mechanism-verified; global Desktop App 2.34.0 (macOS) GetAllPlugins load and agy CLI 1.5.15 validate/list --json are live-verified (validate exits 0 with 2 multi-host warnings; --strict exits 1). Project-scope .agents/plugins/ hook discovery was observed on agy CLI 1.5.15 via a temporary probe plugin; full project-scope harness-everything isolation and Desktop App project scope remain unverified."},
293
+ "pluginSupport": {"status": "Partial", "paths": {"manifest": [".antigravity-plugin/plugin.json"], "project": [".agents/plugins/harness-everything"], "global": ["~/.gemini/config/plugins/harness-everything"]}, "notes": "Package parity is mechanism-verified; global Desktop App 2.34.0 (macOS) GetAllPlugins load and agy CLI 1.5.15 validate/list --json are live-verified (validate exits 0 with 2 multi-host warnings; --strict exits 1). Linux agy CLI 1.5.21 also validated, installed and listed the global plugin. Project-scope .agents/plugins/ hook discovery was observed on agy CLI 1.5.15 via a temporary probe plugin; full project-scope harness-everything isolation and Desktop App project scope remain unverified."},
294
294
  "bundledSkills": {"status": "Mechanism verified", "paths": {"skills": ["plugins/harness-everything/skills/<name>/SKILL.md"]}, "notes": "Package checks verify all 28 canonical skills, and agy plugin validate --json (1.5.15) counted skills: 28; live invocation across all 28 skills remains unverified."},
295
295
  "hooksLifecycle": {"status": "Partial", "notes": "Deterministic mechanism tests cover SessionStart, PreInvocation, PreToolUse, PostToolUse, and Stop. Desktop App 2.34.0 and CLI 1.5.15 (macOS) live-verified SessionStart, PreInvocation, PreToolUse (write_file/run_command), PostToolUse edit timestamps, and Stop (NO_TOOL_CALL). Host limits: PostToolUse omits exitCode and error on shell non-zero exit (1) on both Desktop 2.34.0 and CLI 1.5.15, so unknown shell outcomes grant no verification credit and preserve failed state (explicit exitCode === 0 required); IDE write tools (write_to_file, replace_file_content, multi_replace_file_content) and live Stop model_stop remain unverified."},
296
296
  "projectScope": {"status": "Partial", "paths": {"plugins": [".agents/plugins/harness-everything"], "rules": [".agents/rules/AGENTS.md"]}, "notes": "agy CLI 1.5.15 plugin list --json only lists global plugins, while agy --print discovered and executed project-scope .agents/plugins/ hooks from a temporary probe plugin. Full project-scope harness-everything isolation without global install and Desktop App project-scope loading remain unverified."},
297
- "globalScope": {"status": "Partial", "paths": {"plugins": ["~/.gemini/config/plugins/harness-everything"]}, "notes": "Global load and hook execution are live-verified on Antigravity 2.0 Desktop App 2.34.0 (macOS), agy CLI 1.5.15 (macOS), and Windows Antigravity Desktop + agy CLI 1.5.16; Linux and other AGY versions remain unverified."},
297
+ "globalScope": {"status": "Partial", "paths": {"plugins": ["~/.gemini/config/plugins/harness-everything"]}, "notes": "Global load and hook execution are live-verified on Antigravity 2.0 Desktop App 2.34.0 (macOS), agy CLI 1.5.15 (macOS), and Windows Antigravity Desktop + agy CLI 1.5.16. Linux agy CLI 1.5.21 verified global installation and discovery. Linux lifecycle hooks and other AGY versions remain unverified."},
298
298
  "installUninstallSymmetry": {"status": "Mechanism verified", "notes": "scripts/plugin-sync.js --host agy install/update/dry-run and staged rollback are covered by mechanism tests and synced live to global scope; plugin-sync.js does not provide uninstall symmetry."},
299
299
  "assetsReferences": {"status": "Mechanism verified", "notes": "Packaged skills, rules/AGENTS.md byte-for-byte parity, and packaged agy-*.js hook scripts are verified by ci/mechanism-agy-plugin-package.test.js."},
300
300
  "updateSync": {"status": "Partial", "notes": "scripts/plugin-sync.js --host agy --json is mechanism-tested and was observed live updating ~/.gemini/config/plugins/harness-everything on macOS; other OSes and project-scope sync live behavior remain unverified."},
301
- "liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/agy-2026-11-23/README.md", "notes": "Partial live-host evidence covers global Antigravity 2.0 Desktop App 2.34.0 (macOS), agy CLI 1.5.15 (macOS), and Windows Desktop + agy CLI 1.5.16 (benchmarks/results/live-host/agy-2026-11-25/README.md): plugin validate/list, SessionStart, PreInvocation, PreToolUse (write_file/run_command), PostToolUse edit timestamps, bounded Stop continuation (NO_TOOL_CALL / direct revision + workspace fingerprint), and temporary project-scope hook discovery. IDE write tools, live shell exitCode: 0 verification credit, live Stop model_stop, full project-scope isolation, and Linux hosts remain unverified."}
301
+ "liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/agy-2026-11-23/README.md", "notes": "Partial live-host evidence covers global Antigravity 2.0 Desktop App 2.34.0 (macOS), agy CLI 1.5.15 (macOS), and Windows Desktop + agy CLI 1.5.16 (benchmarks/results/live-host/agy-2026-11-25/README.md): plugin validate/list, SessionStart, PreInvocation, PreToolUse (write_file/run_command), PostToolUse edit timestamps, bounded Stop continuation (NO_TOOL_CALL / direct revision + workspace fingerprint), and temporary project-scope hook discovery. Linux AGY CLI 1.5.21 validated, installed and listed the enabled global plugin (benchmarks/results/live-host/agy-2026-12-02-linux-loader/README.md). Linux lifecycle hooks, IDE write tools, live shell exitCode: 0 verification credit, live Stop model_stop, and full project-scope isolation remain unverified."}
302
302
  }
303
303
  }
304
304
  ]
@@ -18,7 +18,8 @@ flowchart LR
18
18
  - Use a fresh, private directory for this cycle, outside the Harness checkout. On POSIX hosts the scripts set directory permissions to `0700` and data files to `0600`; on Windows, use a user-private directory with a restrictive ACL.
19
19
  - For cross-month comparisons, choose one absolute private history file outside the checkout and every cycle directory, then pass the same `--history` path to each month's `evaluate` or `all` command. If omitted, history remains at `<private-cycle-dir>/training/history.jsonl` for compatibility and is cycle-local.
20
20
  - Set `--since` to the last completed collection boundary. `collect` requires this date and accepts an optional `--sessions` path for a non-default Codex session directory.
21
- - Pick a version id containing letters, numbers, dots, underscores, or hyphens. Reuse the same data directory and version id to resume; use a new directory for the next month.
21
+ - Use a version ID of 1–80 characters starting with a lowercase ASCII letter or digit. Subsequent characters may include lowercase ASCII letters, digits, dots, underscores, and hyphens. Version IDs are used as written. Reuse the same data directory and version id to resume; use a new directory for the next month.
22
+ - An existing active pointer with an invalid version ID requires manual recovery. Preserve that installation and its pointer, then install and activate a checkpoint published with a valid ID in a clean directory using `--dir`. Set `HARNESS_SYSTEM_ONE_HOME` to that directory for runtime use.
22
23
  - Replace the placeholders in the commands below with real paths, dates, and a version id.
23
24
 
24
25
  ## Steps
@@ -4,7 +4,7 @@ description: "Route software/project work through Harness: classify tier/topolog
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 1.5.2
7
+ version: 1.5.4
8
8
  ---
9
9
 
10
10
  # Harness Everything
@@ -195,9 +195,9 @@ def load_active_bundle(active_path, expected_fingerprint=None, scorer_loader=Non
195
195
  pointer = json.loads(active_path.read_text(encoding='utf-8'))
196
196
  if (not isinstance(pointer, dict) or set(pointer) != {'schemaVersion', 'version', 'dir', 'previous', 'activatedAt'}
197
197
  or pointer.get('schemaVersion') != 1 or not isinstance(pointer.get('version'), str)
198
- or not ID_PATTERN.fullmatch(pointer['version']) or not isinstance(pointer.get('dir'), str)
198
+ or not VERSION_PATTERN.fullmatch(pointer['version']) or not isinstance(pointer.get('dir'), str)
199
199
  or not Path(pointer['dir']).is_absolute()
200
- or (pointer.get('previous') is not None and (not isinstance(pointer['previous'], str) or not ID_PATTERN.fullmatch(pointer['previous'])))
200
+ or (pointer.get('previous') is not None and (not isinstance(pointer['previous'], str) or not VERSION_PATTERN.fullmatch(pointer['previous'])))
201
201
  or not isinstance(pointer.get('activatedAt'), str)):
202
202
  raise ValueError('active-pointer')
203
203
  directory = Path(pointer['dir'])
@@ -260,6 +260,8 @@ MAX_CLIENTS = 64
260
260
  READ_DEADLINE_S = 1.0 # never longer than the Node client's 1000 ms call deadline
261
261
  STARTUP_REASONS = ('artifact-hash', 'checkpoint-format')
262
262
  ID_PATTERN = re.compile(r'[a-z0-9._-]{1,80}')
263
+ # Version IDs match manifest.js; request tasks and options use ID_PATTERN.
264
+ VERSION_PATTERN = re.compile(r'[a-z0-9][a-z0-9._-]{0,79}')
263
265
  HASH_PATTERN = re.compile(r'[0-9a-f]{64}')
264
266
  _USER_SID = []
265
267
 
@@ -7,7 +7,7 @@ const path = require('node:path');
7
7
  const { createHash, randomBytes } = require('node:crypto');
8
8
  const { spawnSync } = require('node:child_process');
9
9
  const { PINNED_CUA_S1_REVISION } = require('./provider');
10
- const { STAGES, validateVersionManifest } = require('./manifest');
10
+ const { STAGES, validVersion, validateVersionManifest } = require('./manifest');
11
11
 
12
12
  const PINS = Object.freeze({
13
13
  cuaS1Revision: PINNED_CUA_S1_REVISION,
@@ -23,10 +23,6 @@ const versionDir = (dir, version) => path.join(path.resolve(dir), 'versions', ve
23
23
  const activePath = dir => path.join(path.resolve(dir), 'active.json');
24
24
  const hash = bytes => createHash('sha256').update(bytes).digest('hex');
25
25
 
26
- function validVersion(version) {
27
- return typeof version === 'string' && /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(version)
28
- && version !== '.' && version !== '..';
29
- }
30
26
  function assertVersion(version) {
31
27
  if (!validVersion(version)) throw new Error('invalid-version: use a single safe version id');
32
28
  }
@@ -6,11 +6,15 @@ const path = require('node:path');
6
6
  const STAGES = ['validity', 'intent', 'tier'];
7
7
  const SAFE_ID = /^[a-z0-9._-]{1,80}$/;
8
8
  const HASH = /^[a-f0-9]{64}$/;
9
- const VERSION = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
9
+ const VERSION = /^[a-z0-9][a-z0-9._-]{0,79}$/;
10
10
  const SAFE_PATH_PART = /^[A-Za-z0-9._-]+$/;
11
11
  const exact = (value, keys) => value && typeof value === 'object' && !Array.isArray(value)
12
12
  && Object.keys(value).length === keys.length && keys.every(key => Object.hasOwn(value, key));
13
13
 
14
+ function validVersion(version) {
15
+ return typeof version === 'string' && VERSION.test(version);
16
+ }
17
+
14
18
  function safeRelative(value) {
15
19
  return typeof value === 'string' && value.length > 0 && !value.includes('\\')
16
20
  && !path.posix.isAbsolute(value) && !path.win32.isAbsolute(value)
@@ -20,7 +24,7 @@ function safeRelative(value) {
20
24
  function validateVersionManifest(manifest, expectedVersion) {
21
25
  const fail = detail => { throw new TypeError(`invalid-manifest: ${detail}`); };
22
26
  if (!exact(manifest, ['schemaVersion', 'version', 'createdAt', 'stages', 'evaluation'])
23
- || manifest.schemaVersion !== 1 || typeof manifest.version !== 'string' || !VERSION.test(manifest.version)
27
+ || manifest.schemaVersion !== 1 || !validVersion(manifest.version)
24
28
  || (expectedVersion !== undefined && manifest.version !== expectedVersion)
25
29
  || typeof manifest.createdAt !== 'string' || !Number.isFinite(Date.parse(manifest.createdAt))
26
30
  || !exact(manifest.stages, STAGES)
@@ -63,4 +67,4 @@ if (require.main === module) {
63
67
  } catch (_) { process.exitCode = 1; }
64
68
  }
65
69
 
66
- module.exports = { STAGES, validateVersionManifest };
70
+ module.exports = { STAGES, validVersion, validateVersionManifest };
@@ -5,7 +5,7 @@ const path = require('node:path');
5
5
  const { createHash } = require('node:crypto');
6
6
  const { spawnSync } = require('node:child_process');
7
7
  const { createRequest, validateRequest, validateResponse } = require('./contract');
8
- const { STAGES, validateVersionManifest } = require('./manifest');
8
+ const { STAGES, validVersion, validateVersionManifest } = require('./manifest');
9
9
  // Upstream cua_s1 source revision documented in docs/system-one-routing.md.
10
10
  const PINNED_CUA_S1_REVISION = 'b7f7e2d8714609853a29c7d049140bc46aec0954';
11
11
  const ADAPTER = path.join(__dirname, 'cua_adapter.py');
@@ -18,7 +18,6 @@ const adapterName = value => typeof value === 'string' && /^[a-z][a-z0-9_-]{0,63
18
18
  // Thresholds calibrated on validation for this checkpoint (docs/system-one-training.md).
19
19
  const inRange = (v, lo, hi) => typeof v === 'number' && Number.isFinite(v) && v >= lo && v <= hi;
20
20
  const LIVE_STAGES = STAGES;
21
- const SAFE_ID = /^[a-z0-9._-]{1,80}$/;
22
21
  const sha256 = value => createHash('sha256').update(value).digest('hex');
23
22
  const MAX_LAYER_BYTES = 32 * 1024 * 1024;
24
23
  // secondaryThreshold is optional and belongs to intent checkpoints (docs/system-one-intent.md#scoring).
@@ -141,9 +140,9 @@ function readActive(env = process.env) {
141
140
  if (!pointerStat.isFile() || pointerStat.isSymbolicLink() || pointerStat.size > 65536) return null;
142
141
  const pointer = JSON.parse(fs.readFileSync(pointerPath, 'utf8'));
143
142
  if (!exact(pointer, ['schemaVersion', 'version', 'dir', 'previous', 'activatedAt']) || pointer.schemaVersion !== 1
144
- || typeof pointer.version !== 'string' || !SAFE_ID.test(pointer.version)
143
+ || !validVersion(pointer.version)
145
144
  || typeof pointer.dir !== 'string' || !path.isAbsolute(pointer.dir)
146
- || !(pointer.previous === null || (typeof pointer.previous === 'string' && SAFE_ID.test(pointer.previous)))
145
+ || !(pointer.previous === null || validVersion(pointer.previous))
147
146
  || typeof pointer.activatedAt !== 'string' || !Number.isFinite(Date.parse(pointer.activatedAt))) return null;
148
147
  const dir = pointer.dir;
149
148
  const dirStat = fs.lstatSync(dir);
@@ -157,12 +157,39 @@ const ISSUE_COMPLETED_CLOSE_TOOLS = new Set([
157
157
  'mcp__codex_apps__github__update_issue',
158
158
  'mcp__codex_apps__github_update_issue',
159
159
  ]);
160
- // Both Issue exceptions require an owner/name repository selector; an ownerless
160
+ const ISSUE_CREATE_TOOLS = new Set([
161
+ 'mcp__codex_apps__github__create_issue',
162
+ 'mcp__codex_apps__github_create_issue',
163
+ 'mcp__github__create_issue',
164
+ ]);
165
+ // Issue exceptions require an owner/name repository selector; an ownerless
161
166
  // name is uncertain and must keep the original gate.
162
167
  const OWNER_REPO_SELECTOR = /^[^/\s]+\/[^/\s]+$/;
168
+ const SINGLE_REPO_SEGMENT = /^[^/\s]+$/;
169
+ const ISSUE_CREATE_ALLOWED_KEYS = new Set([
170
+ 'repository_full_name',
171
+ 'repo_full_name',
172
+ 'owner',
173
+ 'repo',
174
+ 'title',
175
+ 'body',
176
+ 'labels',
177
+ 'assignees',
178
+ 'milestone',
179
+ ]);
180
+
181
+ function isIssueCreateTool(name) {
182
+ const text = String(name || '');
183
+ if (text === 'mcp__codex_apps__github_create_issue') return true;
184
+ const segments = text.split('__');
185
+ return segments.length >= 3
186
+ && segments[0].toLowerCase() === 'mcp'
187
+ && segments.slice(1, -1).every(Boolean)
188
+ && segments[segments.length - 1] === 'create_issue';
189
+ }
163
190
 
164
191
  function isRoutineIssueTool(name) {
165
- return ISSUE_COMMENT_TOOLS.has(name) || ISSUE_COMPLETED_CLOSE_TOOLS.has(name);
192
+ return ISSUE_COMMENT_TOOLS.has(name) || ISSUE_COMPLETED_CLOSE_TOOLS.has(name) || isIssueCreateTool(name);
166
193
  }
167
194
 
168
195
  function hasExactKeys(input, expected) {
@@ -170,6 +197,48 @@ function hasExactKeys(input, expected) {
170
197
  return keys.length === expected.length && expected.every(key => Object.prototype.hasOwnProperty.call(input, key));
171
198
  }
172
199
 
200
+ function isNonEmptyStringArray(value) {
201
+ return Array.isArray(value) && value.every(item => typeof item === 'string' && item.trim() !== '');
202
+ }
203
+
204
+ function hasValidRepoSelector(input) {
205
+ const hasRepositoryFullName = Object.prototype.hasOwnProperty.call(input, 'repository_full_name');
206
+ const hasRepoFullName = Object.prototype.hasOwnProperty.call(input, 'repo_full_name');
207
+ const hasOwner = Object.prototype.hasOwnProperty.call(input, 'owner');
208
+ const hasRepo = Object.prototype.hasOwnProperty.call(input, 'repo');
209
+
210
+ const selectorForms = (hasRepositoryFullName ? 1 : 0)
211
+ + (hasRepoFullName ? 1 : 0)
212
+ + ((hasOwner || hasRepo) ? 1 : 0);
213
+ if (selectorForms !== 1) return false;
214
+
215
+ if (hasRepositoryFullName) {
216
+ return typeof input.repository_full_name === 'string' && OWNER_REPO_SELECTOR.test(input.repository_full_name);
217
+ }
218
+ if (hasRepoFullName) {
219
+ return typeof input.repo_full_name === 'string' && OWNER_REPO_SELECTOR.test(input.repo_full_name);
220
+ }
221
+ return hasOwner && hasRepo
222
+ && typeof input.owner === 'string' && SINGLE_REPO_SEGMENT.test(input.owner)
223
+ && typeof input.repo === 'string' && SINGLE_REPO_SEGMENT.test(input.repo);
224
+ }
225
+
226
+ function isRoutineIssueCreation(payload) {
227
+ if (!ISSUE_CREATE_TOOLS.has(toolNameOf(payload))) return false;
228
+ const input = toolInputOf(payload);
229
+ if (!input || typeof input !== 'object' || Array.isArray(input)) return false;
230
+ const keys = Object.keys(input);
231
+ if (!keys.every(key => ISSUE_CREATE_ALLOWED_KEYS.has(key))) return false;
232
+ if (!hasValidRepoSelector(input)) return false;
233
+ if (typeof input.title !== 'string' || input.title.trim() === '') return false;
234
+ if (Object.prototype.hasOwnProperty.call(input, 'body') && typeof input.body !== 'string') return false;
235
+ if (Object.prototype.hasOwnProperty.call(input, 'labels') && !isNonEmptyStringArray(input.labels)) return false;
236
+ if (Object.prototype.hasOwnProperty.call(input, 'assignees') && !isNonEmptyStringArray(input.assignees)) return false;
237
+ if (Object.prototype.hasOwnProperty.call(input, 'milestone')
238
+ && (!Number.isSafeInteger(input.milestone) || input.milestone <= 0)) return false;
239
+ return true;
240
+ }
241
+
173
242
  function isRoutineIssueComment(payload) {
174
243
  const input = toolInputOf(payload);
175
244
  return ISSUE_COMMENT_TOOLS.has(toolNameOf(payload))
@@ -239,6 +308,16 @@ function structuredRule(payload, options = {}) {
239
308
  hostDeferredReason: 'Codex routine Issue completed-close operations defer to native task scope and permissions.',
240
309
  };
241
310
  }
311
+ if (detectHost(payload, options.host) === 'codex' && descriptor.action === 'mutate'
312
+ && isRoutineIssueCreation(payload) && !(hint && hint.required)) {
313
+ return {
314
+ descriptor,
315
+ rule: null,
316
+ hostDeferred: true,
317
+ hostDeferredId: 'routine-issue-create',
318
+ hostDeferredReason: 'Codex routine Issue creation defers to native task scope and permissions.',
319
+ };
320
+ }
242
321
  if (descriptor.classification === 'gated') {
243
322
  return {
244
323
  descriptor,
@@ -774,4 +853,5 @@ module.exports = {
774
853
  normalizeActionDescriptor,
775
854
  structuredRule,
776
855
  isRoutinePullRequestCreation,
856
+ isRoutineIssueCreation,
777
857
  };