@momentiq/dark-factory-cli 1.1.0 → 2.0.0
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/README.md +86 -2
- package/dist/adapters/critic-result-schema.d.ts +14 -14
- package/dist/adapters/index.d.ts +1 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +7 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/static-schema-lint.d.ts +68 -0
- package/dist/adapters/static-schema-lint.d.ts.map +1 -0
- package/dist/adapters/static-schema-lint.js +813 -0
- package/dist/adapters/static-schema-lint.js.map +1 -0
- package/dist/cli.d.ts +17 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +296 -41
- package/dist/cli.js.map +1 -1
- package/dist/commands/findings.d.ts +6 -0
- package/dist/commands/findings.d.ts.map +1 -0
- package/dist/commands/findings.js +196 -0
- package/dist/commands/findings.js.map +1 -0
- package/dist/commands/skills.d.ts +6 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +248 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/doctor.d.ts +17 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +107 -0
- package/dist/doctor.js.map +1 -1
- package/dist/evidence/docker-build.d.ts +6 -0
- package/dist/evidence/docker-build.d.ts.map +1 -0
- package/dist/evidence/docker-build.js +199 -0
- package/dist/evidence/docker-build.js.map +1 -0
- package/dist/evidence/index.d.ts +1 -0
- package/dist/evidence/index.d.ts.map +1 -1
- package/dist/evidence/index.js +6 -0
- package/dist/evidence/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +2 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/doctor.d.ts.map +1 -1
- package/dist/mcp/tools/doctor.js +5 -0
- package/dist/mcp/tools/doctor.js.map +1 -1
- package/dist/mcp/tools/review-bypass.d.ts.map +1 -1
- package/dist/mcp/tools/review-bypass.js +21 -0
- package/dist/mcp/tools/review-bypass.js.map +1 -1
- package/dist/mcp/tools/skills-install.d.ts +6 -0
- package/dist/mcp/tools/skills-install.d.ts.map +1 -0
- package/dist/mcp/tools/skills-install.js +260 -0
- package/dist/mcp/tools/skills-install.js.map +1 -0
- package/dist/mcp/tools/stats-gate.d.ts.map +1 -1
- package/dist/mcp/tools/stats-gate.js +63 -15
- package/dist/mcp/tools/stats-gate.js.map +1 -1
- package/dist/policy/gate.d.ts +1 -1
- package/dist/policy/gate.d.ts.map +1 -1
- package/dist/policy/gate.js +96 -12
- package/dist/policy/gate.js.map +1 -1
- package/dist/prompt.d.ts +1 -0
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +105 -1
- package/dist/prompt.js.map +1 -1
- package/dist/report.d.ts +106 -3
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +282 -10
- package/dist/report.js.map +1 -1
- package/dist/runner.d.ts +2 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +86 -2
- package/dist/runner.js.map +1 -1
- package/dist/self-consistency.d.ts +144 -0
- package/dist/self-consistency.d.ts.map +1 -0
- package/dist/self-consistency.js +368 -0
- package/dist/self-consistency.js.map +1 -0
- package/dist/skills/config.d.ts +176 -0
- package/dist/skills/config.d.ts.map +1 -0
- package/dist/skills/config.js +251 -0
- package/dist/skills/config.js.map +1 -0
- package/dist/skills/index.d.ts +4 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +8 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/install.d.ts +62 -0
- package/dist/skills/install.d.ts.map +1 -0
- package/dist/skills/install.js +315 -0
- package/dist/skills/install.js.map +1 -0
- package/dist/skills/template.d.ts +42 -0
- package/dist/skills/template.d.ts.map +1 -0
- package/dist/skills/template.js +95 -0
- package/dist/skills/template.js.map +1 -0
- package/dist/trusted-surface/rebind.d.ts.map +1 -1
- package/dist/trusted-surface/rebind.js +14 -1
- package/dist/trusted-surface/rebind.js.map +1 -1
- package/package.json +32 -2
- package/skills/README.md +89 -0
- package/skills/chief-engineer-blitz/SKILL.md.tmpl +443 -0
- package/skills/chief-engineer-blitz/skill.json +53 -0
- package/skills/chief-engineer-review/SKILL.md.tmpl +184 -0
- package/skills/chief-engineer-review/references/review-examples.md.tmpl +130 -0
- package/skills/chief-engineer-review/skill.json +67 -0
- package/skills/chief-engineer-review/templates/code-review-prompt.md.tmpl +111 -0
- package/skills/chief-engineer-review/templates/escalation-prompt.md.tmpl +56 -0
- package/skills/chief-engineer-review/templates/plan-review-prompt.md.tmpl +74 -0
- package/skills/skill-schema.json +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-schema-lint.js","sourceRoot":"","sources":["../../src/adapters/static-schema-lint.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,sEAAsE;AACtE,wEAAwE;AACxE,oEAAoE;AACpE,qEAAqE;AACrE,uEAAuE;AACvE,wEAAwE;AACxE,kEAAkE;AAClE,gEAAgE;AAChE,uEAAuE;AACvE,8BAA8B;AAC9B,EAAE;AACF,qEAAqE;AACrE,qEAAqE;AACrE,kEAAkE;AAClE,sEAAsE;AACtE,uEAAuE;AACvE,qEAAqE;AACrE,sEAAsE;AACtE,yEAAyE;AACzE,0BAA0B;AAC1B,EAAE;AACF,WAAW;AACX,gEAAgE;AAChE,uEAAuE;AACvE,uCAAuC;AACvC,sEAAsE;AACtE,uEAAuE;AACvE,sEAAsE;AACtE,mEAAmE;AACnE,uEAAuE;AACvE,EAAE;AACF,yBAAyB;AACzB,oEAAoE;AACpE,0EAA0E;AAC1E,sEAAsE;AACtE,+DAA+D;AAC/D,qEAAqE;AACrE,4EAA4E;AAC5E,EAAE;AACF,uBAAuB;AACvB,uEAAuE;AACvE,yEAAyE;AACzE,sEAAsE;AACt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,WAAW,EAAE,iEAAiE,EAAE,CAAC;aACxF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,0BAA0B;gBAChC,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,sCAAuC,GAAa,CAAC,OAAO,EAAE;gBACtE,WAAW,EAAE,iEAAiE;aAC/E,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import { type LoadedConfig } from "./policy/config.js";
|
|
3
|
+
import { type SelfConsistencyProbeFn } from "./self-consistency.js";
|
|
4
|
+
/**
|
|
5
|
+
* Cursor finding (cli.ts:560) — resolve the production
|
|
6
|
+
* self-consistency probe so the policy `unilateralVetoRules.requireCorroborationFor`
|
|
7
|
+
* actually demotes findings on the default OSS CLI path. Returns the
|
|
8
|
+
* probe callable when (a) the loaded policy lists `self_inconsistent`
|
|
9
|
+
* AND (b) `buildDefaultSelfConsistencyProbe()` returns a non-null
|
|
10
|
+
* factory (i.e. the env has a `GEMINI_API_KEY`). Otherwise returns
|
|
11
|
+
* undefined, which makes the runner skip the probe pass entirely
|
|
12
|
+
* (byte-identical pre-#112 behavior).
|
|
13
|
+
*
|
|
14
|
+
* Operators who want a non-Gemini probe (or the hosted worker's
|
|
15
|
+
* proprietary calibrated probe) replace the callable by importing
|
|
16
|
+
* `runReview` directly with their own `selfConsistencyProbe`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveProductionSelfConsistencyProbe(loaded: LoadedConfig): SelfConsistencyProbeFn | undefined;
|
|
3
19
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA0EA,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAue/B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,YAAY,GACnB,sBAAsB,GAAG,SAAS,CAWpC"}
|
package/dist/cli.js
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
// subcommands accept their own flags directly (see `cmdAudit` and
|
|
35
35
|
// `cmdAdmitPr` below).
|
|
36
36
|
import { spawnSync } from "node:child_process";
|
|
37
|
-
import { accessSync, appendFileSync, constants as fsConstants, existsSync, readFileSync, } from "node:fs";
|
|
37
|
+
import { accessSync, appendFileSync, constants as fsConstants, existsSync, readFileSync, realpathSync, } from "node:fs";
|
|
38
38
|
import { dirname, resolve } from "node:path";
|
|
39
39
|
import { fileURLToPath } from "node:url";
|
|
40
40
|
import { runValidateCycleDoc } from "./cycle-doc-validator/index.js";
|
|
@@ -54,10 +54,11 @@ import { AdapterRegistry, collectRequiredEnvVars, } from "./adapters/critic.js";
|
|
|
54
54
|
import { loadAgentReviewConfig } from "./policy/config.js";
|
|
55
55
|
import { buildCriticReport, buildZeroEvidenceDiagnostic } from "./report.js";
|
|
56
56
|
import { runReview, runCommitGate } from "./runner.js";
|
|
57
|
+
import { buildDefaultSelfConsistencyProbe, } from "./self-consistency.js";
|
|
57
58
|
import { resolveArtifactDir, telemetryPath } from "./paths.js";
|
|
58
59
|
// Phase F-LOCAL — hook-facing subcommand support.
|
|
59
60
|
import { loadDopplerBootstrapEnv, DEFAULT_BOOTSTRAP_ALLOWLIST, } from "./doppler-bootstrap.js";
|
|
60
|
-
import { classifyDoctorState, runDoctor } from "./doctor.js";
|
|
61
|
+
import { classifyDoctorState, detectCloudEnv, runDoctor, } from "./doctor.js";
|
|
61
62
|
import { resolveProfile } from "./policy/profile.js";
|
|
62
63
|
import { commitsForPushUpdate, parsePrePushUpdates, resolveCommit, commitParent, changedFiles, } from "./git.js";
|
|
63
64
|
import { runQualityGates } from "./evidence/quality-gates.js";
|
|
@@ -69,12 +70,21 @@ import { summarizeGate } from "./policy/gate.js";
|
|
|
69
70
|
// stderr-only diagnostics) is structurally distinct from the other
|
|
70
71
|
// subcommands. See docs/roadmap/cycles/cycle5-mcp-server.md.
|
|
71
72
|
import { cmdMcp } from "./mcp/cli.js";
|
|
73
|
+
// DFP #192 — `df skills install/list` subcommand. The skills module is the
|
|
74
|
+
// install engine (consumer-config-driven template rendering); cmdSkills
|
|
75
|
+
// in commands/skills.ts is the CLI wrapper around it.
|
|
76
|
+
import { cmdSkills } from "./commands/skills.js";
|
|
72
77
|
// Cycle 11 Phase 11.1 — `df flow` namespace surfacing the PR Flow
|
|
73
78
|
// Assessor's records from momentiq-ai/df-assessments. See
|
|
74
79
|
// docs/roadmap/cycles/cycle11-flow-assessor-surfacing-and-tools.md.
|
|
75
80
|
import { cmdFlow } from "./commands/flow/index.js";
|
|
76
81
|
import { cmdShow } from "./commands/show.js";
|
|
77
82
|
import { cmdStatus } from "./commands/status.js";
|
|
83
|
+
// Cycle 13 (dark-factory-platform#149) — `df findings --range` surfaces
|
|
84
|
+
// the per-commit iteration-receipt artifacts that the new (default)
|
|
85
|
+
// final-commit-only `df gate-push` semantic leaves un-gated. See
|
|
86
|
+
// src/commands/findings.ts for the rationale.
|
|
87
|
+
import { cmdFindings } from "./commands/findings.js";
|
|
78
88
|
// Cycle 12 Phase 12.2 — agent handoff protocol (v2 — Issue-anchored, native-
|
|
79
89
|
// baton). The four cmd* functions below wrap the verb orchestrators exported
|
|
80
90
|
// from src/handoff/index.ts and route to them at the bottom of main(). v1
|
|
@@ -112,12 +122,23 @@ function printHelp(meta) {
|
|
|
112
122
|
" df review Run the local critic against a commit",
|
|
113
123
|
" (subscription auth — Cursor / Codex /",
|
|
114
124
|
" Claude logins, NOT pay-per-token keys).",
|
|
115
|
-
" df gate-push Pre-push gate — block a push when
|
|
116
|
-
"
|
|
125
|
+
" df gate-push Pre-push gate — block a push when HEAD's",
|
|
126
|
+
" critic verdict has unresolved blockers.",
|
|
127
|
+
" Default since Cycle 13 (dark-factory-",
|
|
128
|
+
" platform#149): gates the HEAD commit",
|
|
129
|
+
" only; intermediate commits are iteration",
|
|
130
|
+
" receipts (see `df findings --range`).",
|
|
131
|
+
" Legacy per-commit gating via",
|
|
132
|
+
" `--full-range` / `DF_GATE_FULL_RANGE=1`.",
|
|
117
133
|
" df show Render the per-commit review artifact",
|
|
118
134
|
" (with --json for the structured form).",
|
|
119
135
|
" df status Terse verdict + per-critic status for",
|
|
120
136
|
" a commit (with --json for shell pipes).",
|
|
137
|
+
" df findings --range BASE..HEAD",
|
|
138
|
+
" Audit-inspect per-commit findings for the",
|
|
139
|
+
" iteration-receipt artifacts the default",
|
|
140
|
+
" final-commit-only `df gate-push` leaves",
|
|
141
|
+
" un-gated (Cycle 13). NOT a gate.",
|
|
121
142
|
" df gates Run configured quality gates and",
|
|
122
143
|
" triggered verification routes.",
|
|
123
144
|
" df stats Pretty-print critic call stats + bypass",
|
|
@@ -155,6 +176,13 @@ function printHelp(meta) {
|
|
|
155
176
|
" + prompt catalog. Run `df mcp --help` for the",
|
|
156
177
|
" .mcp.json wiring snippet.",
|
|
157
178
|
"",
|
|
179
|
+
"Bundled skills (consumer-shape):",
|
|
180
|
+
" df skills install <name> Render + install a bundled skill into",
|
|
181
|
+
" .claude/skills/<name>/, driven by the consumer's",
|
|
182
|
+
" darkfactory.yaml. --all installs every skill",
|
|
183
|
+
" flagged enabled: true.",
|
|
184
|
+
" df skills list List bundled skill names + summaries.",
|
|
185
|
+
"",
|
|
158
186
|
"PR Flow Assessor surfacing:",
|
|
159
187
|
" df flow Surface the PR Flow Assessor's records.",
|
|
160
188
|
" Six sub-subcommands: show / agent /",
|
|
@@ -294,14 +322,23 @@ const CYCLE12_SUBCOMMANDS = new Set([
|
|
|
294
322
|
// not at the top level, so the surface stays grouped (`df flow --help` is
|
|
295
323
|
// authoritative) and we don't pollute the top-level `df` namespace.
|
|
296
324
|
const CYCLE11_SUBCOMMANDS = new Set(["flow"]);
|
|
297
|
-
// `df show` / `df status`
|
|
298
|
-
//
|
|
325
|
+
// `df show` / `df status` / `df findings` — CLI artifact-inspection
|
|
326
|
+
// subcommands. `show` + `status` mirror the df_show_run / df_findings MCP
|
|
327
|
+
// tools per-commit (cycle 5); `findings --range <base>..<head>` (Cycle
|
|
328
|
+
// 13, dark-factory-platform#149) walks the iteration-receipt artifacts
|
|
329
|
+
// the new default final-commit-only `df gate-push` semantic leaves
|
|
330
|
+
// un-gated. All three share the loader + mappers in
|
|
299
331
|
// src/lib/show-status-core.ts so the CLI's `--json` output stays
|
|
300
332
|
// byte-equivalent with the MCP tool's structuredContent envelope (cycle 5
|
|
301
333
|
// spec requirement). Registered here so the early --help interception
|
|
302
|
-
// forwards
|
|
303
|
-
|
|
304
|
-
|
|
334
|
+
// forwards each `df <cmd> --help` to its per-subcommand help printer.
|
|
335
|
+
const SHOW_STATUS_SUBCOMMANDS = new Set(["show", "status", "findings"]);
|
|
336
|
+
// `df skills` — bundled-skill installer (Cycle: DFP #192). The namespace
|
|
337
|
+
// fans out into `install/list` sub-subcommands handled inside cmdSkills;
|
|
338
|
+
// registered here so the early --help interception above forwards
|
|
339
|
+
// `df skills --help` to cmdSkills' own help printer instead of the
|
|
340
|
+
// top-level printHelp.
|
|
341
|
+
const SKILLS_SUBCOMMANDS = new Set(["skills"]);
|
|
305
342
|
function cmdStatusCheck(_rest) {
|
|
306
343
|
// pr-status-check is a sentinel aggregator. As cycle 331.1 Phase E
|
|
307
344
|
// documents in `.github/workflows/pr-status-check.yml`, this gate is
|
|
@@ -345,6 +382,12 @@ const ADAPTER_LOADERS = [
|
|
|
345
382
|
{ id: "codex-sdk", modulePath: "./adapters/codex-sdk.js", className: "CodexSdkAdapter" },
|
|
346
383
|
{ id: "gemini-sdk", modulePath: "./adapters/gemini-sdk.js", className: "GeminiSdkAdapter" },
|
|
347
384
|
{ id: "grok-direct-sdk", modulePath: "./adapters/grok-direct-sdk.js", className: "GrokDirectSdkAdapter" },
|
|
385
|
+
// Consumer dark-factory-platform#107 — deterministic schema-lint adapter.
|
|
386
|
+
// No vendor SDK, no env vars, no network; pure ajv-backed validation of
|
|
387
|
+
// schema-annotated code blocks in changed markdown / config files.
|
|
388
|
+
// Loads alongside the LLM adapters so the local profile can include it
|
|
389
|
+
// without any additional toolchain.
|
|
390
|
+
{ id: "static-schema-lint", modulePath: "./adapters/static-schema-lint.js", className: "StaticSchemaLintAdapter" },
|
|
348
391
|
];
|
|
349
392
|
async function buildDefaultAdapterRegistry() {
|
|
350
393
|
// Each adapter reads its API key from the corresponding env var by
|
|
@@ -397,6 +440,31 @@ function appendStepSummary(markdown) {
|
|
|
397
440
|
// best-effort — never let a summary-write failure change the gate outcome.
|
|
398
441
|
}
|
|
399
442
|
}
|
|
443
|
+
/**
|
|
444
|
+
* Cursor finding (cli.ts:560) — resolve the production
|
|
445
|
+
* self-consistency probe so the policy `unilateralVetoRules.requireCorroborationFor`
|
|
446
|
+
* actually demotes findings on the default OSS CLI path. Returns the
|
|
447
|
+
* probe callable when (a) the loaded policy lists `self_inconsistent`
|
|
448
|
+
* AND (b) `buildDefaultSelfConsistencyProbe()` returns a non-null
|
|
449
|
+
* factory (i.e. the env has a `GEMINI_API_KEY`). Otherwise returns
|
|
450
|
+
* undefined, which makes the runner skip the probe pass entirely
|
|
451
|
+
* (byte-identical pre-#112 behavior).
|
|
452
|
+
*
|
|
453
|
+
* Operators who want a non-Gemini probe (or the hosted worker's
|
|
454
|
+
* proprietary calibrated probe) replace the callable by importing
|
|
455
|
+
* `runReview` directly with their own `selfConsistencyProbe`.
|
|
456
|
+
*/
|
|
457
|
+
export function resolveProductionSelfConsistencyProbe(loaded) {
|
|
458
|
+
const flags = loaded.config.aggregation.unilateralVetoRules?.requireCorroborationFor ?? [];
|
|
459
|
+
if (!flags.includes("self_inconsistent"))
|
|
460
|
+
return undefined;
|
|
461
|
+
const probe = buildDefaultSelfConsistencyProbe();
|
|
462
|
+
if (probe === null) {
|
|
463
|
+
process.stderr.write("[critic] self-consistency probe disabled — GEMINI_API_KEY unset; policy `unilateralVetoRules.requireCorroborationFor: [self_inconsistent]` is configured but probe-flagged findings will not be demoted on this run.\n");
|
|
464
|
+
return undefined;
|
|
465
|
+
}
|
|
466
|
+
return probe;
|
|
467
|
+
}
|
|
400
468
|
async function cmdCritic(rest) {
|
|
401
469
|
if (rest.includes("--help") || rest.includes("-h")) {
|
|
402
470
|
process.stdout.write([
|
|
@@ -437,11 +505,13 @@ async function cmdCritic(rest) {
|
|
|
437
505
|
// audit trail on its own PRs.
|
|
438
506
|
const artifactDir = await resolveArtifactDir(loaded);
|
|
439
507
|
const sink = new FileTelemetrySink(telemetryPath(artifactDir));
|
|
508
|
+
const selfConsistencyProbe = resolveProductionSelfConsistencyProbe(loaded);
|
|
440
509
|
const outcome = await runReview({
|
|
441
510
|
loaded,
|
|
442
511
|
registry,
|
|
443
512
|
ref: opts.ref,
|
|
444
513
|
telemetry: sink,
|
|
514
|
+
...(selfConsistencyProbe !== undefined ? { selfConsistencyProbe } : {}),
|
|
445
515
|
});
|
|
446
516
|
// sage3c#2213 — surface per-critic errors + a loud degradation
|
|
447
517
|
// warning. `buildCriticReport` is pure; it turns the artifact's
|
|
@@ -625,12 +695,14 @@ async function cmdReview(rest) {
|
|
|
625
695
|
const ref = flags["commit"] ?? "HEAD";
|
|
626
696
|
const foreground = flags["foreground"] === true || flags["foreground"] === "true";
|
|
627
697
|
try {
|
|
698
|
+
const selfConsistencyProbe = resolveProductionSelfConsistencyProbe(loaded);
|
|
628
699
|
const outcome = await runReview({
|
|
629
700
|
loaded,
|
|
630
701
|
registry,
|
|
631
702
|
ref,
|
|
632
703
|
telemetry: sink,
|
|
633
704
|
profileName,
|
|
705
|
+
...(selfConsistencyProbe !== undefined ? { selfConsistencyProbe } : {}),
|
|
634
706
|
});
|
|
635
707
|
// Issue #51 — loud post-completion diagnostic for zero-evidence
|
|
636
708
|
// reviews. When every critic errored (no completed verdicts), the
|
|
@@ -672,19 +744,93 @@ function hasProfileEntry(config, profileName) {
|
|
|
672
744
|
return config.profiles[profileName] !== undefined;
|
|
673
745
|
}
|
|
674
746
|
// ----- df gate-push -----
|
|
747
|
+
//
|
|
748
|
+
// Cycle 13 (dark-factory-platform#149) — semantic flip:
|
|
749
|
+
//
|
|
750
|
+
// DEFAULT MODE: final-commit-only. The HEAD (last) commit of each
|
|
751
|
+
// push update is the only one whose verdict decides the gate. The
|
|
752
|
+
// intermediate commits' per-SHA artifacts still exist on disk
|
|
753
|
+
// (`.git/agent-reviews/<sha>.json`) as iteration receipts and stay
|
|
754
|
+
// visible via `df findings --range <base>..<head>`, but they do
|
|
755
|
+
// NOT influence the push outcome. This matches the documented
|
|
756
|
+
// find-fix-new-commit pattern: commit B fixes commit A's blockers,
|
|
757
|
+
// B's verdict is what gates the push.
|
|
758
|
+
//
|
|
759
|
+
// Soundness caveat: each per-SHA artifact reviews `parent..commit`
|
|
760
|
+
// only, NOT `base..tip`. HEAD's APPROVED verdict therefore proves
|
|
761
|
+
// the LAST incremental change is safe; it does NOT prove the
|
|
762
|
+
// cumulative `base..tip` diff is safe. The banner + help text
|
|
763
|
+
// surface this so operators can choose `--full-range` (or rely on
|
|
764
|
+
// the CI cold-path agent-critic workflow that reviews the full PR
|
|
765
|
+
// diff) when cumulative soundness matters more than termination of
|
|
766
|
+
// the find-fix loop.
|
|
767
|
+
//
|
|
768
|
+
// LEGACY MODE: full-range — gate every commit in the push update,
|
|
769
|
+
// block on any single commit's blockers. Opt-in via `--full-range`
|
|
770
|
+
// OR `DF_GATE_FULL_RANGE=1`. Use cases: forensic replay, per-commit
|
|
771
|
+
// audit (each commit is independently reviewed in a deploy log),
|
|
772
|
+
// cumulative-state evidence requirements.
|
|
773
|
+
//
|
|
774
|
+
// The legacy mode was the implicit default before Cycle 13. It
|
|
775
|
+
// makes the find-fix-new-commit pattern non-terminating in practice
|
|
776
|
+
// (any iteration round produces stale intermediate `CHANGES_REQUESTED`
|
|
777
|
+
// verdicts that block the push and force a squash, which spawns a
|
|
778
|
+
// fresh full-diff review that surfaces new findings — see
|
|
779
|
+
// consumer-side dark-factory-platform#149 for the full failure mode).
|
|
780
|
+
//
|
|
781
|
+
// The mode banner — `GATE MODE: final-commit-only (HEAD=<sha>)` or
|
|
782
|
+
// `GATE MODE: full-range (N commits)` — prints once per push update so
|
|
783
|
+
// operators see which semantic is active without needing to remember
|
|
784
|
+
// the env-var / flag state.
|
|
785
|
+
//
|
|
786
|
+
// `--commit SHA --ci` mode is a single-commit replay path (CI cold-
|
|
787
|
+
// path); the legacy/default split does not apply to it (one commit
|
|
788
|
+
// only).
|
|
789
|
+
function isFullRangeRequested(flags) {
|
|
790
|
+
if (flags["full-range"] === true || flags["full-range"] === "true") {
|
|
791
|
+
return true;
|
|
792
|
+
}
|
|
793
|
+
const env = process.env["DF_GATE_FULL_RANGE"];
|
|
794
|
+
if (env !== undefined && env !== "" && env !== "0" && env.toLowerCase() !== "false") {
|
|
795
|
+
return true;
|
|
796
|
+
}
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
675
799
|
async function cmdGatePush(rest) {
|
|
676
800
|
if (rest.includes("--help") || rest.includes("-h")) {
|
|
677
801
|
process.stdout.write([
|
|
678
|
-
"df gate-push —
|
|
802
|
+
"df gate-push — gate a push on the local-critic verdict.",
|
|
679
803
|
"",
|
|
680
804
|
"Usage:",
|
|
681
|
-
" df gate-push [--profile NAME]
|
|
682
|
-
" df gate-push --
|
|
805
|
+
" df gate-push [--profile NAME] # local pre-push",
|
|
806
|
+
" df gate-push --full-range [--profile NAME] # legacy: gate every commit",
|
|
807
|
+
" df gate-push --commit SHA --ci [--profile NAME] # CI replay (single commit)",
|
|
808
|
+
"",
|
|
809
|
+
"Designed for .husky/pre-push. Reads git's pre-push protocol on stdin.",
|
|
810
|
+
"",
|
|
811
|
+
"Default mode (Cycle 13 — dark-factory-platform#149):",
|
|
812
|
+
" Gates ONLY the HEAD (final) commit of each push update. Intermediate",
|
|
813
|
+
" commits' per-SHA artifacts at .git/agent-reviews/<sha>.json are still",
|
|
814
|
+
" written (iteration audit), but they DO NOT influence the gate.",
|
|
815
|
+
" Inspect them with: `df findings --range <base>..HEAD`.",
|
|
683
816
|
"",
|
|
684
|
-
"
|
|
685
|
-
"
|
|
686
|
-
"
|
|
687
|
-
"
|
|
817
|
+
"Legacy mode — opt in via `--full-range` OR `DF_GATE_FULL_RANGE=1`:",
|
|
818
|
+
" Gates EVERY commit in the push range; any single commit's blocker",
|
|
819
|
+
" blocks the push. Use for forensic replay or per-commit deploy-log",
|
|
820
|
+
" audit. Note: this was the implicit default before Cycle 13 and is",
|
|
821
|
+
" what produced the find-fix-new-commit termination failure.",
|
|
822
|
+
"",
|
|
823
|
+
"Soundness caveat (default mode):",
|
|
824
|
+
" Each per-SHA artifact reviews `parent..commit` only, NOT `base..tip`.",
|
|
825
|
+
" HEAD's APPROVED verdict therefore proves the LAST incremental change",
|
|
826
|
+
" is safe; it does NOT prove the cumulative `base..tip` diff is safe.",
|
|
827
|
+
" For cumulative-state evidence either pass `--full-range` (or set",
|
|
828
|
+
" `DF_GATE_FULL_RANGE=1`) for per-commit gating, or rely on the CI",
|
|
829
|
+
" cold-path agent-critic workflow (which reviews the full PR diff).",
|
|
830
|
+
"",
|
|
831
|
+
"Exit code:",
|
|
832
|
+
" 1 if the gating verdict (HEAD-only or full-range, per mode) blocks.",
|
|
833
|
+
" 0 otherwise.",
|
|
688
834
|
"",
|
|
689
835
|
"Bypass:",
|
|
690
836
|
" AGENT_REVIEW_BYPASS=\"<reason>\" git push # logged to _runs.ndjson",
|
|
@@ -723,6 +869,7 @@ async function cmdGatePush(rest) {
|
|
|
723
869
|
process.stdout.write(`-- ${sha.slice(0, 12)}\n${summarizeGate(result)}\n`);
|
|
724
870
|
return result.blocked ? 1 : 0;
|
|
725
871
|
}
|
|
872
|
+
const fullRange = isFullRangeRequested(flags);
|
|
726
873
|
const stdin = await readStdinUtf8FromTtyOrStream();
|
|
727
874
|
const updates = parsePrePushUpdates(stdin);
|
|
728
875
|
if (updates.length === 0) {
|
|
@@ -736,18 +883,45 @@ async function cmdGatePush(rest) {
|
|
|
736
883
|
const commits = await commitsForPushUpdate(update);
|
|
737
884
|
if (commits.length === 0)
|
|
738
885
|
continue;
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
886
|
+
if (fullRange) {
|
|
887
|
+
// Legacy mode — gate every commit in the range. Pre-Cycle-13
|
|
888
|
+
// behavior, kept for forensic replay and per-commit audit
|
|
889
|
+
// contexts (e.g. production-deploy push where each commit is
|
|
890
|
+
// independently reviewed in the deploy log).
|
|
891
|
+
process.stdout.write(`GATE MODE: full-range (${commits.length} commits) — ${update.localRef} -> ${update.remoteRef}\n`);
|
|
892
|
+
for (const sha of commits) {
|
|
893
|
+
const result = await runCommitGate({
|
|
894
|
+
loaded,
|
|
895
|
+
commit: sha,
|
|
896
|
+
telemetry: sink,
|
|
897
|
+
profileName,
|
|
898
|
+
});
|
|
899
|
+
process.stdout.write(`-- ${sha.slice(0, 12)}\n${summarizeGate(result)}\n`);
|
|
900
|
+
if (result.blocked)
|
|
901
|
+
blockedAny = true;
|
|
902
|
+
}
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
// Default mode (Cycle 13) — final-commit-only. The last commit in
|
|
906
|
+
// the range (`commitsForPushUpdate` returns the rev-list reverse,
|
|
907
|
+
// so HEAD is the last element) is the only one whose verdict
|
|
908
|
+
// gates the push. Intermediate commits' artifacts are iteration
|
|
909
|
+
// receipts; inspect them with `df findings --range`.
|
|
910
|
+
const headSha = commits[commits.length - 1] ?? "";
|
|
911
|
+
process.stdout.write(`GATE MODE: final-commit-only (HEAD=${headSha.slice(0, 12)}) — ${update.localRef} -> ${update.remoteRef}\n`);
|
|
912
|
+
if (commits.length > 1) {
|
|
913
|
+
process.stdout.write(` intermediate commits (${commits.length - 1}) are iteration receipts; inspect with: df findings --range ${update.remoteRef === "" ? "<base>" : `${update.remoteSha.slice(0, 12)}..${headSha.slice(0, 12)}`}\n`);
|
|
914
|
+
process.stdout.write(` soundness caveat: HEAD's verdict covers parent..HEAD only, NOT base..HEAD; use --full-range (or the CI agent-critic on the full PR diff) when cumulative-state evidence is required.\n`);
|
|
750
915
|
}
|
|
916
|
+
const result = await runCommitGate({
|
|
917
|
+
loaded,
|
|
918
|
+
commit: headSha,
|
|
919
|
+
telemetry: sink,
|
|
920
|
+
profileName,
|
|
921
|
+
});
|
|
922
|
+
process.stdout.write(`-- ${headSha.slice(0, 12)}\n${summarizeGate(result)}\n`);
|
|
923
|
+
if (result.blocked)
|
|
924
|
+
blockedAny = true;
|
|
751
925
|
}
|
|
752
926
|
return blockedAny ? 1 : 0;
|
|
753
927
|
}
|
|
@@ -758,11 +932,18 @@ async function cmdDoctor(rest) {
|
|
|
758
932
|
"df doctor — verify the environment for hook-facing critic invocation.",
|
|
759
933
|
"",
|
|
760
934
|
"Usage:",
|
|
761
|
-
" df doctor [--profile NAME]",
|
|
935
|
+
" df doctor [--profile NAME] [--json]",
|
|
762
936
|
"",
|
|
763
937
|
"Checks: node version, hooks dir, hook executable, core.hooksPath,",
|
|
764
|
-
"artifact dir, doppler bootstrap, per-adapter
|
|
765
|
-
"auth lives here).",
|
|
938
|
+
"artifact dir, doppler bootstrap, cloud-env detection, per-adapter",
|
|
939
|
+
"doctor() (subscription auth lives here; skipped in cloud envs).",
|
|
940
|
+
"",
|
|
941
|
+
"Flags:",
|
|
942
|
+
" --json Emit a machine-readable JSON",
|
|
943
|
+
" report on stdout instead of the",
|
|
944
|
+
" human-readable INFO/OK/FAIL lines",
|
|
945
|
+
" (for consumer-side pre-push hooks",
|
|
946
|
+
" that fail-fast on auth_pending).",
|
|
766
947
|
"",
|
|
767
948
|
"Environment:",
|
|
768
949
|
" AGENT_REVIEW_PROFILE=<name> Profile to validate (default: local)",
|
|
@@ -770,6 +951,12 @@ async function cmdDoctor(rest) {
|
|
|
770
951
|
" DF_DOCTOR_SKIP_HOOKS=1 Skip git-core-hookspath check",
|
|
771
952
|
" DF_DOCTOR_SKIP_DOPPLER=1 Skip doppler-cli-on-path check",
|
|
772
953
|
"",
|
|
954
|
+
"Cloud-env markers (any-of triggers subscription-auth skip):",
|
|
955
|
+
" CODESPACES=true GitHub Codespaces",
|
|
956
|
+
" REMOTE_CONTAINERS=true VS Code Dev Containers",
|
|
957
|
+
" CLAUDE_CODE_SANDBOX=true Claude Code web sandbox",
|
|
958
|
+
" DEVCONTAINER=true generic devcontainer images",
|
|
959
|
+
"",
|
|
773
960
|
].join("\n"));
|
|
774
961
|
return 0;
|
|
775
962
|
}
|
|
@@ -800,16 +987,46 @@ async function cmdDoctor(rest) {
|
|
|
800
987
|
profileName,
|
|
801
988
|
perCriticChecks: checks,
|
|
802
989
|
});
|
|
990
|
+
const cloudEnv = detectCloudEnv();
|
|
991
|
+
const allOk = checks.every((c) => c.passed || c.optional);
|
|
992
|
+
// --json — machine-readable output for consumer-side pre-push hooks
|
|
993
|
+
// (DFP issue #56). Shape is stable and documented in
|
|
994
|
+
// packages/schemas/src/index.ts (DoctorReport). Exit code semantics
|
|
995
|
+
// are the same as the human path: 0 = all required checks passed,
|
|
996
|
+
// 1 = at least one required check failed.
|
|
997
|
+
if (flags["json"]) {
|
|
998
|
+
const report = {
|
|
999
|
+
version: 1,
|
|
1000
|
+
schema: "df-doctor-report-v1",
|
|
1001
|
+
triage: { state: triage.state, line: triage.line },
|
|
1002
|
+
cloudEnv: {
|
|
1003
|
+
detected: cloudEnv.detected,
|
|
1004
|
+
markers: cloudEnv.markers,
|
|
1005
|
+
},
|
|
1006
|
+
// `profile` is part of the stable field set; `JSON.stringify`
|
|
1007
|
+
// omits `undefined`, so we default explicitly here even though
|
|
1008
|
+
// `resolveProfile` already returns `"local"` on the no-flag /
|
|
1009
|
+
// no-env path. Belt-and-braces — keeps the contract intact if the
|
|
1010
|
+
// resolver signature ever loosens.
|
|
1011
|
+
profile: profileName || "local",
|
|
1012
|
+
ok: allOk,
|
|
1013
|
+
checks,
|
|
1014
|
+
};
|
|
1015
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
1016
|
+
return allOk ? 0 : 1;
|
|
1017
|
+
}
|
|
803
1018
|
process.stdout.write(`${triage.line}\n`);
|
|
804
|
-
let allOk = true;
|
|
805
1019
|
for (const c of checks) {
|
|
806
|
-
const label = c.passed ? "OK" : c.optional ? "INFO" : "FAIL";
|
|
1020
|
+
const label = c.passed ? (c.optional ? "INFO" : "OK") : c.optional ? "INFO" : "FAIL";
|
|
807
1021
|
process.stdout.write(`[${label}] ${c.name}: ${c.detail}\n`);
|
|
808
1022
|
if (!c.passed && c.remediation) {
|
|
809
1023
|
process.stdout.write(` fix: ${c.remediation}\n`);
|
|
810
1024
|
}
|
|
811
|
-
if (
|
|
812
|
-
|
|
1025
|
+
else if (c.passed && c.optional && c.remediation) {
|
|
1026
|
+
// INFO-with-remediation surfaces the cloud-env bypass hint loudly
|
|
1027
|
+
// even though the check itself "passed" (it's informational).
|
|
1028
|
+
process.stdout.write(` note: ${c.remediation}\n`);
|
|
1029
|
+
}
|
|
813
1030
|
}
|
|
814
1031
|
return allOk ? 0 : 1;
|
|
815
1032
|
}
|
|
@@ -1500,7 +1717,8 @@ async function main(argv) {
|
|
|
1500
1717
|
!PHASE_G_SUBCOMMANDS.has(sub0) &&
|
|
1501
1718
|
!CYCLE12_SUBCOMMANDS.has(sub0) &&
|
|
1502
1719
|
!CYCLE11_SUBCOMMANDS.has(sub0) &&
|
|
1503
|
-
!SHOW_STATUS_SUBCOMMANDS.has(sub0)
|
|
1720
|
+
!SHOW_STATUS_SUBCOMMANDS.has(sub0) &&
|
|
1721
|
+
!SKILLS_SUBCOMMANDS.has(sub0)) {
|
|
1504
1722
|
printHelp(meta);
|
|
1505
1723
|
return 0;
|
|
1506
1724
|
}
|
|
@@ -1585,12 +1803,49 @@ async function main(argv) {
|
|
|
1585
1803
|
stderr: (s) => process.stderr.write(s),
|
|
1586
1804
|
});
|
|
1587
1805
|
}
|
|
1806
|
+
// Cycle 13 (dark-factory-platform#149) — `df findings --range` audit
|
|
1807
|
+
// surface for the iteration-receipt artifacts the new default
|
|
1808
|
+
// final-commit-only `df gate-push` semantic intentionally leaves
|
|
1809
|
+
// un-gated. NOT a gate; opt-in inspection only.
|
|
1810
|
+
if (sub === "findings") {
|
|
1811
|
+
return await cmdFindings(rest, {
|
|
1812
|
+
stdout: (s) => process.stdout.write(s),
|
|
1813
|
+
stderr: (s) => process.stderr.write(s),
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1816
|
+
// DFP #192 — bundled-skill installer surface. The subcommand fans out
|
|
1817
|
+
// into `install/list` inside cmdSkills, mirroring the `df flow` pattern.
|
|
1818
|
+
if (sub === "skills") {
|
|
1819
|
+
return await cmdSkills(rest);
|
|
1820
|
+
}
|
|
1588
1821
|
return notImplemented(sub);
|
|
1589
1822
|
}
|
|
1590
|
-
main(
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1823
|
+
// Only run main() when this module is the program entry point.
|
|
1824
|
+
// Tests and other modules can `import` cli.ts to reuse helpers
|
|
1825
|
+
// (e.g. `resolveProductionSelfConsistencyProbe`) without triggering
|
|
1826
|
+
// `main(process.argv)` as a side-effect of the import. The realpath
|
|
1827
|
+
// dance handles symlinked installs (npm bin shims often symlink
|
|
1828
|
+
// `dist/cli.js` into `node_modules/.bin/df`). Same posture as
|
|
1829
|
+
// sage-cli (see commit f0f945e). Cursor finding (cli.ts:560) tests
|
|
1830
|
+
// reach `resolveProductionSelfConsistencyProbe` by importing this
|
|
1831
|
+
// module; without the guard they'd trigger the help path on import.
|
|
1832
|
+
function isInvokedAsMain() {
|
|
1833
|
+
const entry = process.argv[1];
|
|
1834
|
+
if (!entry)
|
|
1835
|
+
return false;
|
|
1836
|
+
try {
|
|
1837
|
+
return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));
|
|
1838
|
+
}
|
|
1839
|
+
catch {
|
|
1840
|
+
return false;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
if (isInvokedAsMain()) {
|
|
1844
|
+
main(process.argv).then((code) => {
|
|
1845
|
+
process.exitCode = code;
|
|
1846
|
+
}, (err) => {
|
|
1847
|
+
process.stderr.write(`df: fatal: ${err.message}\n`);
|
|
1848
|
+
process.exitCode = 1;
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1596
1851
|
//# sourceMappingURL=cli.js.map
|