@hve-squad/mcp 0.8.0 → 0.9.1
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.
- package/README.md +23 -3
- package/dist/src/engine/advisory-pipeline.js +25 -5
- package/dist/src/engine/council.js +24 -3
- package/dist/src/engine/delegated.js +10 -3
- package/dist/src/engine/embedded.js +10 -0
- package/dist/src/engine/persona.js +38 -2
- package/dist/src/engine/profiles.js +4 -3
- package/dist/src/engine/routing.js +60 -32
- package/dist/src/paths.js +16 -0
- package/dist/src/router/router.js +1 -0
- package/dist/src/server.js +1 -1
- package/generated/copilot-studio-connector/connector.manifest.json +1 -1
- package/generated/mcp-tools.schema.json +19 -1
- package/package.json +13 -6
- package/tools.catalog.yml +22 -6
package/README.md
CHANGED
|
@@ -17,14 +17,14 @@ This server has **two execution modes**, at different maturity levels. Be precis
|
|
|
17
17
|
| Mode | Host | State | Behaves as the full APM package? |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
19
|
| **Delegated** (stdio) | VS Code GitHub Copilot (local) | Works | **Yes** — VS Code dispatches the real deployed cast. Needs the built package + `apm install` of the cast; install with `npx -y @hve-squad/mcp` or a local build. |
|
|
20
|
-
| **Embedded advisory hero tools** (`squad_research`, `squad_review`, `squad_plan`, `squad_architect`) | Copilot Studio (remote HTTP) | Works, deployable via [host/RUNBOOK.md](host/RUNBOOK.md) | **Advisory parity.** Each runs one server-side dispatch via Azure OpenAI, resolving the **real from-disk persona from the full bundled cast** (
|
|
20
|
+
| **Embedded advisory hero tools** (`squad_research`, `squad_review`, `squad_plan`, `squad_architect`) | Copilot Studio (remote HTTP) | Works, deployable via [host/RUNBOOK.md](host/RUNBOOK.md) | **Advisory parity.** Each runs one server-side dispatch via Azure OpenAI, resolving the **real from-disk persona from the full bundled cast** (91 agents), under Entra auth, gates, tenant isolation and cost caps. Advisory (text) output only — no code execution or deploy. |
|
|
21
21
|
| **Embedded async advisory pipeline** (`squad_run`, `squad_status`) | Copilot Studio (remote HTTP) | **Works end-to-end; single-replica (file) or multi-replica (Azure Table)** | **Advisory parity — full cast, full advisory stages.** Data-driven routing runs research → plan → council → review → backlog over the real cast. Advisory (text) only; code-executing implement/deploy is a deferred execution expansion. |
|
|
22
22
|
| **Deterministic render** (`squad_render_pptx`) | Copilot Studio (remote HTTP) | Opt-in (`SQUAD_MCP_ENABLE_RENDER_PPTX=true`) | **First file-output tool.** Renders content YAML to a `.pptx` with in-image `python-pptx` and returns a short-lived Azure Blob **user-delegation SAS** download link (tenant-scoped path, SAS never logged, `Squad.Render` fail-closed scope, caller YAML is DATA). No model call. |
|
|
23
23
|
|
|
24
24
|
**The async pipeline (`squad_run`) runs the full advisory squad** — data-driven routing over the full bundled cast, sequencing research → plan → (council) → review → backlog-handoff and producing a finished, sectioned advisory artifact. It is **advisory parity**: finished text deliverables, not code-executing implement/deploy (that is a separate, deferred execution expansion). Specifics:
|
|
25
25
|
|
|
26
26
|
- **Off by default** (`SQUAD_MCP_REMOTE_PIPELINE_ENABLED=false`); the default remote surface is the advisory hero tools. Enabling the async pipeline requires a durable run-state backend.
|
|
27
|
-
- **Full cast + routing.** Requests are routed to the real roster roles (researcher → lead → council members → tester) resolved from the SHA-pinned
|
|
27
|
+
- **Full cast + routing.** Requests are routed to the real roster roles (researcher → lead → council members → tester) resolved from the SHA-pinned 91-agent cast bundle; the council is task-fit (one seat per lens the request touches) and synthesizes a most-restrictive-wins Council Verdict (Go / Go-With-Conditions / Stop). It honors `mode` (interactive pauses per stage; `autopilot`/`autonomous` run to one compiled artifact).
|
|
28
28
|
- **Releasable by an operator.** `squad_run` holds at a non-bypassable Human Gate; an operator with the distinct `Squad.Operate` app role releases a held run via the out-of-band `POST /admin/approve` route (never a `tools/call`), after which a `squad_status` poll drives it to completion. Approvals are audited (approver + timestamp) and tenant-scoped.
|
|
29
29
|
- **Two run-state backends** (`SQUAD_MCP_RUN_STATE_BACKEND`): `file` (single-replica, local dir) or `table` (Azure Table Storage, cross-replica ETag compare-and-swap). The `table` backend + a store-backed approval channel make release visible across replicas, so a **multi-replica / scale-to-zero** deployment is supported (WI-06). Per-stage artifacts, the Council Verdict, and caller `request`/`context` are AES-256-GCM encrypted at rest when a key is configured.
|
|
30
30
|
- **Long runs (>240s)** are handled by an optional background **worker** (an ACA Job): with `SQUAD_MCP_WORKER_ENABLED=true` the status poll is read-only and the worker drives approved runs off the request path (WI-1b4-WORKER).
|
|
@@ -96,6 +96,26 @@ The server surfaces it on the two catch-all entry points — a `discovery` input
|
|
|
96
96
|
|
|
97
97
|
**The embedded path never runs it.** An unattended run has nobody to interview, so no offer is made, an explicit `discovery=` is ignored rather than honored (and logged as `discovery_ignored_unattended`), and the caller's payload becomes the intake gate's input instead. The unattended path is therefore never ungated — it is gated by validation rather than by ideation, the only one of the two it can honestly perform.
|
|
98
98
|
|
|
99
|
+
### Task-fit council
|
|
100
|
+
|
|
101
|
+
`hve-squad@0.18.0` replaced the fixed four-role council quorum with a **task-fit** council. Each lens the work touches maps to one role, and only those roles are dispatched:
|
|
102
|
+
|
|
103
|
+
| Lens | Role | Dispatched when the request touches… |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
| Architecture | `architect` | structure, components, integration, or topology |
|
|
106
|
+
| Security | `security` | identity, secrets, exposure, threats, or regulated data |
|
|
107
|
+
| Cost | `cost-manager` | billable resources, budget, pricing, or FinOps |
|
|
108
|
+
| Product-fit | `product-owner` | scope, user-facing behavior, priorities, or acceptance criteria |
|
|
109
|
+
| RAI | `rai` | AI/ML behavior, model selection, training data, or agent autonomy |
|
|
110
|
+
|
|
111
|
+
The trigger is two or more of the first four lenses, or **any** responsible-AI concern on its own. A council can therefore be two roles, all five, or `rai` alone. The Council Verdict lists every lens left out under `Council Members Not Proposed` with its reason, so a narrow council stays auditable.
|
|
112
|
+
|
|
113
|
+
The **embedded/advisory pipeline** (`squad_run`) applies the same sizing in `route()`. When a needed council role is not in the seeded profile, the pipeline does not dispatch a partial council or synthesize a verdict for a lens it did not dispatch. Instead it records a `## Council Extension` section that names the roles to add (`full` seeds every council role) and continues to review, because the advisory pipeline has no implement stage to gate. In the **delegated** path, the coordinator persona carries the upstream contract: offer a missing role as a council extension, and treat a user's `## Council Waiver` as satisfying the Implementation Gate for that topic, never a Risk Gate.
|
|
114
|
+
|
|
115
|
+
### Model routing
|
|
116
|
+
|
|
117
|
+
`hve-squad@0.18.0` also added per-role model routing. **`squad_run`** and **`squad_federate`** take an optional `routing` input (`off`, `ranked`, or `manual`) that mirrors the new `/squad` and `/squad-federation` argument. In the **delegated** path it is forwarded verbatim: the coordinator persists it as the `Model routing:` line in `team.md`, `ranked` picks each role's model by fit from the squad model catalog, `manual` asks the user to choose from the models the host can run, and `off` dispatches with no model parameter. Omit it to keep the recorded mode. The **embedded** path ignores it (logged as `routing_ignored_unattended`), because it runs on the operator-configured backend.
|
|
118
|
+
|
|
99
119
|
## Execution model — delegated (local VS Code)
|
|
100
120
|
|
|
101
121
|
The Step 0.1 delegated-drive spike validated this path (Question A = PASS): VS Code Copilot auto-invokes the tool and drives its own in-host dispatch loop. The spike was a disposable de-risking exercise; it is **not** shipped with the package (it is git-ignored — see `.gitignore`). In the delegated (local) mode the server runs **no model**; it returns:
|
|
@@ -176,7 +196,7 @@ The package never writes your `.vscode/mcp.json` — the template is an example
|
|
|
176
196
|
|
|
177
197
|
## The manifest generator (drift check)
|
|
178
198
|
|
|
179
|
-
`generators/build-manifests.ts` reads the authored catalog plus the deployed squad sources — `squad-routing.instructions.md`, `squad-roster.instructions.md
|
|
199
|
+
`generators/build-manifests.ts` reads the authored catalog plus the deployed squad sources — `squad-routing.instructions.md`, the roster Cast Catalog (`skills/squad/references/roster-catalog.md` since `hve-squad@0.18.0`; `squad-roster.instructions.md` before it), and the `*.agent.md` personas — all **read-only**, validates them against each other, and emits the runtime descriptor `generated/mcp-tools.schema.json`.
|
|
180
200
|
|
|
181
201
|
The build **fails (exit non-zero)** when a catalog tool maps to a routing intent that is not a real routing row, or to a role/council agent that is not an installed agent. Run it with `npm run generate`; wire it into CI to catch catalog/cast drift.
|
|
182
202
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
import { composeEmbeddedPrompt } from "./embedded-prompt.js";
|
|
39
39
|
import { resolvePersonaForRole, resolvePersonaForRosterRole } from "./embedded-roles.js";
|
|
40
|
-
import { runCouncil, resolveCouncilMembers } from "./council.js";
|
|
40
|
+
import { renderCouncilExtension, runCouncil, resolveCouncilMembers, } from "./council.js";
|
|
41
41
|
import { loadRosterMap, route } from "./routing.js";
|
|
42
42
|
/** The roster role KEY the backlog-handoff stage resolves to. */
|
|
43
43
|
const BACKLOG_ROLE_KEY = "product-owner";
|
|
@@ -91,7 +91,8 @@ function resolveBacklogPersona(roots, rosterMap) {
|
|
|
91
91
|
*
|
|
92
92
|
* The intake gate is prepended only for a profile that seeds `intake-validator`
|
|
93
93
|
* (`product`, `full`); the council is interleaved between plan and review only
|
|
94
|
-
* when
|
|
94
|
+
* when it triggers — as a dispatched task-fit council when every needed role is
|
|
95
|
+
* seated, or as a non-dispatching council extension offer when one is not; the fan-out replaces the single Implement stage for a profile
|
|
95
96
|
* carrying two or more deliverable-producing roles. A research-only route stays
|
|
96
97
|
* a single research stage. Stages whose persona cannot be resolved are dropped
|
|
97
98
|
* (never a silent wrong persona).
|
|
@@ -131,9 +132,22 @@ export function planAdvisoryStages(plan, roots, rosterMap) {
|
|
|
131
132
|
if (plan.council.engaged) {
|
|
132
133
|
const members = resolveCouncilMembers(plan, roots);
|
|
133
134
|
if (members.length > 0) {
|
|
134
|
-
ordered.push({
|
|
135
|
+
ordered.push({
|
|
136
|
+
kind: "council",
|
|
137
|
+
role: "Council Verdict",
|
|
138
|
+
members,
|
|
139
|
+
notProposed: [...plan.council.notProposed],
|
|
140
|
+
});
|
|
135
141
|
}
|
|
136
142
|
}
|
|
143
|
+
else if (plan.council.extension.length > 0) {
|
|
144
|
+
ordered.push({
|
|
145
|
+
kind: "council",
|
|
146
|
+
role: "Council Extension",
|
|
147
|
+
extension: [...plan.council.extension],
|
|
148
|
+
notProposed: [...plan.council.notProposed],
|
|
149
|
+
});
|
|
150
|
+
}
|
|
137
151
|
// Deliverable fan-out: the profile's specialists each own a distinct artifact.
|
|
138
152
|
const fannedOutRoles = new Set();
|
|
139
153
|
for (const stage of plan.fanOut) {
|
|
@@ -233,8 +247,14 @@ export async function runAdvisoryPipeline(request, deps, opts = {}) {
|
|
|
233
247
|
};
|
|
234
248
|
}
|
|
235
249
|
const stage = orderedPlan[i];
|
|
236
|
-
if (stage.kind === "council" && stage.
|
|
237
|
-
const
|
|
250
|
+
if (stage.kind === "council" && stage.extension && stage.extension.length > 0) {
|
|
251
|
+
const markdown = renderCouncilExtension(stage.extension, stage.notProposed ?? []);
|
|
252
|
+
stages.push({ kind: "council", role: "Council Extension", section: markdown, text: markdown });
|
|
253
|
+
await deps.persistence?.recordStage({ role: "Council Extension", artifact: markdown });
|
|
254
|
+
await deps.ledger?.recordDecision(markdown);
|
|
255
|
+
}
|
|
256
|
+
else if (stage.kind === "council" && stage.members) {
|
|
257
|
+
const verdict = await runCouncil(stage.members, priorArtifact ?? "", request, councilDeps, stage.notProposed ?? []);
|
|
238
258
|
councilVerdict = verdict;
|
|
239
259
|
for (const usage of verdict.usage) {
|
|
240
260
|
deps.costLedger?.record(usage.estimatedCostUsd);
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* findings, following the advisory subset of
|
|
7
7
|
* `squad-src/.github/instructions/squad/squad-council.instructions.md`:
|
|
8
8
|
*
|
|
9
|
+
* * The council is TASK-FIT: only the roles whose lens the work touches are
|
|
10
|
+
* dispatched, and every lens left out is recorded under
|
|
11
|
+
* `Council Members Not Proposed` so a narrow council stays auditable.
|
|
9
12
|
* * Each member is dispatched against the SAME scoped input (the plan
|
|
10
13
|
* artifact), never threaded member-to-member — the council is a parallel
|
|
11
14
|
* go/no-go over one proposal, not a pipeline.
|
|
@@ -123,10 +126,11 @@ export function synthesizeVerdict(opinions) {
|
|
|
123
126
|
return { verdict: "Go", conditions: [] };
|
|
124
127
|
}
|
|
125
128
|
/** Render the `## Council Verdict` markdown section (advisory subset of the schema). */
|
|
126
|
-
function renderVerdict(verdict, conditions, opinions) {
|
|
129
|
+
function renderVerdict(verdict, conditions, opinions, notProposed) {
|
|
127
130
|
const lines = ["## Council Verdict", ""];
|
|
128
131
|
lines.push(`* Verdict: ${verdict}`);
|
|
129
132
|
lines.push(`* Council Members Dispatched: ${opinions.map((o) => o.agentName).join(", ")}`);
|
|
133
|
+
lines.push(`* Council Members Not Proposed: ${notProposed.length > 0 ? notProposed.map((o) => `${o.role} — ${o.reason}`).join("; ") : "none"}`);
|
|
130
134
|
lines.push("", "### Findings by Member", "");
|
|
131
135
|
lines.push("| Member | Verdict | Conditions |");
|
|
132
136
|
lines.push("| --- | --- | --- |");
|
|
@@ -150,6 +154,23 @@ function renderVerdict(verdict, conditions, opinions) {
|
|
|
150
154
|
// ---------------------------------------------------------------------------
|
|
151
155
|
// Member resolution + dispatch.
|
|
152
156
|
// ---------------------------------------------------------------------------
|
|
157
|
+
/**
|
|
158
|
+
* Render the council extension offer for a council that triggered but whose
|
|
159
|
+
* task-fit roles are not all on the seeded roster. No member is dispatched and
|
|
160
|
+
* no verdict is synthesized: the coordinator never covers a lens it did not
|
|
161
|
+
* dispatch. The advisory pipeline has no implement stage to gate, so the offer
|
|
162
|
+
* is recorded in the artifact rather than stopping the run.
|
|
163
|
+
*/
|
|
164
|
+
export function renderCouncilExtension(extension, notProposed) {
|
|
165
|
+
const lines = ["## Council Extension", ""];
|
|
166
|
+
lines.push(`* Roles to Add: ${extension.join(", ")}`);
|
|
167
|
+
lines.push(`* Council Members Not Proposed: ${notProposed.length > 0 ? notProposed.map((o) => `${o.role} — ${o.reason}`).join("; ") : "none"}`);
|
|
168
|
+
lines.push("* Verdict: none (council not dispatched)");
|
|
169
|
+
lines.push("", "The work needs council roles the seeded profile does not carry, so no Council Verdict was " +
|
|
170
|
+
"synthesized. Re-run with a profile that seeds them (`full` seeds every council role), or " +
|
|
171
|
+
"add the roles to the squad roster, before relying on this plan to gate implementation.");
|
|
172
|
+
return lines.join("\n");
|
|
173
|
+
}
|
|
153
174
|
/**
|
|
154
175
|
* Resolve a routed {@link RoutePlan}'s council member `agentName`s into ordered
|
|
155
176
|
* {@link PersonaRecord}s via the Phase 1 loader (`resolvePersonaForRole`, real
|
|
@@ -174,7 +195,7 @@ export function resolveCouncilMembers(plan, roots) {
|
|
|
174
195
|
* request/context are DATA, the member charter is the only AUTHORITY (SEC-5).
|
|
175
196
|
* Returns the structured verdict plus the rendered `## Council Verdict` block.
|
|
176
197
|
*/
|
|
177
|
-
export async function runCouncil(members, planArtifact, request, deps) {
|
|
198
|
+
export async function runCouncil(members, planArtifact, request, deps, notProposed = []) {
|
|
178
199
|
const opinions = await Promise.all(members.map(async (member) => {
|
|
179
200
|
// SEC-5 — member charter is the ONLY authority; plan + caller input are DATA.
|
|
180
201
|
const prompt = composeEmbeddedPrompt({
|
|
@@ -199,6 +220,6 @@ export async function runCouncil(members, planArtifact, request, deps) {
|
|
|
199
220
|
}));
|
|
200
221
|
const synth = synthesizeVerdict(opinions);
|
|
201
222
|
const usage = opinions.map((o) => o.usage).filter((u) => Boolean(u));
|
|
202
|
-
const markdown = renderVerdict(synth.verdict, synth.conditions, opinions);
|
|
223
|
+
const markdown = renderVerdict(synth.verdict, synth.conditions, opinions, notProposed);
|
|
203
224
|
return { verdict: synth.verdict, conditions: synth.conditions, members: opinions, usage, markdown };
|
|
204
225
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COORDINATOR_PERSONA, DISCOVERY_GATE_INSTRUCTIONS, FEDERATION_AUTOPILOT_NOTE, FEDERATION_COORDINATOR_PERSONA, FEDERATION_DETECTION_NOTE, GATE_INSTRUCTIONS, discoveryInstructions, modeInstructions, squadStateRoot, } from "./persona.js";
|
|
1
|
+
import { COORDINATOR_PERSONA, DISCOVERY_GATE_INSTRUCTIONS, FEDERATION_AUTOPILOT_NOTE, FEDERATION_COORDINATOR_PERSONA, FEDERATION_DETECTION_NOTE, GATE_INSTRUCTIONS, discoveryInstructions, modeInstructions, routingInstructions, squadStateRoot, } from "./persona.js";
|
|
2
2
|
import { LOCAL_MEMORY_TENANT } from "./squad-memory-resources.js";
|
|
3
3
|
/** True for the federation meta tool (routes across named sub-squads). */
|
|
4
4
|
function isFederationTool(tool) {
|
|
@@ -27,6 +27,10 @@ function composeSystemPrompt(tool, request) {
|
|
|
27
27
|
if (discoveryBlock.length > 0) {
|
|
28
28
|
blocks.push(discoveryBlock);
|
|
29
29
|
}
|
|
30
|
+
const routingBlock = routingInstructions(request.routing, federation);
|
|
31
|
+
if (routingBlock.length > 0) {
|
|
32
|
+
blocks.push(routingBlock);
|
|
33
|
+
}
|
|
30
34
|
// Surface federation resolution for the federation tool, or for any tool that
|
|
31
35
|
// did not pin a sub-squad (a plain repo ignores it; a federation repo needs it).
|
|
32
36
|
if (federation || !request.squad) {
|
|
@@ -73,8 +77,10 @@ function composeFramedRequest(tool, request) {
|
|
|
73
77
|
`"${tool.routingIntent}", tier: ${tierNote}) via your runSubagent/task tool ` +
|
|
74
78
|
"for this request. Do NOT perform the work inline; dispatch and report only", "after the subagent returns:");
|
|
75
79
|
if (tool.council.length > 0) {
|
|
76
|
-
lines.push("", "If this is a pre-implementation go/no-go
|
|
77
|
-
|
|
80
|
+
lines.push("", "If this is a pre-implementation go/no-go, crosses two or more council", `domains, or raises any RAI concern, also run a task-fit council (only the ` +
|
|
81
|
+
`seats whose lens the work touches, from ${tool.council.join(", ")}) and record a ` +
|
|
82
|
+
"Council Verdict, listing every lens left out under Council Members Not Proposed, " +
|
|
83
|
+
"before any implementer dispatches.");
|
|
78
84
|
}
|
|
79
85
|
if (request.squad) {
|
|
80
86
|
lines.push("", `Scope this dispatch to the **${request.squad}** federation sub-squad ` +
|
|
@@ -150,6 +156,7 @@ async function composeStateContext(request, memory) {
|
|
|
150
156
|
`- owner: ${request.owner ?? "(role-only dispatch)"}`,
|
|
151
157
|
`- mode: ${request.mode ?? "(interactive)"}`,
|
|
152
158
|
`- discovery: ${request.discovery ?? "(no explicit depth; offer once when the trigger holds)"}`,
|
|
159
|
+
`- model routing: ${request.routing ?? "(as recorded in team.md; none recorded dispatches with no model parameter)"}`,
|
|
153
160
|
];
|
|
154
161
|
// Optional bounded prior-context digest (Step 4.1). With NO store injected the
|
|
155
162
|
// block is never appended, so the output is BYTE-IDENTICAL to the advisory-only
|
|
@@ -200,6 +200,10 @@ export class EmbeddedCoordinator {
|
|
|
200
200
|
* made, an explicit depth is ignored rather than honored, and the caller's
|
|
201
201
|
* payload becomes the intake gate's input instead. An unattended run is gated by
|
|
202
202
|
* validation, not by ideation.
|
|
203
|
+
*
|
|
204
|
+
* `request.routing` is ignored for the same reason: per-role model routing is
|
|
205
|
+
* a `team.md` decision the host's coordinator owns (and `manual` interviews the
|
|
206
|
+
* user), while this path runs on the operator-configured backend.
|
|
203
207
|
*/
|
|
204
208
|
async handle(tool, request, ctx) {
|
|
205
209
|
const matchedRouting = toMatchedRouting(tool);
|
|
@@ -210,6 +214,12 @@ export class EmbeddedCoordinator {
|
|
|
210
214
|
requested: request.discovery,
|
|
211
215
|
});
|
|
212
216
|
}
|
|
217
|
+
if (request.routing) {
|
|
218
|
+
this.logger?.info("routing_ignored_unattended", {
|
|
219
|
+
toolId: tool.id,
|
|
220
|
+
requested: request.routing,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
213
223
|
// SEC-9 / COST-1 / COST-2 — admit under quota before any work.
|
|
214
224
|
const admit = this.quota.acquire(tenantId);
|
|
215
225
|
if (!admit.ok) {
|
|
@@ -143,8 +143,12 @@ export const GATE_INSTRUCTIONS = [
|
|
|
143
143
|
"confirm the methodology artifacts exist: a research artifact under",
|
|
144
144
|
"`.copilot-tracking/research/`, a plan under `.copilot-tracking/plans/`, and —",
|
|
145
145
|
"when the request crosses two or more council domains (architecture, security,",
|
|
146
|
-
"cost, product-fit
|
|
147
|
-
"`.copilot-tracking/squad/decisions.md`.
|
|
146
|
+
"cost, product-fit) or raises any RAI concern — a non-`Stop` Council Verdict,",
|
|
147
|
+
"or a user's `## Council Waiver`, in `.copilot-tracking/squad/decisions.md`.",
|
|
148
|
+
"Size the council to the work: dispatch only the role for each lens the work",
|
|
149
|
+
"touches and record every lens left out under `Council Members Not Proposed`;",
|
|
150
|
+
"offer a needed council role the roster lacks as a council extension rather",
|
|
151
|
+
"than covering its lens yourself. When a precondition is unmet, dispatch",
|
|
148
152
|
"the missing stage (or escalate); never produce the missing research, plan, or",
|
|
149
153
|
"verdict yourself. On a `Stop` verdict, escalate rather than dispatch.",
|
|
150
154
|
"",
|
|
@@ -244,6 +248,38 @@ export function discoveryInstructions(discovery) {
|
|
|
244
248
|
"you could not dispatch. Record the verdict with `Opt-In: explicit-input`.",
|
|
245
249
|
].join("\n");
|
|
246
250
|
}
|
|
251
|
+
/** The per-role model routing modes the `/squad` prompt accepts (hve-squad 0.18.0). */
|
|
252
|
+
export const MODEL_ROUTING_MODES = ["off", "ranked", "manual"];
|
|
253
|
+
/**
|
|
254
|
+
* The per-turn model routing disposition, paraphrased from the `/squad` and
|
|
255
|
+
* `/squad-federation` prompts and `references/model-routing.md`. Appended only
|
|
256
|
+
* when the caller supplied an explicit `routing=` input; when it is omitted the
|
|
257
|
+
* coordinator applies the mode already recorded in `team.md`.
|
|
258
|
+
*/
|
|
259
|
+
export function routingInstructions(routing, federation = false) {
|
|
260
|
+
const mode = (routing ?? "").trim().toLowerCase();
|
|
261
|
+
if (!MODEL_ROUTING_MODES.includes(mode)) {
|
|
262
|
+
return "";
|
|
263
|
+
}
|
|
264
|
+
const lines = [
|
|
265
|
+
`**Model routing = ${mode} (explicit input).** Pass \`routing=${mode}\` to the coordinator`,
|
|
266
|
+
"verbatim; it persists the mode as the `Model routing:` line in `team.md` until changed.",
|
|
267
|
+
];
|
|
268
|
+
if (mode === "ranked") {
|
|
269
|
+
lines.push("`ranked` picks each role's model by fit from the squad model catalog and shows the", "picks in `team.md`'s `Model` column; every non-Scribe dispatch passes that cell verbatim.");
|
|
270
|
+
}
|
|
271
|
+
else if (mode === "manual") {
|
|
272
|
+
lines.push("`manual` asks the user, before any dispatch, to accept the suggestions or choose per", "assignment class and then per role, offering only models this host can run; every", "non-Scribe dispatch passes the recorded `Model` cell verbatim.");
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
lines.push("`off` removes the `Model` column and dispatches with no model parameter.");
|
|
276
|
+
}
|
|
277
|
+
lines.push("The Scribe never inherits the session model under any mode.");
|
|
278
|
+
if (federation) {
|
|
279
|
+
lines.push("Forward the mode to every selected sub-squad exactly as profile and tier are", "forwarded; a sub-squad may narrow it, never widen or substitute it.");
|
|
280
|
+
}
|
|
281
|
+
return lines.join("\n");
|
|
282
|
+
}
|
|
247
283
|
/**
|
|
248
284
|
* Federation-level autopilot note, paraphrased from
|
|
249
285
|
* squad-src/.github/instructions/squad/squad-federation-autopilot.instructions.md.
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { readFileSync } from "node:fs";
|
|
21
21
|
import { join } from "node:path";
|
|
22
|
-
import { resolveSquadGithubRoot } from "../paths.js";
|
|
22
|
+
import { resolveSquadGithubRoot, rosterCatalogPath } from "../paths.js";
|
|
23
23
|
import { parseTables } from "./markdown-table.js";
|
|
24
24
|
/** The profile seeded when the caller names none, or names one that does not exist. */
|
|
25
25
|
export const DEFAULT_PROFILE = "default";
|
|
@@ -138,7 +138,7 @@ export function parseDeliverableRoots(markdown) {
|
|
|
138
138
|
export function parseCastCatalog(markdown) {
|
|
139
139
|
const table = parseTables(markdown).find((t) => t.headers.some((h) => h.toLowerCase().includes("primary agent")));
|
|
140
140
|
if (!table) {
|
|
141
|
-
throw new Error("Could not find the Cast Catalog table in
|
|
141
|
+
throw new Error("Could not find the Cast Catalog table in roster-catalog.md.");
|
|
142
142
|
}
|
|
143
143
|
const roleIdx = table.headers.findIndex((h) => h.trim().toLowerCase() === "role");
|
|
144
144
|
const primaryIdx = table.headers.findIndex((h) => h.toLowerCase().includes("primary agent"));
|
|
@@ -170,10 +170,11 @@ export function loadProfileTables(githubRoot = resolveSquadGithubRoot()) {
|
|
|
170
170
|
throw new Error("Could not resolve the squad .github root (squad-roster.instructions.md not found).");
|
|
171
171
|
}
|
|
172
172
|
const rosterMd = readFileSync(join(githubRoot, "instructions", "squad", "squad-roster.instructions.md"), "utf8");
|
|
173
|
+
const catalogMd = readFileSync(rosterCatalogPath(githubRoot), "utf8");
|
|
173
174
|
return {
|
|
174
175
|
profiles: parseProfiles(rosterMd),
|
|
175
176
|
deliverableRoots: parseDeliverableRoots(rosterMd),
|
|
176
|
-
cast: parseCastCatalog(
|
|
177
|
+
cast: parseCastCatalog(catalogMd),
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
180
|
/**
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
* — the "Default Routing Rules" table (intent keyword -> role, autonomy
|
|
11
11
|
* tier, parallel-eligibility) used for classification and per-stage
|
|
12
12
|
* tier/parallel resolution.
|
|
13
|
-
* * squad-src/.github/
|
|
13
|
+
* * squad-src/.github/skills/squad/references/roster-catalog.md
|
|
14
14
|
* — the "Cast Catalog" table (role KEY -> Primary Agent `name:`) used as
|
|
15
|
-
* the role -> agentName resolver
|
|
15
|
+
* the role -> agentName resolver (in `squad-roster.instructions.md`
|
|
16
|
+
* before hve-squad 0.18.0; see `rosterCatalogPath`). This is exactly the injectable map the
|
|
16
17
|
* Phase 1 persona loader helpers (`loadPersonaForRosterRole` /
|
|
17
18
|
* `resolvePersonaForRosterRole`) consume.
|
|
18
19
|
*
|
|
@@ -26,15 +27,16 @@
|
|
|
26
27
|
*
|
|
27
28
|
* research (`researcher`)
|
|
28
29
|
* -> plan (`lead`)
|
|
29
|
-
* -> council (
|
|
30
|
-
*
|
|
30
|
+
* -> council (task-fit: one role per lens the request touches, from
|
|
31
|
+
* `architect`, `security`, `cost-manager`, `product-owner`,
|
|
32
|
+
* `rai`)
|
|
31
33
|
* -> review (`tester`)
|
|
32
34
|
* -> backlog-handoff
|
|
33
35
|
*
|
|
34
36
|
* The linear pipeline stages returned in {@link RoutePlan.stages} are
|
|
35
37
|
* research -> plan -> review; the council is surfaced separately in
|
|
36
|
-
* {@link RoutePlan.council} (
|
|
37
|
-
* council
|
|
38
|
+
* {@link RoutePlan.council} (triggered when the request crosses two or more
|
|
39
|
+
* council lenses or raises any RAI concern) so Phase 3 can interleave it between plan and review without
|
|
38
40
|
* this Phase re-planning. A single research-type request routes to the single
|
|
39
41
|
* `researcher` stage only.
|
|
40
42
|
*
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
*/
|
|
45
47
|
import { readFileSync } from "node:fs";
|
|
46
48
|
import { join } from "node:path";
|
|
47
|
-
import { resolveSquadGithubRoot } from "../paths.js";
|
|
49
|
+
import { resolveSquadGithubRoot, rosterCatalogPath } from "../paths.js";
|
|
48
50
|
import { defaultProfileTables, INTAKE_VALIDATOR_ROLE, resolveProfile, } from "./profiles.js";
|
|
49
51
|
// ---------------------------------------------------------------------------
|
|
50
52
|
// Markdown table parsing lives in `markdown-table.ts` so the router, the profile
|
|
@@ -88,7 +90,7 @@ export function parseRoutingIntents(markdown) {
|
|
|
88
90
|
export function parseRosterMap(markdown) {
|
|
89
91
|
const table = parseTables(markdown).find((t) => t.headers.some((h) => h.toLowerCase().includes("primary agent")));
|
|
90
92
|
if (!table) {
|
|
91
|
-
throw new Error("Could not find the roster cast catalog (Primary Agent) in
|
|
93
|
+
throw new Error("Could not find the roster cast catalog (Primary Agent) in roster-catalog.md.");
|
|
92
94
|
}
|
|
93
95
|
const roleIdx = table.headers.findIndex((h) => h.trim().toLowerCase() === "role");
|
|
94
96
|
const primaryIdx = table.headers.findIndex((h) => h.toLowerCase().includes("primary agent"));
|
|
@@ -111,7 +113,7 @@ export function loadRoutingTables(githubRoot = resolveSquadGithubRoot()) {
|
|
|
111
113
|
throw new Error("Could not resolve the squad .github root (squad-routing.instructions.md not found).");
|
|
112
114
|
}
|
|
113
115
|
const routingMd = readFileSync(join(githubRoot, "instructions", "squad", "squad-routing.instructions.md"), "utf8");
|
|
114
|
-
const rosterMd = readFileSync(
|
|
116
|
+
const rosterMd = readFileSync(rosterCatalogPath(githubRoot), "utf8");
|
|
115
117
|
return {
|
|
116
118
|
intents: parseRoutingIntents(routingMd),
|
|
117
119
|
rosterMap: parseRosterMap(rosterMd),
|
|
@@ -129,14 +131,24 @@ export function loadRosterMap(githubRoot = resolveSquadGithubRoot()) {
|
|
|
129
131
|
const RESEARCH_ROLE = "researcher";
|
|
130
132
|
const PLAN_ROLE = "lead";
|
|
131
133
|
const REVIEW_ROLE = "tester";
|
|
132
|
-
/** Council member role KEYS (base four + optional `rai`). */
|
|
133
|
-
const COUNCIL_BASE_ROLES = ["architect", "security", "cost-manager", "product-owner"];
|
|
134
|
-
const RAI_ROLE = "rai";
|
|
135
134
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
|
|
135
|
+
* The council LENSES, each mapped to the one role that covers it, in the order
|
|
136
|
+
* `squad-council.instructions.md` lists them. The council has no fixed quorum:
|
|
137
|
+
* only the roles whose lens the request touches are dispatched.
|
|
138
|
+
*/
|
|
139
|
+
const COUNCIL_LENSES = [
|
|
140
|
+
{ lens: "architecture", role: "architect" },
|
|
141
|
+
{ lens: "security", role: "security" },
|
|
142
|
+
{ lens: "cost", role: "cost-manager" },
|
|
143
|
+
{ lens: "product", role: "product-owner" },
|
|
144
|
+
{ lens: "rai", role: "rai" },
|
|
145
|
+
];
|
|
146
|
+
const RAI_LENS = "rai";
|
|
147
|
+
/**
|
|
148
|
+
* Council LENSES and their trigger keywords. The router triggers the council
|
|
149
|
+
* when a request crosses two or more of the architecture, security, cost, and
|
|
150
|
+
* product-fit lenses, or raises any responsible-AI concern (mirrors the council
|
|
151
|
+
* triggers and the Implementation Gate).
|
|
140
152
|
*/
|
|
141
153
|
const COUNCIL_DOMAINS = {
|
|
142
154
|
architecture: ["architecture", "architectural", "system design", "component", "design tradeoff"],
|
|
@@ -145,6 +157,11 @@ const COUNCIL_DOMAINS = {
|
|
|
145
157
|
product: ["product", "requirement", "backlog", "prd", "brd", "user story", "roadmap", "epic"],
|
|
146
158
|
rai: ["responsible ai", "rai", "fairness", "harm", "bias"],
|
|
147
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* Keywords matched as WHOLE words. A single RAI concern now triggers the council
|
|
162
|
+
* on its own, so `rai` must not prefix-match `raise` or `rain`.
|
|
163
|
+
*/
|
|
164
|
+
const WHOLE_WORD_KEYWORDS = new Set(["rai"]);
|
|
148
165
|
/** Keywords that identify the research intent (research-only detection). */
|
|
149
166
|
const RESEARCH_KEYWORDS = ["research", "investigate", "explore", "find out"];
|
|
150
167
|
/**
|
|
@@ -153,7 +170,8 @@ const RESEARCH_KEYWORDS = ["research", "investigate", "explore", "find out"];
|
|
|
153
170
|
*/
|
|
154
171
|
function keywordPresent(haystack, keyword) {
|
|
155
172
|
const escaped = keyword.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
156
|
-
|
|
173
|
+
const end = WHOLE_WORD_KEYWORDS.has(keyword) ? "(?![a-z0-9])" : "";
|
|
174
|
+
return new RegExp(`(^|[^a-z0-9])${escaped}${end}`, "i").test(haystack);
|
|
157
175
|
}
|
|
158
176
|
/** Find the routing row that owns a canonical keyword (e.g. `research`, `plan`, `review`). */
|
|
159
177
|
function findIntentRow(tables, keyword) {
|
|
@@ -194,8 +212,8 @@ function crossedCouncilDomains(request) {
|
|
|
194
212
|
* no council domain, no mode/full-profile override) routes to the single
|
|
195
213
|
* `researcher` stage.
|
|
196
214
|
* * Any other request is a full advisory request and routes to
|
|
197
|
-
* research -> plan -> review, with
|
|
198
|
-
* crosses two or more council
|
|
215
|
+
* research -> plan -> review, with a task-fit council triggered when the
|
|
216
|
+
* request crosses two or more council lenses or raises any RAI concern.
|
|
199
217
|
*/
|
|
200
218
|
export function computeRoutePlan(request, opts = {}, tables, profileTables) {
|
|
201
219
|
const lower = request.toLowerCase();
|
|
@@ -222,7 +240,7 @@ export function computeRoutePlan(request, opts = {}, tables, profileTables) {
|
|
|
222
240
|
if (researchMatched && !otherMatched) {
|
|
223
241
|
return {
|
|
224
242
|
stages: [researchStage].filter(seeded),
|
|
225
|
-
council: { engaged: false, members: [],
|
|
243
|
+
council: { engaged: false, members: [], extension: [], notProposed: [] },
|
|
226
244
|
profile: profile.name,
|
|
227
245
|
intake,
|
|
228
246
|
fanOut,
|
|
@@ -234,25 +252,35 @@ export function computeRoutePlan(request, opts = {}, tables, profileTables) {
|
|
|
234
252
|
buildStage(tables, PLAN_ROLE, "plan", "confirm", false),
|
|
235
253
|
buildStage(tables, REVIEW_ROLE, "review", "auto", true),
|
|
236
254
|
].filter(seeded);
|
|
237
|
-
const
|
|
238
|
-
const missingQuorum = councilCrossed
|
|
239
|
-
? COUNCIL_BASE_ROLES.filter((role) => !profile.seeded.has(role))
|
|
240
|
-
: [];
|
|
241
|
-
const memberRoles = councilCrossed && missingQuorum.length === 0
|
|
242
|
-
? [
|
|
243
|
-
...COUNCIL_BASE_ROLES,
|
|
244
|
-
...(councilDomains.includes(RAI_ROLE) && profile.seeded.has(RAI_ROLE) ? [RAI_ROLE] : []),
|
|
245
|
-
]
|
|
246
|
-
: [];
|
|
247
|
-
const members = memberRoles.map((roleKey) => resolveAgent(tables, roleKey));
|
|
255
|
+
const council = planCouncil(councilDomains, profile.seeded, tables);
|
|
248
256
|
return {
|
|
249
257
|
stages,
|
|
250
|
-
council
|
|
258
|
+
council,
|
|
251
259
|
profile: profile.name,
|
|
252
260
|
intake,
|
|
253
261
|
fanOut,
|
|
254
262
|
};
|
|
255
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Size the council to the work (`squad-council.instructions.md` *Council
|
|
266
|
+
* Membership*). The trigger is unchanged in spirit — two or more of the
|
|
267
|
+
* architecture/security/cost/product-fit lenses, or any RAI concern — but the
|
|
268
|
+
* membership is task-fit: one role per lens touched, every other lens recorded
|
|
269
|
+
* as not proposed. A needed role the profile did not seed becomes the council
|
|
270
|
+
* extension, and the council is not engaged until it is seated.
|
|
271
|
+
*/
|
|
272
|
+
function planCouncil(councilDomains, seeded, tables) {
|
|
273
|
+
const classicLenses = councilDomains.filter((domain) => domain !== RAI_LENS);
|
|
274
|
+
const triggered = classicLenses.length >= 2 || councilDomains.includes(RAI_LENS);
|
|
275
|
+
if (!triggered) {
|
|
276
|
+
return { engaged: false, members: [], extension: [], notProposed: [] };
|
|
277
|
+
}
|
|
278
|
+
const needed = COUNCIL_LENSES.filter(({ lens }) => councilDomains.includes(lens)).map(({ role }) => role);
|
|
279
|
+
const notProposed = COUNCIL_LENSES.filter(({ lens }) => !councilDomains.includes(lens)).map(({ lens, role }) => ({ role, reason: `the request does not touch the ${lens} lens` }));
|
|
280
|
+
const extension = needed.filter((role) => !seeded.has(role));
|
|
281
|
+
const members = extension.length === 0 ? needed.map((role) => resolveAgent(tables, role)) : [];
|
|
282
|
+
return { engaged: members.length > 0, members, extension, notProposed };
|
|
283
|
+
}
|
|
256
284
|
let cachedTables;
|
|
257
285
|
/** The default routing tables, parsed from disk once and cached. */
|
|
258
286
|
function defaultTables() {
|
package/dist/src/paths.js
CHANGED
|
@@ -75,6 +75,22 @@ export function resolveSquadGithubRoot(fromPackageRoot = packageRoot()) {
|
|
|
75
75
|
}
|
|
76
76
|
return undefined;
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Resolve the file holding the roster Cast Catalog table (role -> Primary and
|
|
80
|
+
* Alternate agents) under a squad `.github` root.
|
|
81
|
+
*
|
|
82
|
+
* `hve-squad@0.18.0` moved the table out of `squad-roster.instructions.md` into
|
|
83
|
+
* the squad skill's `references/roster-catalog.md`, which every layout places at
|
|
84
|
+
* `<root>/skills/squad/references/`. The roster instructions stay the fallback so
|
|
85
|
+
* a consumer still on an older APM install keeps resolving roles.
|
|
86
|
+
*/
|
|
87
|
+
export function rosterCatalogPath(githubRoot) {
|
|
88
|
+
const relocated = join(githubRoot, "skills", "squad", "references", "roster-catalog.md");
|
|
89
|
+
if (existsSync(relocated)) {
|
|
90
|
+
return relocated;
|
|
91
|
+
}
|
|
92
|
+
return join(githubRoot, "instructions", "squad", "squad-roster.instructions.md");
|
|
93
|
+
}
|
|
78
94
|
/**
|
|
79
95
|
* Resolve the candidate `agents/` directories that may hold the `*.agent.md`
|
|
80
96
|
* personas, in priority order, filtered to those that exist.
|
|
@@ -79,6 +79,7 @@ export class ToolRouter {
|
|
|
79
79
|
owner: optionalString(record.owner),
|
|
80
80
|
mode: optionalString(record.mode),
|
|
81
81
|
discovery: optionalString(record.discovery),
|
|
82
|
+
routing: optionalString(record.routing),
|
|
82
83
|
context: optionalString(record.context),
|
|
83
84
|
squad: optionalString(record.squad),
|
|
84
85
|
init: record.init === true,
|
package/dist/src/server.js
CHANGED
|
@@ -29,7 +29,7 @@ export const SERVER_NAME = "hve-squad-mcp";
|
|
|
29
29
|
* image than in development. A constant plus a failing test is the cheaper and
|
|
30
30
|
* more honest guarantee.
|
|
31
31
|
*/
|
|
32
|
-
export const SERVER_VERSION = "0.
|
|
32
|
+
export const SERVER_VERSION = "0.9.1";
|
|
33
33
|
/**
|
|
34
34
|
* Render an engine result into MCP tool-call content. For delegated execution
|
|
35
35
|
* this is the "charter contract": the persona to adopt, the matched routing,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{
|
|
21
21
|
"name": "squad_review",
|
|
22
22
|
"title": "Squad Review",
|
|
23
|
-
"description": "Run the squad's review stage. Routes to the Squad Reviewer (squad `tester` role) at the `auto` tier for quality, correctness, and standards review. When the request asks for a pre-implementation go/no-go
|
|
23
|
+
"description": "Run the squad's review stage. Routes to the Squad Reviewer (squad `tester` role) at the `auto` tier for quality, correctness, and standards review. When the request asks for a pre-implementation go/no-go, crosses two or more council domains, or raises any responsible-AI concern, it engages a task-fit council at the `confirm` tier: only the seats whose lens the work touches (architect, security, cost-manager, product-owner, rai), with every lens left out recorded in the verdict. Embedded execution (squad-guided / embedded): the server runs the review stage under the squad's gates and methodology and returns a finished reviewer artifact (a single reviewer pass, not a convened council verdict). Use for \"review\", \"validate\", \"check quality\", \"council\", or \"go/no-go\" requests.",
|
|
24
24
|
"scope": "Squad.Review"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
{
|
|
148
148
|
"name": "squad_review",
|
|
149
149
|
"title": "Squad Review",
|
|
150
|
-
"description": "Run the squad's review stage. Routes to the Squad Reviewer (squad `tester` role) at the `auto` tier for quality, correctness, and standards review. When the request asks for a pre-implementation go/no-go
|
|
150
|
+
"description": "Run the squad's review stage. Routes to the Squad Reviewer (squad `tester` role) at the `auto` tier for quality, correctness, and standards review. When the request asks for a pre-implementation go/no-go, crosses two or more council domains, or raises any responsible-AI concern, it engages a task-fit council at the `confirm` tier: only the seats whose lens the work touches (architect, security, cost-manager, product-owner, rai), with every lens left out recorded in the verdict. Delegated execution: returns the Coordinator persona, matched routing, and a framed dispatch request. Use for \"review\", \"validate\", \"check quality\", \"council\", or \"go/no-go\" requests.",
|
|
151
151
|
"inputSchema": {
|
|
152
152
|
"type": "object",
|
|
153
153
|
"additionalProperties": false,
|
|
@@ -349,6 +349,15 @@
|
|
|
349
349
|
],
|
|
350
350
|
"description": "Optional discovery-gate depth for a request that states a goal with no requirement artifact behind it: quick (analyst), standard (designer then analyst), deep (designer, then challenger and experimenter, then analyst), or skip. An explicit depth beats the coordinator's one-time offer. Ignored on an unattended run, which has nobody for the gate to interview."
|
|
351
351
|
},
|
|
352
|
+
"routing": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"enum": [
|
|
355
|
+
"off",
|
|
356
|
+
"ranked",
|
|
357
|
+
"manual"
|
|
358
|
+
],
|
|
359
|
+
"description": "Optional per-role model routing mode, persisted in team.md until changed: ranked (pick each role's model by fit from the squad model catalog), manual (ask you to choose each role's model from the models this host can run), or off (no Model column; dispatch with no model parameter). Omit to keep the recorded mode. Ignored on an unattended run."
|
|
360
|
+
},
|
|
352
361
|
"context": {
|
|
353
362
|
"type": "string",
|
|
354
363
|
"description": "Optional free-form context to frame the pipeline."
|
|
@@ -442,6 +451,15 @@
|
|
|
442
451
|
],
|
|
443
452
|
"description": "Optional discovery-gate depth, asked once at the federation level and applied per qualifying sub-squad: quick (analyst), standard (designer then analyst), deep (designer, then challenger and experimenter, then analyst), or skip. Each qualifying sub-squad runs its own session and writes its own brief and verdict under its own root. Ignored on an unattended run."
|
|
444
453
|
},
|
|
454
|
+
"routing": {
|
|
455
|
+
"type": "string",
|
|
456
|
+
"enum": [
|
|
457
|
+
"off",
|
|
458
|
+
"ranked",
|
|
459
|
+
"manual"
|
|
460
|
+
],
|
|
461
|
+
"description": "Optional per-role model routing mode (off, ranked, or manual), forwarded verbatim to every selected sub-squad's coordinator run; each sub-squad persists it in its own team.md and may only narrow it, never widen or substitute it. Ignored on an unattended run."
|
|
462
|
+
},
|
|
445
463
|
"context": {
|
|
446
464
|
"type": "string",
|
|
447
465
|
"description": "Optional free-form context to frame the federation turn."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hve-squad/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Outbound Model Context Protocol (MCP) server that exposes the hve-squad as coarse intent tools (squad_research, squad_plan, squad_review, squad_architect, squad_run) plus squad_federate for the opt-in federation of named sub-squads, to MCP hosts such as VS Code GitHub Copilot. Phase 0: local stdio, delegated execution.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,20 +39,27 @@
|
|
|
39
39
|
"release:prep": "tsx scripts/release-prep.ts",
|
|
40
40
|
"test": "node --import tsx --test \"test/**/*.test.ts\"",
|
|
41
41
|
"test:conformance": "node --import tsx --test \"test/conformance/**/*.test.ts\"",
|
|
42
|
+
"docs:build": "eleventy && pagefind --site _site && node scripts/check-docs.mjs",
|
|
43
|
+
"docs:dev": "npm run docs:build && eleventy --serve --port=4173",
|
|
44
|
+
"docs:check": "node scripts/check-docs.mjs",
|
|
45
|
+
"docs:test": "node --test test/docs/*.test.mjs",
|
|
42
46
|
"start": "node dist/src/server.js",
|
|
43
47
|
"start:http": "node dist/src/server-http.js",
|
|
44
48
|
"start:worker": "node dist/src/worker-main.js"
|
|
45
49
|
},
|
|
46
50
|
"dependencies": {
|
|
47
|
-
"@azure/identity": "^4.
|
|
48
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
51
|
+
"@azure/identity": "^4.14.0",
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
49
53
|
"ajv": "^8.17.1",
|
|
50
|
-
"jose": "^6.2.
|
|
54
|
+
"jose": "^6.2.13",
|
|
51
55
|
"yaml": "^2.9.1"
|
|
52
56
|
},
|
|
53
57
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"
|
|
58
|
+
"@11ty/eleventy": "3.1.6",
|
|
59
|
+
"@types/node": "^26.6.5",
|
|
60
|
+
"cheerio": "1.2.0",
|
|
61
|
+
"pagefind": "1.5.2",
|
|
62
|
+
"tsx": "^4.23.15",
|
|
56
63
|
"typescript": "^7.0.2"
|
|
57
64
|
},
|
|
58
65
|
"engines": {
|
package/tools.catalog.yml
CHANGED
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
# Per-tool `input` mirrors the `/squad` prompt arguments
|
|
27
27
|
# (squad-src/.github/prompts/squad/squad.prompt.md):
|
|
28
28
|
# request (required), profile, tier, owner, mode, context, the optional
|
|
29
|
-
# discovery-gate depth on the two catch-all tools, and
|
|
30
|
-
# `squad` sub-squad target (plus `init` on squad_federate).
|
|
29
|
+
# discovery-gate depth and model-routing mode on the two catch-all tools, and
|
|
30
|
+
# the optional federation `squad` sub-squad target (plus `init` on squad_federate).
|
|
31
31
|
#
|
|
32
32
|
# Execution model (Phase 0): DELEGATED. The tool returns the Coordinator
|
|
33
33
|
# persona + matched routing + framed request; the calling host (VS Code GitHub
|
|
@@ -47,6 +47,11 @@ conventions:
|
|
|
47
47
|
# gate interviews a human, so an unattended run ignores the input entirely.
|
|
48
48
|
# See squad-src/.github/instructions/squad/squad-discovery-gate.instructions.md.
|
|
49
49
|
discoveryDepths: [quick, standard, deep, skip]
|
|
50
|
+
# Per-role model routing modes (hve-squad 0.18.0), forwarded to the coordinator
|
|
51
|
+
# on the attended (delegated) path only; the embedded engine runs its own
|
|
52
|
+
# configured backend and ignores the input.
|
|
53
|
+
# See squad-src/.github/skills/squad/references/model-routing.md.
|
|
54
|
+
modelRouting: [off, ranked, manual]
|
|
50
55
|
stateRoot: ".copilot-tracking/squad/"
|
|
51
56
|
# Federation (opt-in): a repo may host several named sub-squads, each an
|
|
52
57
|
# ordinary squad rooted at the sub-squad root below. The optional `squad`
|
|
@@ -158,13 +163,16 @@ tools:
|
|
|
158
163
|
- id: squad_review
|
|
159
164
|
title: Squad Review
|
|
160
165
|
# Seeded from the `tester` role -> Squad Reviewer; council row adds the
|
|
161
|
-
#
|
|
166
|
+
# task-fit go/no-go reviewers (one per lens: architect, security, cost,
|
|
167
|
+
# product, rai).
|
|
162
168
|
description: >-
|
|
163
169
|
Run the squad's review stage. Routes to the Squad Reviewer (squad `tester`
|
|
164
170
|
role) at the `auto` tier for quality, correctness, and standards review.
|
|
165
|
-
When the request asks for a pre-implementation go/no-go
|
|
166
|
-
more council domains,
|
|
167
|
-
|
|
171
|
+
When the request asks for a pre-implementation go/no-go, crosses two or
|
|
172
|
+
more council domains, or raises any responsible-AI concern, it engages a
|
|
173
|
+
task-fit council at the `confirm` tier: only the seats whose lens the work
|
|
174
|
+
touches (architect, security, cost-manager, product-owner, rai), with every
|
|
175
|
+
lens left out recorded in the verdict.
|
|
168
176
|
Delegated execution: returns the Coordinator persona, matched routing, and
|
|
169
177
|
a framed dispatch request. Use for "review", "validate", "check quality",
|
|
170
178
|
"council", or "go/no-go" requests.
|
|
@@ -318,6 +326,10 @@ tools:
|
|
|
318
326
|
type: string
|
|
319
327
|
enum: [quick, standard, deep, skip]
|
|
320
328
|
description: "Optional discovery-gate depth for a request that states a goal with no requirement artifact behind it: quick (analyst), standard (designer then analyst), deep (designer, then challenger and experimenter, then analyst), or skip. An explicit depth beats the coordinator's one-time offer. Ignored on an unattended run, which has nobody for the gate to interview."
|
|
329
|
+
routing:
|
|
330
|
+
type: string
|
|
331
|
+
enum: ["off", ranked, manual]
|
|
332
|
+
description: "Optional per-role model routing mode, persisted in team.md until changed: ranked (pick each role's model by fit from the squad model catalog), manual (ask you to choose each role's model from the models this host can run), or off (no Model column; dispatch with no model parameter). Omit to keep the recorded mode. Ignored on an unattended run."
|
|
321
333
|
context:
|
|
322
334
|
type: string
|
|
323
335
|
description: "Optional free-form context to frame the pipeline."
|
|
@@ -392,6 +404,10 @@ tools:
|
|
|
392
404
|
type: string
|
|
393
405
|
enum: [quick, standard, deep, skip]
|
|
394
406
|
description: "Optional discovery-gate depth, asked once at the federation level and applied per qualifying sub-squad: quick (analyst), standard (designer then analyst), deep (designer, then challenger and experimenter, then analyst), or skip. Each qualifying sub-squad runs its own session and writes its own brief and verdict under its own root. Ignored on an unattended run."
|
|
407
|
+
routing:
|
|
408
|
+
type: string
|
|
409
|
+
enum: ["off", ranked, manual]
|
|
410
|
+
description: "Optional per-role model routing mode (off, ranked, or manual), forwarded verbatim to every selected sub-squad's coordinator run; each sub-squad persists it in its own team.md and may only narrow it, never widen or substitute it. Ignored on an unattended run."
|
|
395
411
|
context:
|
|
396
412
|
type: string
|
|
397
413
|
description: "Optional free-form context to frame the federation turn."
|