@deftai/directive-core 0.69.0 → 0.71.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/branch/evaluate.js +7 -0
- package/dist/deposit/contain.d.ts +41 -0
- package/dist/deposit/contain.js +113 -0
- package/dist/deposit/copy-tree.js +8 -2
- package/dist/doctor/checks.d.ts +11 -0
- package/dist/doctor/checks.js +75 -2
- package/dist/doctor/doctor-state.js +2 -2
- package/dist/doctor/main.js +54 -1
- package/dist/doctor/manifest.d.ts +20 -0
- package/dist/doctor/manifest.js +22 -0
- package/dist/doctor/types.d.ts +8 -0
- package/dist/eval/crud-telemetry.d.ts +59 -0
- package/dist/eval/crud-telemetry.js +307 -0
- package/dist/eval/health.d.ts +52 -0
- package/dist/eval/health.js +240 -0
- package/dist/eval/readback.d.ts +38 -0
- package/dist/eval/readback.js +209 -0
- package/dist/eval/report.d.ts +53 -0
- package/dist/eval/report.js +161 -0
- package/dist/eval/run.d.ts +79 -0
- package/dist/eval/run.js +309 -0
- package/dist/events/attribution-constants.d.ts +13 -0
- package/dist/events/attribution-constants.js +18 -0
- package/dist/events/attribution-ledger.d.ts +43 -0
- package/dist/events/attribution-ledger.js +61 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/init-deposit/gitignore.js +5 -5
- package/dist/init-deposit/init-deposit.js +6 -0
- package/dist/init-deposit/refresh.js +5 -0
- package/dist/intake/issue-ingest.d.ts +11 -0
- package/dist/intake/issue-ingest.js +86 -11
- package/dist/layout/resolve.d.ts +2 -2
- package/dist/layout/resolve.js +2 -2
- package/dist/lifecycle/events.js +2 -0
- package/dist/policy/index.d.ts +2 -1
- package/dist/policy/index.js +15 -2
- package/dist/policy/plan-extensions.d.ts +31 -0
- package/dist/policy/plan-extensions.js +45 -0
- package/dist/policy/value-feedback.d.ts +56 -0
- package/dist/policy/value-feedback.js +284 -0
- package/dist/policy/wip.d.ts +2 -2
- package/dist/policy/wip.js +2 -2
- package/dist/preflight-cache/evaluate.js +4 -3
- package/dist/scope/audit-log.js +3 -3
- package/dist/scope/transition.js +16 -5
- package/dist/session/session-start.js +20 -0
- package/dist/slice/record.js +3 -3
- package/dist/swarm/routing.js +10 -3
- package/dist/triage/actions/candidates-log.d.ts +4 -4
- package/dist/triage/actions/candidates-log.js +4 -7
- package/dist/triage/bootstrap/gitignore.d.ts +7 -3
- package/dist/triage/bootstrap/gitignore.js +67 -37
- package/dist/triage/bootstrap/index.d.ts +1 -1
- package/dist/triage/bootstrap/index.js +4 -3
- package/dist/triage/bulk/index.d.ts +11 -2
- package/dist/triage/bulk/index.js +43 -6
- package/dist/triage/cache-path.d.ts +39 -0
- package/dist/triage/cache-path.js +98 -0
- package/dist/triage/help/registry-data.d.ts +53 -20
- package/dist/triage/help/registry-data.js +104 -20
- package/dist/triage/index.d.ts +2 -0
- package/dist/triage/index.js +2 -0
- package/dist/triage/queue/audit.js +2 -2
- package/dist/triage/queue/cache.js +2 -2
- package/dist/triage/reconcile/reconcile.js +4 -3
- package/dist/triage/scope/cli.d.ts +2 -1
- package/dist/triage/scope/cli.js +30 -6
- package/dist/triage/scope/mutations-core.js +3 -2
- package/dist/triage/scope/mutations.d.ts +10 -0
- package/dist/triage/scope/mutations.js +22 -0
- package/dist/triage/subscribe/index.d.ts +1 -1
- package/dist/triage/subscribe/index.js +4 -3
- package/dist/triage/summary/index.d.ts +2 -2
- package/dist/triage/summary/index.js +4 -3
- package/dist/triage/summary/reconcilable.d.ts +1 -1
- package/dist/triage/summary/reconcilable.js +3 -2
- package/dist/triage/welcome/constants.d.ts +3 -4
- package/dist/triage/welcome/constants.js +3 -4
- package/dist/triage/welcome/index.d.ts +1 -0
- package/dist/triage/welcome/index.js +1 -0
- package/dist/triage/welcome/onboard.d.ts +35 -0
- package/dist/triage/welcome/onboard.js +94 -0
- package/dist/triage/welcome/prior-state.js +3 -2
- package/dist/triage/welcome/summary.js +5 -4
- package/dist/umbrella-current-shape/index.d.ts +25 -1
- package/dist/umbrella-current-shape/index.js +84 -4
- package/dist/value/adoption-emit.d.ts +14 -0
- package/dist/value/adoption-emit.js +67 -0
- package/dist/value/adoption-registry.d.ts +62 -0
- package/dist/value/adoption-registry.js +214 -0
- package/dist/value/feedback-file.d.ts +67 -0
- package/dist/value/feedback-file.js +353 -0
- package/dist/value/friction-emit.d.ts +10 -0
- package/dist/value/friction-emit.js +24 -0
- package/dist/value/readback.d.ts +86 -0
- package/dist/value/readback.js +503 -0
- package/dist/vbrief-build/project-definition-io.d.ts +6 -0
- package/dist/vbrief-build/project-definition-io.js +7 -2
- package/dist/vbrief-validate/decomposition.js +1 -1
- package/dist/vbrief-validate/precutover.js +7 -3
- package/dist/wip-cap/evaluate.js +3 -0
- package/package.json +35 -3
|
@@ -5,7 +5,7 @@ export declare const registryData: {
|
|
|
5
5
|
readonly name: "task triage:summary";
|
|
6
6
|
readonly summary: "One-line state for session-start ritual";
|
|
7
7
|
readonly refs: "(D2 / #1122)";
|
|
8
|
-
readonly description: "Emit the one-line triage state consumed by the session-start ritual. Always exits 0 (status surface, not a gate); appends a JSONL record to vbrief/.
|
|
8
|
+
readonly description: "Emit the one-line triage state consumed by the session-start ritual. Always exits 0 (status surface, not a gate); appends a JSONL record to vbrief/.triage-cache/summary-history.jsonl for observability.";
|
|
9
9
|
readonly usage: "task triage:summary [-- --json] [--no-history]";
|
|
10
10
|
readonly flags: readonly [readonly ["--json", "(off)", "Emit the structured record as JSON instead of the one-liner."], readonly ["--no-history", "(off)", "Suppress the history sidecar append (test-only)."], readonly ["--project-root PATH", "(cwd)", "Project root override (Taskfile threads USER_WORKING_DIR)."]];
|
|
11
11
|
readonly examples: readonly ["task triage:summary", "task triage:summary -- --json | jq"];
|
|
@@ -191,11 +191,11 @@ export declare const registryData: {
|
|
|
191
191
|
readonly "task triage:welcome": {
|
|
192
192
|
readonly name: "task triage:welcome";
|
|
193
193
|
readonly summary: "Single-entry-point upgrade ritual";
|
|
194
|
-
readonly refs: "(N3 / #1143)";
|
|
195
|
-
readonly description: "6-phase onboarding ritual: detect prior state, prompt for subscription scope, run triage:bootstrap, prompt for wipCap, offer WIP relief, print triage:summary. Idempotent on re-run; safe entrypoint for fresh consumers.";
|
|
196
|
-
readonly usage: "task triage:welcome [-- --no-subprocess]";
|
|
197
|
-
readonly flags: readonly [readonly ["--no-subprocess", "(off)", "Dry-mode: don't shell out to sibling tasks."]];
|
|
198
|
-
readonly examples: readonly ["task triage:welcome"];
|
|
194
|
+
readonly refs: "(N3 / #1143, #2295)";
|
|
195
|
+
readonly description: "6-phase onboarding ritual: detect prior state, prompt for subscription scope, run triage:bootstrap, prompt for wipCap, offer WIP relief, print triage:summary. Idempotent on re-run; safe entrypoint for fresh consumers. Pass --onboard for the non-interactive path that applies a triage-scope preset (and optional --wip-cap) without prompting -- the form agents/CI use.";
|
|
196
|
+
readonly usage: "task triage:welcome [-- --onboard [--preset small|mid|mega] [--wip-cap N]] [--no-subprocess]";
|
|
197
|
+
readonly flags: readonly [readonly ["--onboard", "(off)", "Non-interactive onboarding: apply a triage-scope preset (and optional WIP cap) without prompting."], readonly ["--preset small|mid|mega", "small", "Subscription-scope preset applied by --onboard."], readonly ["--wip-cap N", "(policy default)", "Persist an explicit in-flight scope cap during --onboard (positive integer)."], readonly ["--no-subprocess", "(off)", "Dry-mode: don't shell out to sibling tasks."]];
|
|
198
|
+
readonly examples: readonly ["task triage:welcome", "task triage:welcome -- --onboard --preset small"];
|
|
199
199
|
readonly see_also: readonly ["task triage:bootstrap", "task triage:summary", "#1119 / N3"];
|
|
200
200
|
readonly placeholder: false;
|
|
201
201
|
};
|
|
@@ -203,7 +203,7 @@ export declare const registryData: {
|
|
|
203
203
|
readonly name: "task triage:reconcile";
|
|
204
204
|
readonly summary: "Self-heal audit log from on-disk vBRIEFs";
|
|
205
205
|
readonly refs: "(#1468)";
|
|
206
|
-
readonly description: "Idempotent repair verb: derive missing `accept` decisions for proposed/pending/active vBRIEFs that carry an x-vbrief/github-issue reference but have no entry in vbrief/.
|
|
206
|
+
readonly description: "Idempotent repair verb: derive missing `accept` decisions for proposed/pending/active vBRIEFs that carry an x-vbrief/github-issue reference but have no entry in vbrief/.triage-cache/candidates.jsonl. Recovers triage state after the gitignored audit log is reset/lost (#1464) without a full cache re-fetch. Never overrides an existing decision, so a re-run is a no-op.";
|
|
207
207
|
readonly usage: "task triage:reconcile [-- --repo owner/name] [--dry-run] [--json]";
|
|
208
208
|
readonly flags: readonly [readonly ["--repo owner/name", "(ref URI / git remote)", "Fallback repo for refs lacking owner/name."], readonly ["--dry-run", "(off)", "Report what would be restored without writing."], readonly ["--json", "(off)", "Structured JSON output."]];
|
|
209
209
|
readonly examples: readonly ["task triage:reconcile -- --dry-run", "task triage:reconcile -- --repo deftai/directive"];
|
|
@@ -280,7 +280,7 @@ export declare const registryData: {
|
|
|
280
280
|
readonly name: "task triage:subscribe";
|
|
281
281
|
readonly summary: "Add label/milestone/issue to subscription";
|
|
282
282
|
readonly refs: "(D14 / #1133)";
|
|
283
|
-
readonly description: "Subscribe to a label / milestone / issue by appending a rule to plan.policy.triageScope[]. Emits a JSONL audit record to vbrief/.
|
|
283
|
+
readonly description: "Subscribe to a label / milestone / issue by appending a rule to plan.policy.triageScope[]. Emits a JSONL audit record to vbrief/.triage-cache/subscription-history.jsonl.";
|
|
284
284
|
readonly usage: "task triage:subscribe -- (--label=L | --milestone=M | --issue=N)";
|
|
285
285
|
readonly flags: readonly [readonly ["--label L", "(none)", "Subscribe to a label."], readonly ["--milestone M", "(none)", "Subscribe to a milestone."], readonly ["--issue N", "(none)", "Subscribe to a single issue."]];
|
|
286
286
|
readonly examples: readonly ["task triage:subscribe -- --label='area:swarm'", "task triage:subscribe -- --milestone='v0.32.0'"];
|
|
@@ -335,7 +335,7 @@ export declare const registryData: {
|
|
|
335
335
|
readonly name: "task triage:audit-log:rotate";
|
|
336
336
|
readonly summary: "Rotate candidates.jsonl when bounded";
|
|
337
337
|
readonly refs: "(D20, coming)";
|
|
338
|
-
readonly description: "Rotate vbrief/.
|
|
338
|
+
readonly description: "Rotate vbrief/.triage-cache/candidates.jsonl when it exceeds the configured bound. Compacts terminal entries and preserves the open-work tail.";
|
|
339
339
|
readonly usage: "task triage:audit-log:rotate [-- --max-lines N]";
|
|
340
340
|
readonly flags: readonly [readonly ["--max-lines N", "(consumer default)", "Bound at which rotation fires."]];
|
|
341
341
|
readonly examples: readonly ["task triage:audit-log:rotate -- --max-lines 10000"];
|
|
@@ -344,14 +344,47 @@ export declare const registryData: {
|
|
|
344
344
|
};
|
|
345
345
|
readonly "task triage:metrics": {
|
|
346
346
|
readonly name: "task triage:metrics";
|
|
347
|
-
readonly summary: "
|
|
348
|
-
readonly refs: "(
|
|
349
|
-
readonly description: "
|
|
347
|
+
readonly summary: "Attributed-value trend from the events ledger";
|
|
348
|
+
readonly refs: "(#1709)";
|
|
349
|
+
readonly description: "Report value-feedback attribution trends from .deft-cache/events.jsonl: total signal count plus per-class (value, bypass, adoption, friction) and per-event breakdowns over a time window. Alias of the value:show handler. Requires plan.policy.valueFeedback.enabled (default OFF) — exits blocked when disabled; an empty ledger prints a no-signals message. In the maintainer repo, skipped unless DEFT_VALUE_SELF_DOGFOOD=1.";
|
|
350
350
|
readonly usage: "task triage:metrics [-- --window=7d] [--format=text|json]";
|
|
351
|
-
readonly flags: readonly [readonly ["--window WINDOW", "7d", "Time window
|
|
352
|
-
readonly examples: readonly ["task triage:metrics -- --window
|
|
353
|
-
readonly see_also: readonly ["task
|
|
354
|
-
readonly placeholder:
|
|
351
|
+
readonly flags: readonly [readonly ["--window WINDOW", "7d", "Time window (e.g. 7d, 30d, 24h)."], readonly ["--format text|json", "text", "Output shape (json emits the full trend object)."]];
|
|
352
|
+
readonly examples: readonly ["task triage:metrics", "task triage:metrics -- --window=30d --format=json"];
|
|
353
|
+
readonly see_also: readonly ["task policy:show --field=valueFeedback", "task policy:enable-value-feedback -- --confirm", "#1709"];
|
|
354
|
+
readonly placeholder: false;
|
|
355
|
+
};
|
|
356
|
+
readonly "task eval:health": {
|
|
357
|
+
readonly name: "task eval:health";
|
|
358
|
+
readonly summary: "Tier 0 static framework health score";
|
|
359
|
+
readonly refs: "(#1703)";
|
|
360
|
+
readonly description: "Aggregate static self-consistency gates (encoding, links, vBRIEF conformance, AGENTS.md freshness; content-manifest on framework-source trees) into a versioned 0–100 score. Detects contradictory / unsatisfiable gate pairs (#1694). Appends each run to .eval/results/health-history.jsonl. Session start may emit a budgeted [eval] advisory when health degrades.";
|
|
361
|
+
readonly usage: "task eval:health [-- --json] [--no-persist] [--project-root PATH]";
|
|
362
|
+
readonly flags: readonly [readonly ["--json", "(off)", "Emit the structured HealthReport instead of the human summary."], readonly ["--no-persist", "(off)", "Run probes without appending to the health history ledger."], readonly ["--project-root PATH", "(cwd)", "Project root override (Taskfile threads USER_WORKING_DIR)."]];
|
|
363
|
+
readonly examples: readonly ["task eval:health", "task eval:health -- --json"];
|
|
364
|
+
readonly see_also: readonly ["task eval:run", "task eval:report", "#1703"];
|
|
365
|
+
readonly placeholder: false;
|
|
366
|
+
};
|
|
367
|
+
readonly "task eval:run": {
|
|
368
|
+
readonly name: "task eval:run";
|
|
369
|
+
readonly summary: "Tier 2 golden corpus eval for a model";
|
|
370
|
+
readonly refs: "(#1703)";
|
|
371
|
+
readonly description: "Execute the fixed golden corpus with objective graders (CRUD schema/invention, surgical update, health fixture, rotating holdout tasks). Persists results to .eval/results/golden-runs.jsonl for champion–challenger diffs.";
|
|
372
|
+
readonly usage: "task eval:run -- --model MODEL [--seed N] [--directive-version V] [--harness NAME] [--json] [--no-persist]";
|
|
373
|
+
readonly flags: readonly [readonly ["--model MODEL", "(required)", "Model identifier for the run record."], readonly ["--seed N", "(1,2,3)", "Repeatable seed(s); pass multiple --seed flags."], readonly ["--directive-version V", "(engine version)", "Pin the directive version label."], readonly ["--harness NAME", "deterministic-fixture", "Harness label stored on the run record."], readonly ["--json", "(off)", "Emit the GoldenRunRecord JSON."], readonly ["--no-persist", "(off)", "Run without appending to golden-runs.jsonl."], readonly ["--project-root PATH", "(cwd)", "Project root override (Taskfile threads USER_WORKING_DIR)."]];
|
|
374
|
+
readonly examples: readonly ["task eval:run -- --model gpt-5", "task eval:run -- --model claude-sonnet --seed 1 --seed 2 --json"];
|
|
375
|
+
readonly see_also: readonly ["task eval:report", "task eval:health", "#1703"];
|
|
376
|
+
readonly placeholder: false;
|
|
377
|
+
};
|
|
378
|
+
readonly "task eval:report": {
|
|
379
|
+
readonly name: "task eval:report";
|
|
380
|
+
readonly summary: "Tier 2 champion–challenger diff with significance";
|
|
381
|
+
readonly refs: "(#1703)";
|
|
382
|
+
readonly description: "Diff two directive versions' latest golden runs for a model: primary/holdout/overall pass-rate deltas with two-proportion significance and a holdout tripwire when primary gains do not generalize (#1703 Goodhart guard).";
|
|
383
|
+
readonly usage: "task eval:report -- --champion V --challenger V --model MODEL [--json] [--project-root PATH]";
|
|
384
|
+
readonly flags: readonly [readonly ["--champion V", "(required)", "Baseline directive version."], readonly ["--challenger V", "(required)", "Candidate directive version."], readonly ["--model MODEL", "(required)", "Model identifier shared by both runs."], readonly ["--json", "(off)", "Emit the GoldenEvalReport JSON."], readonly ["--project-root PATH", "(cwd)", "Project root override (Taskfile threads USER_WORKING_DIR)."]];
|
|
385
|
+
readonly examples: readonly ["task eval:report -- --champion 0.58.0 --challenger 0.59.0 --model gpt-5"];
|
|
386
|
+
readonly see_also: readonly ["task eval:run", "task eval:health", "#1703"];
|
|
387
|
+
readonly placeholder: false;
|
|
355
388
|
};
|
|
356
389
|
readonly "task scope:promote": {
|
|
357
390
|
readonly name: "task scope:promote";
|
|
@@ -368,7 +401,7 @@ export declare const registryData: {
|
|
|
368
401
|
readonly name: "task scope:demote";
|
|
369
402
|
readonly summary: "pending/ -> proposed/ (set status proposed)";
|
|
370
403
|
readonly refs: "(D1 / #1121)";
|
|
371
|
-
readonly description: "Demote a vBRIEF scope from vbrief/pending/ back to vbrief/proposed/ and append a structured audit entry (including a demote_meta block) to vbrief/.
|
|
404
|
+
readonly description: "Demote a vBRIEF scope from vbrief/pending/ back to vbrief/proposed/ and append a structured audit entry (including a demote_meta block) to vbrief/.triage-cache/scope-lifecycle.jsonl. Supports single-file and --batch (cohort shrink / cap relief) modes.";
|
|
372
405
|
readonly usage: "task scope:demote -- <file> [--reason TEXT] | task scope:demote -- --batch [--older-than-days N]";
|
|
373
406
|
readonly flags: readonly [readonly ["<file>", "(required for single)", "Path to vBRIEF."], readonly ["--batch", "(off)", "Batch mode: demote every pending older than --older-than-days."], readonly ["--older-than-days N", "45", "Batch-mode age threshold."], readonly ["--reason TEXT", "operator-requested", "Free-text reason for single-demote."], readonly ["--actor STR", "operator", "Actor identity recorded in the audit entry."]];
|
|
374
407
|
readonly examples: readonly ["task scope:demote -- vbrief/pending/2026-05-19-foo.vbrief.json", "task scope:demote -- --batch --older-than-days 60"];
|
|
@@ -469,13 +502,13 @@ export declare const registryData: {
|
|
|
469
502
|
readonly refs: "(deft-directive-decompose skill)";
|
|
470
503
|
readonly description: "Validate or apply an approved epic/phase -> story decomposition draft. The draft is a temporary proposal artifact, not a vBRIEF. Writes pending child vBRIEFs and wires references back into the parent epic.";
|
|
471
504
|
readonly usage: "task scope:decompose -- <parent> --draft <draft> [--check] [--date YYYY-MM-DD]";
|
|
472
|
-
readonly flags: readonly [readonly ["<parent>", "(conditional)", "Parent epic/phase vBRIEF path; required with --draft, omit only for --check no-op."], readonly ["--draft PATH", "(required)", "Approved decomposition JSON draft; prefer vbrief/.
|
|
473
|
-
readonly examples: readonly ["task scope:decompose -- vbrief/active/epic.vbrief.json --draft vbrief/.
|
|
505
|
+
readonly flags: readonly [readonly ["<parent>", "(conditional)", "Parent epic/phase vBRIEF path; required with --draft, omit only for --check no-op."], readonly ["--draft PATH", "(required)", "Approved decomposition JSON draft; prefer vbrief/.triage-cache/decompositions/<parent-slug>.json."], readonly ["--check", "(off)", "Validate only; do not write."], readonly ["--date YYYY-MM-DD", "today", "Creation date for generated child filenames."]];
|
|
506
|
+
readonly examples: readonly ["task scope:decompose -- vbrief/active/epic.vbrief.json --draft vbrief/.triage-cache/decompositions/epic.json --check"];
|
|
474
507
|
readonly see_also: readonly ["task scope:promote", "skills/deft-directive-decompose/SKILL.md"];
|
|
475
508
|
readonly placeholder: false;
|
|
476
509
|
};
|
|
477
510
|
};
|
|
478
|
-
readonly categoriesTriage: readonly [readonly ["Session-start", readonly ["task triage:summary", "task verify:cache-fresh"]], readonly ["State verbs (mutate audit log)", readonly ["task triage:accept", "task triage:defer", "task triage:reject", "task triage:needs-ac", "task triage:mark-duplicate", "task triage:reset", "task triage:status", "task triage:history"]], readonly ["Read verbs", readonly ["task triage:queue", "task triage:audit", "task triage:show", "task triage:scope", "task triage:scope-drift", "task triage:classify"]], readonly ["Lifecycle", readonly ["task triage:bootstrap", "task triage:welcome", "task triage:reconcile"]], readonly ["Bulk variants", readonly ["task triage:bulk-accept", "task triage:bulk-reject", "task triage:bulk-defer", "task triage:bulk-needs-ac", "task triage:refresh-active", "task triage:smoketest"]], readonly ["Subscription mutation", readonly ["task triage:subscribe", "task triage:unsubscribe"]], readonly ["Archive / rotation", readonly ["task triage:audit:prune", "task triage:archive-list", "task triage:restore-from-archive", "task triage:audit-log:rotate", "task triage:metrics"]]];
|
|
511
|
+
readonly categoriesTriage: readonly [readonly ["Session-start", readonly ["task triage:summary", "task verify:cache-fresh"]], readonly ["State verbs (mutate audit log)", readonly ["task triage:accept", "task triage:defer", "task triage:reject", "task triage:needs-ac", "task triage:mark-duplicate", "task triage:reset", "task triage:status", "task triage:history"]], readonly ["Read verbs", readonly ["task triage:queue", "task triage:audit", "task triage:show", "task triage:scope", "task triage:scope-drift", "task triage:classify"]], readonly ["Lifecycle", readonly ["task triage:bootstrap", "task triage:welcome", "task triage:reconcile"]], readonly ["Bulk variants", readonly ["task triage:bulk-accept", "task triage:bulk-reject", "task triage:bulk-defer", "task triage:bulk-needs-ac", "task triage:refresh-active", "task triage:smoketest"]], readonly ["Subscription mutation", readonly ["task triage:subscribe", "task triage:unsubscribe"]], readonly ["Archive / rotation", readonly ["task triage:audit:prune", "task triage:archive-list", "task triage:restore-from-archive", "task triage:audit-log:rotate", "task triage:metrics"]], readonly ["Framework eval (#1703)", readonly ["task eval:health", "task eval:run", "task eval:report"]]];
|
|
479
512
|
readonly categoriesScope: readonly [readonly ["Promote / demote", readonly ["task scope:promote", "task scope:demote"]], readonly ["Activate / complete", readonly ["task scope:activate", "task scope:complete", "task scope:fail", "task scope:cancel", "task scope:block", "task scope:unblock"]], readonly ["Reversibility", readonly ["task scope:undo", "task scope:restore"]], readonly ["Decomposition", readonly ["task scope:decompose"]]];
|
|
480
513
|
readonly scriptSubcommandMap: {
|
|
481
514
|
readonly triage_actions: {
|
|
@@ -5,7 +5,7 @@ export const registryData = {
|
|
|
5
5
|
name: "task triage:summary",
|
|
6
6
|
summary: "One-line state for session-start ritual",
|
|
7
7
|
refs: "(D2 / #1122)",
|
|
8
|
-
description: "Emit the one-line triage state consumed by the session-start ritual. Always exits 0 (status surface, not a gate); appends a JSONL record to vbrief/.
|
|
8
|
+
description: "Emit the one-line triage state consumed by the session-start ritual. Always exits 0 (status surface, not a gate); appends a JSONL record to vbrief/.triage-cache/summary-history.jsonl for observability.",
|
|
9
9
|
usage: "task triage:summary [-- --json] [--no-history]",
|
|
10
10
|
flags: [
|
|
11
11
|
["--json", "(off)", "Emit the structured record as JSON instead of the one-liner."],
|
|
@@ -296,11 +296,24 @@ export const registryData = {
|
|
|
296
296
|
"task triage:welcome": {
|
|
297
297
|
name: "task triage:welcome",
|
|
298
298
|
summary: "Single-entry-point upgrade ritual",
|
|
299
|
-
refs: "(N3 / #1143)",
|
|
300
|
-
description: "6-phase onboarding ritual: detect prior state, prompt for subscription scope, run triage:bootstrap, prompt for wipCap, offer WIP relief, print triage:summary. Idempotent on re-run; safe entrypoint for fresh consumers.",
|
|
301
|
-
usage: "task triage:welcome [-- --no-subprocess]",
|
|
302
|
-
flags: [
|
|
303
|
-
|
|
299
|
+
refs: "(N3 / #1143, #2295)",
|
|
300
|
+
description: "6-phase onboarding ritual: detect prior state, prompt for subscription scope, run triage:bootstrap, prompt for wipCap, offer WIP relief, print triage:summary. Idempotent on re-run; safe entrypoint for fresh consumers. Pass --onboard for the non-interactive path that applies a triage-scope preset (and optional --wip-cap) without prompting -- the form agents/CI use.",
|
|
301
|
+
usage: "task triage:welcome [-- --onboard [--preset small|mid|mega] [--wip-cap N]] [--no-subprocess]",
|
|
302
|
+
flags: [
|
|
303
|
+
[
|
|
304
|
+
"--onboard",
|
|
305
|
+
"(off)",
|
|
306
|
+
"Non-interactive onboarding: apply a triage-scope preset (and optional WIP cap) without prompting.",
|
|
307
|
+
],
|
|
308
|
+
["--preset small|mid|mega", "small", "Subscription-scope preset applied by --onboard."],
|
|
309
|
+
[
|
|
310
|
+
"--wip-cap N",
|
|
311
|
+
"(policy default)",
|
|
312
|
+
"Persist an explicit in-flight scope cap during --onboard (positive integer).",
|
|
313
|
+
],
|
|
314
|
+
["--no-subprocess", "(off)", "Dry-mode: don't shell out to sibling tasks."],
|
|
315
|
+
],
|
|
316
|
+
examples: ["task triage:welcome", "task triage:welcome -- --onboard --preset small"],
|
|
304
317
|
see_also: ["task triage:bootstrap", "task triage:summary", "#1119 / N3"],
|
|
305
318
|
placeholder: false,
|
|
306
319
|
},
|
|
@@ -308,7 +321,7 @@ export const registryData = {
|
|
|
308
321
|
name: "task triage:reconcile",
|
|
309
322
|
summary: "Self-heal audit log from on-disk vBRIEFs",
|
|
310
323
|
refs: "(#1468)",
|
|
311
|
-
description: "Idempotent repair verb: derive missing `accept` decisions for proposed/pending/active vBRIEFs that carry an x-vbrief/github-issue reference but have no entry in vbrief/.
|
|
324
|
+
description: "Idempotent repair verb: derive missing `accept` decisions for proposed/pending/active vBRIEFs that carry an x-vbrief/github-issue reference but have no entry in vbrief/.triage-cache/candidates.jsonl. Recovers triage state after the gitignored audit log is reset/lost (#1464) without a full cache re-fetch. Never overrides an existing decision, so a re-run is a no-op.",
|
|
312
325
|
usage: "task triage:reconcile [-- --repo owner/name] [--dry-run] [--json]",
|
|
313
326
|
flags: [
|
|
314
327
|
[
|
|
@@ -422,7 +435,7 @@ export const registryData = {
|
|
|
422
435
|
name: "task triage:subscribe",
|
|
423
436
|
summary: "Add label/milestone/issue to subscription",
|
|
424
437
|
refs: "(D14 / #1133)",
|
|
425
|
-
description: "Subscribe to a label / milestone / issue by appending a rule to plan.policy.triageScope[]. Emits a JSONL audit record to vbrief/.
|
|
438
|
+
description: "Subscribe to a label / milestone / issue by appending a rule to plan.policy.triageScope[]. Emits a JSONL audit record to vbrief/.triage-cache/subscription-history.jsonl.",
|
|
426
439
|
usage: "task triage:subscribe -- (--label=L | --milestone=M | --issue=N)",
|
|
427
440
|
flags: [
|
|
428
441
|
["--label L", "(none)", "Subscribe to a label."],
|
|
@@ -491,7 +504,7 @@ export const registryData = {
|
|
|
491
504
|
name: "task triage:audit-log:rotate",
|
|
492
505
|
summary: "Rotate candidates.jsonl when bounded",
|
|
493
506
|
refs: "(D20, coming)",
|
|
494
|
-
description: "Rotate vbrief/.
|
|
507
|
+
description: "Rotate vbrief/.triage-cache/candidates.jsonl when it exceeds the configured bound. Compacts terminal entries and preserves the open-work tail.",
|
|
495
508
|
usage: "task triage:audit-log:rotate [-- --max-lines N]",
|
|
496
509
|
flags: [["--max-lines N", "(consumer default)", "Bound at which rotation fires."]],
|
|
497
510
|
examples: ["task triage:audit-log:rotate -- --max-lines 10000"],
|
|
@@ -500,17 +513,87 @@ export const registryData = {
|
|
|
500
513
|
},
|
|
501
514
|
"task triage:metrics": {
|
|
502
515
|
name: "task triage:metrics",
|
|
503
|
-
summary: "
|
|
504
|
-
refs: "(
|
|
505
|
-
description: "
|
|
516
|
+
summary: "Attributed-value trend from the events ledger",
|
|
517
|
+
refs: "(#1709)",
|
|
518
|
+
description: "Report value-feedback attribution trends from .deft-cache/events.jsonl: total signal count plus per-class (value, bypass, adoption, friction) and per-event breakdowns over a time window. Alias of the value:show handler. Requires plan.policy.valueFeedback.enabled (default OFF) — exits blocked when disabled; an empty ledger prints a no-signals message. In the maintainer repo, skipped unless DEFT_VALUE_SELF_DOGFOOD=1.",
|
|
506
519
|
usage: "task triage:metrics [-- --window=7d] [--format=text|json]",
|
|
507
520
|
flags: [
|
|
508
|
-
["--window WINDOW", "7d", "Time window
|
|
509
|
-
["--format text|json", "text", "Output shape."],
|
|
521
|
+
["--window WINDOW", "7d", "Time window (e.g. 7d, 30d, 24h)."],
|
|
522
|
+
["--format text|json", "text", "Output shape (json emits the full trend object)."],
|
|
510
523
|
],
|
|
511
|
-
examples: ["task triage:metrics -- --window
|
|
512
|
-
see_also: [
|
|
513
|
-
|
|
524
|
+
examples: ["task triage:metrics", "task triage:metrics -- --window=30d --format=json"],
|
|
525
|
+
see_also: [
|
|
526
|
+
"task policy:show --field=valueFeedback",
|
|
527
|
+
"task policy:enable-value-feedback -- --confirm",
|
|
528
|
+
"#1709",
|
|
529
|
+
],
|
|
530
|
+
placeholder: false,
|
|
531
|
+
},
|
|
532
|
+
"task eval:health": {
|
|
533
|
+
name: "task eval:health",
|
|
534
|
+
summary: "Tier 0 static framework health score",
|
|
535
|
+
refs: "(#1703)",
|
|
536
|
+
description: "Aggregate static self-consistency gates (encoding, links, vBRIEF conformance, AGENTS.md freshness; content-manifest on framework-source trees) into a versioned 0–100 score. Detects contradictory / unsatisfiable gate pairs (#1694). Appends each run to .eval/results/health-history.jsonl. Session start may emit a budgeted [eval] advisory when health degrades.",
|
|
537
|
+
usage: "task eval:health [-- --json] [--no-persist] [--project-root PATH]",
|
|
538
|
+
flags: [
|
|
539
|
+
["--json", "(off)", "Emit the structured HealthReport instead of the human summary."],
|
|
540
|
+
["--no-persist", "(off)", "Run probes without appending to the health history ledger."],
|
|
541
|
+
[
|
|
542
|
+
"--project-root PATH",
|
|
543
|
+
"(cwd)",
|
|
544
|
+
"Project root override (Taskfile threads USER_WORKING_DIR).",
|
|
545
|
+
],
|
|
546
|
+
],
|
|
547
|
+
examples: ["task eval:health", "task eval:health -- --json"],
|
|
548
|
+
see_also: ["task eval:run", "task eval:report", "#1703"],
|
|
549
|
+
placeholder: false,
|
|
550
|
+
},
|
|
551
|
+
"task eval:run": {
|
|
552
|
+
name: "task eval:run",
|
|
553
|
+
summary: "Tier 2 golden corpus eval for a model",
|
|
554
|
+
refs: "(#1703)",
|
|
555
|
+
description: "Execute the fixed golden corpus with objective graders (CRUD schema/invention, surgical update, health fixture, rotating holdout tasks). Persists results to .eval/results/golden-runs.jsonl for champion–challenger diffs.",
|
|
556
|
+
usage: "task eval:run -- --model MODEL [--seed N] [--directive-version V] [--harness NAME] [--json] [--no-persist]",
|
|
557
|
+
flags: [
|
|
558
|
+
["--model MODEL", "(required)", "Model identifier for the run record."],
|
|
559
|
+
["--seed N", "(1,2,3)", "Repeatable seed(s); pass multiple --seed flags."],
|
|
560
|
+
["--directive-version V", "(engine version)", "Pin the directive version label."],
|
|
561
|
+
["--harness NAME", "deterministic-fixture", "Harness label stored on the run record."],
|
|
562
|
+
["--json", "(off)", "Emit the GoldenRunRecord JSON."],
|
|
563
|
+
["--no-persist", "(off)", "Run without appending to golden-runs.jsonl."],
|
|
564
|
+
[
|
|
565
|
+
"--project-root PATH",
|
|
566
|
+
"(cwd)",
|
|
567
|
+
"Project root override (Taskfile threads USER_WORKING_DIR).",
|
|
568
|
+
],
|
|
569
|
+
],
|
|
570
|
+
examples: [
|
|
571
|
+
"task eval:run -- --model gpt-5",
|
|
572
|
+
"task eval:run -- --model claude-sonnet --seed 1 --seed 2 --json",
|
|
573
|
+
],
|
|
574
|
+
see_also: ["task eval:report", "task eval:health", "#1703"],
|
|
575
|
+
placeholder: false,
|
|
576
|
+
},
|
|
577
|
+
"task eval:report": {
|
|
578
|
+
name: "task eval:report",
|
|
579
|
+
summary: "Tier 2 champion–challenger diff with significance",
|
|
580
|
+
refs: "(#1703)",
|
|
581
|
+
description: "Diff two directive versions' latest golden runs for a model: primary/holdout/overall pass-rate deltas with two-proportion significance and a holdout tripwire when primary gains do not generalize (#1703 Goodhart guard).",
|
|
582
|
+
usage: "task eval:report -- --champion V --challenger V --model MODEL [--json] [--project-root PATH]",
|
|
583
|
+
flags: [
|
|
584
|
+
["--champion V", "(required)", "Baseline directive version."],
|
|
585
|
+
["--challenger V", "(required)", "Candidate directive version."],
|
|
586
|
+
["--model MODEL", "(required)", "Model identifier shared by both runs."],
|
|
587
|
+
["--json", "(off)", "Emit the GoldenEvalReport JSON."],
|
|
588
|
+
[
|
|
589
|
+
"--project-root PATH",
|
|
590
|
+
"(cwd)",
|
|
591
|
+
"Project root override (Taskfile threads USER_WORKING_DIR).",
|
|
592
|
+
],
|
|
593
|
+
],
|
|
594
|
+
examples: ["task eval:report -- --champion 0.58.0 --challenger 0.59.0 --model gpt-5"],
|
|
595
|
+
see_also: ["task eval:run", "task eval:health", "#1703"],
|
|
596
|
+
placeholder: false,
|
|
514
597
|
},
|
|
515
598
|
"task scope:promote": {
|
|
516
599
|
name: "task scope:promote",
|
|
@@ -535,7 +618,7 @@ export const registryData = {
|
|
|
535
618
|
name: "task scope:demote",
|
|
536
619
|
summary: "pending/ -> proposed/ (set status proposed)",
|
|
537
620
|
refs: "(D1 / #1121)",
|
|
538
|
-
description: "Demote a vBRIEF scope from vbrief/pending/ back to vbrief/proposed/ and append a structured audit entry (including a demote_meta block) to vbrief/.
|
|
621
|
+
description: "Demote a vBRIEF scope from vbrief/pending/ back to vbrief/proposed/ and append a structured audit entry (including a demote_meta block) to vbrief/.triage-cache/scope-lifecycle.jsonl. Supports single-file and --batch (cohort shrink / cap relief) modes.",
|
|
539
622
|
usage: "task scope:demote -- <file> [--reason TEXT] | task scope:demote -- --batch [--older-than-days N]",
|
|
540
623
|
flags: [
|
|
541
624
|
["<file>", "(required for single)", "Path to vBRIEF."],
|
|
@@ -685,13 +768,13 @@ export const registryData = {
|
|
|
685
768
|
[
|
|
686
769
|
"--draft PATH",
|
|
687
770
|
"(required)",
|
|
688
|
-
"Approved decomposition JSON draft; prefer vbrief/.
|
|
771
|
+
"Approved decomposition JSON draft; prefer vbrief/.triage-cache/decompositions/<parent-slug>.json.",
|
|
689
772
|
],
|
|
690
773
|
["--check", "(off)", "Validate only; do not write."],
|
|
691
774
|
["--date YYYY-MM-DD", "today", "Creation date for generated child filenames."],
|
|
692
775
|
],
|
|
693
776
|
examples: [
|
|
694
|
-
"task scope:decompose -- vbrief/active/epic.vbrief.json --draft vbrief/.
|
|
777
|
+
"task scope:decompose -- vbrief/active/epic.vbrief.json --draft vbrief/.triage-cache/decompositions/epic.json --check",
|
|
695
778
|
],
|
|
696
779
|
see_also: ["task scope:promote", "skills/deft-directive-decompose/SKILL.md"],
|
|
697
780
|
placeholder: false,
|
|
@@ -746,6 +829,7 @@ export const registryData = {
|
|
|
746
829
|
"task triage:metrics",
|
|
747
830
|
],
|
|
748
831
|
],
|
|
832
|
+
["Framework eval (#1703)", ["task eval:health", "task eval:run", "task eval:report"]],
|
|
749
833
|
],
|
|
750
834
|
categoriesScope: [
|
|
751
835
|
["Promote / demote", ["task scope:promote", "task scope:demote"]],
|
package/dist/triage/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
export * as actions from "./actions/index.js";
|
|
10
10
|
export * as bootstrap from "./bootstrap/index.js";
|
|
11
11
|
export * as bulk from "./bulk/index.js";
|
|
12
|
+
export * as cachePath from "./cache-path.js";
|
|
13
|
+
export * from "./cache-path.js";
|
|
12
14
|
export * as classify from "./classify/index.js";
|
|
13
15
|
export * as help from "./help/index.js";
|
|
14
16
|
export * as queue from "./queue/index.js";
|
package/dist/triage/index.js
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
export * as actions from "./actions/index.js";
|
|
10
10
|
export * as bootstrap from "./bootstrap/index.js";
|
|
11
11
|
export * as bulk from "./bulk/index.js";
|
|
12
|
+
export * as cachePath from "./cache-path.js";
|
|
13
|
+
export * from "./cache-path.js";
|
|
12
14
|
export * as classify from "./classify/index.js";
|
|
13
15
|
export * as help from "./help/index.js";
|
|
14
16
|
export * as queue from "./queue/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveCandidatesLogPath } from "../cache-path.js";
|
|
4
4
|
/** Resolve audit log path; mirrors candidates_log._resolve_path (framework root). */
|
|
5
5
|
export function resolveAuditLogPath(options = {}) {
|
|
6
6
|
if (options.auditLogPath !== null && options.auditLogPath !== undefined) {
|
|
@@ -12,7 +12,7 @@ export function resolveAuditLogPath(options = {}) {
|
|
|
12
12
|
: envRoot.length > 0
|
|
13
13
|
? resolve(envRoot)
|
|
14
14
|
: process.cwd();
|
|
15
|
-
return
|
|
15
|
+
return resolveCandidatesLogPath(root);
|
|
16
16
|
}
|
|
17
17
|
/** Read audit log entries, optionally filtered by repo. */
|
|
18
18
|
export function readAuditEntries(repo, options = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveTriageCachePath } from "../cache-path.js";
|
|
4
4
|
import { extractAuthor, extractMilestone } from "../scope-drift/cache-walker.js";
|
|
5
5
|
import { CACHE_DIR_NAME, CACHE_SOURCE_GITHUB_ISSUE } from "./constants.js";
|
|
6
6
|
import { hasActiveScopeIgnores, isRawIssueScopeIgnored, resolveScopeIgnores, } from "./scope-ignores-filter.js";
|
|
@@ -23,7 +23,7 @@ export function resolveSlicesLogPath(options = {}) {
|
|
|
23
23
|
: envRoot.length > 0
|
|
24
24
|
? resolve(envRoot)
|
|
25
25
|
: process.cwd();
|
|
26
|
-
return
|
|
26
|
+
return resolveTriageCachePath(root, "slices.jsonl");
|
|
27
27
|
}
|
|
28
28
|
/** Read slices.jsonl records. */
|
|
29
29
|
export function loadSliceRecords(options = {}) {
|
|
@@ -2,7 +2,8 @@ import { execFileSync } from "node:child_process";
|
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { appendFileSync, mkdirSync } from "node:fs";
|
|
4
4
|
import { dirname, resolve } from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import { resolveLifecycleFolder } from "../../layout/resolve.js";
|
|
6
|
+
import { resolveCandidatesLogPath } from "../cache-path.js";
|
|
6
7
|
import { auditKey, existingAuditRefs, scanLifecycleRefs } from "./audit.js";
|
|
7
8
|
import { BACKFILL_FOLDERS, RECONCILE_ACTOR, } from "./types.js";
|
|
8
9
|
const GIT_ORIGIN_RE = /^(?:https?:\/\/(?:[^@/]+@)?github\.com\/|git@github\.com:|ssh:\/\/git@github\.com[:/])([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*?)(?:\.git)?\/?\s*$/;
|
|
@@ -33,7 +34,7 @@ function newDecisionId() {
|
|
|
33
34
|
}
|
|
34
35
|
export function findReconcilable(projectRoot, options = {}) {
|
|
35
36
|
const root = resolve(projectRoot);
|
|
36
|
-
const auditPath = options.auditLogPath ??
|
|
37
|
+
const auditPath = options.auditLogPath ?? resolveCandidatesLogPath(root);
|
|
37
38
|
const existing = existingAuditRefs(auditPath);
|
|
38
39
|
const defaultRepo = options.defaultRepo ?? null;
|
|
39
40
|
const items = [];
|
|
@@ -116,7 +117,7 @@ export function reconcile(projectRoot, options = {}) {
|
|
|
116
117
|
if (defaultRepo === null) {
|
|
117
118
|
defaultRepo = inferRepoFromGit(root);
|
|
118
119
|
}
|
|
119
|
-
const auditPath = options.auditLogPath ??
|
|
120
|
+
const auditPath = options.auditLogPath ?? resolveCandidatesLogPath(root);
|
|
120
121
|
const dryRun = options.dryRun ?? false;
|
|
121
122
|
const result = {
|
|
122
123
|
projectRoot: root,
|
|
@@ -6,13 +6,14 @@ export interface ParsedCliArgs {
|
|
|
6
6
|
addLabel: string | undefined;
|
|
7
7
|
addMilestone: string | undefined;
|
|
8
8
|
ignoreLabel: string | undefined;
|
|
9
|
+
setPreset: string | undefined;
|
|
9
10
|
diffFromUpstream: boolean;
|
|
10
11
|
source: string;
|
|
11
12
|
cacheRoot: string | undefined;
|
|
12
13
|
count: number | undefined;
|
|
13
14
|
}
|
|
14
15
|
export declare function parseCliArgs(argv: string[]): ParsedCliArgs;
|
|
15
|
-
export declare const CLI_HELP = "usage: triage_scope.py [-h] [--project-root PROJECT_ROOT] [--list]\n [--refresh-denominator] [--repo REPO]\n [--add-label ADD_LABEL] [--add-milestone ADD_MILESTONE]\n [--ignore-label IGNORE_LABEL] [--diff-from-upstream]\n [--source SOURCE] [--cache-root CACHE_ROOT]\n [--count COUNT]\n\nInspect, mutate, and diff the typed plan.policy.triageScope[] subscription +\nplan.policy.triageScopeIgnores[] (#1131 / D12, #1133 / D14, #1182 / D14c).\nRead paths never trigger a recompute; use --refresh-denominator to update the\ncoverage cache. Mutation flags --add-label / --add-milestone / --ignore-label
|
|
16
|
+
export declare const CLI_HELP = "usage: triage_scope.py [-h] [--project-root PROJECT_ROOT] [--list]\n [--refresh-denominator] [--repo REPO]\n [--add-label ADD_LABEL] [--add-milestone ADD_MILESTONE]\n [--ignore-label IGNORE_LABEL] [--set-preset PRESET]\n [--diff-from-upstream]\n [--source SOURCE] [--cache-root CACHE_ROOT]\n [--count COUNT]\n\nInspect, mutate, and diff the typed plan.policy.triageScope[] subscription +\nplan.policy.triageScopeIgnores[] (#1131 / D12, #1133 / D14, #1182 / D14c).\nRead paths never trigger a recompute; use --refresh-denominator to update the\ncoverage cache. Mutation flags --add-label / --add-milestone / --ignore-label /\n--set-preset are idempotent and atomic; every mutation appends a\nsubscription-change audit entry to vbrief/.eval/subscription-history.jsonl.\n--set-preset small|mid|mega overwrites plan.policy.triageScope[] with a named\nsubscription preset via the same writer that backs triage:welcome --onboard (#2301).\n";
|
|
16
17
|
/** Run triage:scope CLI; returns exit code and captured output for parity. */
|
|
17
18
|
export declare function runCliCapture(argv: string[]): {
|
|
18
19
|
code: number;
|
package/dist/triage/scope/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { coveragePath, writeCoverageDenominator } from "./coverage.js";
|
|
5
|
-
import { addLabelToIgnores, addLabelToScope, addMilestoneToScope, computeDiffFromUpstream, fetchUpstreamLabelsAndMilestones, renderDiffReport, } from "./mutations.js";
|
|
5
|
+
import { addLabelToIgnores, addLabelToScope, addMilestoneToScope, computeDiffFromUpstream, fetchUpstreamLabelsAndMilestones, renderDiffReport, setScopePreset, } from "./mutations.js";
|
|
6
6
|
import { subscriptionHash } from "./normalize.js";
|
|
7
7
|
import { pyListRepr } from "./python-repr.js";
|
|
8
8
|
import { renderIgnores, renderList } from "./renderers.js";
|
|
@@ -17,6 +17,7 @@ export function parseCliArgs(argv) {
|
|
|
17
17
|
addLabel: undefined,
|
|
18
18
|
addMilestone: undefined,
|
|
19
19
|
ignoreLabel: undefined,
|
|
20
|
+
setPreset: undefined,
|
|
20
21
|
diffFromUpstream: false,
|
|
21
22
|
source: "github-issue",
|
|
22
23
|
cacheRoot: undefined,
|
|
@@ -60,6 +61,12 @@ export function parseCliArgs(argv) {
|
|
|
60
61
|
}
|
|
61
62
|
else if (arg?.startsWith("--ignore-label="))
|
|
62
63
|
parsed.ignoreLabel = arg.slice("--ignore-label=".length);
|
|
64
|
+
else if (arg === "--set-preset") {
|
|
65
|
+
parsed.setPreset = argv[i + 1];
|
|
66
|
+
i += 1;
|
|
67
|
+
}
|
|
68
|
+
else if (arg?.startsWith("--set-preset="))
|
|
69
|
+
parsed.setPreset = arg.slice("--set-preset=".length);
|
|
63
70
|
else if (arg === "--source") {
|
|
64
71
|
parsed.source = argv[i + 1] ?? "github-issue";
|
|
65
72
|
i += 1;
|
|
@@ -86,16 +93,19 @@ export function parseCliArgs(argv) {
|
|
|
86
93
|
export const CLI_HELP = `usage: triage_scope.py [-h] [--project-root PROJECT_ROOT] [--list]
|
|
87
94
|
[--refresh-denominator] [--repo REPO]
|
|
88
95
|
[--add-label ADD_LABEL] [--add-milestone ADD_MILESTONE]
|
|
89
|
-
[--ignore-label IGNORE_LABEL] [--
|
|
96
|
+
[--ignore-label IGNORE_LABEL] [--set-preset PRESET]
|
|
97
|
+
[--diff-from-upstream]
|
|
90
98
|
[--source SOURCE] [--cache-root CACHE_ROOT]
|
|
91
99
|
[--count COUNT]
|
|
92
100
|
|
|
93
101
|
Inspect, mutate, and diff the typed plan.policy.triageScope[] subscription +
|
|
94
102
|
plan.policy.triageScopeIgnores[] (#1131 / D12, #1133 / D14, #1182 / D14c).
|
|
95
103
|
Read paths never trigger a recompute; use --refresh-denominator to update the
|
|
96
|
-
coverage cache. Mutation flags --add-label / --add-milestone / --ignore-label
|
|
97
|
-
are idempotent and atomic; every mutation appends a
|
|
98
|
-
entry to vbrief/.eval/subscription-history.jsonl.
|
|
104
|
+
coverage cache. Mutation flags --add-label / --add-milestone / --ignore-label /
|
|
105
|
+
--set-preset are idempotent and atomic; every mutation appends a
|
|
106
|
+
subscription-change audit entry to vbrief/.eval/subscription-history.jsonl.
|
|
107
|
+
--set-preset small|mid|mega overwrites plan.policy.triageScope[] with a named
|
|
108
|
+
subscription preset via the same writer that backs triage:welcome --onboard (#2301).
|
|
99
109
|
`;
|
|
100
110
|
function handleMutation(projectRoot, args) {
|
|
101
111
|
const out = { stdout: [], stderr: [] };
|
|
@@ -115,6 +125,10 @@ function handleMutation(projectRoot, args) {
|
|
|
115
125
|
[changed, message] = addLabelToIgnores(projectRoot, args.ignoreLabel);
|
|
116
126
|
verb = "ignore-label";
|
|
117
127
|
}
|
|
128
|
+
else if (args.setPreset !== undefined) {
|
|
129
|
+
[changed, message] = setScopePreset(projectRoot, args.setPreset);
|
|
130
|
+
verb = "set-preset";
|
|
131
|
+
}
|
|
118
132
|
else {
|
|
119
133
|
throw new Error("internal: mutation flag set but no handler matched");
|
|
120
134
|
}
|
|
@@ -148,12 +162,13 @@ export function runCliCapture(argv) {
|
|
|
148
162
|
args.addLabel !== undefined ? "--add-label" : null,
|
|
149
163
|
args.addMilestone !== undefined ? "--add-milestone" : null,
|
|
150
164
|
args.ignoreLabel !== undefined ? "--ignore-label" : null,
|
|
165
|
+
args.setPreset !== undefined ? "--set-preset" : null,
|
|
151
166
|
].filter((f) => f !== null);
|
|
152
167
|
if (mutationFlags.length > 1) {
|
|
153
168
|
return {
|
|
154
169
|
code: 2,
|
|
155
170
|
stdout: "",
|
|
156
|
-
stderr: "triage:scope: --add-label / --add-milestone / --ignore-label " +
|
|
171
|
+
stderr: "triage:scope: --add-label / --add-milestone / --ignore-label / --set-preset " +
|
|
157
172
|
`are mutually exclusive (got ${pyListRepr(mutationFlags)}).\n`,
|
|
158
173
|
};
|
|
159
174
|
}
|
|
@@ -171,6 +186,15 @@ export function runCliCapture(argv) {
|
|
|
171
186
|
if (mutation.code !== 0) {
|
|
172
187
|
return { code: mutation.code, stdout: stdout.join(""), stderr: stderr.join("") };
|
|
173
188
|
}
|
|
189
|
+
// A preset write comes from the trusted SUBSCRIPTION_PRESETS constant (the
|
|
190
|
+
// same source the onboard path writes). The `mega` preset intentionally
|
|
191
|
+
// ships an `explicit-watch` scaffold with an empty `issues` list for the
|
|
192
|
+
// operator to fill in, which the strict hand-edit validator below flags.
|
|
193
|
+
// Bypass that re-validation for a preset write so `--set-preset` reports the
|
|
194
|
+
// successful, persisted mutation instead of a spurious exit 1 (#2301).
|
|
195
|
+
if (args.setPreset !== undefined) {
|
|
196
|
+
return { code: 0, stdout: stdout.join(""), stderr: stderr.join("") };
|
|
197
|
+
}
|
|
174
198
|
}
|
|
175
199
|
const data = loadProjectDefinition(projectRoot);
|
|
176
200
|
const rules = resolveScopeRules(projectRoot, data);
|
|
@@ -2,9 +2,10 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync, } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import { resolveProjectDefinitionPath } from "../../layout/resolve.js";
|
|
6
6
|
import { migrateLegacyPolicyKey, PLAN_POLICY_KEY } from "../../policy/plan-extensions.js";
|
|
7
7
|
import { projectDefinitionMutationLock } from "../../vbrief-build/project-definition-io.js";
|
|
8
|
+
import { resolveTriageCachePath } from "../cache-path.js";
|
|
8
9
|
import { SUBSCRIPTION_HISTORY_SCHEMA } from "./constants.js";
|
|
9
10
|
import { pyStrRepr } from "./python-repr.js";
|
|
10
11
|
import { utcIso } from "./time.js";
|
|
@@ -61,7 +62,7 @@ function resolveActor(actor) {
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
export function recordSubscriptionChange(projectRoot, options) {
|
|
64
|
-
const historyPath =
|
|
65
|
+
const historyPath = resolveTriageCachePath(projectRoot, "subscription-history.jsonl");
|
|
65
66
|
const record = {
|
|
66
67
|
schema: SUBSCRIPTION_HISTORY_SCHEMA,
|
|
67
68
|
change_id: randomUUID(),
|
|
@@ -18,4 +18,14 @@ export declare function fetchUpstreamLabelsAndMilestones(repo: string, binary?:
|
|
|
18
18
|
export declare function addLabelToScope(projectRoot: string, label: string, actor?: string | null): [boolean, string];
|
|
19
19
|
export declare function addMilestoneToScope(projectRoot: string, milestone: string, actor?: string | null): [boolean, string];
|
|
20
20
|
export declare function addLabelToIgnores(projectRoot: string, label: string): [boolean, string];
|
|
21
|
+
/** Valid subscription preset keys for `triage:scope --set-preset` (#2301). */
|
|
22
|
+
export declare function scopePresetKeys(): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Overwrite plan.policy.triageScope with a named subscription preset (#2301).
|
|
25
|
+
* Reuses the shared `subscriptionPreset` + `writeTriageScope` helper that backs
|
|
26
|
+
* `triage:welcome --onboard`, so the write path (namespaced key, legacy-key
|
|
27
|
+
* migration, audit trail, mutation lock) stays identical across surfaces rather
|
|
28
|
+
* than being duplicated here.
|
|
29
|
+
*/
|
|
30
|
+
export declare function setScopePreset(projectRoot: string, presetKey: string): [boolean, string];
|
|
21
31
|
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { SUBPROCESS_MAX_BUFFER } from "../../subprocess/max-buffer.js";
|
|
3
|
+
import { SUBSCRIPTION_PRESETS } from "../welcome/constants.js";
|
|
4
|
+
import { subscriptionPreset, writeTriageScope } from "../welcome/writers.js";
|
|
3
5
|
import { collectMilestoneSubscribedNames, rulesRequestIsOpen } from "./milestone.js";
|
|
4
6
|
import { addIgnore, subscribe } from "./mutations-core.js";
|
|
5
7
|
import { resolveScopeIgnores, resolveScopeRules } from "./resolve.js";
|
|
@@ -200,4 +202,24 @@ export function addLabelToIgnores(projectRoot, label) {
|
|
|
200
202
|
throw new Error(`label must be a non-empty string; got ${JSON.stringify(label)}`);
|
|
201
203
|
return addIgnore(projectRoot, label);
|
|
202
204
|
}
|
|
205
|
+
/** Valid subscription preset keys for `triage:scope --set-preset` (#2301). */
|
|
206
|
+
export function scopePresetKeys() {
|
|
207
|
+
return Object.keys(SUBSCRIPTION_PRESETS);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Overwrite plan.policy.triageScope with a named subscription preset (#2301).
|
|
211
|
+
* Reuses the shared `subscriptionPreset` + `writeTriageScope` helper that backs
|
|
212
|
+
* `triage:welcome --onboard`, so the write path (namespaced key, legacy-key
|
|
213
|
+
* migration, audit trail, mutation lock) stays identical across surfaces rather
|
|
214
|
+
* than being duplicated here.
|
|
215
|
+
*/
|
|
216
|
+
export function setScopePreset(projectRoot, presetKey) {
|
|
217
|
+
const key = presetKey.trim();
|
|
218
|
+
const validKeys = scopePresetKeys();
|
|
219
|
+
if (!validKeys.includes(key)) {
|
|
220
|
+
throw new Error(`unknown preset ${JSON.stringify(presetKey)}; valid presets: ${validKeys.join(", ")}`);
|
|
221
|
+
}
|
|
222
|
+
const rules = subscriptionPreset(key);
|
|
223
|
+
return writeTriageScope(projectRoot, rules, { presetLabel: key });
|
|
224
|
+
}
|
|
203
225
|
//# sourceMappingURL=mutations.js.map
|