harness-everything 0.16.4 → 0.16.5

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 (32) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +6 -0
  4. package/ci/mechanism-2am-openai-packaged-helper-runtime.test.js +82 -0
  5. package/ci/skill-routing-check.js +1 -1
  6. package/harness-everything/SKILL.md +1 -1
  7. package/harness-everything/scripts/bootstrap.js +4 -3
  8. package/harness-everything/scripts/runtime-paths.js +37 -0
  9. package/harness-everything/scripts/self-heal.js +3 -2
  10. package/harness-everything/scripts/tier-router.js +2 -6
  11. package/hooks/scripts/lib/platforms/claude.js +3 -3
  12. package/opencode-plugin/plugin.json +1 -1
  13. package/package.json +1 -1
  14. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  15. package/plugins/harness-everything/hooks/scripts/lib/platforms/claude.js +3 -3
  16. package/plugins/harness-everything/plugin.json +1 -1
  17. package/plugins/harness-everything/scripts/installer.js +629 -0
  18. package/plugins/harness-everything/scripts/lib/claude-hooks.js +84 -0
  19. package/plugins/harness-everything/scripts/lib/execution-contract.js +70 -0
  20. package/plugins/harness-everything/scripts/lib/gitignore.js +199 -0
  21. package/plugins/harness-everything/scripts/lib/manifest.js +142 -0
  22. package/plugins/harness-everything/scripts/lib/path-boundary.js +90 -0
  23. package/plugins/harness-everything/scripts/lib/prompts.js +241 -0
  24. package/plugins/harness-everything/scripts/lib/skills.js +314 -0
  25. package/plugins/harness-everything/scripts/lib/workspace.js +290 -0
  26. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  27. package/plugins/harness-everything/skills/harness-everything/scripts/bootstrap.js +4 -3
  28. package/plugins/harness-everything/skills/harness-everything/scripts/runtime-paths.js +37 -0
  29. package/plugins/harness-everything/skills/harness-everything/scripts/self-heal.js +3 -2
  30. package/plugins/harness-everything/skills/harness-everything/scripts/tier-router.js +2 -6
  31. package/scripts/installer.js +12 -4
  32. package/scripts/sync-openai-plugin.js +5 -2
@@ -10,7 +10,7 @@
10
10
  "name": "harness-everything",
11
11
  "source": "./",
12
12
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
13
- "version": "0.16.4",
13
+ "version": "0.16.5",
14
14
  "author": {
15
15
  "name": "Miya Daniel"
16
16
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "harness-everything",
3
3
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
4
- "version": "0.16.4",
4
+ "version": "0.16.5",
5
5
  "author": {
6
6
  "name": "Miya Daniel"
7
7
  },
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.16.5](https://github.com/dyphn1/Harness-everything/compare/v0.16.4...v0.16.5) (2026-09-21)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **codex:** make packaged helper runtime self-contained ([96cba55](https://github.com/dyphn1/Harness-everything/commit/96cba55b2347251c90306a727825377ba26465c2))
10
+
5
11
  ## [0.16.4](https://github.com/dyphn1/Harness-everything/compare/v0.16.3...v0.16.4) (2026-09-20)
6
12
 
7
13
  ### Bug Fixes
@@ -0,0 +1,82 @@
1
+ 'use strict';
2
+
3
+ const assert = require('assert');
4
+ const fs = require('fs');
5
+ const os = require('os');
6
+ const path = require('path');
7
+ const { spawnSync } = require('child_process');
8
+
9
+ const repoRoot = path.resolve(__dirname, '..');
10
+ const packagedPlugin = path.join(repoRoot, 'plugins', 'harness-everything');
11
+
12
+ function runNode(script, args, options) {
13
+ return spawnSync(process.execPath, [script, ...args], {
14
+ cwd: options.cwd,
15
+ env: { ...process.env, ...options.env },
16
+ input: options.input,
17
+ encoding: 'utf8'
18
+ });
19
+ }
20
+
21
+ function describe(result) {
22
+ return [result.stdout, result.stderr].filter(Boolean).join('\n');
23
+ }
24
+
25
+ const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-openai-plugin-'));
26
+ try {
27
+ const pluginRoot = path.join(tempRoot, 'plugin');
28
+ const workspaceRoot = path.join(tempRoot, 'workspace');
29
+ const stateHome = path.join(tempRoot, 'state');
30
+ fs.cpSync(packagedPlugin, pluginRoot, { recursive: true });
31
+ fs.mkdirSync(workspaceRoot, { recursive: true });
32
+ fs.mkdirSync(stateHome, { recursive: true });
33
+ fs.mkdirSync(path.join(workspaceRoot, '.git'), { recursive: true });
34
+ fs.writeFileSync(path.join(workspaceRoot, 'AGENTS.md'), '# managed workspace\n', 'utf8');
35
+
36
+ const env = {
37
+ HARNESS_STATE_HOME: stateHome,
38
+ HARNESS_WORKSPACE_ROOT: workspaceRoot,
39
+ };
40
+
41
+ const scriptsRoot = path.join(pluginRoot, 'skills', 'harness-everything', 'scripts');
42
+ const selfHeal = runNode(path.join(scriptsRoot, 'self-heal.js'), ['--check'], {
43
+ cwd: workspaceRoot,
44
+ env,
45
+ });
46
+ assert.strictEqual(selfHeal.status, 0, `packaged self-heal --check failed:\n${describe(selfHeal)}`);
47
+
48
+ const installer = runNode(path.join(pluginRoot, 'scripts', 'installer.js'), ['--codex', '--no-skills', '--yes'], {
49
+ cwd: workspaceRoot,
50
+ env,
51
+ });
52
+ assert.strictEqual(installer.status, 0, `packaged installer failed:\n${describe(installer)}`);
53
+ assert.match(
54
+ fs.readFileSync(path.join(workspaceRoot, 'AGENTS.md'), 'utf8'),
55
+ /Harness OS Guidance \(Advisory\)/,
56
+ 'packaged installer did not write the Codex advisory file'
57
+ );
58
+
59
+ const bootstrap = runNode(path.join(scriptsRoot, 'bootstrap.js'), [], {
60
+ cwd: workspaceRoot,
61
+ env,
62
+ input: JSON.stringify({ session_id: 'packaged-runtime-smoke', cwd: workspaceRoot }),
63
+ });
64
+ assert.strictEqual(bootstrap.status, 0, `packaged bootstrap failed:\n${describe(bootstrap)}`);
65
+ assert.match(describe(bootstrap), /Harness OS initialized/, 'packaged bootstrap did not initialize Harness');
66
+
67
+ const tierRouter = runNode(path.join(scriptsRoot, 'tier-router.js'), ['audit the repository and run tests'], {
68
+ cwd: workspaceRoot,
69
+ env,
70
+ });
71
+ assert.strictEqual(tierRouter.status, 0, `packaged tier-router failed:\n${describe(tierRouter)}`);
72
+ assert.doesNotMatch(
73
+ describe(tierRouter),
74
+ /BASE EXECUTION LOOP: Load 'todo-driven-workflow'/,
75
+ 'direct packaged tier-router still emits retired mandatory todo guidance'
76
+ );
77
+ assert.match(describe(tierRouter), /WORKFLOW STRATEGY:/, 'packaged tier-router did not emit the workflow contract');
78
+
79
+ console.log('OpenAI packaged helper runtime smoke test passed');
80
+ } finally {
81
+ fs.rmSync(tempRoot, { recursive: true, force: true });
82
+ }
@@ -49,7 +49,7 @@ function discoverNestedSkills(skillDir) {
49
49
 
50
50
  function expectedMarker(skill) {
51
51
  if (skill === 'harness-everything') return 'RECOMMENDED TIER';
52
- if (skill === 'todo-driven-workflow') return 'BASE EXECUTION LOOP';
52
+ if (skill === 'todo-driven-workflow') return 'WORKFLOW STRATEGY';
53
53
  return `${skill}/SKILL.md`;
54
54
  }
55
55
 
@@ -4,7 +4,7 @@ description: "Route software/project work through the Harness kernel: classify T
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.16.3
7
+ version: 0.16.5
8
8
  ---
9
9
 
10
10
  # Harness Everything
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  const fs = require('fs');
3
3
  const path = require('path');
4
+ const { getHarnessRoot, requireHarnessState, requireWorkspace } = require('./runtime-paths');
4
5
  const {
5
6
  getWorkspaceRoot,
6
7
  getSessionId,
7
8
  getSessionDir,
8
9
  writeCurrentSession,
9
10
  pruneStaleSessions,
10
- } = require('../../hooks/scripts/lib/harness-state');
11
+ } = requireHarnessState();
11
12
 
12
13
  console.log("Bootstrapping Harness Skills OS...");
13
14
 
@@ -162,9 +163,9 @@ try {
162
163
  // npx/global install auditing the harness checkout itself compares two
163
164
  // different paths and wrongly advises a repair that self-heal then skips
164
165
  // (issue #40). Required lazily so a missing lib can never break session start.
165
- const { isHarnessRepo } = require('../../scripts/lib/workspace');
166
+ const { isHarnessRepo } = requireWorkspace();
166
167
  const auditingSelf = isHarnessRepo(workspaceRoot)
167
- || path.resolve(workspaceRoot) === path.resolve(__dirname, '..', '..');
168
+ || path.resolve(workspaceRoot) === path.resolve(getHarnessRoot());
168
169
 
169
170
  if (missing.length > 0 && !auditingSelf) {
170
171
  console.log(`\n[Self-Heal] Missing integration touchpoints: ${missing.join(', ')}`);
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // Helpers live in both the source checkout and the packaged plugin's skill
7
+ // tree. Resolve the owning runtime root instead of assuming either layout.
8
+ function candidateRoots() {
9
+ return [
10
+ path.resolve(__dirname, '..', '..'),
11
+ path.resolve(__dirname, '..', '..', '..'),
12
+ ];
13
+ }
14
+
15
+ function getHarnessRoot() {
16
+ const root = candidateRoots().find(candidate =>
17
+ fs.existsSync(path.join(candidate, 'scripts', 'lib', 'workspace.js'))
18
+ );
19
+ if (!root) {
20
+ throw new Error(`Harness runtime root not found from ${__dirname}`);
21
+ }
22
+ return root;
23
+ }
24
+
25
+ function requireWorkspace() {
26
+ return require(path.join(getHarnessRoot(), 'scripts', 'lib', 'workspace.js'));
27
+ }
28
+
29
+ function requireHarnessState() {
30
+ return require(path.join(getHarnessRoot(), 'hooks', 'scripts', 'lib', 'harness-state.js'));
31
+ }
32
+
33
+ module.exports = {
34
+ getHarnessRoot,
35
+ requireWorkspace,
36
+ requireHarnessState,
37
+ };
@@ -23,7 +23,8 @@
23
23
  const fs = require('fs');
24
24
  const path = require('path');
25
25
  const { execSync } = require('child_process');
26
- const { getWorkspaceRoot, isHarnessRepo } = require('../../scripts/lib/workspace');
26
+ const { getHarnessRoot, requireWorkspace } = require('./runtime-paths');
27
+ const { getWorkspaceRoot, isHarnessRepo } = requireWorkspace();
27
28
 
28
29
  const MARKER = 'Harness OS Guidance (Advisory)';
29
30
  const HOOK_ID = 'harness:pre:bootstrap';
@@ -194,7 +195,7 @@ function main() {
194
195
  const forceSelf = process.argv.includes('--force-self');
195
196
 
196
197
  const workspaceRoot = getWorkspaceRoot();
197
- const harnessSourceDir = path.resolve(__dirname, '..', '..');
198
+ const harnessSourceDir = getHarnessRoot();
198
199
  const installerPath = path.join(harnessSourceDir, 'scripts', 'installer.js');
199
200
 
200
201
  console.log(`Workspace: ${workspaceRoot}`);
@@ -5,6 +5,7 @@ const {
5
5
  buildRouterContract,
6
6
  writeRouterContract,
7
7
  } = require('./router-contract');
8
+ const { requireWorkspace } = require('./runtime-paths');
8
9
 
9
10
  const DEFAULT_ROUTING_CONFIG = {
10
11
  tiers: { tier3: [], tier2: [] },
@@ -163,7 +164,7 @@ function plannerInputsFromContext(context, promptLower) {
163
164
  function emitDynamicSkills(promptLower, context, recommendedGuides) {
164
165
  try {
165
166
  const userHome = process.env.HOME || process.env.USERPROFILE || '';
166
- const { getWorkspaceRoot } = require('../../scripts/lib/workspace');
167
+ const { getWorkspaceRoot } = requireWorkspace();
167
168
  const workspaceRoot = getWorkspaceRoot(context);
168
169
 
169
170
  const manifestPaths = [
@@ -315,11 +316,6 @@ function run(userPrompt, context) {
315
316
  console.log(`\n=> RECOMMENDED TIER: ${recommendedTier}`);
316
317
  console.log(`=> RATIONALE: ${rationale}`);
317
318
 
318
- if (recommendedTier.startsWith('Tier 2') || recommendedTier.startsWith('Tier 3')) {
319
- console.log(`\n=> BASE EXECUTION LOOP: Load 'todo-driven-workflow' and initialize its checklist (3-7 verifiable sub-tasks) BEFORE editing any file.`);
320
- console.log(` Track exactly ONE item in-progress at a time; verify with real evidence before marking completed.`);
321
- }
322
-
323
319
  const requestedFableModel = detectFableModel(promptLower);
324
320
  if (requestedFableModel) {
325
321
  console.log(`\n=> REQUESTED FABLE MODEL MODE: ${requestedFableModel}`);
@@ -107,7 +107,7 @@ module.exports = {
107
107
  manifestPath: manifest.getManifestPath(claudeDir)
108
108
  };
109
109
  },
110
- install({ isGlobal, targetWorkspaceRoot, harnessSourceDir, packageVersion, claudeHooks, manifest }) {
110
+ install({ isGlobal, targetWorkspaceRoot, harnessSourceDir, harnessRuntimeRoot = harnessSourceDir, packageVersion, claudeHooks, manifest }) {
111
111
  const userHome = require('os').homedir();
112
112
  const claudeDir = isGlobal ? path.join(userHome, '.claude') : path.join(targetWorkspaceRoot, '.claude');
113
113
  if (!fs.existsSync(claudeDir)) {
@@ -124,7 +124,7 @@ module.exports = {
124
124
  }
125
125
  }
126
126
 
127
- const sourceHooksFile = path.join(harnessSourceDir, 'hooks', 'hooks.json');
127
+ const sourceHooksFile = path.join(harnessRuntimeRoot, 'hooks', 'hooks.json');
128
128
  if (fs.existsSync(sourceHooksFile)) {
129
129
  const sourceHooksObj = JSON.parse(fs.readFileSync(sourceHooksFile, 'utf8'));
130
130
  const resolvedHooks = {};
@@ -134,7 +134,7 @@ module.exports = {
134
134
  if (cloned.hooks) {
135
135
  cloned.hooks = cloned.hooks.map(h => {
136
136
  if (h.type === 'command' && h.command) {
137
- h.command = resolveClaudeHookCommand(h.command, harnessSourceDir);
137
+ h.command = resolveClaudeHookCommand(h.command, harnessRuntimeRoot);
138
138
  }
139
139
  return h;
140
140
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "harness-enforcement",
3
3
  "description": "Repository inventory for the opencode enforcement plugin and its standalone helper",
4
- "version": "0.16.4",
4
+ "version": "0.16.5",
5
5
  "runtime": "index.mjs",
6
6
  "hooks": {
7
7
  "verify": "hooks/verify.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness-everything",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "description": "Harness OS: An Orchestrated Agent Operating System for AI-driven Development",
5
5
  "main": "harness-everything/scripts/bootstrap.js",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness-everything",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
5
5
  "author": {
6
6
  "name": "Miya Daniel",
@@ -107,7 +107,7 @@ module.exports = {
107
107
  manifestPath: manifest.getManifestPath(claudeDir)
108
108
  };
109
109
  },
110
- install({ isGlobal, targetWorkspaceRoot, harnessSourceDir, packageVersion, claudeHooks, manifest }) {
110
+ install({ isGlobal, targetWorkspaceRoot, harnessSourceDir, harnessRuntimeRoot = harnessSourceDir, packageVersion, claudeHooks, manifest }) {
111
111
  const userHome = require('os').homedir();
112
112
  const claudeDir = isGlobal ? path.join(userHome, '.claude') : path.join(targetWorkspaceRoot, '.claude');
113
113
  if (!fs.existsSync(claudeDir)) {
@@ -124,7 +124,7 @@ module.exports = {
124
124
  }
125
125
  }
126
126
 
127
- const sourceHooksFile = path.join(harnessSourceDir, 'hooks', 'hooks.json');
127
+ const sourceHooksFile = path.join(harnessRuntimeRoot, 'hooks', 'hooks.json');
128
128
  if (fs.existsSync(sourceHooksFile)) {
129
129
  const sourceHooksObj = JSON.parse(fs.readFileSync(sourceHooksFile, 'utf8'));
130
130
  const resolvedHooks = {};
@@ -134,7 +134,7 @@ module.exports = {
134
134
  if (cloned.hooks) {
135
135
  cloned.hooks = cloned.hooks.map(h => {
136
136
  if (h.type === 'command' && h.command) {
137
- h.command = resolveClaudeHookCommand(h.command, harnessSourceDir);
137
+ h.command = resolveClaudeHookCommand(h.command, harnessRuntimeRoot);
138
138
  }
139
139
  return h;
140
140
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "harness-everything",
4
- "version": "0.16.4",
4
+ "version": "0.16.5",
5
5
  "description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
6
6
  "author": {
7
7
  "name": "Miya Daniel",