AR-2 — BreakdownRulesSection for architect-specific Routing fields #1202
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
Reference
charles/agent-hooks#1202
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?
Why
Architect owns four fields no other type has:
example_prompts: string[]— quick-start chips in the chat UIlabel_rules: Array<{ pattern, exclude_pattern?, label }>—/breakdownauto-labellerassignee_rules: Array<{ when_label, assign_to }>—/breakdownauto-assignerdefault_assignee: string—/breakdownfallbackOnce #1201 lands, every other section in
TypeEditorDrawerworks for architect. The Routing section is the only odd one — its worker fields (routes_labels,reviews_authors,reviews_labels) are meaningless for a non-dispatchable type. Replace the body for architect with an editor for the four architect-specific fields above.Goal
BreakdownRulesSectioncomponent mounted in place ofRoutingSectionwhen editing architect.PUT /config/agentslike every other section.Acceptance criteria
apps/web/src/features/agents/sections/breakdown-rules-section.tsx. Exported fromsections/index.ts.SectionPane::sectionBody("Routing"): whentypeName === "architect", renderBreakdownRulesSectioninstead ofRoutingSection.<ChipInput>overconfig.example_prompts. Free-text chips, no suggestions, placeholder"Add a prompt…". Commit on Enter / comma.{ pattern, exclude_pattern, label }. Pattern + Exclude are regex inputs with inline validation (try { new RegExp(value) } catch). Invalid → red border + caption "Invalid regex", row does not commit. Label is a single-chip input withrepoLabelssuggestions.[Add rule]appends an empty row; each row has a delete affordance.{ when_label, assign_to }.when_labelautocompletes fromrepoLabels;assign_toautocompletes fromagentUsers.[Add rule]+ per-row delete.agentUsers. Placeholder(default: dev).onChange({ ...config, <field>: nextValue })to land intypesDraft→ autosave →PUT /config/agents.roleordispatchablechips in the body — those fields are just normal enum/checkbox values post-#1199, edited (if at all) via Identity or via a generic Routing checkbox elsewhere.Tests
apps/web/src/features/agents/sections/breakdown-rules-section.test.tsx:example_prompts— type a prompt, press Enter, commit; remove a chip; assert theonChangepayload.label_rules— add a rule, edit each column, assert theonChangepayload. Invalid regex onpatternshows error caption and does not commit.assignee_rules— autocomplete fromagentUsers, assert theonChangepayload.default_assignee— autocomplete fromagentUsers.PUT /config/agentspayload contains the newlabel_rules.dev's Routing section still mounts the existingRoutingSectionwithroutes_labelsetc.Out of scope
/breakdowndry-run preview against existing repo labels (filed separately if useful).agents-config-schema.ts).References
apps/server/src/shared/config/agents-default-config.ts::architect— factory shape of the four fields.apps/server/src/shared/config/agents-config-schema.ts— existing zod schema.apps/web/src/components/chip-input.tsx— reuse for chip / autocomplete inputs.apps/web/src/features/agents/sections/routing-section.tsx— sibling component; branch lives next to it insection-pane.tsx.Depends on
#1201 — without it, this surface isn't reachable from the operator's normal flow.
Tracker
#1203
🦵 @charles kicked the queue — re-running implement on @code-lead.