@osfactory/har 1.0.0 → 1.1.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/dist/index.js +813 -818
  2. package/dist/templates/AGENTS.md.template +1 -1
  3. package/dist/templates/adaptation-prompt-init.md +18 -23
  4. package/dist/templates/adaptation-prompt-maintain.md +1 -1
  5. package/dist/templates/adaptation-prompt-plugin.md +1 -1
  6. package/dist/templates/agent-skills/har-wt.md +1 -1
  7. package/dist/templates/agent-skills/setup-har.md +4 -4
  8. package/dist/templates/har-boilerplate/harness.env +1 -1
  9. package/dist/templates/har-boilerplate/justfile +11 -12
  10. package/dist/templates/har-boilerplate/stages.json +3 -9
  11. package/dist/templates/har-boilerplate-cli/harness.env +1 -1
  12. package/dist/templates/har-boilerplate-cli/justfile +9 -10
  13. package/dist/templates/har-boilerplate-cli/stages.json +2 -7
  14. package/dist/templates/har-boilerplate-ios/harness.env +1 -1
  15. package/dist/templates/har-boilerplate-ios/justfile +9 -10
  16. package/dist/templates/har-boilerplate-ios/stages.json +3 -8
  17. package/dist/templates/migration-prompt.md +2 -2
  18. package/dist/templates/plugins/custom-stage-skeleton.sh +2 -2
  19. package/dist/templates/plugins/gitleaks/.har/stages/secrets-scan.sh +2 -2
  20. package/dist/templates/plugins/gitleaks/template.manifest.json +1 -1
  21. package/dist/templates/plugins/kerno/.github/workflows/kerno.yml +1 -1
  22. package/dist/templates/plugins/kerno/.har/stages/KERNO.md +2 -2
  23. package/dist/templates/plugins/kerno/.har/stages/backend-validation.sh +3 -3
  24. package/dist/templates/plugins/kerno/README.md +2 -2
  25. package/dist/templates/plugins/kerno/template.manifest.json +1 -1
  26. package/dist/templates/plugins/playwright/.har/stages/PLAYWRIGHT.md +2 -2
  27. package/dist/templates/plugins/playwright/.har/stages/browser-e2e.sh +3 -3
  28. package/dist/templates/plugins/playwright/README.md +1 -1
  29. package/dist/templates/plugins/playwright/playwright.config.js +2 -2
  30. package/dist/templates/plugins/playwright/template.manifest.json +1 -1
  31. package/dist/templates/plugins/rocketsim/.har/stages/ROCKETSIM.md +1 -1
  32. package/dist/templates/plugins/rocketsim/.har/stages/rocketsim-flows.sh +3 -3
  33. package/dist/templates/plugins/rocketsim/README.md +1 -1
  34. package/dist/templates/plugins/rocketsim/flows/example-smoke.sh +1 -1
  35. package/dist/templates/plugins/rocketsim/template.manifest.json +1 -1
  36. package/dist/templates/plugins/semgrep/.har/stages/SEMGREP.md +1 -1
  37. package/dist/templates/plugins/semgrep/.har/stages/sast.sh +3 -3
  38. package/dist/templates/plugins/semgrep/README.md +2 -2
  39. package/dist/templates/plugins/semgrep/template.manifest.json +1 -1
  40. package/dist/templates/plugins/trivy/.har/stages/TRIVY.md +1 -1
  41. package/dist/templates/plugins/trivy/.har/stages/vuln-scan.sh +3 -3
  42. package/dist/templates/plugins/trivy/template.manifest.json +1 -1
  43. package/dist/templates/profiles/cli/docs/readme/quick-start.md +2 -3
  44. package/dist/templates/profiles/cli/docs/readme/verification-contract.md +3 -3
  45. package/dist/templates/profiles/cli/docs/readme/what-s-in-here.md +1 -2
  46. package/dist/templates/profiles/default/docs/readme/quick-start.md +2 -3
  47. package/dist/templates/profiles/default/docs/readme/verification-contract.md +3 -3
  48. package/dist/templates/profiles/default/docs/readme/what-s-in-here.md +1 -2
  49. package/dist/templates/profiles/ios/docs/readme/quick-start.md +2 -3
  50. package/dist/templates/profiles/ios/docs/readme/what-s-in-here.md +1 -2
  51. package/dist/templates/runtime-bundles/shared-kernel/STAGES.md +1 -1
  52. package/dist/templates/runtime-bundles/shared-kernel/lib/verify-runner.mjs +1 -1
  53. package/dist/templates/shared-docs/readme/maintaining-this-harness.md +3 -3
  54. package/package.json +1 -1
  55. package/dist/templates/runtime-bundles/pm2-runtime/attach.sh +0 -53
  56. package/dist/templates/runtime-bundles/shared-kernel/agent-cli.sh +0 -52
  57. package/dist/templates/runtime-bundles/shared-kernel/launch.sh +0 -52
  58. package/dist/templates/runtime-bundles/shared-kernel/preflight.sh +0 -52
  59. package/dist/templates/runtime-bundles/shared-kernel/setup-infra.sh +0 -52
  60. package/dist/templates/runtime-bundles/shared-kernel/teardown.sh +0 -52
  61. package/dist/templates/runtime-bundles/shared-kernel/verify.sh +0 -52
@@ -20,7 +20,7 @@ harness or report it; do not fall back to ad-hoc commands.
20
20
 
21
21
  Occupied slots always block: `complete` / `teardown`, then launch. Customize the
22
22
  harness only through `harness.env`, `stages.json` + `.har/stages/`, `.har/hooks/`
23
- and `.har/plugins/` — the generated `.har/*.sh` shims are not an editing surface.
23
+ and `.har/plugins/` — there is no generated `.har/*.sh` entry-point surface.
24
24
 
25
25
  Full detail — slot environment, readiness, definition of done, project commands,
26
26
  commit gate: [`.har/README.md`](.har/README.md) and [`.har/stages.json`](.har/stages.json).
@@ -5,8 +5,8 @@ Adapt the `.har/` harness in this repository so AI coding agents can run the pro
5
5
  Explore this repository, then edit files in `.har/` directly to make the harness runnable for this project.
6
6
 
7
7
  `.har/` is a **configuration surface** — the runtime machinery lives in the HAR
8
- package behind the `./.har/*.sh` shims. Never edit the shims or invent new config
9
- files; every customization has a sanctioned home:
8
+ package. CLI and MCP are the only entry points. Never add lifecycle wrappers
9
+ or invent new config files; every customization has a sanctioned home:
10
10
 
11
11
  | Customization | Home |
12
12
  |---------------|------|
@@ -16,9 +16,9 @@ files; every customization has a sanctioned home:
16
16
  | Anything bigger | Plugins (`har env add-plugin`, `har plugin create` for local) |
17
17
  | Full runtime ownership (rare) | `har env eject` |
18
18
 
19
- ## HAR profiles (pick the right one at init)
19
+ ## HAR profiles (pick the right one at scaffold)
20
20
 
21
- `har env init` scaffolds from one of three boilerplate profiles — **choose the profile that matches this repository**:
21
+ The scaffold comes from one of three boilerplate profiles — **choose the profile that matches this repository**:
22
22
 
23
23
  | Profile | Best for | What you get |
24
24
  |---------|----------|--------------|
@@ -26,11 +26,7 @@ files; every customization has a sanctioned home:
26
26
  | `cli` | **CLI tools, libraries, test-suite repos** (typical SWE-bench) | Git worktree by default, no PM2; optional Docker for databases; run project commands in isolation |
27
27
  | `ios` | **Mobile iOS / Swift** | xcodebuild + iOS Simulator; scheme/project/simulator in `harness.env` |
28
28
 
29
- ```bash
30
- har env init # default (SaaS/web)
31
- har env init --profile cli # libraries / CLI / polyglot test repos
32
- har env init --profile ios # iOS apps
33
- ```
29
+ If you must re-scaffold (destructive): `har env init --force --profile default|cli|ios`.
34
30
 
35
31
  Do **not** disable worktrees, rewrite launch into repo-root-only mode, or pick the wrong profile unless the project truly requires it.
36
32
 
@@ -55,8 +51,8 @@ Replace all TODO placeholders. Key files:
55
51
  Identify the **primary application** — the ONE app coding agents will modify and run per-slot. Everything else is shared and runs once for all slots:
56
52
 
57
53
  1. **Primary app** → set `HARNESS_PRIMARY_APP` in `harness.env`; wire ONLY its dev processes into `ecosystem.agent.template.cjs` (a primary app may still need several processes, e.g. api + frontend of the same app).
58
- 2. **External dependencies** (database, cache, queue, mail, ...) → keep/add them as services in `docker-compose.agent.yml`, delete the menu entries the project doesn't use, and list the needed ones in `HARNESS_INFRA_SERVICES` (e.g. `"db redis"`). They start once via `setup-infra.sh` on fixed ports and serve every slot.
59
- 3. **Internal supporting services** (a monolith/monorepo's other services the agent depends on but is not changing) → do NOT start them per-slot. Run them once and shared: as compose services in `docker-compose.agent.yml`, or as PM2 processes in `.har/ecosystem.shared.config.cjs` (processes named `har-shared-<name>`, started automatically by `setup-infra.sh` when the file exists). Point the primary app at them through `env.template`.
54
+ 2. **External dependencies** (database, cache, queue, mail, ...) → keep/add them as services in `docker-compose.agent.yml`, delete the menu entries the project doesn't use, and list the needed ones in `HARNESS_INFRA_SERVICES` (e.g. `"db redis"`). They start once via `har env setup-infra` on fixed ports and serve every slot.
55
+ 3. **Internal supporting services** (a monolith/monorepo's other services the agent depends on but is not changing) → do NOT start them per-slot. Run them once and shared: as compose services in `docker-compose.agent.yml`, or as PM2 processes in `.har/ecosystem.shared.config.cjs` (processes named `har-shared-<name>`, started automatically by `har env setup-infra` when the file exists). Point the primary app at them through `env.template`.
60
56
 
61
57
  Simple single-app repos need none of the extra machinery: one primary app, usually one `db` in `HARNESS_INFRA_SERVICES`, no shared ecosystem file.
62
58
 
@@ -76,8 +72,8 @@ Verification is data: `.har/stages.json` lists the pipeline in
76
72
  `verificationStages` (execution order), and every id resolves to a registered
77
73
  stage with `"tier": "quick" | "full"`. Adapt verification by editing the stage
78
74
  entries — commands, tiers, order — or adding stage scripts (see
79
- `.har/STAGES.md`). **Never edit `.har/verify.sh`**; it is a thin iterator that
80
- runs the registry. The scaffolded defaults (`typecheck`, `unit-tests`, `lint`,
75
+ `.har/STAGES.md`). Do not add lifecycle wrappers — `har env verify` runs the
76
+ registry. The scaffolded defaults (`typecheck`, `unit-tests`, `lint`,
81
77
  `readiness`, plus `api-health` on web profiles) are derived from
82
78
  `HARNESS_ECOSYSTEM` — a starting point, not the repo's final contract. Replace
83
79
  conventions that do not match this project. Use toolchain variables from
@@ -166,8 +162,8 @@ The harness reference agents read: slot environment, readiness / what "agent
166
162
  usable" means here, definition of done, project commands, architecture.
167
163
 
168
164
  ### `.har/env.template`, `docker-compose.agent.yml`
169
- Adapt as needed for the project's infra (`setup-infra.sh` is a shim — the
170
- services it starts come from these two files plus `HARNESS_INFRA_SERVICES`).
165
+ Adapt as needed for the project's infra (`har env setup-infra` starts
166
+ services from these two files plus `HARNESS_INFRA_SERVICES`).
171
167
 
172
168
  ### Port allocation & shared services
173
169
 
@@ -211,15 +207,14 @@ Coding agents discover the harness through two files:
211
207
 
212
208
  Do **not** create `AGENT.md` (singular) — that legacy name is obsolete. If `AGENT.md` exists, merge any unique notes into `AGENTS.md` and delete `AGENT.md`.
213
209
 
214
- If **`har env init` already created `AGENTS.md`**, refresh the **HAR / agent environment** section and fill in **Project-specific notes** — do not wipe unrelated content.
210
+ If **the scaffold already created `AGENTS.md`**, refresh the **HAR / agent environment** section and fill in **Project-specific notes** — do not wipe unrelated content.
215
211
 
216
212
  If **no `AGENTS.md` exists**, create one at the repo root using this structure:
217
213
 
218
214
  - Link to `.har/README.md`
219
215
  - State plainly: **the harness is how you run this project** — to see the app live (manual testing, browser, screenshots), `launch` a slot; never hand-roll docker/dev-server startup, and never work around a failing harness command with ad-hoc setup (fix or report it instead)
220
216
  - Commands: HAR MCP tools or `har env launch/verify/teardown`
221
- - Shell shims: `./.har/launch.sh`, `./.har/verify.sh`, `./.har/teardown.sh` — same runtime and run records
222
- - Rules (no hardcoded ports, use `./.har/agent-cli.sh`, do not touch other agents' resources)
217
+ - Rules (no hardcoded ports, use `har env agent <id> …`, do not touch other agents' resources)
223
218
  - Project-specific notes (stack, credentials, definition of done)
224
219
 
225
220
  If **`AGENTS.md` already exists** (project-owned), add or update a concise **HAR / agent environment** section — do not replace unrelated content.
@@ -236,14 +231,14 @@ If this repository contains **more than one project or `.har` harness** (check f
236
231
 
237
232
  Include a **Run history** subsection:
238
233
 
239
- - Every entry point (`./.har/*.sh` shims, `har env …`, MCP) writes the same run records to `.har/runs/YYYY-MM-DD/HH-mm-ss_<stageId>_agent-<id>.json`
234
+ - Every entry point (`har env …`, MCP) writes the same run records to `.har/runs/YYYY-MM-DD/HH-mm-ss_<stageId>_agent-<id>.json`
240
235
  - With worktrees, code runs in the worktree but run JSON lives in the main checkout `.har/runs/`
241
- - The `./.har/*.sh` shims forward to the same runtime — evidence records are identical from any surface
236
+ - CLI and MCP are the only entry points — evidence records are identical from either surface
242
237
 
243
238
  ## Step 4 — Adaptation completeness (required)
244
239
 
245
240
  Before finishing, confirm the harness describes this project truthfully — do
246
- **not** go hunting for machinery to prune (the shims and packaged runtime are
241
+ **not** go hunting for machinery to prune (the packaged runtime is
247
242
  not yours to trim, and wholesale deletion just manufactures drift):
248
243
 
249
244
  - [ ] No `TODO` placeholders remain anywhere in `.har/`
@@ -256,10 +251,10 @@ not yours to trim, and wholesale deletion just manufactures drift):
256
251
 
257
252
  ## Rules
258
253
 
259
- 1. Customize only through the contract: config in `harness.env`, stages in `stages.json` / `.har/stages/`, hooks in `.har/hooks/`, plugins in `.har/plugins/` — never edit the generated `*.sh` shims
254
+ 1. Customize only through the contract: config in `harness.env`, stages in `stages.json` / `.har/stages/`, hooks in `.har/hooks/`, plugins in `.har/plugins/` — never add lifecycle `.sh` wrappers
260
255
  2. Always update `.har/README.md` to reflect current harness state
261
256
  3. Reuse existing project commands from package.json, Makefile, CI, etc.
262
257
  4. Replace all TODO placeholders
263
258
  5. Do not edit `.har/manifest.json` — managed by the har CLI
264
259
 
265
- When finished, summarize what you changed, confirm verification commands (`har env verify 1 --full` or `./.har/verify.sh 1 --full`) are correct for this stack, and record the adaptation with `har env maintain --finalize --summary "<what changed>"`.
260
+ When finished, summarize what you changed, confirm verification commands (`har env verify 1 --full`) are correct for this stack, and record the adaptation with `har env maintain --finalize --summary "<what changed>"`.
@@ -81,7 +81,7 @@ scripts for a lifecycle side effect, move that code into a hook.
81
81
  Platform-shape upgrades are **code, not a checklist**: the har CLI carries a
82
82
  versioned migration registry keyed on the manifest's `runtimeVersion`.
83
83
  `har env maintain` detects an old harness shape, writes `.har/MIGRATE-PROMPT.md`,
84
- and `har env maintain --migrate` applies the mechanical steps (shims, pure-config
84
+ and `har env maintain --migrate` applies the mechanical steps (delete leftover wrappers, pure-config
85
85
  `harness.env` with `HARNESS_INFRA_SERVICES` / `HARNESS_INFRA_PORT_LANES`
86
86
  conversions, machinery removal) with backups under `.har/migrate/backup/`.
87
87
 
@@ -31,7 +31,7 @@ stage entries in `.har/stages.json`. Never edit the shims.
31
31
  ## Prove it green
32
32
 
33
33
  ```bash
34
- har env launch 1 # or ./.har/launch.sh 1
34
+ har env launch 1
35
35
  har env verify 1 --full # must pass INCLUDING {{STAGE_IDS}}
36
36
  ```
37
37
 
@@ -16,7 +16,7 @@ har env status # or ./.har/agent-cli.sh 1 status
16
16
  ## 2. Launch — BEFORE editing any file
17
17
 
18
18
  ```bash
19
- har env launch <id> # or ./.har/launch.sh <id>
19
+ har env launch <id>
20
20
  ```
21
21
 
22
22
  Launch creates a fresh session worktree from HEAD and prints its **work dir** (also recorded in `.har/slots/agent-<id>.json`, path like `~/worktrees/<base>-<sha4>-har-agent-<id>-<rand4>`). If a previous launch failed partway, retry with `--resume` instead of starting fresh.
@@ -42,15 +42,15 @@ Tell the user which profile you picked and why before continuing.
42
42
 
43
43
  ## 4. Initialize the harness
44
44
 
45
- ```bash
46
- har env init --profile <profile> # omit --profile for default
47
- ```
45
+ Call `har_init_harness` with the chosen `profile` (`default`, `cli`, or `ios`).
46
+ Do not run `har onboard` (that wizard is for humans) and do not advertise
47
+ `har env init` as the first-run command.
48
48
 
49
49
  If `.har/` already exists, stop and suggest `/har-maintain` instead.
50
50
 
51
51
  ## 5. Perform the adaptation yourself
52
52
 
53
- `har env init` prints an adaptation prompt and writes it to `.har/ADAPT-PROMPT.md`. Read that file and **execute its instructions yourself, now, in this session** — tailor the harness configuration surface (`harness.env`, `stages.json` + `.har/stages/`, `.har/hooks/`, `docker-compose.agent.yml`, `env.template`) and `AGENTS.md` to this repository's real stack, ports, and commands. The `./.har/*.sh` files are generated shims over the packaged runtime — never edit them.
53
+ `har_init_harness` writes an adaptation prompt to `.har/ADAPT-PROMPT.md`. Read that file and **execute its instructions yourself, now, in this session** — tailor the harness configuration surface (`harness.env`, `stages.json` + `.har/stages/`, `.har/hooks/`, `docker-compose.agent.yml`, `env.template`) and `AGENTS.md` to this repository's real stack, ports, and commands. The `./.har/*.sh` files are generated shims over the packaged runtime — never edit them.
54
54
 
55
55
  ## 6. Register the project's checks as stages
56
56
 
@@ -1,5 +1,5 @@
1
1
  # Shared harness configuration — edit to match your project
2
- # Generated by har env init, maintained over time with har env maintain
2
+ # Generated when the harness is scaffolded, maintained with har env maintain
3
3
  #
4
4
  # This file is pure KEY=value config (plus comments) and is schema-validated
5
5
  # on read. Runtime helpers (har_infra_enabled, har_pg, port resolution) live
@@ -2,38 +2,37 @@
2
2
 
3
3
  set shell := ["bash", "-cu"]
4
4
 
5
+ repo := justfile_directory() + "/.."
6
+
5
7
  setup:
6
- ./setup-infra.sh
8
+ har env setup-infra --repo {{repo}}
7
9
 
8
10
  launch id:
9
- ./launch.sh {{id}}
11
+ har env launch {{id}} --repo {{repo}}
10
12
 
11
13
  teardown id:
12
- ./teardown.sh {{id}}
14
+ har env teardown {{id}} --repo {{repo}}
13
15
 
14
16
  verify id:
15
- ./verify.sh {{id}}
17
+ har env verify {{id}} --repo {{repo}}
16
18
 
17
19
  verify-full id:
18
- ./verify.sh {{id}} --full
20
+ har env verify {{id}} --full --repo {{repo}}
19
21
 
20
22
  status:
21
- #!/usr/bin/env bash
22
- for id in 1 2 3 4 5; do
23
- ./agent-cli.sh "$id" status 2>/dev/null || true
24
- done
23
+ har env status --repo {{repo}}
25
24
 
26
25
  launch-all count:
27
26
  #!/usr/bin/env bash
28
27
  for id in $(seq 1 {{count}}); do
29
- ./launch.sh "$id"
28
+ har env launch "$id" --repo "{{repo}}"
30
29
  done
31
30
 
32
31
  teardown-all:
33
32
  #!/usr/bin/env bash
34
33
  for id in 1 2 3 4 5; do
35
- ./teardown.sh "$id" 2>/dev/null || true
34
+ har env teardown "$id" --repo "{{repo}}" 2>/dev/null || true
36
35
  done
37
36
 
38
37
  cli id cmd *args:
39
- ./agent-cli.sh {{id}} {{cmd}} {{args}}
38
+ har env agent {{id}} {{cmd}} {{args}} --repo {{repo}}
@@ -13,14 +13,12 @@
13
13
  {
14
14
  "id": "setup-infra",
15
15
  "kind": "setup",
16
- "description": "Shared infrastructure (Docker, template DB)",
17
- "command": "./.har/setup-infra.sh"
16
+ "description": "Shared infrastructure (Docker, template DB)"
18
17
  },
19
18
  {
20
19
  "id": "launch",
21
20
  "kind": "launch",
22
21
  "description": "Launch an isolated agent environment slot",
23
- "command": "./.har/launch.sh {agentId}",
24
22
  "artifacts": [
25
23
  {
26
24
  "path": ".env.agent.{agentId}",
@@ -33,7 +31,6 @@
33
31
  "id": "verify",
34
32
  "kind": "verify",
35
33
  "description": "Verification pipeline: runs stages.json verificationStages in order (tier \"quick\" by default; --full runs the whole list)",
36
- "command": "./.har/verify.sh {agentId}",
37
34
  "acceptsArgs": [
38
35
  "--full"
39
36
  ],
@@ -49,7 +46,6 @@
49
46
  "id": "status",
50
47
  "kind": "inspect",
51
48
  "description": "Inspect a running agent environment slot",
52
- "command": "./.har/agent-cli.sh {agentId} status",
53
49
  "artifacts": [
54
50
  {
55
51
  "path": ".har/logs",
@@ -61,14 +57,12 @@
61
57
  {
62
58
  "id": "logs",
63
59
  "kind": "inspect",
64
- "description": "Read recent logs for an agent slot",
65
- "command": "./.har/agent-cli.sh {agentId} logs"
60
+ "description": "Read recent logs for an agent slot"
66
61
  },
67
62
  {
68
63
  "id": "teardown",
69
64
  "kind": "teardown",
70
- "description": "Stop processes and release agent slot resources",
71
- "command": "./.har/teardown.sh {agentId}"
65
+ "description": "Stop processes and release agent slot resources"
72
66
  },
73
67
  {
74
68
  "id": "typecheck",
@@ -1,5 +1,5 @@
1
1
  # CLI / library harness — optional Docker via HARNESS_INFRA_SERVICES, no PM2
2
- # Generated by har env init --profile cli
2
+ # Generated when the harness is scaffolded (--profile cli)
3
3
  #
4
4
  # This file is pure KEY=value config (plus comments) and is schema-validated
5
5
  # on read. Runtime helpers (har_infra_enabled, har_pg, port resolution) live
@@ -2,26 +2,25 @@
2
2
 
3
3
  set shell := ["bash", "-cu"]
4
4
 
5
+ repo := justfile_directory() + "/.."
6
+
5
7
  setup:
6
- ./setup-infra.sh
8
+ har env setup-infra --repo {{repo}}
7
9
 
8
10
  launch id:
9
- ./launch.sh {{id}}
11
+ har env launch {{id}} --repo {{repo}}
10
12
 
11
13
  teardown id:
12
- ./teardown.sh {{id}}
14
+ har env teardown {{id}} --repo {{repo}}
13
15
 
14
16
  verify id:
15
- ./verify.sh {{id}}
17
+ har env verify {{id}} --repo {{repo}}
16
18
 
17
19
  verify-full id:
18
- ./verify.sh {{id}} --full
20
+ har env verify {{id}} --full --repo {{repo}}
19
21
 
20
22
  status:
21
- #!/usr/bin/env bash
22
- for id in 1 2 3; do
23
- ./agent-cli.sh "$id" status 2>/dev/null || true
24
- done
23
+ har env status --repo {{repo}}
25
24
 
26
25
  cli id cmd *args:
27
- ./agent-cli.sh {{id}} {{cmd}} {{args}}
26
+ har env agent {{id}} {{cmd}} {{args}} --repo {{repo}}
@@ -13,14 +13,12 @@
13
13
  {
14
14
  "id": "setup-infra",
15
15
  "kind": "setup",
16
- "description": "Optional shared Docker infrastructure",
17
- "command": "./.har/setup-infra.sh"
16
+ "description": "Optional shared Docker infrastructure"
18
17
  },
19
18
  {
20
19
  "id": "launch",
21
20
  "kind": "launch",
22
21
  "description": "Prepare agent slot (git worktree, deps, env file)",
23
- "command": "./.har/launch.sh {agentId}",
24
22
  "artifacts": [
25
23
  {
26
24
  "path": ".env.agent.{agentId}",
@@ -33,7 +31,6 @@
33
31
  "id": "verify",
34
32
  "kind": "verify",
35
33
  "description": "Verification pipeline: runs stages.json verificationStages in order (tier \"quick\" by default; --full runs the whole list)",
36
- "command": "./.har/verify.sh {agentId}",
37
34
  "acceptsArgs": [
38
35
  "--full"
39
36
  ],
@@ -49,7 +46,6 @@
49
46
  "id": "status",
50
47
  "kind": "inspect",
51
48
  "description": "Inspect agent slot status and worktree path",
52
- "command": "./.har/agent-cli.sh {agentId} status",
53
49
  "artifacts": [
54
50
  {
55
51
  "path": ".har/logs",
@@ -61,8 +57,7 @@
61
57
  {
62
58
  "id": "teardown",
63
59
  "kind": "teardown",
64
- "description": "Remove worktree and env file for the slot",
65
- "command": "./.har/teardown.sh {agentId}"
60
+ "description": "Remove worktree and env file for the slot"
66
61
  },
67
62
  {
68
63
  "id": "typecheck",
@@ -1,5 +1,5 @@
1
1
  # iOS mobile app harness — Xcode / iOS Simulator, no PM2, no Docker infra
2
- # Generated by har env init --profile ios
2
+ # Generated when the harness is scaffolded (--profile ios)
3
3
  #
4
4
  # This file is pure KEY=value config (plus comments) and is schema-validated
5
5
  # on read. Runtime helpers (har_infra_enabled, port resolution) live in
@@ -2,29 +2,28 @@
2
2
 
3
3
  set shell := ["bash", "-cu"]
4
4
 
5
+ repo := justfile_directory() + "/.."
6
+
5
7
  setup:
6
- ./setup-infra.sh
8
+ har env setup-infra --repo {{repo}}
7
9
 
8
10
  launch id:
9
- ./launch.sh {{id}}
11
+ har env launch {{id}} --repo {{repo}}
10
12
 
11
13
  teardown id:
12
- ./teardown.sh {{id}}
14
+ har env teardown {{id}} --repo {{repo}}
13
15
 
14
16
  verify id:
15
- ./verify.sh {{id}}
17
+ har env verify {{id}} --repo {{repo}}
16
18
 
17
19
  verify-full id:
18
- ./verify.sh {{id}} --full
20
+ har env verify {{id}} --full --repo {{repo}}
19
21
 
20
22
  status:
21
- #!/usr/bin/env bash
22
- for id in 1 2 3; do
23
- ./agent-cli.sh "$id" status 2>/dev/null || true
24
- done
23
+ har env status --repo {{repo}}
25
24
 
26
25
  cli id cmd *args:
27
- ./agent-cli.sh {{id}} {{cmd}} {{args}}
26
+ har env agent {{id}} {{cmd}} {{args}} --repo {{repo}}
28
27
 
29
28
  simulator:
30
29
  xcrun simctl list devices available | grep -E 'iPhone|iPad' | head -20
@@ -13,14 +13,12 @@
13
13
  {
14
14
  "id": "setup-infra",
15
15
  "kind": "setup",
16
- "description": "Boot iOS Simulator and start optional shared infra",
17
- "command": "./.har/setup-infra.sh"
16
+ "description": "Boot iOS Simulator and start optional shared infra"
18
17
  },
19
18
  {
20
19
  "id": "launch",
21
20
  "kind": "launch",
22
21
  "description": "Prepare agent slot (git worktree, iOS deps, env file)",
23
- "command": "./.har/launch.sh {agentId}",
24
22
  "artifacts": [
25
23
  {
26
24
  "path": ".env.agent.{agentId}",
@@ -33,7 +31,6 @@
33
31
  "id": "verify",
34
32
  "kind": "verify",
35
33
  "description": "Verification pipeline: runs stages.json verificationStages in order (tier \"quick\" by default; --full runs the whole list)",
36
- "command": "./.har/verify.sh {agentId}",
37
34
  "acceptsArgs": [
38
35
  "--full"
39
36
  ],
@@ -49,7 +46,6 @@
49
46
  "id": "status",
50
47
  "kind": "inspect",
51
48
  "description": "Inspect agent slot status, simulator, and worktree path",
52
- "command": "./.har/agent-cli.sh {agentId} status",
53
49
  "artifacts": [
54
50
  {
55
51
  "path": ".har/logs",
@@ -61,8 +57,7 @@
61
57
  {
62
58
  "id": "teardown",
63
59
  "kind": "teardown",
64
- "description": "Remove worktree and env file for the slot",
65
- "command": "./.har/teardown.sh {agentId}"
60
+ "description": "Remove worktree and env file for the slot"
66
61
  },
67
62
  {
68
63
  "id": "build",
@@ -85,7 +80,7 @@
85
80
  "kind": "test",
86
81
  "tier": "full",
87
82
  "description": "SwiftLint (skips when not installed)",
88
- "command": "command -v \"${HARNESS_SWIFTLINT_CMD:-swiftlint}\" >/dev/null 2>&1 && \"${HARNESS_SWIFTLINT_CMD:-swiftlint}\" --quiet || echo \"swiftlint not installed — skipping\"",
83
+ "command": "command -v \"${HARNESS_SWIFTLINT_CMD:-swiftlint}\" >/dev/null 2>&1 && \"${HARNESS_SWIFTLINT_CMD:-swiftlint}\" --quiet || echo \"swiftlint not installed \u2014 skipping\"",
89
84
  "requiresAgentId": true
90
85
  },
91
86
  {
@@ -9,7 +9,7 @@ In 1.0 the harness machinery lives once, in the `@osfactory/har` package. `.har/
9
9
  - **hooks** — `.har/hooks/{pre-launch,post-launch,pre-verify,pre-teardown,post-teardown}.sh` (custom lifecycle behavior)
10
10
  - **plugins** — `.har/plugins/<id>/` local plugins for anything bigger (`har plugin create <id>`)
11
11
 
12
- The `./.har/*.sh` entry points become thin shims (`exec har env … "$@"` with a pinned `npx` fallback), so every surface — raw scripts, `har env`, MCP tools — writes the same run/validation records. Your muscle memory (`./.har/launch.sh 1`, `./.har/verify.sh 1 --full`, `har env launch 1`) keeps working before, during, and after.
12
+ Lifecycle wrappers under `.har/` are deleted. Drive the harness with `har env …` or MCP — both write the same run/validation records. Project-owned `stages/*.sh` and `hooks/*.sh` stay.
13
13
 
14
14
  {{MIGRATION_SECTION}}
15
15
 
@@ -35,7 +35,7 @@ If the backups show deep patches to the machinery itself (not just config/stages
35
35
  2. `har env maintain` — drift report should show only files you deliberately adapted.
36
36
  3. Full verify on **every configured agent slot** that is in use; at minimum:
37
37
  - `har env launch 1`
38
- - `har env verify 1 --full` (or `./.har/verify.sh 1 --full` — same records either way)
38
+ - `har env verify 1 --full`
39
39
  - `har env complete 1` (or `har env teardown 1`)
40
40
  4. Exercise anything you lifted into hooks/stages (e.g. per-slot data stores exist in the work dir, custom checks run in `--full`).
41
41
 
@@ -26,8 +26,8 @@ escape_step_output() {
26
26
  printf '%s' "$1" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const s=d.trim().split('\n').slice(0,50).join('\n');process.stdout.write(JSON.stringify(s))})" 2>/dev/null || echo '""'
27
27
  }
28
28
 
29
- ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run ./.har/launch.sh ${AGENT_ID} first}"
30
- WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run ./.har/launch.sh ${AGENT_ID} first}"
29
+ ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
30
+ WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
31
31
  ARTIFACTS_DIR="$HARNESS_DIR/artifacts/__STAGE_ID__"
32
32
  mkdir -p "$ARTIFACTS_DIR"
33
33
 
@@ -48,8 +48,8 @@ REPORT_PATH="$ARTIFACT_DIR/report.json"
48
48
  SCAN_LOG="$ARTIFACT_DIR/gitleaks.log"
49
49
 
50
50
  # ── Resolve agent env ─────────────────────────────────────────────────────────
51
- ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run ./.har/launch.sh ${AGENT_ID} first}"
52
- WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run ./.har/launch.sh ${AGENT_ID} first}"
51
+ ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
52
+ WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
53
53
 
54
54
  GITLEAKS_VERSION="$(gitleaks version 2>/dev/null | head -1 || echo unknown)"
55
55
  log "gitleaks ${GITLEAKS_VERSION} — ${MODE} scan of $WORK_DIR"
@@ -43,7 +43,7 @@
43
43
  ],
44
44
  "nextSteps": [
45
45
  "Install gitleaks: brew install gitleaks — or a release binary from https://github.com/gitleaks/gitleaks/releases",
46
- "./.har/launch.sh 1",
46
+ "har env launch 1",
47
47
  "./.har/stages/secrets-scan.sh 1",
48
48
  "Open .har/artifacts/secrets-scan/report.json for findings (secrets are redacted)",
49
49
  "Tune allowlists in .gitleaks.toml — read .har/stages/GITLEAKS.md for the adaptation guide"
@@ -30,7 +30,7 @@ jobs:
30
30
  - name: Install Kerno CLI
31
31
  run: npm install -g @kerno/cli
32
32
  # - name: Start the app (adapt for your stack) and migrate/seed its database
33
- # run: ./.har/launch.sh 1 && <start your app in the slot>
33
+ # run: har env launch 1 && <start your app in the slot>
34
34
  # - name: Bind a Kerno agent to this checkout
35
35
  # run: kerno init
36
36
  # - name: Run backend validation
@@ -47,7 +47,7 @@ concurrently across slots.
47
47
 
48
48
  ## Configuration the stage reads
49
49
 
50
- All values come from the slot's `.env.agent.<id>` (written by `launch.sh`) and `~/.kerno/agent.port`:
50
+ All values come from the slot's `.env.agent.<id>` (written by `har env launch`) and `~/.kerno/agent.port`:
51
51
 
52
52
  | Value | Source | Used for |
53
53
  |-------|--------|----------|
@@ -101,7 +101,7 @@ Under `.har/artifacts/backend-validation/`:
101
101
  ./.har/stages/backend-validation.sh 1
102
102
 
103
103
  # As part of full verify
104
- ./.har/verify.sh 1 --full
104
+ har env verify 1 --full
105
105
  ```
106
106
 
107
107
  ## Adapting per repo
@@ -4,7 +4,7 @@
4
4
  # via the local Kerno agent's REST API. Outputs JSON to stdout, progress to stderr.
5
5
  #
6
6
  # Usage: ./.har/stages/backend-validation.sh <agent-id>
7
- # Prerequisite: ./.har/launch.sh <agent-id>, the app running in the slot, AND a Kerno
7
+ # Prerequisite: har env launch <agent-id>, the app running in the slot, AND a Kerno
8
8
  # agent started with `kerno init` in THIS worktree (Kerno allows ONE agent per machine).
9
9
  # See: ./.har/stages/KERNO.md for the full setup + adaptation guide.
10
10
  set -euo pipefail
@@ -76,8 +76,8 @@ fi
76
76
  trap cleanup EXIT
77
77
 
78
78
  # ── Resolve agent env + slot target ───────────────────────────────────────────
79
- ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run ./.har/launch.sh ${AGENT_ID} first}"
80
- WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run ./.har/launch.sh ${AGENT_ID} first}"
79
+ ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
80
+ WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
81
81
 
82
82
  # SUT URL: prefer an explicit override, then the app's own SITE_URL (both the default
83
83
  # web profile and single-port apps like Next.js set SITE_URL to the running app), then a
@@ -55,13 +55,13 @@ kerno init # run inside the slot worktree
55
55
  ls .kerno/scenarios/endpoints/
56
56
 
57
57
  # 4. Launch the slot and start your app
58
- ./.har/launch.sh 1
58
+ har env launch 1
59
59
 
60
60
  # 5. Run backend validation
61
61
  ./.har/stages/backend-validation.sh 1
62
62
 
63
63
  # 6. Validate everything
64
- ./.har/verify.sh 1 --full
64
+ har env verify 1 --full
65
65
  ```
66
66
 
67
67
  Per-endpoint run responses and verdicts land in `.har/artifacts/backend-validation/`.
@@ -49,7 +49,7 @@
49
49
  "npm install -g @kerno/cli",
50
50
  "kerno init # bind the single Kerno agent to THIS worktree",
51
51
  "Ask your Kerno agent to generate a scenario suite (or ensure .kerno/scenarios/ is committed)",
52
- "./.har/launch.sh 1 # then start your app in the slot",
52
+ "har env launch 1 # then start your app in the slot",
53
53
  "./.har/stages/backend-validation.sh 1",
54
54
  "Open .har/artifacts/backend-validation/ for verdicts and per-endpoint run responses"
55
55
  ],
@@ -10,12 +10,12 @@ Adapt specs under `tests/` for your application. Full verification (`verify --fu
10
10
 
11
11
  ## Run
12
12
 
13
- After `./.har/launch.sh <id>`:
13
+ After `har env launch <id>`:
14
14
 
15
15
  ```bash
16
16
  ./.har/stages/browser-e2e.sh <id>
17
17
  # included in:
18
- ./.har/verify.sh <id> --full
18
+ har env verify <id> --full
19
19
  ```
20
20
 
21
21
  Adapt selectors and paths in the scaffold specs during harness adaptation.