@osfactory/har 1.0.0 → 1.2.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 (63) hide show
  1. package/dist/index.js +815 -820
  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/factory-line.md +96 -0
  7. package/dist/templates/agent-skills/har-wt.md +1 -1
  8. package/dist/templates/agent-skills/setup-har.md +4 -4
  9. package/dist/templates/agent-skills/skills.manifest.json +13 -0
  10. package/dist/templates/har-boilerplate/harness.env +1 -1
  11. package/dist/templates/har-boilerplate/justfile +11 -12
  12. package/dist/templates/har-boilerplate/stages.json +3 -9
  13. package/dist/templates/har-boilerplate-cli/harness.env +1 -1
  14. package/dist/templates/har-boilerplate-cli/justfile +9 -10
  15. package/dist/templates/har-boilerplate-cli/stages.json +2 -7
  16. package/dist/templates/har-boilerplate-ios/harness.env +1 -1
  17. package/dist/templates/har-boilerplate-ios/justfile +9 -10
  18. package/dist/templates/har-boilerplate-ios/stages.json +3 -8
  19. package/dist/templates/migration-prompt.md +2 -2
  20. package/dist/templates/plugins/custom-stage-skeleton.sh +2 -2
  21. package/dist/templates/plugins/gitleaks/.har/stages/secrets-scan.sh +2 -2
  22. package/dist/templates/plugins/gitleaks/template.manifest.json +1 -1
  23. package/dist/templates/plugins/kerno/.github/workflows/kerno.yml +1 -1
  24. package/dist/templates/plugins/kerno/.har/stages/KERNO.md +2 -2
  25. package/dist/templates/plugins/kerno/.har/stages/backend-validation.sh +3 -3
  26. package/dist/templates/plugins/kerno/README.md +2 -2
  27. package/dist/templates/plugins/kerno/template.manifest.json +1 -1
  28. package/dist/templates/plugins/playwright/.har/stages/PLAYWRIGHT.md +2 -2
  29. package/dist/templates/plugins/playwright/.har/stages/browser-e2e.sh +3 -3
  30. package/dist/templates/plugins/playwright/README.md +1 -1
  31. package/dist/templates/plugins/playwright/playwright.config.js +2 -2
  32. package/dist/templates/plugins/playwright/template.manifest.json +1 -1
  33. package/dist/templates/plugins/rocketsim/.har/stages/ROCKETSIM.md +1 -1
  34. package/dist/templates/plugins/rocketsim/.har/stages/rocketsim-flows.sh +3 -3
  35. package/dist/templates/plugins/rocketsim/README.md +1 -1
  36. package/dist/templates/plugins/rocketsim/flows/example-smoke.sh +1 -1
  37. package/dist/templates/plugins/rocketsim/template.manifest.json +1 -1
  38. package/dist/templates/plugins/semgrep/.har/stages/SEMGREP.md +1 -1
  39. package/dist/templates/plugins/semgrep/.har/stages/sast.sh +3 -3
  40. package/dist/templates/plugins/semgrep/README.md +2 -2
  41. package/dist/templates/plugins/semgrep/template.manifest.json +1 -1
  42. package/dist/templates/plugins/trivy/.har/stages/TRIVY.md +1 -1
  43. package/dist/templates/plugins/trivy/.har/stages/vuln-scan.sh +3 -3
  44. package/dist/templates/plugins/trivy/template.manifest.json +1 -1
  45. package/dist/templates/profiles/cli/docs/readme/quick-start.md +2 -3
  46. package/dist/templates/profiles/cli/docs/readme/verification-contract.md +3 -3
  47. package/dist/templates/profiles/cli/docs/readme/what-s-in-here.md +1 -2
  48. package/dist/templates/profiles/default/docs/readme/quick-start.md +2 -3
  49. package/dist/templates/profiles/default/docs/readme/verification-contract.md +3 -3
  50. package/dist/templates/profiles/default/docs/readme/what-s-in-here.md +1 -2
  51. package/dist/templates/profiles/ios/docs/readme/quick-start.md +2 -3
  52. package/dist/templates/profiles/ios/docs/readme/what-s-in-here.md +1 -2
  53. package/dist/templates/runtime-bundles/shared-kernel/STAGES.md +1 -1
  54. package/dist/templates/runtime-bundles/shared-kernel/lib/verify-runner.mjs +1 -1
  55. package/dist/templates/shared-docs/readme/maintaining-this-harness.md +3 -3
  56. package/package.json +1 -1
  57. package/dist/templates/runtime-bundles/pm2-runtime/attach.sh +0 -53
  58. package/dist/templates/runtime-bundles/shared-kernel/agent-cli.sh +0 -52
  59. package/dist/templates/runtime-bundles/shared-kernel/launch.sh +0 -52
  60. package/dist/templates/runtime-bundles/shared-kernel/preflight.sh +0 -52
  61. package/dist/templates/runtime-bundles/shared-kernel/setup-infra.sh +0 -52
  62. package/dist/templates/runtime-bundles/shared-kernel/teardown.sh +0 -52
  63. 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
 
@@ -0,0 +1,96 @@
1
+ # Run a factory line
2
+
3
+ Execute **one station** of a declared multi-station program:
4
+
5
+ sync → wave plan → parallel HAR slots → cumulative gate → human handoff.
6
+
7
+ The program lives in a **line template** (a `*.line.json` the user points at,
8
+ or `.har/line.json` when that file exists). This workflow is the orchestrator.
9
+ Station-specific how-to lives in other skills the template lists.
10
+
11
+ HAR already has the primitives — work units, isolated slots, stages, plugins,
12
+ validation records. A line is composition plus a manifest. Do not invent a
13
+ second runner, a stack-specific MCP tool, or GitHub-shaped stations.
14
+
15
+ This workflow is the same on Claude Code (`/factory-line`), Cursor
16
+ (`.cursor/commands/factory-line`), and Codex (`har-factory-line`).
17
+
18
+ ## Inputs
19
+
20
+ Resolve these before doing anything (ask only if not inferable):
21
+
22
+ 1. **Line file** — path to a `*.line.json`. If the repo has no line file and
23
+ the user did not name one, stop and say so. Do not invent GitHub issue
24
+ numbers or a fixture repo.
25
+ 2. **Station id** — default: the first station whose bound work is not all
26
+ done / whose gate has not passed.
27
+ 3. **Slot budget** — `har env status` first. One slot per concurrent agent.
28
+ Occupied slots always block.
29
+
30
+ ## Contract (minimum)
31
+
32
+ A line file is JSON with `contractVersion: 1`. Required:
33
+
34
+ - `id`, `stations[]` (ordered; each has `id` + `title`)
35
+ - `gate.cumulative` must be `true`
36
+ - `handoff.autonomousShip` must be `false`
37
+
38
+ Optional: `skills[]` and `mcp[]` (declarations + install hints — HAR does not
39
+ vendor third-party skill packs or add core MCP tools), `plugins[]`,
40
+ `gate.stages[]` with `fromStation` (that stage stays required from this
41
+ station **on**), `extraStages[]`, `traveler`, `stations[].work` / `waves`.
42
+
43
+ `work.source` is `github`, `linear`, `none`, or a free string — the tracker
44
+ is data on the station, not the type of the station. If `waves` is omitted,
45
+ the station is one sequential cell.
46
+
47
+ A QA station is never removed. Adding a station must not drop earlier
48
+ `gate.stages`. When a review finds a new class of defect, add a stage or
49
+ doctor question and tag `fromStation` — that is how the ratchet grows.
50
+
51
+ ## What this workflow must not bake in
52
+
53
+ Stacked PRs, a long-lived integration branch, a named fixture repo, `M0..M5`,
54
+ and "one issue = one PR = one slot" are **instance tactics**. If the template
55
+ does not declare them, do not do them.
56
+
57
+ ## 0. Load and preflight
58
+
59
+ 1. Read the line file. Confirm `gate.cumulative` and `handoff.autonomousShip`.
60
+ 2. Skills and MCP: confirm required ones are present. Missing optional:
61
+ skip those steps and say so. Do not install third-party packs yourself.
62
+ 3. Print: line id, station id, waves, slot plan, and every gate stage whose
63
+ `fromStation` is this station or an earlier one.
64
+
65
+ ## 1. Wave plan
66
+
67
+ Print `stations[].waves` (or a single cell). One HAR slot per group in a
68
+ wave. Never share a slot between two concurrent groups.
69
+
70
+ ## 2. Execute waves
71
+
72
+ For each wave, one subagent per group, in parallel. Each:
73
+
74
+ 1. Checks the slot is free. Occupied → complete/teardown that slot, or pick
75
+ a free slot in budget.
76
+ 2. `har env launch <slot>` with `--work-id` / `--work-source` / `--work-url`
77
+ / `--work-title` when work is bound. Skip tracker flags when source is
78
+ `none`.
79
+ 3. Edits **only** in the returned work dir.
80
+ 4. Full verify in-slot until green. If this station made a new gate question
81
+ askable, add it — never remove an earlier station's stages.
82
+ 5. Reports back. Subagents never push, PR, complete, or teardown on their own.
83
+
84
+ ## 3. Gate
85
+
86
+ Run every gate stage whose `fromStation` ≤ current station. If
87
+ `gate.optInEnv` is set, export it as `1` so the opt-in jig actually runs.
88
+
89
+ Red gate → fix, re-run. Never hand off a red gate. Never bypass
90
+ (`HAR_SKIP_GATE`, `--no-verify`).
91
+
92
+ ## 4. Handoff
93
+
94
+ Update the `traveler` the template names. Then **stop and wait**. Do not
95
+ merge, push to the default branch, complete a slot, or release. Present a
96
+ session handoff (summary, session branch, preview URLs, gate evidence).
@@ -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
 
@@ -43,6 +43,19 @@
43
43
  },
44
44
  "cursor": { "command": true },
45
45
  "codex": { "promptName": "har-maintain" }
46
+ },
47
+ {
48
+ "id": "factory-line",
49
+ "body": "factory-line.md",
50
+ "title": "Run one station of a factory line",
51
+ "claude": {
52
+ "frontmatter": {
53
+ "name": "factory-line",
54
+ "description": "Execute one station of a declared multi-station program (*.line.json): parallel HAR slots, cumulative gate, human handoff. Use when asked to run a factory line, the next station, or a milestone program."
55
+ }
56
+ },
57
+ "cursor": { "command": true },
58
+ "codex": { "promptName": "har-factory-line" }
46
59
  }
47
60
  ]
48
61
  }
@@ -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"