Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(brief): closed-status rule after the key-only reminder; category names as plain text (MUL-10027) (#11380)
Bohan Jiangea13b23f8f99
diff --git a/server/internal/daemon/execenv/runtime_config_issue_status_test.go b/server/internal/daemon/execenv/runtime_config_issue_status_test.goindex 999b63e2c2..3a1c9895c3 100644--- a/server/internal/daemon/execenv/runtime_config_issue_status_test.go+++ b/server/internal/daemon/execenv/runtime_config_issue_status_test.go@@ -13,7 +13,7 @@ const builtInStatusLine = "- `multica issue status <id> <status>` — flip statu// catalogBridgeBullet distinguishes workflow keys from lifecycle categories;// it must appear exactly when a catalog is present.-const catalogBridgeBullet = "- The workflow rules above refer to exact built-in status keys, not categories. Custom statuses share lifecycle semantics only, not built-in automation behavior.\n"+const catalogBridgeBullet = "- The `in_progress` / `in_review` / `blocked` rules above refer to exact built-in status keys, not categories. Custom statuses share lifecycle semantics only, not built-in automation behavior.\n"func TestBriefStatusCatalogAbsentUsesBuiltInLine(t *testing.T) {t.Parallel()@@ -195,3 +195,32 @@ func TestBriefStatusCatalogUnknownCategoriesDisclosed(t *testing.T) {}}}++// TestBriefClosedRulePicksByCategory pins the closed rule after the catalog+// bridge, which covers only the key rules above it, and keeps category names+// out of code spans in every status-rule form, since `closed` or `started` as+// a code token invites a status write the server rejects (MUL-7379).+func TestBriefClosedRulePicksByCategory(t *testing.T) {+ t.Parallel()+ catalog := []IssueStatusForEnv{{Key: "wont_fix", Name: "Won't fix", Category: "closed"}}+ withCatalog := buildMetaSkillContent("claude", TaskContextForEnv{IssueID: "issue-1", IssueStatuses: catalog})+ bridge := strings.Index(withCatalog, catalogBridgeBullet)+ closed := strings.Index(withCatalog, issueStatusClosedRule)+ if bridge < 0 || closed < 0 || bridge > closed {+ t.Errorf("catalog bridge (at %d) must precede the closed rule (at %d)\n---\n%s", bridge, closed, withCatalog)+ }++ for name, ctx := range map[string]TaskContextForEnv{+ "built-in": {IssueID: "issue-1"},+ "catalog": {IssueID: "issue-1", IssueStatuses: catalog},+ "commands": {IssueID: "issue-1", HasProjectWorkflow: true},+ "status map": {IssueID: "issue-1", HasProjectWorkflow: true, ProjectWorkflowStatusMap: true},+ } {+ out := buildMetaSkillContent("claude", ctx)+ for _, category := range []string{"unstarted", "started", "closed"} {+ if strings.Contains(out, "`"+category+"`") {+ t.Errorf("%s: brief renders category %q as a code token\n---\n%s", name, category, out)+ }+ }+ }+}diff --git a/server/internal/daemon/execenv/runtime_config_project_workflow_test.go b/server/internal/daemon/execenv/runtime_config_project_workflow_test.goindex 4c57c0fedc..db11263076 100644--- a/server/internal/daemon/execenv/runtime_config_project_workflow_test.go+++ b/server/internal/daemon/execenv/runtime_config_project_workflow_test.go@@ -14,7 +14,7 @@ var builtInStatusRules = []string{"→ `in_review`","a dispatch turn leaves the parent `in_progress`","5. Before exiting, confirm the status still matches where things actually stand.",- "The workflow rules above refer to exact built-in status keys",+ catalogBridgeBullet,}func TestBriefWithProjectWorkflowDropsBuiltInStatusRules(t *testing.T) {@@ -122,13 +122,13 @@ func TestBriefWithStatusMapStatesTheMapRules(t *testing.T) {"Entering a status that hands off reassigns the issue and starts its handler's run","A status without a handler hands nothing off: the work stays yours","At a step you handle, follow its Routes line.",- "leave `done`-category statuses to a human unless Routes leads there",- "a `closed`-category status that fits; comment why first",+ "leave done-category statuses to a human unless Routes leads there",+ "a status in the closed category that fits (`cancelled` when there are no custom statuses); comment why first","add no wakeup for that",// A stuck step goes back to whoever can supply what is missing when// it cannot park the issue: at a terminal status, whose author// routed only the send-back, or without a blocked column.- "at a `done`- or `closed`-category status, its send-back route if it has one; elsewhere `blocked` when the map has it, else your step's send-back route when it has one",+ "at a done- or closed-category status, its send-back route if it has one; elsewhere `blocked` when the map has it, else your step's send-back route when it has one","This issue's status map is in `[Project workflow]`","--duplicate-of","questions, discussion, and acknowledgements never touch status",diff --git a/server/internal/daemon/execenv/runtime_config_sections.go b/server/internal/daemon/execenv/runtime_config_sections.goindex d49c479f5c..3eb950761d 100644--- a/server/internal/daemon/execenv/runtime_config_sections.go+++ b/server/internal/daemon/execenv/runtime_config_sections.go@@ -731,20 +731,24 @@ func writeWorkflowIssue(b *strings.Builder, ctx TaskContextForEnv) {if ctx.IsSquadLeader {b.WriteString("- Squad leader: dispatching members is not delivery — a dispatch turn leaves the parent `in_progress`, and it moves to `in_review` only on the later turn (a member update or stage-barrier re-trigger) where you confirm the overall goal is met.\n")}- b.WriteString(issueStatusClosedRule)- // A custom catalog needs one reminder that workflow updates use exact keys.+ // A custom catalog needs one reminder that the key rules above use exact+ // keys. It names them and precedes the closed rule, which does pick by+ // category, so the reminder cannot read as covering that rule too.if len(ctx.IssueStatuses) > 0 {- b.WriteString("- The workflow rules above refer to exact built-in status keys, not categories. Custom statuses share lifecycle semantics only, not built-in automation behavior.\n")+ b.WriteString("- The `in_progress` / `in_review` / `blocked` rules above refer to exact built-in status keys, not categories. Custom statuses share lifecycle semantics only, not built-in automation behavior.\n")}+ b.WriteString(issueStatusClosedRule)b.WriteString(issueStatusNoWriteRule)}// issueStatusClosedRule and issueStatusNoWriteRule are the status rules an// issue follows with or without a project workflow: a closed-category status// is how an agent records that the work will not be done, whichever status-// list it picks from (MUL-9913).+// list it picks from (MUL-9913). Category names stay plain text, as in+// writeIssueStatusCommand (MUL-7379); the duplicate mark's full command is+// duplicateOfCommandLine in the command list.const (- issueStatusClosedRule = "- The work won't be done — out of scope, not reproducible, a duplicate → a `closed`-category status that fits; comment why first, and mark a duplicate with `multica issue status <id> cancelled --duplicate-of <original>`.\n"+ issueStatusClosedRule = "- The work won't be done — out of scope, not reproducible, a duplicate → a status in the closed category that fits (`cancelled` when there are no custom statuses); comment why first, and mark a duplicate with `--duplicate-of` (see `## Available Commands`).\n"issueStatusNoWriteRule = "- Your turn produced none of the issue's own deliverable — you answered a question or consulted on work owned elsewhere → write nothing, at any point; questions, discussion, and acknowledgements never touch status. This no-write default is what keeps concurrent runs from flapping the board.\n\n")@@ -779,10 +783,10 @@ func writeIssueStatusRulesForStatusMap(b *strings.Builder, ctx TaskContextForEnvb.WriteString("**Issue status — this issue follows its project workflow** (skip any status call your Agent Identity forbids)\n\n")b.WriteString("`[Project workflow]` is this issue's status map. When your work changes where the issue stands, set the status whose meaning matches.\n\n")b.WriteString("- Entering a status that hands off reassigns the issue and starts its handler's run: go there only once your part is done. A status you handle starts your run by itself — add no wakeup for that. A status without a handler hands nothing off: the work stays yours until it is delivered or reaches one that does.\n")- b.WriteString("- At a step you handle, follow its Routes line. Otherwise, delivered work goes to the status meaning delivered; leave `done`-category statuses to a human unless Routes leads there or the map has no delivered status.\n")+ b.WriteString("- At a step you handle, follow its Routes line. Otherwise, delivered work goes to the status meaning delivered; leave done-category statuses to a human unless Routes leads there or the map has no delivered status.\n")b.WriteString(issueStatusClosedRule)b.WriteString("- Work continues beyond this turn → leave the status.\n")- b.WriteString("- You cannot proceed without something you are missing → comment what is missing, then: at a `done`- or `closed`-category status, its send-back route if it has one; elsewhere `blocked` when the map has it, else your step's send-back route when it has one.\n")+ b.WriteString("- You cannot proceed without something you are missing → comment what is missing, then: at a done- or closed-category status, its send-back route if it has one; elsewhere `blocked` when the map has it, else your step's send-back route when it has one.\n")if ctx.IsSquadLeader {b.WriteString("- Squad leader: dispatching members is not delivery — move the parent on only on a later turn that confirms the current step's goal is met.\n")}