decision: move the ADR tooling into its own Go module, or keep it in madtea and improve it? #643
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#643
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
I want madtea's
adrcommands to keep agents aligned with recorded decisions. Today they do not. Agents reopen decided questions and redesign decided features.I reviewed the points in my own agent sessions where I stopped or corrected an agent, from 2026-08-21 to 2026-09-22. At 10 of those points, an agent proposed or asked about something that a written decision already settled.
AskUserQuestiontool.The
adrcommands check the format of records. No part of madtea shows a relevant decision to an agent when the agent proposes or asks. The plannedlist,view, andrebuildactions (#507, #508) do not change that, because an agent must choose to call them. The last section lists checks that could show decisions to agents at those points.Records this touches
Option 1 below forks two records, and it needs a new record that states both forks:
internal/service, under two thin surfaces. Option 1 moves the ADR logic to an outside module. Both surfaces stay thin over it.adroperations moves to the module.Records 0034, 0036, and 0037 decide the format and the checks of the current tool.
The code today
internal/service/adrholds the logic inadr.go,decision_issues.go, andorigin.go, about 2,060 lines. Itsmadrpackage holds the embedded MADR templates and their licenses.internal/cmd/adr,internal/format/adr, andinternal/mcp/tools_adr.goare the CLI and MCP wrappers, about 440 lines.adr newnumbers a record from the records on origin's default branch (ResolveOriginNames).adr checkreads the state and comments of each linked issue (fetchIssue).internal/service/adrimports five madtea packages:config,gitea,gitexec,service, andservice/git. They serve those two features, the repo lookup (resolveOwnRepo), and two local git reads:user.nameandmadtea.adr.topLevelRepo.fetchIssue,resolveOwnRepo,resolveTopLevelRepo,resolveOriginDefaultBranch, andnewOriginServices.Option 1: move the ADR tooling into its own Go module
The new module holds the MADR rules, the checks, the templates, the checks in the last section, and its own records and issues. madtea imports it as a library.
madtea adrandmadt_adrstay in madtea and call the library. madtea gives the library its forge access through one interface:go.mod. #642 made aDecision issues:list mandatory in every record, which broke every existing MADR tree. Under this option, that break is a module release, not a madtea release.madt_adrwith only a version bump.tools_adr.goalready defines the actions as a table (adrActions) and a handler map (adrHandlers). If the module exports that table, madtea can register it. Each action must still pass madtea's parity test.decide(#495) is one such change, because it closes issues.Two orders are possible:
internal/service/adrimports anymadtea.lol/internalpackage. Then move the package to the new repo. The first step passes the madtea gate by itself. The gate'sadr checkstep keeps working through both steps, becausemadtea adr checkstays.Option 2: keep the ADR tooling in madtea and improve it
Checks that show decisions to agents, in either option
The 10 cases show where a check could have run:
AskUserQuestionthat matches the question against accepted recordsadr checkrequires the "Considered Options" section today, but reads nothing from it.adr checkdoes not read that section. If the check required the named test to exist, and the test to cite the record, a reversed decision would fail a test that names the record.Open question
Which option: move the ADR tooling into its own Go module, or keep it in madtea and improve it?
Related: #488, #495, #507, #508, #528, #632, #634, #638, #639, #642.