Skip to content

factory: level 0 — the night shift merges tier-1 PRs under a lease - #491

Merged
JulienMartel merged 2 commits into
mainfrom
worktree-autonomous-agent-factory
Aug 29, 2026
Merged

factory: level 0 — the night shift merges tier-1 PRs under a lease#491
JulienMartel merged 2 commits into
mainfrom
worktree-autonomous-agent-factory

Conversation

@JulienMartel

Copy link
Copy Markdown
Contributor

What

The factory, level 0 — a night shift that merges tier-1 (docs-only) PRs across the org while a user-granted lease is live, watches main CI, and reports every act to a shift log. Three scripts + one skill, no daemon, no webhook, no new repo:

  • script/factory-lease — the standing merge grant (grant 12h / status / revoke), one TSV line under ~/.cache/hausfold-factory/, machine-local so no PR can grant itself authority.
  • script/factory-tier — tier 1 decided by a reviewed path filter, never by model judgement: *.md / docs/ only, no renames, no agent-steering files (any case), owner-authored worktree-*main, green, ≤2000 lines, file list read paginated.
  • script/factory-shift — one deterministic pass: budget line from the aiusage feed, tier check on every open org PR, head-SHA-pinned gh pr merge --squash under a live lease, bench pull + bench ship ripple, CI-RED sensing (+ trill cards, --source factory). --dry-run senses only.
  • /nightshift — the foreman: loops the shift, spawns capped fixer lanes on CI-RED (through the handoff skill, background lanes), throttles against the token pace line, hands over a shift report at lease end.

Docs: docs/factory.md; AGENTS.md gains the night-shift routing row and the lease exception to "merging waits for the user".

Why

The org lands ~100 PRs a week and every one waits for a human merge. The user approved tier-1 auto-merge under a lease; this is the narrowest implementation that fails closed — no lease (expired, revoked, or never granted) is exactly today's workflow.

Verify

Watch out

  • Overlap: ⚠ merry-lemur also edits AGENTS.md L64-67 — "merry-lemur lands first (already pushed) — then autonomous-agent-factory rebases onto main."
  • The merge decision is deliberately code, not judgement: factory-tier's filter is the whole definition of tier 1. Widening it (e.g. re-admitting content/, which auto-publishes hausfold.co) is a reviewed edit to that script + docs/factory.md.
  • The budget line trusts usage-claude.tsv's column order (written by haus's statusline-refresh.sh); implausible percentages degrade it to "unreadable" rather than mis-throttling, but a same-order semantic change over there would not be caught.
  • pmset -a disablesleep (lid-closed running) is documented in docs/factory.md but not yet a haus option — follow-up belongs in haus.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WZg7vtYTqsXrVixrSSY3G

JulienMartel and others added 2 commits August 29, 2026 08:16
Three scripts and a skill: factory-lease (the standing merge grant, machine-
local), factory-tier (tier 1 decided by a reviewed path filter, never by
model judgement), factory-shift (one deterministic pass: budget line, merge,
lock ripple, CI-RED sensing), and /nightshift (the foreman loop that spawns
capped fixer lanes and throttles against the aiusage feed's pace line).
The failure mode of all of it is the status quo: no lease, and every PR
waits at 'PR open' exactly as before.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016WZg7vtYTqsXrVixrSSY3G
Renames refused outright (a rename is a delete wearing a docs name, and
GraphQL's files list never says so), the file list read paginated from REST
and cross-checked against changedFiles, merges pinned to the vetted head
SHA (--match-head-commit fails closed on a race), the steering-file deny
tests case-insensitive because APFS is, content/ out of tier 1 (hausfold.co
main deploys the public site — a publish stays gated), the fixer spawn
rerouted through the handoff skill's background-lane path, the budget line
guarded against a reordered usage feed, red runs widened to timed_out and
startup_failure, and /nightshift added to CLAUDE.md's skills row.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016WZg7vtYTqsXrVixrSSY3G
@JulienMartel
JulienMartel merged commit 29f5d8b into main Aug 29, 2026
2 checks passed
@JulienMartel
JulienMartel deleted the worktree-autonomous-agent-factory branch August 29, 2026 13:27
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