Make agents default-branch-agnostic; add regen/lint gates, roster relocation, MergePatrol conflict fix, and CI hardening#63
Merged
Conversation
…ates instead of hardcoding `main`, so generated agents work on non-`main` repos. Add regen-parity and branch-literal-absence CI gates, relocate the agent roster to `.agentfactory/AGENTS.md` with auto-regeneration, fix MergePatrol's rebase-vs-merge conflict handling and wake discipline, and harden CI. Fixes #62.
|
agentfactory seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
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.
Fixes #62.
Summary
Agentfactory hardcoded
main/origin/maininto the formulas and rendered roletemplates, so every generated agent mis-targeted its rebase, push, merge, PR-base,
and verification git ops on any repo whose default branch isn't
main(e.g.master). This makes the factory default-branch-agnostic and adds the durabilityinterlocks, roster fixes, MergePatrol correctness fix, and CI hardening tracked in
the issue.
What changed
Default-branch resolution (the headline)
internal/cmd/detect_default_branch.go: layered, read-only detection —origin/HEADsymbolic-ref →ls-remote --symref→gh repo view— with abranch-name allowlist (the template-expansion path does no shell escaping) and a
per-callout timeout so an unreachable remote can't hang
af sling.sling.goinjects an ambient{{default_branch}}token before templateexpansion: an operator
--varoverride wins, and on detection failure it warnsloudly instead of silently assuming
main.design-v3,factoryworker,mergepatrol) and the rendered roletemplates rolled over from literal
mainto{{default_branch}}.Durability interlocks
make check-regen+ a CIregenjob: fail if committed role templates divergefrom what regeneration produces from the current formulas.
formula_literal_absence_test.go: lint rejecting any re-introduced executablebranch literal, while leaving legitimate prose mentions of "main" alone.
.gitignorenow tracks installed skill copies so a clean checkout can't driftmake check-skills.Agent roster
.agentfactory/AGENTS.md(single source of truth inpaths.go),written atomically, auto-regenerated on
af formula agent-genadd/delete, withthe worktree symlink and manager template updated.
af install --initno longertouches a host project's own root
AGENTS.md.MergePatrol
fail
rebaseyet merge cleanly), so mergeable PRs are no longer skipped and nospurious conflict tasks are filed. Added wake discipline: instantiate the formula
before judging the work queue.
CI
main+ tags(
workflow_dispatchadded), andlibsqlite3-0for the Python issue-store.Test plan
make test— green (all packagesok).make build,make sync-formulas,make sync-skills— clean and idempotent..agentfactory/AGENTS.mdrelocation behavioral test.🤖 Generated with Claude Code