Summary
Add a curator agent that intelligently reorganizes jj commit history after the bead loop completes, replacing the current heuristic-only curate_history action with agent-driven judgment.
Current State
curate_history (in src/maverick/library/actions/jj.py) runs two mechanical passes:
jj absorb — distributes stray hunks into the correct ancestor by line blame
- Heuristic squash — squashes commits whose descriptions contain fix/fixup/lint/format/typecheck keywords into their parent
This is conservative by design — it only combines obvious fix-up commits.
Proposed Enhancement
A curator agent that:
- Reviews
jj log + per-commit diffs for the working set
- Identifies semantic groupings — e.g. "these 3 beads all relate to authentication"
- Produces a rewrite plan using jj primitives:
jj squash — combine related commits
jj split — separate commits that touch unrelated concerns
jj rebase -r — reorder for logical flow
jj describe — rewrite commit messages for the merged result
- Executes the plan with operation-log safety (
jj op restore on failure)
Design Considerations
- The agent should receive the full
jj log --stat and optionally jj diff for each commit
- Output should be a structured rewrite plan (list of jj commands), not free-form text
- Each rewrite step should be validated (no conflicts introduced)
- The operation log provides a safety net — snapshot before, restore on failure
- Could run as an optional step (
curate_with_agent: true) or replace the heuristic entirely once proven
Acceptance Criteria
Labels
enhancement, jj, agents
Summary
Add a curator agent that intelligently reorganizes jj commit history after the bead loop completes, replacing the current heuristic-only
curate_historyaction with agent-driven judgment.Current State
curate_history(insrc/maverick/library/actions/jj.py) runs two mechanical passes:jj absorb— distributes stray hunks into the correct ancestor by line blameThis is conservative by design — it only combines obvious fix-up commits.
Proposed Enhancement
A curator agent that:
jj log+ per-commit diffs for the working setjj squash— combine related commitsjj split— separate commits that touch unrelated concernsjj rebase -r— reorder for logical flowjj describe— rewrite commit messages for the merged resultjj op restoreon failure)Design Considerations
jj log --statand optionallyjj difffor each commitcurate_with_agent: true) or replace the heuristic entirely once provenAcceptance Criteria
src/maverick/agents/curate_history_with_agentaction insrc/maverick/library/actions/jj.pyLabels
enhancement, jj, agents