@danmoisan/drm-copilot-mcp 1.1.19 → 1.1.21
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/out/mcp-server.js +172 -11
- package/package.json +1 -1
- package/resources/claude-customizations/.claude/agents/atomic-executor.md +17 -6
- package/resources/claude-customizations/.claude/agents/atomic-planner.md +10 -2
- package/resources/claude-customizations/.claude/agents/epic-orchestrator.md +5 -0
- package/resources/claude-customizations/.claude/agents/orchestrator.md +4 -1
- package/resources/claude-customizations/.claude/agents/parallel-orchestrator.md +4 -0
- package/resources/claude-customizations/.claude/agents/task-researcher.md +8 -0
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-command.ps1 +190 -0
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +22 -53
- package/resources/claude-customizations/.claude/hooks/hook-docs-only-diff.ps1 +5 -1
- package/resources/claude-customizations/.claude/hooks/premortem-section.ps1 +149 -0
- package/resources/claude-customizations/.claude/hooks/validate-executor-output.ps1 +210 -84
- package/resources/claude-customizations/.claude/hooks/validate-planner-output.ps1 +13 -1
- package/resources/claude-customizations/.claude/hooks/validate-task-researcher-output.ps1 +24 -5
- package/resources/claude-customizations/.claude/lib/ci-gate/Invoke-MergeConfirmationParser.ps1 +203 -0
- package/resources/claude-customizations/.claude/lib/codex-routing/CodexDeployment.psm1 +10 -10
- package/resources/claude-customizations/.claude/rules/plan-acceptance-gates.md +46 -10
- package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +48 -16
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/SKILL.md +7 -3
- package/resources/claude-customizations/.claude/skills/csharp-change-budget-router/SKILL.md +2 -2
- package/resources/claude-customizations/.claude/skills/epic-orchestrate/SKILL.md +12 -3
- package/resources/claude-customizations/.claude/skills/epic-plan/SKILL.md +4 -2
- package/resources/claude-customizations/.claude/skills/execution-environment/SKILL.md +134 -0
- package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +22 -9
- package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +29 -5
- package/resources/claude-customizations/.claude/skills/powershell-change-budget-router/SKILL.md +1 -1
- package/resources/claude-customizations/.claude/skills/python-change-budget-router/SKILL.md +1 -1
- package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +14 -6
- package/resources/claude-customizations/.claude/skills/research-issue/SKILL.md +6 -0
- package/resources/claude-customizations/config/orchestration-routing.json +7 -7
- package/resources/claude-customizations/pack-manifests/core.json +4 -0
- package/resources/codex-and-agents-customizations/.agents/skills/README.md +1 -0
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-executor/SKILL.md +8 -7
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +39 -4
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-planner/SKILL.md +8 -6
- package/resources/codex-and-agents-customizations/.agents/skills/codex-model-routing/SKILL.md +6 -6
- package/resources/codex-and-agents-customizations/.agents/skills/csharp-change-budget-router/SKILL.md +2 -2
- package/resources/codex-and-agents-customizations/.agents/skills/epic-orchestrate/SKILL.md +15 -8
- package/resources/codex-and-agents-customizations/.agents/skills/epic-plan/SKILL.md +2 -2
- package/resources/codex-and-agents-customizations/.agents/skills/execution-environment/SKILL.md +134 -0
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +16 -6
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +1 -1
- package/resources/codex-and-agents-customizations/.agents/skills/powershell-change-budget-router/SKILL.md +1 -1
- package/resources/codex-and-agents-customizations/.agents/skills/python-change-budget-router/SKILL.md +1 -1
- package/resources/codex-and-agents-customizations/.agents/skills/remediation-handoff-atomic-planner/SKILL.md +7 -3
- package/resources/codex-and-agents-customizations/.agents/skills/research-issue/SKILL.md +6 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c1.toml +11 -7
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c2.toml +11 -7
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3-elevated.toml +11 -7
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3.toml +11 -7
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c4.toml +11 -7
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +11 -7
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c1.toml +6 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c2.toml +6 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3-elevated.toml +6 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3.toml +6 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c4.toml +6 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner.toml +6 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/commit-steward-c1.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/commit-steward-c2.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/commit-steward-c3-elevated.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/commit-steward-c3.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/commit-steward-c4.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/commit-steward.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c1.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c2.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3-elevated.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c4.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/epic-orchestrator.toml +4 -2
- package/resources/codex-and-agents-customizations/.codex/agents/epic-planner.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c1.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c2.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c3-elevated.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c3.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c4.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c1.toml +8 -5
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c2.toml +8 -5
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c3-elevated.toml +8 -5
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c3.toml +8 -5
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c4.toml +8 -5
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator.toml +8 -5
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c1.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c2.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3-elevated.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c4.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c1.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c2.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c3-elevated.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c3.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c4.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c1.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c2.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c3-elevated.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c3.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c4.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c1.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c2.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3-elevated.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c4.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c1.toml +7 -1
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c2.toml +7 -1
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c3-elevated.toml +7 -1
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c3.toml +7 -1
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c4.toml +7 -1
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher.toml +7 -1
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c1.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c2.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c3-elevated.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c3.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c4.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate-command.ps1 +190 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate.ps1 +17 -38
- package/resources/codex-and-agents-customizations/.codex/hooks/hook-docs-only-diff.ps1 +5 -1
- package/resources/codex-and-agents-customizations/.codex/hooks/record-subagent-routing-attestation.ps1 +82 -70
- package/resources/codex-and-agents-customizations/.codex/prompts/feature-review-remediate.md +6 -4
- package/resources/codex-and-agents-customizations/.codex-variants/csharp-legacy/agents/csharp-typed-engineer.toml +1 -1
- package/resources/codex-and-agents-customizations/pack-manifests/core.json +2 -0
- package/resources/config/orchestration-routing.json +7 -7
- package/resources/customizations/.github/agents/atomic_executor.agent.md +21 -11
- package/resources/customizations/.github/agents/atomic_planning.agent.md +8 -3
- package/resources/customizations/.github/agents/csharp-atomic-executor.agent.md +13 -9
- package/resources/customizations/.github/agents/csharp-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +2 -2
- package/resources/customizations/.github/agents/csharp-typed-engineer.agent.md +3 -3
- package/resources/customizations/.github/agents/orchestrator.agent.md +8 -5
- package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +13 -9
- package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +2 -2
- package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +3 -3
- package/resources/customizations/.github/agents/python-atomic-executor.agent.md +13 -9
- package/resources/customizations/.github/agents/python-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/python-orchestrator.agent.md +2 -2
- package/resources/customizations/.github/agents/task-researcher.agent.md +6 -0
- package/resources/customizations/.github/prompts/generate-atomic-plan.prompt.md +16 -10
- package/resources/customizations/.github/prompts/orchestrate-csharp-work.prompt.md +2 -2
- package/resources/customizations/.github/prompts/orchestrate-powershell-work.prompt.md +1 -1
- package/resources/customizations/.github/prompts/orchestrate-python-work.prompt.md +1 -1
- package/resources/customizations/.github/prompts/orchestrate-work.prompt.md +2 -2
- package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +39 -4
- package/resources/customizations/.github/skills/csharp-change-budget-router/SKILL.md +1 -1
- package/resources/customizations/.github/skills/execution-environment/SKILL.md +134 -0
- package/resources/customizations/.github/skills/powershell-change-budget-router/SKILL.md +1 -1
- package/resources/customizations/.github/skills/remediation-handoff-atomic-planner/SKILL.md +7 -3
- package/resources/feature-templates/bug/plan.yyyy-MM-ddTHH-mm.md +10 -0
- package/resources/feature-templates/feature/plan.yyyy-MM-ddTHH-mm.md +11 -0
- package/resources/feature-templates/refactor/plan.yyyy-MM-ddTHH-mm.md +11 -0
- package/resources/lib/codex-routing/CodexDeployment.psm1 +10 -10
- package/resources/powershell/PoshQC/PoshQC.CoverageMerge.psm1 +163 -0
- package/resources/powershell/PoshQC/PoshQC.Shard.psm1 +296 -0
- package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +23 -4
- package/resources/powershell/PoshQC/PoshQC.psd1 +7 -1
- package/resources/powershell/PoshQC/PoshQC.psm1 +17 -5
- package/resources/powershell/PoshQC/README.md +13 -1
- package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +3 -0
package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md
CHANGED
|
@@ -21,6 +21,22 @@ Use this skill when:
|
|
|
21
21
|
- Task IDs must match their phase and be sequential per phase.
|
|
22
22
|
- Plans must pass the `mcp__drm-copilot__validate_orchestration_artifacts` MCP tool with `artifact_type: "plan"` and `artifact_path: <plan-path>` before they can be reported as approved.
|
|
23
23
|
|
|
24
|
+
## Design-Level Plan Contract (Mandatory)
|
|
25
|
+
|
|
26
|
+
A plan is a design-level document: it states what changes and how the change is proven, not a transcript of commands. Every task names the files it creates or edits, the symbols, headings, or tests it touches, the behavior the change produces, the tests that prove that behavior, and an acceptance condition stated as an observable outcome.
|
|
27
|
+
|
|
28
|
+
Rules:
|
|
29
|
+
|
|
30
|
+
- **Anchors are symbols, headings, or test names.** A plan never cites a line number, a `path:line` locator, a `#L` anchor, or a commit SHA, because each goes stale when `main` moves (validator rules G11 and G12). Scope comparisons name the merge-base derivation of `origin/main` and `HEAD`, not a commit.
|
|
31
|
+
- **Literals only where they are the asserted value.** A plan quotes a literal when an acceptance condition asserts that exact value. It does not quote file contents, command output, or prose for context.
|
|
32
|
+
- **Tool routes are not restated.** Tool routes, launchers, wrapper scripts, command-text restrictions, the batch budget, hook context, and CI shape are owned by the `execution-environment` skill. A plan references that skill instead of restating its content.
|
|
33
|
+
- **Changed existing behavior names its asserting tests.** A task that changes the observable behavior of an existing function, script, fixture, or test stub (its signature, argv, output, exit status, or the files it writes) names every existing test that asserts that behavior and states each test's disposition: unchanged because it is unaffected, or updated, with the reason for the update. The tests are found by searching the test tree for the symbol, the file name, and the asserted output. A test that asserts the current behavior and is outside the task's file set fails once the change lands, and the plan's own acceptance condition then cannot be met. The planner's adversarial self-review includes this search for every task that changes existing behavior.
|
|
34
|
+
- **Size guideline.** A plan stays within 40 canonical tasks and 400 physical lines. A plan that needs more carries a `## Size Justification` section with at least one line stating why the size is necessary (validator rule G13). Files produced by one generator run count as one generator task.
|
|
35
|
+
- **Pre-Mortem.** Every plan carries a `## Pre-Mortem` section with one bullet beginning with each of the seven labels `Review checklists`, `Coverage`, `Mirror parity`, `File size`, `Test isolation`, `CI-only behavior`, and `Evidence`. Each bullet states how the plan prevents that failure class, or states "not applicable" followed by the reason. The `Test isolation` bullet names the isolation runs the plan performs: a seeded shuffled Jest run with the seed recorded, a reversed-order run of the new or changed Python test modules, and a seeded shuffled file-order run of the touched Pester suites with at least three seeds, each seed recorded. The `Mirror parity` bullet also covers the execution-environment brief: a plan that alters a fact the brief states (for example, it adds or renames a CI job, changes a required status context, a tool route, or a batch-budget rule) includes a task that updates the brief in the same change, in all six byte-identical copies, and the bullet names that task. Without that task the brief states a superseded fact once the change lands, which breaks the brief's own maintenance rule. The planner SubagentStop hook blocks a plan without a complete section.
|
|
36
|
+
- **Final-phase self-review.** The final phase of every plan contains a self-review task that walks the policy-audit, code-review, and feature-audit templates under `docs/features/templates/policy_audit/` against the branch diff from the merge base and writes `<FEATURE>/evidence/qa-gates/self-review.<timestamp>.md` with one PASS, FAIL, or N/A row per checklist item. A FAIL row is fixed and the QA loop is re-run before the self-review is rewritten; the plan does not complete with a FAIL row.
|
|
37
|
+
|
|
38
|
+
This section takes precedence over the literal-quoting rules of `## Wrap-Tolerant Assertion Authoring (Mandatory)`: those rules govern the asserted value of an acceptance condition, not context.
|
|
39
|
+
|
|
24
40
|
## Short-Path Minimal Plan Contract
|
|
25
41
|
|
|
26
42
|
When orchestration selects short path, a minimal plan is still mandatory and must include these blocks:
|
|
@@ -159,13 +175,30 @@ Any regression test task expected to fail must be tagged with `[expect-fail]` an
|
|
|
159
175
|
## Preflight Validation (Planner ↔ Executor)
|
|
160
176
|
|
|
161
177
|
When validating or handing off plans for execution:
|
|
162
|
-
-
|
|
178
|
+
- Put the directive line `DIRECTIVE: PREFLIGHT VALIDATION ONLY` in the delegation prompt. The preflight directive belongs in the delegation prompt, never in a plan file.
|
|
163
179
|
- Require one of the exact signals:
|
|
164
180
|
- `PREFLIGHT: ALL CLEAR`
|
|
165
181
|
- `PREFLIGHT: REVISIONS REQUIRED`
|
|
166
|
-
- If revisions are required, provide a precise plan delta
|
|
182
|
+
- If revisions are required, provide a precise plan delta with one `PREFLIGHT-DEFECT:` line per substantive defect. A plan returns to the planner at most once.
|
|
167
183
|
- If the required planner ↔ executor handoff cannot be started or completed, stop and report blocked state; do not self-approve the plan.
|
|
168
184
|
|
|
185
|
+
### Single-Pass Preflight
|
|
186
|
+
|
|
187
|
+
- **Review the entire plan in one pass.** The preflight executor checks every phase, task, and prose region and does not stop at the first defect.
|
|
188
|
+
- **Classify every defect as trivial or substantive.** Trivial defects are a stale or misspelled anchor, symbol, heading, or path whose intent is unambiguous; a citation correction, including removal of a G11 line-number or G12 commit-SHA citation; a typo; a literal-formatting defect that does not change what is asserted; and an evidence filename spelling. Substantive defects are a missing or extra task; a wrong file set or design; an acceptance criterion with no implementing task; an acceptance condition whose correction changes what is asserted; a task-ordering error; and a scope-boundary violation.
|
|
189
|
+
- **Fix trivial defects in place, in task text only.** The preflight executor edits task text and plan preamble in the same plan file and never adds, removes, or reorders tasks. Each fix is recorded in `<FEATURE>/evidence/other/preflight-fixes.<timestamp>.md`.
|
|
190
|
+
- **Return substantive defects only, all of them.** `PREFLIGHT: REVISIONS REQUIRED` is returned only when at least one substantive defect remains, and it lists every one. `PREFLIGHT: ALL CLEAR` may follow in-place fixes.
|
|
191
|
+
|
|
192
|
+
Output format. After the `PREFLIGHT:` signal, the return carries one line per defect:
|
|
193
|
+
|
|
194
|
+
- `PREFLIGHT-FIX: <task id or heading> | <defect class> | <change made>`
|
|
195
|
+
- `PREFLIGHT-DEFECT: <task id or heading> | <defect class> | <required change>`
|
|
196
|
+
- `preflight-fix-record: <path>` when at least one fix was made.
|
|
197
|
+
|
|
198
|
+
`PREFLIGHT: ALL CLEAR` carries no `PREFLIGHT-DEFECT:` line, and `PREFLIGHT: REVISIONS REQUIRED` carries at least one.
|
|
199
|
+
|
|
200
|
+
At most one return. On `PREFLIGHT: REVISIONS REQUIRED`, the orchestrator delegates one planner revision carrying the full `PREFLIGHT-DEFECT:` list and runs one more preflight. If that preflight still reports a substantive defect, the orchestrator halts with `blocked_reason: "validator_failed"` during planning, or records `final_status: "blocked_preflight_iteration_limit"` in a remediation cycle.
|
|
201
|
+
|
|
169
202
|
## Validator Gate (Mandatory)
|
|
170
203
|
|
|
171
204
|
Before a plan can be treated as approved:
|
|
@@ -174,15 +207,17 @@ Before a plan can be treated as approved:
|
|
|
174
207
|
- reject the plan if that validator exits non-zero,
|
|
175
208
|
- do not treat human-readable summaries as a substitute for validator success.
|
|
176
209
|
|
|
210
|
+
The validator applies the acceptance-gate rules of `.claude/rules/plan-acceptance-gates.md`. G1 through G9 judge the commands a plan states as acceptance conditions; G10 reports a SCRATCH definition not namespaced by issue number; and the document-level rules G11, G12, and G13 report a line-number citation, a commit-SHA citation, and a plan above 40 tasks or 400 lines without a non-empty `## Size Justification` section. The complete shipped set is therefore G1 through G13. The installed MCP validator applies G11 through G13 only after the extension release that carries them is installed; until then, validate a plan with the repository's Python CLI `scripts/dev_tools/validate_orchestration_artifacts.py` and its `plan` subcommand, as the `execution-environment` skill states.
|
|
211
|
+
|
|
177
212
|
## Plan-Path Continuity Contract (Mandatory)
|
|
178
213
|
|
|
179
214
|
When a caller provides an explicit target plan file path (for example `${plan-path}` or `${file}`):
|
|
180
215
|
|
|
181
216
|
- Planner MUST update that exact file in place.
|
|
182
|
-
- Planner MUST reuse the same file for
|
|
217
|
+
- Planner MUST reuse the same file for the single permitted preflight revision.
|
|
183
218
|
- Planner MUST NOT create additional timestamped sibling files (for example `plan.<timestamp>.md`) during the same planning cycle.
|
|
184
219
|
|
|
185
|
-
If the provided path does not exist, it may be created once, then reused for
|
|
220
|
+
If the provided path does not exist, it may be created once, then reused for the single permitted revision in that cycle.
|
|
186
221
|
|
|
187
222
|
## Mode source precedence (Mandatory)
|
|
188
223
|
|
|
@@ -12,6 +12,7 @@ Planning-only workflow skill for generating executor-ready plans.
|
|
|
12
12
|
Always apply:
|
|
13
13
|
- `policy-compliance-order`
|
|
14
14
|
- `atomic-plan-contract`
|
|
15
|
+
- `execution-environment`
|
|
15
16
|
|
|
16
17
|
## Role
|
|
17
18
|
|
|
@@ -26,7 +27,8 @@ Use `atomic-plan-contract` as the source of truth for:
|
|
|
26
27
|
- Phase 0 requirements,
|
|
27
28
|
- baseline evidence tasks,
|
|
28
29
|
- final QA requirements,
|
|
29
|
-
-
|
|
30
|
+
- the design-level plan contract and the `## Pre-Mortem` section,
|
|
31
|
+
- single-pass preflight behavior.
|
|
30
32
|
|
|
31
33
|
Each task must be:
|
|
32
34
|
- atomic,
|
|
@@ -49,10 +51,10 @@ Concurrent child runs in one session share one session scratchpad, so every plan
|
|
|
49
51
|
Before a plan is finalized:
|
|
50
52
|
|
|
51
53
|
1. Hand the current plan to `atomic-executor` in preflight-validation-only mode.
|
|
52
|
-
2. If preflight returns `PREFLIGHT: REVISIONS REQUIRED`,
|
|
53
|
-
3.
|
|
54
|
+
2. If preflight returns `PREFLIGHT: REVISIONS REQUIRED`, apply every listed `PREFLIGHT-DEFECT:` change to the same file in one revision.
|
|
55
|
+
3. A plan returns to the planner at most once. If the confirming preflight still reports a substantive defect, the orchestrator halts with `blocked_reason: "validator_failed"`; do not open another revision.
|
|
54
56
|
|
|
55
|
-
Do not finalize a plan before preflight clears it.
|
|
57
|
+
Do not finalize a plan before preflight clears it. Every plan follows `## Design-Level Plan Contract (Mandatory)` in `atomic-plan-contract`, including the `## Pre-Mortem` section and the final-phase self-review task.
|
|
56
58
|
|
|
57
59
|
### Enforced Handoff Contract
|
|
58
60
|
|
|
@@ -62,7 +64,7 @@ Do not finalize a plan before preflight clears it.
|
|
|
62
64
|
- `PREFLIGHT: ALL CLEAR`
|
|
63
65
|
- `PREFLIGHT: REVISIONS REQUIRED`
|
|
64
66
|
- If revisions are required, `atomic-executor` MUST provide a precise plan delta that can be applied to the same plan file.
|
|
65
|
-
-
|
|
67
|
+
- Preflight is single-pass: trivial defects are fixed in place by `atomic-executor`, and only substantive defects return, at most once.
|
|
66
68
|
- Do not treat a partial summary as a valid substitute for the exact preflight signal.
|
|
67
69
|
- If the required `atomic-executor` handoff cannot be started or completed, stop and report blocked state; do not self-approve the plan.
|
|
68
70
|
- Before reporting completion, the target plan MUST pass the `validate_orchestration_artifacts` MCP tool with `artifact_type: "plan"` and `artifact_path: <plan-path>`.
|
|
@@ -84,7 +86,7 @@ Forbidden writes:
|
|
|
84
86
|
When a caller provides an explicit target plan path:
|
|
85
87
|
|
|
86
88
|
- update that exact file in place,
|
|
87
|
-
- reuse that same file for
|
|
89
|
+
- reuse that same file for the single permitted preflight revision,
|
|
88
90
|
- do not create additional sibling `plan.*.md` files during the same planning cycle.
|
|
89
91
|
|
|
90
92
|
## Determinism Gates
|
package/resources/codex-and-agents-customizations/.agents/skills/codex-model-routing/SKILL.md
CHANGED
|
@@ -81,13 +81,13 @@ receipt's logical agent name.
|
|
|
81
81
|
|
|
82
82
|
## Fixed routing outcomes
|
|
83
83
|
|
|
84
|
-
- C1: `gpt-
|
|
85
|
-
- C2: `gpt-
|
|
86
|
-
- C3 standalone with a C3 ceiling: `gpt-
|
|
84
|
+
- C1: `gpt-6-luna`, low reasoning.
|
|
85
|
+
- C2: `gpt-6.1-sol`, medium reasoning.
|
|
86
|
+
- C3 standalone with a C3 ceiling: `gpt-6.1-sol`, high reasoning.
|
|
87
87
|
- C3 in either epic-child context, or C3 under a C4 ceiling:
|
|
88
|
-
`gpt-
|
|
89
|
-
- C4: `gpt-
|
|
90
|
-
- `epic-planner` and `epic-orchestrator`: always `gpt-
|
|
88
|
+
`gpt-6-astra`, high reasoning through the `-c3-elevated` profile.
|
|
89
|
+
- C4: `gpt-6-astra`, max reasoning.
|
|
90
|
+
- `epic-planner` and `epic-orchestrator`: always `gpt-6-astra`, ultra
|
|
91
91
|
reasoning.
|
|
92
92
|
|
|
93
93
|
If the exact model is unavailable, record `model_unavailable`, leave the work
|
|
@@ -28,7 +28,7 @@ When routed through `csharp-orchestrator`, small path still requires lifecycle s
|
|
|
28
28
|
- promote potential item to GitHub issue with `--work-mode minor-audit`,
|
|
29
29
|
- create active feature folder with `--work-mode minor-audit`,
|
|
30
30
|
- delegate minimal-audit plan creation to `atomic_planner` with `DIRECTIVE: MINIMAL-AUDIT PLAN REQUIRED`,
|
|
31
|
-
- require `atomic_executor` preflight
|
|
31
|
+
- require single-pass `atomic_executor` preflight ending in `PREFLIGHT: ALL CLEAR` (at most one return to the planner),
|
|
32
32
|
- execute Phase 0 only via atomic_executor before branching,
|
|
33
33
|
- run reduced small-audit after implementation and QC.
|
|
34
34
|
|
|
@@ -69,7 +69,7 @@ In all modes, per-batch budget remains: at most **3 production files** and **3 t
|
|
|
69
69
|
When `csharp-typed-engineer` runs in orchestrator handoff mode, it must execute the following delegation chain and must not bypass it with direct implementation:
|
|
70
70
|
|
|
71
71
|
1. Delegate to `atomic_planner` for an architecture plus testability plan only (no edits).
|
|
72
|
-
2. Require planner output to include final `PREFLIGHT: ALL CLEAR` from
|
|
72
|
+
2. Require planner output to include final `PREFLIGHT: ALL CLEAR` from single-pass preflight (at most one return to the planner).
|
|
73
73
|
3. Delegate plan execution to `atomic_executor`.
|
|
74
74
|
4. Delegate the final QA gate to `atomic_executor` per `csharp-qa-gate`.
|
|
75
75
|
5. Delegate post-implementation review to `feature-review` per `feature-review-workflow`.
|
|
@@ -79,7 +79,7 @@ issue number for it. Run at most one main-sync child per wave, then re-fetch the
|
|
|
79
79
|
Launch all ready children in one bounded parallel wave. Before each launch, persist the
|
|
80
80
|
epic-child topology receipt, reviewed complexity assessment, delegation receipt, and Codex
|
|
81
81
|
model-routing receipt with the same `delegation_id`, then select the generated deployment agent.
|
|
82
|
-
C3 epic children use the elevated
|
|
82
|
+
C3 epic children use the elevated Astra/High profile. The child prompt contains:
|
|
83
83
|
|
|
84
84
|
> `Epic mode: true. epic_feature_folder: <epic-slug>. integration_branch: epic/<epic-slug>-integration. epic_checkpoint_path: artifacts/orchestration/epic-orchestrator-state.json. PR base branch MUST be <integration_branch>, not main; pass --base <integration_branch> to gh pr create.`
|
|
85
85
|
|
|
@@ -137,12 +137,12 @@ remove its worktree. The worktree-removal hook denies removal before the matchin
|
|
|
137
137
|
Route selection and model selection are independent. The deterministic file-count or marker
|
|
138
138
|
route selects topology; the C1-C4 assessment selects a checked-in Codex deployment profile.
|
|
139
139
|
|
|
140
|
-
- C1: `gpt-
|
|
141
|
-
- C2: `gpt-
|
|
142
|
-
- standalone C3 with ceiling C3: `gpt-
|
|
143
|
-
- epic C3 or C3 with a C4 sibling: `gpt-
|
|
144
|
-
- C4: `gpt-
|
|
145
|
-
- `epic-orchestrator`: `gpt-
|
|
140
|
+
- C1: `gpt-6-luna`, low.
|
|
141
|
+
- C2: `gpt-6.1-sol`, medium.
|
|
142
|
+
- standalone C3 with ceiling C3: `gpt-6.1-sol`, high.
|
|
143
|
+
- epic C3 or C3 with a C4 sibling: `gpt-6-astra`, high.
|
|
144
|
+
- C4: `gpt-6-astra`, max.
|
|
145
|
+
- `epic-orchestrator`: `gpt-6-astra`, ultra.
|
|
146
146
|
|
|
147
147
|
Persist the topology and model-routing receipts before every child or `pr-author` delegation. The
|
|
148
148
|
deployed agent type and actual model must match its receipts and start attestation. If the
|
|
@@ -169,7 +169,14 @@ On resume, reconcile the checkpoint against `git worktree list --porcelain`, bra
|
|
|
169
169
|
After every child is merged or its worktree removed, delegate final PR authoring to the routed
|
|
170
170
|
`pr-author` profile, refresh PR context through the MCP surface, run the CI-green procedure,
|
|
171
171
|
record the current head SHA and successful conclusion, and merge the integration branch to
|
|
172
|
-
`main` only through the merge gate.
|
|
172
|
+
`main` only through the merge gate. A zero exit from `gh pr merge` does not prove a merge when
|
|
173
|
+
`main` uses a merge queue: read the pull-request state (`state`, `mergeCommit`, `mergedAt`,
|
|
174
|
+
`isInMergeQueue`, and `autoMergeRequest`) every 30 seconds for at most 90 minutes until it is
|
|
175
|
+
`MERGED`, then run `git fetch origin main` and
|
|
176
|
+
`git merge-base --is-ancestor <merge-commit-oid> origin/main`. The final merge SHA is recorded
|
|
177
|
+
only after the merge is confirmed by polling and ancestry check. When the 90 minutes are
|
|
178
|
+
exhausted, report `awaiting_merge_queue` and do not record a merge; never re-issue the merge in
|
|
179
|
+
a loop (issue #952).
|
|
173
180
|
|
|
174
181
|
## Completion
|
|
175
182
|
|
|
@@ -97,7 +97,7 @@ the prepared worktree. Write one immutable launch specification under
|
|
|
97
97
|
`wave_number: 0`, the planner checkpoint path, integration branch, bounded maximum, and one
|
|
98
98
|
launch record per child. Every record supplies the unique launch/delegation ids, prepared
|
|
99
99
|
worktree and branch, generated `orchestrator-cN` profile, exact model/reasoning/permissions, and
|
|
100
|
-
prompt. C3 epic children use the elevated
|
|
100
|
+
prompt. C3 epic children use the elevated Astra/High profile. Monitor the returned durable status
|
|
101
101
|
path; a nonzero child exit or missing completion status blocks fan-in.
|
|
102
102
|
|
|
103
103
|
The launch specification schema is:
|
|
@@ -118,7 +118,7 @@ The launch specification schema is:
|
|
|
118
118
|
"feature_folder": "<final-active-feature-folder>",
|
|
119
119
|
"issue_num": 123,
|
|
120
120
|
"deployment_agent": "orchestrator-c3-elevated",
|
|
121
|
-
"model": "gpt-
|
|
121
|
+
"model": "gpt-6-astra",
|
|
122
122
|
"model_reasoning_effort": "high",
|
|
123
123
|
"permissions": "orchestrator-workspace",
|
|
124
124
|
"execution_context": "epic_preparation_child",
|
package/resources/codex-and-agents-customizations/.agents/skills/execution-environment/SKILL.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: execution-environment
|
|
3
|
+
description: 'Execution-environment brief for research, planning, preflight, execution, and orchestration. Use before planning or delegating work so tool routes, command-text restrictions, the batch budget, hook context, CI shape, contract tests, evidence rules, coverage and file-size gates, and test-isolation checks are known and are not restated in plans.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Execution-Environment Brief
|
|
7
|
+
|
|
8
|
+
## Purpose and Maintenance
|
|
9
|
+
|
|
10
|
+
This brief states the environment facts that every researcher, planner, preflight executor, executor, and orchestrator needs before work starts. Plans reference this brief instead of restating its content; a plan that restates a tool route, a launcher, or a command-text restriction duplicates text that goes stale when this brief changes.
|
|
11
|
+
|
|
12
|
+
Maintenance rule: this brief is updated in the same change that alters any fact it states. It carries no line numbers and no commit identifiers; it cites files, symbols, headings, job names, and test names. The same text is byte-identical in six locations: `.claude/skills/execution-environment/SKILL.md`, `.agents/skills/execution-environment/SKILL.md`, `.github/skills/execution-environment/SKILL.md`, and their bundled copies under `extensions/drm-copilot/resources/`. Where the Claude and Codex runtimes differ, both paths are named (`.claude/hooks/...` and `.codex/hooks/...`).
|
|
13
|
+
|
|
14
|
+
## Tool Routes by Agent
|
|
15
|
+
|
|
16
|
+
- `atomic-executor` has no PowerShell tool. Its `tools:` list is Read, Grep, Glob, Edit, Write, several `Bash(...)` entries, the four `mcp__drm-copilot__run_poshqc_*` tools, and `mcp__drm-copilot__validate_orchestration_artifacts`. A `(pattern)` suffix on a `tools:` entry admits the bare tool, so the executor has Bash, subject to the repository hooks and the runtime guard described under Command-Text Restrictions.
|
|
17
|
+
- `atomic-planner` has no Bash. It has Read, Grep, Glob, Edit, Write, and `mcp__drm-copilot__validate_orchestration_artifacts`, so it can validate a plan with the installed validator before handoff but cannot run any toolchain command.
|
|
18
|
+
- `task-researcher` has Read, Grep, Glob, WebFetch, and Write. It cannot run `git show` or `gh`; facts that need either are marked for the orchestrator to confirm.
|
|
19
|
+
- `orchestrator` and the main session running the `orchestrate` skill have Bash, the PoshQC and validation MCP tools, and the `Agent` tool. Only they can delegate, so any step that needs a further agent run is orchestrator-owned.
|
|
20
|
+
- PowerShell for the executor therefore runs through the `mcp__drm-copilot__run_poshqc_*` tools or through a `sh` launcher script stored under `SCRATCH` that invokes PowerShell 7 from inside the script file.
|
|
21
|
+
|
|
22
|
+
## Command-Text Restrictions
|
|
23
|
+
|
|
24
|
+
Two separate mechanisms restrict Bash command text. They are kept apart here because they have different causes and different fixes.
|
|
25
|
+
|
|
26
|
+
- **Worktree isolation guard (Claude Code runtime behavior, not a repository hook).** Inside an agent-isolated worktree, the Claude Code runtime refuses Bash command text it cannot show stays inside the worktree. Observed refusals include text containing `pwsh`, `bash`, or `wsl`, heredocs, `printf --`, a `cd <path> &&` prefix before `git`, `git -C <other worktree>`, embedded `jq` filter strings, an unquoted shell variable in an option position, and loops or other compound constructs around `sh`. Text that passes includes `sh <file>.sh` with a literal path, `npx`, `poetry run python <script>`, `gh`, worktree-scoped `git`, and `git commit -F <file>`. No file under `.claude/hooks/` implements this guard, and no settings file registers it.
|
|
27
|
+
- **Repository hooks.** `.claude/hooks/validate-bash.ps1` (`.codex/hooks/validate-bash.ps1` for Codex; functions `Get-BlockedBashPattern`, `Get-CdChainedReadCommandMatch`, `Get-BashBlockReason`) denies destructive patterns (`rm -rf`, forced pushes, `git reset --hard`, recursive forced removal) and a `cd` followed later in the same command by a file-reading command such as `grep`, `cat`, `head`, `tail`, `less`, `more`, `awk`, or `sed -n`. `.claude/hooks/enforce-parallel-worktree-removal-gate.ps1` denies the literal worktree-removal command anywhere in a command.
|
|
28
|
+
- A multi-line `poetry run python -c` program exits 0 without running. Put Python helpers in a file under `SCRATCH` and run the file.
|
|
29
|
+
|
|
30
|
+
## PowerShell Route and PoshQC MCP Limits
|
|
31
|
+
|
|
32
|
+
- PoshQC MCP results carry no output. The summary string is composed from a fixed template before the child process runs (`runPoshQcWorkflow` in `extensions/drm-copilot/src/repo-automation-service.ts`), and `RepoAutomationExecutionResult` has no exit-code or output field. An `ok: true` result proves only that the tool was invoked.
|
|
33
|
+
- Counts, percentages, and findings therefore come from files or direct runs: pass and fail counts from `artifacts/pester/pester-junit.xml`, line coverage from `artifacts/pester/powershell-coverage.xml`, and analyzer findings from a direct `Invoke-ScriptAnalyzer` run with `scripts/powershell/PoshQC/settings/pssa.settings.psd1`.
|
|
34
|
+
- The MCP test tool reads the installed extension's settings. Branch-current Pester runs import `scripts/powershell/PoshQC/PoshQC.psd1` and call `Invoke-PoshQCTest` from a `sh`-launched PowerShell 7. The coverage population is derived by `Invoke-PoshQCTest` from `config/poshqc-coverage.json`; there is no hand-maintained coverage path list.
|
|
35
|
+
- `Invoke-Pester` without `-EnableExit` (or `Run.Exit`) exits 0 when tests fail; read the JUnit file rather than the exit code of such a run.
|
|
36
|
+
|
|
37
|
+
## Batch Budget
|
|
38
|
+
|
|
39
|
+
- In direct mode the batch-budget hooks allow at most three distinct production files per kind in one session: the fourth distinct non-test PowerShell file is denied with `POWERSHELL_LARGE_PATH_REQUIRED` and the fourth distinct non-test Python file with `PYTHON_LARGE_PATH_REQUIRED` (`.claude/hooks/enforce-powershell-batch-budget.ps1` and `.claude/hooks/enforce-python-batch-budget.ps1`; Codex copies under `.codex/hooks/`). Test files never count.
|
|
40
|
+
- Exemption: the cap does not apply when `artifacts/orchestration/orchestrator-state.json` in the worktree that holds the hook script selects the `large`, `remediation`, or `preparation` route and is not terminal (`Test-BatchBudgetLargePathRoute` in `.claude/hooks/enforce-batch-budget-route.ps1`). An isolated subagent worktree has no checkpoint, because `artifacts/` is gitignored, so direct mode applies there.
|
|
41
|
+
- Bundle mirror copies under `extensions/drm-copilot/resources/` are production files and count against the cap.
|
|
42
|
+
- A scratch `.ps1` file counts when it resolves inside the worktree root. Files under `SCRATCH`, which is outside the worktree root, are discarded without consuming a slot.
|
|
43
|
+
- Only `Write` and `Edit` calls are seen (the hook matcher is `Write|Edit`). Files written by Bash, by a copy script, or by a generator are not seen.
|
|
44
|
+
- Budget state is kept per session under `.claude/state/`; there is no automatic reset.
|
|
45
|
+
|
|
46
|
+
## Hook Execution Context
|
|
47
|
+
|
|
48
|
+
- Hooks for an isolated subagent run inside the subagent's worktree with that worktree's hook scripts, which are `main`'s copies. A hook change on a branch is not exercised by isolated subagents until it merges.
|
|
49
|
+
- Hook behavior on a branch is therefore proven by Pester suites, not by a live subagent run. A live check of a branch hook needs a non-isolated delegation from the item worktree.
|
|
50
|
+
- Enforcement hooks do not invoke Python; bash is preferred and PowerShell is acceptable (`tests/scripts/claude-runtime/enforcement-hooks-no-python-invocation.Tests.ps1`).
|
|
51
|
+
|
|
52
|
+
## MCP Surfaces Run the Installed Extension
|
|
53
|
+
|
|
54
|
+
- Every `mcp__drm-copilot__*` tool runs the installed extension, not the branch. `validate_orchestration_artifacts` applies the installed rule set, so validator rules added on a branch apply through MCP only after the extension release that carries them is installed.
|
|
55
|
+
- Branch-current plan validation runs the repository's Python CLI `scripts/dev_tools/validate_orchestration_artifacts.py` with its `plan` subcommand, through Poetry in module form.
|
|
56
|
+
- A push-down served by the MCP tools writes the installed extension's bundled payload; a repository-side edit under `extensions/drm-copilot/resources/` changes that payload only after a rebuild and reinstall.
|
|
57
|
+
|
|
58
|
+
## CI Shape and Required Checks
|
|
59
|
+
|
|
60
|
+
- `.github/workflows/ci.yml` triggers on `push` to `main` and `development`, on `pull_request` to `main`, `development`, and `epic/**`, on `workflow_dispatch`, and on `merge_group` (`types: [checks_requested]`, added by issue #952), with no path filters. When the merge queue on `main` is enabled, every required check is produced by a `merge_group` run of `ci.yml` as well as by the pull-request run; `.github/workflows/README.md` (`## Triggers`) records the trigger set.
|
|
61
|
+
- Jobs in `ci.yml` and their check names: `Change scope` (job `changes`, the change-scope decision below); `CI full run` (job `full-run-marker`, which runs only on a full run, marks that run as a valid base for later decisions, and is not a required check); `quality-checks7 / Code Quality & Tests (<python-version>)` on Python 3.10, 3.11, 3.12, and 3.13 (`_quality-checks.yml`: Black check, Ruff, Pyright, the Codex generator `--check`, the tier classification, Pytest with line and branch coverage, and the coverage-threshold check on the JSON report totals); `security-scan / Security Scanning` (its `safety check` step carries `continue-on-error: true` and does not fail the check); `docs-validation / Documentation Validation`; `build-check / Build Package`; `shell-coverage / Shell Coverage (Bats + kcov)`; `drm-copilot-extension-tests / drm-copilot Extension Tests (<os>)` on `ubuntu-latest` and `windows-latest`; `root-typescript-tests / Root TypeScript Tests (<os>)` on `ubuntu-latest` and `windows-latest`; `NPM Audit Gate / npm audit (<manifest>)` (the calling job carries the name `NPM Audit Gate`); and the `poshqc` group below.
|
|
62
|
+
- PowerShell CI (`_poshqc.yml`): `poshqc / PowerShell QC static` (format and analyze on `windows-latest`); the shard matrix `poshqc / PowerShell QC shard 1`, `shard 2`, and `shard 3` (`Invoke-PoshQCTest -ShardIndex -ShardCount` over the scan folders of `config/poshqc-scan.json`, with coverage, on `windows-latest`); the aggregator `poshqc / PowerShell QC`, which requires the static and shard jobs to succeed, verifies shard completeness against a Pester discovery count, and merges shard coverage; and `poshqc / PowerShell hook suites (Linux)`, which runs only `tests/scripts/claude-hooks` and `tests/scripts/codex-hooks` on `ubuntu-latest` with coverage disabled. A new test file under a scanned folder is assigned to a shard automatically and is counted by the completeness check.
|
|
63
|
+
- Change-scope decision (issue #962): the `Change scope` job runs `scripts/ci/Invoke-CiChangeScope.ps1` and publishes the job output `code`. The decision is `code=false` (docs-only) only on a `pull_request` event from this repository, through one of two comparisons. Green-run base: every file changed since the newest successful `ci.yml` run on the pull-request branch whose `CI full run` job succeeded, and whose head commit is present and an ancestor of the current head, is on the allowlist `config/ci-docs-only-paths.json`; the reason is `DOCS_ONLY_SINCE_<green head sha>`. Merge-base fallback (issue #973): when the green-run step ends with no earlier full green run (`NO_FULL_GREEN_RUN`), a missing base (`BASE_NOT_PRESENT`), or a non-ancestor base (`BASE_NOT_ANCESTOR`), and the pull request's base ref is exactly `main`, the script computes `git merge-base` of the payload base SHA (`BASE_SHA`, from `github.event.pull_request.base.sha`; the base ref arrives as `BASE_REF`) and the head, lists the files changed since that merge base with the same diff arguments, and decides `DOCS_ONLY_SINCE_MERGE_BASE_<merge base sha>` when every changed file is allowlisted. Both comparisons run the diff with rename detection off, so both the old and the new path of a rename are classified. A path is allowlisted when it starts with `docs/features/active/`, `docs/features/archive/`, `docs/features/completed/`, `docs/features/epics/`, `docs/features/parallel/`, `docs/features/potential/`, or `docs/research/`, does not start with `docs/features/templates/` or `docs/features/potential/template.md`, and ends in `.md`, `.txt`, `.log`, `.json`, or `.xml`; the allowlist file itself is not allowlisted. Every other case is a full run (`code=true`): `push`, `merge_group`, and `workflow_dispatch` events, a fork pull request, unreadable run or job data, no earlier full green run or a missing or non-ancestor base when the base ref is not `main`, a merge base that cannot be resolved (`MERGE_BASE_UNRESOLVED`, for example a blank base SHA or a base commit missing from the checkout), a failed ancestry check, an empty diff, any path outside the allowlist, and any error. The decision step carries `continue-on-error: true` and the callers compare the output with `!= 'false'`, so a failed or missing decision also gives a full run.
|
|
64
|
+
- Docs-only behavior (`code=false`): `ci.yml` passes `run-heavy: false` to `_quality-checks.yml`, `_security-scan.yml`, `_build-check.yml`, `_poshqc.yml`, `_shell-coverage.yml`, and `_drm-copilot-extension-tests.yml`. Each required job still starts under its full-run check name with every step skipped, so every required context reports `success` without running its suite. In `_poshqc.yml` the aggregator `poshqc / PowerShell QC` runs with every step gated, and `poshqc / PowerShell QC static`, the shard jobs, and `poshqc / PowerShell hook suites (Linux)` are skipped at job level. `docs-validation / Documentation Validation` runs in full. `root-typescript-tests`, `NPM Audit Gate`, and `CI full run` are skipped at job level. A `success` on a docs-only commit is therefore not evidence that the heavy suites pass for that commit; that evidence is the newest run whose `CI full run` job succeeded.
|
|
65
|
+
- A commit that changes any path outside the allowlist (any code, workflow, configuration, script, test, or customization file) runs the full set of jobs, and its `CI full run` job marks it as a base for later docs-only decisions. A standalone `workflow_dispatch` of a reusable workflow, or a caller that omits `run-heavy`, also runs in full. `.github/workflows/README.md` (`## Change-Scope Decision (Issue #962)`) records the reason codes and the per-context behavior table.
|
|
66
|
+
- Required contexts of ruleset 15241672, confirmed by the orchestrator through `gh api` on 2026-10-16: `drm-copilot-extension-tests / drm-copilot Extension Tests (ubuntu-latest)`, `drm-copilot-extension-tests / drm-copilot Extension Tests (windows-latest)`, `docs-validation / Documentation Validation`, `poshqc / PowerShell QC`, `shell-coverage / Shell Coverage (Bats + kcov)`, `security-scan / Security Scanning`, `quality-checks7 / Code Quality & Tests (3.10)`, `quality-checks7 / Code Quality & Tests (3.11)`, `quality-checks7 / Code Quality & Tests (3.12)`, `quality-checks7 / Code Quality & Tests (3.13)`, `build-check / Build Package`.
|
|
67
|
+
- Refresh rule: a change that renames a job, adds or removes a matrix entry, or changes the ruleset refreshes this list in the same change, and the orchestrator re-confirms the contexts with a read-only `gh api repos/drmoisan/drm-copilot/rulesets/15241672` call before relying on them.
|
|
68
|
+
- Skipped-check semantics: a job skipped by an `if:` condition reports success to a required check; a workflow that does not run at all reports nothing, which leaves the required check pending.
|
|
69
|
+
- A pull request into a branch other than `main`, `development`, or `epic/**` gets no CI run; dispatch `ci.yml` manually for it.
|
|
70
|
+
|
|
71
|
+
## CI-Only Failure Classes
|
|
72
|
+
|
|
73
|
+
- A test that reads gitignored `artifacts/` state passes only on a worktree that holds that state; CI has none.
|
|
74
|
+
- A fixture rooted at a drive letter or a `C:/workspace` path fails `path.isAbsolute` and path joins on Linux.
|
|
75
|
+
- `_shell-coverage.yml` checks out at depth one, so `origin/main` does not exist in that job; no test may diff against it.
|
|
76
|
+
- The Linux hook-suite job runs `tests/scripts/claude-hooks` and `tests/scripts/codex-hooks` on a case-sensitive file system: use `Join-Path`, forward-slash relative paths, exact file-name case, and no drive letters or backslash literals.
|
|
77
|
+
- The `.gitattributes` rule `* text=auto eol=lf` normalizes line endings on checkout, so a CRLF fixture committed as text is not CRLF in CI.
|
|
78
|
+
- Shard and single-process Pester runs expose module-scope import visibility and leaked state that per-suite local runs hide.
|
|
79
|
+
|
|
80
|
+
## Contract Tests That Pin Mirrored Files
|
|
81
|
+
|
|
82
|
+
Run these after editing any mirrored or bundled file; each is under `tests/scripts/dev_tools/` unless named otherwise.
|
|
83
|
+
|
|
84
|
+
- `test_push_down_claude_resource_contracts.py` and `test_push_down_codex_and_agents_resource_contracts.py`: every distributable `.claude`, `.agents`, and `.codex` file exists in the bundle with equal text.
|
|
85
|
+
- `test_push_down_claude_pack_manifest_completeness.py` and `test_push_down_codex_and_agents_pack_manifest_completeness.py`: every bundled file is listed in a pack manifest.
|
|
86
|
+
- The Codex generator check: `scripts/dev_tools/generate_codex_agent_variants.py` run in module form with `--check` (base agents are hand-edited; variants, bundle copies, and the Codex `core.json` are generated).
|
|
87
|
+
- `test_codex_agent_wrapper_contracts.py` and `test_codex_handoff_contract_parity.py`: pinned Codex agent fragments and handoff parity.
|
|
88
|
+
- `test_claude_rules_frontmatter.py`: rule `paths:` scopes and that every preloaded skill exists.
|
|
89
|
+
- `parallel_orchestrator_surface_expectations.py` (`PINNED_FROZEN_SURFACE_HASHES`): byte hashes of frozen orchestration surfaces, including `.claude/skills/epic-orchestrate/SKILL.md` and `.claude/agents/epic-orchestrator.md`.
|
|
90
|
+
- `test_quality_checks_workflow_contracts.py`: workflow step conditions.
|
|
91
|
+
- `test_push_down_issue_824_follow_ups.py`: pushed rules and skills name no consuming product.
|
|
92
|
+
- `test_typescript_toolchain_instruction_contracts.py`: no reference to another test framework, and every backticked npm script token in the pinned mirrors exists in the root `package.json`.
|
|
93
|
+
- `tests/scripts/claude-runtime/claude-architecture-doc.Tests.ps1` and `tests/scripts/claude-runtime/hook-dependency-guard-completeness.Tests.ps1`: agent tool names in the architecture document and the guarded dot-source pattern in hooks.
|
|
94
|
+
|
|
95
|
+
## Preflight Defect Classes the Validator Cannot See
|
|
96
|
+
|
|
97
|
+
These pass every validator rule and are found only by reading the plan against the tree:
|
|
98
|
+
|
|
99
|
+
- `git grep` against a file the plan creates (untracked, so invisible to `git grep`); a search pattern beginning with `-` that is not passed through `-e`.
|
|
100
|
+
- A checkbox diff-pair assertion against a file the plan adds, and a CRLF fixture under the `eol=lf` attribute rule.
|
|
101
|
+
- A new TypeScript production file without its own `coverageThreshold` entry in `extensions/drm-copilot/jest.config.cjs`, whose threshold map has per-file entries only and no `global` key.
|
|
102
|
+
- A per-file coverage floor asserted for code that the tests replace with blanket mocks.
|
|
103
|
+
- Batch-budget exhaustion across a session, and an acceptance condition that depends on a branch hook being exercised by an isolated subagent.
|
|
104
|
+
- `origin/main` advancing during planning: scope diffs anchor on the merge base of `origin/main` and `HEAD`, never on `origin/main` itself.
|
|
105
|
+
- `Measure-Object -Line` counts non-empty lines only; physical line counts use `wc -l` or `@(Get-Content -LiteralPath <path>).Count`.
|
|
106
|
+
- A coverage argument written as a filesystem path measures nothing; the dotted module form is required, and branch figures come from the JSON report, not the combined terminal column.
|
|
107
|
+
- A task that changes the observable behavior of an existing function, script, fixture, or test stub (signature, argv, output, exit status, or written files) while the tests that assert that behavior are outside the task's file set: those tests fail once the change lands, and the plan's own acceptance cannot be met. Preflight searches the test tree for the changed symbol, the file name, and the asserted output, and confirms that the task names each matching test with its disposition (unchanged because unaffected, or updated with the reason).
|
|
108
|
+
- A plan that alters a fact this brief states (it adds or renames a CI job, changes a required status context, a tool route, or a batch-budget rule) with no task that updates the brief in the same change, in all six byte-identical copies: the plan then breaks the maintenance rule in `## Purpose and Maintenance`. Preflight compares each task's changes against the facts this brief states and confirms that a brief-update task exists and that the plan's `Mirror parity` Pre-Mortem bullet names it.
|
|
109
|
+
|
|
110
|
+
## Evidence and Documentation Rules
|
|
111
|
+
|
|
112
|
+
- Evidence lives under `<FEATURE>/evidence/<kind>/` with kinds `baseline`, `regression-testing`, `qa-gates`, `other`, `issue-updates`, and `remediation-baseline` (`.claude/skills/evidence-and-timestamp-conventions/SKILL.md`; enforced by `.claude/hooks/enforce-evidence-locations.ps1`).
|
|
113
|
+
- Evidence filenames carry the UTC time of the write, read from the clock, in the `yyyy-MM-ddTHH-mm` shape; a consumer selects the lexicographically greatest `<name>.*.md`. Plan files are stamped by the feature-folder tooling in America/New_York.
|
|
114
|
+
- Every command-step artifact carries `Timestamp:`, `Command:`, `EXIT_CODE:`, and `Output Summary:`. No artifact records an absolute path, a host name, or a session scratchpad path; scratch locations are recorded as the token `SCRATCH`.
|
|
115
|
+
- `SCRATCH` is `<session scratchpad>/issue-<issue-num>/`, and scratch file names start with `issue-<issue-num>-`.
|
|
116
|
+
- `.github/workflows/_docs-validation.yml` checks only that `README.md` is present and non-empty and that `LICENSE` exists, and it warns when two instruction files are missing. There is no Markdown lint or link check in CI.
|
|
117
|
+
|
|
118
|
+
## Coverage and File-Size Gates
|
|
119
|
+
|
|
120
|
+
- Line coverage of at least 85% and branch coverage of at least 75% apply per changed production file in Python and TypeScript. PowerShell has a line threshold of 85% and no branch gate, because Pester does not measure branch coverage. No production file may be excluded from measurement.
|
|
121
|
+
- Python: measure a module with `--cov=<dotted.module>`, `--cov-branch`, `--cov-report=term-missing`, and `--cov-report=json:<path>`; read branch figures from the JSON report.
|
|
122
|
+
- TypeScript: a new production file needs its own entry in the `coverageThreshold` map of `extensions/drm-copilot/jest.config.cjs`; Jest runs through `node run-jest.cjs` in `extensions/drm-copilot/`.
|
|
123
|
+
- PowerShell: per-file line coverage is read from `artifacts/pester/powershell-coverage.xml` written by the self-hosted PoshQC module.
|
|
124
|
+
- No production, test, or reusable script file exceeds 500 physical lines; Markdown is exempt. Files at or near the limit are not extended; new logic goes into a new module and a new test file.
|
|
125
|
+
|
|
126
|
+
## Test Isolation Checks
|
|
127
|
+
|
|
128
|
+
- Tests create no temporary files; file and transcript reads go through injected seams with in-memory content.
|
|
129
|
+
- Before review, run each isolation check and record it under `<FEATURE>/evidence/regression-testing/`:
|
|
130
|
+
- a seeded shuffled Jest run (`node run-jest.cjs --randomize --seed=<n>` in `extensions/drm-copilot/`) with the seed recorded;
|
|
131
|
+
- a reversed-order run of the new or changed Python test modules in one process;
|
|
132
|
+
- a seeded shuffled file-order run of the touched Pester suites in one process, with at least three seeds and each seed and its file order recorded;
|
|
133
|
+
- a fresh single-process Pester run over `tests/scripts`, which is the CI shape.
|
|
134
|
+
- An order dependence found by any run is fixed on both sides: the suite that leaves state behind (globals, functions, environment variables, mocks, imported modules, script-scope state) and the suite that assumes prior state. Every seed is then re-run.
|
|
@@ -27,6 +27,7 @@ Before proceeding, the orchestrator must:
|
|
|
27
27
|
1. Read `AGENTS.md` for repository tone policy and architectural context.
|
|
28
28
|
2. Read applicable `.agents/skills/` files for the languages in scope.
|
|
29
29
|
3. Read the policy files listed in the compliance reading order section of `AGENTS.md`.
|
|
30
|
+
4. Read the `execution-environment` skill (`.agents/skills/execution-environment/SKILL.md`) before delegating any worker. Delegation prompts and plans reference that brief instead of restating tool routes, command-text restrictions, the batch budget, hook context, or CI shape.
|
|
30
31
|
|
|
31
32
|
## Checkpoint Handling
|
|
32
33
|
|
|
@@ -101,8 +102,8 @@ Apply the deterministic production-file axis before model selection:
|
|
|
101
102
|
closed to the large orchestrator topology.
|
|
102
103
|
- Outside the applicable budget, cross-cutting, mixed-language, or unsupported: deploy
|
|
103
104
|
`orchestrator-<profile>` and let that agent run the large path.
|
|
104
|
-
- Epic planning: deploy the forced `epic-planner`
|
|
105
|
-
- Prepared or manual epic execution: deploy the forced `epic-orchestrator`
|
|
105
|
+
- Epic planning: deploy the forced `epic-planner` Astra/Ultra persona.
|
|
106
|
+
- Prepared or manual epic execution: deploy the forced `epic-orchestrator` Astra/Ultra persona.
|
|
106
107
|
|
|
107
108
|
Only the production-file limit selects inside versus outside the language topology budget. The
|
|
108
109
|
test-file estimate remains in the receipt and governs typed-engineer batching; it does not change
|
|
@@ -121,7 +122,11 @@ route.
|
|
|
121
122
|
- Copy the exact required agents, skills, and MCP tools from the central `preparation` route.
|
|
122
123
|
- Perform promotion through the MCP surface, research, `spec.md`, `user-story.md`, atomic
|
|
123
124
|
planning, and atomic-executor preflight only.
|
|
124
|
-
-
|
|
125
|
+
- Run single-pass preflight against the same plan path (`### Single-Pass Preflight` in
|
|
126
|
+
`atomic-plan-contract`): trivial defects are fixed in place, the plan returns to the planner at
|
|
127
|
+
most once with the full `PREFLIGHT-DEFECT:` list, and a second substantive result halts with
|
|
128
|
+
`blocked_reason: "validator_failed"`. The preflight directive goes in the delegation prompt,
|
|
129
|
+
never in the plan file.
|
|
125
130
|
- Commit the prepared feature folder and approved plan to the worktree branch.
|
|
126
131
|
- Stop with `completed_steps` containing `S3_promotion` and `S4_atomic_planning`,
|
|
127
132
|
`next_step: "S5_atomic_execution"`, all execution-through-CI step statuses exactly
|
|
@@ -153,8 +158,8 @@ checked-in Codex deployment agent. Before every delegation:
|
|
|
153
158
|
5. Require the `SubagentStart` model attestation to match the receipt before accepting mutation
|
|
154
159
|
or completion.
|
|
155
160
|
|
|
156
|
-
C3 defaults to
|
|
157
|
-
|
|
161
|
+
C3 defaults to Sol/High when it is the standalone orchestration ceiling. It elevates to
|
|
162
|
+
Astra/High only for epic preparation/execution children or when a C4 sibling sets the ceiling to
|
|
158
163
|
C4. If the required model/profile is unavailable, record `model_unavailable` and stop without a
|
|
159
164
|
silent fallback.
|
|
160
165
|
|
|
@@ -430,8 +435,13 @@ A bounded loop consisting of five steps. The attempt count is `remediation_loop.
|
|
|
430
435
|
|
|
431
436
|
Cycle accounting: a remediation attempt is complete when R3 execution finished (`execution_status: "complete"`) and the pre-R4 commit recorded a non-empty change set; only then set `candidate_applied: true` on that cycle and increment `completed_attempts`. A cycle that ends without a candidate (execution not started, execution failed, or an empty staged change set) records `candidate_applied: false` and consumes no number. It is followed by at most one re-plan under the same number when the executor output identifies an autonomous plan defect; otherwise reclassify the blocker (typically `external_dependency`) and halt. Two consecutive no-candidate cycles halt with `step6_status: "blocked_remediation_loop_limit"`.
|
|
432
437
|
|
|
438
|
+
Remediation mode. Each cycle's `remediation-inputs.<timestamp>.md` carries exactly one line `Remediation-Mode: proportionate` or `Remediation-Mode: design`. A cycle is proportionate when every `autonomous` finding can be fixed without changing a spec acceptance criterion, a public interface, or the item's file inventory beyond the files already in the branch diff plus their tests and mirrors; otherwise it is design. CI-failure findings are normally proportionate.
|
|
439
|
+
|
|
440
|
+
- **Proportionate cycle.** One `atomic-planner` delegation produces a short plan with a `## Pre-Mortem` section and a final self-review task; R2 and R3 then run as one `atomic-executor` delegation that performs single-pass preflight with in-place trivial fixes and executes the plan. Record `preflight: {iterations: 1, final_status: "clear"}` before `execution_status`. A substantive defect stops the run with `BLOCKED at preflight (before [P0-T1])` and no checked task; rewrite the mode line to `Remediation-Mode: design` and continue as a design cycle with one planner revision.
|
|
441
|
+
- **Design cycle.** R1 to R5 run as listed below, with R2 under the single-pass preflight and at-most-one-return rule.
|
|
442
|
+
|
|
433
443
|
- **R1 — Remediation plan of record:** Use the exact `REMEDIATION_PLAN: <path>` returned by the review as the starting plan of record for the loop.
|
|
434
|
-
- **R2 — Preflight clearance:** Delegate to `atomic-executor` for precondition validation only (no implementation). If the executor
|
|
444
|
+
- **R2 — Preflight clearance:** Delegate to `atomic-executor` for precondition validation only (no implementation), with the preflight directive in the delegation prompt. Trivial defects are fixed in place. If the executor returns `PREFLIGHT: REVISIONS REQUIRED`, return to R1 once by re-delegating to `atomic-planner` against the same remediation-plan path with the full `PREFLIGHT-DEFECT:` list; if the following preflight still reports a substantive defect, record `final_status: "blocked_preflight_iteration_limit"` on the cycle and halt. Only after `PREFLIGHT: ALL CLEAR` may the orchestrator advance to R3.
|
|
435
445
|
- **R3 — Remediation execution:** Delegate to `atomic-executor` with full execution authorization. Each task's toolchain loop (format → lint → type-check → test) is mandatory; no skipping.
|
|
436
446
|
- **Pre-R4 commit:** Stage all changes (`git add -A`), run MCP tool `collect_commit_context`, delegate to `commit_steward` using the resulting artifact, and commit with the generated message. Advance to R4 only after a successful commit.
|
|
437
447
|
- **R4 — Re-audit:** Refresh PR context via MCP tool `collect_pr_context`, then delegate to `feature-reviewer` with the same inputs as the original review (resolved base branch, feature folder, refreshed PR context artifacts, acceptance-criteria source). No scope narrowing. The canonical issue number line must be included.
|
package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md
CHANGED
|
@@ -275,7 +275,7 @@ If an exact signal or required path field is missing, set the relevant step to `
|
|
|
275
275
|
8. Keep topology routing separate from C1-C4 model routing. Persist both topology and
|
|
276
276
|
model-routing receipts and select the exact generated Codex deployment agent before every
|
|
277
277
|
delegation.
|
|
278
|
-
9. Use
|
|
278
|
+
9. Use Sol/High for standalone ceiling-C3 work. Use Astra/High for C3 epic children or C3 work in
|
|
279
279
|
an orchestration whose monotonic ceiling is C4. Do not infer this overlay from file count.
|
|
280
280
|
|
|
281
281
|
## Small Path
|
|
@@ -28,7 +28,7 @@ When routed through `powershell-orchestrator`, small path still requires lifecyc
|
|
|
28
28
|
- promote potential item to GitHub issue with `--work-mode minor-audit`,
|
|
29
29
|
- create active feature folder with `--work-mode minor-audit`,
|
|
30
30
|
- delegate minimal-audit plan creation to `atomic_planner` with `DIRECTIVE: MINIMAL-AUDIT PLAN REQUIRED`,
|
|
31
|
-
- require `atomic_executor` preflight
|
|
31
|
+
- require single-pass `atomic_executor` preflight ending in `PREFLIGHT: ALL CLEAR` (at most one return to the planner),
|
|
32
32
|
- execute Phase 0 only via `atomic_executor` before branching,
|
|
33
33
|
- run reduced small-audit after implementation and QC.
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@ When routed through the orchestrator, the small path still requires lifecycle sc
|
|
|
40
40
|
- promote the potential item to a GitHub issue with `--work-mode minor-audit`,
|
|
41
41
|
- create the active feature folder with `--work-mode minor-audit`,
|
|
42
42
|
- delegate minimal-audit plan creation to `atomic_planner` with `DIRECTIVE: MINIMAL-AUDIT PLAN REQUIRED`,
|
|
43
|
-
- require `atomic_executor` preflight
|
|
43
|
+
- require single-pass `atomic_executor` preflight ending in `PREFLIGHT: ALL CLEAR` (at most one return to the planner),
|
|
44
44
|
- execute Phase 0 only via `atomic_executor` before branching,
|
|
45
45
|
- run the reduced small-audit after implementation and QC.
|
|
46
46
|
|
|
@@ -27,6 +27,9 @@ Remediation triggers only on blocking findings classified `autonomous`. Each blo
|
|
|
27
27
|
Create `remediation/<timestamp>/remediation-inputs.md` (one timestamped `remediation/` folder per cycle; reaudit artifacts from a triggering or exit review live under the sibling `audit/<timestamp>/` folder, per the canonical pattern documented in the Claude-side `remediation-handoff-atomic-planner` skill) with:
|
|
28
28
|
- Enumerated fix list with file paths, expected behavior, and verification commands.
|
|
29
29
|
- A “do not do” list (no scope creep, no policy weakening, no silent skips).
|
|
30
|
+
- Exactly one mode line, `Remediation-Mode: proportionate` or `Remediation-Mode: design`. The cycle is proportionate when every `autonomous` finding can be fixed without changing a spec acceptance criterion, a public interface, or the item's file inventory beyond the files already in the branch diff plus their tests and mirrors; otherwise it is design. CI-failure findings are normally proportionate.
|
|
31
|
+
|
|
32
|
+
Proportionate cycle: one `atomic_planner` delegation writes a short plan with a `## Pre-Mortem` section and a final self-review task, and one `atomic_executor` delegation runs single-pass preflight with in-place trivial fixes and then executes it; `preflight: {iterations: 1, final_status: "clear"}` is recorded before `execution_status`. A substantive preflight defect stops that run with `BLOCKED at preflight (before [P0-T1])` and no checked task, and the cycle converts to design mode (the mode line is rewritten to `Remediation-Mode: design`) for one planner revision. Design cycle: the handoff below runs with the at-most-one-return rule.
|
|
30
33
|
|
|
31
34
|
## Plan Creation and Handoff
|
|
32
35
|
|
|
@@ -36,9 +39,10 @@ Create `remediation/<timestamp>/remediation-inputs.md` (one timestamped `remedia
|
|
|
36
39
|
- `${file}` pointing to the remediation plan target file
|
|
37
40
|
3) Require `atomic_planner` to output a deterministic, atomic plan with phases and `[P#-T#]` IDs.
|
|
38
41
|
4) Require the same `${file}` path to be updated in place across all remediation-plan revisions in the same remediation loop.
|
|
39
|
-
5) The caller owns the downstream clearance
|
|
40
|
-
- hand the resulting remediation plan to `atomic_executor` in preflight-validation mode,
|
|
41
|
-
- if preflight returns `PREFLIGHT: REVISIONS REQUIRED`, re-delegate to `atomic_planner` against the same `${file}` path,
|
|
42
|
+
5) The caller owns the downstream clearance step:
|
|
43
|
+
- hand the resulting remediation plan to `atomic_executor` in preflight-validation mode, with the preflight directive in the delegation prompt and never in the plan file; preflight is single-pass and fixes trivial defects in place,
|
|
44
|
+
- if preflight returns `PREFLIGHT: REVISIONS REQUIRED`, re-delegate to `atomic_planner` once against the same `${file}` path with the full `PREFLIGHT-DEFECT:` list, then run one confirming preflight,
|
|
45
|
+
- if the confirming preflight still reports a substantive defect, record `final_status: "blocked_preflight_iteration_limit"` and halt the cycle,
|
|
42
46
|
- execute the remediation plan only after `PREFLIGHT: ALL CLEAR`.
|
|
43
47
|
|
|
44
48
|
## Context Package (When Required)
|
|
@@ -55,6 +55,12 @@ Create or update a single research file in the applicable tracked research root:
|
|
|
55
55
|
- Propose a test strategy consistent with repository policy (unit tests for pure logic, integration seams).
|
|
56
56
|
- Do not write test code; describe the strategy only.
|
|
57
57
|
|
|
58
|
+
### 6. Pre-Mortem
|
|
59
|
+
|
|
60
|
+
- Feature-associated research (a research path under `docs/features/`) MUST carry a `## Pre-Mortem` section with one bullet beginning with each of the seven labels `Review checklists`, `Coverage`, `Mirror parity`, `File size`, `Test isolation`, `CI-only behavior`, and `Evidence`. Each bullet states how the next review or CI run could fail on that dimension and the mitigation the plan must carry; a label that does not apply is written as "not applicable" followed by the reason.
|
|
61
|
+
- One-off research under `docs/research/` is exempt.
|
|
62
|
+
- The `execution-environment` skill states the CI shape, contract tests, and isolation checks the section accounts for.
|
|
63
|
+
|
|
58
64
|
## Constraints
|
|
59
65
|
|
|
60
66
|
- Research only. Do not implement changes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
name = "atomic-executor-c1"
|
|
2
2
|
description = "Converted subagent"
|
|
3
|
-
model = "gpt-
|
|
3
|
+
model = "gpt-6-luna"
|
|
4
4
|
model_reasoning_effort = "low"
|
|
5
5
|
developer_instructions = '''
|
|
6
6
|
Applied rewrites:
|
|
@@ -11,6 +11,7 @@ Use the following repo-local skills as the canonical workflow source:
|
|
|
11
11
|
- atomic-plan-contract
|
|
12
12
|
- policy-compliance-order
|
|
13
13
|
- acceptance-criteria-tracking
|
|
14
|
+
- execution-environment
|
|
14
15
|
|
|
15
16
|
---
|
|
16
17
|
name: atomic-executor
|
|
@@ -35,11 +36,13 @@ tools:
|
|
|
35
36
|
- "mcp__drm-copilot__run_poshqc_analyze"
|
|
36
37
|
- "mcp__drm-copilot__run_poshqc_test"
|
|
37
38
|
- "mcp__drm-copilot__run_poshqc_analyze_autofix"
|
|
39
|
+
- "mcp__drm-copilot__validate_orchestration_artifacts"
|
|
38
40
|
skills:
|
|
39
41
|
- policy-compliance-order
|
|
40
42
|
- atomic-plan-contract
|
|
41
43
|
- evidence-and-timestamp-conventions
|
|
42
44
|
- acceptance-criteria-tracking
|
|
45
|
+
- execution-environment
|
|
43
46
|
memory: project
|
|
44
47
|
hooks:
|
|
45
48
|
SubagentStop:
|
|
@@ -106,19 +109,20 @@ Concurrent child runs in one session share one session scratchpad, so every scra
|
|
|
106
109
|
|
|
107
110
|
## Preflight Validation
|
|
108
111
|
|
|
109
|
-
When
|
|
112
|
+
When the delegation prompt carries the directive `DIRECTIVE: PREFLIGHT VALIDATION ONLY`, perform validation only and return exactly one of `PREFLIGHT: ALL CLEAR` or `PREFLIGHT: REVISIONS REQUIRED`. The preflight directive belongs in the delegation prompt, never in a plan file.
|
|
110
113
|
|
|
111
114
|
- `PREFLIGHT: ALL CLEAR`
|
|
112
115
|
- `PREFLIGHT: REVISIONS REQUIRED`
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
116
|
+
- Review the entire plan in one pass and classify every defect as trivial or substantive, per `### Single-Pass Preflight` in `atomic-plan-contract`.
|
|
117
|
+
- Fix trivial defects in place, in task text only; never add, remove, or reorder tasks. Report each fix as `PREFLIGHT-FIX: <task id or heading> | <defect class> | <change made>` and name the fix record as `preflight-fix-record: <path>`.
|
|
118
|
+
- If revisions are required, include a precise plan delta that can be applied to the same plan file, with one `PREFLIGHT-DEFECT: <task id or heading> | <defect class> | <required change>` line per substantive defect.
|
|
119
|
+
- Return the result to the caller. A plan returns to the planner at most once; the orchestrator routes the defect list for one revision and runs one confirming preflight.
|
|
120
|
+
- If the required validator is unavailable, stop and report blocked state.
|
|
117
121
|
- Before any `PREFLIGHT: ALL CLEAR` result is treated as approved, the target plan must pass the `validate_orchestration_artifacts` MCP tool with `artifact_type: "plan"` and `artifact_path: <plan-path>`.
|
|
118
122
|
|
|
119
123
|
## Blocking Protocol
|
|
120
124
|
|
|
121
|
-
Blocking is permitted only during preflight validation (before `[P0-T1]`). When preflight-blocked:
|
|
125
|
+
Blocking is permitted only during preflight validation (before `[P0-T1]`), including the preflight that opens a combined preflight-and-execute run of a proportionate remediation cycle. When preflight-blocked:
|
|
122
126
|
|
|
123
127
|
1. State: `BLOCKED at preflight (before [P0-T1])`.
|
|
124
128
|
2. Provide a short, concrete explanation of why.
|