@gobing-ai/spur 0.3.41 → 0.3.42
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/.claude-plugin/marketplace.json +15 -0
- package/README.md +15 -1
- package/config/templates/AGENTS.md +5 -3
- package/config/workflows/task-pipeline.yaml +103 -12
- package/package.json +15 -12
- package/plugins/README.md +655 -0
- package/plugins/sp/README.md +621 -0
- package/plugins/sp/agents/expert-spur.md +109 -0
- package/plugins/sp/agents/super-coder.md +126 -0
- package/plugins/sp/agents/super-planner.md +283 -0
- package/plugins/sp/agents/super-reviewer.md +154 -0
- package/plugins/sp/commands/dev-arch.md +30 -0
- package/plugins/sp/commands/dev-brainstorm.md +40 -0
- package/plugins/sp/commands/dev-changelog.md +28 -0
- package/plugins/sp/commands/dev-daily.md +29 -0
- package/plugins/sp/commands/dev-debug.md +29 -0
- package/plugins/sp/commands/dev-dogfood.md +33 -0
- package/plugins/sp/commands/dev-featurechange.md +130 -0
- package/plugins/sp/commands/dev-find-conflict.md +51 -0
- package/plugins/sp/commands/dev-find-issue.md +76 -0
- package/plugins/sp/commands/dev-find-next.md +60 -0
- package/plugins/sp/commands/dev-fixall.md +33 -0
- package/plugins/sp/commands/dev-gitmsg.md +28 -0
- package/plugins/sp/commands/dev-gtd.md +97 -0
- package/plugins/sp/commands/dev-handover.md +26 -0
- package/plugins/sp/commands/dev-idea.md +50 -0
- package/plugins/sp/commands/dev-next.md +31 -0
- package/plugins/sp/commands/dev-parallel.md +30 -0
- package/plugins/sp/commands/dev-plan.md +46 -0
- package/plugins/sp/commands/dev-refine.md +48 -0
- package/plugins/sp/commands/dev-refineall.md +65 -0
- package/plugins/sp/commands/dev-refresh.md +32 -0
- package/plugins/sp/commands/dev-reverse.md +32 -0
- package/plugins/sp/commands/dev-review.md +31 -0
- package/plugins/sp/commands/dev-run.md +63 -0
- package/plugins/sp/commands/dev-runall.md +80 -0
- package/plugins/sp/commands/dev-simplify.md +39 -0
- package/plugins/sp/commands/dev-unit.md +29 -0
- package/plugins/sp/commands/dev-verify.md +48 -0
- package/plugins/sp/commands/dev-verifyall.md +72 -0
- package/plugins/sp/commands/dev-wrap.md +30 -0
- package/plugins/sp/commands/dev-wrapall.md +33 -0
- package/plugins/sp/commands/rule-add.md +18 -0
- package/plugins/sp/commands/rule-refine.md +18 -0
- package/plugins/sp/commands/rule-scan.md +18 -0
- package/plugins/sp/commands/spur-init.md +22 -0
- package/plugins/sp/commands/workflow-add.md +18 -0
- package/plugins/sp/commands/workflow-refine.md +18 -0
- package/plugins/sp/hooks/agent-hint.ts +60 -0
- package/plugins/sp/hooks/careful-guard.ts +147 -0
- package/plugins/sp/hooks/context-post-tool.ts +325 -0
- package/plugins/sp/hooks/context-session-start.ts +182 -0
- package/plugins/sp/hooks/context-session-stop.ts +95 -0
- package/plugins/sp/hooks/hooks.json +51 -0
- package/plugins/sp/hooks/pi/guard-extension.ts +341 -0
- package/plugins/sp/hooks/task-write-guard.ts +84 -0
- package/plugins/sp/plugin.json +8 -0
- package/plugins/sp/scripts/batch-preflight.ts +204 -0
- package/plugins/sp/scripts/daily-summary/daily-summary.ts +606 -0
- package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +363 -0
- package/plugins/sp/scripts/dogfood-testing/validate-report.ts +168 -0
- package/plugins/sp/scripts/feature-sync-bounded.ts +451 -0
- package/plugins/sp/scripts/stage-registry-adapter.ts +1341 -0
- package/plugins/sp/scripts/task-size-precheck.ts +202 -0
- package/plugins/sp/scripts/validate-commands.ts +651 -0
- package/plugins/sp/scripts/validate-flag-contracts.ts +875 -0
- package/plugins/sp/skills/brainstorm/SKILL.md +361 -0
- package/plugins/sp/skills/brainstorm/agents/openai.yaml +14 -0
- package/plugins/sp/skills/brainstorm/examples/ideation-example.md +209 -0
- package/plugins/sp/skills/brainstorm/metadata.openclaw +7 -0
- package/plugins/sp/skills/brainstorm/references/grilling-interview.md +68 -0
- package/plugins/sp/skills/brainstorm/references/workflows.md +255 -0
- package/plugins/sp/skills/branch-workflow/SKILL.md +109 -0
- package/plugins/sp/skills/branch-workflow/references/branch-lifecycle.md +69 -0
- package/plugins/sp/skills/branch-workflow/references/worktree-patterns.md +100 -0
- package/plugins/sp/skills/code-implementation/SKILL.md +176 -0
- package/plugins/sp/skills/code-implementation/references/debugging.md +64 -0
- package/plugins/sp/skills/code-implementation/references/implementation-patterns.md +113 -0
- package/plugins/sp/skills/code-improvement/SKILL.md +231 -0
- package/plugins/sp/skills/code-improvement/references/deepening-signals.md +205 -0
- package/plugins/sp/skills/code-review/SKILL.md +112 -0
- package/plugins/sp/skills/code-review/references/receiving-code-review.md +70 -0
- package/plugins/sp/skills/code-review/references/review-lenses.md +117 -0
- package/plugins/sp/skills/code-review/references/self-review-checklist.md +53 -0
- package/plugins/sp/skills/code-review/references/verification-before-completion.md +68 -0
- package/plugins/sp/skills/code-simplification/SKILL.md +225 -0
- package/plugins/sp/skills/code-testing/SKILL.md +108 -0
- package/plugins/sp/skills/code-testing/references/stacks/bun-ts.md +165 -0
- package/plugins/sp/skills/code-testing/references/stacks/go.md +88 -0
- package/plugins/sp/skills/code-testing/references/stacks/python.md +117 -0
- package/plugins/sp/skills/code-testing/references/test-loop-breaker.md +37 -0
- package/plugins/sp/skills/code-testing/references/test-output-discipline.md +52 -0
- package/plugins/sp/skills/code-testing/references/unit-testing.md +212 -0
- package/plugins/sp/skills/code-verification/SKILL.md +535 -0
- package/plugins/sp/skills/code-verification/references/code-improvement.md +39 -0
- package/plugins/sp/skills/code-verification/references/secu-review.md +94 -0
- package/plugins/sp/skills/code-verification/references/verdict-schema.md +141 -0
- package/plugins/sp/skills/conflict-finding/SKILL.md +254 -0
- package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +258 -0
- package/plugins/sp/skills/conflict-finding/references/comparison-protocol.md +277 -0
- package/plugins/sp/skills/conflict-finding/references/finding-contract.md +346 -0
- package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +276 -0
- package/plugins/sp/skills/daily-summary/SKILL.md +171 -0
- package/plugins/sp/skills/daily-summary/agents/openai.yaml +13 -0
- package/plugins/sp/skills/doc-evolve/SKILL.md +175 -0
- package/plugins/sp/skills/doc-evolve/references/operations.md +93 -0
- package/plugins/sp/skills/dogfood-testing/SKILL.md +608 -0
- package/plugins/sp/skills/dogfood-testing/references/monitor-ledger.md +211 -0
- package/plugins/sp/skills/dogfood-testing/references/report-template.md +351 -0
- package/plugins/sp/skills/doubt-driven-development/SKILL.md +136 -0
- package/plugins/sp/skills/functional-review/SKILL.md +364 -0
- package/plugins/sp/skills/functional-review/references/verdict-schema.md +133 -0
- package/plugins/sp/skills/indexed-context/SKILL.md +164 -0
- package/plugins/sp/skills/issue-finding/SKILL.md +424 -0
- package/plugins/sp/skills/issue-finding/agents/openai.yaml +15 -0
- package/plugins/sp/skills/issue-finding/examples/expected-findings.json +27 -0
- package/plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl +23 -0
- package/plugins/sp/skills/issue-finding/references/session-formats.md +121 -0
- package/plugins/sp/skills/next-feature/SKILL.md +125 -0
- package/plugins/sp/skills/next-feature/references/handoff-routing.md +92 -0
- package/plugins/sp/skills/next-feature/references/proposal-contract.md +49 -0
- package/plugins/sp/skills/next-feature/references/ranking-rubric.md +52 -0
- package/plugins/sp/skills/next-feature/references/signal-derivation.md +67 -0
- package/plugins/sp/skills/next-router/SKILL.md +181 -0
- package/plugins/sp/skills/next-router/references/messages.md +90 -0
- package/plugins/sp/skills/next-router/references/routing-table.md +216 -0
- package/plugins/sp/skills/parallel-execution/SKILL.md +148 -0
- package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +100 -0
- package/plugins/sp/skills/parallel-execution/references/fan-out-patterns.md +101 -0
- package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +94 -0
- package/plugins/sp/skills/reverse-engineering/SKILL.md +375 -0
- package/plugins/sp/skills/reverse-engineering/agents/openai.yaml +18 -0
- package/plugins/sp/skills/source-driven-development/SKILL.md +124 -0
- package/plugins/sp/skills/spec-decomposition/SKILL.md +117 -0
- package/plugins/sp/skills/spec-decomposition/references/decomposition.md +539 -0
- package/plugins/sp/skills/spur-cli/SKILL.md +133 -0
- package/plugins/sp/skills/spur-cli/references/agent.md +179 -0
- package/plugins/sp/skills/spur-cli/references/features/acceptance-criteria.md +82 -0
- package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +177 -0
- package/plugins/sp/skills/spur-cli/references/features/roadmap-priority.md +84 -0
- package/plugins/sp/skills/spur-cli/references/features/verbs.md +122 -0
- package/plugins/sp/skills/spur-cli/references/features.md +234 -0
- package/plugins/sp/skills/spur-cli/references/init.md +119 -0
- package/plugins/sp/skills/spur-cli/references/message.md +98 -0
- package/plugins/sp/skills/spur-cli/references/rules/authoring-rules.md +212 -0
- package/plugins/sp/skills/spur-cli/references/rules/fine-tuning.md +148 -0
- package/plugins/sp/skills/spur-cli/references/rules/operations.md +228 -0
- package/plugins/sp/skills/spur-cli/references/rules/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/rules.md +209 -0
- package/plugins/sp/skills/spur-cli/references/serve.md +58 -0
- package/plugins/sp/skills/spur-cli/references/tasks/l3-guard-cheatsheet.md +98 -0
- package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +95 -0
- package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +361 -0
- package/plugins/sp/skills/spur-cli/references/tasks.md +278 -0
- package/plugins/sp/skills/spur-cli/references/team.md +133 -0
- package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +226 -0
- package/plugins/sp/skills/spur-cli/references/workflows/operations.md +211 -0
- package/plugins/sp/skills/spur-cli/references/workflows/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/workflows.md +355 -0
- package/plugins/sp/skills/spur-dev/SKILL.md +224 -0
- package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +196 -0
- package/plugins/sp/skills/spur-dev/references/cross-cutting.md +664 -0
- package/plugins/sp/skills/spur-dev/references/decision-brief.md +80 -0
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +546 -0
- package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +164 -0
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +727 -0
- package/plugins/sp/skills/spur-dev/references/execution-workflow.md +350 -0
- package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +191 -0
- package/plugins/sp/skills/spur-dev/references/flag-glossary.md +417 -0
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +171 -0
- package/plugins/sp/skills/spur-dev/references/glossary.md +95 -0
- package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +80 -0
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +88 -0
- package/plugins/sp/skills/spur-dev/references/planning-workflow.md +302 -0
- package/plugins/sp/skills/spur-dev/references/product-planning.md +206 -0
- package/plugins/sp/skills/spur-dev/references/section-batching.md +24 -0
- package/plugins/sp/skills/sys-architecture/SKILL.md +155 -0
- package/plugins/sp/skills/sys-architecture/references/decision-method.md +137 -0
- package/plugins/sp/skills/sys-architecture/references/upkeep-survey.md +75 -0
- package/plugins/sp/skills/sys-debugging/SKILL.md +228 -0
- package/plugins/sp/skills/sys-debugging/references/debugging-protocol.md +62 -0
- package/plugins/sp/skills/test-driven-development/SKILL.md +248 -0
- package/plugins/sp/skills/wayfinder/SKILL.md +292 -0
- package/spur.js +6093 -5180
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* task-size-precheck — pipeline size precheck guard (R2, task 0454) plus the
|
|
4
|
+
* size-vs-executor-capability gate (R3, task 0487).
|
|
5
|
+
*
|
|
6
|
+
* Shells `spur task show <wbs> --json`, evaluates R-item count and Plan
|
|
7
|
+
* checklist count against limits, writes PASS/FAIL to status file. With
|
|
8
|
+
* `--executor`, also shells `spur agent doctor <exec> --json` and blocks a large
|
|
9
|
+
* task routed to a sub-`capable-1` executor.
|
|
10
|
+
*
|
|
11
|
+
* Always exits 0 (soft check, like doctor). The precheck→implement guard in
|
|
12
|
+
* task-pipeline.yaml reads the status file.
|
|
13
|
+
*
|
|
14
|
+
* Ships with the plugin to arbitrary projects, so it stays node-builtin-only —
|
|
15
|
+
* no workspace imports. The capability tier therefore comes from the CLI rather
|
|
16
|
+
* than from `getExecutorTier` directly; `spur agent doctor --json` exposes it as
|
|
17
|
+
* `capabilityTier` precisely so the inference regex is not duplicated here.
|
|
18
|
+
*
|
|
19
|
+
* Usage:
|
|
20
|
+
* bun plugins/sp/scripts/task-size-precheck.ts <wbs> [--spur-bin <path>]
|
|
21
|
+
* [--max-reqs <n>] [--max-plan-items <n>] [--executor <name>]
|
|
22
|
+
*
|
|
23
|
+
* Env: SPUR_BIN, MAX_IMPLEMENT_REQS, MAX_IMPLEMENT_PLAN_ITEMS
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { execFileSync } from 'node:child_process';
|
|
27
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
28
|
+
import { join } from 'node:path';
|
|
29
|
+
|
|
30
|
+
// ─── Regex (sync with packages/app/src/services/task-size-precheck.ts) ───────
|
|
31
|
+
|
|
32
|
+
/** Matches `- [ ] **R1.**` or `- [x] R1.` etc. Requires period after digits. */
|
|
33
|
+
const R_ITEM_RE = /^\s*-\s*\[[ xX]\]\s*(\*\*)?R\d+\./m;
|
|
34
|
+
|
|
35
|
+
/** Matches checklist items under the Plan section. */
|
|
36
|
+
const CHECKLIST_ITEM_RE = /^\s*-\s*\[[ xX]\]/m;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Large-task thresholds for the capability gate (R3, task 0487) — the DEFAULT
|
|
40
|
+
* caps, not the overridable `--max-*` limits. Raising the caps says "I accept a
|
|
41
|
+
* big task"; it does not make a flash-tier model able to finish one inside
|
|
42
|
+
* `implementTimeoutMs`.
|
|
43
|
+
*/
|
|
44
|
+
const LARGE_TASK_REQS = 5;
|
|
45
|
+
const LARGE_TASK_PLAN_ITEMS = 8;
|
|
46
|
+
|
|
47
|
+
/** Capability tiers strong enough for a large task. Anything else blocks. */
|
|
48
|
+
const CAPABLE_TIERS = new Set(['capable-1', 'capable-2', 'capable-3']);
|
|
49
|
+
|
|
50
|
+
// ─── CLI ─────────────────────────────────────────────────────────────────────
|
|
51
|
+
|
|
52
|
+
function usage(): never {
|
|
53
|
+
console.error(
|
|
54
|
+
'Usage: bun plugins/sp/scripts/task-size-precheck.ts <wbs> [--spur-bin <path>] [--max-reqs <n>] [--max-plan-items <n>] [--executor <name>]',
|
|
55
|
+
);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function parseArgs(argv: string[]): {
|
|
60
|
+
wbs: string;
|
|
61
|
+
spurBin: string;
|
|
62
|
+
maxReqs: number;
|
|
63
|
+
maxPlanItems: number;
|
|
64
|
+
executor: string;
|
|
65
|
+
} {
|
|
66
|
+
let spurBin = process.env.SPUR_BIN ?? 'spur';
|
|
67
|
+
let wbs = '';
|
|
68
|
+
let maxReqs = Number(process.env.MAX_IMPLEMENT_REQS) || 5;
|
|
69
|
+
let maxPlanItems = Number(process.env.MAX_IMPLEMENT_PLAN_ITEMS) || 8;
|
|
70
|
+
let executor = '';
|
|
71
|
+
|
|
72
|
+
let i = 0;
|
|
73
|
+
while (i < argv.length) {
|
|
74
|
+
const arg = argv[i];
|
|
75
|
+
if (arg === '--spur-bin') {
|
|
76
|
+
spurBin = argv[i + 1] ?? 'spur';
|
|
77
|
+
i += 2;
|
|
78
|
+
} else if (arg === '--max-reqs') {
|
|
79
|
+
maxReqs = Number(argv[i + 1]) || 5;
|
|
80
|
+
i += 2;
|
|
81
|
+
} else if (arg === '--max-plan-items') {
|
|
82
|
+
maxPlanItems = Number(argv[i + 1]) || 8;
|
|
83
|
+
i += 2;
|
|
84
|
+
} else if (arg === '--executor') {
|
|
85
|
+
executor = argv[i + 1] ?? '';
|
|
86
|
+
i += 2;
|
|
87
|
+
} else if (!arg.startsWith('--')) {
|
|
88
|
+
wbs = arg;
|
|
89
|
+
i++;
|
|
90
|
+
} else {
|
|
91
|
+
i++;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!wbs) usage();
|
|
96
|
+
return { wbs, spurBin, maxReqs, maxPlanItems, executor };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Split a multi-token `spurBin` (`<runtime> <mainModule>`) the same way
|
|
101
|
+
* `runSpurJson` does in feature-sync-bounded.ts — execFileSync's first arg is
|
|
102
|
+
* one executable path, not a shell command line.
|
|
103
|
+
*/
|
|
104
|
+
function runSpur(spurBin: string, args: string[]): string {
|
|
105
|
+
const [file = 'spur', ...lead] = spurBin.split(/\s+/).filter(Boolean);
|
|
106
|
+
return execFileSync(file, [...lead, ...args], {
|
|
107
|
+
encoding: 'utf-8',
|
|
108
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Capability tier of `executor` per `spur agent doctor <exec> --json`.
|
|
114
|
+
* Unknown executor, unreadable doctor output, or an undeclared-and-uninferrable
|
|
115
|
+
* tier all read as `standard` — conservative: a false block is one flag away,
|
|
116
|
+
* a false pass costs a 30-minute timed-out implement.
|
|
117
|
+
*/
|
|
118
|
+
function resolveCapabilityTier(spurBin: string, executor: string): string {
|
|
119
|
+
try {
|
|
120
|
+
const out = runSpur(spurBin, ['agent', 'doctor', executor, '--json']);
|
|
121
|
+
const tier = JSON.parse(out)?.agents?.[0]?.capabilityTier;
|
|
122
|
+
return typeof tier === 'string' && tier ? tier : 'standard';
|
|
123
|
+
} catch {
|
|
124
|
+
return 'standard';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function main(): void {
|
|
129
|
+
const { wbs, spurBin, maxReqs, maxPlanItems, executor } = parseArgs(process.argv.slice(2));
|
|
130
|
+
|
|
131
|
+
// Fetch task content via spur
|
|
132
|
+
let taskContent: string;
|
|
133
|
+
try {
|
|
134
|
+
const result = runSpur(spurBin, ['task', 'show', wbs, '--json']);
|
|
135
|
+
const task = JSON.parse(result);
|
|
136
|
+
taskContent = task.content ?? task.body ?? '';
|
|
137
|
+
} catch {
|
|
138
|
+
// If spur fails, write FAIL and exit 0 (soft, like doctor)
|
|
139
|
+
const statusDir = join(process.cwd(), '.spur', 'run');
|
|
140
|
+
if (!existsSync(statusDir)) mkdirSync(statusDir, { recursive: true });
|
|
141
|
+
writeFileSync(join(statusDir, `${wbs}-precheck-size.status`), 'FAIL\n');
|
|
142
|
+
console.error(`task-size-precheck: FAIL — could not fetch task ${wbs} via ${spurBin}`);
|
|
143
|
+
process.exit(0);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const reqCount = taskContent.match(new RegExp(R_ITEM_RE.source, 'gm'))?.length ?? 0;
|
|
147
|
+
|
|
148
|
+
const planMatch = taskContent.match(/^#{2,3}\s+Plan\s*$/m);
|
|
149
|
+
const planBody = planMatch
|
|
150
|
+
? (() => {
|
|
151
|
+
const rest = taskContent.slice((planMatch.index ?? 0) + planMatch[0].length);
|
|
152
|
+
const nextSection = rest.match(/^#{2,3}\s+/m);
|
|
153
|
+
return nextSection ? rest.slice(0, nextSection.index ?? 0) : rest;
|
|
154
|
+
})()
|
|
155
|
+
: '';
|
|
156
|
+
const planItemCount = planBody.match(new RegExp(CHECKLIST_ITEM_RE.source, 'gm'))?.length ?? 0;
|
|
157
|
+
|
|
158
|
+
const reasons: string[] = [];
|
|
159
|
+
// R3 (0487): a large task on a sub-capable executor blocks even when the caller
|
|
160
|
+
// raised the caps — the caps are an acceptance of size, not a capability grant.
|
|
161
|
+
if (executor && (reqCount > LARGE_TASK_REQS || planItemCount > LARGE_TASK_PLAN_ITEMS)) {
|
|
162
|
+
const tier = resolveCapabilityTier(spurBin, executor);
|
|
163
|
+
if (!CAPABLE_TIERS.has(tier)) {
|
|
164
|
+
reasons.push(
|
|
165
|
+
`Task size (${reqCount} R-items / ${planItemCount} Plan items) requires a capable executor, ` +
|
|
166
|
+
`but ${executor} is tier ${tier}. ` +
|
|
167
|
+
`Pass \`--agent <capable>\` or \`--vars '{"implementAgent":"<capable>"}'\`, or split the task.`,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (reqCount > maxReqs) {
|
|
172
|
+
reasons.push(
|
|
173
|
+
`Task has ${reqCount} R-items (max ${maxReqs}). ` +
|
|
174
|
+
`Consider decomposing or raise maxImplementReqs via --vars.`,
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
if (planItemCount > maxPlanItems) {
|
|
178
|
+
reasons.push(
|
|
179
|
+
`Task has ${planItemCount} Plan items (max ${maxPlanItems}). ` +
|
|
180
|
+
`Consider simplifying the plan or raise maxImplementPlanItems via --vars.`,
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const ok = reasons.length === 0;
|
|
185
|
+
const status = ok ? 'PASS' : 'FAIL';
|
|
186
|
+
|
|
187
|
+
const statusDir = join(process.cwd(), '.spur', 'run');
|
|
188
|
+
if (!existsSync(statusDir)) mkdirSync(statusDir, { recursive: true });
|
|
189
|
+
writeFileSync(join(statusDir, `${wbs}-precheck-size.status`), `${status}\n`);
|
|
190
|
+
|
|
191
|
+
const msg = `task-size-precheck: ${status} — ${reqCount} R-items, ${planItemCount} Plan items`;
|
|
192
|
+
console.error(msg);
|
|
193
|
+
if (!ok) {
|
|
194
|
+
for (const r of reasons) {
|
|
195
|
+
console.error(` ${r}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
process.exit(0);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
main();
|