harness-everything 0.16.5 → 0.17.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 (28) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +29 -0
  4. package/ci/mechanism-2ai-workspace-fingerprint-batch.test.js +11 -1
  5. package/ci/mechanism-2am-openai-packaged-helper-runtime.test.js +28 -0
  6. package/ci/mechanism-2an-environment-detection-readonly.test.js +113 -0
  7. package/ci/mechanism-2an-workflow-obligations.test.js +201 -0
  8. package/docs/workflows/environment-detection.md +15 -7
  9. package/environment-detection/SKILL.md +15 -16
  10. package/harness-everything/SKILL.md +1 -1
  11. package/harness-everything/scripts/kernel-router.js +14 -3
  12. package/harness-everything/scripts/self-heal.js +30 -8
  13. package/hooks/scripts/lib/workflow-obligations.js +316 -0
  14. package/hooks/scripts/lib/workflow-runtime.js +1 -1
  15. package/hooks/scripts/workflow-disposition.js +97 -5
  16. package/hooks/scripts/workflow-stop-gate.js +12 -4
  17. package/opencode-plugin/plugin.json +1 -1
  18. package/package.json +1 -1
  19. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  20. package/plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js +316 -0
  21. package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +1 -1
  22. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +97 -5
  23. package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +12 -4
  24. package/plugins/harness-everything/plugin.json +1 -1
  25. package/plugins/harness-everything/skills/environment-detection/SKILL.md +15 -16
  26. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  27. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +14 -3
  28. package/plugins/harness-everything/skills/harness-everything/scripts/self-heal.js +30 -8
@@ -2,12 +2,12 @@
2
2
  /**
3
3
  * Self-healing installation audit for Harness OS.
4
4
  *
5
- * Audits the six platform integration touchpoints in the current workspace
6
- * and, when any are missing, re-runs the idempotent installer to repair them.
7
- * This makes the harness portable across editors: install once via Claude
8
- * Code, then open the same repo in Copilot/Cursor/Codex/Continue/Hermes and
9
- * the missing advisory instructions are backfilled automatically the first time
10
- * harness-everything (or the environment-detection Discover phase) runs.
5
+ * Audits the six platform integration touchpoints in the current workspace.
6
+ * Read-only callers use --check. Repair mode is explicit: only a direct run
7
+ * without --check may delegate to the idempotent installer.
8
+ *
9
+ * environment-detection uses the read-only path; ordinary Discover/preflight
10
+ * must never backfill hooks or advisory files as a side effect.
11
11
  *
12
12
  * Usage:
13
13
  * node self-heal.js Audit and repair anything missing.
@@ -24,7 +24,26 @@ const fs = require('fs');
24
24
  const path = require('path');
25
25
  const { execSync } = require('child_process');
26
26
  const { getHarnessRoot, requireWorkspace } = require('./runtime-paths');
27
- const { getWorkspaceRoot, isHarnessRepo } = requireWorkspace();
27
+
28
+ function resolveLocalRuntime(checkOnly) {
29
+ try {
30
+ const { getWorkspaceRoot, isHarnessRepo } = requireWorkspace();
31
+ return { getWorkspaceRoot, isHarnessRepo, harnessSourceDir: getHarnessRoot() };
32
+ } catch (err) {
33
+ const message = err && err.message ? err.message : String(err);
34
+ if (!/Harness runtime root not found/.test(message)) throw err;
35
+
36
+ if (checkOnly) {
37
+ console.log('[Harness Self-Heal Audit]');
38
+ console.log(' SKIPPED Local repair runtime unavailable on this distribution surface.');
39
+ console.log('\nRead-only audit skipped; no workspace files were changed.');
40
+ return null;
41
+ }
42
+
43
+ console.error('Cannot repair: local Harness installer/runtime is unavailable on this distribution surface.');
44
+ process.exit(1);
45
+ }
46
+ }
28
47
 
29
48
  const MARKER = 'Harness OS Guidance (Advisory)';
30
49
  const HOOK_ID = 'harness:pre:bootstrap';
@@ -194,8 +213,11 @@ function main() {
194
213
  const checkOnly = process.argv.includes('--check');
195
214
  const forceSelf = process.argv.includes('--force-self');
196
215
 
216
+ const runtime = resolveLocalRuntime(checkOnly);
217
+ if (!runtime) return;
218
+
219
+ const { getWorkspaceRoot, isHarnessRepo, harnessSourceDir } = runtime;
197
220
  const workspaceRoot = getWorkspaceRoot();
198
- const harnessSourceDir = getHarnessRoot();
199
221
  const installerPath = path.join(harnessSourceDir, 'scripts', 'installer.js');
200
222
 
201
223
  console.log(`Workspace: ${workspaceRoot}`);