@gobing-ai/spur 0.4.8 → 0.4.10
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 +1 -1
- package/config/pipeline-budgets.json +2 -2
- package/config/rules/README.md +1 -1
- package/config/rules/boundary/config-loading-ownership.yaml +1 -0
- package/config/rules/boundary/env-var-hygiene.yaml +0 -1
- package/config/rules/boundary/sp-plugin-standalone.yaml +1 -1
- package/config/rules/boundary/sp-script-placement.yaml +3 -3
- package/config/rules/docs/sourced-api-claims.yaml +29 -64
- package/config/rules/strict/runtime-boundaries.yaml +40 -1
- package/config/rules/structure/protected-files.yaml +1 -1
- package/config/rules/surface/check-cli-surface.yaml +33 -0
- package/config/rules/typescript/no-debugger.yaml +3 -0
- package/config/workflow-candidates.json +2 -2
- package/config/workflows/feature-verification.yaml +6 -19
- package/config/workflows/history-anatomy.yaml +14 -28
- package/config/workflows/idea-pipeline.yaml +6 -19
- package/config/workflows/pr-review.yaml +9 -16
- package/config/workflows/task-pipeline.yaml +18 -25
- package/config/workflows/wrapup-pipeline.yaml +21 -63
- package/package.json +3 -3
- package/plugins/sp/README.md +70 -37
- package/plugins/sp/agents/expert-spur.md +0 -1
- package/plugins/sp/agents/super-planner.md +5 -5
- package/plugins/sp/agents/super-reviewer.md +2 -2
- package/plugins/sp/commands/dev-changelog.md +1 -1
- package/plugins/sp/commands/dev-daily.md +1 -1
- package/plugins/sp/commands/dev-pr-review.md +1 -1
- package/plugins/sp/commands/dev-review-session.md +1 -1
- package/plugins/sp/commands/dev-runall.md +4 -4
- package/plugins/sp/commands/dev-verify.md +4 -6
- package/plugins/sp/commands/dev-verifyall.md +4 -5
- package/plugins/sp/hooks/hooks.json +11 -1
- package/plugins/sp/lib/context-post-tool.ts +1 -1
- package/plugins/sp/lib/context-session-start.ts +1 -1
- package/plugins/sp/lib/context-session-stop.ts +1 -1
- package/plugins/sp/lib/destructive-policy.ts +65 -1
- package/plugins/sp/plugin.json +2 -5
- package/plugins/sp/{hooks → scripts/hooks}/agent-lifecycle.ts +1 -1
- package/plugins/sp/scripts/hooks/careful-guard.ts +94 -0
- package/plugins/sp/{hooks → scripts/hooks}/context-post-tool.ts +2 -2
- package/plugins/sp/{hooks → scripts/hooks}/context-session-start.ts +1 -1
- package/plugins/sp/{hooks → scripts/hooks}/context-session-stop.ts +1 -1
- package/plugins/sp/{hooks → scripts/hooks}/fleet-guest-stop.ts +6 -4
- package/plugins/sp/{hooks → scripts/hooks}/task-write-guard.ts +38 -21
- package/plugins/sp/skills/brainstorm/SKILL.md +12 -11
- package/plugins/sp/skills/brainstorm/agents/openai.yaml +1 -1
- package/plugins/sp/skills/brainstorm/examples/ideation-example.md +0 -4
- package/plugins/sp/skills/brainstorm/metadata.openclaw +1 -1
- package/plugins/sp/skills/brainstorm/references/workflows.md +4 -14
- package/plugins/sp/skills/code-implementation/SKILL.md +1 -1
- package/plugins/sp/skills/code-verification/SKILL.md +8 -8
- package/plugins/sp/skills/code-verification/references/secu-review.md +4 -4
- package/plugins/sp/skills/code-verification/references/verdict-schema.md +9 -1
- package/plugins/sp/skills/daily-summary/SKILL.md +4 -5
- package/plugins/sp/skills/dogfood-testing/SKILL.md +9 -9
- package/plugins/sp/skills/dogfood-testing/references/report-template.md +1 -1
- package/plugins/sp/skills/history-anatomy/references/modes.md +2 -2
- package/plugins/sp/skills/history-anatomy/references/operations.md +3 -4
- package/plugins/sp/skills/history-anatomy/references/report-contract.md +2 -3
- package/plugins/sp/skills/issue-finding/SKILL.md +1 -1
- package/plugins/sp/skills/next-router/references/routing-table.md +1 -1
- package/plugins/sp/skills/parallel-execution/SKILL.md +2 -2
- package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +9 -10
- package/plugins/sp/skills/pr-reviewing/SKILL.md +14 -15
- package/plugins/sp/skills/reverse-engineering/SKILL.md +4 -6
- package/plugins/sp/skills/session-review/SKILL.md +13 -29
- package/plugins/sp/skills/source-driven-development/SKILL.md +26 -27
- package/plugins/sp/skills/spur-check/SKILL.md +14 -13
- package/plugins/sp/skills/spur-cli/SKILL.md +1 -1
- package/plugins/sp/skills/spur-cli/references/agent.md +17 -2
- package/plugins/sp/skills/spur-cli/references/builder.md +27 -6
- package/plugins/sp/skills/spur-cli/references/features.md +6 -1
- package/plugins/sp/skills/spur-cli/references/history.md +3 -0
- package/plugins/sp/skills/spur-cli/references/self.md +5 -3
- package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +3 -0
- package/plugins/sp/skills/spur-cli/references/tasks.md +13 -3
- package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +1 -1
- package/plugins/sp/skills/spur-cli/references/workflows.md +36 -1
- package/plugins/sp/skills/spur-dev/SKILL.md +1 -1
- package/plugins/sp/skills/spur-dev/references/cross-cutting.md +1 -1
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +12 -13
- package/plugins/sp/skills/spur-dev/references/execution-batch-report.md +10 -11
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +16 -17
- package/plugins/sp/skills/spur-dev/references/execution-parallel-isolation.md +1 -1
- package/plugins/sp/skills/spur-dev/references/execution-worktree-landing.md +9 -12
- package/plugins/sp/skills/spur-dev/references/execution-worktree-setup.md +6 -8
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +1 -1
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +33 -40
- package/plugins/sp/skills/spur-dev/references/structured-trace-emission.md +24 -24
- package/plugins/sp/skills/spur-doctor/SKILL.md +5 -4
- package/spur.js +12726 -1456
- package/web/_astro/{BoardApp.CaNvQBD_.js → BoardApp.B5rTVNd_.js} +1 -1
- package/web/_astro/{BoardApp.C5jnkkKP.js → BoardApp.BMprmPRc.js} +141 -141
- package/web/_astro/{TaskDetail.DGKndhI8.js → TaskDetail.Ddsur8qd.js} +1 -1
- package/web/_astro/{arc.DHrwdg3G.js → arc.DLqVVBxP.js} +1 -1
- package/web/_astro/{architectureDiagram-3BPJPVTR.pvKpK1s5.js → architectureDiagram-3BPJPVTR.C-Pk3uAi.js} +1 -1
- package/web/_astro/{blockDiagram-GPEHLZMM.BQmRcZsS.js → blockDiagram-GPEHLZMM.BRO1i_Nm.js} +1 -1
- package/web/_astro/{c4Diagram-AAUBKEIU.CCLjHeH1.js → c4Diagram-AAUBKEIU.BU_cWu6e.js} +1 -1
- package/web/_astro/channel.Bs3Illhy.js +1 -0
- package/web/_astro/{chunk-2J33WTMH.DL6Yuoma.js → chunk-2J33WTMH.D2VXiQ2t.js} +1 -1
- package/web/_astro/{chunk-4BX2VUAB.CzlyEI7l.js → chunk-4BX2VUAB.BcHT772J.js} +1 -1
- package/web/_astro/{chunk-55IACEB6.B60EWxp1.js → chunk-55IACEB6.DhDtICmo.js} +1 -1
- package/web/_astro/{chunk-727SXJPM.c7v_fRLo.js → chunk-727SXJPM.BoKHp7gV.js} +1 -1
- package/web/_astro/{chunk-AQP2D5EJ.8BxLWdDc.js → chunk-AQP2D5EJ.Chu4JRpE.js} +1 -1
- package/web/_astro/{chunk-FMBD7UC4.DmKuxGFT.js → chunk-FMBD7UC4.wHdwKPlq.js} +1 -1
- package/web/_astro/{chunk-ND2GUHAM.1Zwd4mqV.js → chunk-ND2GUHAM.ffN-M1JB.js} +1 -1
- package/web/_astro/{chunk-QZHKN3VN.BvYLu-A1.js → chunk-QZHKN3VN.FRubwg4S.js} +1 -1
- package/web/_astro/{classDiagram-4FO5ZUOK.CEqRt0WU.js → classDiagram-4FO5ZUOK.c22tQsc_.js} +1 -1
- package/web/_astro/{classDiagram-v2-Q7XG4LA2.CEqRt0WU.js → classDiagram-v2-Q7XG4LA2.c22tQsc_.js} +1 -1
- package/web/_astro/{cose-bilkent-S5V4N54A.C7JiUdj2.js → cose-bilkent-S5V4N54A.B9c6fiSj.js} +1 -1
- package/web/_astro/{cynefin-OW5HDTMX.B6mZ-1be.js → cynefin-OW5HDTMX.DrZsrUHl.js} +1 -1
- package/web/_astro/{dagre-BM42HDAG.BuryfDy6.js → dagre-BM42HDAG.DG1U4b3y.js} +1 -1
- package/web/_astro/{diagram-2AECGRRQ.dao39YQM.js → diagram-2AECGRRQ.CH15b-K3.js} +1 -1
- package/web/_astro/{diagram-5GNKFQAL.lnGZe4At.js → diagram-5GNKFQAL.BH1j7twR.js} +1 -1
- package/web/_astro/{diagram-KO2AKTUF.uWfhzEfT.js → diagram-KO2AKTUF.q2zCkbAj.js} +1 -1
- package/web/_astro/{diagram-LMA3HP47.ppq8-198.js → diagram-LMA3HP47.BLaaZnHV.js} +1 -1
- package/web/_astro/{diagram-OG6HWLK6.CKSCqDt5.js → diagram-OG6HWLK6.BcpRdQwI.js} +1 -1
- package/web/_astro/{erDiagram-TEJ5UH35.sFSf2yBN.js → erDiagram-TEJ5UH35.D7KBlqfM.js} +1 -1
- package/web/_astro/{flowDiagram-I6XJVG4X.BJQjKLbz.js → flowDiagram-I6XJVG4X.D_gmuRqg.js} +1 -1
- package/web/_astro/{ganttDiagram-6RSMTGT7.DAHKNj2N.js → ganttDiagram-6RSMTGT7.DzgWYniD.js} +1 -1
- package/web/_astro/{gitGraphDiagram-PVQCEYII.BlmzcW_O.js → gitGraphDiagram-PVQCEYII.576i3hm3.js} +1 -1
- package/web/_astro/index.DiC1a6lh.css +1 -0
- package/web/_astro/{infoDiagram-5YYISTIA.DGhjaqsi.js → infoDiagram-5YYISTIA.DMCclBiz.js} +1 -1
- package/web/_astro/{ishikawaDiagram-YF4QCWOH.gKIpgt6F.js → ishikawaDiagram-YF4QCWOH.9Kyca4SH.js} +1 -1
- package/web/_astro/{journeyDiagram-JHISSGLW.DG3tmP0R.js → journeyDiagram-JHISSGLW.chbdG-8q.js} +1 -1
- package/web/_astro/{kanban-definition-UN3LZRKU.CgHDSxkR.js → kanban-definition-UN3LZRKU.Bds54-e0.js} +1 -1
- package/web/_astro/{linear.BuGEpcuM.js → linear.D5ND9GN_.js} +1 -1
- package/web/_astro/{mermaid.core.DBVqkWBp.js → mermaid.core.D9N_PGbj.js} +4 -4
- package/web/_astro/{mindmap-definition-RKZ34NQL.D-kOcji9.js → mindmap-definition-RKZ34NQL.t0xop5vp.js} +1 -1
- package/web/_astro/{pieDiagram-4H26LBE5.BvGPwtZt.js → pieDiagram-4H26LBE5.DqgKh6hM.js} +1 -1
- package/web/_astro/{quadrantDiagram-W4KKPZXB.BKb_9FV6.js → quadrantDiagram-W4KKPZXB.DeuHVi2t.js} +1 -1
- package/web/_astro/{requirementDiagram-4Y6WPE33.Cx0fvD8v.js → requirementDiagram-4Y6WPE33.BdYFSG4W.js} +1 -1
- package/web/_astro/{sankeyDiagram-5OEKKPKP.fatULi0W.js → sankeyDiagram-5OEKKPKP.k1LPPETJ.js} +1 -1
- package/web/_astro/{sequenceDiagram-3UESZ5HK.ChHyKqco.js → sequenceDiagram-3UESZ5HK.DdyfpzoG.js} +1 -1
- package/web/_astro/{stateDiagram-AJRCARHV.BdUpKWyj.js → stateDiagram-AJRCARHV.DSEI8il0.js} +1 -1
- package/web/_astro/{stateDiagram-v2-BHNVJYJU.fmJxqIm5.js → stateDiagram-v2-BHNVJYJU.CoMnQRKo.js} +1 -1
- package/web/_astro/{timeline-definition-PNZ67QCA.BayDn5-V.js → timeline-definition-PNZ67QCA.DM1AHNm-.js} +1 -1
- package/web/_astro/{vennDiagram-CIIHVFJN.Bm2Aggwa.js → vennDiagram-CIIHVFJN.C-cJmVtl.js} +1 -1
- package/web/_astro/{wardleyDiagram-YWT4CUSO.DI75O-uG.js → wardleyDiagram-YWT4CUSO.D0xMzKPb.js} +1 -1
- package/web/_astro/{xychartDiagram-2RQKCTM6.DL90E7Q7.js → xychartDiagram-2RQKCTM6.BH5xJcEq.js} +1 -1
- package/web/index.html +2 -2
- package/config/plugin-scripts.json +0 -116
- package/config/script-placement-baseline.json +0 -33
- package/plugins/sp/hooks/careful-guard.ts +0 -74
- package/plugins/sp/hooks/pi/guard-extension.ts +0 -304
- package/plugins/sp/lib/dogfood-pipeline.ts +0 -265
- package/plugins/sp/lib/dogfood-report.ts +0 -278
- package/plugins/sp/lib/history-anatomy.generated.d.mts +0 -112
- package/plugins/sp/lib/history-anatomy.generated.mjs +0 -691
- package/plugins/sp/lib/idea-handoff.generated.d.mts +0 -17
- package/plugins/sp/lib/idea-handoff.generated.mjs +0 -1446
- package/plugins/sp/lib/inline-run-app.ts +0 -68
- package/plugins/sp/lib/inline-run.generated.d.mts +0 -37
- package/plugins/sp/lib/inline-run.generated.mjs +0 -3103
- package/plugins/sp/lib/plan-projection.generated.d.mts +0 -197
- package/plugins/sp/lib/plan-projection.generated.mjs +0 -982
- package/plugins/sp/lib/quality-gate.generated.d.mts +0 -139
- package/plugins/sp/lib/quality-gate.generated.mjs +0 -30510
- package/plugins/sp/lib/residual-scan.generated.d.mts +0 -93
- package/plugins/sp/lib/residual-scan.generated.mjs +0 -383
- package/plugins/sp/lib/run-summary-core.ts +0 -225
- package/plugins/sp/lib/spur-bin.ts +0 -36
- package/plugins/sp/lib/step-profile.generated.d.mts +0 -71
- package/plugins/sp/lib/step-profile.generated.mjs +0 -174
- package/plugins/sp/lib/transcript.ts +0 -112
- package/plugins/sp/scripts/batch-plan.mjs +0 -1096
- package/plugins/sp/scripts/batch-plan.ts +0 -145
- package/plugins/sp/scripts/batch-preflight.mjs +0 -423
- package/plugins/sp/scripts/batch-preflight.ts +0 -270
- package/plugins/sp/scripts/commit-guard.mjs +0 -226
- package/plugins/sp/scripts/commit-guard.ts +0 -248
- package/plugins/sp/scripts/daily-summary/daily-summary.mjs +0 -626
- package/plugins/sp/scripts/daily-summary/daily-summary.ts +0 -855
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.mjs +0 -211
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +0 -110
- package/plugins/sp/scripts/dogfood-testing/validate-report.mjs +0 -282
- package/plugins/sp/scripts/dogfood-testing/validate-report.ts +0 -98
- package/plugins/sp/scripts/feature-verification-steps.mjs +0 -82
- package/plugins/sp/scripts/feature-verification-steps.ts +0 -164
- package/plugins/sp/scripts/history-anatomy-cache.mjs +0 -931
- package/plugins/sp/scripts/history-anatomy-cache.ts +0 -247
- package/plugins/sp/scripts/idea-handoff.mjs +0 -32
- package/plugins/sp/scripts/idea-handoff.ts +0 -47
- package/plugins/sp/scripts/inline-run-dispatch.mjs +0 -131
- package/plugins/sp/scripts/inline-run-dispatch.ts +0 -115
- package/plugins/sp/scripts/inline-run-setup.mjs +0 -746
- package/plugins/sp/scripts/inline-run-setup.ts +0 -198
- package/plugins/sp/scripts/persist-out-check.mjs +0 -217
- package/plugins/sp/scripts/persist-out-check.ts +0 -249
- package/plugins/sp/scripts/pr-reviewing.mjs +0 -712
- package/plugins/sp/scripts/pr-reviewing.ts +0 -952
- package/plugins/sp/scripts/quality-gate.mjs +0 -30491
- package/plugins/sp/scripts/quality-gate.ts +0 -80
- package/plugins/sp/scripts/residual-scan.mjs +0 -634
- package/plugins/sp/scripts/residual-scan.ts +0 -248
- package/plugins/sp/scripts/run-summary.mjs +0 -758
- package/plugins/sp/scripts/run-summary.ts +0 -107
- package/plugins/sp/scripts/script-root.mjs +0 -129
- package/plugins/sp/scripts/script-root.ts +0 -199
- package/plugins/sp/scripts/session-timeline.mjs +0 -359
- package/plugins/sp/scripts/session-timeline.ts +0 -190
- package/plugins/sp/scripts/task-diffstat.mjs +0 -181
- package/plugins/sp/scripts/task-diffstat.ts +0 -219
- package/plugins/sp/scripts/workflow-step-profile.mjs +0 -338
- package/plugins/sp/scripts/workflow-step-profile.ts +0 -165
- package/plugins/sp/scripts/wrapup-drift-probe.mjs +0 -190
- package/plugins/sp/scripts/wrapup-drift-probe.ts +0 -261
- package/plugins/sp/scripts/wrapup-steps.mjs +0 -627
- package/plugins/sp/scripts/wrapup-steps.ts +0 -891
- package/web/_astro/channel.C7wG9RxA.js +0 -1
- package/web/_astro/index.BCY1JJHd.css +0 -1
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @bun
|
|
3
|
-
|
|
4
|
-
// plugins/sp/scripts/feature-verification-steps.ts
|
|
5
|
-
import { spawnSync } from "child_process";
|
|
6
|
-
import { existsSync } from "fs";
|
|
7
|
-
import { fileURLToPath } from "url";
|
|
8
|
-
|
|
9
|
-
// plugins/sp/lib/env.ts
|
|
10
|
-
function getEnvVar(name, fallback) {
|
|
11
|
-
const raw = process.env[name];
|
|
12
|
-
return raw === undefined ? fallback : raw;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// plugins/sp/scripts/feature-verification-steps.ts
|
|
16
|
-
function bundleEntry() {
|
|
17
|
-
return fileURLToPath(new URL("../lib/inline-run.generated.mjs", import.meta.url));
|
|
18
|
-
}
|
|
19
|
-
function sourceModeError(spurBin) {
|
|
20
|
-
return new Error(`source mode: refusing to load packages/app/src/index.ts (spurBin=${JSON.stringify(spurBin)}). ` + "That entry is not the feature-verification contract surface \u2014 it does not export " + "runFeatureVerification. Fix: run in bundle mode so " + "plugins/sp/lib/inline-run.generated.mjs is loaded (omit --module-mode, or pass --module-mode bundle) " + "and regenerate that bundle if it is missing. Reinstalling the sp plugin does not add the operation to the app source entry.");
|
|
21
|
-
}
|
|
22
|
-
function resolveModuleMode(raw) {
|
|
23
|
-
if (raw === "" || raw === "bundle")
|
|
24
|
-
return "bundle";
|
|
25
|
-
if (raw === "source")
|
|
26
|
-
return "source";
|
|
27
|
-
throw new Error(`unknown --module-mode ${JSON.stringify(raw)}; expected "source" or "bundle"`);
|
|
28
|
-
}
|
|
29
|
-
async function loadModule(spurBin, mode) {
|
|
30
|
-
if (mode === "source")
|
|
31
|
-
throw sourceModeError(spurBin);
|
|
32
|
-
const bundle = bundleEntry();
|
|
33
|
-
if (!existsSync(bundle)) {
|
|
34
|
-
throw new Error(`feature-verification-steps: mode=bundle \u2014 the generated inline bundle is missing at ${bundle}` + `${spurBin === "" ? "" : ` (spurBin=${spurBin})`}. ` + "Fix: in a source checkout run `bun run build:bundle`; for an installed plugin reinstall it.");
|
|
35
|
-
}
|
|
36
|
-
return requireModule(bundle, mode);
|
|
37
|
-
}
|
|
38
|
-
async function requireModule(entry, mode) {
|
|
39
|
-
const mod = await import(entry);
|
|
40
|
-
const missing = ["runFeatureVerification"].filter((k) => typeof mod[k] !== "function");
|
|
41
|
-
if (missing.length > 0) {
|
|
42
|
-
throw new Error(`feature-verification-steps: mode=${mode} \u2014 application entry ${entry} is missing feature-verification seams (${missing.join(", ")}). ` + "Fix: the generated inline bundle is stale or incomplete \u2014 run `bun run build:bundle` in a source checkout, or reinstall the sp plugin.");
|
|
43
|
-
}
|
|
44
|
-
return mod;
|
|
45
|
-
}
|
|
46
|
-
async function verify(featureId, runId, cmdOverride, spurBin, mode, confidenceOverride, ackLowConfidence) {
|
|
47
|
-
const mod = await loadModule(spurBin, mode);
|
|
48
|
-
const result = await mod.runFeatureVerification({
|
|
49
|
-
workdir: process.cwd(),
|
|
50
|
-
featureId,
|
|
51
|
-
runId,
|
|
52
|
-
cmdOverride,
|
|
53
|
-
confidenceOverride,
|
|
54
|
-
ackLowConfidence
|
|
55
|
-
});
|
|
56
|
-
console.log(`feature-verification-steps: ${featureId} ${result.message}`);
|
|
57
|
-
}
|
|
58
|
-
function main() {
|
|
59
|
-
if (!process.versions.bun) {
|
|
60
|
-
const child = spawnSync("bun", [fileURLToPath(import.meta.url), ...process.argv.slice(2)], {
|
|
61
|
-
stdio: "inherit"
|
|
62
|
-
});
|
|
63
|
-
if (child.error)
|
|
64
|
-
console.error(`feature-verification-steps requires Bun on PATH: ${child.error.message}`);
|
|
65
|
-
process.exit(child.status ?? 1);
|
|
66
|
-
}
|
|
67
|
-
const args = process.argv.slice(2);
|
|
68
|
-
const command = args[0];
|
|
69
|
-
const flag = (name) => {
|
|
70
|
-
const i = args.indexOf(name);
|
|
71
|
-
return i >= 0 && i + 1 < args.length ? args[i + 1] ?? "" : "";
|
|
72
|
-
};
|
|
73
|
-
if (command !== "verify") {
|
|
74
|
-
console.error("Usage: feature-verification-steps.ts verify --feature-id <id> --run-id <id> [--cmd <command>] [--confidence HIGH|MEDIUM|LOW] [--ack-low-confidence]");
|
|
75
|
-
process.exit(2);
|
|
76
|
-
}
|
|
77
|
-
verify(flag("--feature-id") || getEnvVar("featureId") || "", flag("--run-id") || getEnvVar("__runId") || "", flag("--cmd") || getEnvVar("verificationCmd") || "", flag("--spur-bin") || getEnvVar("spurBin") || "", resolveModuleMode(flag("--module-mode")), flag("--confidence") || getEnvVar("confidence") || "", args.includes("--ack-low-confidence") || getEnvVar("ackLowConfidence") === "true").then(() => process.exit(0)).catch((err) => {
|
|
78
|
-
console.error(`feature-verification-steps: ${String(err)}`);
|
|
79
|
-
process.exit(1);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
main();
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* feature-verification-steps — argv adapter for the feature-verification pass (task 0915; reduced to
|
|
4
|
-
* an adapter in task 1176).
|
|
5
|
-
*
|
|
6
|
-
* The pass itself — resolve the selected `feature-verification` definition, capture the before
|
|
7
|
-
* proof-input digest, record and register the RUNNING receipt, run the effective command through the
|
|
8
|
-
* safe argv splitter (never `sh -c`), compare the after digest, complete PASS/FAIL plus the coarse
|
|
9
|
-
* status file — lives in the application operation
|
|
10
|
-
* `packages/app/src/workflow/feature-verification-run.ts`, reached through the generated inline
|
|
11
|
-
* bundle. This entry owns argv, usage and exit codes only: it opens no project DB, constructs no
|
|
12
|
-
* `ArtifactDao`, and scans no feature directory (that lookup is app-owned too).
|
|
13
|
-
*
|
|
14
|
-
* Usage (workflow onEnter, vars: featureId, verificationCmd, spurBin, __runId):
|
|
15
|
-
* bun plugins/sp/scripts/feature-verification-steps.ts verify \
|
|
16
|
-
* --feature-id D63 --run-id <runId> [--cmd "bun run spur-check-feature"] [--module-mode bundle]
|
|
17
|
-
*
|
|
18
|
-
* Always exits 0 after a completed pass; the transition guard reads the status file and the
|
|
19
|
-
* completion boundary validates the receipt (fail-closed). Unsafe ids are refused by the operation.
|
|
20
|
-
*
|
|
21
|
-
* The installed `.mjs` twin may be launched with plain `node` (the `feature-verification` workflow
|
|
22
|
-
* selects `installed -> node`), but the generated inline bundle keeps `bun:sqlite` external by design, so the
|
|
23
|
-
* twin re-enters Bun at the top of `main()` (task 1197). Unlike daily-summary it fails closed when Bun
|
|
24
|
-
* is missing — a verifier that cannot load its bundle cannot run the checks.
|
|
25
|
-
*
|
|
26
|
-
* Node-builtin imports only (ADR-065); the application seams come from the generated inline bundle,
|
|
27
|
-
* never from `packages/app/src/index.ts`, which is not a plugin-script contract surface (0948 R3).
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
import { spawnSync } from 'node:child_process';
|
|
31
|
-
import { existsSync } from 'node:fs';
|
|
32
|
-
import { fileURLToPath } from 'node:url';
|
|
33
|
-
import { getEnvVar } from '../lib/env';
|
|
34
|
-
|
|
35
|
-
/** Shape of the generated inline bundle / repo app source this script consumes. */
|
|
36
|
-
interface VerificationModule {
|
|
37
|
-
runFeatureVerification: typeof import('../../../packages/app/src/workflow/feature-verification-run')['runFeatureVerification'];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Explicit module surface. Source is not the contract; the generated bundle is (0948 R3). */
|
|
41
|
-
type ModuleMode = 'source' | 'bundle';
|
|
42
|
-
|
|
43
|
-
function bundleEntry(): string {
|
|
44
|
-
return fileURLToPath(new URL('../lib/inline-run.generated.mjs', import.meta.url));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Source mode names the mode and the fix. The app source entry does not export the verification
|
|
49
|
-
* operation, and "rebuild/install the sp plugin" cannot add it.
|
|
50
|
-
*/
|
|
51
|
-
function sourceModeError(spurBin: string): Error {
|
|
52
|
-
return new Error(
|
|
53
|
-
`source mode: refusing to load packages/app/src/index.ts (spurBin=${JSON.stringify(spurBin)}). ` +
|
|
54
|
-
'That entry is not the feature-verification contract surface — it does not export ' +
|
|
55
|
-
'runFeatureVerification. Fix: run in bundle mode so ' +
|
|
56
|
-
'plugins/sp/lib/inline-run.generated.mjs is loaded (omit --module-mode, or pass --module-mode bundle) ' +
|
|
57
|
-
'and regenerate that bundle if it is missing. Reinstalling the sp plugin does not add the operation to the app source entry.',
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function resolveModuleMode(raw: string): ModuleMode {
|
|
62
|
-
if (raw === '' || raw === 'bundle') return 'bundle';
|
|
63
|
-
if (raw === 'source') return 'source';
|
|
64
|
-
throw new Error(`unknown --module-mode ${JSON.stringify(raw)}; expected "source" or "bundle"`);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Bundle mode loads the generated inline bundle. Source mode fails closed with a named fix.
|
|
69
|
-
*
|
|
70
|
-
* `spurBin` no longer selects the module (it named the *caller's* CLI entry, not this script's runtime
|
|
71
|
-
* surface); it is kept only to make the failure message actionable.
|
|
72
|
-
*/
|
|
73
|
-
async function loadModule(spurBin: string, mode: ModuleMode): Promise<VerificationModule> {
|
|
74
|
-
if (mode === 'source') throw sourceModeError(spurBin);
|
|
75
|
-
const bundle = bundleEntry();
|
|
76
|
-
if (!existsSync(bundle)) {
|
|
77
|
-
throw new Error(
|
|
78
|
-
`feature-verification-steps: mode=bundle — the generated inline bundle is missing at ${bundle}` +
|
|
79
|
-
`${spurBin === '' ? '' : ` (spurBin=${spurBin})`}. ` +
|
|
80
|
-
'Fix: in a source checkout run `bun run build:bundle`; for an installed plugin reinstall it.',
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
return requireModule(bundle, mode);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/** Dynamic-import the entry and refuse a module missing the verification operation. */
|
|
87
|
-
async function requireModule(entry: string, mode: ModuleMode): Promise<VerificationModule> {
|
|
88
|
-
const mod = (await import(entry)) as Partial<VerificationModule> & Record<string, unknown>;
|
|
89
|
-
const missing = (['runFeatureVerification'] as const).filter((k) => typeof mod[k] !== 'function');
|
|
90
|
-
if (missing.length > 0) {
|
|
91
|
-
throw new Error(
|
|
92
|
-
`feature-verification-steps: mode=${mode} — application entry ${entry} is missing feature-verification seams (${missing.join(', ')}). ` +
|
|
93
|
-
'Fix: the generated inline bundle is stale or incomplete — run `bun run build:bundle` in a source checkout, or reinstall the sp plugin.',
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
return mod as VerificationModule;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/** One full verification pass for one feature. Always exits 0. */
|
|
100
|
-
async function verify(
|
|
101
|
-
featureId: string,
|
|
102
|
-
runId: string,
|
|
103
|
-
cmdOverride: string,
|
|
104
|
-
spurBin: string,
|
|
105
|
-
mode: ModuleMode,
|
|
106
|
-
confidenceOverride: string,
|
|
107
|
-
ackLowConfidence: boolean,
|
|
108
|
-
): Promise<void> {
|
|
109
|
-
const mod = await loadModule(spurBin, mode);
|
|
110
|
-
const result = await mod.runFeatureVerification({
|
|
111
|
-
workdir: process.cwd(),
|
|
112
|
-
featureId,
|
|
113
|
-
runId,
|
|
114
|
-
cmdOverride,
|
|
115
|
-
// Operator-declared level (empty = derive from the pass) and the acknowledgement of a LOW
|
|
116
|
-
// level. Both ride the receipt, so the completion boundary reads them from the evidence
|
|
117
|
-
// rather than from whatever flags a later transition happens to pass.
|
|
118
|
-
confidenceOverride,
|
|
119
|
-
ackLowConfidence,
|
|
120
|
-
});
|
|
121
|
-
console.log(`feature-verification-steps: ${featureId} ${result.message}`);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function main(): void {
|
|
125
|
-
// The portable Node twin has no workspace imports; the generated bundle still uses Spur's Bun
|
|
126
|
-
// runtime (bun:sqlite stays external by design). Re-enter Bun before any app import; fail closed
|
|
127
|
-
// when Bun is missing — the verifier must not report a pass it could not run.
|
|
128
|
-
if (!process.versions.bun) {
|
|
129
|
-
const child = spawnSync('bun', [fileURLToPath(import.meta.url), ...process.argv.slice(2)], {
|
|
130
|
-
stdio: 'inherit',
|
|
131
|
-
});
|
|
132
|
-
if (child.error) console.error(`feature-verification-steps requires Bun on PATH: ${child.error.message}`);
|
|
133
|
-
process.exit(child.status ?? 1);
|
|
134
|
-
}
|
|
135
|
-
const args = process.argv.slice(2);
|
|
136
|
-
const command = args[0];
|
|
137
|
-
const flag = (name: string): string => {
|
|
138
|
-
const i = args.indexOf(name);
|
|
139
|
-
return i >= 0 && i + 1 < args.length ? (args[i + 1] ?? '') : '';
|
|
140
|
-
};
|
|
141
|
-
if (command !== 'verify') {
|
|
142
|
-
console.error(
|
|
143
|
-
'Usage: feature-verification-steps.ts verify --feature-id <id> --run-id <id> [--cmd <command>] ' +
|
|
144
|
-
'[--confidence HIGH|MEDIUM|LOW] [--ack-low-confidence]',
|
|
145
|
-
);
|
|
146
|
-
process.exit(2);
|
|
147
|
-
}
|
|
148
|
-
verify(
|
|
149
|
-
flag('--feature-id') || getEnvVar('featureId') || '',
|
|
150
|
-
flag('--run-id') || getEnvVar('__runId') || '',
|
|
151
|
-
flag('--cmd') || getEnvVar('verificationCmd') || '',
|
|
152
|
-
flag('--spur-bin') || getEnvVar('spurBin') || '',
|
|
153
|
-
resolveModuleMode(flag('--module-mode')),
|
|
154
|
-
flag('--confidence') || getEnvVar('confidence') || '',
|
|
155
|
-
args.includes('--ack-low-confidence') || getEnvVar('ackLowConfidence') === 'true',
|
|
156
|
-
)
|
|
157
|
-
.then(() => process.exit(0))
|
|
158
|
-
.catch((err: unknown) => {
|
|
159
|
-
console.error(`feature-verification-steps: ${String(err)}`);
|
|
160
|
-
process.exit(1);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
main();
|