@deftai/directive-core 0.105.0 → 0.106.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.
Files changed (85) hide show
  1. package/dist/authz/classify.js +591 -34
  2. package/dist/check/named-cause.js +1 -1
  3. package/dist/forward-coverage/diff-coverage.d.ts +39 -0
  4. package/dist/forward-coverage/diff-coverage.js +112 -0
  5. package/dist/forward-coverage/diff-lines.d.ts +19 -0
  6. package/dist/forward-coverage/diff-lines.js +173 -0
  7. package/dist/forward-coverage/evaluate.d.ts +24 -9
  8. package/dist/forward-coverage/evaluate.js +125 -19
  9. package/dist/init-deposit/agent-hooks.d.ts +1 -1
  10. package/dist/init-deposit/agent-hooks.js +1 -1
  11. package/dist/intake/clause-derivation.d.ts +9 -0
  12. package/dist/intake/clause-derivation.js +30 -3
  13. package/dist/lifecycle-visible/evaluate.d.ts +98 -0
  14. package/dist/lifecycle-visible/evaluate.js +710 -0
  15. package/dist/lifecycle-visible/index.d.ts +2 -0
  16. package/dist/lifecycle-visible/index.js +2 -0
  17. package/dist/literal-acceptance/capture.js +3 -3
  18. package/dist/orchestration/judgment-policy.d.ts +13 -0
  19. package/dist/orchestration/judgment-policy.js +15 -0
  20. package/dist/orchestration/probe-session.js +13 -8
  21. package/dist/orchestration/verify-judgment-gates.d.ts +4 -0
  22. package/dist/orchestration/verify-judgment-gates.js +43 -11
  23. package/dist/policy/ceremony-dial.js +7 -7
  24. package/dist/policy/host-hooks.d.ts +20 -0
  25. package/dist/policy/host-hooks.js +121 -2
  26. package/dist/policy/org-force-on-migration.js +2 -1
  27. package/dist/policy/plan-extensions.d.ts +1 -1
  28. package/dist/policy/plan-extensions.js +2 -0
  29. package/dist/policy/product-signal.js +6 -7
  30. package/dist/policy/require-human-merge.js +8 -6
  31. package/dist/policy/resolve.d.ts +7 -2
  32. package/dist/policy/resolve.js +25 -8
  33. package/dist/policy/value-feedback.js +7 -8
  34. package/dist/preflight-cache/evaluate.d.ts +12 -0
  35. package/dist/preflight-cache/evaluate.js +15 -1
  36. package/dist/preflight-cache/index.d.ts +1 -1
  37. package/dist/preflight-cache/index.js +1 -1
  38. package/dist/product-first-done-gate/evaluate.d.ts +4 -0
  39. package/dist/product-first-done-gate/evaluate.js +46 -5
  40. package/dist/release/closed-verb-gate.d.ts +12 -0
  41. package/dist/release/closed-verb-gate.js +51 -0
  42. package/dist/release/index.d.ts +1 -0
  43. package/dist/release/index.js +1 -0
  44. package/dist/release/pipeline.js +7 -0
  45. package/dist/release/types.d.ts +12 -0
  46. package/dist/render/constants.d.ts +2 -1
  47. package/dist/render/constants.js +2 -1
  48. package/dist/render/framework-commands.js +4 -0
  49. package/dist/render/spec-validate.js +23 -12
  50. package/dist/run-summary/types.d.ts +4 -0
  51. package/dist/scope/main.js +15 -5
  52. package/dist/scope/promote-from-issue.js +5 -5
  53. package/dist/scope-provenance/evaluate.js +3 -3
  54. package/dist/session/ac-pass-banking.d.ts +5 -0
  55. package/dist/session/ac-pass-banking.js +3 -2
  56. package/dist/session/process-cost.d.ts +32 -10
  57. package/dist/session/process-cost.js +189 -1
  58. package/dist/session/product-state-hash.js +41 -24
  59. package/dist/session/ritual-entrypoint.js +16 -1
  60. package/dist/session/session-start.d.ts +6 -0
  61. package/dist/session/session-start.js +32 -2
  62. package/dist/session/verify-session-ritual.d.ts +24 -1
  63. package/dist/session/verify-session-ritual.js +89 -6
  64. package/dist/swarm/finalize-cohort-cli.d.ts +7 -2
  65. package/dist/swarm/finalize-cohort-cli.js +165 -35
  66. package/dist/swarm/finalize-cohort.d.ts +1 -0
  67. package/dist/swarm/finalize-cohort.js +14 -2
  68. package/dist/swarm/routing-set-cli.js +2 -0
  69. package/dist/swarm/routing-verify.d.ts +1 -1
  70. package/dist/swarm/routing-verify.js +2 -2
  71. package/dist/triage/bootstrap/index.js +6 -6
  72. package/dist/triage/help/registry-data.d.ts +1 -1
  73. package/dist/triage/help/registry-data.js +1 -1
  74. package/dist/triage/welcome/writers.d.ts +1 -1
  75. package/dist/triage/welcome/writers.js +10 -5
  76. package/dist/value/readback.d.ts +4 -1
  77. package/dist/value/readback.js +51 -12
  78. package/dist/vbrief-validate/schema.d.ts +4 -0
  79. package/dist/vbrief-validate/schema.js +1 -1
  80. package/dist/verify-env/agent-hook-readiness.d.ts +2 -2
  81. package/dist/verify-env/agent-hook-readiness.js +12 -8
  82. package/dist/verify-env/agent-hooks-live-probe.d.ts +5 -1
  83. package/dist/verify-env/agent-hooks-live-probe.js +26 -5
  84. package/dist/verify-env/agent-hooks.js +3 -4
  85. package/package.json +7 -3
@@ -9,6 +9,8 @@ import { ENV_RUN_SUMMARY_PATH, RunSummaryEmitter, } from "../run-summary/index.j
9
9
  import { deriveAcceptanceClauses, readAcceptanceClauses, serializeAcceptanceClauses, } from "../verify-ac/clauses.js";
10
10
  /** One-line remediation when a stamp has no statement-traceable clause (#3398). */
11
11
  export const CLAUSE_STAMP_IMPLEMENTATION_ONLY_REMEDIATION = "derive clauses from the statement's testable constraints";
12
+ export const MISSING_AMBIGUITY_ATTESTATION_CAUSE = "missing_ambiguity_attestation";
13
+ export const AMBIGUITY_ATTESTATION_REMEDIATION = "record ambiguity readings or attest none_found";
12
14
  const NARRATIVE_KEYS = [
13
15
  "Overview",
14
16
  "Description",
@@ -165,12 +167,22 @@ export function prepareClauseStamp(clauses, statement) {
165
167
  ambiguity_attestation: traced.some(hasAmbiguousReadings) ? undefined : "none_found",
166
168
  };
167
169
  }
168
- const AMBIGUITY_ATTESTATION_MISSING = "verify:ac config error: missing ambiguity attestation; record at least one ambiguous: true clause with readings, or set ambiguity_attestation: none_found";
170
+ const AMBIGUITY_ATTESTATION_MISSING = `verify:ac config error: missing ambiguity attestation; ${AMBIGUITY_ATTESTATION_REMEDIATION}`;
171
+ function missingAttestationCheck() {
172
+ return {
173
+ ok: false,
174
+ attested: false,
175
+ kind: "missing",
176
+ message: AMBIGUITY_ATTESTATION_MISSING,
177
+ cause: MISSING_AMBIGUITY_ATTESTATION_CAUSE,
178
+ remediation: AMBIGUITY_ATTESTATION_REMEDIATION,
179
+ };
180
+ }
169
181
  /** Config-error surface for verify:ac: attestation or an ambiguous clause with readings. */
170
182
  export function evaluateAmbiguityAttestation(acceptance) {
171
183
  const rec = asRecord(acceptance);
172
184
  if (rec === null) {
173
- return { ok: false, attested: false, kind: "missing", message: AMBIGUITY_ATTESTATION_MISSING };
185
+ return missingAttestationCheck();
174
186
  }
175
187
  const clauses = readAcceptanceClauses(rec);
176
188
  if (clauses.some(hasAmbiguousReadings)) {
@@ -179,7 +191,22 @@ export function evaluateAmbiguityAttestation(acceptance) {
179
191
  if (rec.ambiguity_attestation === "none_found") {
180
192
  return { ok: true, attested: true, kind: "none_found", message: "" };
181
193
  }
182
- return { ok: false, attested: false, kind: "missing", message: AMBIGUITY_ATTESTATION_MISSING };
194
+ return missingAttestationCheck();
195
+ }
196
+ /**
197
+ * Fail-closed check for a *stamped* plan.acceptance (#3559).
198
+ * Command-only / empty floor blocks are not stamps; they keep the empty-resolution path.
199
+ */
200
+ export function stampedAmbiguityAttestationError(acceptance) {
201
+ const rec = asRecord(acceptance);
202
+ if (rec === null) {
203
+ return null;
204
+ }
205
+ if (readAcceptanceClauses(rec).length === 0) {
206
+ return null;
207
+ }
208
+ const check = evaluateAmbiguityAttestation(rec);
209
+ return check.ok ? null : check;
183
210
  }
184
211
  function serializeTracedClauses(clauses) {
185
212
  return serializeAcceptanceClauses(clauses).map((row, index) => ({
@@ -0,0 +1,98 @@
1
+ /**
2
+ * verify:lifecycle-visible — detect ignore/index flags that hide lifecycle roots (#3505).
3
+ *
4
+ * Warn-only by default (exit 0). Pass --enforce to fail closed.
5
+ * Not a task-check gate: this is a per-clone environment property.
6
+ */
7
+ import { type GitRunner } from "../session/git.js";
8
+ export declare const LIFECYCLE_ROOT_PREFIXES: readonly ["xbrief", "vbrief"];
9
+ export declare const LIFECYCLE_STAGE_DIRS: readonly ["proposed", "pending", "active", "completed", "cancelled"];
10
+ export type LifecycleHideKind = "ignored" | "skip-worktree" | "assume-unchanged";
11
+ export interface LifecycleHideFinding {
12
+ readonly path: string;
13
+ readonly kind: LifecycleHideKind;
14
+ readonly source: string;
15
+ readonly line: number | null;
16
+ readonly rule: string;
17
+ readonly raw: string;
18
+ }
19
+ export interface LifecycleVisibleOptions {
20
+ readonly projectRoot: string;
21
+ readonly enforce?: boolean;
22
+ readonly runGit?: GitRunner;
23
+ }
24
+ export interface LifecycleVisibleResult {
25
+ readonly code: 0 | 1 | 2;
26
+ readonly message: string;
27
+ readonly stream: "stdout" | "stderr";
28
+ readonly findings: readonly LifecycleHideFinding[];
29
+ readonly enforce: boolean;
30
+ readonly failOpen: boolean;
31
+ }
32
+ export interface CheckIgnoreMatch {
33
+ readonly source: string;
34
+ readonly line: number;
35
+ readonly pattern: string;
36
+ readonly path: string;
37
+ }
38
+ export interface LsFilesVerboseRecord {
39
+ readonly tag: string;
40
+ readonly path: string;
41
+ }
42
+ /** Ignore globs from one file, with the directory Git applies them against. */
43
+ export interface IgnorePatternSource {
44
+ readonly baseDir: string;
45
+ readonly patterns: readonly string[];
46
+ }
47
+ /** Canonical lifecycle root pathspecs (`xbrief/active/`, `vbrief/pending/`, …). */
48
+ export declare function lifecycleRootRelPaths(): string[];
49
+ /** Fills `*` in ignore globs so a derived probe still matches the rule. */
50
+ export declare const LIFECYCLE_PROBE_STEM = "lifecycle-visible";
51
+ /**
52
+ * Date-prefixed brief-shaped fallback when no ignore-rule date glob exists.
53
+ * Date globs emit their own matching names (`2026-07-*` → a July file, `2025-*` → 2025).
54
+ */
55
+ export declare const LIFECYCLE_PROBE_SENTINEL = "2026-01-01-lifecycle-visible.xbrief.json";
56
+ /** Legacy vbrief filename so `*.vbrief.json` / `2026-*.vbrief.json` cannot report clean. */
57
+ export declare const LIFECYCLE_PROBE_SENTINEL_VBRIEF = "2026-01-01-lifecycle-visible.vbrief.json";
58
+ /** Stage dirs plus one matching-extension sentinel under each. */
59
+ export declare function lifecycleIgnoreProbeRelPaths(): string[];
60
+ /** True when an ignore glob could hide a convention-valid brief. */
61
+ export declare function ignorePatternLooksLifecycleRelevant(pattern: string): boolean;
62
+ /** Linear `[abc]` expansion — avoid nested regex quantifiers (CodeQL js/polynomial-redos). */
63
+ export declare function expandGitignoreCharClasses(body: string): string;
64
+ /**
65
+ * Expand one gitignore glob into a single concrete pathname that still matches it.
66
+ * `*` becomes {@link LIFECYCLE_PROBE_STEM}; `**` collapses; `?` becomes `0`.
67
+ */
68
+ export declare function expandGitignoreGlobToConcrete(pattern: string): string | null;
69
+ /** Join a glob-expanded probe to the ignore file's directory (Git's match root). */
70
+ export declare function joinIgnoreFileBase(baseDir: string, concrete: string): string;
71
+ /**
72
+ * One derived probe per relevant ignore-rule line (bounded by ignore-file size, not a numeric cap).
73
+ * Date globs keep their year/month so `2026-07-*` probes a July name, not the January fallback.
74
+ * Slash patterns keep the ignore-file directory; stage wildcards expand onto real stages.
75
+ */
76
+ export declare function derivedLifecycleIgnoreProbesFromSources(sources: readonly IgnorePatternSource[]): string[];
77
+ /** Ignore-file globs → check-ignore pathspecs (one per relevant rule line). */
78
+ export declare function derivedLifecycleIgnoreProbes(projectRoot: string, runGit: GitRunner): string[];
79
+ /** Map a check-ignore pathname back to its canonical stage root, or null if outside. */
80
+ export declare function lifecycleRootForRelPath(relPosix: string): string | null;
81
+ /** Deliberate hybrid ignores under a visible root must not trip the check (#1144). */
82
+ export declare function isSelectiveLifecyclePath(relPosix: string): boolean;
83
+ /** Map git check-ignore source paths to the actionable display form. */
84
+ export declare function displayIgnoreSource(source: string, projectRoot: string): string;
85
+ /**
86
+ * Parse one `git check-ignore -v` line: `<source>:<linenum>:<pattern>\\t<pathname>`.
87
+ * Source may be a Windows absolute path with a drive colon.
88
+ */
89
+ export declare function parseCheckIgnoreVerboseLine(line: string): CheckIgnoreMatch | null;
90
+ /** Parse one `git ls-files -v` record (`S path` / `h path`). */
91
+ export declare function parseLsFilesVerboseRecord(record: string): LsFilesVerboseRecord | null;
92
+ /** Index flag encoded by the `ls-files -v` status tag. */
93
+ export declare function indexFlagKind(tag: string): "skip-worktree" | "assume-unchanged" | null;
94
+ /** Session:start advisory lines — silent when clean. */
95
+ export declare function formatLifecycleVisibleSessionLines(result: LifecycleVisibleResult): string[];
96
+ /** Evaluate whether lifecycle roots are hidden by ignore rules or index flags (#3505). */
97
+ export declare function evaluateLifecycleVisible(options: LifecycleVisibleOptions): LifecycleVisibleResult;
98
+ //# sourceMappingURL=evaluate.d.ts.map