@deftai/directive-core 0.107.0 → 0.108.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 (167) hide show
  1. package/dist/architecture/sor-preflight.js +2 -0
  2. package/dist/check/cached-orchestrator.js +28 -3
  3. package/dist/check/named-cause.js +18 -3
  4. package/dist/codebase/provider.js +7 -1
  5. package/dist/delivery-attempt/handoff.js +1 -1
  6. package/dist/design-critique/citation-grammar.d.ts +53 -0
  7. package/dist/design-critique/citation-grammar.js +303 -0
  8. package/dist/design-critique/completed-arc-record.d.ts +62 -0
  9. package/dist/design-critique/completed-arc-record.js +232 -0
  10. package/dist/freshness/bind.d.ts +32 -3
  11. package/dist/freshness/bind.js +58 -12
  12. package/dist/hooks/classify/host-session-identity.d.ts +76 -0
  13. package/dist/hooks/classify/host-session-identity.js +470 -0
  14. package/dist/hooks/classify/index.d.ts +3 -2
  15. package/dist/hooks/classify/index.js +3 -2
  16. package/dist/hooks/classify/paths.d.ts +7 -0
  17. package/dist/hooks/classify/paths.js +35 -0
  18. package/dist/hooks/classify/stdin.d.ts +5 -0
  19. package/dist/hooks/classify/stdin.js +27 -0
  20. package/dist/hooks/dispatcher.d.ts +52 -1
  21. package/dist/hooks/dispatcher.js +538 -45
  22. package/dist/hooks/fixtures/cases.d.ts +16 -2
  23. package/dist/hooks/fixtures/cases.js +175 -0
  24. package/dist/hooks/scope.js +3 -1
  25. package/dist/init-deposit/agent-hooks.d.ts +2 -1
  26. package/dist/init-deposit/agent-hooks.js +8 -1
  27. package/dist/init-deposit/hook-runtime-travel.d.ts +77 -0
  28. package/dist/init-deposit/hook-runtime-travel.js +269 -0
  29. package/dist/intake/clause-derivation.js +9 -3
  30. package/dist/intake/issue-ingest.js +62 -2
  31. package/dist/intake/platform-capabilities.d.ts +9 -2
  32. package/dist/intake/platform-capabilities.js +38 -9
  33. package/dist/orphan-active/evaluate.d.ts +25 -0
  34. package/dist/orphan-active/evaluate.js +193 -128
  35. package/dist/orphan-active/index.d.ts +1 -0
  36. package/dist/orphan-active/index.js +1 -0
  37. package/dist/orphan-active/issue-state.d.ts +121 -0
  38. package/dist/orphan-active/issue-state.js +278 -0
  39. package/dist/platform/cursor-managed-runtime.d.ts +95 -0
  40. package/dist/platform/cursor-managed-runtime.js +241 -0
  41. package/dist/platform/index.d.ts +1 -0
  42. package/dist/platform/index.js +1 -0
  43. package/dist/platform/platform-capabilities.d.ts +23 -1
  44. package/dist/platform/platform-capabilities.js +55 -15
  45. package/dist/policy/ceremony-dial.js +5 -9
  46. package/dist/policy/host-hooks.js +4 -9
  47. package/dist/policy/org-force-on-migration.js +5 -10
  48. package/dist/policy/plan-extensions.d.ts +14 -2
  49. package/dist/policy/plan-extensions.js +24 -3
  50. package/dist/policy/product-signal.js +5 -10
  51. package/dist/policy/require-human-merge.js +5 -9
  52. package/dist/policy/resolve.js +77 -16
  53. package/dist/policy/value-feedback.js +9 -18
  54. package/dist/pr-closeout-attestable/evaluate.d.ts +80 -0
  55. package/dist/pr-closeout-attestable/evaluate.js +306 -0
  56. package/dist/pr-closeout-attestable/index.d.ts +2 -0
  57. package/dist/pr-closeout-attestable/index.js +2 -0
  58. package/dist/pr-protected-issues/gh.d.ts +6 -2
  59. package/dist/pr-protected-issues/gh.js +7 -3
  60. package/dist/pr-wait-mergeable/cascade.d.ts +9 -1
  61. package/dist/pr-wait-mergeable/cascade.js +21 -1
  62. package/dist/pr-wait-mergeable/types.d.ts +2 -0
  63. package/dist/pr-wait-mergeable/wrappers.d.ts +6 -0
  64. package/dist/pr-wait-mergeable/wrappers.js +11 -0
  65. package/dist/preflight/evaluate.d.ts +15 -0
  66. package/dist/preflight/evaluate.js +29 -3
  67. package/dist/product-first-done-gate/acceptance-resolver.d.ts +14 -2
  68. package/dist/product-first-done-gate/acceptance-resolver.js +13 -2
  69. package/dist/product-first-done-gate/evaluate.js +17 -7
  70. package/dist/release/cli-drift-report.d.ts +68 -0
  71. package/dist/release/cli-drift-report.js +189 -0
  72. package/dist/release/index.d.ts +1 -0
  73. package/dist/release/index.js +1 -0
  74. package/dist/release/issue-state-fetch.d.ts +5 -3
  75. package/dist/release/issue-state-fetch.js +86 -21
  76. package/dist/release/native-steps.js +1 -0
  77. package/dist/release/pipeline.js +19 -0
  78. package/dist/release/types.d.ts +14 -0
  79. package/dist/render/constants.d.ts +4 -0
  80. package/dist/render/constants.js +11 -8
  81. package/dist/render/export-spec.js +31 -5
  82. package/dist/render/index.d.ts +1 -1
  83. package/dist/render/index.js +1 -1
  84. package/dist/render/prd-render.d.ts +4 -1
  85. package/dist/render/prd-render.js +82 -23
  86. package/dist/render/project-render.js +14 -7
  87. package/dist/render/scope-outlook.d.ts +2 -0
  88. package/dist/render/scope-outlook.js +3 -0
  89. package/dist/render/spec-render.js +2 -2
  90. package/dist/resolution/package-manager.d.ts +33 -4
  91. package/dist/resolution/package-manager.js +210 -9
  92. package/dist/review-monitor/constants.d.ts +7 -0
  93. package/dist/review-monitor/constants.js +7 -0
  94. package/dist/review-monitor/github-lease.d.ts +98 -1
  95. package/dist/review-monitor/github-lease.js +182 -1
  96. package/dist/review-monitor/lease-comment.d.ts +36 -0
  97. package/dist/review-monitor/lease-comment.js +103 -2
  98. package/dist/scm/call.js +12 -3
  99. package/dist/scm/design-critique-chip.d.ts +1 -0
  100. package/dist/scm/design-critique-chip.js +22 -6
  101. package/dist/scm/gh-rest.d.ts +9 -1
  102. package/dist/scm/gh-rest.js +103 -0
  103. package/dist/scm/readiness.d.ts +2 -0
  104. package/dist/scm/readiness.js +28 -4
  105. package/dist/scope/project-definition-sync.js +14 -7
  106. package/dist/session/git.d.ts +24 -0
  107. package/dist/session/git.js +138 -2
  108. package/dist/session/occupancy.d.ts +238 -12
  109. package/dist/session/occupancy.js +815 -29
  110. package/dist/session/ritual-sentinel.d.ts +5 -0
  111. package/dist/session/ritual-sentinel.js +5 -0
  112. package/dist/session/session-ready.d.ts +5 -1
  113. package/dist/session/session-ready.js +98 -8
  114. package/dist/session/session-start.d.ts +5 -1
  115. package/dist/session/session-start.js +32 -17
  116. package/dist/session/toolchain-preflight.d.ts +13 -3
  117. package/dist/session/toolchain-preflight.js +93 -18
  118. package/dist/session/verify-session-ritual.d.ts +11 -0
  119. package/dist/session/verify-session-ritual.js +60 -15
  120. package/dist/slice/constants.d.ts +1 -1
  121. package/dist/spec-authority/constants.d.ts +10 -2
  122. package/dist/spec-authority/constants.js +53 -8
  123. package/dist/spec-authority/resolver.d.ts +3 -0
  124. package/dist/spec-authority/resolver.js +55 -7
  125. package/dist/subprocess/max-buffer.d.ts +14 -0
  126. package/dist/subprocess/max-buffer.js +15 -0
  127. package/dist/swarm/complete-cohort.d.ts +2 -0
  128. package/dist/swarm/complete-cohort.js +21 -13
  129. package/dist/swarm/index.d.ts +1 -0
  130. package/dist/swarm/index.js +1 -0
  131. package/dist/swarm/launch-cli.js +53 -33
  132. package/dist/swarm/launch.d.ts +8 -0
  133. package/dist/swarm/launch.js +63 -43
  134. package/dist/swarm/pre-dispatch-cli.js +2 -1
  135. package/dist/swarm/pre-dispatch.js +10 -1
  136. package/dist/swarm/subagent-status-dir.d.ts +27 -0
  137. package/dist/swarm/subagent-status-dir.js +42 -0
  138. package/dist/swarm/worktrees.d.ts +17 -3
  139. package/dist/swarm/worktrees.js +48 -4
  140. package/dist/triage/scope/mutations-core.d.ts +2 -6
  141. package/dist/triage/scope/mutations-core.js +23 -55
  142. package/dist/triage/scope-drift/add-ignore.js +5 -39
  143. package/dist/triage/subscribe/index.d.ts +2 -6
  144. package/dist/triage/subscribe/index.js +15 -65
  145. package/dist/triage/welcome/writers.js +15 -74
  146. package/dist/vbrief-build/index.d.ts +2 -1
  147. package/dist/vbrief-build/index.js +2 -1
  148. package/dist/vbrief-build/parity-scenarios.js +5 -5
  149. package/dist/vbrief-build/project-definition-io.d.ts +63 -3
  150. package/dist/vbrief-build/project-definition-io.js +357 -31
  151. package/dist/vbrief-build/project-definition-mutation.d.ts +32 -0
  152. package/dist/vbrief-build/project-definition-mutation.js +43 -0
  153. package/dist/vbrief-validate/conformance.d.ts +1 -0
  154. package/dist/vbrief-validate/conformance.js +85 -8
  155. package/dist/vbrief-validate/main.js +2 -0
  156. package/dist/vbrief-validate/precutover.js +5 -10
  157. package/dist/verify-ac/clauses.d.ts +62 -2
  158. package/dist/verify-ac/clauses.js +183 -111
  159. package/dist/verify-ac/index.d.ts +1 -1
  160. package/dist/verify-ac/index.js +1 -1
  161. package/dist/verify-env/node-runtime.d.ts +8 -4
  162. package/dist/verify-env/node-runtime.js +9 -6
  163. package/dist/verify-env/toolchain-check.d.ts +35 -3
  164. package/dist/verify-env/toolchain-check.js +155 -36
  165. package/dist/verify-source/project-definition-mutation-boundary.d.ts +104 -0
  166. package/dist/verify-source/project-definition-mutation-boundary.js +326 -0
  167. package/package.json +7 -3
@@ -24,7 +24,15 @@ export type HookDecisionCode = "session-start" | "session-start-disabled" | "ses
24
24
  /** Host closed stdin with zero bytes — integration failure, not a policy gate (#2864). */
25
25
  | "stdin-empty" | "ritual-not-ready"
26
26
  /** Product-path write while another live session occupies this worktree (#3433). */
27
- | "occupancy-occupied" | "scope-not-ready" | "write-propose-ready"
27
+ | "occupancy-occupied"
28
+ /** A supported host omitted or malformed its cooperative payload owner (#3611). */
29
+ | "occupancy-identity-unavailable"
30
+ /** Host payload identity conflicts with explicit/environment identity (#3611). */
31
+ | "occupancy-identity-conflict"
32
+ /** Live lease and exact verified ritual state name different owners (#3611). */
33
+ | "occupancy-ritual-mismatch"
34
+ /** Write target resolved to a Git repository that does not share git-common-dir (#3794). */
35
+ | "foreign-repository-deny" | "scope-not-ready" | "write-propose-ready"
28
36
  /** Allowlisted assist/scratch write without active xBRIEF (#1802). */
29
37
  | "write-assist-scratch-ready" | "write-ready" | "read-only-deny" | "spawn-explore-ready"
30
38
  /** Non-lifecycle assist/docs spawn allowed without active xBRIEF (#3080). */
@@ -46,6 +54,8 @@ export interface HookDecision {
46
54
  readonly projectRoot: string;
47
55
  readonly message: string;
48
56
  readonly scopePath: string | null;
57
+ /** Complete host tool input replacement for an exact lifecycle command (#3611). */
58
+ readonly updatedInput?: Readonly<Record<string, unknown>>;
49
59
  }
50
60
  export interface HookDispatchInput {
51
61
  readonly host: HookHost;
@@ -106,6 +116,12 @@ export interface HookPolicySeams {
106
116
  readonly loadAuthzGrants?: (projectRoot: string, state: AuthzState) => readonly HumanOriginGrant[];
107
117
  /** When false, skip writing `.deft/authz/audit.jsonl` (tests). Default true. */
108
118
  readonly authzAudit?: boolean;
119
+ /** Test seam for restricting Task lifecycle rewrites to the Directive source repo. */
120
+ readonly runningInsideDeftRepo?: (projectRoot: string) => boolean;
121
+ /** Test seam for execution-root realpath binding in lifecycle rewrites. */
122
+ readonly realpathLifecycleExecutionRoot?: (path: string) => string;
123
+ /** Test seam for Windows drive-only execution-root payloads (#2787). */
124
+ readonly lifecycleExecutionPlatform?: NodeJS.Platform;
109
125
  }
110
126
  /** POSIX-ish project-relative path for lifecycle matching. */
111
127
  export declare function toProjectRelativePosix(projectRoot: string, targetPath: string): string;
@@ -153,6 +169,41 @@ export declare function isAssistScratchWrite(projectRoot: string, targetPath: st
153
169
  /** Normalize hook project-root resolution on Windows (doubled drive + MSYS `/c/...`). */
154
170
  export declare function normalizeHookProjectRoot(path: string): string;
155
171
  export declare function projectRootFromHookPayload(payload: unknown, fallback: string): string;
172
+ /** Interpolate both roots so a deny names the tree that was judged (#3794). */
173
+ export declare function formatHookRootNote(payloadRoot: string, effectiveRoot: string): string;
174
+ /** Why a mutation target was refused, so the deny message can be specific (#3794). */
175
+ export type EffectiveHookRootRefusal =
176
+ /** Both common-dirs resolved and differ: a proven separate repository. */
177
+ "foreign-repository"
178
+ /** `payloadRoot` is a repository but the target's identity could not be read. */
179
+ | "unproven-identity"
180
+ /** Members of one mutation resolved to two admitted worktrees. */
181
+ | "worktree-span";
182
+ export interface EffectiveHookRootAdmission {
183
+ readonly root: string;
184
+ /** True when the target was refused and the dispatcher must deny (#3794). */
185
+ readonly foreign: boolean;
186
+ readonly candidate: string | null;
187
+ readonly refusal: EffectiveHookRootRefusal | null;
188
+ }
189
+ /**
190
+ * Admit the Git toplevel of the write target only when it shares
191
+ * `--git-common-dir` with `payloadRoot`.
192
+ *
193
+ * Identity resolves to one of three outcomes, not two. A `payloadRoot` that is
194
+ * not a Git repository never posed a containment question, so it keeps today's
195
+ * payloadRoot gating. A `payloadRoot` that *is* a repository, paired with a
196
+ * target that resolved to some other toplevel whose identity cannot be read, is
197
+ * a question asked and left unanswered — that fails closed rather than
198
+ * inheriting payloadRoot's occupancy and ritual state (#3794).
199
+ */
200
+ export declare function admitEffectiveHookRoot(payloadRoot: string, writeTarget: string | null, runGit: GitRunner): EffectiveHookRootAdmission;
201
+ /**
202
+ * Admit every mutation target and require one effectiveRoot. A refused member
203
+ * short-circuits; a span of two admitted worktrees is also refused so
204
+ * occupancy/ritual cannot follow only the declared ApplyPatch path (#3794).
205
+ */
206
+ export declare function admitMutationTargetSet(payloadRoot: string, targets: readonly string[], runGit: GitRunner): EffectiveHookRootAdmission;
156
207
  export declare function isHookHost(value: string): value is HookHost;
157
208
  export declare function isHookEvent(value: string): value is HookEvent;
158
209
  /** Decide a normalized event using only the P0 direct-write policy. */