uni-harness 0.1.0 → 0.1.1

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.
@@ -11,6 +11,14 @@ running them.
11
11
 
12
12
  ## Step 1: Scan
13
13
 
14
+ - **Exclude the harness's own files first.** Everything the installer put
15
+ here — `.claude/`, `.harness/`, `harness/` — is the kit's machinery, not
16
+ the project. Never let it drive language detection, and never propose the
17
+ kit's self-test (`harness/tests/test_hooks.sh`) as the project's TEST_CMD:
18
+ it verifies the harness, not the user's code, and pointing the stop gate
19
+ at it would "pass" every turn regardless of what broke. If no project
20
+ code exists outside those directories yet, say so and leave the commands
21
+ blank until there is something real to verify.
14
22
  - Language/version: from manifests (package.json, pyproject.toml, go.mod,
15
23
  Cargo.toml, *.csproj, ...). Prefer versions pinned in lockfiles/config.
16
24
  - BUILD / TEST / LINT candidates: collect from manifest scripts, Makefile,
package/bin/cli.js CHANGED
@@ -27,6 +27,10 @@ const { spawnSync } = require('child_process');
27
27
 
28
28
  const PKG_ROOT = path.resolve(__dirname, '..');
29
29
  const MACHINERY_DIRS = ['.claude/hooks', '.claude/skills', '.claude/agents', 'harness'];
30
+ // Files that live in these dirs but belong to the kit repository only.
31
+ // test_installer.sh tests bin/cli.js, which is never installed into target
32
+ // projects — shipping it there guarantees a failing test suite.
33
+ const KIT_ONLY_FILES = new Set(['harness/tests/test_installer.sh']);
30
34
  const MANIFEST = '.harness/kit-manifest.json';
31
35
  const KIT_VERSION = require(path.join(PKG_ROOT, 'package.json')).version;
32
36
 
@@ -53,7 +57,9 @@ function machineryFiles() {
53
57
  const files = [];
54
58
  for (const d of MACHINERY_DIRS) {
55
59
  for (const f of walk(path.join(PKG_ROOT, d))) {
56
- files.push(path.relative(PKG_ROOT, f));
60
+ const rel = path.relative(PKG_ROOT, f).split(path.sep).join('/');
61
+ if (KIT_ONLY_FILES.has(rel)) continue;
62
+ files.push(rel);
57
63
  }
58
64
  }
59
65
  return files.sort();
@@ -40,6 +40,9 @@ check "writes manifest" "yes" "$([ -f "$TGT/.harness/kit-manifest.json" ] && ech
40
40
  check "gitignores logs" ".harness/logs/" "$(cat "$TGT/.gitignore")"
41
41
  check "init runs hook tests" "Hook tests passed" "$OUT"
42
42
  check "prints next step" "/harness-init" "$OUT"
43
+ # regression: test_installer.sh tests bin/cli.js, which only exists in the
44
+ # npm package — shipping it to targets guarantees a failing suite there
45
+ check "does not ship test_installer.sh" "EMPTY" "$([ -f "$TGT/harness/tests/test_installer.sh" ] && echo left)"
43
46
 
44
47
  # ── brownfield init: existing project files are preserved ────────
45
48
  echo "init (brownfield)"
@@ -82,6 +85,22 @@ check "states owned files untouched" "were not touched" "$OUT"
82
85
  OUT=$(node "$CLI" update "$TGT" --force 2>&1)
83
86
  check "--force overwrites modifications" "EMPTY" "$(grep -F 'local customization' "$TGT/.claude/hooks/guard-pre-bash.sh" || true)"
84
87
 
88
+ # simulate a v0.1.0 install that shipped test_installer.sh: an unmodified
89
+ # manifest-tracked copy must be cleaned up by update
90
+ cp "$ROOT/harness/tests/test_installer.sh" "$TGT/harness/tests/test_installer.sh"
91
+ python3 - "$TGT" <<'EOF'
92
+ import json, sys, hashlib, os
93
+ t = sys.argv[1]
94
+ mp = os.path.join(t, '.harness/kit-manifest.json')
95
+ m = json.load(open(mp))
96
+ p = os.path.join(t, 'harness/tests/test_installer.sh')
97
+ m['files']['harness/tests/test_installer.sh'] = hashlib.sha256(open(p, 'rb').read()).hexdigest()
98
+ json.dump(m, open(mp, 'w'), indent=2)
99
+ EOF
100
+ OUT=$(node "$CLI" update "$TGT" 2>&1)
101
+ check "update removes stale kit-only file" "removed from kit" "$OUT"
102
+ check "stale file is gone" "EMPTY" "$([ -f "$TGT/harness/tests/test_installer.sh" ] && echo left)"
103
+
85
104
  # ── doctor ───────────────────────────────────────────────────────
86
105
  echo "doctor"
87
106
  OUT=$(node "$CLI" doctor "$TGT" 2>&1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-harness",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Agent harness kit for Claude Code — installs verification sensors, destructive-command guards, checkpoint recovery, observability logs, and ratchet skills into your project",
5
5
  "bin": {
6
6
  "uni-harness": "bin/cli.js"