Harness honours LANDING=pr — promote matou-app's branch-per-issue / PR flow into the core #13

Closed
opened 2026-08-22 11:35:05 +00:00 by ben · 1 comment
Owner

Part of the agent-driven install-session arc (Ben, 2026-08-21/22; docs/superpowers/specs/2026-08-21-vendor-command-design.md §Context records the decomposition: 2 vendor ✅ → 1 policy layer + prompt rendering → 3 host enrolment → 4 the install session). Worked by the factory's own swarm (STATUS.md 2026-08-22 — SELF-HOSTED).

Depends on the policy layer ticket (policy_load exports SWARM_POLICY_LANDING).

Why

matou-app runs PR-per-issue with human merge entirely from its own .sandcastle/ (branches agent/issue-<N>, PR body closes #N, list-ready-tasks.sh drops issues with an open agent PR, run summary lists PRs, pr-e2e.yml/run-pr-e2e.sh, verify.yml). That is a second copy of harness logic the factory should own — under LANDING=pr the vendored core does it; under LANDING=push (default) nothing changes for idss.

Deliverables (read matou-app's .sandcastle/ first; port, don't reinvent)

  • landing-lib.sh: landing_branch_for <N> (agent/issue-<N>), landing_push <N> (push mode: today's HEAD:refs/heads/main; pr mode: push branch, open/refresh PR via forgejo-lib.sh, body from a template carrying closes #<N> — GOTCHAS 2 for labels), landing_open_pr_for <N> (exit 0 + PR number if one is open).
  • list-ready-tasks.sh: in pr mode, drop issues with an open agent PR (port matou-app's filter).
  • run-swarm.sh run summary: in pr mode list the PRs opened this run; the rescue-branch path is unchanged.
  • close-report-lib.sh: in pr mode gate 1 ("commit reachable from origin/main") becomes "commit reachable from the issue's open PR head"; status: success closes the issue only when MERGE_AUTHORITY=agent-after-green merged it — otherwise the envelope is posted and the issue stays open with the PR linked (human merge closes it via closes #N).
  • prompt.md step 6 text is NOT edited here (prompt edits are design work — the render ticket consumes landing-lib.sh's output); instead claim-next-task.sh prints the landing instruction line for the claimed ticket (landing: push to main / landing: PR from agent/issue-<N>), which the prompt already surfaces.
  • tests/landing-lib-test.sh + updates to list-ready-tasks/close-report-lib tests; shimmed curl and git.

Acceptance

  • LANDING=push (or no policy file): every existing test passes unchanged, git diff of idss-relevant behaviour is nil.
  • LANDING=pr: a shimmed run pushes agent/issue-7, opens one PR, a second run does not open a duplicate and does not re-claim #7 while the PR is open.
  • matou-app can retire its local pr-e2e-lib.sh/run-pr-e2e.sh copies at its next pin bump (note what remains product-specific in the close report).
_Part of the agent-driven install-session arc (Ben, 2026-08-21/22; `docs/superpowers/specs/2026-08-21-vendor-command-design.md` §Context records the decomposition: 2 vendor ✅ → 1 policy layer + prompt rendering → 3 host enrolment → 4 the install session). Worked by the factory's own swarm (STATUS.md 2026-08-22 — SELF-HOSTED)._ **Depends on** the policy layer ticket (`policy_load` exports `SWARM_POLICY_LANDING`). ## Why matou-app runs PR-per-issue with human merge entirely from its own `.sandcastle/` (branches `agent/issue-<N>`, PR body `closes #N`, `list-ready-tasks.sh` drops issues with an open agent PR, run summary lists PRs, `pr-e2e.yml`/`run-pr-e2e.sh`, `verify.yml`). That is a second copy of harness logic the factory should own — under `LANDING=pr` the vendored core does it; under `LANDING=push` (default) nothing changes for idss. ## Deliverables (read matou-app's `.sandcastle/` first; port, don't reinvent) - `landing-lib.sh`: `landing_branch_for <N>` (`agent/issue-<N>`), `landing_push <N>` (push mode: today's `HEAD:refs/heads/main`; pr mode: push branch, open/refresh PR via `forgejo-lib.sh`, body from a template carrying `closes #<N>` — GOTCHAS 2 for labels), `landing_open_pr_for <N>` (exit 0 + PR number if one is open). - `list-ready-tasks.sh`: in pr mode, drop issues with an open agent PR (port matou-app's filter). - `run-swarm.sh` run summary: in pr mode list the PRs opened this run; the rescue-branch path is unchanged. - `close-report-lib.sh`: in pr mode gate 1 ("commit reachable from origin/main") becomes "commit reachable from the issue's open PR head"; `status: success` closes the issue only when `MERGE_AUTHORITY=agent-after-green` merged it — otherwise the envelope is posted and the issue stays open with the PR linked (human merge closes it via `closes #N`). - `prompt.md` step 6 text is NOT edited here (prompt edits are design work — the render ticket consumes `landing-lib.sh`'s output); instead `claim-next-task.sh` prints the landing instruction line for the claimed ticket (`landing: push to main` / `landing: PR from agent/issue-<N>`), which the prompt already surfaces. - `tests/landing-lib-test.sh` + updates to `list-ready-tasks`/`close-report-lib` tests; shimmed `curl` and `git`. ## Acceptance - `LANDING=push` (or no policy file): every existing test passes unchanged, `git diff` of idss-relevant behaviour is nil. - `LANDING=pr`: a shimmed run pushes `agent/issue-7`, opens one PR, a second run does not open a duplicate and does not re-claim #7 while the PR is open. - matou-app can retire its local `pr-e2e-lib.sh`/`run-pr-e2e.sh` copies at its next pin bump (note what remains product-specific in the close report).

close-report for #13 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 13,
  "status": "success",
  "commits": [
    "3ddb0b2d1d977b7f80490a21c33efbeffa3d5f3a"
  ],
  "changed_files": [
    "STATUS.md",
    "claim-next-task.sh",
    "close-report-lib.sh",
    "close-report.sh",
    "forgejo-lib.sh",
    "landing-lib.sh",
    "list-ready-tasks.sh",
    "onboarding/vendor-manifest",
    "run-swarm.sh",
    "tests/claim-next-task-test.sh",
    "tests/close-report-lib-test.sh",
    "tests/close-report-test.sh",
    "tests/fakebin/curl",
    "tests/forgejo-lib-test.sh",
    "tests/landing-lib-test.sh",
    "tests/list-ready-tasks-test.sh",
    "tests/run-swarm-landing-test.sh"
  ],
  "tests": [
    {
      "command": "bash tests/landing-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/forgejo-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/list-ready-tasks-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/claim-next-task-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/close-report-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/close-report-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/run-swarm-landing-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh (offline suite)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "landing-lib.sh: landing_branch_for / landing_push (push=HEAD:main, pr=branch+PR) / landing_open_pr_for": "landing-lib.sh + tests/landing-lib-test.sh (19 checks)",
    "PR opened/refreshed via forgejo-lib.sh, body carries closes #<N>": "forgejo-lib.sh forgejo_open_pr_for/create_pr/pr_head_sha/merge_pr + landing_pr_body; tests/forgejo-lib-test.sh (39) + landing-lib-test",
    "list-ready-tasks.sh: pr mode drops issues with an open agent PR": "list-ready-tasks.sh pr block + tests/list-ready-tasks-test.sh case 9",
    "run-swarm.sh run summary: pr mode lists PRs opened this run; rescue path unchanged": "run-swarm.sh landing_reconcile + PRs-opened summary + tests/run-swarm-landing-test.sh",
    "close-report-lib.sh: pr-mode gate 1 = reachable from PR head; success closes only when agent-after-green merged, else envelope posted + issue open": "close-report-lib.sh (mode-agnostic head) + close-report.sh pr actuator; tests/close-report-lib-test.sh T3b + tests/close-report-test.sh PR-1..PR-4",
    "claim-next-task.sh prints the landing instruction line": "claim-next-task.sh print_landing (stderr) + tests/claim-next-task-test.sh T2/T2b",
    "prompt.md step 6 NOT edited": "no prompt.md change in the diff (render ticket's job)",
    "LANDING=push nil-diff: every existing test passes unchanged": "full offline suite green; push-mode paths byte-identical (gated on SWARM_POLICY_LANDING)",
    "LANDING=pr: run pushes agent/issue-7, opens one PR, second run no duplicate, #7 not re-claimed": "landing-lib-test (first/second run) + list-ready-tasks-test case 9",
    "matou-app can retire its pr-e2e copies; note what stays product-specific": "e2e RUNNER (run-pr-e2e.sh/pr-e2e-lib.sh feature-spec+KERI/any-sync/Playwright, verify.yml) stays product-specific; only LANDING logic promoted — see summary",
    "vendor-manifest coverage": "onboarding/vendor-manifest gains landing-lib.sh; coverage test green"
  },
  "summary": "LANDING=pr promotes matou-app's branch-per-issue/PR flow into the vendored core via landing-lib.sh + forgejo PR verbs, consumed by list-ready-tasks/claim-next-task/run-swarm/close-report, all gated so push mode is byte-identical.",
  "blockers": []
}
**close-report** for #13 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 13, "status": "success", "commits": [ "3ddb0b2d1d977b7f80490a21c33efbeffa3d5f3a" ], "changed_files": [ "STATUS.md", "claim-next-task.sh", "close-report-lib.sh", "close-report.sh", "forgejo-lib.sh", "landing-lib.sh", "list-ready-tasks.sh", "onboarding/vendor-manifest", "run-swarm.sh", "tests/claim-next-task-test.sh", "tests/close-report-lib-test.sh", "tests/close-report-test.sh", "tests/fakebin/curl", "tests/forgejo-lib-test.sh", "tests/landing-lib-test.sh", "tests/list-ready-tasks-test.sh", "tests/run-swarm-landing-test.sh" ], "tests": [ { "command": "bash tests/landing-lib-test.sh", "exit_code": 0 }, { "command": "bash tests/forgejo-lib-test.sh", "exit_code": 0 }, { "command": "bash tests/list-ready-tasks-test.sh", "exit_code": 0 }, { "command": "bash tests/claim-next-task-test.sh", "exit_code": 0 }, { "command": "bash tests/close-report-test.sh", "exit_code": 0 }, { "command": "bash tests/close-report-lib-test.sh", "exit_code": 0 }, { "command": "bash tests/run-swarm-landing-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh (offline suite)", "exit_code": 0 } ], "criteria": { "landing-lib.sh: landing_branch_for / landing_push (push=HEAD:main, pr=branch+PR) / landing_open_pr_for": "landing-lib.sh + tests/landing-lib-test.sh (19 checks)", "PR opened/refreshed via forgejo-lib.sh, body carries closes #<N>": "forgejo-lib.sh forgejo_open_pr_for/create_pr/pr_head_sha/merge_pr + landing_pr_body; tests/forgejo-lib-test.sh (39) + landing-lib-test", "list-ready-tasks.sh: pr mode drops issues with an open agent PR": "list-ready-tasks.sh pr block + tests/list-ready-tasks-test.sh case 9", "run-swarm.sh run summary: pr mode lists PRs opened this run; rescue path unchanged": "run-swarm.sh landing_reconcile + PRs-opened summary + tests/run-swarm-landing-test.sh", "close-report-lib.sh: pr-mode gate 1 = reachable from PR head; success closes only when agent-after-green merged, else envelope posted + issue open": "close-report-lib.sh (mode-agnostic head) + close-report.sh pr actuator; tests/close-report-lib-test.sh T3b + tests/close-report-test.sh PR-1..PR-4", "claim-next-task.sh prints the landing instruction line": "claim-next-task.sh print_landing (stderr) + tests/claim-next-task-test.sh T2/T2b", "prompt.md step 6 NOT edited": "no prompt.md change in the diff (render ticket's job)", "LANDING=push nil-diff: every existing test passes unchanged": "full offline suite green; push-mode paths byte-identical (gated on SWARM_POLICY_LANDING)", "LANDING=pr: run pushes agent/issue-7, opens one PR, second run no duplicate, #7 not re-claimed": "landing-lib-test (first/second run) + list-ready-tasks-test case 9", "matou-app can retire its pr-e2e copies; note what stays product-specific": "e2e RUNNER (run-pr-e2e.sh/pr-e2e-lib.sh feature-spec+KERI/any-sync/Playwright, verify.yml) stays product-specific; only LANDING logic promoted — see summary", "vendor-manifest coverage": "onboarding/vendor-manifest gains landing-lib.sh; coverage test green" }, "summary": "LANDING=pr promotes matou-app's branch-per-issue/PR flow into the vendored core via landing-lib.sh + forgejo PR verbs, consumed by list-ready-tasks/claim-next-task/run-swarm/close-report, all gated so push mode is byte-identical.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/dev-factory#13
No description provided.