repo-harness 0.29.2 → 0.30.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/AGENTS.md +2 -2
- package/CLAUDE.md +2 -2
- package/README.md +1 -1
- package/assets/reference-configs/agentic-development-flow.md +1 -1
- package/assets/reference-configs/global-working-rules.md +7 -1
- package/assets/reference-configs/herdr-notify.md +1 -1
- package/assets/reference-configs/release-deploy.md +89 -29
- package/assets/skill-commands/manifest.json +57 -0
- package/assets/skill-version.json +2 -2
- package/assets/skills/repo-harness-advisor/SKILL.md +77 -0
- package/assets/skills/repo-harness-archimap/SKILL.md +4 -2
- package/assets/skills/repo-harness-archimap/references/visual-language.md +21 -0
- package/assets/skills/repo-harness-archimap/scripts/measure.ts +215 -0
- package/assets/skills/repo-harness-issue-flow/references/board.md +5 -3
- package/assets/skills/repo-harness-issue-flow/references/orchestrator.md +21 -4
- package/assets/skills/repo-harness-issue-flow/references/templates.md +9 -6
- package/assets/skills/repo-harness-orchestrator/SKILL.md +61 -0
- package/assets/skills/repo-harness-seat-handoff/SKILL.md +25 -0
- package/assets/skills/repo-harness-test/references/verification-plan.md +1 -1
- package/assets/templates/helpers/capability-resolver.ts +228 -28
- package/dist/hook-entry.js +149 -16
- package/dist/oar-review-host.js +139 -9
- package/package.json +1 -1
- package/scripts/ci-documentation-consumers.ts +1 -1
- package/scripts/release-owner-steps.sh +44 -11
- package/scripts/replay-ci-coverage.ts +2 -1
- package/scripts/report-ci.ts +6 -5
- package/scripts/select-ci-coverage.ts +9 -16
- package/src/cli/commands/global-runtime.ts +2 -1
- package/src/cli/commands/publication.ts +4 -2
- package/src/cli/commands/review.ts +2 -1
- package/src/cli/commands/seats.ts +52 -4
- package/src/cli/hook/handler-registry.ts +2 -2
- package/src/cli/installer/global-context.ts +1 -0
- package/src/core/board/board.ts +20 -6
- package/src/core/board/parents.ts +52 -40
- package/src/core/board/seat-launch.ts +1 -1
- package/src/core/board/seat-reset.ts +15 -3
- package/src/core/board/source.ts +100 -27
- package/src/core/ci/documentation-path.ts +12 -0
- package/src/core/evidence/required-check-evidence.ts +4 -6
- package/src/core/operator/architecture-map.ts +2 -2
- package/src/core/publication/acceptance-merge-policy.ts +13 -4
- package/src/core/review/acceptance-receipt.ts +1 -18
- package/src/core/review/model-family.ts +17 -0
- package/src/core/review/review-publish.ts +5 -3
- package/src/effects/board/attention-watch.ts +3 -2
- package/src/effects/board/collect.ts +139 -24
- package/src/effects/board/merge-only-sync.ts +0 -2
- package/src/effects/board/parents.ts +5 -12
- package/src/effects/board/seat-reset.ts +37 -4
- package/src/effects/board/seats.ts +3 -19
- package/src/effects/evidence/verification-execution.ts +8 -29
- package/src/effects/fleet/provider-feedback.ts +2 -1
- package/src/effects/git/run-git.ts +6 -3
- package/src/effects/git/runner.ts +228 -28
- package/src/effects/operator/architecture-map-collector.ts +6 -4
- package/src/effects/operator/board-observer.ts +263 -0
- package/src/effects/operator/board-summary.ts +3 -4
- package/src/effects/operator/server.ts +36 -8
- package/src/effects/publication/merge-executor.ts +336 -44
- package/src/effects/repo-registry.ts +27 -0
- package/src/effects/review/diff-fingerprint.ts +0 -153
- package/src/effects/review/review-publish.ts +38 -4
- package/src/effects/state/coordination-worktree-topology.ts +3 -2
- package/src/effects/terminal/herdr-core.ts +28 -16
package/AGENTS.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Workflow
|
|
4
4
|
- Multi-agent work follows `repo-harness-issue-flow` (`assets/skills/repo-harness-issue-flow/SKILL.md`): roles, claims, handoff, dispatch, acceptance and merge.
|
|
5
5
|
- `docs/architecture/archimap.html` is the single architecture entry. It links each module to its archctx-projected capability doc in `docs/architecture/modules/`. Change boundaries only through `repo-harness-architecture`; do not hand-write other architecture docs.
|
|
6
|
-
- The owner keeps every security decision (owner, 2026-11-09, #2008): credentials, tokens and secrets, and each change that reads, moves or exposes them; permissions (seat tool grants, network access, sandbox settings, hooks, confirmation bypass); the safety net (branch protection, `publication.acceptance_merge`, force push to main, the `Required / CI` definition); deletion that git cannot restore (unpushed commits, dirty worktrees, owner files outside a repository such as `~/.repo-harness`, `~/.claude` or `~/.codex` without a backup); and production: `
|
|
6
|
+
- The owner keeps every security decision (owner, 2026-11-09, #2008): credentials, tokens and secrets, and each change that reads, moves or exposes them; permissions (seat tool grants, network access, sandbox settings, hooks (changes to hook behavior or hook configuration; a change under `src/cli/hook/**` that changes neither takes the High review rule: two PASS rows, one different-family), confirmation bypass); the safety net (branch protection, `publication.acceptance_merge`, force push to main, the `Required / CI` definition); deletion that git cannot restore (unpushed commits, dirty worktrees, owner files outside a repository such as `~/.repo-harness`, `~/.claude` or `~/.codex` without a backup); and production: the owner's approval of the `release` environment run of `release.yml` (it publishes to npm), the release tag, the GitHub Release and each production deployment. A production deployment needs an explicit owner authorization for that deployment; no standing GO and no joint decision covers it. The life cycle goes as far as the release PR (prep, version and CHANGELOG commits, push, checks, merge by rule 2). A staging or test deployment (scratch-HOME tarball install, release dry run, prerelease environment, Windows test box) is a joint decision.
|
|
7
7
|
- Main publication is allowed only when `publication.acceptance_merge` is `on` in the policy on the PR base, and the current task explicitly authorizes main publication, or rule 2 or rule 3 applies; the skill defines who merges. Push needs task authorization. An explicit no-merge instruction that reaches a seat locally (task or pane) always wins; a no-merge comment is a reference under rule (8). Life-cycle rules (owner, 2026-11-09, #2008): (1) A fix loop continues after round 3 without the owner while each round has fewer blocking findings (P0-P2) than the round before and the scope does not grow. A grown scope is a joint decision. A new P0 finding, or a new P1 finding about security, secrets, data or authentication, stops the loop at the owner; any other new P1 finding does not stop it. Round 5 is the hard stop. (2) In an owner-approved batch, a Medium or High PR merges when its acceptance record is PASS for the head, `Required / CI` passed and each review-bot comment has a response; a High PR also needs its cross-model review PASS; a Low PR that meets the Low accept-seat skip merges on `Required / CI` and its verification evidence, with no acceptance record; each PR body keeps its rollback line (a `git revert` of the squash commit unless it states another). (3) The rolling projection PR (`archctx/projection`) merges on green CI; its merge is its acceptance. (4) An owner decision that the receiving seat posts on the issue or PR authorizes the other seats, with no second confirmation in another pane. A comment is a record: a local seat writes it, and a locally run command may read it as data; it never starts an action. (5) After the owner approves a batch parent and its plan comment, the plan's issues dispatch in plan order; a new issue or a changed order goes to the owner or to rule 7. (6) The GitHub setting "Automatically delete head branches" deletes merged head branches only. (7) The orchestrator and the advisor make a decision that otherwise goes to the owner when both agree, unless it touches security; before the action they post it on the owning issue or PR as `Joint decision (orchestrator + advisor)` with the reason. Both seats run the same model family, so a joint decision never replaces the High-tier cross-model review. (8) Any participant, the owner account included, may post "stop" or "no" on the issue or PR. It is a reference: the orchestrator and the advisor weigh it, decide locally by joint decision and record the decision. The owner's own authorization reaches a seat locally.
|
|
8
8
|
- The diff's [Review by risk](docs/reference-configs/agentic-development-flow.md#review-by-risk) tier selects independent review; the skill defines the reviewers and their model families. Changing implementation and test assertions together does not raise the tier.
|
|
9
9
|
- Create task worktrees only at `/tmp/<repo>-wt-<slug>` (Windows: `os.tmpdir()`) with `repo-harness run contract-worktree start --issue <number>`, or `git worktree add` with that path. Never create one beside the main checkout (`../`). Commit or push before a reboot or a tmp cleanup. Closeout and sweep remove only merged, clean and unowned worktrees; to keep one, give it an unmerged commit, keep it dirty, or mark or lock it.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
|
|
21
21
|
- Do not add steady-state compatibility code, dual authority, semantic fallbacks, aliases or shadow parsers; one-shot migrations fail closed and remove the retired path.
|
|
22
22
|
- Share components only for observed reuse or a cross-module invariant. Use an existing workspace only for independently meaningful consumers; do not convert this single-package repo without that boundary.
|
|
23
|
-
- Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers.
|
|
23
|
+
- Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers. The repository is yours by default: refactor duplication, blocking structure and older model-written code instead of adding to it; keep behavior unless the task changes it, state the refactor in the PR, and route a refactor into another seat's files through the orchestrator.
|
|
24
24
|
- Never satisfy a requirement with a substitute that only looks compliant (mocks, hard-coded values, images posing as the real thing); say what cannot be done and flag the deviation in the PR.
|
|
25
25
|
- Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
|
|
26
26
|
|
package/CLAUDE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Workflow
|
|
4
4
|
- Multi-agent work follows `repo-harness-issue-flow` (`assets/skills/repo-harness-issue-flow/SKILL.md`): roles, claims, handoff, dispatch, acceptance and merge.
|
|
5
5
|
- `docs/architecture/archimap.html` is the single architecture entry. It links each module to its archctx-projected capability doc in `docs/architecture/modules/`. Change boundaries only through `repo-harness-architecture`; do not hand-write other architecture docs.
|
|
6
|
-
- The owner keeps every security decision (owner, 2026-11-09, #2008): credentials, tokens and secrets, and each change that reads, moves or exposes them; permissions (seat tool grants, network access, sandbox settings, hooks, confirmation bypass); the safety net (branch protection, `publication.acceptance_merge`, force push to main, the `Required / CI` definition); deletion that git cannot restore (unpushed commits, dirty worktrees, owner files outside a repository such as `~/.repo-harness`, `~/.claude` or `~/.codex` without a backup); and production: `
|
|
6
|
+
- The owner keeps every security decision (owner, 2026-11-09, #2008): credentials, tokens and secrets, and each change that reads, moves or exposes them; permissions (seat tool grants, network access, sandbox settings, hooks (changes to hook behavior or hook configuration; a change under `src/cli/hook/**` that changes neither takes the High review rule: two PASS rows, one different-family), confirmation bypass); the safety net (branch protection, `publication.acceptance_merge`, force push to main, the `Required / CI` definition); deletion that git cannot restore (unpushed commits, dirty worktrees, owner files outside a repository such as `~/.repo-harness`, `~/.claude` or `~/.codex` without a backup); and production: the owner's approval of the `release` environment run of `release.yml` (it publishes to npm), the release tag, the GitHub Release and each production deployment. A production deployment needs an explicit owner authorization for that deployment; no standing GO and no joint decision covers it. The life cycle goes as far as the release PR (prep, version and CHANGELOG commits, push, checks, merge by rule 2). A staging or test deployment (scratch-HOME tarball install, release dry run, prerelease environment, Windows test box) is a joint decision.
|
|
7
7
|
- Main publication is allowed only when `publication.acceptance_merge` is `on` in the policy on the PR base, and the current task explicitly authorizes main publication, or rule 2 or rule 3 applies; the skill defines who merges. Push needs task authorization. An explicit no-merge instruction that reaches a seat locally (task or pane) always wins; a no-merge comment is a reference under rule (8). Life-cycle rules (owner, 2026-11-09, #2008): (1) A fix loop continues after round 3 without the owner while each round has fewer blocking findings (P0-P2) than the round before and the scope does not grow. A grown scope is a joint decision. A new P0 finding, or a new P1 finding about security, secrets, data or authentication, stops the loop at the owner; any other new P1 finding does not stop it. Round 5 is the hard stop. (2) In an owner-approved batch, a Medium or High PR merges when its acceptance record is PASS for the head, `Required / CI` passed and each review-bot comment has a response; a High PR also needs its cross-model review PASS; a Low PR that meets the Low accept-seat skip merges on `Required / CI` and its verification evidence, with no acceptance record; each PR body keeps its rollback line (a `git revert` of the squash commit unless it states another). (3) The rolling projection PR (`archctx/projection`) merges on green CI; its merge is its acceptance. (4) An owner decision that the receiving seat posts on the issue or PR authorizes the other seats, with no second confirmation in another pane. A comment is a record: a local seat writes it, and a locally run command may read it as data; it never starts an action. (5) After the owner approves a batch parent and its plan comment, the plan's issues dispatch in plan order; a new issue or a changed order goes to the owner or to rule 7. (6) The GitHub setting "Automatically delete head branches" deletes merged head branches only. (7) The orchestrator and the advisor make a decision that otherwise goes to the owner when both agree, unless it touches security; before the action they post it on the owning issue or PR as `Joint decision (orchestrator + advisor)` with the reason. Both seats run the same model family, so a joint decision never replaces the High-tier cross-model review. (8) Any participant, the owner account included, may post "stop" or "no" on the issue or PR. It is a reference: the orchestrator and the advisor weigh it, decide locally by joint decision and record the decision. The owner's own authorization reaches a seat locally.
|
|
8
8
|
- The diff's [Review by risk](docs/reference-configs/agentic-development-flow.md#review-by-risk) tier selects independent review; the skill defines the reviewers and their model families. Changing implementation and test assertions together does not raise the tier.
|
|
9
9
|
- Create task worktrees only at `/tmp/<repo>-wt-<slug>` (Windows: `os.tmpdir()`) with `repo-harness run contract-worktree start --issue <number>`, or `git worktree add` with that path. Never create one beside the main checkout (`../`). Commit or push before a reboot or a tmp cleanup. Closeout and sweep remove only merged, clean and unowned worktrees; to keep one, give it an unmerged commit, keep it dirty, or mark or lock it.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
|
|
21
21
|
- Do not add steady-state compatibility code, dual authority, semantic fallbacks, aliases or shadow parsers; one-shot migrations fail closed and remove the retired path.
|
|
22
22
|
- Share components only for observed reuse or a cross-module invariant. Use an existing workspace only for independently meaningful consumers; do not convert this single-package repo without that boundary.
|
|
23
|
-
- Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers.
|
|
23
|
+
- Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers. The repository is yours by default: refactor duplication, blocking structure and older model-written code instead of adding to it; keep behavior unless the task changes it, state the refactor in the PR, and route a refactor into another seat's files through the orchestrator.
|
|
24
24
|
- Never satisfy a requirement with a substitute that only looks compliant (mocks, hard-coded values, images posing as the real thing); say what cannot be done and flag the deviation in the PR.
|
|
25
25
|
- Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
|
|
26
26
|
|
package/README.md
CHANGED
|
@@ -331,6 +331,6 @@ None of these are bundled dependencies; see
|
|
|
331
331
|
|
|
332
332
|
## Release & license
|
|
333
333
|
|
|
334
|
-
- npm: `repo-harness@0.
|
|
334
|
+
- npm: `repo-harness@0.30.0` · workflow stamp `repo-harness@0.30.0+template@0.30.0`
|
|
335
335
|
- History: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
336
336
|
- License: MIT — see [`LICENSE`](LICENSE)
|
|
@@ -19,7 +19,7 @@ Size PR CI by the diff, the same as step 4. A full suite on each small PR spends
|
|
|
19
19
|
- Triggers: run PR checks on `pull_request`. Do not also trigger `push` on feature branches; that runs each commit twice. A `push` to the default branch runs only the selection job in report mode, with no tests.
|
|
20
20
|
- Superseded runs: set `concurrency` to one group per PR number with `cancel-in-progress: true` for `pull_request` events only. Do not cancel scheduled runs.
|
|
21
21
|
- Selection: a first job reads the diff against the PR base and outputs a mode. Later jobs read the mode in a job-level `if:`.
|
|
22
|
-
- A docs-only diff runs only the tests that name a changed document, including a deleted one. With no such test, it skips build and test jobs, and the required aggregate check still reports. One function names the documentation paths; in the repo-harness source repository it is `isDocumentationPath` in `
|
|
22
|
+
- A docs-only diff runs only the tests that name a changed document, including a deleted one. With no such test, it skips build and test jobs, and the required aggregate check still reports. One function names the documentation paths; in the repo-harness source repository it is `isDocumentationPath` in `src/core/ci/documentation-path.ts`. Keep link, format and advisory document checks. A document that is program input, such as a projected copy, a parsed contract or a generated region, is outside the documentation rule or has a test that names it, so a change to it runs its consumer tests.
|
|
23
23
|
- A code diff runs typecheck plus the tests that the diff affects. Use the runner's change detection (`vitest --changed`, `jest --changedSince`, `nx affected`, `turbo run --filter=...[<base>]`, `pytest --testmon`) or an import-graph selector.
|
|
24
24
|
- A change to a shared input (lockfile, root build or test config, CI workflow, a test helper with no mapped consumer) runs the full suite on that PR. A selector that cannot map a changed file widens the run; it never shrinks it.
|
|
25
25
|
- Required checks: skip a job with a job-level `if:`, not with workflow-level `paths` or `paths-ignore`. GitHub counts a skipped job as passing for a required check. A workflow that never starts leaves its required check pending and blocks the merge.
|
|
@@ -20,7 +20,7 @@ Generality: These are general working rules. Do not tailor behavior to any speci
|
|
|
20
20
|
- Address status questions, cost concerns, and redirection before resuming prior work.
|
|
21
21
|
- Before a step expected to exceed 10 minutes, state its expected cost and necessity. Reuse valid evidence after checking subject hash, fingerprint, and freshness; produce expensive final evidence once after freezing code and merging or pinning the target base.
|
|
22
22
|
- Cap fail -> fix -> reverify loops at three rounds per issue; then stop and report findings.
|
|
23
|
-
- Report
|
|
23
|
+
- Report unrelated faults (defects outside the task) without fixing them. At most one directly blocking unrelated fix is allowed per task. A second unrelated discovery is a hard stop: report and wait for instruction. Refactoring follows Code Ownership.
|
|
24
24
|
- Use the cheapest sufficient verification for trivial or mechanical tasks; preserve required checks and behavior-specific evidence.
|
|
25
25
|
|
|
26
26
|
## Progressive Due Diligence
|
|
@@ -39,6 +39,12 @@ Before non-trivial design or edits, complete P1/P2/P3:
|
|
|
39
39
|
- Validate an unknown value once, at the boundary that owns it, and pass the typed value inward. Do not check again a value that a schema, constructor or internal type already guarantees.
|
|
40
40
|
- Before you add complexity for a speculative or very unlikely race, security or failure case, or a test for it, tell the user the concrete failure mode, its likelihood and the complexity cost, and get their approval. Do not expand scope silently for theoretical robustness.
|
|
41
41
|
|
|
42
|
+
## Code Ownership
|
|
43
|
+
|
|
44
|
+
- By default, the repository is yours. You decide its shape, and you maintain it later. A repository's own rules or the user can say otherwise, for example for an upstream project that the user only contributes to.
|
|
45
|
+
- Refactor when it makes the code better: remove duplication, replace a structure that blocks the change, and rewrite older model-written code instead of adding to it. Do not copy a duplicate or add a layer on top of messy code.
|
|
46
|
+
- A refactor keeps behavior unless the task changes it, and the PR states what it refactored. In multi-seat work, a refactor that reaches files that another seat owns goes through the orchestrator first (one writer per file).
|
|
47
|
+
|
|
42
48
|
## No Compatibility Fallbacks in Product Code
|
|
43
49
|
|
|
44
50
|
- Forbid steady-state compatibility behavior: no dual authorities, dual reads/writes, aliases, shape translators, shadow parsers, or semantic fallbacks.
|
|
@@ -115,7 +115,7 @@ The pane name is `<prefix>-<role>[-<item>][-<qualifier>]`: at most 32 characters
|
|
|
115
115
|
| `item` | worker: the issue number (`--issue`) or `rel<digits>` for release prep (`--release`); reviewer: the PR number. None for `orch` and `adv` | the dispatch |
|
|
116
116
|
| `qualifier` | worker: a slice word when one issue has two live worker panes (`--qualifier`); reviewer: the review runtime id (`claude`, `codex`) | the dispatch |
|
|
117
117
|
|
|
118
|
-
- Set `panePrefix`
|
|
118
|
+
- Set `panePrefix` with `repo-harness seats prefix --repo <path> --pane-prefix <p>`. Every registry writer keeps it. The registry read refuses a malformed or duplicate prefix.
|
|
119
119
|
- `seats argv` reads the entry of the primary checkout of the current directory; a linked worktree resolves to its primary checkout. No entry, or an entry without `panePrefix`, fails with `pane_name_invalid`. A name over 32 characters fails the same way.
|
|
120
120
|
- One pane serves one item. Do not reuse a pane for another issue: close it and start a new one. Only `hc run --name` sets an hc terminal name, and hc refuses a second live terminal with that name.
|
|
121
121
|
- The name carries no state (round, status, PR state). The board reads those from GitHub and the labels.
|
|
@@ -31,35 +31,95 @@ tags, the Git version tag, and the core runtime receipt.
|
|
|
31
31
|
|
|
32
32
|
## Owner Release GO
|
|
33
33
|
|
|
34
|
-
The life cycle stops at the merged release PR.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
`
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
`
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
34
|
+
The life cycle stops at the merged release PR. One run of
|
|
35
|
+
`.github/workflows/release.yml` publishes, tags and releases the merged
|
|
36
|
+
release commit. The orchestrator seat starts it:
|
|
37
|
+
`gh workflow run release.yml -f sha=<merged release commit>`. The run name is
|
|
38
|
+
`Release <sha>`. The `publish` job waits in the `release` environment. The
|
|
39
|
+
owner step is one action: approve that run. The approval is the explicit
|
|
40
|
+
authorization for that production deployment.
|
|
41
|
+
|
|
42
|
+
A job that holds `id-token: write` or `contents: write` runs only inline
|
|
43
|
+
workflow steps and SHA-pinned actions. It checks out no code to run and runs
|
|
44
|
+
no install, repository script or package script. The steps of a job share one
|
|
45
|
+
runner and user, so a token set on one step is not safe from dependency code
|
|
46
|
+
that an earlier step of the same job ran. The run has six jobs:
|
|
47
|
+
|
|
48
|
+
1. `validate` (`contents: read`, `main` only): git and jq commands written in
|
|
49
|
+
the workflow read the SHA as data. The job refuses a SHA that is not 40 hex
|
|
50
|
+
characters or not a first-parent commit of a fresh `main`, a commit where
|
|
51
|
+
either package version is not the target version or is already the target
|
|
52
|
+
version in its first parent, and a commit with no CHANGELOG section.
|
|
53
|
+
2. `lane` (`contents: read`): checks out the SHA, runs `bun install`,
|
|
54
|
+
`bun run check:release` and
|
|
55
|
+
`bash scripts/release-owner-steps.sh workflow-guard <sha>` (a version that
|
|
56
|
+
is on npm, an existing tag or a changed checkout fails). `npm pack` packs
|
|
57
|
+
both packages; it runs the `prepack` builds. The job uploads both tarballs.
|
|
58
|
+
3. `publish` (`release` environment, `contents: read` and `id-token: write`):
|
|
59
|
+
no checkout. It downloads the tarballs. Inline steps check that each
|
|
60
|
+
tarball holds the package name and version and that npm does not have the
|
|
61
|
+
version. `npm publish <tarball> --provenance --ignore-scripts` publishes
|
|
62
|
+
`repo-harness-operator-web`, waits until npm shows it, then publishes
|
|
63
|
+
`repo-harness`. No package script runs.
|
|
64
|
+
4. `published` (`contents: read`): checks out the SHA, runs `bun install` and
|
|
65
|
+
`check published <version>`.
|
|
66
|
+
5. `tag` (`contents: write`): no checkout. Inline git fetches the SHA and awk
|
|
67
|
+
reads its CHANGELOG section. `gh api` creates the annotated tag
|
|
68
|
+
`v<version>` at the SHA, and `gh release create --verify-tag` creates the
|
|
69
|
+
GitHub Release with that section.
|
|
70
|
+
6. `tagged` (`contents: read`): checks out the SHA and runs
|
|
71
|
+
`check tagged <version>` (the remote tag is at the release commit; the
|
|
72
|
+
GitHub Release is not a draft or a prerelease).
|
|
73
|
+
|
|
74
|
+
Each script step fetches `main` first, so a merge to `main` during the run
|
|
75
|
+
does not stop it. A failed step stops the run. A rerun of a published version
|
|
76
|
+
stops at the guard in `lane`; nothing is published again.
|
|
77
|
+
|
|
78
|
+
npm provenance records the workflow run commit (`GITHUB_SHA`), which is the
|
|
79
|
+
`main` head at dispatch, not the input SHA. Dispatch right after the release
|
|
80
|
+
PR merges, so that the two commits are the same or close.
|
|
81
|
+
|
|
82
|
+
### Owner setup (#2194)
|
|
83
|
+
|
|
84
|
+
- npm Trusted Publishing for each of `repo-harness-operator-web` and
|
|
85
|
+
`repo-harness`: repository `aimpact-inc/repo-harness`, workflow
|
|
86
|
+
`release.yml` and environment `release`. npm does not check the branch, so
|
|
87
|
+
the environment field is what keeps a token from a job without the approved
|
|
88
|
+
environment from publishing.
|
|
89
|
+
- The GitHub environment `release`: the owner as the required reviewer and a
|
|
90
|
+
deployment branch policy of `main` only.
|
|
91
|
+
|
|
92
|
+
### Partial publish recovery
|
|
93
|
+
|
|
94
|
+
When the run stops after a publish, a rerun refuses. The owner completes the
|
|
95
|
+
release by hand from the release commit. Read the state of each step before
|
|
96
|
+
the step, and do only the steps that are not done. Stop at the first failure
|
|
97
|
+
and report it.
|
|
98
|
+
|
|
99
|
+
1. Worktree: `git fetch origin && git worktree add --detach /tmp/repo-harness-wt-release-<version> <sha> && cd /tmp/repo-harness-wt-release-<version> && bun install --frozen-lockfile`
|
|
100
|
+
2. Console package: when `npm view repo-harness-operator-web@<version> version`
|
|
101
|
+
prints the version, skip this step. Otherwise run, from the worktree root:
|
|
102
|
+
`bash scripts/release-owner-steps.sh guard <version> <sha> && (cd packages/operator-web && npm publish --auth-type=web)`
|
|
103
|
+
3. Core package: when `npm view repo-harness@<version> version` prints the
|
|
104
|
+
version, skip this step. Otherwise run, from the worktree root:
|
|
105
|
+
`bash scripts/release-owner-steps.sh guard <version> <sha> && npm publish --auth-type=web`
|
|
106
|
+
4. `bash scripts/release-owner-steps.sh check published <version>`
|
|
107
|
+
5. Tag: run `git ls-remote --tags origin "refs/tags/v<version>" "refs/tags/v<version>^{}"`.
|
|
108
|
+
No output: run `git tag -a v<version> <sha> -m "repo-harness <version>" && git push origin v<version>`.
|
|
109
|
+
A `^{}` line that names `<sha>`: the tag is done; skip.
|
|
110
|
+
Any other output: stop and report.
|
|
111
|
+
6. GitHub Release: run `gh release view v<version> --json tagName,isDraft,isPrerelease`.
|
|
112
|
+
Not found: run `bash scripts/release-owner-steps.sh notes <version> > /tmp/repo-harness-wt-release-<version>.notes.md && gh release create v<version> --verify-tag --title "repo-harness <version>" --notes-file /tmp/repo-harness-wt-release-<version>.notes.md`.
|
|
113
|
+
Found: skip; step 7 checks it.
|
|
114
|
+
7. `bash scripts/release-owner-steps.sh check tagged <version>`
|
|
115
|
+
|
|
116
|
+
`bash scripts/release-owner-steps.sh plan <version>` stays a read-only
|
|
117
|
+
preflight: it runs the guard checks for a version and prints the release
|
|
118
|
+
commit, a manual command list and the post-release steps. After the run
|
|
119
|
+
passes, the orchestrator and the advisor decide together on those
|
|
120
|
+
post-release steps: `repo-harness update` on the owner host, the Upgrade
|
|
121
|
+
steps of the release notes, and the relaunch of both seats from
|
|
122
|
+
`repo-harness seats argv <seat> --repository-id <id>`.
|
|
63
123
|
|
|
64
124
|
## Webapp Release Shape
|
|
65
125
|
|
|
@@ -254,6 +254,63 @@
|
|
|
254
254
|
"retirementCandidate": null,
|
|
255
255
|
"audience": "bot"
|
|
256
256
|
},
|
|
257
|
+
{
|
|
258
|
+
"name": "repo-harness-orchestrator",
|
|
259
|
+
"kind": "facade",
|
|
260
|
+
"source": "assets/skills/repo-harness-orchestrator",
|
|
261
|
+
"provider": null,
|
|
262
|
+
"hosts": [
|
|
263
|
+
"claude"
|
|
264
|
+
],
|
|
265
|
+
"owner": "peer-runtime",
|
|
266
|
+
"explicitOnly": false,
|
|
267
|
+
"discoverability": "explicit-only",
|
|
268
|
+
"requires": [
|
|
269
|
+
"herdr"
|
|
270
|
+
],
|
|
271
|
+
"mutatesRepoByDefault": false,
|
|
272
|
+
"summary": "Explicit-invoke start of the orchestrator seat of the cwd repository in a new tab of its Herdr space, from repo-harness seats argv; refuses a second live orchestrator of the repository.",
|
|
273
|
+
"retirementCandidate": null,
|
|
274
|
+
"audience": "bot"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "repo-harness-advisor",
|
|
278
|
+
"kind": "facade",
|
|
279
|
+
"source": "assets/skills/repo-harness-advisor",
|
|
280
|
+
"provider": null,
|
|
281
|
+
"hosts": [
|
|
282
|
+
"claude"
|
|
283
|
+
],
|
|
284
|
+
"owner": "peer-runtime",
|
|
285
|
+
"explicitOnly": false,
|
|
286
|
+
"discoverability": "explicit-only",
|
|
287
|
+
"requires": [
|
|
288
|
+
"herdr"
|
|
289
|
+
],
|
|
290
|
+
"mutatesRepoByDefault": false,
|
|
291
|
+
"summary": "Explicit-invoke start of the advisor seat beside the live orchestrator of the cwd repository, from repo-harness seats argv; refuses without that orchestrator or with a live advisor.",
|
|
292
|
+
"retirementCandidate": null,
|
|
293
|
+
"audience": "bot"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "repo-harness-seat-handoff",
|
|
297
|
+
"kind": "facade",
|
|
298
|
+
"source": "assets/skills/repo-harness-seat-handoff",
|
|
299
|
+
"provider": null,
|
|
300
|
+
"hosts": [
|
|
301
|
+
"claude"
|
|
302
|
+
],
|
|
303
|
+
"owner": "peer-runtime",
|
|
304
|
+
"explicitOnly": false,
|
|
305
|
+
"discoverability": "explicit-only",
|
|
306
|
+
"requires": [
|
|
307
|
+
"herdr"
|
|
308
|
+
],
|
|
309
|
+
"mutatesRepoByDefault": false,
|
|
310
|
+
"summary": "Explicit-invoke on-demand reset of the current orchestrator or advisor seat: runs repo-harness seats handoff and follows the Stop-hook handoff steps it prints.",
|
|
311
|
+
"retirementCandidate": null,
|
|
312
|
+
"audience": "bot"
|
|
313
|
+
},
|
|
257
314
|
{
|
|
258
315
|
"name": "merge-gate",
|
|
259
316
|
"kind": "judge",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: repo-harness-advisor
|
|
3
|
+
description: Start the advisor seat of the current repository beside its live orchestrator seat in the project Herdr space, from repo-harness seats argv. Refuses without a live orchestrator or with a live advisor.
|
|
4
|
+
when_to_use: "repo-harness-advisor"
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# repo-harness-advisor
|
|
9
|
+
|
|
10
|
+
Bot entrypoint. Explicit invoke only. It starts one process. `repo-harness seats argv`
|
|
11
|
+
holds the model, the effort, the tool limits, the env, the labels and the brief; this
|
|
12
|
+
skill copies none of them. The role rules stay in `repo-harness-issue-flow`.
|
|
13
|
+
|
|
14
|
+
A running session cannot get tool limits or env after its start, so this skill never
|
|
15
|
+
turns the current session into the seat. It always starts a new terminal.
|
|
16
|
+
|
|
17
|
+
## Run
|
|
18
|
+
|
|
19
|
+
Run the script below as one Bash command from the project checkout. Set `SPACE` to the
|
|
20
|
+
space id when the user named one (`--space <id>`); otherwise leave it empty. Every
|
|
21
|
+
probe is its own checked step: a failed or unparsable probe stops the script, and is
|
|
22
|
+
never read as "no seat" or "no space". A non-zero exit starts nothing; report its
|
|
23
|
+
stderr. A missing `hc` or `herdr-app` stops the script; there is no tmux fallback.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
SPACE=''
|
|
27
|
+
stop() { printf 'repo-harness-advisor: %s\n' "$1" >&2; exit 1; }
|
|
28
|
+
for tool in gh git jq hc herdr-app repo-harness; do command -v "$tool" >/dev/null || stop "$tool is not available"; done
|
|
29
|
+
|
|
30
|
+
# 1. Repository: gh reads the git remote of the cwd, so each project has its own seats.
|
|
31
|
+
repo=$(gh api 'repos/{owner}/{repo}') || stop 'gh cannot read the repository of the cwd git remote'
|
|
32
|
+
id=$(printf '%s' "$repo" | jq -er '.id | numbers') || stop 'the repository has no numeric id'
|
|
33
|
+
name=$(printf '%s' "$repo" | jq -er '.name | strings') || stop 'the repository has no name'
|
|
34
|
+
common=$(git rev-parse --path-format=absolute --git-common-dir) || stop 'the cwd is not in a git checkout'
|
|
35
|
+
folder=$(dirname "$common")
|
|
36
|
+
|
|
37
|
+
# 2. Space: the named id, else the one local space named after the repository. Never the selected space.
|
|
38
|
+
layout=$(herdr-app ls) || stop 'herdr-app ls failed'
|
|
39
|
+
spaces=$(printf '%s' "$layout" | jq -ec --arg n "$name" --arg s "$SPACE" '.spaces | arrays
|
|
40
|
+
| [.[] | select((.id | contains("/") | not) and (if $s == "" then .name == $n else .id == $s end)) | .id]') || stop 'herdr-app ls has no space list'
|
|
41
|
+
[ "$(printf '%s' "$spaces" | jq length)" = 1 ] || stop "space does not resolve for $name: $spaces; invoke again with --space <id>"
|
|
42
|
+
space=$(printf '%s' "$spaces" | jq -r '.[0]')
|
|
43
|
+
|
|
44
|
+
# 3. Live seats of the repository, local terminals only: no advisor, exactly one orchestrator.
|
|
45
|
+
# Seats are per host: the board reads local terminals only (src/effects/terminal/herdr-core.ts:337), and another machine may run the same seat.
|
|
46
|
+
live() {
|
|
47
|
+
seats=$(hc ls --json --label "repo-harness.seat=$1" --label "repo-harness.repository=$id") || stop 'hc ls failed'
|
|
48
|
+
printf '%s' "$seats" | jq -ec '.terminals | arrays | [.[] | .address | select(contains("/") | not)]' || stop 'hc ls has no terminal list'
|
|
49
|
+
}
|
|
50
|
+
advisors=$(live advisor) || exit 1
|
|
51
|
+
[ "$advisors" = '[]' ] || stop "refused: repository $id already has a live advisor seat at $(printf '%s' "$advisors" | jq -r 'join(", ")')"
|
|
52
|
+
orchestrators=$(live orchestrator) || exit 1
|
|
53
|
+
[ "$orchestrators" != '[]' ] || stop "refused: repository $id has no live orchestrator seat; the advisor serves only the orchestrator"
|
|
54
|
+
[ "$(printf '%s' "$orchestrators" | jq length)" = 1 ] || stop "refused: repository $id has more than one live orchestrator seat: $orchestrators"
|
|
55
|
+
orchestrator=$(printf '%s' "$orchestrators" | jq -r '.[0]')
|
|
56
|
+
|
|
57
|
+
# 4. The orchestrator tab in the project space.
|
|
58
|
+
tab_of=$(printf '%s' "$layout" | jq -ec --arg s "$space" --arg t "$orchestrator" '[.spaces[] | select(.id == $s) | .tabs[]
|
|
59
|
+
| select(any(.terminals[]; .terminal == $t)) | {count: (.terminals | length), pane: (.terminals[] | select(.terminal == $t) | .pane)}] | select(length == 1) | .[0]') \
|
|
60
|
+
|| stop "refused: the orchestrator seat $orchestrator is not in space $space"
|
|
61
|
+
count=$(printf '%s' "$tab_of" | jq -r .count)
|
|
62
|
+
pane=$(printf '%s' "$tab_of" | jq -r .pane)
|
|
63
|
+
|
|
64
|
+
# 5. Launch: seats argv first, checked, then Herdr with the checked values. Never split down.
|
|
65
|
+
launch=$(repo-harness seats argv advisor --repository-id "$id" --json) || stop 'repo-harness seats argv advisor failed'
|
|
66
|
+
argv=$(printf '%s' "$launch" | jq -ec '.argv | select(type == "array" and length > 0 and all(.[]; type == "string"))') || stop 'seats argv gave no argv'
|
|
67
|
+
if [ "$count" -lt 3 ]; then
|
|
68
|
+
herdr-app do pane.split --direction right --pane "$pane" --argv "$argv" || stop 'herdr-app pane.split failed'
|
|
69
|
+
else
|
|
70
|
+
tab=$(printf '%s' "$launch" | jq -er '.tab | strings | select(. != "")') || stop 'seats argv gave no tab name'
|
|
71
|
+
herdr-app do tab.new --space "$space" --name "$tab" --folder "$folder" --argv "$argv" || stop 'herdr-app tab.new failed'
|
|
72
|
+
fi
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then report the new terminal address from the Herdr output. When the output names
|
|
76
|
+
none, run the step 3 advisor probe again: the argv labels its own terminal before the
|
|
77
|
+
agent starts. Report the `limits` of the `seats argv` JSON.
|
|
@@ -107,8 +107,10 @@ model's own docs. The archimap is the one hand-composed HTML view.
|
|
|
107
107
|
the edge styles used. On each behavior board, compare every state name
|
|
108
108
|
and transition label with the spec at its path: each one must be a spec
|
|
109
109
|
state value or action name, and each red marker must have one legend
|
|
110
|
-
row. Run `measure.ts` once more against the written map and confirm
|
|
111
|
-
that the coverage lists are empty.
|
|
110
|
+
row. Run `measure.ts --map` once more against the written map and confirm
|
|
111
|
+
that the coverage lists are empty. Fix each `geometry.findings` entry, or
|
|
112
|
+
name it in the report with the reason. A board in `geometry.unchecked` has
|
|
113
|
+
no check except your look at it.
|
|
112
114
|
8. **Ship with the change.** In a refresh triggered by a branch change,
|
|
113
115
|
commit the map in the same PR as the model change. Say in the PR body
|
|
114
116
|
which boards changed.
|
|
@@ -101,6 +101,27 @@ vertical one.
|
|
|
101
101
|
(51+, white text). Forbidden and satisfied: `forbid` tint `#FBEDEA` with
|
|
102
102
|
`#9A3412` text. Attention: `attn`, amber.
|
|
103
103
|
|
|
104
|
+
## Facts that `measure.ts --map` reads
|
|
105
|
+
|
|
106
|
+
On a board that holds a `.node`, the geometry check reads three facts:
|
|
107
|
+
|
|
108
|
+
- `.node` and `.panel` carry inline `left`, `top`, `width` and `height` in px.
|
|
109
|
+
- Each edge is a `<path>` of `M`, `H`, `V` and `L` commands in board
|
|
110
|
+
coordinates. Any other command is a usage error. A path inside `<defs>` is
|
|
111
|
+
a marker.
|
|
112
|
+
- Each `.elabel` carries inline `left` and `top`. Its box is 7 px per
|
|
113
|
+
character wide and 16 px high.
|
|
114
|
+
|
|
115
|
+
`line_end_open`: the first or last point of a path is more than 8 px from the
|
|
116
|
+
border of every `.node` and `.panel`.
|
|
117
|
+
|
|
118
|
+
`line_through_box`: a path segment has a point inside a `.node` that is more
|
|
119
|
+
than 8 px from the nearest border of that node. A zero-length segment is tested
|
|
120
|
+
as a point. Path ends have no special case: an end more than 8 px inside a node
|
|
121
|
+
gives `line_end_open` and `line_through_box`. A node at most 16 px wide or high
|
|
122
|
+
gets no `line_through_box`, and a line that stays within 8 px of a border gets
|
|
123
|
+
none.
|
|
124
|
+
|
|
104
125
|
## Quality checks
|
|
105
126
|
|
|
106
127
|
- No two boxes overlap unless one contains the other.
|