@danmoisan/drm-copilot-mcp 1.1.25 → 1.1.27
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 +170 -52
- package/package.json +1 -1
- package/resources/claude-customizations/.claude/agents/atomic-executor.md +3 -3
- package/resources/claude-customizations/.claude/agents/atomic-planner.md +2 -2
- package/resources/claude-customizations/.claude/agents/csharp-typed-engineer.md +7 -7
- package/resources/claude-customizations/.claude/agents/feature-review.md +6 -3
- package/resources/claude-customizations/.claude/agents/orchestrator.md +11 -7
- package/resources/claude-customizations/.claude/agents/parallel-orchestrator.md +7 -3
- package/resources/claude-customizations/.claude/agents/parallel-planner.md +6 -2
- package/resources/claude-customizations/.claude/agents/powershell-typed-engineer.md +7 -7
- package/resources/claude-customizations/.claude/agents/python-typed-engineer.md +6 -6
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-review.ps1 +699 -0
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +16 -1
- package/resources/claude-customizations/.claude/hooks/enforce-model-routing-receipt.ps1 +41 -0
- package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-cleanup.ps1 +481 -0
- package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +3 -1
- package/resources/claude-customizations/.claude/hooks/enforce-parallel-cohort-barrier-helpers.ps1 +69 -3
- package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill-helpers.ps1 +2 -2
- package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.cleanup.ps1 +246 -0
- package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.docs-only.ps1 +1 -0
- package/resources/claude-customizations/.claude/hooks/hook-cleanup-context.ps1 +343 -0
- package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage-rules.ps1 +50 -16
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorState.psm1 +6 -1
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletion.psm1 +4 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletionChecks.psm1 +51 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateReceipts.psm1 +5 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateRemediationAccounting.psm1 +116 -4
- package/resources/claude-customizations/.claude/lib/parallel-admission/Invoke-ParallelAdmission.ps1 +626 -0
- package/resources/claude-customizations/.claude/lib/parallel-admission/ParallelAdmission.psm1 +508 -0
- package/resources/claude-customizations/.claude/lib/parallel-admission/ParallelAdmissionJson.psm1 +141 -0
- package/resources/claude-customizations/.claude/lib/parallel-admission/ParallelAdmissionPrecedence.psm1 +508 -0
- package/resources/claude-customizations/.claude/rules/csharp.md +8 -8
- package/resources/claude-customizations/.claude/rules/orchestrator-state.md +28 -2
- package/resources/claude-customizations/.claude/rules/parallel-orchestration.md +17 -1
- package/resources/claude-customizations/.claude/rules/powershell.md +2 -2
- package/resources/claude-customizations/.claude/settings.json +1 -0
- package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +9 -13
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/SKILL.md +93 -14
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup-worktrees.sh +23 -10
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_lib.sh +54 -46
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_merge_lib.sh +234 -0
- package/resources/claude-customizations/.claude/skills/csharp-qa-gate/SKILL.md +14 -15
- package/resources/claude-customizations/.claude/skills/epic-progress-report/SKILL.md +338 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Logic.ps1 +248 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Metrics.ps1 +232 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Render.ps1 +196 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.State.ps1 +286 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.ps1 +475 -0
- package/resources/claude-customizations/.claude/skills/execution-environment/SKILL.md +31 -16
- package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +21 -9
- package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +5 -5
- package/resources/claude-customizations/.claude/skills/invoke-powershell-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/.claude/skills/invoke-python-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +24 -2
- package/resources/claude-customizations/.claude/skills/parallel-add/SKILL.md +71 -7
- package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +34 -2
- package/resources/claude-customizations/.claude/skills/parallel-plan/SKILL.md +82 -12
- package/resources/claude-customizations/.claude/skills/powershell-qa-gate/SKILL.md +16 -17
- package/resources/claude-customizations/.claude/skills/python-qa-gate/SKILL.md +15 -16
- package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +1 -1
- package/resources/claude-customizations/.claude-variants/csharp-legacy/agents/csharp-typed-engineer.md +6 -6
- package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/pack-manifests/core.json +15 -0
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +8 -12
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-planner/SKILL.md +1 -1
- package/resources/codex-and-agents-customizations/.agents/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/codex-and-agents-customizations/.agents/skills/execution-environment/SKILL.md +31 -16
- package/resources/codex-and-agents-customizations/.agents/skills/feature-review/SKILL.md +5 -1
- package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +18 -5
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +24 -2
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-state/SKILL.md +16 -1
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +3 -3
- package/resources/codex-and-agents-customizations/.agents/skills/powershell/SKILL.md +2 -2
- package/resources/codex-and-agents-customizations/.agents/skills/powershell-qa-gate/SKILL.md +15 -16
- package/resources/codex-and-agents-customizations/.agents/skills/python-qa-gate/SKILL.md +14 -15
- package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/SKILL.md +2 -0
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c1.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c2.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3-elevated.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c4.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c1.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c2.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3-elevated.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c4.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c1.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c2.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3-elevated.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c4.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/feature-review.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-di-unit-test-engineer.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c1.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c2.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3-elevated.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c4.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/pytest-unit-test-coding.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-execution-only-typed.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c1.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c2.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3-elevated.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c4.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate-review.ps1 +699 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate.ps1 +29 -2
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-cleanup.ps1 +481 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate.ps1 +4 -2
- package/resources/codex-and-agents-customizations/.codex/hooks/hook-cleanup-context.ps1 +343 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/validate-feature-review-coverage.ps1 +51 -4
- package/resources/codex-and-agents-customizations/.codex-variants/csharp-legacy/agents/csharp-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/pack-manifests/core.json +3 -0
- package/resources/customizations/.github/agents/5.1-Beast-adjusted.agent.md +1 -1
- package/resources/customizations/.github/agents/Powershell DI Unit Test Engineer.agent.md +20 -26
- package/resources/customizations/.github/agents/atomic_executor.agent.md +4 -4
- package/resources/customizations/.github/agents/atomic_planning.agent.md +4 -4
- package/resources/customizations/.github/agents/commentary-remediation.agent.md +1 -1
- package/resources/customizations/.github/agents/commit-steward.agent.md +1 -1
- package/resources/customizations/.github/agents/csharp-atomic-executor.agent.md +14 -14
- package/resources/customizations/.github/agents/csharp-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +4 -4
- package/resources/customizations/.github/agents/csharp-typed-engineer.agent.md +19 -22
- package/resources/customizations/.github/agents/epic-review.agent.md +1 -1
- package/resources/customizations/.github/agents/gpt-5-beast-mode.agent.md +3 -3
- package/resources/customizations/.github/agents/orchestrator.agent.md +8 -8
- package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +12 -12
- package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +4 -4
- package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +6 -6
- package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +21 -24
- package/resources/customizations/.github/agents/pytest-unit-test-coding.agent.md +13 -17
- package/resources/customizations/.github/agents/python-atomic-executor.agent.md +11 -11
- package/resources/customizations/.github/agents/python-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/python-execution-only-typed.agent.md +14 -17
- package/resources/customizations/.github/agents/python-orchestrator.agent.md +7 -7
- package/resources/customizations/.github/agents/python-typed-engineer.agent.md +17 -20
- package/resources/customizations/.github/agents/staged-review.agent.md +2 -2
- package/resources/customizations/.github/agents/tdd-green.agent.md +1 -1
- package/resources/customizations/.github/agents/tdd-red.agent.md +3 -3
- package/resources/customizations/.github/agents/tdd-refactor.agent.md +2 -2
- package/resources/customizations/.github/agents/typescript-engineer.agent.md +3 -3
- package/resources/customizations/.github/codex/execute-hard-lock.prompt.md +3 -3
- package/resources/customizations/.github/instructions/general-code-change.instructions.md +1 -1
- package/resources/customizations/.github/instructions/powershell-unit-test.instructions.md +1 -1
- package/resources/customizations/.github/instructions/python-code-change.instructions.md +5 -5
- package/resources/customizations/.github/instructions/python-suppressions.instructions.md +3 -3
- package/resources/customizations/.github/instructions/python-unit-test.instructions.md +1 -1
- package/resources/customizations/.github/prompts/execute-hard-lock.prompt.md +2 -2
- package/resources/customizations/.github/prompts/generate-commit-message-repo.prompt.md +2 -2
- package/resources/customizations/.github/prompts/remediate-comments.prompt.md +2 -2
- package/resources/customizations/.github/prompts/review-feature.prompt.md +1 -1
- package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +8 -12
- package/resources/customizations/.github/skills/execution-environment/SKILL.md +31 -16
- package/resources/customizations/.github/skills/feature-review-workflow/SKILL.md +15 -2
- package/resources/feature-templates/bug/plan.yyyy-MM-ddTHH-mm.md +4 -4
- package/resources/feature-templates/feature/plan.yyyy-MM-ddTHH-mm.md +3 -3
- package/resources/feature-templates/refactor/plan.yyyy-MM-ddTHH-mm.md +2 -2
- package/resources/powershell/PoshQC/PoshQC.ScanConfig.psm1 +3 -1
- package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +14 -12
- package/resources/powershell/PoshQC/PoshQC.psm1 +3 -3
- package/resources/powershell/PoshQC/README.md +8 -8
- package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +2 -2
- package/resources/templates/policy_audit/AGENTS.md +9 -10
- package/resources/templates/policy_audit/policy-audit.yyyy-MM-ddTHH-mm.md +19 -20
package/out/mcp-server.js
CHANGED
|
@@ -9712,7 +9712,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
9712
9712
|
}
|
|
9713
9713
|
return propValues;
|
|
9714
9714
|
});
|
|
9715
|
-
const
|
|
9715
|
+
const isObject18 = isObject;
|
|
9716
9716
|
const catchall = def.catchall;
|
|
9717
9717
|
let value;
|
|
9718
9718
|
const memo2 = globalConfig.memoizer;
|
|
@@ -9720,7 +9720,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
9720
9720
|
inst._zod.parse = (payload, ctx) => {
|
|
9721
9721
|
value ?? (value = _normalized.value);
|
|
9722
9722
|
const input = payload.value;
|
|
9723
|
-
if (!
|
|
9723
|
+
if (!isObject18(input)) {
|
|
9724
9724
|
payload.issues.push({
|
|
9725
9725
|
expected: "object",
|
|
9726
9726
|
code: "invalid_type",
|
|
@@ -9856,7 +9856,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
9856
9856
|
return doc.compile();
|
|
9857
9857
|
};
|
|
9858
9858
|
let fastpass;
|
|
9859
|
-
const
|
|
9859
|
+
const isObject18 = isObject;
|
|
9860
9860
|
const jit = !globalConfig.jitless;
|
|
9861
9861
|
const allowsEval2 = allowsEval;
|
|
9862
9862
|
const fastEnabled = jit && allowsEval2.value;
|
|
@@ -9865,7 +9865,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
9865
9865
|
inst._zod.parse = (payload, ctx) => {
|
|
9866
9866
|
value ?? (value = _normalized.value);
|
|
9867
9867
|
const input = payload.value;
|
|
9868
|
-
if (!
|
|
9868
|
+
if (!isObject18(input)) {
|
|
9869
9869
|
payload.issues.push({
|
|
9870
9870
|
expected: "object",
|
|
9871
9871
|
code: "invalid_type",
|
|
@@ -31060,6 +31060,41 @@ var VALID_BLOCKED_REASONS = /* @__PURE__ */ new Set([
|
|
|
31060
31060
|
...NON_MECHANICAL_BLOCKED_REASONS
|
|
31061
31061
|
]);
|
|
31062
31062
|
|
|
31063
|
+
// ../../extensions/drm-copilot/src/lib/validate/orchestrator-state-concurrent-review.ts
|
|
31064
|
+
var CONCURRENT_REVIEW_MODE = "concurrent";
|
|
31065
|
+
var PASSING_REVIEW_VERDICT = "PASS";
|
|
31066
|
+
var LAST_REVIEW_NOT_PASSED_ERROR = "Checkpoint completion validation failed: review_mode concurrent requires a last review_outcomes entry with verdict PASS.";
|
|
31067
|
+
var LAST_REVIEW_HEAD_MISSING_ERROR = "Checkpoint completion validation failed: review_mode concurrent requires head_sha on the last review_outcomes entry.";
|
|
31068
|
+
var OBJECT_ID_PATTERN = /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/;
|
|
31069
|
+
function asObject2(value) {
|
|
31070
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
31071
|
+
return void 0;
|
|
31072
|
+
}
|
|
31073
|
+
return value;
|
|
31074
|
+
}
|
|
31075
|
+
function lastReviewOutcome(state) {
|
|
31076
|
+
const outcomes = asObject2(state["remediation_loop"])?.["review_outcomes"];
|
|
31077
|
+
if (!Array.isArray(outcomes)) {
|
|
31078
|
+
return void 0;
|
|
31079
|
+
}
|
|
31080
|
+
const entries = outcomes;
|
|
31081
|
+
return asObject2(entries.at(-1));
|
|
31082
|
+
}
|
|
31083
|
+
function validateConcurrentReviewCompletion(state) {
|
|
31084
|
+
if (state["review_mode"] !== CONCURRENT_REVIEW_MODE) {
|
|
31085
|
+
return [];
|
|
31086
|
+
}
|
|
31087
|
+
const last = lastReviewOutcome(state);
|
|
31088
|
+
if (last?.["verdict"] !== PASSING_REVIEW_VERDICT) {
|
|
31089
|
+
return [LAST_REVIEW_NOT_PASSED_ERROR];
|
|
31090
|
+
}
|
|
31091
|
+
const head = last["head_sha"];
|
|
31092
|
+
if (typeof head !== "string" || !OBJECT_ID_PATTERN.test(head)) {
|
|
31093
|
+
return [LAST_REVIEW_HEAD_MISSING_ERROR];
|
|
31094
|
+
}
|
|
31095
|
+
return [];
|
|
31096
|
+
}
|
|
31097
|
+
|
|
31063
31098
|
// ../../extensions/drm-copilot/src/lib/validate/orchestrator-state-promotion-tools.ts
|
|
31064
31099
|
var FEATURE_PROMOTION_ENTRY_TOOL = "new_potential_entry";
|
|
31065
31100
|
var BUG_PROMOTION_ENTRY_TOOL = "new_potential_bug_entry";
|
|
@@ -31795,6 +31830,85 @@ function validateReviewOutcomes(loop) {
|
|
|
31795
31830
|
return errors;
|
|
31796
31831
|
}
|
|
31797
31832
|
|
|
31833
|
+
// ../../extensions/drm-copilot/src/lib/validate/orchestrator-state-light-cycle.ts
|
|
31834
|
+
var REMEDIATION_PATH_KEY = "remediation_path";
|
|
31835
|
+
var LIGHT_REMEDIATION_PATH = "light";
|
|
31836
|
+
var FULL_REMEDIATION_PATH = "full";
|
|
31837
|
+
var LIGHT_FINDING_LIMIT = 3;
|
|
31838
|
+
function isObject12(value) {
|
|
31839
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31840
|
+
}
|
|
31841
|
+
function findingValue(finding, key) {
|
|
31842
|
+
return isObject12(finding) ? finding[key] : void 0;
|
|
31843
|
+
}
|
|
31844
|
+
function openingFindings(openedByReview, outcomes) {
|
|
31845
|
+
const outcome = Array.isArray(outcomes) && typeof openedByReview === "number" ? outcomes[openedByReview] : void 0;
|
|
31846
|
+
const findings = isObject12(outcome) ? outcome["findings"] : void 0;
|
|
31847
|
+
return Array.isArray(findings) ? findings : [];
|
|
31848
|
+
}
|
|
31849
|
+
function lightCycleErrors(index, cycle, prior, outcomes, opensReview) {
|
|
31850
|
+
const prefix = `Checkpoint remediation cycle #${index} remediation_path is light but`;
|
|
31851
|
+
const errors = [];
|
|
31852
|
+
if (Object.prototype.hasOwnProperty.call(cycle, "preflight")) {
|
|
31853
|
+
errors.push(`${prefix} the cycle carries preflight.`);
|
|
31854
|
+
}
|
|
31855
|
+
const hasOpened = Object.prototype.hasOwnProperty.call(
|
|
31856
|
+
cycle,
|
|
31857
|
+
"opened_by_review"
|
|
31858
|
+
);
|
|
31859
|
+
const openedByReview = cycle["opened_by_review"];
|
|
31860
|
+
if (!hasOpened || !opensReview(openedByReview, outcomes)) {
|
|
31861
|
+
errors.push(`${prefix} opened_by_review does not name its opening review.`);
|
|
31862
|
+
} else {
|
|
31863
|
+
const findings = openingFindings(openedByReview, outcomes);
|
|
31864
|
+
if (findings.length > LIGHT_FINDING_LIMIT) {
|
|
31865
|
+
errors.push(
|
|
31866
|
+
`${prefix} its opening review has ${findings.length} findings; the limit is ${LIGHT_FINDING_LIMIT}.`
|
|
31867
|
+
);
|
|
31868
|
+
}
|
|
31869
|
+
findings.forEach((finding, findingIndex) => {
|
|
31870
|
+
if (findingValue(finding, "remediability") !== "autonomous") {
|
|
31871
|
+
errors.push(`${prefix} finding #${findingIndex} is not autonomous.`);
|
|
31872
|
+
}
|
|
31873
|
+
});
|
|
31874
|
+
findings.forEach((finding, findingIndex) => {
|
|
31875
|
+
if (findingValue(finding, "scope") !== "contained") {
|
|
31876
|
+
errors.push(
|
|
31877
|
+
`${prefix} finding #${findingIndex} scope is not contained.`
|
|
31878
|
+
);
|
|
31879
|
+
}
|
|
31880
|
+
});
|
|
31881
|
+
}
|
|
31882
|
+
if (isObject12(prior) && prior[REMEDIATION_PATH_KEY] === LIGHT_REMEDIATION_PATH) {
|
|
31883
|
+
errors.push(`${prefix} the prior cycle is light.`);
|
|
31884
|
+
}
|
|
31885
|
+
return errors;
|
|
31886
|
+
}
|
|
31887
|
+
function validateLightCycles(cycleList, outcomes, opensReview) {
|
|
31888
|
+
const errors = [];
|
|
31889
|
+
const cycles = cycleList ?? [];
|
|
31890
|
+
cycles.forEach((cycle, index) => {
|
|
31891
|
+
if (!isObject12(cycle) || !Object.prototype.hasOwnProperty.call(cycle, REMEDIATION_PATH_KEY)) {
|
|
31892
|
+
return;
|
|
31893
|
+
}
|
|
31894
|
+
const path17 = cycle[REMEDIATION_PATH_KEY];
|
|
31895
|
+
if (path17 === FULL_REMEDIATION_PATH) {
|
|
31896
|
+
return;
|
|
31897
|
+
}
|
|
31898
|
+
if (path17 !== LIGHT_REMEDIATION_PATH) {
|
|
31899
|
+
errors.push(
|
|
31900
|
+
`Checkpoint remediation cycle #${index} remediation_path must be light or full.`
|
|
31901
|
+
);
|
|
31902
|
+
return;
|
|
31903
|
+
}
|
|
31904
|
+
const prior = index > 0 ? cycles[index - 1] : void 0;
|
|
31905
|
+
errors.push(
|
|
31906
|
+
...lightCycleErrors(index, cycle, prior, outcomes, opensReview)
|
|
31907
|
+
);
|
|
31908
|
+
});
|
|
31909
|
+
return errors;
|
|
31910
|
+
}
|
|
31911
|
+
|
|
31798
31912
|
// ../../extensions/drm-copilot/src/lib/validate/orchestrator-state-remediation.ts
|
|
31799
31913
|
var REMEDIATION_LOOP_KEY = "remediation_loop";
|
|
31800
31914
|
var REMEDIATION_CYCLES_KEY = "cycles";
|
|
@@ -31804,7 +31918,7 @@ var COMPLETED_ATTEMPTS_KEY = "completed_attempts";
|
|
|
31804
31918
|
var CANDIDATE_APPLIED_KEY = "candidate_applied";
|
|
31805
31919
|
var OPENED_BY_REVIEW_KEY = "opened_by_review";
|
|
31806
31920
|
var COMPLETED_EXECUTION_STATUS = "complete";
|
|
31807
|
-
function
|
|
31921
|
+
function isObject13(value) {
|
|
31808
31922
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31809
31923
|
}
|
|
31810
31924
|
function isStrictInteger(value) {
|
|
@@ -31822,9 +31936,9 @@ function validateRemediationCycle(index, cycle) {
|
|
|
31822
31936
|
);
|
|
31823
31937
|
}
|
|
31824
31938
|
const executionStatus = cycle["execution_status"];
|
|
31825
|
-
if (typeof executionStatus === "string" && EXECUTION_STATUSES_REQUIRING_CLEAR_PREFLIGHT.has(executionStatus)) {
|
|
31939
|
+
if (cycle[REMEDIATION_PATH_KEY] !== LIGHT_REMEDIATION_PATH && typeof executionStatus === "string" && EXECUTION_STATUSES_REQUIRING_CLEAR_PREFLIGHT.has(executionStatus)) {
|
|
31826
31940
|
const preflight = cycle["preflight"];
|
|
31827
|
-
const preflightStatus =
|
|
31941
|
+
const preflightStatus = isObject13(preflight) ? preflight["final_status"] : void 0;
|
|
31828
31942
|
if (preflightStatus !== PREFLIGHT_CLEARED_STATUS) {
|
|
31829
31943
|
errors.push(
|
|
31830
31944
|
`Checkpoint remediation cycle #${index} execution_status is ${executionStatus} but preflight.final_status is not 'clear'.`
|
|
@@ -31846,14 +31960,14 @@ function opensRemediationReview(openedByReview, outcomes) {
|
|
|
31846
31960
|
return false;
|
|
31847
31961
|
}
|
|
31848
31962
|
const target = outcomes[openedByReview];
|
|
31849
|
-
return
|
|
31963
|
+
return isObject13(target) && target["verdict"] === "REMEDIATION_REQUIRED";
|
|
31850
31964
|
}
|
|
31851
31965
|
function validateRemediationAccounting(loop, cycleList) {
|
|
31852
31966
|
const errors = [];
|
|
31853
31967
|
const outcomes = loop[REVIEW_OUTCOMES_KEY];
|
|
31854
31968
|
let appliedCount = 0;
|
|
31855
31969
|
(cycleList ?? []).forEach((cycle, index) => {
|
|
31856
|
-
if (!
|
|
31970
|
+
if (!isObject13(cycle)) {
|
|
31857
31971
|
return;
|
|
31858
31972
|
}
|
|
31859
31973
|
const prefix = `Checkpoint remediation cycle #${index}`;
|
|
@@ -31888,11 +32002,14 @@ function validateRemediationAccounting(loop, cycleList) {
|
|
|
31888
32002
|
);
|
|
31889
32003
|
}
|
|
31890
32004
|
}
|
|
32005
|
+
errors.push(
|
|
32006
|
+
...validateLightCycles(cycleList, outcomes, opensRemediationReview)
|
|
32007
|
+
);
|
|
31891
32008
|
return errors;
|
|
31892
32009
|
}
|
|
31893
32010
|
function validateRemediationLoop(remediationLoop) {
|
|
31894
32011
|
const errors = [];
|
|
31895
|
-
if (!
|
|
32012
|
+
if (!isObject13(remediationLoop)) {
|
|
31896
32013
|
return errors;
|
|
31897
32014
|
}
|
|
31898
32015
|
const cycles = remediationLoop[REMEDIATION_CYCLES_KEY];
|
|
@@ -31900,7 +32017,7 @@ function validateRemediationLoop(remediationLoop) {
|
|
|
31900
32017
|
if (Array.isArray(cycles)) {
|
|
31901
32018
|
cycleList = cycles;
|
|
31902
32019
|
cycles.forEach((cycle, index) => {
|
|
31903
|
-
if (!
|
|
32020
|
+
if (!isObject13(cycle)) {
|
|
31904
32021
|
errors.push(
|
|
31905
32022
|
`Checkpoint remediation cycle #${index} must be an object.`
|
|
31906
32023
|
);
|
|
@@ -31979,18 +32096,18 @@ var DELEGATING_AGENTS = /* @__PURE__ */ new Set([
|
|
|
31979
32096
|
"prd-feature",
|
|
31980
32097
|
"pr-author"
|
|
31981
32098
|
]);
|
|
31982
|
-
function
|
|
32099
|
+
function isObject14(value) {
|
|
31983
32100
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31984
32101
|
}
|
|
31985
32102
|
function delegatedAgents(state) {
|
|
31986
32103
|
const agents = /* @__PURE__ */ new Set();
|
|
31987
32104
|
let receipts = state["delegation_receipts"];
|
|
31988
|
-
if (
|
|
32105
|
+
if (isObject14(receipts)) {
|
|
31989
32106
|
receipts = receipts["agents"];
|
|
31990
32107
|
}
|
|
31991
32108
|
if (Array.isArray(receipts)) {
|
|
31992
32109
|
for (const receipt of receipts) {
|
|
31993
|
-
if (!
|
|
32110
|
+
if (!isObject14(receipt)) {
|
|
31994
32111
|
continue;
|
|
31995
32112
|
}
|
|
31996
32113
|
const agentName = receipt["agent_name"];
|
|
@@ -32014,7 +32131,7 @@ function validateModelRoutingExistence(state) {
|
|
|
32014
32131
|
const receipts = state["model_routing_receipts"];
|
|
32015
32132
|
if (Array.isArray(receipts)) {
|
|
32016
32133
|
for (const receipt of receipts) {
|
|
32017
|
-
if (!
|
|
32134
|
+
if (!isObject14(receipt)) {
|
|
32018
32135
|
continue;
|
|
32019
32136
|
}
|
|
32020
32137
|
const agent = receipt["agent"];
|
|
@@ -32102,13 +32219,13 @@ function isValidStepStatus(key, value) {
|
|
|
32102
32219
|
}
|
|
32103
32220
|
return STEP_SPECIFIC_EXTRA_STATUS.get(key)?.has(value) === true;
|
|
32104
32221
|
}
|
|
32105
|
-
function
|
|
32222
|
+
function isObject15(value) {
|
|
32106
32223
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
32107
32224
|
}
|
|
32108
32225
|
function validateListDelegationReceipts(receipts) {
|
|
32109
32226
|
const errors = [];
|
|
32110
32227
|
receipts.forEach((receipt, index) => {
|
|
32111
|
-
if (!
|
|
32228
|
+
if (!isObject15(receipt)) {
|
|
32112
32229
|
errors.push(`Checkpoint delegation receipt #${index} must be an object.`);
|
|
32113
32230
|
return;
|
|
32114
32231
|
}
|
|
@@ -32150,7 +32267,7 @@ function validateNamespacedDelegationReceipts(receipts) {
|
|
|
32150
32267
|
if (promotionReceipts === void 0 || promotionReceipts === null) {
|
|
32151
32268
|
return errors;
|
|
32152
32269
|
}
|
|
32153
|
-
if (!
|
|
32270
|
+
if (!isObject15(promotionReceipts)) {
|
|
32154
32271
|
errors.push(
|
|
32155
32272
|
"Checkpoint delegation_receipts.promotion must be an object namespace."
|
|
32156
32273
|
);
|
|
@@ -32185,7 +32302,7 @@ function validateOrchestratorStateText(text2, options = {}) {
|
|
|
32185
32302
|
`Checkpoint is not valid JSON: ${exc instanceof Error ? exc.message : String(exc)}`
|
|
32186
32303
|
];
|
|
32187
32304
|
}
|
|
32188
|
-
if (!
|
|
32305
|
+
if (!isObject15(state)) {
|
|
32189
32306
|
return ["Checkpoint root must be a JSON object."];
|
|
32190
32307
|
}
|
|
32191
32308
|
const stateMap = state;
|
|
@@ -32210,7 +32327,7 @@ function validateOrchestratorStateText(text2, options = {}) {
|
|
|
32210
32327
|
if (receipts !== void 0 && receipts !== null) {
|
|
32211
32328
|
if (Array.isArray(receipts)) {
|
|
32212
32329
|
errors.push(...validateListDelegationReceipts(receipts));
|
|
32213
|
-
} else if (
|
|
32330
|
+
} else if (isObject15(receipts)) {
|
|
32214
32331
|
errors.push(...validateNamespacedDelegationReceipts(receipts));
|
|
32215
32332
|
} else {
|
|
32216
32333
|
errors.push(
|
|
@@ -32251,6 +32368,7 @@ function validateOrchestratorStateText(text2, options = {}) {
|
|
|
32251
32368
|
routingMatrix
|
|
32252
32369
|
})
|
|
32253
32370
|
);
|
|
32371
|
+
errors.push(...validateConcurrentReviewCompletion(stateMap));
|
|
32254
32372
|
}
|
|
32255
32373
|
if (options.requireModelRouting === true) {
|
|
32256
32374
|
errors.push(...validateModelRoutingExistence(stateMap));
|
|
@@ -33479,7 +33597,7 @@ var PROHIBITED_ANY_LEVEL_KEYS = words(
|
|
|
33479
33597
|
"depends_on integration_branch epic_merge_pr"
|
|
33480
33598
|
);
|
|
33481
33599
|
var ROOT_PATH = "<root>";
|
|
33482
|
-
function
|
|
33600
|
+
function isObject16(value) {
|
|
33483
33601
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
33484
33602
|
}
|
|
33485
33603
|
function pythonRepr10(value) {
|
|
@@ -33495,7 +33613,7 @@ function pythonRepr10(value) {
|
|
|
33495
33613
|
if (Array.isArray(value)) {
|
|
33496
33614
|
return `[${value.map(pythonRepr10).join(", ")}]`;
|
|
33497
33615
|
}
|
|
33498
|
-
if (
|
|
33616
|
+
if (isObject16(value)) {
|
|
33499
33617
|
const pairs = Object.entries(value).map(
|
|
33500
33618
|
([key, item]) => `${pythonRepr10(key)}: ${pythonRepr10(item)}`
|
|
33501
33619
|
);
|
|
@@ -33534,7 +33652,7 @@ function itemContext(context, index) {
|
|
|
33534
33652
|
return `${context} items[${index}]`;
|
|
33535
33653
|
}
|
|
33536
33654
|
function validateBlastRadiusBlock(radius, context) {
|
|
33537
|
-
if (!
|
|
33655
|
+
if (!isObject16(radius)) {
|
|
33538
33656
|
return [`${context} blast_radius must be an object.`];
|
|
33539
33657
|
}
|
|
33540
33658
|
const errors = [];
|
|
@@ -33581,7 +33699,7 @@ function validateMergeStatus(record3, context, state) {
|
|
|
33581
33699
|
return [];
|
|
33582
33700
|
}
|
|
33583
33701
|
function validateItemRecord(item, context, requireKind = false) {
|
|
33584
|
-
if (!
|
|
33702
|
+
if (!isObject16(item)) {
|
|
33585
33703
|
return [`${context} must be an object.`];
|
|
33586
33704
|
}
|
|
33587
33705
|
const errors = [];
|
|
@@ -33619,7 +33737,7 @@ function validateItems(items, context, requireKind = false) {
|
|
|
33619
33737
|
errors.push(
|
|
33620
33738
|
...validateItemRecord(entry, itemContext(context, index), requireKind)
|
|
33621
33739
|
);
|
|
33622
|
-
if (!
|
|
33740
|
+
if (!isObject16(entry)) {
|
|
33623
33741
|
return;
|
|
33624
33742
|
}
|
|
33625
33743
|
const issueNum = entry["issue_num"];
|
|
@@ -33638,7 +33756,7 @@ function validateItems(items, context, requireKind = false) {
|
|
|
33638
33756
|
}
|
|
33639
33757
|
function prohibitedKeyErrors(value, path17, context, keys) {
|
|
33640
33758
|
const errors = [];
|
|
33641
|
-
if (
|
|
33759
|
+
if (isObject16(value)) {
|
|
33642
33760
|
for (const [key, child] of Object.entries(value)) {
|
|
33643
33761
|
if (keys.includes(key)) {
|
|
33644
33762
|
errors.push(`${context} carries prohibited key '${key}' at ${path17}.`);
|
|
@@ -33657,7 +33775,7 @@ function prohibitedKeyErrors(value, path17, context, keys) {
|
|
|
33657
33775
|
}
|
|
33658
33776
|
function scanProhibitedKeys(root, context, deepKeys = PROHIBITED_ANY_LEVEL_KEYS, topLevelKeys = []) {
|
|
33659
33777
|
const errors = prohibitedKeyErrors(root, ROOT_PATH, context, deepKeys);
|
|
33660
|
-
if (
|
|
33778
|
+
if (isObject16(root) && topLevelKeys.length > 0) {
|
|
33661
33779
|
for (const key of topLevelKeys) {
|
|
33662
33780
|
if (key in root) {
|
|
33663
33781
|
errors.push(
|
|
@@ -33696,7 +33814,7 @@ function buildReferenceIndex(items) {
|
|
|
33696
33814
|
return { records, byFolderHint };
|
|
33697
33815
|
}
|
|
33698
33816
|
for (const entry of items) {
|
|
33699
|
-
if (!
|
|
33817
|
+
if (!isObject16(entry)) {
|
|
33700
33818
|
continue;
|
|
33701
33819
|
}
|
|
33702
33820
|
const issueNum = entry["issue_num"];
|
|
@@ -33731,7 +33849,7 @@ function cohortIndexByItem(cohorts, recolorGeneration, references) {
|
|
|
33731
33849
|
return assignments;
|
|
33732
33850
|
}
|
|
33733
33851
|
for (const entry of cohorts) {
|
|
33734
|
-
if (!
|
|
33852
|
+
if (!isObject16(entry) || entry["generation"] !== recolorGeneration) {
|
|
33735
33853
|
continue;
|
|
33736
33854
|
}
|
|
33737
33855
|
const cohortIndex = entry["index"];
|
|
@@ -33804,7 +33922,7 @@ function validateCohortBarrierOrdering(state) {
|
|
|
33804
33922
|
);
|
|
33805
33923
|
const errors = [];
|
|
33806
33924
|
for (const entry of edges) {
|
|
33807
|
-
if (!
|
|
33925
|
+
if (!isObject16(entry)) {
|
|
33808
33926
|
continue;
|
|
33809
33927
|
}
|
|
33810
33928
|
const first = resolveReference(entry["a"], references);
|
|
@@ -33909,7 +34027,7 @@ function validateMutations(mutations, issueNums, recolorGeneration, context) {
|
|
|
33909
34027
|
const errors = [];
|
|
33910
34028
|
mutations.forEach((entry, position) => {
|
|
33911
34029
|
const entryContext = `${context} mutations[${position}]`;
|
|
33912
|
-
if (!
|
|
34030
|
+
if (!isObject16(entry)) {
|
|
33913
34031
|
errors.push(`${entryContext} must be an object.`);
|
|
33914
34032
|
return;
|
|
33915
34033
|
}
|
|
@@ -33953,7 +34071,7 @@ function validateDriftEvents(events, issueNums, context) {
|
|
|
33953
34071
|
const errors = [];
|
|
33954
34072
|
events.forEach((entry, position) => {
|
|
33955
34073
|
const entryContext = `${context} drift_events[${position}]`;
|
|
33956
|
-
if (!
|
|
34074
|
+
if (!isObject16(entry)) {
|
|
33957
34075
|
errors.push(`${entryContext} must be an object.`);
|
|
33958
34076
|
return;
|
|
33959
34077
|
}
|
|
@@ -33998,7 +34116,7 @@ function collectItemKeysAndStates(items) {
|
|
|
33998
34116
|
return pairs;
|
|
33999
34117
|
}
|
|
34000
34118
|
for (const entry of items) {
|
|
34001
|
-
if (!
|
|
34119
|
+
if (!isObject16(entry)) {
|
|
34002
34120
|
continue;
|
|
34003
34121
|
}
|
|
34004
34122
|
const issueNum = entry["issue_num"];
|
|
@@ -34058,7 +34176,7 @@ function validateCohortShapes(cohorts, issueNums, recolorGeneration, context) {
|
|
|
34058
34176
|
const bound = generationOk && typeof recolorGeneration === "number" ? recolorGeneration : null;
|
|
34059
34177
|
cohorts.forEach((entry, position) => {
|
|
34060
34178
|
const entryContext = `${context} cohorts[${position}]`;
|
|
34061
|
-
if (!
|
|
34179
|
+
if (!isObject16(entry)) {
|
|
34062
34180
|
errors.push(`${entryContext} must be an object.`);
|
|
34063
34181
|
return;
|
|
34064
34182
|
}
|
|
@@ -34070,7 +34188,7 @@ function currentGenerationCohorts(cohorts, recolorGeneration) {
|
|
|
34070
34188
|
if (!isNonNegativeInteger(recolorGeneration) || !Array.isArray(cohorts)) {
|
|
34071
34189
|
return [];
|
|
34072
34190
|
}
|
|
34073
|
-
return cohorts.filter(
|
|
34191
|
+
return cohorts.filter(isObject16).filter((entry) => entry["generation"] === recolorGeneration);
|
|
34074
34192
|
}
|
|
34075
34193
|
function validateCurrentGenerationCohorts(cohorts, items, recolorGeneration, context) {
|
|
34076
34194
|
const current = currentGenerationCohorts(cohorts, recolorGeneration);
|
|
@@ -34183,7 +34301,7 @@ function validateConflictEdges(edges, issueNums, context) {
|
|
|
34183
34301
|
const duplicates = /* @__PURE__ */ new Map();
|
|
34184
34302
|
edges.forEach((entry, position) => {
|
|
34185
34303
|
const entryContext = `${context} conflict_edges[${position}]`;
|
|
34186
|
-
if (!
|
|
34304
|
+
if (!isObject16(entry)) {
|
|
34187
34305
|
errors.push(`${entryContext} must be an object.`);
|
|
34188
34306
|
return;
|
|
34189
34307
|
}
|
|
@@ -34328,7 +34446,7 @@ function recordsCloseMutation(state) {
|
|
|
34328
34446
|
return false;
|
|
34329
34447
|
}
|
|
34330
34448
|
return mutations.some(
|
|
34331
|
-
(entry) =>
|
|
34449
|
+
(entry) => isObject16(entry) && entry["op"] === "close"
|
|
34332
34450
|
);
|
|
34333
34451
|
}
|
|
34334
34452
|
function validateCompletion2(state) {
|
|
@@ -34336,7 +34454,7 @@ function validateCompletion2(state) {
|
|
|
34336
34454
|
const items = state["items"];
|
|
34337
34455
|
const entries = Array.isArray(items) ? items : [];
|
|
34338
34456
|
entries.forEach((entry, index) => {
|
|
34339
|
-
if (!
|
|
34457
|
+
if (!isObject16(entry)) {
|
|
34340
34458
|
return;
|
|
34341
34459
|
}
|
|
34342
34460
|
if (entry["state"] === "withdrawn") {
|
|
@@ -34364,7 +34482,7 @@ function validateParallelOrchestratorStateText(text2, options = {}) {
|
|
|
34364
34482
|
const detail = error2 instanceof Error ? error2.message : String(error2);
|
|
34365
34483
|
return [`${CONTEXT} is not valid JSON: ${detail}.`];
|
|
34366
34484
|
}
|
|
34367
|
-
if (!
|
|
34485
|
+
if (!isObject16(state)) {
|
|
34368
34486
|
return [`${CONTEXT} root must be a JSON object.`];
|
|
34369
34487
|
}
|
|
34370
34488
|
const errors = [];
|
|
@@ -34469,13 +34587,13 @@ function validateReadyItemRouting(record3, entryContext) {
|
|
|
34469
34587
|
errors.push(enumError(entryContext, "complexity_band", BAND_ORDER2, band));
|
|
34470
34588
|
}
|
|
34471
34589
|
const assessment = record3["complexity_assessment"];
|
|
34472
|
-
if (
|
|
34590
|
+
if (isObject16(assessment)) {
|
|
34473
34591
|
errors.push(...validateAssessment(assessment, band, entryContext));
|
|
34474
34592
|
} else {
|
|
34475
34593
|
errors.push(`${entryContext} complexity_assessment must be an object.`);
|
|
34476
34594
|
}
|
|
34477
34595
|
const receipt = record3["model_routing_receipt"];
|
|
34478
|
-
if (
|
|
34596
|
+
if (isObject16(receipt)) {
|
|
34479
34597
|
errors.push(...validateReceipt4(receipt, band, entryContext));
|
|
34480
34598
|
} else {
|
|
34481
34599
|
errors.push(`${entryContext} model_routing_receipt must be an object.`);
|
|
@@ -34557,7 +34675,7 @@ function itemRecords(items) {
|
|
|
34557
34675
|
}
|
|
34558
34676
|
const records = [];
|
|
34559
34677
|
items.forEach((entry, index) => {
|
|
34560
|
-
if (
|
|
34678
|
+
if (isObject16(entry)) {
|
|
34561
34679
|
records.push({ index, record: entry });
|
|
34562
34680
|
}
|
|
34563
34681
|
});
|
|
@@ -34641,7 +34759,7 @@ function validateReadyItem(record3, entryContext) {
|
|
|
34641
34759
|
}
|
|
34642
34760
|
}
|
|
34643
34761
|
const radius = record3["blast_radius"];
|
|
34644
|
-
const source =
|
|
34762
|
+
const source = isObject16(radius) ? radius["source"] : null;
|
|
34645
34763
|
if (source !== READY_RADIUS_SOURCE) {
|
|
34646
34764
|
errors.push(
|
|
34647
34765
|
`${entryContext} blast_radius.source must be ${pythonRepr10(READY_RADIUS_SOURCE)} for execution readiness; found: ${pythonRepr10(source)}.`
|
|
@@ -34688,7 +34806,7 @@ function validateParallelPlannerStateText(text2, options = {}) {
|
|
|
34688
34806
|
const detail = error2 instanceof Error ? error2.message : String(error2);
|
|
34689
34807
|
return [`${CONTEXT2} is not valid JSON: ${detail}.`];
|
|
34690
34808
|
}
|
|
34691
|
-
if (!
|
|
34809
|
+
if (!isObject16(state)) {
|
|
34692
34810
|
return [`${CONTEXT2} root must be a JSON object.`];
|
|
34693
34811
|
}
|
|
34694
34812
|
const errors = [];
|
|
@@ -42995,7 +43113,7 @@ var DiscoveryOperationError = class extends Error {
|
|
|
42995
43113
|
this.result = result;
|
|
42996
43114
|
}
|
|
42997
43115
|
};
|
|
42998
|
-
function
|
|
43116
|
+
function isObject17(value) {
|
|
42999
43117
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43000
43118
|
}
|
|
43001
43119
|
function isStringArray(value) {
|
|
@@ -43010,23 +43128,23 @@ function malformed(detail, context) {
|
|
|
43010
43128
|
});
|
|
43011
43129
|
}
|
|
43012
43130
|
function validateFinding(value, context) {
|
|
43013
|
-
if (!
|
|
43131
|
+
if (!isObject17(value) || typeof value["code"] !== "string" || !SEVERITIES.includes(String(value["severity"])) || value["artifact_path"] !== null && typeof value["artifact_path"] !== "string" || typeof value["pointer"] !== "string" || !isStringArray(value["related_ids"]) || !isStringArray(value["related_paths"]) || typeof value["message"] !== "string" || typeof value["next_action"] !== "string") {
|
|
43014
43132
|
return malformed("a finding is missing a required field", context);
|
|
43015
43133
|
}
|
|
43016
43134
|
return value;
|
|
43017
43135
|
}
|
|
43018
43136
|
function validateArtifact(value, context) {
|
|
43019
|
-
if (!
|
|
43137
|
+
if (!isObject17(value) || typeof value["path"] !== "string" || typeof value["kind"] !== "string" || !ARTIFACT_STATUSES.includes(String(value["status"])) || typeof value["sha256"] !== "string" || !SHA2566.test(value["sha256"]) || value["content"] !== void 0 && typeof value["content"] !== "string") {
|
|
43020
43138
|
return malformed("an artifact is missing a required field", context);
|
|
43021
43139
|
}
|
|
43022
43140
|
return value;
|
|
43023
43141
|
}
|
|
43024
43142
|
function validateSummary(value, context) {
|
|
43025
|
-
if (!
|
|
43143
|
+
if (!isObject17(value) || typeof value["message"] !== "string" || !Array.isArray(value["counts"]) || value["validation_result"] !== null && typeof value["validation_result"] !== "string" || value["receipt_ref"] !== null && typeof value["receipt_ref"] !== "string" || value["invocation_ref"] !== null && typeof value["invocation_ref"] !== "string") {
|
|
43026
43144
|
return malformed("the summary is missing a required field", context);
|
|
43027
43145
|
}
|
|
43028
43146
|
for (const count of value["counts"]) {
|
|
43029
|
-
if (!
|
|
43147
|
+
if (!isObject17(count) || typeof count["name"] !== "string" || typeof count["value"] !== "number" || !Number.isInteger(count["value"]) || count["value"] < 0) {
|
|
43030
43148
|
return malformed("a summary count is invalid", context);
|
|
43031
43149
|
}
|
|
43032
43150
|
}
|
|
@@ -43036,7 +43154,7 @@ function validateRuntime(value, context) {
|
|
|
43036
43154
|
if (value === null) {
|
|
43037
43155
|
return null;
|
|
43038
43156
|
}
|
|
43039
|
-
if (!
|
|
43157
|
+
if (!isObject17(value) || typeof value["package_version"] !== "string" || typeof value["schema_version"] !== "string" || typeof value["build_sha256"] !== "string" || !SHA2566.test(value["build_sha256"]) || typeof value["policy_version"] !== "number" || typeof value["policy_sha256"] !== "string" || !SHA2566.test(value["policy_sha256"])) {
|
|
43040
43158
|
return malformed("the runtime identity is incomplete", context);
|
|
43041
43159
|
}
|
|
43042
43160
|
if (value["package_version"] !== SUPPORTED_RUNTIME_PACKAGE_VERSION || value["schema_version"] !== SUPPORTED_RUNTIME_SCHEMA_VERSION) {
|
|
@@ -43065,7 +43183,7 @@ function parseDiscoveryResult(stdout, context) {
|
|
|
43065
43183
|
} catch {
|
|
43066
43184
|
return malformed("stdout is not one complete JSON document", context);
|
|
43067
43185
|
}
|
|
43068
|
-
if (!
|
|
43186
|
+
if (!isObject17(parsed)) {
|
|
43069
43187
|
return malformed("the document is not an object", context);
|
|
43070
43188
|
}
|
|
43071
43189
|
if (parsed["result_version"] !== SUPPORTED_RESULT_VERSION) {
|
|
@@ -43093,7 +43211,7 @@ function parseDiscoveryResult(stdout, context) {
|
|
|
43093
43211
|
);
|
|
43094
43212
|
const summary = validateSummary(parsed["summary"], context);
|
|
43095
43213
|
const inputManifest = parsed["input_manifest"];
|
|
43096
|
-
if (inputManifest !== null && !
|
|
43214
|
+
if (inputManifest !== null && !isObject17(inputManifest)) {
|
|
43097
43215
|
return malformed("the input manifest is invalid", context);
|
|
43098
43216
|
}
|
|
43099
43217
|
const runtime = validateRuntime(parsed["runtime"], context);
|
package/package.json
CHANGED
|
@@ -77,9 +77,9 @@ For each task:
|
|
|
77
77
|
|
|
78
78
|
Use the scoped tool patterns for quality gates:
|
|
79
79
|
|
|
80
|
-
- **Python**: `poetry run black`, `poetry run ruff`, `poetry run pyright`, `poetry run pytest`
|
|
80
|
+
- **Python**: `poetry run black`, `poetry run ruff`, `poetry run pyright`, `poetry run pytest -n auto`
|
|
81
81
|
- **TypeScript**: `npx prettier`, `npx eslint`, `npx tsc`, `npx jest`
|
|
82
|
-
- **PowerShell**: MCP server functions (`mcp__drm-copilot__run_poshqc_format`, `mcp__drm-copilot__run_poshqc_analyze`, `mcp__drm-
|
|
82
|
+
- **PowerShell**: MCP server functions (`mcp__drm-copilot__run_poshqc_format`, `mcp__drm-copilot__run_poshqc_analyze`, `mcp__drm-copilot__run_poshqc_analyze_autofix`), and one `Invoke-PoshQCParallelTest` run as the Pester gate through the `sh` launcher route
|
|
83
83
|
- **Git**: `git diff`, `git status`, `git log`
|
|
84
84
|
|
|
85
85
|
Run toolchain in order: format, lint, type-check, test. Restart from step 1 if any step fails or changes files.
|
|
@@ -111,7 +111,7 @@ A run is a preflight run when its delegation prompt carries the directive `DIREC
|
|
|
111
111
|
|
|
112
112
|
## Blocking Protocol
|
|
113
113
|
|
|
114
|
-
Blocking is permitted only during preflight validation (before `[P0-T1]`). This includes a combined preflight-and-execute run of a proportionate remediation cycle: the run first performs single-pass preflight, fixes trivial defects in place, and stops before `[P0-T1]` only when a substantive defect remains. When preflight-blocked:
|
|
114
|
+
Blocking is permitted only during preflight validation (before `[P0-T1]`). This includes a combined preflight-and-execute run of a proportionate remediation cycle: the run first performs single-pass preflight, fixes trivial defects in place, and stops before `[P0-T1]` only when a substantive defect remains. A light remediation run has no preflight, and stops the same way before `[P0-T1]` only when a fix task cannot be done at its named location. When preflight-blocked:
|
|
115
115
|
|
|
116
116
|
1. State: `BLOCKED at preflight (before [P0-T1])`.
|
|
117
117
|
2. Provide a short, concrete explanation of why.
|
|
@@ -46,7 +46,7 @@ Generate plans using the atomic plan contract defined in the `atomic-plan-contra
|
|
|
46
46
|
- Phase headings: `### Phase N — <Title>`
|
|
47
47
|
- Task IDs: `- [ ] [P#-T#] <description>`
|
|
48
48
|
- Sequential task numbering within each phase
|
|
49
|
-
- Phase 0: baseline capture (repo-policy reading tasks + language-specific
|
|
49
|
+
- Phase 0: baseline capture (repo-policy reading tasks + language-specific static tool baselines; no test suite runs)
|
|
50
50
|
- Final phase: full QA loop for each applicable language, ending with the self-review task that writes `<FEATURE>/evidence/qa-gates/self-review.<timestamp>.md`
|
|
51
51
|
|
|
52
52
|
Every plan is design-level per `## Design-Level Plan Contract (Mandatory)` in the `atomic-plan-contract` skill: tasks name files, symbols, behavior, tests, and acceptance; anchors are symbols, headings, or test names, never line numbers or commit SHAs; literals appear only where they are the asserted value; tool routes and launchers are not restated because the `execution-environment` skill owns them; and a plan above 40 tasks or 400 lines carries a `## Size Justification` section. Every plan carries a `## Pre-Mortem` section with one bullet for each of `Review checklists`, `Coverage`, `Mirror parity`, `File size`, `Test isolation`, `CI-only behavior`, and `Evidence`; the planner SubagentStop hook blocks a plan without it.
|
|
@@ -55,7 +55,7 @@ Every plan is design-level per `## Design-Level Plan Contract (Mandatory)` in th
|
|
|
55
55
|
|
|
56
56
|
1. Every task must be atomic: one binary outcome, one verifiable acceptance criterion.
|
|
57
57
|
2. Every task must include explicit file paths.
|
|
58
|
-
3. Include explicit
|
|
58
|
+
3. Include explicit static baseline tasks and final-QA coverage tasks for each language where policy requires coverage, with per-file coverage read from the single gate run.
|
|
59
59
|
4. Do not add bucket tasks (e.g., "Refactor module" or "Write tests") that cannot be completed as a single binary outcome.
|
|
60
60
|
5. Do not execute implementation; produce the plan only.
|
|
61
61
|
|