@massa-ai/cursor-plugin 1.12.1 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.cursor-plugin/plugin.json +1 -1
  2. package/agents/massa-ai-architecture-specialist.md +2 -6
  3. package/agents/massa-ai-audit-specialist.md +2 -6
  4. package/agents/massa-ai-builder.md +1 -6
  5. package/agents/massa-ai-context-curator.md +2 -6
  6. package/agents/massa-ai-documentation-agent.md +1 -6
  7. package/agents/massa-ai-furps-analyst.md +2 -6
  8. package/agents/massa-ai-investigator.md +2 -6
  9. package/agents/massa-ai-judge.md +99 -0
  10. package/agents/massa-ai-meta-judge.md +86 -0
  11. package/agents/massa-ai-mobile-specialist.md +2 -6
  12. package/agents/massa-ai-navigator.md +2 -6
  13. package/agents/massa-ai-plan-critic.md +2 -6
  14. package/agents/massa-ai-planner.md +2 -6
  15. package/agents/massa-ai-requirements-analyst.md +2 -6
  16. package/agents/massa-ai-reviewer.md +2 -6
  17. package/agents/massa-ai-test-engineer.md +1 -6
  18. package/agents/massa-ai-verification-agent.md +2 -6
  19. package/package.json +1 -1
  20. package/skills/agents/architecture-specialist/SKILL.md +1 -4
  21. package/skills/agents/audit-specialist/SKILL.md +1 -4
  22. package/skills/agents/builder/SKILL.md +1 -4
  23. package/skills/agents/context-curator/SKILL.md +1 -4
  24. package/skills/agents/documentation-agent/SKILL.md +1 -4
  25. package/skills/agents/furps-analyst/SKILL.md +1 -4
  26. package/skills/agents/investigator/SKILL.md +1 -4
  27. package/skills/agents/judge/SKILL.md +103 -0
  28. package/skills/agents/meta-judge/SKILL.md +90 -0
  29. package/skills/agents/mobile-specialist/SKILL.md +1 -4
  30. package/skills/agents/navigator/SKILL.md +1 -4
  31. package/skills/agents/plan-critic/SKILL.md +1 -4
  32. package/skills/agents/planner/SKILL.md +1 -4
  33. package/skills/agents/requirements-analyst/SKILL.md +1 -4
  34. package/skills/agents/reviewer/SKILL.md +1 -4
  35. package/skills/agents/test-engineer/SKILL.md +1 -4
  36. package/skills/agents/verification-agent/SKILL.md +1 -4
  37. package/skills/massa-ai/SKILL.md +1 -0
  38. package/skills/massa-ai/references/audit-report-io.md +107 -0
  39. package/skills/massa-ai/workflows/judge-with-debate.md +171 -0
@@ -0,0 +1,171 @@
1
+ ### Judge With Debate
2
+
3
+ Use this workflow when the user explicitly asks to evaluate an artifact through multi-judge
4
+ debate — "judge this", "judge-with-debate", "evaluate with debate", "run the judges on X". The
5
+ user supplies artifact path(s) plus a task description (what the artifact was supposed to
6
+ accomplish) and optionally evaluation context. This is a standalone, explicit-route workflow: it
7
+ is never auto-selected by the router for generic review work (use `reviewer`, `*-audit`, or
8
+ `plan-critic` for those).
9
+
10
+ The protocol: a meta-judge authors a tailored evaluation specification **once**; three
11
+ independent judges score the artifact against it with quoted evidence; the judges debate their
12
+ disagreements over **up to 3 rounds**; the panel converges on a consensus verdict or reports an
13
+ honest no-consensus. Ported from the NeoLabHQ `judge-with-debate` pattern; this file is the
14
+ canonical contract here — repository contracts win on any conflict with the base.
15
+
16
+ Before the first substantive read, load `references/project-context.md` and run the
17
+ project-context intake sweep for the target repository (the workspace holding the artifact
18
+ under evaluation, which may differ from this repo).
19
+
20
+ Report contracts (paths, schemas, fidelity checklist) live in
21
+ `references/audit-report-io.md` → **Judge With Debate Report Contracts**. Dispatch contract,
22
+ capability packet, output contract, Name Resolution, and feedback labels live in
23
+ `references/agent-orchestration.md`.
24
+
25
+ ## Channel Discipline (non-negotiable)
26
+
27
+ - **Orchestrator → judges**: capability packet + the evaluation specification YAML verbatim.
28
+ - **Judges → orchestrator**: the structured reply block only (schema below). The orchestrator
29
+ **never opens `audits/judge/*.md` report files** — reports are the judge-to-judge channel.
30
+ Consensus is computed from reply blocks; the final synthesis is assembled from reply blocks.
31
+ - **Judges ↔ judges**: report files on disk, read directly by each judge during debate rounds.
32
+ The orchestrator never relays report content between judges.
33
+
34
+ ## Step 0 — Input validation
35
+
36
+ Before any dispatch:
37
+
38
+ 1. Artifact path(s) exist and are readable; task description is non-empty. Otherwise refuse and
39
+ name what is missing.
40
+ 2. Create `audits/judge/` under the target project root when missing. Resolve same-day
41
+ same-target collisions with the audit-report-io suffix rule (`-2`, `-3`, …) and state the
42
+ deviation.
43
+ 3. Assign report paths: `audits/judge/<YYYY-MM-DD judge-with-debate judge-N.md>` for N in 1..3
44
+ and `audits/judge/<YYYY-MM-DD judge-with-debate consensus.md>`.
45
+
46
+ ## Step 0.5 — Host capability probe (every invocation)
47
+
48
+ Check whether the host supports **dispatch-time model selection** (a per-dispatch model
49
+ parameter on the task/subagent tool). This probe runs on every invocation — when a host gains
50
+ the capability, per-slot diversity activates automatically with no harness edit.
51
+
52
+ - Probe positive → request per-slot models at dispatch: meta-judge `kimi-k3`, Judge 1
53
+ `deepseek-v4-pro`, Judge 2 `minimax-m3`, Judge 3 `GLM-5.2`.
54
+ - Probe negative (all four hosts today) → dispatch the charter-default artifacts and record the
55
+ unmet per-slot requests. Every fallback is named; if any slot fell back the consensus file and
56
+ the reply carry `DIVERSITY DEGRADED` with the actual model state. The mark is per-run, never a
57
+ standing state.
58
+ - A pinned-but-unavailable model falls back to the host default for that slot, named loudly in
59
+ the same way.
60
+
61
+ ## Step 1 — Meta-judge (exactly once)
62
+
63
+ Dispatch `massa-ai-meta-judge` (read-only) with the task description, artifact type, context,
64
+ and artifact paths. Model request: `kimi-k3` (see Step 0.5).
65
+
66
+ Validate the returned evaluation specification in two stages, in order; a retry names the
67
+ **first failed check** and nothing else:
68
+
69
+ 1. **Syntactic** — output parses as YAML (common failure: JSON-style braces or a prose wrapper).
70
+ 2. **Weights** — every `criteria[].weight` present, summing to 1.0 ± 0.001.
71
+ 3. **Semantic shape** — every criterion has `id`, `name`, `weight`, `scale` (min 1, max 5),
72
+ `rubric` with anchors for scores 1, 3, 5, and a `checklist` with ≥1 item. Parseable but
73
+ invalid specs (e.g. `scale.max: 7`) fail here, not at stage 1.
74
+
75
+ On failure: retry the meta-judge **once** with the failed stage + check name. Second failure →
76
+ stop `Blocked`. The meta-judge runs exactly once per evaluation — never re-run between rounds,
77
+ never edited by the orchestrator; the YAML passes to all judges in all rounds **verbatim**.
78
+
79
+ Feedback: `🤖 [Agent Started] Meta-Judge is authoring the evaluation specification.`
80
+ then `🤖 [Agent Done]` or `🤖 [Agent Blocked]` with the one-line reason.
81
+
82
+ ## Step 2 — Independent analysis (3 judges in parallel)
83
+
84
+ Dispatch three `massa-ai-judge` agents **in parallel** (round 0), one per judge number, each
85
+ with: the verbatim specification YAML, task description, artifact paths, its own report path,
86
+ `round: 0`, and its model request (Step 0.5). Each judge writes its own
87
+ `audits/judge/<...> judge-N.md` per the report contract and returns the reply block:
88
+
89
+ ```yaml
90
+ status: Complete | Partial | Blocked
91
+ judge: 1 | 2 | 3
92
+ round: 0 | 1 | 2 | 3
93
+ scores:
94
+ overall: <weighted score>
95
+ criteria: { <id>: <score>, ... }
96
+ agreement: accept-consensus | contest
97
+ strengths: [<≤3 items>]
98
+ weaknesses: [<≤3 items>]
99
+ revisions: [<criterion: old→new, evidence pointer>] # debate rounds only
100
+ risks_and_skips: <string>
101
+ next_step: <string>
102
+ ```
103
+
104
+ A reply block with malformed or missing `scores` counts as `contest` for that round; the same
105
+ judge malformed twice → stop `Blocked`. A judge dispatch that fails goes through Name Resolution
106
+ (`references/agent-orchestration.md`): the main agent runs that judge's scope locally against
107
+ the same output contract and marks the substitution in the consensus file; if a full marked
108
+ panel still cannot complete, stop `Blocked`. A silently reduced panel is never allowed.
109
+
110
+ ## Step 3 — Consensus check (from reply blocks only)
111
+
112
+ After every round (including round 0), compute step by step:
113
+
114
+ 1. Extract each judge's `scores.overall` and list them explicitly.
115
+ 2. max − min ≤ **0.5** → overall consensus candidate; otherwise no consensus.
116
+ 3. For every criterion, list the three scores side by side; max − min ≤ **1.0** on **every**
117
+ criterion → criterion consensus; otherwise name the contested criteria.
118
+ 4. Every judge's `agreement` is `accept-consensus`.
119
+
120
+ Consensus requires **all three** conditions. If consensus after round 0 → skip debate, go to
121
+ Step 5. If no consensus and rounds remain → Step 4. If no consensus after round 3 → Step 6.
122
+
123
+ ## Step 4 — Debate round (rounds 1..3, max 3)
124
+
125
+ Increment the round. Dispatch three `massa-ai-judge` agents **in parallel** again, each with:
126
+ the verbatim specification YAML (unchanged), task description, artifact paths, its own report
127
+ path, **all three** report paths as peer paths, and `round: R`. Each judge:
128
+
129
+ 1. Re-reads its own previous report and reads the peer reports from the filesystem directly.
130
+ 2. Identifies criterion disagreements (> 1.0 gap).
131
+ 3. Defends with quoted evidence; challenges with quoted counter-evidence.
132
+ 4. Revises a score **only** when peer evidence is compelling, quoting the new evidence.
133
+ 5. **Appends** a `## Debate Round {R}` section to its own file (append-only — never rewrites,
134
+ never creates a fresh file).
135
+ 6. Returns the reply block with revisited `scores`, `agreement`, and `revisions`.
136
+
137
+ Then return to Step 3.
138
+
139
+ ## Step 5 — Consensus report
140
+
141
+ Assemble from reply blocks only (never by opening judge files):
142
+
143
+ 1. Consensus score table (J1/J2/J3/mean per criterion + overall).
144
+ 2. Consensus strengths/weaknesses = the intersection of the judges' replies.
145
+ 3. Debate summary: rounds taken, initial disagreements, and how each resolved (from `revisions`).
146
+ 4. Final recommendation: Pass / Fail / Needs Revision with justification tied to the scores.
147
+ 5. Diversity line: `OK`, or `DIVERSITY DEGRADED` naming slots and actual models; local-fallback
148
+ marks when a Name Resolution local run substituted for a judge.
149
+
150
+ Write `audits/judge/<YYYY-MM-DD judge-with-debate consensus.md>` per the report contract
151
+ (freshness header + Verification/Test Fidelity Checklist) and reply the verdict to the user with
152
+ rounds taken and the diversity state.
153
+
154
+ ## Step 6 — No-consensus report
155
+
156
+ After round 3 without consensus: write the consensus-path file with
157
+ `Final Recommendation: NO CONSENSUS — human review required`, the per-judge score table showing
158
+ the unresolved gaps, the specific criteria that never converged, and an analysis of why. Reply
159
+ with the disagreement summary and the report paths. **Never emit a consensus verdict the panel
160
+ did not reach.**
161
+
162
+ ## Pitfalls (each is a rule, not advice)
163
+
164
+ - Never skip the meta-judge; never let judges score without the shared specification.
165
+ - Never modify or regenerate the specification between rounds — verbatim, every round.
166
+ - Never let a debate judge create a new report file — append-only `## Debate Round {R}` sections.
167
+ - Never relay reports between judges through the orchestrator — filesystem channel only.
168
+ - Never open judge report files in orchestrator context — reply blocks carry everything needed.
169
+ - Never accept a score revision without quoted evidence (sycophancy check).
170
+ - Never exceed 3 debate rounds or 3 judges — the protocol is fixed.
171
+ - Never treat a `contest` or malformed reply as agreement — missing scores mean no consensus.