@osfactory/har 1.0.0-rc.2 → 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.
- package/dist/index.js +5231 -8674
- package/dist/templates/AGENTS.md.template +19 -66
- package/dist/templates/CLAUDE.md.template +1 -5
- package/dist/templates/adaptation-prompt-init.md +25 -29
- package/dist/templates/adaptation-prompt-maintain.md +5 -5
- package/dist/templates/adaptation-prompt-plugin.md +1 -1
- package/dist/templates/agent-skills/har-wt.md +2 -2
- package/dist/templates/agent-skills/setup-har.md +4 -4
- package/dist/templates/cursor-rule.mdc.template +7 -72
- package/dist/templates/har-boilerplate/gitignore.template +3 -1
- package/dist/templates/har-boilerplate/harness.env +1 -1
- package/dist/templates/har-boilerplate/justfile +11 -12
- package/dist/templates/har-boilerplate/stages.json +3 -9
- package/dist/templates/har-boilerplate-cli/gitignore.template +3 -1
- package/dist/templates/har-boilerplate-cli/harness.env +1 -1
- package/dist/templates/har-boilerplate-cli/justfile +9 -10
- package/dist/templates/har-boilerplate-cli/stages.json +2 -7
- package/dist/templates/har-boilerplate-ios/gitignore.template +2 -0
- package/dist/templates/har-boilerplate-ios/harness.env +1 -1
- package/dist/templates/har-boilerplate-ios/justfile +9 -10
- package/dist/templates/har-boilerplate-ios/stages.json +3 -8
- package/dist/templates/migration-prompt.md +4 -3
- package/dist/templates/plugins/custom-stage-skeleton.sh +2 -2
- package/dist/templates/plugins/gitleaks/.har/stages/secrets-scan.sh +2 -2
- package/dist/templates/plugins/gitleaks/template.manifest.json +1 -1
- package/dist/templates/plugins/kerno/.github/workflows/kerno.yml +1 -1
- package/dist/templates/plugins/kerno/.har/stages/KERNO.md +2 -2
- package/dist/templates/plugins/kerno/.har/stages/backend-validation.sh +3 -3
- package/dist/templates/plugins/kerno/README.md +2 -2
- package/dist/templates/plugins/kerno/template.manifest.json +1 -1
- package/dist/templates/plugins/playwright/.har/stages/PLAYWRIGHT.md +2 -2
- package/dist/templates/plugins/playwright/.har/stages/browser-e2e.sh +3 -3
- package/dist/templates/plugins/playwright/README.md +1 -1
- package/dist/templates/plugins/playwright/playwright.config.js +2 -2
- package/dist/templates/plugins/playwright/template.manifest.json +1 -1
- package/dist/templates/plugins/rocketsim/.har/stages/ROCKETSIM.md +1 -1
- package/dist/templates/plugins/rocketsim/.har/stages/rocketsim-flows.sh +3 -3
- package/dist/templates/plugins/rocketsim/README.md +1 -1
- package/dist/templates/plugins/rocketsim/flows/example-smoke.sh +1 -1
- package/dist/templates/plugins/rocketsim/template.manifest.json +1 -1
- package/dist/templates/plugins/semgrep/.har/stages/SEMGREP.md +1 -1
- package/dist/templates/plugins/semgrep/.har/stages/sast.sh +3 -3
- package/dist/templates/plugins/semgrep/README.md +2 -2
- package/dist/templates/plugins/semgrep/template.manifest.json +1 -1
- package/dist/templates/plugins/trivy/.har/stages/TRIVY.md +1 -1
- package/dist/templates/plugins/trivy/.har/stages/vuln-scan.sh +3 -3
- package/dist/templates/plugins/trivy/template.manifest.json +1 -1
- package/dist/templates/profiles/cli/docs/{claude-agent → readme}/definition-of-done.md +3 -3
- package/dist/templates/profiles/cli/docs/{claude-agent → readme}/do-not.md +1 -1
- package/dist/templates/profiles/cli/docs/{claude-agent → readme}/environment.md +3 -3
- package/dist/templates/profiles/cli/docs/readme/for-coding-agents.md +5 -7
- package/dist/templates/profiles/cli/docs/readme/port-shared-services-cli-profile.md +3 -3
- package/dist/templates/profiles/cli/docs/readme/quick-start.md +2 -9
- package/dist/templates/profiles/cli/docs/readme/verification-contract.md +5 -5
- package/dist/templates/profiles/cli/docs/readme/what-s-in-here.md +2 -3
- package/dist/templates/profiles/cli/profile.manifest.json +14 -11
- package/dist/templates/profiles/default/docs/readme/architecture.md +1 -1
- package/dist/templates/profiles/default/docs/{claude-agent → readme}/definition-of-done.md +3 -3
- package/dist/templates/profiles/default/docs/{claude-agent → readme}/do-not.md +2 -2
- package/dist/templates/profiles/default/docs/readme/environment.md +19 -0
- package/dist/templates/profiles/default/docs/readme/for-coding-agents.md +4 -6
- package/dist/templates/profiles/default/docs/readme/port-shared-services.md +5 -5
- package/dist/templates/profiles/default/docs/readme/quick-start.md +2 -9
- package/dist/templates/profiles/default/docs/readme/readiness-layers.md +4 -4
- package/dist/templates/profiles/default/docs/{claude-agent → readme}/readiness.md +1 -1
- package/dist/templates/profiles/default/docs/readme/verification-contract.md +4 -4
- package/dist/templates/profiles/default/docs/readme/what-s-in-here.md +2 -3
- package/dist/templates/profiles/default/profile.manifest.json +21 -13
- package/dist/templates/profiles/ios/docs/{claude-agent → readme}/definition-of-done.md +3 -3
- package/dist/templates/profiles/ios/docs/{claude-agent → readme}/do-not.md +1 -1
- package/dist/templates/profiles/ios/docs/{claude-agent → readme}/environment.md +4 -4
- package/dist/templates/profiles/ios/docs/readme/port-shared-services-ios-profile.md +3 -3
- package/dist/templates/profiles/ios/docs/{claude-agent → readme}/project-commands.md +4 -4
- package/dist/templates/profiles/ios/docs/readme/quick-start.md +2 -9
- package/dist/templates/profiles/ios/docs/readme/simulators.md +2 -2
- package/dist/templates/profiles/ios/docs/{claude-agent → readme}/user-flow-validation-rocketsim.md +2 -2
- package/dist/templates/profiles/ios/docs/readme/verification-contract.md +1 -1
- package/dist/templates/profiles/ios/docs/readme/what-s-in-here.md +2 -3
- package/dist/templates/profiles/ios/profile.manifest.json +15 -12
- package/dist/templates/runtime-bundles/shared-kernel/STAGES.md +1 -1
- package/dist/templates/runtime-bundles/shared-kernel/lib/verify-runner.mjs +1 -1
- package/dist/templates/shared-docs/readme/maintaining-this-harness.md +3 -3
- package/package.json +2 -1
- package/dist/prompts/system-authoring.md +0 -155
- package/dist/templates/profiles/default/docs/claude-agent/environment.md +0 -19
- package/dist/templates/profiles/ios/docs/claude-agent/intro.md +0 -3
- package/dist/templates/runtime-bundles/pm2-runtime/attach.sh +0 -15
- package/dist/templates/runtime-bundles/shared-kernel/agent-cli.sh +0 -35
- package/dist/templates/runtime-bundles/shared-kernel/launch.sh +0 -35
- package/dist/templates/runtime-bundles/shared-kernel/preflight.sh +0 -35
- package/dist/templates/runtime-bundles/shared-kernel/setup-infra.sh +0 -35
- package/dist/templates/runtime-bundles/shared-kernel/teardown.sh +0 -35
- package/dist/templates/runtime-bundles/shared-kernel/verify.sh +0 -35
- package/dist/templates/shared-docs/claude-agent/intro.md +0 -3
- /package/dist/templates/profiles/cli/docs/{claude-agent → readme}/project-commands.md +0 -0
- /package/dist/templates/profiles/cli/docs/{claude-agent → readme}/readiness.md +0 -0
- /package/dist/templates/profiles/default/docs/{claude-agent → readme}/project-commands.md +0 -0
- /package/dist/templates/profiles/ios/docs/{claude-agent → readme}/readiness.md +0 -0
|
@@ -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
|
|
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
|
-
|
|
8
|
+
har env setup-infra --repo {{repo}}
|
|
7
9
|
|
|
8
10
|
launch id:
|
|
9
|
-
|
|
11
|
+
har env launch {{id}} --repo {{repo}}
|
|
10
12
|
|
|
11
13
|
teardown id:
|
|
12
|
-
|
|
14
|
+
har env teardown {{id}} --repo {{repo}}
|
|
13
15
|
|
|
14
16
|
verify id:
|
|
15
|
-
|
|
17
|
+
har env verify {{id}} --repo {{repo}}
|
|
16
18
|
|
|
17
19
|
verify-full id:
|
|
18
|
-
|
|
20
|
+
har env verify {{id}} --full --repo {{repo}}
|
|
19
21
|
|
|
20
22
|
status:
|
|
21
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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`
|
|
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
|
|
|
@@ -50,5 +50,6 @@ Record the migration and clean up the migration artifacts (`.har/migrate/`, this
|
|
|
50
50
|
1. Never edit `.har/manifest.json` by hand — it is managed by the har CLI.
|
|
51
51
|
2. Do not delete `.har/migrate/backup/` until finalize — it is the only copy of the pre-1.0 adaptations.
|
|
52
52
|
3. Keep `stages.json` stage ids stable — run records and Mission Control reference them.
|
|
53
|
-
4. Update `.har/README.md`
|
|
53
|
+
4. Update `.har/README.md` if commands or workflow notes changed — 1.0 does not
|
|
54
|
+
generate `.har/CLAUDE.agent.md`; its content belongs there.
|
|
54
55
|
5. Commit the migrated harness (shims, `harness.env`, `stages.json`, `.har/hooks/`) once verified — `.har/migrate/` and this prompt are transient and stay untracked.
|
|
@@ -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
|
|
30
|
-
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run
|
|
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
|
|
52
|
-
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run
|
|
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
|
-
"
|
|
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:
|
|
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
|
|
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
|
-
|
|
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:
|
|
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
|
|
80
|
-
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
"
|
|
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
|
|
13
|
+
After `har env launch <id>`:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
./.har/stages/browser-e2e.sh <id>
|
|
17
17
|
# included in:
|
|
18
|
-
|
|
18
|
+
har env verify <id> --full
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Adapt selectors and paths in the scaffold specs during harness adaptation.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Outputs JSON to stdout, human-readable progress to stderr.
|
|
4
4
|
#
|
|
5
5
|
# Usage: ./.har/stages/browser-e2e.sh <agent-id>
|
|
6
|
-
# Prerequisite:
|
|
6
|
+
# Prerequisite: har env launch <agent-id>
|
|
7
7
|
set -euo pipefail
|
|
8
8
|
|
|
9
9
|
# 1.0 stage surface: the runner exports WORK_DIR, ENV_FILE, AGENT_ID and
|
|
@@ -17,8 +17,8 @@ now_ms() { node -e 'process.stdout.write(String(Date.now()))'; }
|
|
|
17
17
|
|
|
18
18
|
log() { echo "==> [browser-e2e agent-$AGENT_ID] $*" >&2; }
|
|
19
19
|
|
|
20
|
-
ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run
|
|
21
|
-
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run
|
|
20
|
+
ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
|
|
21
|
+
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
|
|
22
22
|
FE_PORT="${FE_PORT:-$(( HARNESS_FE_BASE_PORT + AGENT_ID * 10 ))}"
|
|
23
23
|
API_PORT="${API_PORT:-$(( HARNESS_API_BASE_PORT + AGENT_ID * 10 ))}"
|
|
24
24
|
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
// -------------------
|
|
5
5
|
// - Stage id: `browser-e2e` (`.har/stages/browser-e2e.sh`, registered in `stages.json`).
|
|
6
6
|
// - Runs automatically on FULL verify only — not on quick verify:
|
|
7
|
-
//
|
|
7
|
+
// har env verify <id> --full
|
|
8
8
|
// har env verify <id> --full
|
|
9
9
|
// har env complete <id> # always full; required before declaring done
|
|
10
10
|
// - Quick verify (`verify.sh <id>`) stops at typecheck / unit tests / api-health.
|
|
11
11
|
//
|
|
12
12
|
// Prerequisites
|
|
13
13
|
// -------------
|
|
14
|
-
// 1. Launch a slot first:
|
|
14
|
+
// 1. Launch a slot first: har env launch <id>
|
|
15
15
|
// 2. Install browsers once: npx playwright install chromium
|
|
16
16
|
//
|
|
17
17
|
// Environment (injected by browser-e2e.sh — never hardcode slot ports in specs)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Usage: ./.har/stages/rocketsim-flows.sh <agent-id> [flow-name]
|
|
7
7
|
# flow-name (optional): run only flows/<flow-name>.sh instead of all flows
|
|
8
8
|
#
|
|
9
|
-
# Prerequisite:
|
|
9
|
+
# Prerequisite: har env launch <agent-id> AND app installed+running on simulator
|
|
10
10
|
# See: ./.har/stages/ROCKETSIM.md for the full authoring guide.
|
|
11
11
|
set -euo pipefail
|
|
12
12
|
|
|
@@ -38,8 +38,8 @@ if ! rocketsim doctor --quiet 2>/dev/null; then
|
|
|
38
38
|
fi
|
|
39
39
|
|
|
40
40
|
# ── Resolve agent env ─────────────────────────────────────────────────────────
|
|
41
|
-
ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run
|
|
42
|
-
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run
|
|
41
|
+
ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
|
|
42
|
+
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
|
|
43
43
|
|
|
44
44
|
# ── Discover flows ─────────────────────────────────────────────────────────────
|
|
45
45
|
FLOWS_DIR="$WORK_DIR/flows"
|
|
@@ -20,7 +20,7 @@ log() { echo "==> [example-smoke] $*" >&2; }
|
|
|
20
20
|
log "Checking simulator focus..."
|
|
21
21
|
FOCUSED=$(rocketsim simulator focused 2>/dev/null || echo "")
|
|
22
22
|
if [ -z "$FOCUSED" ]; then
|
|
23
|
-
log "✗ No focused simulator — run
|
|
23
|
+
log "✗ No focused simulator — run har env setup-infra first"
|
|
24
24
|
exit 1
|
|
25
25
|
fi
|
|
26
26
|
log "Simulator: $(echo "$FOCUSED" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const j=JSON.parse(d);process.stdout.write(j.name||d.trim());}catch{process.stdout.write(d.trim());}})" 2>/dev/null || echo "$FOCUSED")"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
],
|
|
42
42
|
"nextSteps": [
|
|
43
43
|
"rocketsim doctor",
|
|
44
|
-
"
|
|
44
|
+
"har env launch 1",
|
|
45
45
|
"Build and install your app on the simulator",
|
|
46
46
|
"./.har/stages/rocketsim-flows.sh 1",
|
|
47
47
|
"Open .har/artifacts/rocketsim-flows/ for screenshots and per-flow results",
|
|
@@ -14,7 +14,7 @@ runs it automatically once it is listed in `verificationStages`.
|
|
|
14
14
|
./.har/stages/sast.sh 1 src/ lib/auth.py
|
|
15
15
|
|
|
16
16
|
# Included in full verify
|
|
17
|
-
|
|
17
|
+
har env verify 1 --full
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Reports land under `.har/artifacts/sast/` in the **main repo root** (not the worktree):
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# .har/harness.env to pin rulesets. Registry configs (auto, p/...) need
|
|
12
12
|
# network access and send pseudonymized metrics to semgrep.dev.
|
|
13
13
|
#
|
|
14
|
-
# Prerequisite:
|
|
14
|
+
# Prerequisite: har env launch <agent-id> AND the semgrep CLI installed
|
|
15
15
|
# See: ./.har/stages/SEMGREP.md for the full adaptation guide.
|
|
16
16
|
set -euo pipefail
|
|
17
17
|
|
|
@@ -44,8 +44,8 @@ fi
|
|
|
44
44
|
# Artifacts land in the main repo root (where .har/ lives), not the worktree.
|
|
45
45
|
MAIN_REPO_ROOT="$REPO_ROOT"
|
|
46
46
|
|
|
47
|
-
ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run
|
|
48
|
-
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run
|
|
47
|
+
ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
|
|
48
|
+
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
|
|
49
49
|
|
|
50
50
|
# ── Artifact directory (main repo root, not the worktree) ─────────────────────
|
|
51
51
|
ARTIFACT_DIR="$MAIN_REPO_ROOT/.har/artifacts/sast"
|
|
@@ -50,8 +50,8 @@ evidence. See `.har/stages/SEMGREP.md` for the full story.
|
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
pipx install semgrep
|
|
53
|
-
|
|
53
|
+
har env launch 1
|
|
54
54
|
./.har/stages/sast.sh 1
|
|
55
55
|
# reports: .har/artifacts/sast/semgrep.json (+ .sarif, scan.log)
|
|
56
|
-
|
|
56
|
+
har env verify 1 --full
|
|
57
57
|
```
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
],
|
|
44
44
|
"nextSteps": [
|
|
45
45
|
"pipx install semgrep # or: pip install semgrep / brew install semgrep",
|
|
46
|
-
"
|
|
46
|
+
"har env launch 1",
|
|
47
47
|
"./.har/stages/sast.sh 1",
|
|
48
48
|
"Open .har/artifacts/sast/ for the JSON and SARIF reports",
|
|
49
49
|
"Read .har/stages/SEMGREP.md to pin rulesets (HARNESS_SEMGREP_CONFIG) or add local rules",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# TRIVY_CACHE_DIR vulnerability DB cache (default: ~/.cache/trivy —
|
|
13
13
|
# shared across slots so the DB downloads once)
|
|
14
14
|
#
|
|
15
|
-
# Prerequisite:
|
|
15
|
+
# Prerequisite: har env launch <agent-id>
|
|
16
16
|
# See: ./.har/stages/TRIVY.md for the full adaptation guide.
|
|
17
17
|
set -euo pipefail
|
|
18
18
|
|
|
@@ -39,8 +39,8 @@ if ! command -v trivy >/dev/null 2>&1; then
|
|
|
39
39
|
fi
|
|
40
40
|
|
|
41
41
|
# ── Resolve agent env ─────────────────────────────────────────────────────────
|
|
42
|
-
ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run
|
|
43
|
-
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run
|
|
42
|
+
ENV_FILE="${ENV_FILE:?No slot env for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
|
|
43
|
+
WORK_DIR="${WORK_DIR:?No slot work dir for agent ${AGENT_ID} — run har env launch ${AGENT_ID} first}"
|
|
44
44
|
|
|
45
45
|
# ── Configuration ─────────────────────────────────────────────────────────────
|
|
46
46
|
SEVERITY="${HARNESS_TRIVY_SEVERITY:-HIGH,CRITICAL}"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
],
|
|
48
48
|
"nextSteps": [
|
|
49
49
|
"Install trivy: brew install trivy (or https://trivy.dev/latest/getting-started/installation/)",
|
|
50
|
-
"
|
|
50
|
+
"har env launch 1",
|
|
51
51
|
"./.har/stages/vuln-scan.sh 1",
|
|
52
52
|
"Open .har/artifacts/vuln-scan/summary.txt for findings",
|
|
53
53
|
"Tune HARNESS_TRIVY_SEVERITY / HARNESS_TRIVY_SCANNERS in .har/harness.env — read .har/stages/TRIVY.md"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
## Definition of done
|
|
2
2
|
|
|
3
|
-
- [ ] Full verification returns `"status": "pass"` (`har env verify
|
|
3
|
+
- [ ] Full verification returns `"status": "pass"` (`har env verify <id> --full`, MCP `har_run_verification` with `full: true`, or `har env verify <id> --full`)
|
|
4
4
|
- [ ] The slot is agent-usable for this repo's documented smoke workflow when runtime services are involved
|
|
5
5
|
- [ ] Full verify runs every registered stage in `stages.json` `verificationStages` (Playwright, custom checks, …) — when `stages/browser-e2e.sh` exists, adapt specs under `tests/` for UI changes
|
|
6
6
|
- [ ] New behavior has automated test coverage
|
|
7
7
|
- [ ] Changes committed **in the session worktree** with a clear message
|
|
8
8
|
- [ ] Present session handoff (summary, branch, preview URLs) and **wait for user** before `complete`, push, or PR
|
|
9
|
-
- [ ] On user approval of the default: push + open PR (when `gh`/GitHub MCP available), then `har env complete
|
|
9
|
+
- [ ] On user approval of the default: push + open PR (when `gh`/GitHub MCP available), then `har env complete <id>` (or MCP `har_complete_environment`) — full verify + validation + teardown, branch kept
|
|
10
10
|
|
|
11
11
|
### Session handoff
|
|
12
12
|
|
|
@@ -18,6 +18,6 @@ else as alternatives. If PR tooling is unavailable, recommend complete and repor
|
|
|
18
18
|
the session branch for a manual push. Prefer `complete` over bare `teardown` when
|
|
19
19
|
the work succeeded. See `.cursor/rules/har-workflow.mdc` for the handoff shape.
|
|
20
20
|
|
|
21
|
-
Quick loop: MCP `har_run_verification`, `har env verify
|
|
21
|
+
Quick loop: MCP `har_run_verification`, `har env verify <id>`, or `har env verify <id>`
|
|
22
22
|
|
|
23
23
|
Stages are the harness's single vocabulary for checks: templates and custom stages compile to generic kinds in `.har/stages.json`, and you interact with them only through the registry (`har_run_stage`, `verify`), never stack-specific tooling. Authoring guide: `.har/STAGES.md`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Do not
|
|
2
2
|
|
|
3
3
|
- Work around a failing harness command with ad-hoc setup — fix the harness or report the failure
|
|
4
|
-
- Edit `.env.agent
|
|
4
|
+
- Edit `.env.agent.<id>` by hand
|
|
5
5
|
- Run `verify` before `launch` when e2e needs a running server
|
|
6
6
|
- Edit the main checkout — all edits go under the session work dir
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
| | |
|
|
4
4
|
|--|--|
|
|
5
|
-
| **Agent ID** |
|
|
6
|
-
| **Work dir** | Fresh session worktree per launch — see the launch output or `.har/slots/agent
|
|
5
|
+
| **Agent ID** | <id> |
|
|
6
|
+
| **Work dir** | Fresh session worktree per launch — see the launch output or `.har/slots/agent-<id>.json` |
|
|
7
7
|
|
|
8
8
|
**Never edit the main checkout** — launch FIRST, then make ALL file edits under the work dir from the launch output. An occupied slot always blocks a new launch — run `har env teardown <id>` (or `complete <id>`) first, then launch again.
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
|
|
11
|
+
har env agent <id> status
|
|
12
12
|
```
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
## For coding agents
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
When the project needs Postgres, Redis, or similar, add the service to `docker-compose.agent.yml` (or keep one from the menu), list it in `HARNESS_INFRA_SERVICES` in `harness.env`, and use `setup-infra.sh` — never run raw `docker compose` for shared infra. Shared services run once on fixed ports and serve every agent slot.
|
|
3
|
+
1. Read repo [`AGENTS.md`](../AGENTS.md)
|
|
4
|
+
2. Read this file and `stages.json` — this file is the harness reference:
|
|
5
|
+
slot environment, readiness, definition of done, project commands
|
|
6
|
+
3. Drive the harness with HAR MCP tools or `har env …`; never hardcode ports —
|
|
7
|
+
ask `har env agent <id> url`
|
|
@@ -9,17 +9,17 @@ This profile has **no PM2 app ports** — agents run project commands directly i
|
|
|
9
9
|
| Shared Postgres | Per machine | `HARNESS_DB_PORT_DEFAULT` | Scan `HARNESS_DB_PORT_SCAN_START..END` |
|
|
10
10
|
| Other compose services | Per machine | `HARNESS_*_PORT_DEFAULT` for that service | Scan configured ranges in `harness.env` |
|
|
11
11
|
|
|
12
|
-
When a repo adds a local HTTP server for integration tests, prefer reading ports from `.env.agent.<id>` or
|
|
12
|
+
When a repo adds a local HTTP server for integration tests, prefer reading ports from `.env.agent.<id>` or `har env agent <id>` rather than hardcoding values.
|
|
13
13
|
|
|
14
14
|
### Shared vs per-slot
|
|
15
15
|
|
|
16
16
|
| Resource | Model | Configuration |
|
|
17
17
|
|----------|-------|---------------|
|
|
18
18
|
| Postgres / Redis / mail / … | One shared container on a scanned host port | `HARNESS_INFRA_SERVICES` + matching vars in `harness.env` |
|
|
19
|
-
| Per-slot databases | Cloned from template DB when `db` is enabled | `launch
|
|
19
|
+
| Per-slot databases | Cloned from template DB when `db` is enabled | `har env launch` |
|
|
20
20
|
| Application code | Isolated git worktree per slot | `HARNESS_USE_WORKTREE=true` |
|
|
21
21
|
|
|
22
22
|
### Do not
|
|
23
23
|
|
|
24
24
|
- Hardcode `15432` or other default infra ports in tests — read `AGENT_DB_PORT` from `.env.agent.<id>` or `har_pg`
|
|
25
|
-
- Run raw `docker compose` for harness infrastructure — use `setup-infra
|
|
25
|
+
- Run raw `docker compose` for harness infrastructure — use `har env setup-infra`
|