Skip to content

v2.8.0: merge-policy for the lwp-website pilot (factory side) - #12

Merged
Param-Harrison merged 1 commit into
mainfrom
release/v2.8.0
Sep 27, 2026
Merged

Param-Harrison merged 1 commit into
mainfrom
release/v2.8.0

Conversation

@Param-Harrison

Copy link
Copy Markdown
Contributor

Summary

  • Ports src/ci.ts (validatePr, waitForCi, a new non-blocking ciStatusNow snapshot — machinist agent.py:439-459,487-592) and src/merge-policy.ts (decideMerge/attemptMerge/renderAuditComment — machinist risk_delivery/gate.py, refusal reasons from agent-skills' herdr-issue-coordinator checklist).
  • merge.policy is "off" (default, unchanged behavior for every existing repo), "dry-run" (assesses eligibility, posts an audit comment, never merges) or "auto" (merges once every readiness and eligibility gate holds), scoped by merge.autoPaths/maxFiles/maxLines.
  • Wired into resumeInReview (checked once per poll, non-blocking) rather than the pipeline's terminal "pr" stage, so waitForCi's own wait never ties up a worker slot and undoes v2.7.0's continuous dispatch. A human /factory revise or /factory cancel always wins over the merge check that poll.
  • New src/github.ts methods (prStatus, mergeReadiness, mergePr) and src/git.ts's diffStat. New merge-dry-run inbox kind.

Test plan

  • make check (typecheck + full bun test + skills-ref validate) green: 779 pass, 0 fail
  • Two genuine revert-and-fail proofs on resumeInReview's guards (policy-off skip, duplicate-audit-comment skip) — both confirmed to fail when the guard is removed, then restored
  • tests/merge-refusal-coverage.test.ts (new structural test) proven by revert-and-fail: an untested union member added to MergeRefusalReason fails the test, confirmed, then reverted
  • Closed a genuine pre-existing coverage gap this structural test caught: draft and not-mergeable had no test in tests/ported/machinist/merge-policy.test.ts
  • Scenario-level spy proves merge is never called on any path while policy is "off"

Not in this PR

  • lwp-website's own .factory/config.json, protectedPaths, charter.md, issue forms, gate fixes, copied skills, CI workflow, and the five pilot issues — separate PR against lwp-website.
  • gate.py's git-tree-truncation/file-mode/renamed-file checks, and waiting on a Codex review bot — not ported, not needed by this codebase's shape.
  • The review inbox's own merge button (v2.9) — merge-dry-run is read-only for now.

🤖 Generated with Claude Code

src/ci.ts (validatePr, waitForCi, and a non-blocking ciStatusNow snapshot,
ported from machinist agent.py) and src/merge-policy.ts (ported from
machinist risk_delivery/gate.py, refusal reasons from agent-skills'
herdr-issue-coordinator checklist). merge.policy is "off" by default,
"dry-run" assesses and posts an audit comment, "auto" merges once every
readiness and eligibility gate holds, gated by autoPaths/maxFiles/maxLines
instead of gate.py's hardcoded 200-line allow-list.

Wired into resumeInReview rather than the pipeline's terminal stage, so the
CI wait never blocks a worker slot and undoes v2.7.0's continuous dispatch.
A human /factory revise or /factory cancel always wins over the merge check
on the same poll.

Structural tests: a spy across the whole scenario suite proves merge is
never called while policy is "off"; tests/merge-refusal-coverage.test.ts
regex-parses MergeRefusalReason and fails if any reason isn't asserted by
name in its ported test file (caught a real gap: draft and not-mergeable
had no test); a file under protectedPaths never qualifies for auto-merge
whatever autoPaths says, at both the module and scenario level.

lwp-website's own config, protected paths, issue forms, gate fixes, copied
skills, CI workflow and the five pilot issues are a separate PR against
that repo.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@Param-Harrison
Param-Harrison merged commit 408108a into main Sep 27, 2026
2 checks passed
@Param-Harrison
Param-Harrison deleted the release/v2.8.0 branch September 27, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant