Skip to content

feat(maintainer): Pi/Minimax variant of repo-triage#1562

Merged
Wirasm merged 1 commit into
devfrom
feat/repo-triage-minimax-pi-port
May 4, 2026
Merged

feat(maintainer): Pi/Minimax variant of repo-triage#1562
Wirasm merged 1 commit into
devfrom
feat/repo-triage-minimax-pi-port

Conversation

@Wirasm

@Wirasm Wirasm commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

UX Journey

Before

Maintainer                Archon CLI                 Claude Sonnet
──────────                ──────────                 ─────────────
runs repo-triage ───────▶ executes triage-issues ──▶ briefs issues (Task fan-out)
                          executes link-prs      ──▶ matches PRs (Task fan-out)
                          ...                                ...
sees digest ◀──────────── synthesises digest    ◀── (Sonnet, ~50–200k tokens)

After (additive — Claude path unchanged)

Maintainer                Archon CLI                  Pi / Minimax M2.7
──────────                ──────────                  ─────────────────
runs repo-triage-minimax  executes triage-issues ───▶ briefs issues *inline* (one prompt)
                          executes link-prs      ───▶ matches PRs *inline* (one prompt)
                          ...                                 ...
sees digest ◀──────────── synthesises digest     ◀─── (Minimax M2.7, no Task fan-out)

Architecture Diagram

Before

.archon/workflows/maintainer/
├── maintainer-review-pr.yaml
├── maintainer-standup.yaml          (Claude)
├── maintainer-standup-minimax.yaml  (Pi/Minimax)
└── repo-triage.yaml                 (Claude — sole triage workflow)

After

.archon/workflows/maintainer/
├── maintainer-review-pr.yaml
├── maintainer-standup.yaml
├── maintainer-standup-minimax.yaml
├── repo-triage.yaml                 (Claude — unchanged)
└── repo-triage-minimax.yaml         [+]  (Pi/Minimax — same DAG, Task-free prompts)

Connection inventory:

From To Status Notes
repo-triage-minimax.yaml .archon/state/triage-state.json new Reads/writes the same state file as Claude variant
repo-triage-minimax.yaml .archon/state/closed-dedup-state.json new Same
repo-triage-minimax.yaml .archon/state/closed-pr-dedup-state.json new Same
repo-triage-minimax.yaml .archon/state/pr-state.json new Same
repo-triage-minimax.yaml .archon/state/stale-nudge-state.json new Same
repo-triage-minimax.yaml .claude/agents/triage-agent.md not connected Labelling intentionally skipped under Pi
repo-triage.yaml (any) unchanged Claude variant untouched

Label Snapshot

  • Risk: risk: low
  • Size: size: M
  • Scope: workflows
  • Module: workflows:maintainer

Change Metadata

  • Change type: feature
  • Primary scope: workflows

Linked Issue

  • Closes #
  • Related # 1480 (maintainer-standup-minimax precedent)
  • Related # 1067 (nested-Claude-Code session hang — motivates the Pi variant)

Validation Evidence

bun run cli validate workflows repo-triage-minimax
# Validating workflows in /Users/rasmus/Projects/cole/Archon
#   repo-triage-minimax                      ok
# Results: 1 valid, 0 with errors
  • Evidence provided (test/log/trace/screenshot): validator output above
  • Skipped commands: bun run validate (full suite — no code changed; YAML-only PR)

Security Impact

  • New permissions/capabilities? No
  • New external network calls? No (same gh + Slack-webhook surface as Claude variant)
  • Secrets/tokens handling changed? No
  • File system access scope changed? No (writes only under .archon/state/ and $ARTIFACTS_DIR, identical to Claude variant)

Compatibility / Migration

  • Backward compatible? Yes — additive; existing repo-triage.yaml untouched.
  • Config/env changes? No — uses the same DRY_RUN, SKIP_*, and SLACK_WEBHOOK env vars as the Claude variant.
  • Database migration needed? No
  • Upgrade steps: none. To use, run bun run cli workflow run repo-triage-minimax.

Human Verification

  • Verified scenarios:
    • bun run cli validate workflows repo-triage-minimax passes clean (no warnings).
    • Audited the diff against repo-triage.yaml: identical DAG (triage-issuesclosed-dedup-check, triage-issueslink-prs, standalone closed-pr-dedup-check and stale-nudge, all → digest).
    • Confirmed every reference to inline agents: blocks, Task calls, and named sub-agents (brief-gen, closed-brief-gen, pr-brief-gen, pr-issue-matcher, triage-agent) has been removed or converted to a negative ("no Task fan-out") instruction.
    • State-file shapes are unchanged from the Claude variant — wire-compatible for resumption.
  • Edge cases checked:
    • DRY_RUN=1 path still works (the [DRY] would ... instructions remain, just without the Task-prepend sub-bullet).
    • SKIP_* escape hatches preserved verbatim for staged rollouts.
    • LABEL pass intentionally skipped under Pi — guardrail rewritten to point at the Claude variant for label coverage.
  • What was not verified:
    • End-to-end live run against GitHub. The workflow is read-mostly and gated by DRY_RUN; recommend a first run with DRY_RUN=1 before any live invocation. (The Claude variant's behavioural guarantees apply.)
    • Quality of Minimax M2.7's clustering / template-adherence judgements vs Claude Sonnet — empirical, evaluate after the first non-dry run.

Side Effects / Blast Radius

  • Affected subsystems/workflows: only the maintainer triage flow when the maintainer explicitly invokes repo-triage-minimax. No effect on default workflows or any code path.
  • Potential unintended effects:
    • If a prior run of repo-triage.yaml left briefs in triage-state.json, the Pi variant will re-shape them on its next BRIEF PASS (same JSON shape — no data loss; cached briefs are simply re-validated against new sha digests).
    • Per-issue inline iteration costs more output tokens than parallel Task fan-out; on repos with > ~200 open issues the single-prompt context could push limits.
  • Guardrails/monitoring:
    • Validator passes locally and in CI.
    • First production run should be DRY_RUN=1; the workflow's own summary lists every would-be mutation.

Rollback Plan

  • Fast rollback command: git revert <commit> or rm .archon/workflows/maintainer/repo-triage-minimax.yaml.
  • Feature flags / config toggles: per-node skip env vars (SKIP_CLOSED_DEDUP, SKIP_CLOSED_PR_DEDUP, SKIP_PR_LINK, SKIP_STALE_NUDGE) work identically to the Claude variant.
  • Observable failure symptoms: validator failure (caught at CLI / CI); workflow run errors surface in $ARTIFACTS_DIR/digest.md and the per-node summaries.

Risks and Mitigations

  • Risk: Minimax M2.7 produces lower-quality clusters / weaker fully-addresses judgements than Sonnet, leading to noisy or wrong dedup comments.
    • Mitigation: workflow's own conservative bias remains intact ("default to related", "when in doubt, skip"); operator runs DRY_RUN first; the Claude variant remains the gold-standard fallback.
  • Risk: Single-prompt inline iteration hits context limits on very large repos.
    • Mitigation: gh issue list --limit 200 cap is unchanged. If a run truncates, increase the cap or fall back to the Claude variant (which uses Task fan-out).
  • Risk: Drift between the two variants over time (a fix lands in one but not the other).
    • Mitigation: keep the diff between the two YAMLs minimal — only model swap + sub-agent removal. Cross-link in commit messages when touching either.

Summary by CodeRabbit

  • New Features
    • Automated issue duplicate detection with deduplication notifications
    • Smart pull request linking to related issues
    • Stale issue and PR reminder system
    • Automated repository activity digests

Adds repo-triage-minimax.yaml — a Pi/Minimax M2.7 port of the existing
repo-triage workflow. Identical DAG shape, state files, and guardrails;
all four LLM-orchestrated nodes rewritten to do per-issue/per-PR work
inline since Pi has no Task tool / inline sub-agents.

Differences from the Claude variant:
- Drops the four `agents:` blocks (brief-gen, closed-brief-gen,
  pr-brief-gen, pr-issue-matcher) — Pi can't invoke them.
- Removes Task from `allowed_tools` for every prompt node.
- Each "BRIEF/MATCH PASS" reads the gh JSON dump once and processes
  every entry inline; JSON shapes that the deleted sub-agents returned
  are now spec'd in the orchestrator prompt.
- Skips the LABEL pass — labelling requires Claude's Task tool to
  invoke the on-disk triage-agent sub-agent. Run repo-triage.yaml
  (the Claude variant) when label-coverage matters.

Validates clean: 1 valid, 0 errors, 0 warnings.
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds a comprehensive Archon repository maintenance workflow with five concurrent nodes—triage-issues, closed-dedup-check, closed-pr-dedup-check, link-prs, and stale-nudge—that periodically identify and reconcile duplicate issues/PRs, link PRs to issues, post reminders, and synthesize findings into a maintainer digest.

Changes

Repository Triage and Deduplication Workflow

Layer / File(s) Summary
Workflow Header & Infrastructure
.archon/workflows/maintainer/repo-triage-minimax.yaml (lines 1–40)
Defines workflow name, idempotency mode, disables worktree creation, and specifies minimax/MiniMax-M2.7 model for all nodes with DRY_RUN and SKIP flags.
Triage Issues Node
.archon/workflows/maintainer/repo-triage-minimax.yaml (lines 41–259)
Reads/validates triage-state.json, fetches open issues and templates, computes cached brief summaries, clusters likely duplicates, posts dedup-discovery comments with 3-day reply windows, auto-closes tracked duplicates after 3 days with no non-bot replies, and atomically writes merged state with summary output.
Closed-Issue Deduplication Node
.archon/workflows/maintainer/repo-triage-minimax.yaml (lines 260–489)
Reads open briefs and closed-dedup-state.json, cross-matches open issues against recently closed ones (90-day window), posts "may be resolved" comments, auto-closes only when tracked and unanswered after 3 days, with conservative matching guardrails and atomic state writes.
Closed-PR Deduplication Node
.archon/workflows/maintainer/repo-triage-minimax.yaml (lines 490–685)
Caches and matches open PRs against recently closed PRs (90-day window), fetches diffs with truncation awareness, posts informational duplicate/supersession comments (never auto-closes PRs), tracks comment IDs in closed-pr-dedup-state.json, and outputs summary counts.
PR-to-Issue Linking Node
.archon/workflows/maintainer/repo-triage-minimax.yaml (lines 686–1016)
Uses pr-state.json to cache PR metadata by SHA, matches open PRs to open issues via diffs with conservative fallback, posts either Closes #X`` suggestions (only when fully-addressed) or "related to #X" cross-reference comments, includes template-nudge pass with first-run grandfather baseline, merges state atomically, and outputs summary.
Stale-Nudge Node
.archon/workflows/maintainer/repo-triage-minimax.yaml (lines 1017–1148)
Posts non-auto-closing "still relevant?" reminders for quiet issues/PRs in stale-nudge-state.json, skips drafts and do-not-bother labels, ensures one nudge per quiet period, verifies idempotency via existing comments, records comment IDs, and writes atomic state with summary.
Digest & Synthesis Node
.archon/workflows/maintainer/repo-triage-minimax.yaml (lines 1149–1456)
Depends on all prior nodes; reads state files and outputs to build digest.md with per-node sections, headline counts, full comment-URL index from stored bot comment IDs, and carry-forward 3-day-clock items; performs optional best-effort Slack posting with DRY_RUN safety.

Sequence Diagram

sequenceDiagram
    participant GitHub as GitHub API
    participant Triage as triage-issues
    participant ClosedDedup as closed-dedup-check
    participant ClosedPRDedup as closed-pr-dedup-check
    participant LinkPRs as link-prs
    participant StaleNudge as stale-nudge
    participant Digest as digest
    participant State as State Files
    participant Slack as Slack (optional)

    Triage->>GitHub: Fetch open issues & templates
    Triage->>Triage: Compute brief summaries
    Triage->>Triage: Cluster & identify duplicates
    Triage->>GitHub: Post dedup comments
    Triage->>State: Save triage-state.json
    Triage-->>ClosedDedup: ✓ Node complete

    ClosedDedup->>State: Read triage state
    ClosedDedup->>GitHub: Fetch recently closed issues
    ClosedDedup->>GitHub: Post resolution comments
    ClosedDedup->>GitHub: Auto-close (3-day check)
    ClosedDedup->>State: Save closed-dedup-state.json
    ClosedDedup-->>ClosedPRDedup: ✓ Node complete

    ClosedPRDedup->>GitHub: Fetch open & closed PRs
    ClosedPRDedup->>GitHub: Fetch PR diffs
    ClosedPRDedup->>GitHub: Post informational comments
    ClosedPRDedup->>State: Save closed-pr-dedup-state.json
    ClosedPRDedup-->>LinkPRs: ✓ Node complete

    LinkPRs->>GitHub: Fetch open PRs & issues
    LinkPRs->>LinkPRs: Match via diffs
    LinkPRs->>GitHub: Post Closes/related comments
    LinkPRs->>GitHub: Post template nudges
    LinkPRs->>State: Save pr-state.json
    LinkPRs-->>StaleNudge: ✓ Node complete

    StaleNudge->>GitHub: Fetch quiet issues & PRs
    StaleNudge->>GitHub: Post stale reminders
    StaleNudge->>State: Save stale-nudge-state.json
    StaleNudge-->>Digest: ✓ Node complete

    Digest->>State: Read all state files
    Digest->>Digest: Build digest.md
    Digest->>Digest: Index comment URLs
    Digest->>Digest: Carry forward 3-day items
    Digest->>Slack: Post optional summary
    Digest->>Digest: Output final digest
Loading

Estimated Code Review Effort

🎯 5 (Critical) | ⏱️ ~120 minutes

The workflow introduces 1456 lines of intricate, multi-node orchestration logic with stateful reconciliation, conservative deduplication heuristics, idempotency guarantees, and 3-day clock semantics across six interdependent nodes. Each node combines GitHub API interaction, cached state merging, bot-comment tracking, and atomic writes with multiple conditional branches and guardrails. The complexity density, multi-file state management, sequential dependency chain, and need to verify logic correctness across DRY_RUN modes and concurrent/serial execution patterns demands careful, line-by-line review.

Possibly Related PRs

  • Archon #1293: Implements an earlier variant of the same repo-triage workflow with the same five-node structure (triage-issues, closed-dedup-check, closed-pr-dedup-check, link-prs, stale-nudge), state file layout (.archon/state/*), and DRY_RUN/SKIP_* flag patterns; directly related to this PR's design and integration.

Poem

🐰 Five nodes dance in perfect sync,
Weeding dupes before you blink—
PRs link, old issues rest,
A tidy repo, triaged best!
Hops away with digest in paw 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(maintainer): Pi/Minimax variant of repo-triage' clearly and concisely summarizes the main change: adding a new Minimax variant of the repo-triage workflow for the maintainer scope.
Description check ✅ Passed The PR description is comprehensive, covering all required template sections: problem, why it matters, what changed, scope boundaries, UX journey (before/after), architecture diagrams, connection inventory, label snapshot, change metadata, linked issues, validation evidence, security impact, compatibility, human verification, side effects, rollback plan, and risks/mitigations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/repo-triage-minimax-pi-port

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
.archon/workflows/maintainer/repo-triage-minimax.yaml (2)

458-463: 💤 Low value

Minor documentation clarification.

Lines 461-462 could be slightly clearer. "Only drop entry on exit 0" followed by "Drop entry from state" on a separate bullet reads as two separate actions. Consider consolidating:

-            - Only drop entry on exit 0.
-            - Drop entry from state.
+            - Only drop entry from state on close success (exit 0).

This is purely a wording nit — the logic described is correct.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.archon/workflows/maintainer/repo-triage-minimax.yaml around lines 458 -
463, Consolidate the two bullets that read "Only drop entry on exit 0" and "Drop
entry from state" into a single, clear action under the `gh issue close <O>
--reason "not planned"` branch: indicate that on exit code 0 you should drop the
entry from state (and on non-zero set `closeAttemptFailed: true`, log the
failure, and do not drop state). Update the bullet list so the successful-exit
behavior and the drop-from-state action are one line to avoid implying two
separate actions.

863-867: 💤 Low value

Clarify or remove potentially misleading cross-reference.

Lines 863-867 mention "closed-pr-dedup-check feeds this pattern too", but link-prs operates on its own state file (pr-state.json) and doesn't consume briefs from closed-pr-dedup-state.json. The diffTruncated handling described here applies to PRs processed within link-prs itself.

Consider removing the closed-pr-dedup-check reference to avoid confusion, or clarify that this is a general principle applicable to both nodes independently.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.archon/workflows/maintainer/repo-triage-minimax.yaml around lines 863 -
867, The cross-reference is misleading: update the text so it no longer implies
`closed-pr-dedup-check` consumes the `link-prs` briefs; either remove the phrase
"`closed-pr-dedup-check` feeds this pattern too" or rewrite it to state the
principle applies independently to both nodes. Specifically mention that
`link-prs` uses `pr-state.json` and `closed-pr-dedup-check` uses
`closed-pr-dedup-state.json`, and clarify that when `diffTruncated: true` any
`fully-addresses`-style claim should be downgraded to `related` in each node's
processing (e.g., when `link-prs` sees `diffTruncated` in a brief it downgrades
`fully-addresses` → `related`).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.archon/workflows/maintainer/repo-triage-minimax.yaml:
- Around line 458-463: Consolidate the two bullets that read "Only drop entry on
exit 0" and "Drop entry from state" into a single, clear action under the `gh
issue close <O> --reason "not planned"` branch: indicate that on exit code 0 you
should drop the entry from state (and on non-zero set `closeAttemptFailed:
true`, log the failure, and do not drop state). Update the bullet list so the
successful-exit behavior and the drop-from-state action are one line to avoid
implying two separate actions.
- Around line 863-867: The cross-reference is misleading: update the text so it
no longer implies `closed-pr-dedup-check` consumes the `link-prs` briefs; either
remove the phrase "`closed-pr-dedup-check` feeds this pattern too" or rewrite it
to state the principle applies independently to both nodes. Specifically mention
that `link-prs` uses `pr-state.json` and `closed-pr-dedup-check` uses
`closed-pr-dedup-state.json`, and clarify that when `diffTruncated: true` any
`fully-addresses`-style claim should be downgraded to `related` in each node's
processing (e.g., when `link-prs` sees `diffTruncated` in a brief it downgrades
`fully-addresses` → `related`).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6140b273-47ca-460b-9902-7a261270eae7

📥 Commits

Reviewing files that changed from the base of the PR and between 88d0109 and f502bec.

📒 Files selected for processing (1)
  • .archon/workflows/maintainer/repo-triage-minimax.yaml

@Wirasm Wirasm merged commit 342685e into dev May 4, 2026
4 checks passed
@Wirasm Wirasm deleted the feat/repo-triage-minimax-pi-port branch May 4, 2026 12:45
@Wirasm Wirasm mentioned this pull request May 12, 2026
cropse pushed a commit to cropse/Archon that referenced this pull request May 19, 2026
Adds repo-triage-minimax.yaml — a Pi/Minimax M2.7 port of the existing
repo-triage workflow. Identical DAG shape, state files, and guardrails;
all four LLM-orchestrated nodes rewritten to do per-issue/per-PR work
inline since Pi has no Task tool / inline sub-agents.

Differences from the Claude variant:
- Drops the four `agents:` blocks (brief-gen, closed-brief-gen,
  pr-brief-gen, pr-issue-matcher) — Pi can't invoke them.
- Removes Task from `allowed_tools` for every prompt node.
- Each "BRIEF/MATCH PASS" reads the gh JSON dump once and processes
  every entry inline; JSON shapes that the deleted sub-agents returned
  are now spec'd in the orchestrator prompt.
- Skips the LABEL pass — labelling requires Claude's Task tool to
  invoke the on-disk triage-agent sub-agent. Run repo-triage.yaml
  (the Claude variant) when label-coverage matters.

Validates clean: 1 valid, 0 errors, 0 warnings.
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