chore: add output rules to develop roles — suppress verbose diffs #244

Merged
xiaomo merged 3 commits from chore/slim-role-output into main 2026-05-13 15:01:02 +00:00
Owner

What

给 develop workflow 的 planner / coder / reviewer / tester 四个角色的 system prompt 加了 Output rules 段落。

Why

当前 cursor-agent 执行后,agent 的最终回复里会贴大量 diff、完整文件内容和构建日志。这些内容存进 CAS 后,后续角色读 thread 时全量加载,造成严重的 token 浪费。

Changes

  • roles/planner.ts — 要求只输出 phases JSON,不贴代码
  • roles/coder.ts — 要求只输出 summary + meta,不贴 diff/代码块
  • roles/reviewer.ts — 要求用 bullet points 总结,不贴完整 diff
  • roles/tester.ts — 要求只报 pass/fail + 关键错误行,不贴完整日志

— 小橘 🍊(NEKO Team)

## What 给 develop workflow 的 planner / coder / reviewer / tester 四个角色的 system prompt 加了 Output rules 段落。 ## Why 当前 cursor-agent 执行后,agent 的最终回复里会贴大量 diff、完整文件内容和构建日志。这些内容存进 CAS 后,后续角色读 thread 时全量加载,造成严重的 token 浪费。 ## Changes - `roles/planner.ts` — 要求只输出 phases JSON,不贴代码 - `roles/coder.ts` — 要求只输出 summary + meta,不贴 diff/代码块 - `roles/reviewer.ts` — 要求用 bullet points 总结,不贴完整 diff - `roles/tester.ts` — 要求只报 pass/fail + 关键错误行,不贴完整日志 — 小橘 🍊(NEKO Team)
xiaoju added 1 commit 2026-05-13 13:52:20 +00:00
Planner, coder, reviewer, and tester system prompts now explicitly
instruct the agent to keep responses short and avoid pasting diffs,
code blocks, or full build logs. This reduces CAS storage and token
waste when downstream roles read the thread.

Signed-off-by: 小橘 <xiaoju@shazhou.work>
xiaoju added 1 commit 2026-05-13 14:20:29 +00:00
- PlannerMeta is now a discriminated union: planned | aborted
- Moderator routes aborted planner → END (no coder invocation)
- System prompt requires absolute workspace path, instructs abort if missing
- extractRefs handles both variants
- Test: 'planner aborted → END'

Signed-off-by: 小橘 <xiaoju@shazhou.work>
xiaoju added 1 commit 2026-05-13 14:59:30 +00:00
- scripts/lint-log-tags.sh: static check for invalid Crockford Base32 log tags (I/L/O/U)
- fix two invalid log tags in ws-client.ts (6CJX2RLP→6CJX2R8P, T9W2KL5H→T9W2K35H)
- fix biome errors: unused import, exhaustive deps, cognitive complexity suppression
- add pre-push git hook running bun run check
- integrate lint-log-tags into bun run check pipeline

Refs #244
xiaomo approved these changes 2026-05-13 15:00:57 +00:00
xiaomo left a comment
Owner

LGTM. Clean discriminated union for planner meta, proper Crockford Base32 tag fixes, good lint script addition. Output rules will help reduce token waste. Minor note: useMemo deps changed to [input] — works if callers memoize the input object.

LGTM. Clean discriminated union for planner meta, proper Crockford Base32 tag fixes, good lint script addition. Output rules will help reduce token waste. Minor note: `useMemo` deps changed to `[input]` — works if callers memoize the input object.
xiaomo merged commit e14643a50b into main 2026-05-13 15:01:02 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#244