harness-everything 1.5.4 → 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 (45) 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 +18 -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/opencode-2026-12-02-450-steering/README.md +20 -0
  19. package/benchmarks/results/live-host/opencode-2026-12-02-450-steering/lifecycle.sanitized.jsonl +14 -0
  20. package/benchmarks/results/live-host/opencode-2026-12-02-450-steering/observations.sanitized.json +20 -0
  21. package/bin/cli.js +30 -7
  22. package/ci/action-gate.test.js +186 -0
  23. package/ci/installer-roundtrip.test.js +20 -0
  24. package/ci/lib/opencode-v2-driver.js +3 -1
  25. package/ci/mechanism-2aa-codex-action-gate-policy.test.js +21 -0
  26. package/ci/mechanism-2ap-sbom.test.js +6 -6
  27. package/ci/mechanism-2x-release-commit-message.test.js +34 -23
  28. package/ci/mechanism-341-opencode-lane.test.js +5 -1
  29. package/ci/mechanism-397-cycle-import.test.js +5 -1
  30. package/ci/mechanism-397-opencode-observations.test.js +260 -24
  31. package/ci/mechanism-552-ledger-pairs.test.js +2 -0
  32. package/ci/mechanism-task-git-authorization.test.js +14 -0
  33. package/docs/README.md +81 -0
  34. package/docs/codex-action-gate.md +1 -1
  35. package/docs/platform-capabilities.md +9 -4
  36. package/docs/platform-compatibility.json +3 -3
  37. package/hooks/scripts/action-gate.js +82 -2
  38. package/opencode-plugin/index.mjs +97 -35
  39. package/opencode-plugin/plugin.json +1 -1
  40. package/package.json +15 -2
  41. package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
  42. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  43. package/plugins/harness-everything/hooks/scripts/action-gate.js +82 -2
  44. package/plugins/harness-everything/plugin.json +1 -1
  45. package/sbom.cdx.json +7 -7
package/SECURITY.md CHANGED
@@ -1,33 +1,54 @@
1
1
  # Security Policy
2
2
 
3
+ **Harness Everything** (npm package `harness-everything`, CLI `harness`) is an AI Agent Behavior and Orchestration Runtime (AI Agent Harness) providing skills, routing, lifecycle hooks, and host integrations.
4
+
5
+ ## Supported Versions
6
+
7
+ Security fixes are applied on a best-effort basis to the latest released minor version line. Older minor and major versions are not supported; users should upgrade to the latest release.
8
+
9
+ | Version | Supported |
10
+ | --- | --- |
11
+ | Latest released minor line | Yes (security and bug fixes) |
12
+ | Older minor / major versions | No |
13
+ | `main` (unreleased) | Development / pre-release |
14
+
3
15
  ## Reporting a Vulnerability
4
16
 
5
- If you discover a security vulnerability in Harness, please report it responsibly.
17
+ If you discover a security vulnerability in Harness Everything, please report it responsibly.
6
18
 
7
19
  **Do not open a public issue for security vulnerabilities.**
8
20
 
9
- Instead, email: dyphn1@hotmail.com
21
+ - If GitHub Security Advisories / private vulnerability reporting is available on the repository, you may submit a private report there.
22
+ - Otherwise (or if you prefer direct contact), email: `dyphn1@hotmail.com`
10
23
 
11
- Include:
24
+ Please include:
12
25
  - Description of the vulnerability
13
26
  - Steps to reproduce
14
27
  - Potential impact
28
+ - Affected version and host environment (if applicable)
15
29
 
16
30
  ## Response Timeline
17
31
 
18
- - Acknowledgment within 48 hours
19
- - Fix or mitigation plan within 7 days for confirmed vulnerabilities
32
+ Harness Everything is an open-source project; the following timelines are **best-effort targets** rather than contractual SLAs:
33
+
34
+ - **Acknowledgement:** within 48 hours
35
+ - **Initial assessment and fix or mitigation plan:** within 7 days for confirmed vulnerabilities
20
36
 
21
37
  ## Scope
22
38
 
23
- This policy covers the Harness-everything repository and its published npm package.
39
+ This policy covers the `Harness-everything` repository, the published `harness-everything` npm package (and `harness` CLI), and the packaged host plugins and lifecycle hooks. (Note: the public OpenAI Skills-only submission artifact in `submission/openai/` is a skills-only listing without local lifecycle hooks.)
40
+
41
+ ## Release Supply-Chain Posture
42
+
43
+ - **npm Trusted Publishing:** Official releases are published from GitHub Actions using npm OIDC Trusted Publishing with provenance (`NPM_CONFIG_PROVENANCE=true`), without long-lived npm publish tokens.
44
+ - **SBOM:** Each release generates and validates a CycloneDX Software Bill of Materials (`sbom.cdx.json`) attached to the corresponding GitHub Release.
24
45
 
25
46
  ## Hooks and Runtime Behavior
26
47
 
27
- Harness installs execution hooks (action gate, scope guard, stop gate) into Claude Code sessions. These hooks:
48
+ Harness Everything installs or packages execution hooks and host adapters (such as the action gate, scope guard, and stop gate in Claude Code, and corresponding mechanisms in supported hosts). These mechanisms:
28
49
 
29
50
  - Enforce file-scope boundaries
30
51
  - Track verification state
31
52
  - Block unsafe operations
32
53
 
33
- If you find a bypass or unintended behavior in these mechanisms, please report it.
54
+ If you find a bypass or unintended behavior in these mechanisms, please report it using the private channels above.
package/SUPPORT.md CHANGED
@@ -1,17 +1,17 @@
1
1
  # Support
2
2
 
3
- Harness Everything is an open-source, skill-only plugin for software-development workflows in ChatGPT, Codex, and compatible coding-agent hosts.
3
+ **Harness Everything** (npm package `harness-everything`, CLI `harness`) is an open-source AI Agent Behavior and Orchestration Runtime (AI Agent Harness) for software-development workflows across Claude Code, OpenCode V2, Codex, ChatGPT, and compatible coding-agent hosts. Only the public OpenAI Skills-only submission artifact (`submission/openai/`) is distributed as skills-only without local lifecycle hooks.
4
4
 
5
5
  ## Get help
6
6
 
7
- For installation, routing, skill behavior, or publication-related problems, open a GitHub issue:
7
+ For installation, routing, hook/plugin behavior, skill behavior, or publication-related problems, open a GitHub issue:
8
8
 
9
9
  https://github.com/dyphn1/Harness-everything/issues
10
10
 
11
11
  Please include:
12
12
 
13
13
  - the host and version you were using;
14
- - the Harness Everything version or commit;
14
+ - the Harness Everything (`harness-everything`) version or commit;
15
15
  - the smallest prompt or workflow that reproduces the problem;
16
16
  - expected and observed behavior;
17
17
  - relevant logs with secrets, credentials, private source, and personal data removed.
@@ -24,4 +24,4 @@ https://github.com/dyphn1/Harness-everything/blob/main/SECURITY.md
24
24
 
25
25
  ## Scope
26
26
 
27
- Harness Everything does not operate a hosted support service, hosted backend, or separate user account. Support covers the open-source plugin package and its documented workflows; support for ChatGPT, Codex, GitHub, package registries, and other third-party services remains with those providers.
27
+ Harness Everything does not operate a hosted support service, hosted backend, or separate user account. Support covers the open-source `harness-everything` runtime, CLI, packaged host plugins/hooks, and documented workflows on a best-effort basis; support for Claude Code, OpenCode, Codex, ChatGPT, GitHub, package registries, and other third-party services remains with those providers.
package/TERMS.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Terms of Use
2
2
 
3
- Harness Everything is open-source software distributed under the Apache License 2.0. Use, copying, modification, and distribution of the software are governed by the terms of the repository `LICENSE` file.
3
+ **Harness Everything** (npm package `harness-everything`, CLI `harness`) is an open-source AI Agent Behavior and Orchestration Runtime (AI Agent Harness) distributed under the Apache License 2.0. Use, copying, modification, and distribution of the software are governed by the terms of the repository `LICENSE` file.
4
4
 
5
5
  ## No hosted service
6
6
 
7
- The project does not provide a hosted service or separate user account. The plugin packages skills and local hooks that run through the user's supported ChatGPT/Codex or coding-agent environment.
7
+ The project does not provide a hosted service or separate user account. The runtime packages skills, routing, and local hooks/plugins that run through the user's supported coding-agent environment (such as Claude Code, OpenCode V2, Codex, or ChatGPT; only the public OpenAI Skills-only submission artifact in `submission/openai/` is skills-only without local lifecycle hooks).
8
8
 
9
9
  ## User responsibility
10
10
 
@@ -12,7 +12,7 @@ Harness workflows can guide an agent to inspect code, modify files, run commands
12
12
 
13
13
  ## Third-party platforms
14
14
 
15
- Use of ChatGPT, Codex, GitHub, package registries, external tools, or connected services remains subject to the applicable third-party terms. Harness Everything does not grant additional rights to those services and does not bypass their authorization or workspace controls.
15
+ Use of Claude Code, OpenCode, Codex, ChatGPT, GitHub, package registries, external tools, or connected services remains subject to the applicable third-party terms. Harness Everything does not grant additional rights to those services and does not bypass their authorization or workspace controls.
16
16
 
17
17
  ## Warranty and liability
18
18
 
@@ -0,0 +1,20 @@
1
+ # OpenCode V2 steering fix on Linux for #450
2
+
3
+ | Field | Observed value |
4
+ | --- | --- |
5
+ | Host | OpenCode 2.4.1, official Linux x64 release, long-lived server |
6
+ | OS | Debian GNU/Linux 13.7, x86_64, kernel 6.18.64 |
7
+ | Node | 24.22.3 |
8
+ | Candidate | Branch based on `970f1684`. Tested `opencode-plugin/index.mjs` SHA-256 `bdcf699b759e9fd51defd0a9501c67da1cadb528fae4909df5fe6b097f93d10d`. |
9
+ | Scope | Project plugin, disposable Git workspace, profile and Harness store |
10
+
11
+ The workspace loaded the candidate from `.opencode/plugins/harness-enforcement.js` alongside the key-only steering probe. The server ran as `opencode serve --hostname 127.0.0.1 --port <port>`. Three `opencode --server <address> run --model fixture/fixture --format json` calls drove one session. B and C used the session ID obtained from A.
12
+
13
+ The fixture was a loopback OpenAI-compatible endpoint that returned a shell tool call to run `sleep 12` for A, then text with a valid label for the shared result and for C. B was submitted while the OpenCode shell tool was running. The host handled scheduling, inbox promotion, tool execution, lifecycle events and plugin calls. The fixture supplied deterministic model output.
14
+
15
+ | Scenario | Host events | Observation |
16
+ | --- | --- | --- |
17
+ | A then steering B | The two prompt IDs matched their respective inbox deliveries inside one execution, followed by one success | Two rows with `final-message-unavailable` and no label |
18
+ | Sequential C | A new start, C inbox delivery and success | One row with a valid label |
19
+
20
+ The [sanitized lifecycle](lifecycle.sanitized.jsonl) includes relative times, pseudonymous IDs, event keys and durable sequence numbers. The [observation excerpt](observations.sanitized.json) preserves the three dispositions. The earlier [macOS trace](../opencode-2026-11-28-450-steering-trace/README.md) is the pre-fix witness. Replayed completions, interruption, reset and workspace controls are covered by deterministic tests.
@@ -0,0 +1,14 @@
1
+ {"dt_ms":0,"hook":"prompt","sid":"s1","mid":"m2","deliveryValue":"steer"}
2
+ {"dt_ms":6,"event":"session.inbox.enqueued","sid":"s1","mid":"m2","seq":1,"dataKeys":["sessionID","inboxID","item"]}
3
+ {"dt_ms":39,"event":"session.execution.started","sid":"s1","seq":2,"dataKeys":["sessionID"]}
4
+ {"dt_ms":43,"event":"session.inbox.delivered","sid":"s1","mid":"m2","seq":4,"dataKeys":["sessionID","inboxID"]}
5
+ {"dt_ms":144,"event":"session.tool.called","sid":"s1","seq":11,"dataKeys":["sessionID","assistantMessageID","id","input","executed"]}
6
+ {"dt_ms":477,"hook":"prompt","sid":"s1","mid":"m4","deliveryValue":"steer"}
7
+ {"dt_ms":481,"event":"session.inbox.enqueued","sid":"s1","mid":"m4","seq":13,"dataKeys":["sessionID","inboxID","item"]}
8
+ {"dt_ms":12443,"event":"session.inbox.delivered","sid":"s1","mid":"m4","seq":16,"dataKeys":["sessionID","inboxID"]}
9
+ {"dt_ms":12483,"event":"session.execution.succeeded","sid":"s1","seq":23,"dataKeys":["sessionID"]}
10
+ {"dt_ms":12748,"hook":"prompt","sid":"s1","mid":"m6","deliveryValue":"steer"}
11
+ {"dt_ms":12752,"event":"session.inbox.enqueued","sid":"s1","mid":"m6","seq":24,"dataKeys":["sessionID","inboxID","item"]}
12
+ {"dt_ms":12774,"event":"session.execution.started","sid":"s1","seq":25,"dataKeys":["sessionID"]}
13
+ {"dt_ms":12774,"event":"session.inbox.delivered","sid":"s1","mid":"m6","seq":26,"dataKeys":["sessionID","inboxID"]}
14
+ {"dt_ms":12824,"event":"session.execution.succeeded","sid":"s1","seq":33,"dataKeys":["sessionID"]}
@@ -0,0 +1,20 @@
1
+ [
2
+ {
3
+ "turn": 1,
4
+ "host": "opencode",
5
+ "selfReport": false,
6
+ "selfReportReason": "final-message-unavailable"
7
+ },
8
+ {
9
+ "turn": 2,
10
+ "host": "opencode",
11
+ "selfReport": false,
12
+ "selfReportReason": "final-message-unavailable"
13
+ },
14
+ {
15
+ "turn": 3,
16
+ "host": "opencode",
17
+ "selfReport": true,
18
+ "selfReportReason": null
19
+ }
20
+ ]
package/bin/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Harness OS CLI
4
- * Dispatches installation and self-regression testing
3
+ * Harness Everything CLI
4
+ * Behavior and orchestration runtime for AI coding agents
5
5
  */
6
6
 
7
7
  const { spawnSync } = require('child_process');
@@ -16,6 +16,11 @@ if (!command || command === '--help' || command === '-h') {
16
16
  process.exit(0);
17
17
  }
18
18
 
19
+ if (command === '--version' || command === '-v' || command === 'version') {
20
+ showVersion();
21
+ process.exit(0);
22
+ }
23
+
19
24
  switch (command) {
20
25
  case 'install':
21
26
  case 'add':
@@ -49,20 +54,35 @@ switch (command) {
49
54
  process.exit(1);
50
55
  }
51
56
 
57
+ function showVersion() {
58
+ const pkgPath = path.resolve(__dirname, '..', 'package.json');
59
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
60
+ console.log(pkg.version);
61
+ }
62
+
52
63
  function showHelp() {
53
64
  console.log(`
54
- Harness OS - AI Agent Operating System CLI
65
+ Harness Everything - Behavior and Orchestration Runtime CLI
55
66
 
56
67
  Usage:
68
+ npx harness-everything <command> [options]
69
+ harness <command> [options]
70
+ npx.cmd harness-everything <command> [options] # Windows PowerShell
71
+
72
+ Examples:
73
+ npx harness-everything install
74
+ harness install
75
+ harness --version
76
+
77
+ Dev/testing (GitHub source):
57
78
  npx github:dyphn1/Harness-everything <command> [options]
58
- npx.cmd github:dyphn1/Harness-everything <command> [options] # Windows PowerShell
59
79
 
60
80
  Windows PowerShell note:
61
81
  Use npx.cmd so restrictive ExecutionPolicy cannot redirect this command to npx.ps1.
62
82
  Harness does not require changing ExecutionPolicy.
63
83
 
64
84
  Commands:
65
- install Install Harness OS hooks & skills into the local repository
85
+ install Install Harness Everything hooks & skills into the local repository
66
86
  Options:
67
87
  --claude Install Claude Code hooks (.claude/settings.json)
68
88
  --cursor Install Cursor project rules (.cursorrules)
@@ -82,12 +102,12 @@ Commands:
82
102
  behavior silently on failure)
83
103
  add/skills/skill Add/install modular skills into the local workspace
84
104
  Usage:
85
- npx github:dyphn1/Harness-everything add [skill-names...]
105
+ npx harness-everything add [skill-names...]
86
106
  Options:
87
107
  -g, --global Install skills to home directory (~/.agents/skills)
88
108
  --symlink/--copy See 'install' above
89
109
  (Runs interactively if no skill names are specified)
90
- uninstall Remove Harness OS hooks, advisory files & skills
110
+ uninstall Remove Harness Everything hooks, advisory files & skills
91
111
  Options:
92
112
  --local Remove from local workspace
93
113
  -g, --global Also remove from home directory (~/.agents, etc.)
@@ -122,8 +142,11 @@ Commands:
122
142
  the explicit stand-in for a hard stop gate on platforms where
123
143
  no equivalent hook is active - call it before declaring a task complete.
124
144
 
145
+ version Show the CLI version
146
+
125
147
  Options:
126
148
  --help, -h Show this help text
149
+ --version, -v Show the CLI version
127
150
  `);
128
151
  }
129
152
 
@@ -600,6 +600,192 @@ try {
600
600
  const issueStop = actionGate.rejectPendingAtStop(unexecutedIssue, { sessionDir });
601
601
  check(issueStop.rejected > 0 && readAudit(sessionDir, unexecutedIssue.tool_use_id).disposition === 'rejected', 'Stop rejects an unexecuted issue deferral');
602
602
 
603
+ // Codex routine Issue creation (host-deferred)
604
+ const issueCreateTools = [
605
+ 'mcp__codex_apps__github__create_issue',
606
+ 'mcp__codex_apps__github_create_issue',
607
+ 'mcp__github__create_issue',
608
+ ];
609
+ const issueCreateInput = {
610
+ repository_full_name: 'dyphn1/Harness-everything',
611
+ title: 'Private fixture issue title',
612
+ body: 'Private fixture issue body',
613
+ };
614
+ for (const tool of issueCreateTools) {
615
+ const candidate = issuePayload(tool, issueCreateInput, 'issue-create-positive-' + issueCreateTools.indexOf(tool));
616
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
617
+ check(result.kind === 'allow' && result.exitCode === 0 && result.stdout === null, 'Issue create exact Codex MCP tool ' + tool + ' defers to host');
618
+ check(result.record && result.record.disposition === 'deferred-to-host' && result.record.matchedRule === 'routine-issue-create', 'Issue create records routine-issue-create host-deferred id');
619
+ const descriptor = result.descriptor || (result.record && result.record.actionDescriptor);
620
+ check(descriptor && descriptor.action === 'mutate' && descriptor.classification === 'gated', 'Issue create remains a gated mutation');
621
+ check(!Object.prototype.hasOwnProperty.call(result, 'permissionDecision'), 'Issue create emits no Harness permission decision');
622
+ check(!JSON.stringify(result.record).includes('Private fixture issue title') && !JSON.stringify(result.record).includes('Private fixture issue body'), 'Issue create audit does not persist raw title or body');
623
+ }
624
+ for (const [label, input] of [
625
+ ['repo_full_name selector', { repo_full_name: 'dyphn1/Harness-everything', title: 'Minimal title' }],
626
+ ['owner+repo selector', { owner: 'dyphn1', repo: 'Harness-everything', title: 'Owner repo title', body: '' }],
627
+ ['full optional fields', {
628
+ repository_full_name: 'dyphn1/Harness-everything',
629
+ title: 'Full fields title',
630
+ body: 'Issue body',
631
+ labels: ['bug', 'p2'],
632
+ assignees: ['dyphn1'],
633
+ milestone: 7,
634
+ }],
635
+ ['empty labels and assignees arrays', {
636
+ repository_full_name: 'dyphn1/Harness-everything',
637
+ title: 'Empty arrays title',
638
+ labels: [],
639
+ assignees: [],
640
+ }],
641
+ ]) {
642
+ const candidate = issuePayload(issueCreateTools[0], input, 'issue-create-shape-' + label.replace(/[^a-z0-9]+/gi, '-'));
643
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
644
+ check(result.kind === 'allow' && result.exitCode === 0 && result.record && result.record.matchedRule === 'routine-issue-create', 'Issue create accepts ' + label);
645
+ }
646
+
647
+ const issueCreateInvalidInputs = [
648
+ ['create null input', null],
649
+ ['create array input', []],
650
+ ['create empty input', {}],
651
+ ['create missing repo selector', { title: 'No repo' }],
652
+ ['create ownerless repository_full_name', { repository_full_name: 'repo-only', title: 'Ownerless' }],
653
+ ['create nested slash repository_full_name', { repository_full_name: 'a/b/c', title: 'Nested' }],
654
+ ['create ownerless repo_full_name', { repo_full_name: 'repo-only', title: 'Ownerless' }],
655
+ ['create owner without repo', { owner: 'dyphn1', title: 'Missing repo' }],
656
+ ['create repo without owner', { repo: 'Harness-everything', title: 'Missing owner' }],
657
+ ['create owner with slash', { owner: 'dyphn1/sub', repo: 'Harness-everything', title: 'Bad owner' }],
658
+ ['create conflicting selectors full+owner', { repository_full_name: 'dyphn1/Harness-everything', owner: 'dyphn1', repo: 'Harness-everything', title: 'Conflict' }],
659
+ ['create conflicting selectors full+repo_full_name', { repository_full_name: 'dyphn1/Harness-everything', repo_full_name: 'dyphn1/Harness-everything', title: 'Conflict' }],
660
+ ['create missing title', { repository_full_name: 'dyphn1/Harness-everything', body: 'No title' }],
661
+ ['create empty title', { repository_full_name: 'dyphn1/Harness-everything', title: '' }],
662
+ ['create whitespace title', { repository_full_name: 'dyphn1/Harness-everything', title: ' ' }],
663
+ ['create non-string title', { repository_full_name: 'dyphn1/Harness-everything', title: 123 }],
664
+ ['create null body', { ...issueCreateInput, body: null }],
665
+ ['create non-string body', { ...issueCreateInput, body: { text: 'obj' } }],
666
+ ['create non-array labels', { ...issueCreateInput, labels: 'bug' }],
667
+ ['create null labels', { ...issueCreateInput, labels: null }],
668
+ ['create empty string label', { ...issueCreateInput, labels: ['bug', ''] }],
669
+ ['create non-string label', { ...issueCreateInput, labels: [1] }],
670
+ ['create null assignees', { ...issueCreateInput, assignees: null }],
671
+ ['create whitespace assignee', { ...issueCreateInput, assignees: [' '] }],
672
+ ['create zero milestone', { ...issueCreateInput, milestone: 0 }],
673
+ ['create fractional milestone', { ...issueCreateInput, milestone: 1.5 }],
674
+ ['create string milestone', { ...issueCreateInput, milestone: '3' }],
675
+ ['create null milestone', { ...issueCreateInput, milestone: null }],
676
+ ['create extra state key', { ...issueCreateInput, state: 'closed' }],
677
+ ['create extra null unknown key', { ...issueCreateInput, unknown: null }],
678
+ ['create extra draft key', { ...issueCreateInput, draft: true }],
679
+ ['create input action_descriptor key', { ...issueCreateInput, action_descriptor: { action: 'delete' } }],
680
+ ];
681
+ for (const [name, input] of issueCreateInvalidInputs) {
682
+ const result = actionGate.evaluatePreToolUse(issuePayload(issueCreateTools[0], input, 'issue-create-invalid-' + name.replace(/[^a-z0-9]+/gi, '-')), {
683
+ host: 'codex', sessionDir, ruleTable: table,
684
+ });
685
+ check(result.kind === 'block' && result.exitCode === 2 && result.record.disposition === 'rejected', name + ' remains gated');
686
+ }
687
+
688
+ for (const tool of [
689
+ 'create_issue',
690
+ 'mcp__codex_apps__github__create_issues',
691
+ 'mcp__codex_apps__github_create_issue_extra',
692
+ 'mcp__demo__foo_create_issue',
693
+ 'mcp__demo__create_issue_and_delete',
694
+ 'mcp__demo__delete_create_issue',
695
+ 'local__mcp__codex_apps__github_create_issue',
696
+ 'mcp____create_issue',
697
+ ]) {
698
+ const result = actionGate.evaluatePreToolUse(issuePayload(tool, issueCreateInput, 'issue-create-spoof-' + tool.replace(/[^a-z0-9]+/gi, '-')), {
699
+ host: 'codex', sessionDir, ruleTable: table,
700
+ });
701
+ check(result.kind === 'block' && result.exitCode === 2, 'near-match or non-MCP ' + tool + ' stays gated');
702
+ }
703
+
704
+ for (const tool of [
705
+ 'mcp__demo__create_issue',
706
+ 'mcp__get_provider__create_issue',
707
+ 'mcp__linear__create_issue',
708
+ ]) {
709
+ const validUnknownProvider = issuePayload(tool, issueCreateInput, 'issue-create-unknown-provider-' + tool.replace(/[^a-z0-9]+/gi, '-'));
710
+ const result = actionGate.evaluatePreToolUse(validUnknownProvider, { host: 'codex', sessionDir, ruleTable: table });
711
+ check(result.kind === 'block' && result.exitCode === 2 && result.record.disposition === 'rejected'
712
+ && result.rule && result.rule.id === 'structured-mutate',
713
+ 'unknown provider ' + tool + ' with valid input stays gated');
714
+ check(result.record.actionDescriptor.toolFamily === 'mcp'
715
+ && result.record.actionDescriptor.action === 'mutate'
716
+ && result.record.actionDescriptor.classification === 'gated',
717
+ 'unknown provider ' + tool + ' stays classified as a gated mcp mutation');
718
+
719
+ for (const action of ['read', 'unknown']) {
720
+ const downgradeAttempt = issuePayload(tool, issueCreateInput, 'issue-create-unknown-downgrade-' + tool.replace(/[^a-z0-9]+/gi, '-') + '-' + action, {
721
+ action_descriptor: { toolFamily: 'shell', action },
722
+ });
723
+ const downgradeResult = actionGate.evaluatePreToolUse(downgradeAttempt, { host: 'codex', sessionDir, ruleTable: table });
724
+ check(downgradeResult.kind === 'block' && downgradeResult.exitCode === 2
725
+ && downgradeResult.rule && downgradeResult.rule.id === 'structured-mutate'
726
+ && downgradeResult.record.actionDescriptor.toolFamily === 'mcp'
727
+ && downgradeResult.record.actionDescriptor.action === 'mutate'
728
+ && downgradeResult.record.actionDescriptor.classification === 'gated',
729
+ 'unknown provider ' + tool + ' cannot be downgraded by explicit ' + action + ' descriptor');
730
+ }
731
+ }
732
+
733
+ const misleadingCreateProvider = issuePayload('mcp__get_provider__create_issue', { ...issueCreateInput, unknown: true }, 'issue-create-get-provider');
734
+ check(actionGate.evaluatePreToolUse(misleadingCreateProvider, { host: 'codex', sessionDir, ruleTable: table }).kind === 'block', 'provider namespace read token cannot downgrade exact create_issue mutation');
735
+
736
+ for (const action of ['delete', 'publish', 'deploy', 'send']) {
737
+ const candidate = issuePayload(issueCreateTools[0], issueCreateInput, 'issue-create-high-risk-' + action, {
738
+ action_descriptor: { toolFamily: 'shell', action },
739
+ });
740
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
741
+ check(result.kind === 'block' && result.exitCode === 2, 'create_issue explicit higher-risk ' + action + ' descriptor stays gated');
742
+ check(result.record.actionDescriptor.toolFamily === 'mcp', 'actual create_issue tool identity overrides a spoofed shell family');
743
+ }
744
+ for (const action of ['read', 'unknown']) {
745
+ const candidate = issuePayload(issueCreateTools[0], issueCreateInput, 'issue-create-downgrade-' + action, {
746
+ action_descriptor: { toolFamily: 'shell', action },
747
+ });
748
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
749
+ check(result.kind === 'allow' && result.record.matchedRule === 'routine-issue-create'
750
+ && result.record.actionDescriptor.toolFamily === 'mcp' && result.record.actionDescriptor.action === 'mutate',
751
+ 'create_issue explicit ' + action + ' descriptor cannot downgrade the exact Issue creation mutation');
752
+ const blocked = issuePayload(issueCreateTools[0], { ...issueCreateInput, unknown: true }, 'issue-create-downgrade-blocked-' + action, {
753
+ action_descriptor: { toolFamily: 'shell', action },
754
+ });
755
+ check(actionGate.evaluatePreToolUse(blocked, { host: 'codex', sessionDir, ruleTable: table }).kind === 'block',
756
+ 'create_issue explicit ' + action + ' descriptor cannot bypass invalid-input gate');
757
+ }
758
+
759
+ for (const host of ['claude', 'opencode', 'unknown']) {
760
+ const candidate = issuePayload(issueCreateTools[0], issueCreateInput, 'issue-create-host-' + host);
761
+ const result = actionGate.evaluatePreToolUse(candidate, { host, sessionDir, ruleTable: table });
762
+ check(result.rule && result.rule.id === 'structured-mutate', host + ' create_issue keeps its existing mutation gate');
763
+ }
764
+
765
+ for (let requiredAt = 0; requiredAt < 4; requiredAt++) {
766
+ const optionalHints = Object.assign({}, ...gateEnvelopes({ required: false }));
767
+ const hints = { ...optionalHints, ...gateEnvelopes({ required: true })[requiredAt] };
768
+ const candidate = issuePayload(issueCreateTools[0], issueCreateInput, 'issue-create-required-' + requiredAt, hints);
769
+ const result = actionGate.evaluatePreToolUse(candidate, { host: 'codex', sessionDir, ruleTable: table });
770
+ check(result.kind === 'block' && result.exitCode === 2 && result.record.disposition === 'rejected', 'required actionGate envelope ' + requiredAt + ' wins for issue create');
771
+ }
772
+
773
+ const issueCreateAuditOne = issuePayload(issueCreateTools[0], { ...issueCreateInput, title: 'Audit title one', body: 'Audit body one' }, 'issue-create-audit-one');
774
+ const issueCreateAuditTwo = issuePayload(issueCreateTools[1], { ...issueCreateInput, title: 'Audit title two', body: 'Audit body two' }, 'issue-create-audit-two');
775
+ const preCreateOne = actionGate.evaluatePreToolUse(issueCreateAuditOne, { host: 'codex', sessionDir, ruleTable: table });
776
+ const preCreateTwo = actionGate.evaluatePreToolUse(issueCreateAuditTwo, { host: 'codex', sessionDir, ruleTable: table });
777
+ check(preCreateOne.record.commandHash !== preCreateTwo.record.commandHash, 'different create_issue payloads have different audit hashes');
778
+ const postCreateOne = actionGate.finalizeExecution(issueCreateAuditOne, 'success', { sessionDir });
779
+ check(postCreateOne.record.disposition === 'executed' && postCreateOne.record.executionOutcome === 'success' && !postCreateOne.record.executionFailure, 'create_issue PostToolUse success is recorded');
780
+ const postCreateTwo = actionGate.finalizeExecution(issueCreateAuditTwo, 'failure', { sessionDir });
781
+ check(postCreateTwo.record.disposition === 'executed' && postCreateTwo.record.executionOutcome === 'failure' && postCreateTwo.record.executionFailure === true, 'create_issue PostToolUse failure is recorded');
782
+ const alteredCreate = { ...issueCreateAuditOne, tool_input: { ...issueCreateAuditOne.tool_input, title: 'Tampered after PreToolUse' } };
783
+ check(actionGate.finalizeExecution(alteredCreate, 'success', { sessionDir }).record.disposition === 'integrity-violation', 'changed create_issue payload cannot reuse a deferred audit record');
784
+ const unexecutedCreate = issuePayload(issueCreateTools[0], { ...issueCreateInput, title: 'Never executed issue' }, 'issue-create-unexecuted-stop');
785
+ actionGate.evaluatePreToolUse(unexecutedCreate, { host: 'codex', sessionDir, ruleTable: table });
786
+ const createStop = actionGate.rejectPendingAtStop(unexecutedCreate, { sessionDir });
787
+ check(createStop.rejected > 0 && readAudit(sessionDir, unexecutedCreate.tool_use_id).disposition === 'rejected', 'Stop rejects an unexecuted create_issue deferral');
788
+
603
789
 
604
790
  } catch (err) {
605
791
  console.error(err.stack || err.message);
@@ -155,5 +155,25 @@ for (const rel of ['.claude/harness-everything', '.agents/harness-everything', '
155
155
  check(`no orphaned global ${rel}`, !fs.existsSync(path.join(home, rel)));
156
156
  }
157
157
 
158
+ const pkgVersion = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')).version;
159
+ for (const flag of ['--version', '-v', 'version']) {
160
+ const res = run([flag]);
161
+ check(
162
+ `CLI ${flag} exits 0 and outputs package.json#version`,
163
+ res.status === 0 && res.stdout.trim() === pkgVersion,
164
+ `status=${res.status}, stdout=${JSON.stringify(res.stdout)}, stderr=${JSON.stringify(res.stderr)}`
165
+ );
166
+ }
167
+
168
+ const helpRes = run(['--help']);
169
+ check(
170
+ 'CLI --help exits 0 and documents --version, -v, and version',
171
+ helpRes.status === 0 &&
172
+ helpRes.stdout.includes('--version') &&
173
+ helpRes.stdout.includes('-v') &&
174
+ /\bversion\b/.test(helpRes.stdout),
175
+ `status=${helpRes.status}, stdout=${JSON.stringify(helpRes.stdout)}`
176
+ );
177
+
158
178
  cleanup();
159
179
  console.log('\nInstaller local + global round-trip: PASSED');
@@ -27,8 +27,10 @@ const POLL_MS = 10;
27
27
  const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
28
28
 
29
29
  // OpenCode 2.x events are flat: {id, created, type, durable, data:{sessionID,...}}.
30
+ let eventSequence = 0;
30
31
  function v2Event(type, sessionID, data = {}) {
31
- return { id: `evt-${type}-${sessionID}-${Date.now()}`, created: Date.now(), type, durable: true, data: { sessionID, ...data } };
32
+ const seq = ++eventSequence;
33
+ return { id: `evt-${seq}`, created: Date.now(), type, durable: { aggregateID: sessionID, seq, version: 1 }, data: { sessionID, ...data } };
32
34
  }
33
35
 
34
36
  async function createV2Driver(options = {}) {
@@ -174,6 +174,9 @@ try {
174
174
  ['mcp__codex_apps__github_update_issue', {
175
175
  repository_full_name: 'dyphn1/Harness-everything', issue_number: 502, state: 'closed', state_reason: 'completed',
176
176
  }, 'routine-issue-completed-close', 'failure'],
177
+ ['mcp__codex_apps__github__create_issue', {
178
+ repository_full_name: 'dyphn1/Harness-everything', title: 'private issue title fixture', body: 'private issue body fixture',
179
+ }, 'routine-issue-create', 'success'],
177
180
  ]) {
178
181
  const candidate = {
179
182
  ...payload('', { toolUseId: `${gateName}-${expectedRule}`, turnId: 'issue-turn' }),
@@ -194,11 +197,29 @@ try {
194
197
  assert.strictEqual(pre.record.commandHash, hash);
195
198
  assert.strictEqual(pre.record.actionDescriptor.payloadHash, hash);
196
199
  assert.ok(!JSON.stringify(pre.record).includes('private issue comment fixture'));
200
+ assert.ok(!JSON.stringify(pre.record).includes('private issue title fixture'));
201
+ assert.ok(!JSON.stringify(pre.record).includes('private issue body fixture'));
197
202
  const post = gate.finalizeExecution(candidate, outcome, { sessionDir });
198
203
  assert.strictEqual(post.record.disposition, 'executed');
199
204
  assert.strictEqual(post.record.executionOutcome, outcome);
200
205
  assert.strictEqual(post.record.commandHash, hash);
201
206
  }
207
+ for (const unknownTool of ['mcp__demo__create_issue', 'mcp__get_provider__create_issue']) {
208
+ const unknownCandidate = {
209
+ ...payload('', { toolUseId: `${gateName}-unknown-${unknownTool}`, turnId: 'issue-turn' }),
210
+ tool_name: unknownTool,
211
+ tool_input: {
212
+ repository_full_name: 'dyphn1/Harness-everything',
213
+ title: 'private unknown provider title',
214
+ },
215
+ };
216
+ const blocked = gate.evaluatePreToolUse(unknownCandidate, { host: 'codex', sessionDir, ruleTable: table });
217
+ assert.strictEqual(blocked.kind, 'block', `${gateName} ${unknownTool} must stay gated`);
218
+ assert.strictEqual(blocked.exitCode, 2);
219
+ assert.strictEqual(blocked.rule.id, 'structured-mutate');
220
+ assert.strictEqual(blocked.record.actionDescriptor.action, 'mutate');
221
+ assert.strictEqual(blocked.record.actionDescriptor.classification, 'gated');
222
+ }
202
223
  }
203
224
  const metadataEntry = preAdapter.processPayload({
204
225
  ...payload('', { toolUseId: 'metadata-entry' }),
@@ -32,13 +32,13 @@ assert.ok(
32
32
  'GitHub Release must publish the generated SBOM as an asset'
33
33
  );
34
34
 
35
- const releaseWorkflow = fs.readFileSync(path.join(ROOT, '.github/workflows/release.yml'), 'utf8');
36
- assert.match(releaseWorkflow, /uses:\s+actions\/upload-artifact@v4/,
37
- 'release workflow must retain the generated SBOM as an Actions artifact');
38
- assert.match(releaseWorkflow, /if:\s+\$\{\{\s*hashFiles\('sbom\.cdx\.json'\)\s*!=\s*''\s*\}\}/,
35
+ const releaseWorkflow = require('js-yaml').load(fs.readFileSync(path.join(ROOT, '.github/workflows/release.yml'), 'utf8'));
36
+ const sbomUpload = releaseWorkflow.jobs.release.steps.find(step =>
37
+ step.uses?.startsWith('actions/upload-artifact@') && step.with?.path === 'sbom.cdx.json'
38
+ );
39
+ assert.ok(sbomUpload, 'release workflow must retain the generated SBOM as an Actions artifact');
40
+ assert.strictEqual(sbomUpload.if, "${{ hashFiles('sbom.cdx.json') != '' }}",
39
41
  'release workflow must skip artifact upload when semantic-release has no release');
40
- assert.match(releaseWorkflow, /path:\s+sbom\.cdx\.json/,
41
- 'release workflow artifact must point at the generated SBOM');
42
42
 
43
43
  const bom = buildBom(ROOT, {
44
44
  version: packageJson.version,