Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-10260: order sub-issues with stages; document blockers on their own (#11639)
Bohan Jiang2cdc4c321be8
diff --git a/server/cmd/multica/cmd_issue.go b/server/cmd/multica/cmd_issue.goindex 2ced39e7b6..160945ff15 100644--- a/server/cmd/multica/cmd_issue.go+++ b/server/cmd/multica/cmd_issue.go@@ -670,7 +670,7 @@ func init() {// issue listissueListCmd.Flags().String("output", "table", "Output format: table or json")- issueListCmd.Flags().Bool("blocked", false, "Only issues waiting for unfinished tasks (manual blockers or earlier stages)")+ issueListCmd.Flags().Bool("blocked", false, "Only issues still waiting on unfinished blockers (issues added with --blocked-by, or earlier stages)")issueListCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")issueListCmd.Flags().String("status", "", "Filter by status")issueListCmd.Flags().String("priority", "", "Filter by priority")diff --git a/server/internal/daemon/execenv/runtime_config_sections.go b/server/internal/daemon/execenv/runtime_config_sections.goindex 0f500ac9f2..ace374addb 100644--- a/server/internal/daemon/execenv/runtime_config_sections.go+++ b/server/internal/daemon/execenv/runtime_config_sections.go@@ -817,9 +817,9 @@ func writeIssueStatusRulesForStatusMap(b *strings.Builder, ctx TaskContextForEnvfunc writeSubIssueCreation(b *strings.Builder, ctx TaskContextForEnv) {b.WriteString("## Sub-issue Creation\n\n")b.WriteString("Default to one issue, one PR. Split only when each piece can be merged and verified on its own — another repository, separate code, or a different owner such as a human step or another agent — and slice by user-visible behavior, never by layer: a backend / frontend split of one feature loses the discussion behind it and cannot be verified end to end until every piece lands. A PR that is large to review is not a reason to split; organize it into commits and give reviewers a guide in its description.\n\n")- b.WriteString("`--status todo` starts an agent-assigned child immediately; `--status backlog` parks it for later promotion; `--stage <N>` groups children into ordered stages.")+ b.WriteString("`--status todo` starts an agent-assigned child once nothing it waits on (an earlier stage, a `--blocked-by` issue) is unfinished; `--status backlog` parks it for later promotion; `--stage <N>` groups children into ordered stages.")if where, ok := subIssueContractsSkill(modelVisibleSkills(ctx.AgentSkills)); ok {- b.WriteString(" Before creating sub-issues, read " + where + " — it covers when to split, serial chains, promotion, and stage wake semantics.")+ b.WriteString(" Before creating sub-issues, read " + where + " — it covers when to split, ordering with stages, promotion, and stage wake semantics.")}b.WriteString("\n\n")}diff --git a/server/internal/daemon/execenv/runtime_config_test.go b/server/internal/daemon/execenv/runtime_config_test.goindex a08f2bf52e..0b7d0b616f 100644--- a/server/internal/daemon/execenv/runtime_config_test.go+++ b/server/internal/daemon/execenv/runtime_config_test.go@@ -67,7 +67,7 @@ func TestSubIssueCreationSectionPresentForIssueRuns(t *testing.T) {// three flags stay discoverable, MUL-3508 follow-up) plus the// skill pointer; the skill side of the contract is asserted in// internal/service (TestPlatformSkillCoversPlatformContracts).- "`--status todo` starts an agent-assigned child immediately",+ "`--status todo` starts an agent-assigned child once nothing it waits on","`--status backlog` parks it","`--stage <N>` groups children into ordered stages","read `references/sub-issues.md` in the `multica-platform` skill",@@ -2449,7 +2449,7 @@ func TestBriefCarriesTheWhenToSplitRule(t *testing.T) {}}rule := strings.Index(out, "Default to one issue, one PR.")- flags := strings.Index(out, "`--status todo` starts an agent-assigned child immediately")+ flags := strings.Index(out, "`--status todo` starts an agent-assigned child once nothing it waits on")if rule < 0 || flags < 0 || rule > flags {t.Errorf("the split rule must come before the sub-issue flags it gates:\n%s", out)}@@ -2532,7 +2532,7 @@ func TestBriefIssuePointerFollowsTheInstalledSkill(t *testing.T) {// The flags themselves are unconditional: they stay discoverable// with or without a skill to point at.for _, always := range []string{- "`--status todo` starts an agent-assigned child immediately",+ "`--status todo` starts an agent-assigned child once nothing it waits on","`--stage <N>` groups children into ordered stages",} {if !strings.Contains(out, always) {diff --git a/server/internal/service/builtin_skills/multica-platform/SKILL.md b/server/internal/service/builtin_skills/multica-platform/SKILL.mdindex fc99c732fc..42e5ba6ce6 100644--- a/server/internal/service/builtin_skills/multica-platform/SKILL.md+++ b/server/internal/service/builtin_skills/multica-platform/SKILL.md@@ -21,7 +21,8 @@ Read the invariants below, then open the reference(s) your task actually needs|---|---|| `references/issues.md` | Issues: PR linking, reading a linked PR's state, saved views (reading, creating, changing), custom properties, status side effects, who else is running, wakeups (events, conditions, timers, check-ins), charts vs attached files in a comment || `references/batch-changes.md` | Changing many issues at once (`issue batch update`, `issue delete <id>... --dry-run`): label and property operations, per-issue results, dry runs |-| `references/sub-issues.md` | Sub-issues: whether to split an issue at all, `todo` vs `backlog` children, serial chains, stages and the parent wakeups they drive |+| `references/dependencies.md` | Making one issue wait for another (`--blocked-by`, `--remove-blocked-by`), finding waiting work (`issue list --blocked`), blockers vs the `blocked` status |+| `references/sub-issues.md` | Sub-issues: whether to split an issue at all, `todo` vs `backlog` children, ordering them with stages, and the parent wakeups stages drive || `references/mentions.md` | Writing a `mention://` link: which types enqueue a run, which are inert, why one silently did nothing; steering another agent's running turn (`comment add --steer`) || `references/docs.md` | Docs (the workspace knowledge base): reading, searching, editing a doc people may be editing live, folders, review comment threads, version history and restore, which doc actions are human-only || `references/agents.md` | Creating, copying or debugging an agent definition: fields, secrets, MCP config, skill binding |diff --git a/server/internal/service/builtin_skills/multica-platform/references/dependencies.md b/server/internal/service/builtin_skills/multica-platform/references/dependencies.mdnew file mode 100644index 0000000000..620cadea93--- /dev/null+++ b/server/internal/service/builtin_skills/multica-platform/references/dependencies.md@@ -0,0 +1,21 @@+# Dependencies++How one issue waits for others with `--blocked-by`, and what the wait does and+does not change.++## Waiting on other issues++`issue create` and `issue update` take repeatable `--blocked-by <issue>` flags+(UUID or identifier) that make an issue wait for other issues in the workspace.+A non-backlog issue enqueues its agent assignee once every blocker enters a done+or closed category (including cancellation), or is removed; a `backlog` issue+stays parked. `issue update --remove-blocked-by <issue>` removes a manual+dependency. `issue get` lists `blocked_by` references, each with+`via: manual|stage`, and `issue list --blocked` finds waiting work. An edge that+would form a cycle is rejected.++Blockers never change issue status; use the manual `blocked` status for missing+information or external conditions. Explicit mentions and replies still run.++To order sub-issues of one parent, use stages instead: earlier stages already+appear as `via: stage` blockers. See `references/sub-issues.md`.diff --git a/server/internal/service/builtin_skills/multica-platform/references/issues.md b/server/internal/service/builtin_skills/multica-platform/references/issues.mdindex 97efe7b7b8..c6193df7c3 100644--- a/server/internal/service/builtin_skills/multica-platform/references/issues.md+++ b/server/internal/service/builtin_skills/multica-platform/references/issues.md@@ -383,9 +383,10 @@ to coordinate with.## Sub-issues and stages-Whether to split an issue at all, `todo` vs `backlog` children, serial chains,-stages and their parent wakeups live in `references/sub-issues.md`. Read it-before creating a sub-issue.+Whether to split an issue at all, `todo` vs `backlog` children, ordering them+with stages, and the parent wakeups stages drive live in+`references/sub-issues.md`. Read it before creating a sub-issue. Making one+issue wait for another (`--blocked-by`) lives in `references/dependencies.md`.## Charts and files in a commentdiff --git a/server/internal/service/builtin_skills/multica-platform/references/sub-issues.md b/server/internal/service/builtin_skills/multica-platform/references/sub-issues.mdindex d4c987b28f..38ab950c94 100644--- a/server/internal/service/builtin_skills/multica-platform/references/sub-issues.md+++ b/server/internal/service/builtin_skills/multica-platform/references/sub-issues.md@@ -4,7 +4,7 @@ Whether to split an issue, and how sub-issues and stages start, order and wakework.- [Before splitting: one issue, one PR](#before-splitting-one-issue-one-pr)-- [Sub-issues: todo starts work now, backlog parks it](#sub-issues-todo-starts-work-now-backlog-parks-it)+- [Sub-issues: todo starts once unblocked, backlog parks it](#sub-issues-todo-starts-once-unblocked-backlog-parks-it)- [Incorrect to correct](#incorrect-to-correct)## Before splitting: one issue, one PR@@ -36,67 +36,66 @@ Each child's run gets a `[Parent issue]` block that points it at the parent,so the child's description carries its scope and acceptance criteria; it doesnot need to restate every decision made on the parent.-## Sub-issues: todo starts work now, backlog parks it+## Sub-issues: todo starts once unblocked, backlog parks it-On an agent-assigned issue, create status decides whether the assignee fires-immediately. A non-backlog status (e.g. `todo`) enqueues the agent when no unfinished blockers remain; `backlog` sets the assignee without triggering, even after blockers end.+On an agent-assigned issue, create status decides whether the assignee fires.+A non-backlog status (e.g. `todo`) enqueues the agent as soon as no earlier+stage or `--blocked-by` issue it waits on is still unfinished. `backlog` sets+the assignee without triggering, even after those waits end.-Parallel children — all start now:+| Need | Create the child with |+|---|---|+| Children that run in parallel | `--status todo`, no stage |+| Children that run in order, each starting on its own | `--stage <N>` and `--status todo` |+| A step the parent reviews results before starting | that step's stage with `--status backlog` |+| A wait on an issue outside this parent, or on one sibling rather than a whole stage | `--blocked-by <issue>` (`references/dependencies.md`) |-```bash-multica issue create --title "..." --parent <issue-id> --assignee <agent> --status todo-```+Order sub-issues of one parent with stages, not with `--blocked-by` chains.-Strictly serial children — park later steps, promote one at a time:+Parallel children — all start now:```bash-multica issue create --title "Step 2: ..." --parent <issue-id> --assignee <agent> --status backlog-multica issue status <child-id> todo # promote when the previous step is truly done+multica issue create --title "..." --parent <issue-id> --assignee <agent> --status todo```-For automatic serial work, create later tasks as `todo` with repeatable-`--blocked-by <issue>` flags. They start after all blockers enter done or closed-categories (including cancellation). `issue get` lists `blocked_by` references,-each with `via: manual|stage`, and `issue list --blocked` finds waiting work.-`issue update --remove-blocked-by <issue>` removes a manual dependency.-Blockers never change issue status; use the manual `blocked` status for missing-information or external conditions. Explicit mentions and replies still run.-### Stages: order sub-issues into barrier groups`--stage <N>` (N >= 1) groups sub-issues under the same parent into ordered-stages. The platform's sub-issue wakeup **wakes the parent assignee when a stage-closes while the next stage has backlog work to promote** — every sub-issue up to that stage has-reached a terminal status (`done`/`cancelled`) — and **once more when every-sub-issue, staged or not, is closed**. A completion that closes nothing is-silent. A sibling set with **no** stages wakes the parent once, when the *last*-sub-issue finishes. A parent in `backlog` is not woken; it catches up once it-leaves backlog. A member assignee gets an inbox notification instead of a run.--Stage waits are computed from all earlier staged siblings under the current-parent; no dependency edges are stored for them. A later stage created as+stages. A staged sub-issue waits until every sub-issue in an earlier stage+reaches a done or closed category (including cancellation); `issue get` lists+those waits in `blocked_by` with `via: stage`. They are computed from the+current siblings and no dependency edges are stored, so moving, restaging or+deleting a sibling immediately changes the wait. A later stage created as`todo` starts automatically once earlier stages end. Use this as the default.Create the later stage as `backlog` when the parent must review results before-promoting it: only this case wakes the parent at an intermediate stage. The-parent is also woken when all children end. Moving, restaging or deleting a-sibling immediately changes the implied wait. Manual blockers combine with-stage waits; a manual edge that cycles through a stage is rejected.+promoting it. Manual blockers combine with stage waits; a manual edge that+cycles through a stage is rejected.++The platform's sub-issue wakeup **wakes the parent assignee when a stage+closes while the next stage has backlog work to promote** — every sub-issue up+to that stage has reached a terminal status (`done`/`cancelled`) — and **once+more when every sub-issue, staged or not, is closed**. A completion that closes+nothing is silent. A sibling set with **no** stages wakes the parent once, when+the *last* sub-issue finishes. A parent in `backlog` is not woken; it catches up+once it leaves backlog. A member assignee gets an inbox notification instead of+a run.```bash-# Stage 1 runs now; later stages parked until promoted+# Stages start in order on their own; the parent reviews before Shipmultica issue create --title "Research A" --parent <id> --assignee <agent> --stage 1 --status todomultica issue create --title "Research B" --parent <id> --assignee <agent> --stage 1 --status todo-multica issue create --title "Build" --parent <id> --assignee <agent> --stage 2 --status backlog+multica issue create --title "Build" --parent <id> --assignee <agent> --stage 2 --status todomultica issue create --title "Ship" --parent <id> --assignee <agent> --stage 3 --status backlog```-When both Stage 1 sub-issues finish you (the parent assignee) are woken by the-sub-issue wakeup; its `[WAKEUP]` block lists every stage and names the next one.-Inspect the layout, then promote the next stage:+Build starts once both Research sub-issues end. When Build ends, you (the parent+assignee) are woken by the sub-issue wakeup because Ship is parked; its+`[WAKEUP]` block lists every stage and names the next one. Inspect the layout,+then promote the next stage:```bash-multica issue children <parent-id> # sub-issues grouped by stage-multica issue status <stage-2-child-id> todo # promote when its deps are met+multica issue children <parent-id> # sub-issues grouped by stage+multica issue status <child-id> todo # promote when its deps are met````issue children --output json` reports per-stage `done` counts, including custom@@ -132,9 +131,8 @@ Serial / phased sub-issues (don't start the whole chain at once):multica issue create --title "Step 2" --parent <issue-id> --assignee <agent> --status todomultica issue create --title "Step 3" --parent <issue-id> --assignee <agent> --status todo-# correct — stage them; Stage 1 runs, later stages park and are promoted as-# each stage's barrier closes+# correct — stage them; each step starts when the previous one endsmultica issue create --title "Step 1" --parent <issue-id> --assignee <agent> --stage 1 --status todo-multica issue create --title "Step 2" --parent <issue-id> --assignee <agent> --stage 2 --status backlog-multica issue create --title "Step 3" --parent <issue-id> --assignee <agent> --stage 3 --status backlog+multica issue create --title "Step 2" --parent <issue-id> --assignee <agent> --stage 2 --status todo+multica issue create --title "Step 3" --parent <issue-id> --assignee <agent> --stage 3 --status todo```diff --git a/server/internal/service/builtin_skills_test.go b/server/internal/service/builtin_skills_test.goindex 81461a9016..13353d1260 100644--- a/server/internal/service/builtin_skills_test.go+++ b/server/internal/service/builtin_skills_test.go@@ -352,8 +352,11 @@ func TestPlatformSkillDescriptionNamesEveryDomain(t *testing.T) {// These are task nouns, not section headings: a task arrives as "set up an// autopilot", never as "Core model".triggerWords := map[string]string{- "references/issues.md": "issue",- "references/sub-issues.md": "sub-issue",+ "references/issues.md": "issue",+ "references/sub-issues.md": "sub-issue",+ // A dependency task arrives as an issue task ("make MUL-2 wait for+ // MUL-1"), and the description has no room left under its cap.+ "references/dependencies.md": "issue","references/batch-changes.md": "batch","references/mentions.md": "mention","references/agents.md": "agent",@@ -556,7 +559,7 @@ func TestPlatformSkillCoversPlatformContracts(t *testing.T) {// MUL-5442: the brief's Sub-issue Creation section is a// one-line map pointing here. These anchors are the demoted// playbook — if they leave, the brief pointer dangles.- "todo starts work now, backlog parks it",+ "todo starts once unblocked, backlog parks it","--status backlog","`--stage <N>`","wakes the parent assignee when a stage",@@ -568,6 +571,22 @@ func TestPlatformSkillCoversPlatformContracts(t *testing.T) {"Slice by user-visible behavior, never by layer","A PR that is large to review is not a reason to split","`[Parent issue]` block",+ // MUL-10260: sibling order has one recipe; --blocked-by is+ // only for waits stages cannot express.+ "Order sub-issues of one parent with stages, not with `--blocked-by` chains",+ },+ },+ {+ // MUL-10260: blockers apply to any issue, so their contract has+ // its own reference instead of living only under sub-issues.+ file: "references/dependencies.md",+ want: []string{+ "--blocked-by <issue>",+ "--remove-blocked-by",+ "issue list --blocked",+ "`via: manual|stage`",+ "Blockers never change issue status",+ "use stages instead",},},{diff --git a/server/internal/service/issue_blocker.go b/server/internal/service/issue_blocker.goindex b9a9c81c32..1973545a19 100644--- a/server/internal/service/issue_blocker.go+++ b/server/internal/service/issue_blocker.go@@ -12,7 +12,7 @@ import ()const SystemRuleBlockersDone = "blockers_done"-const BlockersDoneInstruction = "All tasks this issue was waiting for have ended or were removed from its dependencies. The trigger facts list their statuses. Check cancelled or deleted work before continuing. Start the current assignee's work, using the current project workflow step when present. The platform has not changed this issue's status; if it is blocked, check whether any external wait still applies."+const BlockersDoneInstruction = "All issues this issue was waiting for have ended or were removed from its dependencies. The trigger facts list their statuses. Check cancelled or deleted work before continuing. Start the current assignee's work, using the current project workflow step when present. The platform has not changed this issue's status; if it is blocked, check whether any external wait still applies."// Ordinary admission consumes the release in the task's insert transaction.// Its completion before the scheduler's next pass must not create another run.@@ -127,7 +127,7 @@ func systemInboxType(w db.IssueWakeup) string {}func systemTriggerSummary(w db.IssueWakeup) string {if w.SystemRule.String == SystemRuleBlockersDone {- return "Wakeup: waiting tasks ended"+ return "Wakeup: blockers ended"}return "Wakeup: sub-issues closed"}