@deftai/directive 0.109.0 → 0.110.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/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +1 -0
- package/dist/triage-classify.d.ts +2 -2
- package/dist/triage-classify.js +4 -43
- package/dist/triage-strip-withdrawn.d.ts +21 -0
- package/dist/triage-strip-withdrawn.js +102 -0
- package/dist/verify-forward-coverage.js +4 -3
- package/package.json +3 -3
package/dist/dispatch.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface DispatchIo {
|
|
|
10
10
|
writeErr: (text: string) => void;
|
|
11
11
|
}
|
|
12
12
|
/** CLI modules in packages/cli/src (excluding parity harnesses and bin/index). */
|
|
13
|
-
export declare const CLI_MODULE_VERBS: readonly ["agents-refresh", "cache", "check", "capacity-backfill", "capacity-show", "codebase-default-extractor", "codebase-map", "codebase-map-fresh", "codebase-projection-registry", "codebase-provider", "doctor", "install-upgrade", "install-uninstall", "migrate-preflight", "migrate-xbrief", "migrate-category-b", "framework-check-updates", "hook-dispatch", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "coverage-hotspots", "policy", "authz", "escalation-cli", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "pr-watch", "pr-finish-loop", "directive-finish-loop", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "scope-record-approved-scope", "scm-sync-default", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "occupancy-steal", "occupancy-release", "occupancy-heartbeat", "occupancy-grant", "plan-sequence", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "triage-evaluate", "triage-help", "triage-queue", "triage-reconcile", "triage-refresh", "triage-scope", "triage-scope-drift", "triage-smoketest", "triage-subscribe", "triage-summary", "triage-welcome", "ts-check-lane", "vbrief-activate", "vbrief-build", "vbrief-preflight", "vbrief-reconcile", "vbrief-validate", "vbrief-validation", "xbrief-create", "xbrief-verify", "verify-branch", "verify-encoding", "verify-forward-coverage", "verify-test-boundary", "verify-scope-provenance", "verify-consumer-check-contract", "verify-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-biome-config", "verify-bridge-drift", "verify-capacity", "verify-contained-writes", "verify-telemetry-coverage", "verify-content-manifest", "verify-deposit-closure", "verify-consumer-hard-stops", "verify-closing-keywords", "verify-skill-external-fetch-gate", "verify-semantic-single-source", "verify-contract-drift", "verify-cursor-tier1", "verify-openclaw-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-plan-sequence", "verify-stubs", "verify-xbrief-drift", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-l4-owner", "verify-subagent-alive", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "verify-pr-closeout-attestable", "verify-lifecycle-visible", "verify-completed-tracked", "verify-completed-write-guard", "verify-literal-ac", "verify-ac", "verify-agents-md-budget", "verify-agents-md-advisory", "verify-eval-health-relocation", "verify-eval-triggers-relocation", "eval-health", "eval-run", "eval-report", "eval-triggers"];
|
|
13
|
+
export declare const CLI_MODULE_VERBS: readonly ["agents-refresh", "cache", "check", "capacity-backfill", "capacity-show", "codebase-default-extractor", "codebase-map", "codebase-map-fresh", "codebase-projection-registry", "codebase-provider", "doctor", "install-upgrade", "install-uninstall", "migrate-preflight", "migrate-xbrief", "migrate-category-b", "framework-check-updates", "hook-dispatch", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "coverage-hotspots", "policy", "authz", "escalation-cli", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "pr-watch", "pr-finish-loop", "directive-finish-loop", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "scope-record-approved-scope", "scm-sync-default", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "occupancy-steal", "occupancy-release", "occupancy-heartbeat", "occupancy-grant", "plan-sequence", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "triage-strip-withdrawn", "triage-evaluate", "triage-help", "triage-queue", "triage-reconcile", "triage-refresh", "triage-scope", "triage-scope-drift", "triage-smoketest", "triage-subscribe", "triage-summary", "triage-welcome", "ts-check-lane", "vbrief-activate", "vbrief-build", "vbrief-preflight", "vbrief-reconcile", "vbrief-validate", "vbrief-validation", "xbrief-create", "xbrief-verify", "verify-branch", "verify-encoding", "verify-forward-coverage", "verify-test-boundary", "verify-scope-provenance", "verify-consumer-check-contract", "verify-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-biome-config", "verify-bridge-drift", "verify-capacity", "verify-contained-writes", "verify-telemetry-coverage", "verify-content-manifest", "verify-deposit-closure", "verify-consumer-hard-stops", "verify-closing-keywords", "verify-skill-external-fetch-gate", "verify-semantic-single-source", "verify-contract-drift", "verify-cursor-tier1", "verify-openclaw-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-plan-sequence", "verify-stubs", "verify-xbrief-drift", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-l4-owner", "verify-subagent-alive", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "verify-pr-closeout-attestable", "verify-lifecycle-visible", "verify-completed-tracked", "verify-completed-write-guard", "verify-literal-ac", "verify-ac", "verify-agents-md-budget", "verify-agents-md-advisory", "verify-eval-health-relocation", "verify-eval-triggers-relocation", "eval-health", "eval-run", "eval-report", "eval-triggers"];
|
|
14
14
|
/** Core-only CLI entrypoints without a packages/cli wrapper. */
|
|
15
15
|
export declare const CORE_MODULE_VERBS: readonly ["scm", "scm-readiness", "github-auth-modes", "github-body", "issue-emit", "issue-ingest", "issue-sync-from-xbrief", "reconcile-issues", "swarm-launch", "swarm-complete-cohort", "swarm-finalize-cohort", "swarm-pre-dispatch", "swarm-readiness", "swarm-routing-verify", "swarm-routing-set", "swarm-verify-review-clean", "swarm-worktrees", "framework-commands", "pack-render", "packs-slice", "prd-render", "export-spec", "project-render", "roadmap-render", "rule-map", "spec-render", "spec-validate", "code-structure-validate", "pack-migrate-skills", "pack-migrate-rules", "pack-migrate-strategies", "pack-migrate-patterns", "pack-migrate-swarm-spec", "policy-set", "setup-ghx", "scope-undo", "scope-demote", "scope-decompose", "changelog-resolve-unreleased", "architecture-preflight-sor", "feedback-file", "value-readback", "product-signal", "freshness-report", "decision-write", "decision-list"];
|
|
16
16
|
/** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
|
package/dist/dispatch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import type { ResolveAuthenticatedLogin } from "@deftai/directive-core/dist/triage/author-filter.js";
|
|
3
3
|
import type { LabelClient } from "@deftai/directive-core/dist/vbrief-reconcile/types.js";
|
|
4
4
|
export interface ParsedArgs {
|
|
5
5
|
projectRoot: string;
|
|
@@ -41,5 +41,5 @@ export interface RunOptions {
|
|
|
41
41
|
readonly resolveAuthenticatedLogin?: ResolveAuthenticatedLogin;
|
|
42
42
|
}
|
|
43
43
|
/** Run the CLI and return the process exit code. */
|
|
44
|
-
export declare function run(argv: string[],
|
|
44
|
+
export declare function run(argv: string[], _options?: RunOptions): number;
|
|
45
45
|
//# sourceMappingURL=triage-classify.d.ts.map
|
package/dist/triage-classify.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { statSync } from "node:fs";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import {
|
|
6
|
-
import { labelMirrorOutcomeToJson, listProject, mirrorDiscoveryStateExists, mirrorLabels, recordMirrorDiscoveryAcked, recordMirrorDiscoverySuccessfulDryRun, renderLabelMirrorReport, validateProject, } from "@deftai/directive-core/dist/triage/classify/index.js";
|
|
5
|
+
import { CLASSIFY_MIRROR_WITHDRAWN_EXIT_CODE, CLASSIFY_MIRROR_WITHDRAWN_MESSAGE, listProject, mirrorDiscoveryStateExists, recordMirrorDiscoveryAcked, validateProject, } from "@deftai/directive-core/dist/triage/classify/index.js";
|
|
7
6
|
function parseNonNegInt(raw, flag) {
|
|
8
7
|
const n = Number.parseInt(raw, 10);
|
|
9
8
|
if (!Number.isFinite(n) || String(n) !== raw.trim() || n < 0) {
|
|
@@ -223,7 +222,7 @@ export function parseArgs(argv) {
|
|
|
223
222
|
return parsed;
|
|
224
223
|
}
|
|
225
224
|
/** Run the CLI and return the process exit code. */
|
|
226
|
-
export function run(argv,
|
|
225
|
+
export function run(argv, _options = {}) {
|
|
227
226
|
const args = parseArgs(argv);
|
|
228
227
|
if (args.error !== undefined) {
|
|
229
228
|
process.stderr.write(`ERR: ${args.error}\n`);
|
|
@@ -275,46 +274,8 @@ export function run(argv, options = {}) {
|
|
|
275
274
|
}
|
|
276
275
|
}
|
|
277
276
|
if (args.doMirror) {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
// never silent no-op that would plan/apply the full open cache (#3129 Greptile P1).
|
|
281
|
-
if (args.author !== null) {
|
|
282
|
-
const resolved = resolveAuthorFilter(args.author, options.resolveAuthenticatedLogin);
|
|
283
|
-
if (resolved.error !== undefined || resolved.filter === undefined) {
|
|
284
|
-
process.stderr.write(`ERR: ${resolved.error ?? "argument --author: expected a non-empty login (or @me)"}\n`);
|
|
285
|
-
return 2;
|
|
286
|
-
}
|
|
287
|
-
authorFilter = resolved.filter;
|
|
288
|
-
}
|
|
289
|
-
const mirrorOpts = {
|
|
290
|
-
dryRun: !args.apply,
|
|
291
|
-
repo: args.repo,
|
|
292
|
-
allowCrossRepo: args.allowCrossRepo,
|
|
293
|
-
includeClosed: args.includeClosed,
|
|
294
|
-
reEnrich: args.reEnrich,
|
|
295
|
-
...(authorFilter !== null && authorFilter !== undefined ? { authorFilter } : {}),
|
|
296
|
-
...(args.batchSize !== null ? { batchSize: args.batchSize } : {}),
|
|
297
|
-
...(args.delayMs !== null ? { delayMs: args.delayMs } : {}),
|
|
298
|
-
...(args.sampleLimit !== null ? { sampleLimit: args.sampleLimit } : {}),
|
|
299
|
-
...(options.labelClient !== undefined ? { client: options.labelClient } : {}),
|
|
300
|
-
};
|
|
301
|
-
const [code, outcome] = mirrorLabels(projectRoot, mirrorOpts);
|
|
302
|
-
if (args.json) {
|
|
303
|
-
process.stdout.write(`${JSON.stringify(labelMirrorOutcomeToJson(outcome), null, 2)}\n`);
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
process.stdout.write(renderLabelMirrorReport(outcome));
|
|
307
|
-
}
|
|
308
|
-
// #3124: first successful --mirror dry-run hides the operator discovery tip.
|
|
309
|
-
if (code === 0 && outcome.dry_run) {
|
|
310
|
-
try {
|
|
311
|
-
recordMirrorDiscoverySuccessfulDryRun(projectRoot);
|
|
312
|
-
}
|
|
313
|
-
catch {
|
|
314
|
-
// Advisory tip state — never change the classify exit code.
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
return code;
|
|
277
|
+
process.stderr.write(`${CLASSIFY_MIRROR_WITHDRAWN_MESSAGE}\n`);
|
|
278
|
+
return CLASSIFY_MIRROR_WITHDRAWN_EXIT_CODE;
|
|
318
279
|
}
|
|
319
280
|
// Default / --list: print effective rules
|
|
320
281
|
process.stdout.write(listProject(projectRoot));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { type ListWithdrawnChipIssues } from "@deftai/directive-core/dist/triage/classify/withdraw.js";
|
|
3
|
+
import type { LabelClient } from "@deftai/directive-core/dist/vbrief-reconcile/types.js";
|
|
4
|
+
export interface StripParsedArgs {
|
|
5
|
+
projectRoot: string;
|
|
6
|
+
apply: boolean;
|
|
7
|
+
json: boolean;
|
|
8
|
+
emitDigest: boolean;
|
|
9
|
+
repo: string | null;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function parseStripArgs(argv: string[]): StripParsedArgs;
|
|
13
|
+
export interface StripRunOptions {
|
|
14
|
+
readonly labelClient?: LabelClient;
|
|
15
|
+
readonly resolveDefaultRepo?: () => string | null;
|
|
16
|
+
readonly listIssues?: ListWithdrawnChipIssues;
|
|
17
|
+
}
|
|
18
|
+
export declare function runStripWithdrawn(argv: string[], options?: StripRunOptions): number;
|
|
19
|
+
/** Dispatch handler name (`CLI_MODULE_VERBS` looks for `run`). */
|
|
20
|
+
export declare const run: typeof runStripWithdrawn;
|
|
21
|
+
//# sourceMappingURL=triage-strip-withdrawn.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { resolveRepoFromGitOrigin } from "@deftai/directive-core/dist/scm/design-critique-chip.js";
|
|
4
|
+
import { classifyIssue, resolveClassifyRules, resolveHoldMarkers, } from "@deftai/directive-core/dist/triage/classify/index.js";
|
|
5
|
+
import { CLASSIFY_MIRROR_WITHDRAWN_MESSAGE, stripWithdrawnChips, } from "@deftai/directive-core/dist/triage/classify/withdraw.js";
|
|
6
|
+
export function parseStripArgs(argv) {
|
|
7
|
+
const parsed = {
|
|
8
|
+
projectRoot: ".",
|
|
9
|
+
apply: false,
|
|
10
|
+
json: false,
|
|
11
|
+
emitDigest: false,
|
|
12
|
+
repo: null,
|
|
13
|
+
};
|
|
14
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
15
|
+
const arg = argv[i];
|
|
16
|
+
if (arg === "--apply") {
|
|
17
|
+
parsed.apply = true;
|
|
18
|
+
}
|
|
19
|
+
else if (arg === "--json") {
|
|
20
|
+
parsed.json = true;
|
|
21
|
+
}
|
|
22
|
+
else if (arg === "--emit-digest") {
|
|
23
|
+
parsed.emitDigest = true;
|
|
24
|
+
}
|
|
25
|
+
else if (arg === "--repo") {
|
|
26
|
+
const value = argv[i + 1];
|
|
27
|
+
if (value === undefined) {
|
|
28
|
+
return { ...parsed, error: "argument --repo: expected one argument" };
|
|
29
|
+
}
|
|
30
|
+
parsed.repo = value;
|
|
31
|
+
i += 1;
|
|
32
|
+
}
|
|
33
|
+
else if (arg?.startsWith("--repo=")) {
|
|
34
|
+
parsed.repo = arg.slice("--repo=".length);
|
|
35
|
+
}
|
|
36
|
+
else if (arg === "--project-root") {
|
|
37
|
+
const value = argv[i + 1];
|
|
38
|
+
if (value === undefined) {
|
|
39
|
+
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
40
|
+
}
|
|
41
|
+
parsed.projectRoot = value;
|
|
42
|
+
i += 1;
|
|
43
|
+
}
|
|
44
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
45
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
46
|
+
}
|
|
47
|
+
else if (arg === "--help" || arg === "-h") {
|
|
48
|
+
return parsed;
|
|
49
|
+
}
|
|
50
|
+
else if (arg === "--") {
|
|
51
|
+
}
|
|
52
|
+
else if (arg?.startsWith("-")) {
|
|
53
|
+
return { ...parsed, error: `unrecognized arguments: ${arg}` };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
export function runStripWithdrawn(argv, options = {}) {
|
|
59
|
+
const args = parseStripArgs(argv);
|
|
60
|
+
if (args.error !== undefined) {
|
|
61
|
+
process.stderr.write(`ERR: ${args.error}\n`);
|
|
62
|
+
return 2;
|
|
63
|
+
}
|
|
64
|
+
const repo = args.repo ?? (options.resolveDefaultRepo ?? resolveRepoFromGitOrigin)();
|
|
65
|
+
if (repo === null || repo.length === 0) {
|
|
66
|
+
process.stderr.write("ERR: missing --repo OWNER/NAME (could not resolve from git origin)\n");
|
|
67
|
+
return 2;
|
|
68
|
+
}
|
|
69
|
+
const rules = resolveClassifyRules({ projectRoot: args.projectRoot });
|
|
70
|
+
const holdMarkers = resolveHoldMarkers({ projectRoot: args.projectRoot });
|
|
71
|
+
const [code, outcome] = stripWithdrawnChips({
|
|
72
|
+
repo,
|
|
73
|
+
dryRun: !args.apply,
|
|
74
|
+
emitDigest: args.emitDigest,
|
|
75
|
+
classify: args.emitDigest
|
|
76
|
+
? (issue, opts) => classifyIssue(issue, {
|
|
77
|
+
rules: opts?.rules ?? rules,
|
|
78
|
+
holdMarkers: opts?.holdMarkers ?? holdMarkers,
|
|
79
|
+
})
|
|
80
|
+
: undefined,
|
|
81
|
+
rules,
|
|
82
|
+
holdMarkers,
|
|
83
|
+
...(options.labelClient !== undefined ? { client: options.labelClient } : {}),
|
|
84
|
+
...(options.listIssues !== undefined ? { listIssues: options.listIssues } : {}),
|
|
85
|
+
});
|
|
86
|
+
if (args.json) {
|
|
87
|
+
process.stdout.write(`${JSON.stringify(outcome, null, 2)}\n`);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
process.stdout.write(`strip-withdrawn-chips repo=${outcome.repo} dry-run=${outcome.dry_run} ` +
|
|
91
|
+
`scanned=${outcome.scanned} planned=${outcome.planned} applied=${outcome.applied} ` +
|
|
92
|
+
`unchanged=${outcome.unchanged} errors=${outcome.errors}\n`);
|
|
93
|
+
process.stdout.write(`${CLASSIFY_MIRROR_WITHDRAWN_MESSAGE}\n`);
|
|
94
|
+
}
|
|
95
|
+
return code;
|
|
96
|
+
}
|
|
97
|
+
/** Dispatch handler name (`CLI_MODULE_VERBS` looks for `run`). */
|
|
98
|
+
export const run = runStripWithdrawn;
|
|
99
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
100
|
+
process.exit(runStripWithdrawn(process.argv.slice(2)));
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=triage-strip-withdrawn.js.map
|
|
@@ -5,9 +5,10 @@ import { evaluateForwardCoverage } from "@deftai/directive-core";
|
|
|
5
5
|
const HELP_TEXT = "Usage: verify-forward-coverage [--project-root <path>] [--staged|--head] [--allow-list <path>]\n" +
|
|
6
6
|
" [--coverage-dir <path>] [--coverage-report <path>]\n" +
|
|
7
7
|
" [--enforce] [--quiet]\n" +
|
|
8
|
-
" Fail-closed new-source-file existence (#1310) plus warn-first diff coverage of\n" +
|
|
9
|
-
" added/modified branches (#3514).
|
|
10
|
-
"
|
|
8
|
+
" Fail-closed new-source-file existence (#1310 / #4009) plus warn-first diff coverage of\n" +
|
|
9
|
+
" added/modified branches (#3514). Existence correspondence is path-relative and\n" +
|
|
10
|
+
" uses the test-boundary policy (#3145); pre-existing tests count. The 90% per-diff\n" +
|
|
11
|
+
" threshold is not the 75 global floor. Missing coverage reports skip the diff half.\n" +
|
|
11
12
|
" --enforce: fail closed when uncovered changed branches are below 90%.\n";
|
|
12
13
|
function takeValue(argv, i, flag) {
|
|
13
14
|
const value = argv[i + 1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.110.0",
|
|
4
4
|
"description": "Directive CLI — npm install path for the Deft Directive framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://deftai.github.io/directive/",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"provenance": true
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@deftai/directive-core": "^0.
|
|
38
|
-
"@deftai/directive-content": "^0.
|
|
37
|
+
"@deftai/directive-core": "^0.110.0",
|
|
38
|
+
"@deftai/directive-content": "^0.110.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -b"
|