You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: introduce resource profiles and compact artifacts for small local execution
- Added resource profiles to runtime policy and governance schemas, including 'default' and 'small_local' profiles.
- Implemented compact planning artifacts and phase task cards for small local LLM execution in various scenarios.
- Created new schemas for CodeContextPack, ResearchBrief, and SpecCapture to support compact evidence and planning.
- Developed tests to validate the integration of new resource profiles and compact artifacts in the planning and execution workflows.
- Updated existing schemas and templates to accommodate new requirements for resource-aware execution.
Copy file name to clipboardExpand all lines: BrowserTester-subagent.agent.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@ Keep the health-first gate, observation-first protocol, accessibility severity r
20
20
21
21
If `context_packet` is present in your dispatch, read the referenced `artifact_path` first before opening raw source files. Skip re-investigation of paths listed in `do_not_re_read` unless contradicting evidence is found.
22
22
23
+
If `phase_task_card` is present, treat it as the authoritative local scope. Do not create evidence outside `allowed_files`, do not enter `forbidden_areas`, and return `NEEDS_INPUT` or `FAILED` with `failure_classification: needs_replan` when the card's read budget would be exceeded.
24
+
23
25
### Scope IN
24
26
- E2E browser test execution by running provided test scripts or harnesses via runCommands/runTasks.
25
27
- UI/UX behavior verification against validation matrix.
Copy file name to clipboardExpand all lines: CodeMapper-subagent.agent.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ Find the right files, symbols, and dependencies quickly with deterministic outpu
26
26
- First search batch must launch at least 3 independent searches.
27
27
- If confidence is low or results are contradictory, return `ABSTAIN`.
28
28
- No speculative claims without references.
29
+
- When discovery will be handed to an executor or `resource_profile` is `small_local`, also write a compact CodeContextPack using `plans/templates/code-context-pack-template.md` and `schemas/code-context-pack.schema.json`; include entry points, top files, symbols, call paths, hotspots, and explicit expand conditions instead of raw dumps.
29
30
30
31
### Standards Extraction Mode
31
32
When request includes "conventions", "standards", or "patterns": prioritize config and policy files; extract naming, structure, testing, and config conventions.
@@ -45,6 +46,8 @@ See [skills/patterns/preflect-core.md](skills/patterns/preflect-core.md) for the
Copy file name to clipboardExpand all lines: CoreImplementer-subagent.agent.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ Keep the backend-specific schema contract, verification evidence, and Definition
19
19
20
20
If `context_packet` is present in your dispatch, read the referenced `artifact_path` first before opening raw source files. Skip re-investigation of paths listed in `do_not_re_read` unless contradicting evidence is found.
21
21
22
+
If `phase_task_card` is present, treat it as the authoritative local scope. Do not edit outside `allowed_files`, do not enter `forbidden_areas`, and return `NEEDS_INPUT` or `FAILED` with `failure_classification: needs_replan` when the card's max changed files or read budget would be exceeded.
Copy file name to clipboardExpand all lines: Orchestrator.agent.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,7 @@ Do NOT use `vscode/askQuestions` for questions answerable from codebase evidence
73
73
- Generate `trace_id` (UUID v4 format) at task start. Propagate to all gate events and subagent delegation payloads.
74
74
- Include `trace_id`, `iteration_index`, and `max_iterations` in every gate-event emission per `schemas/orchestrator.gate-event.schema.json`.
75
75
- Purpose: enable log correlation across multi-agent orchestration chains.
76
+
- If the plan declares `resource_profile: small_local`, apply `governance/runtime-policy.json``resource_profiles.small_local`: cap parallel phase dispatch, require compact context artifacts for SMALL/MEDIUM/LARGE phases, and prepare `phase_task_card` payloads before executor dispatch.
76
77
77
78
### Planner Revision Modes
78
79
- Use `revision_mode: initial_create` when no active plan exists.
@@ -129,6 +130,7 @@ When emitting gate events, optionally also append one NDJSON line per event to `
129
130
-`schemas/code-reviewer.verdict.schema.json`
130
131
-`schemas/planner.plan.schema.json`
131
132
-`schemas/orchestrator.delegation-protocol.schema.json` (on-demand — load only when constructing delegation calls)
133
+
-`plans/templates/phase-task-card-template.md` (on-demand — load only when constructing resource-bounded executor payloads)
132
134
-`docs/agent-engineering/CLARIFICATION-POLICY.md`
133
135
-`docs/agent-engineering/TOOL-ROUTING.md`
134
136
-`docs/agent-engineering/SCORING-SPEC.md`
@@ -261,6 +263,8 @@ For `CodeReviewer-subagent`, `PlanAuditor-subagent`, and `AssumptionVerifier-sub
261
263
- Run PreFlect gate.
262
264
- Resolve the phase owner from `phase.executor_agent`. This field is authoritative for delegation and approval summaries.
263
265
- If a legacy phase omits `executor_agent`, do not infer silently. Route the plan back through `REPLAN` to Planner and stop the implementation batch until the phase is reissued with an explicit executor.
266
+
- Build a `phase_task_card` for executor payloads when the phase has `phase_task_card_path`, the plan uses `resource_profile: small_local`, or `governance/runtime-policy.json``resource_profiles.small_local.require_phase_task_card` applies. The card must include objective, allowed files, forbidden areas, context artifacts, validation commands, acceptance checks, max changed files, and escalation rule.
267
+
- When `phase_task_card` budgets are exceeded, do not widen the phase silently. Route to Planner with `needs_replan` or stop with `NEEDS_INPUT` according to the card's escalation rule.
264
268
-**Model Resolution:** Apply the Universal Model Resolution Rule (see Execution Protocol preamble above) before delegating execution: look up `phase.executor_agent` in `agent_role_index`, resolve `roles[role].by_tier[complexity_tier]`, and pass the resolved primary model as the `model` parameter. If the tier entry is `{ "inherit_from": "default" }`, use the role's default `primary`. Only pass a fallback list if `agent/runSubagent` explicitly supports one.
265
269
- Delegate execution to the declared executor agent.
266
270
- Verification Build Gate: after the implementation subagent reports completion, verify build success. Either confirm the execution report includes `build.state: PASS`, or if build evidence is absent or ambiguous, run the project's build command directly. If the build fails, route through Failure Classification Handling before proceeding.
@@ -313,7 +317,7 @@ Violating a stopping rule is equivalent to skipping a gate.
313
317
### Subagent Delegation Contracts
314
318
For agent descriptions, roles, and expected deliverables, see `plans/project-context.md` — Agent Role Matrix.
315
319
316
-
Each delegation must include: scope description, expected output format, and relevant context references.
320
+
Each delegation must include: scope description, expected output format, relevant context references, and `resource_profile` when the plan declares one. Executor delegations should include `phase_task_card` whenever the phase card exists or the active profile is `small_local`.
317
321
318
322
For detailed per-agent parameter shapes and required/optional fields, load `schemas/orchestrator.delegation-protocol.schema.json` on-demand. Do NOT load it into context preemptively — reference it only when constructing a delegation call.
Copy file name to clipboardExpand all lines: Planner.agent.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ Produce implementation plans that are deterministic, schema-compliant, and execu
40
40
### Mandatory Workflow Procedure
41
41
1. Idea Interview Gate: BEFORE the Clarification Gate, evaluate whether the user request is vague or abstract. Trigger condition: the request contains **all three** of — (a) no specific file names or paths, (b) no concrete acceptance criteria, (c) no explicit technology or constraint named. If triggered, load `skills/patterns/idea-to-prompt.md` and execute the 5-step interview protocol using `vscode/askQuestions`. Replace the original vague request with the structured prompt assembled at the end of Step 5. Skip this gate entirely if any single concrete signal is present (a file path, an agent name, a schema reference, or a measurable goal).
42
42
2. Clarification Gate: BEFORE proceeding to Design, evaluate the request against ALL five mandatory clarification classes in `docs/agent-engineering/CLARIFICATION-POLICY.md`. If ANY class matches, STOP and call `vscode/askQuestions` with 2-3 concrete options, affected files/components, and a recommended option with rationale. Do NOT proceed to Design until clarification is resolved or explicitly determined non-applicable. Decision rule: `vscode/askQuestions` is mandatory when competing interpretations change the top-level file set, `executor_agent`, architecture shape, or user-facing behavior. Do NOT call `vscode/askQuestions` for questions answerable by reading the codebase, when all options converge to equivalent outputs, or when the choice is a style or implementation detail already covered by existing configuration.
43
+
-**Spec Capture Gate:** For vague tasks and non-trivial `SMALL`, `MEDIUM`, or `LARGE` plans, create a compact spec artifact using `plans/templates/spec-template.md` and `schemas/spec-capture.schema.json` before final phase decomposition. Set `spec_path` in the plan unless the request is already fully specified and only-when-obvious.
43
44
3. Semantic Risk Discovery Gate: AFTER clarification and BEFORE research delegation, evaluate all 7 semantic risk categories using `plans/project-context.md` — Semantic Risk Taxonomy as the canonical trigger table. **Skip this gate for TRIVIAL scope** (≤2 files, single concern, no data/infra/security surfaces) — record all seven categories with `applicability: "not_applicable"` and proceed directly to Complexity Gate. Use the `risk_review` field format in `schemas/planner.plan.schema.json`; for TRIVIAL plans each category sets `impact: "LOW"` and `disposition: "not_applicable"` with a brief `evidence_source` rationale.
44
45
For all other scopes, record applicability, impact, evidence source, and disposition for each category in the `risk_review` array. Keep cryptographic and vulnerability review ownership with PlanAuditor rather than duplicating it here. Any category with `applicability: applicable` AND `impact: HIGH` that cannot be resolved from available evidence MUST set `disposition: research_phase_added` and trigger a dedicated research phase BEFORE implementation phases.
45
46
4. Complexity Gate: AFTER semantic risk evaluation and BEFORE research delegation, classify the task complexity and emit `complexity_tier` in the plan output. Use `plans/project-context.md` as the canonical source for tier definitions and override rules. Planner owns the classification result and planner-local planning consequences only; Orchestrator applies tier-specific PLAN_REVIEW routing, reviewer activation, and iteration budgets using `governance/runtime-policy.json`.
@@ -55,6 +56,8 @@ For all other scopes, record applicability, impact, evidence source, and disposi
55
56
Implementation agents load referenced skills before executing phase tasks.
56
57
6. Research (delegate CodeMapper-subagent/Researcher-subagent when scope is large).
57
58
- **Model Resolution:** For every `agent/runSubagent` dispatch to `CodeMapper-subagent` or `Researcher-subagent`, load `governance/model-routing.json`, resolve the subagent role via the top-level `agent_role_index`, then apply `roles[role].by_tier[complexity_tier]`. If the tier entry is `{ "inherit_from": "default" }`, inherit the role's default `primary` model and default `fallbacks`; otherwise use the tier-specific `primary` and tier-specific `fallbacks` when present. Resolve `runtime_model_mode` from per-dispatch override when present, else `governance/runtime-policy.json` `model_dispatch.default_mode` (now defaults to `auto`; deterministic is the opt-in mode used for pinned dispatch). Every research dispatch must pass the exact target as the outer `agentName` field and include payload marker `runtime_model_mode`. In deterministic mode (opt-in for pinned dispatch), pass the resolved `primary` as the outer `model` field; when `complexity_tier` is unavailable, deterministic mode uses the target role top-level `primary`. In auto mode, omit the outer `model` intentionally so Copilot selects subagent model automatically. Only pass a fallback list if/when `agent/runSubagent` explicitly supports one; otherwise pass only the resolved primary model string in deterministic mode. A payload-level `model` in the prompt/delegation payload is contract and audit context; it does not by itself select the runtime model and is not a substitute for the outer `model` field.
59
+
- When Researcher produces non-trivial findings, require a compact ResearchBrief artifact using `plans/templates/research-brief-template.md`; set `research_brief_path` and, when executor-facing, `context_packet_path`.
60
+
- When CodeMapper performs discovery for executor context, require a compact CodeContextPack artifact using `plans/templates/code-context-pack-template.md`; set `code_context_pack_path`.
58
61
7. Design (structured design decisions and diagram selection):
59
62
-**Design Decisions Checklist** — Before proceeding to Planning (Step 8), explicitly address four dimensions:
60
63
1.**Boundary changes** — Does the task change system boundaries, add new actors, or modify integration points? If no boundary changes, state "No boundary changes."
@@ -67,6 +70,8 @@ For all other scopes, record applicability, impact, evidence source, and disposi
67
70
-**LARGE:** Always include a Mermaid `sequenceDiagram` alongside the phase dependency DAG.
68
71
- Record design decisions in the plan artifact's "Design Decisions" section (see plan document template).
69
72
8. Planning (phase decomposition with quality gates).
73
+
- When `resource_profile` is `small_local`, keep each phase within the `resource_profiles.small_local.phase_file_limit` from `governance/runtime-policy.json` or add an explicit research/code-context phase before implementation.
74
+
- For non-trivial executor phases and all `resource_profile: small_local` work, prepare a one-screen phase task card from `plans/templates/phase-task-card-template.md` and record `phase_task_card_path` on the phase. The card includes allowed files, forbidden areas, validation commands, acceptance checks, max changed files, and an escalation rule.
70
75
9. Handoff (artifact-first plan persistence plus `plan_path` handoff for Orchestrator; PLAN_REVIEW ownership remains with Orchestrator).
71
76
- For MEDIUM/LARGE plans where Researcher produced a non-trivial evidence packet, set `context_packet_path` in the plan to the research digest artifact path so downstream executors can consume it without re-investigation.
-`skills/patterns/source-grounding.md` (consider for external claims, provenance, and explicit `UNVERIFIED` state)
@@ -165,6 +177,8 @@ The artifact structure is defined by `plans/templates/plan-document-template.md`
165
177
166
178
The plan file must remain consistent with `schemas/planner.plan.schema.json`.
167
179
180
+
For small-model/resource-bounded planning, set `resource_profile: small_local` when requested or when local small LLM execution is the likely target. In that mode, prefer `spec_path`, `research_brief_path`, `code_context_pack_path`, `context_packet_path`, and per-phase `phase_task_card_path` over broad inline context.
181
+
168
182
### Plan Quality Standards
169
183
170
184
See `plans/templates/plan-document-template.md` for the complete 11 quality standards: incremental, TDD-driven, specific, testable, practical, parallelizable, routable, visualized, failure-aware, executable, and risk-reviewed.
If `context_packet` is present in your dispatch, read the referenced `artifact_path` first before opening raw source files. Skip re-investigation of paths listed in `do_not_re_read` unless contradicting evidence is found.
21
21
22
+
If `phase_task_card` is present, treat it as the authoritative local scope. Do not edit outside `allowed_files`, do not enter `forbidden_areas`, and return `NEEDS_INPUT` or `FAILED` with `failure_classification: needs_replan` when the card's max changed files or read budget would be exceeded.
0 commit comments