refactor(daemon): de-duplicate cross-section rules in the runtime brief (MUL-5442) - #6302
Merged
Conversation
… one (MUL-5442) Background Task Safety opened with four bullets that were four views of the same rule -- do not end the turn with run-owned work outstanding: the general ban, the "tool says it will notify you" case, the unobservable-result case, and the "standing by" sign-off. Separating them cost bytes without adding a distinct behaviour. Fold them into the leading bullet. Every phrase the behaviour tests pin is carried over verbatim, including "Do NOT end your turn while background tasks", "Never background-and-yield", "wait for a future notification/reminder", "running in the background so you can keep working", "run the work synchronously instead" and "standing by". MUL-5442 Co-authored-by: multica-agent <github@multica.ai>
…ion and metadata policy to pointers (MUL-5442)
The six workflow steps and the Reply mode block restated policy that already
has a dedicated section. Each restatement is a second place to edit when the
policy changes, which is how they drifted apart in the first place.
Give each rule one canonical home and leave a pointer at the call site:
- delivery ("only a comment reaches the user") -> ## Output; steps 5 and the
Reply block point at it.
- mention discipline -> ## Mentions. The reply-time phrasing the loop-hardening
test pins moves into that section rather than being duplicated in the Reply
block, so the anti-loop signal is unchanged.
- metadata read/write bar -> ## Issue Metadata; steps 2 and 6 point at it
instead of paraphrasing the bar.
Tests: the metadata scope test pinned the old pointer wording, and the mention
test's comment claimed the sign-off rule lived in the workflow steps. Both are
updated to the new placement; every behavioural phrase they guard is still
asserted, file-wide.
MUL-5442
Co-authored-by: multica-agent <github@multica.ai>
…ules one home each (MUL-5442)
Three cross-section duplications, each resolved toward the section that owns
the rule:
- comment reads: the workflow step and the Available Commands entry both
explained what --roots-only / --summary / --thread --tail do. The step keeps
the two reads it mandates and its anti-stale motive; flag semantics stay in
Available Commands, which is the single discovery point. The saturation trap
("caps THREADS, not comments") and the pagination cursor labels stay put --
they are load-bearing after MUL-5372 and remain asserted.
- --content-file: the comment add entry restated the guardrail Comment
Formatting owns; it now names the rule and points there for the rationale.
- workdir path rule (MUL-4252): issue create carried its own copy of the
stale-file rationale; it keeps the rule and defers the why.
- inbound attachments: trimmed to the pinned rule plus a pointer.
MUL-5442
Co-authored-by: multica-agent <github@multica.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…intenance, trim the attachment restatement (MUL-5442) Three follow-ups from review, each re-examined against what the text guards today rather than against the fact that a test pinned it. 1. Agent Identity enumeration. Instruction Precedence and workflow step 4 were added in the same commit (#3802) and each carried its own list of actions Agent Identity can forbid -- and the lists disagreed: one named status changes, the other named issue create/update and delegation, neither contained the other. Merge them into Instruction Precedence, which owns the rule. Step 4 keeps only what that section cannot express: a delegation-only role stops once its delegation is delivered. 2. Squad maintenance. `multica squad member set-role` shipped to every run, including every agent that leads no squad and therefore has no squad whose roles it could change. Gate it on IsSquadLeader -- agent configuration, not per-run state, so the brief stays byte-stable across runs of one session (MUL-5377), the same predicate the workflow already branches on. 3. Inbound attachments. The section restated Output's no-clickable-local-path rule verbatim. Keep the framing Output cannot express -- a downloaded attachment feels shared but landed in a private workdir -- and point at Output for the rule. The delivery test now also asserts the pointed-at rule is present, so the pointer cannot dangle. Brief size, plain issue task: 19,231 -> 18,009 bytes for an ordinary agent (-6.4%), 20,718 -> 19,759 for a squad leader (-4.6%). MUL-5442 Co-authored-by: multica-agent <github@multica.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The runtime brief states several rules in more than one place. Each duplicate is a second site to edit when the rule changes, and the copies had already started to drift — in one case the two copies had become materially different. This PR gives each duplicated rule a single canonical home and leaves a pointer at the other call sites.
De-duplication and one gating fix: no rule is dropped, no behavioural constraint is weakened, and every change is static — the brief stays byte-identical across runs of a resumed session, so prompt-cache prefix stability (#6008 / MUL-5377) is untouched.
Measured on a plain issue task, no agent instructions or workspace data:
main)Per section (ordinary agent): Workflow 5,682 → 4,867, Background Task Safety 3,508 → 3,378, Available Commands/Core 2,790 → 2,673, Squad maintenance 203 → 0, Attachments 521 → 451.
## Instruction Precedencegrows 370 → 410 and## Mentions269 → 342, because both absorbed rules that were previously stated inside the workflow steps.Commits
## Output; mention discipline →## Mentions; the metadata read/write bar →## Issue Metadata.--content-fileguardrail and the MUL-4252 workdir rule, both owned by## Comment Formatting.On commit 4
The two Agent Identity lists had diverged.
## Instruction Precedenceand workflow step 4 were added in the same commit (#3802) and each carried its own enumeration of the actions Agent Identity can forbid. Instruction Precedence named status changes; step 4 named issue create/update and delegation. Neither list contained the other, so adding an action type meant editing two places that nobody would remember were linked. They are now one list, in the section that owns the rule. Step 4 keeps only what that section cannot express: a delegation-only role stops once its delegation is delivered.Squad maintenance was ungated.
multica squad member set-roleshipped in every brief, including every agent that leads no squad and therefore has no squad whose roles it could change. It is now gated onIsSquadLeader— agent configuration, not per-run state, so the brief stays byte-stable across runs of one session; the workflow already branches on the same predicate.The attachment rule was a verbatim restatement.
## Attachmentsrepeated Output's no-clickable-local-path rule. It now keeps the framing Output cannot express — a downloaded attachment feels shared because it arrived from the conversation, but it landed in a private workdir — and points at Output for the rule itself. The delivery test additionally asserts the pointed-at rule is present, so the pointer cannot dangle.Semantic invariants preserved
Every behaviour these sections encode is still asserted by tests:
Do NOT end your turn while background tasks,Never background-and-yield,wait for a future notification/reminder,running in the background so you can keep working,run the work synchronously instead,foreground tool call that blocks,standing by, the persistent-service handoff contract, thegh pr checks --watchban, the merge-gate-is-not-acceptance-criteria rule, and the one CI exception.this is mandatory, not optional,Skipping this step is the most common cause, the--recent Nsaturation trap and the pagination cursor labels. These stay:daemon/prompt.gostill steers agents onto--recenton the coalesced-comments path, so the trap is live, not historical.Final results MUST be delivered via multica issue comment add,does NOT see your terminal output,Post exactly ONE comment per run,private working copy, and the clickable-local-path ban.end with no mention at all,Silence ends conversations,Never @mention the agent you are replying to as a thank-you or sign-off.Test changes are placement-only. Where a test pinned wording that moved, it now pins the new location; where a test pinned a sentence that merely duplicated another section, it pins the surviving canonical rule plus the pointer. No assertion was deleted without a replacement covering the same behaviour.
Deliberately not done
Retiring the
--recent Nsaturation semantics to--helpwas considered and rejected:server/internal/daemon/prompt.go:278still tells agents to run--recent 30on the coalesced-comments path, so deleting the warning would leave a flag the platform recommends and no longer traps. The better fix is to stop recommending it there — a behaviour change in a different file, worth its own PR.This PR is de-duplication. The larger remaining win is prose compression inside Workflow and Background Task Safety, which together are still ~46% of the brief.
Verification
go test ./internal/daemon/...— pass (daemon,execenv,repocache).go build ./...andgo vet ./internal/daemon/...— clean.buildMetaSkillContentwith identical fixture contexts on bothmainand this branch, for an ordinary agent and a squad leader.go test ./...failures incmd/multica,internal/handler,internal/integrations/*reproduce identically onmainin this environment (they need Postgres/config not available locally) and are unrelated.MUL-5442