Repository navigation
feat: batch --integration --push — publish review refs, never forced, swept by sweep-after - #340
Merged
Merged
Conversation
…ed (#339) `push_repo` is the only remote write the batch makes: one throwaway `integration/<slot>` review ref per repo, never a pull request and never a base for one. Nothing already on origin is ever moved. There is no force flag and no lease in the module at all; the decision is four arms in order — skipped merge publishes nothing; an identical TREE on `origin/<branch>` is not re-pushed (the branch is re-cut every run, so commit SHAs always differ and comparing them would pile up `-2 … -20` on every refresh); a genuine fast-forward is pushed plainly; a diverged branch is published beside the old ref as the first free `-N`, leaving what a reviewer may be reading exactly where it is. A push that fails is a note and a `push_note`, never a change of `status`: the merge verdict is a fact about the merge, and a network failure must not turn a clean integration into a conflicted one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NR2L4MT5kTP8Lu9eR7dPUP
…e packet (#339) `--push` is a collect flag that needs `--integration` (a usage error, rc 2, the same path as `plan --integration`) and is refused on `plan` through COLLECT_ONLY. The record cannot ask for it: `- integration: yes` requests the LOCAL preview, and putting a ref on GitHub stays an act the human types. What was published is stamped on the record as `- integration-remote: <Repo>:<branch>, …` — rewritten on every push, because the current publication is the truth, and under the name `branch_sweep.sh --name` matches on. `- sweep-after:` is the date the sweep may delete those refs: `review-at:` plus a week by default, filled once and never overwritten, because a date the human typed is a decision about their own review. An unreadable `review-at:` falls back to today plus a week and says so in the notes. The report and the packet both name the remote branch and the expiry, through the one `_integ_detail` helper, and the panel withdraws its "nothing is pushed" promise exactly when it stops being true. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NR2L4MT5kTP8Lu9eR7dPUP
An `integration/*` ref is a merge preview — cut from the base with every member's head merged in — so it is unmergeable by construction and no containment proof will ever clear it. Under the existing gates it would sit on origin forever, which is how a review aid becomes litter. So it is cleared by date alone: the `- sweep-after:` on the batch record whose `- integration-remote:` names this repo and this branch. The records come from `--records <dir>`, a checkout of PyAutoMind's `batches/` — the Mind's own sweeper already IS that repo and the org-wide sweeper already checks it out at `.mind`, so only the Brain's per-repo sweeper needed a checkout step of its own. No API paging, no second credential, no JSON in bash. Every failure direction points at KEEP. No records dir, no record naming the branch, no date on the record: protected. The date is compared >= today, not > today, because `sweep-after: <today>` is the morning the human sits down with the preview — expiry starts the day after. The repo half of `<Repo>:<branch>` is matched too: one slot publishes the same branch NAME into every affected repo, so branch-only matching would let one repo's record expire another's ref. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NR2L4MT5kTP8Lu9eR7dPUP
`AUTONOMY.md`'s network bullet named exactly one exception, and the batch's `--fetch`/`--integration` had quietly become a second. It says so now, and the push leg with it: opt-in, non-default, laptop-only, throwaway `integration/*` refs and nothing else, never forced, always with an expiry. The conductor's `AGENTS.md` gains the subsection the flag needed — what is published (including a conflicted repo's partial branch, with the left-out members still named), why there is no `--force` anywhere in the path, why the refresh compares trees rather than commits, and how the ref dies. Plus a doctrine-table row, the three new row keys and two block keys in the JSON, and the two record keys under "What it stamps on the record". `batch.sh`'s usage and the `batch` skill's collect bullet say the same thing in one line each, because the flag is discovered from those two places long before anyone opens the conductor's doc. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NR2L4MT5kTP8Lu9eR7dPUP
…339) The tenant firewall flags 'PyAutoFit' and 'pyautolabs.github.io' as instance facts in organ code; the comments now use generic placeholders. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NR2L4MT5kTP8Lu9eR7dPUP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #339. Phase 3 of the batch review integration branches (phases 1-2: #338).
batch collect --integration --pushpublishes eachintegration/<slot>the local leg built toorigin, from the laptop's own git auth, so the merged review state can be checked out on another machine or handed to CI.Three rules make it safe to leave on:
integration/<slot>-Nand the earlier ref is left untouched._integration.pycontains no force flag at all, and a test pins that.- integration-remote: Repo:branch, …(rewritten on every push) and- sweep-after: YYYY-MM-DD(filled once, defaultreview-at+ 7 days, a human value wins).bin/branch_sweep.shgains--records <batches dir>and anintegration/*case: protected while no record names the ref or itssweep-afteris today or later, sweepable the day after. Deletion stays on the existingworkflow_dispatchpath; the three sweep workflows pass--records(the Brain per-repo sweep gains the same PyAutoMind checkout the org-wide one already has).AUTONOMY.md's "no network except one opt-in flag" bullet records the batch exception: fetch + push, opt-in, laptop-only, throwawayintegration/*refs only, nevermain, never a PR, never a base.--pushwithout--integrationis a usage error (rc 2); non-laptop lanes refuse with a pointer at GITHUB_ACCESS.md; a push failure is a note withpushed=falseand never changes the merge verdict. A pushed conflicted repo carries only the merged members, and the panel says so.API Changes
pyauto-brain batch collect --integration --push(new flag, collect-only, requires--integration).--jsonintegration rows gainremote_branch,pushed,push_note; the block gainspushed,sweep_after.integration-remote:andsweep-after:;collect()exposesreview_at/sweep_after.bin/branch_sweep.sh --records <dir>; newintegration/*classification (integration-no-sweep-after/integration-until-<d>protected,integration-expired-<d>sweepable).See full details below.
Test Plan
tests/test_batch_integration.py(31 tests): origin carries the branch equal to local; aftermainmoves the first ref is untouched and-2appears; unchanged refresh mints nothing; conflicted repo publishes its partial branch; failed push is a note and the verdict stands;--pushwithout--integrationrc 2;plan --pushrc 2; cloud lane refuses; record stamps + defaultsweep-after= review-at + 7d; humansweep-afterpreserved; unparsablereview-atfallback; panel/report text; no force flag in the module.tests/test_branch_sweep.py(14 tests): expired sweepable, future and same-day protected, no record protected, another repo's record does not answer for this one, delete removes only the expired branch.draft/bug/pyautobrain/cortex_test_worktree_symlink.md).bash -nand YAML loads on all three workflows.--integrationonly: report renders,git ls-remote origin 'refs/heads/integration/*'empty on PyAutoBrain/PyAutoFit/PyAutoArray afterwards. No real--pushwas run — the first push of a slot against PyAutoLabs repos is the human's call, in front of a packet with thesweep-afterdate in view.Full API Changes (for automation & release notes)
Added
_integration.py:push_repo(row, wt, slot, notes),run(..., push=False),NOT_LOCAL_PUSH,MAX_SUFFIX._batch.py:--push,sweep_after_default(review_at, notes),SWEEP_DAYS,_fill_keyuse forsweep-after,integration-remotestamp, remote/expiry in_integ_detail/_integration_report/_integration_panel.bin/branch_sweep.sh:--records,integration_sweep_after(),integration/*case arm.--recordsinbranch_sweep.yml(+ PyAutoMind checkout) andbranch_sweep_all.yml.AUTONOMY.mdclause; batchAGENTS.md"Pushing the integration branch (--push)";batch.sh;skills/batch/batch.md.Removed
Migration
--recordsin the Mind's own sweep workflow.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NR2L4MT5kTP8Lu9eR7dPUP