@deftai/directive-runtime 0.127.0 → 0.129.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 (264) hide show
  1. package/.githooks/_directive-run.sh +30 -0
  2. package/.githooks/pre-commit +4 -24
  3. package/.githooks/pre-push +11 -17
  4. package/Taskfile.yml +16 -15
  5. package/contracts/design-critique.md +5 -0
  6. package/dist/cli-router/route-argv.js +1 -0
  7. package/dist/contract-entry.js +2 -0
  8. package/dist/coverage-hotspots.js +2 -2
  9. package/dist/dispatch.d.ts +1 -1
  10. package/dist/dispatch.js +7 -0
  11. package/dist/policy.d.ts +4 -2
  12. package/dist/policy.js +101 -2
  13. package/dist/pre-pr-run.d.ts +2 -0
  14. package/dist/pre-pr-run.js +40 -0
  15. package/dist/render-cli/capability-map-cli.d.ts +3 -0
  16. package/dist/render-cli/capability-map-cli.js +6 -0
  17. package/dist/setup-wiring.d.ts +16 -1
  18. package/dist/setup-wiring.js +47 -3
  19. package/dist/setup.d.ts +4 -0
  20. package/dist/setup.js +7 -1
  21. package/dist/verify-ac.js +29 -2
  22. package/docs/getting-started.md +2 -0
  23. package/docs/known-limitations.md +1 -0
  24. package/docs/launcher.md +10 -0
  25. package/package.json +1 -1
  26. package/packs/skills/skills-pack-0.1.json +1 -1
  27. package/skills/deft-directive-pre-pr/SKILL.md +13 -3
  28. package/tasks/agent.yml +0 -2
  29. package/tasks/cache.yml +0 -16
  30. package/tasks/capacity.yml +0 -4
  31. package/tasks/change.yml +0 -4
  32. package/tasks/codebase.yml +0 -10
  33. package/tasks/commit.yml +0 -2
  34. package/tasks/coverage.yml +0 -2
  35. package/tasks/decision.yml +0 -4
  36. package/tasks/directive.yml +0 -1
  37. package/tasks/docs.yml +6 -10
  38. package/tasks/engine-invoke.cjs +79 -0
  39. package/tasks/engine-invoke.test.cjs +84 -0
  40. package/tasks/engine.yml +27 -88
  41. package/tasks/eval.yml +0 -8
  42. package/tasks/feedback.yml +0 -2
  43. package/tasks/install.yml +0 -4
  44. package/tasks/issue.yml +0 -3
  45. package/tasks/lifecycle.yml +0 -1
  46. package/tasks/materialize.cjs +246 -0
  47. package/tasks/materialize.test.cjs +103 -0
  48. package/tasks/materialize.yml +13 -0
  49. package/tasks/migrate.yml +0 -6
  50. package/tasks/packs.yml +0 -16
  51. package/tasks/plan-sequence.yml +0 -8
  52. package/tasks/policy.yml +0 -24
  53. package/tasks/pr.yml +0 -6
  54. package/tasks/prd.yml +0 -2
  55. package/tasks/product-signal.yml +0 -10
  56. package/tasks/project.yml +0 -8
  57. package/tasks/reconcile.yml +0 -2
  58. package/tasks/review-monitor.yml +0 -4
  59. package/tasks/roadmap.yml +0 -4
  60. package/tasks/scm.yml +0 -32
  61. package/tasks/scope.yml +0 -30
  62. package/tasks/slice.yml +0 -4
  63. package/tasks/spec.yml +0 -6
  64. package/tasks/subagent.yml +0 -4
  65. package/tasks/swarm.yml +0 -7
  66. package/tasks/toolchain.yml +0 -4
  67. package/tasks/triage-actions.yml +0 -8
  68. package/tasks/triage-bootstrap.yml +0 -1
  69. package/tasks/triage-bulk.yml +0 -5
  70. package/tasks/triage-classify.yml +0 -2
  71. package/tasks/triage-evaluate.yml +0 -1
  72. package/tasks/triage-metrics.yml +0 -2
  73. package/tasks/triage-queue.yml +0 -3
  74. package/tasks/triage-reconcile.yml +0 -1
  75. package/tasks/triage-scope-drift.yml +0 -1
  76. package/tasks/triage-scope.yml +0 -1
  77. package/tasks/triage-smoketest.yml +0 -1
  78. package/tasks/triage-subscribe.yml +0 -2
  79. package/tasks/tutorial.yml +0 -20
  80. package/tasks/umbrella.yml +0 -2
  81. package/tasks/value.yml +0 -2
  82. package/tasks/vbrief.yml +0 -12
  83. package/tasks/verify.yml +0 -140
  84. package/tasks/xbrief.yml +0 -6
  85. package/templates/design-critique-brief.md +3 -0
  86. package/vendor/directive-content/.githooks/_directive-run.sh +30 -0
  87. package/vendor/directive-content/.githooks/pre-commit +4 -24
  88. package/vendor/directive-content/.githooks/pre-push +11 -17
  89. package/vendor/directive-content/Taskfile.yml +16 -15
  90. package/vendor/directive-content/contracts/design-critique.md +5 -0
  91. package/vendor/directive-content/docs/getting-started.md +2 -0
  92. package/vendor/directive-content/docs/known-limitations.md +1 -0
  93. package/vendor/directive-content/docs/launcher.md +10 -0
  94. package/vendor/directive-content/packs/skills/skills-pack-0.1.json +1 -1
  95. package/vendor/directive-content/skills/deft-directive-pre-pr/SKILL.md +13 -3
  96. package/vendor/directive-content/tasks/agent.yml +0 -2
  97. package/vendor/directive-content/tasks/cache.yml +0 -16
  98. package/vendor/directive-content/tasks/capacity.yml +0 -4
  99. package/vendor/directive-content/tasks/change.yml +0 -4
  100. package/vendor/directive-content/tasks/codebase.yml +0 -10
  101. package/vendor/directive-content/tasks/commit.yml +0 -2
  102. package/vendor/directive-content/tasks/coverage.yml +0 -2
  103. package/vendor/directive-content/tasks/decision.yml +0 -4
  104. package/vendor/directive-content/tasks/directive.yml +0 -1
  105. package/vendor/directive-content/tasks/docs.yml +6 -10
  106. package/vendor/directive-content/tasks/engine-invoke.cjs +79 -0
  107. package/vendor/directive-content/tasks/engine-invoke.test.cjs +84 -0
  108. package/vendor/directive-content/tasks/engine.yml +27 -88
  109. package/vendor/directive-content/tasks/eval.yml +0 -8
  110. package/vendor/directive-content/tasks/feedback.yml +0 -2
  111. package/vendor/directive-content/tasks/install.yml +0 -4
  112. package/vendor/directive-content/tasks/issue.yml +0 -3
  113. package/vendor/directive-content/tasks/lifecycle.yml +0 -1
  114. package/vendor/directive-content/tasks/materialize.cjs +246 -0
  115. package/vendor/directive-content/tasks/materialize.test.cjs +103 -0
  116. package/vendor/directive-content/tasks/materialize.yml +13 -0
  117. package/vendor/directive-content/tasks/migrate.yml +0 -6
  118. package/vendor/directive-content/tasks/packs.yml +0 -16
  119. package/vendor/directive-content/tasks/plan-sequence.yml +0 -8
  120. package/vendor/directive-content/tasks/policy.yml +0 -24
  121. package/vendor/directive-content/tasks/pr.yml +0 -6
  122. package/vendor/directive-content/tasks/prd.yml +0 -2
  123. package/vendor/directive-content/tasks/product-signal.yml +0 -10
  124. package/vendor/directive-content/tasks/project.yml +0 -8
  125. package/vendor/directive-content/tasks/reconcile.yml +0 -2
  126. package/vendor/directive-content/tasks/review-monitor.yml +0 -4
  127. package/vendor/directive-content/tasks/roadmap.yml +0 -4
  128. package/vendor/directive-content/tasks/scm.yml +0 -32
  129. package/vendor/directive-content/tasks/scope.yml +0 -30
  130. package/vendor/directive-content/tasks/slice.yml +0 -4
  131. package/vendor/directive-content/tasks/spec.yml +0 -6
  132. package/vendor/directive-content/tasks/subagent.yml +0 -4
  133. package/vendor/directive-content/tasks/swarm.yml +0 -7
  134. package/vendor/directive-content/tasks/toolchain.yml +0 -4
  135. package/vendor/directive-content/tasks/triage-actions.yml +0 -8
  136. package/vendor/directive-content/tasks/triage-bootstrap.yml +0 -1
  137. package/vendor/directive-content/tasks/triage-bulk.yml +0 -5
  138. package/vendor/directive-content/tasks/triage-classify.yml +0 -2
  139. package/vendor/directive-content/tasks/triage-evaluate.yml +0 -1
  140. package/vendor/directive-content/tasks/triage-metrics.yml +0 -2
  141. package/vendor/directive-content/tasks/triage-queue.yml +0 -3
  142. package/vendor/directive-content/tasks/triage-reconcile.yml +0 -1
  143. package/vendor/directive-content/tasks/triage-scope-drift.yml +0 -1
  144. package/vendor/directive-content/tasks/triage-scope.yml +0 -1
  145. package/vendor/directive-content/tasks/triage-smoketest.yml +0 -1
  146. package/vendor/directive-content/tasks/triage-subscribe.yml +0 -2
  147. package/vendor/directive-content/tasks/tutorial.yml +0 -20
  148. package/vendor/directive-content/tasks/umbrella.yml +0 -2
  149. package/vendor/directive-content/tasks/value.yml +0 -2
  150. package/vendor/directive-content/tasks/vbrief.yml +0 -12
  151. package/vendor/directive-content/tasks/verify.yml +0 -140
  152. package/vendor/directive-content/tasks/xbrief.yml +0 -6
  153. package/vendor/directive-content/templates/design-critique-brief.md +3 -0
  154. package/vendor/directive-core/dist/.tsbuildinfo +1 -1
  155. package/vendor/directive-core/dist/content-root.d.ts.map +1 -1
  156. package/vendor/directive-core/dist/content-root.js +8 -1
  157. package/vendor/directive-core/dist/content-root.js.map +1 -1
  158. package/vendor/directive-core/dist/coverage-hotspots/evaluate.d.ts +13 -5
  159. package/vendor/directive-core/dist/coverage-hotspots/evaluate.d.ts.map +1 -1
  160. package/vendor/directive-core/dist/coverage-hotspots/evaluate.js +60 -2
  161. package/vendor/directive-core/dist/coverage-hotspots/evaluate.js.map +1 -1
  162. package/vendor/directive-core/dist/doctor/checks.d.ts.map +1 -1
  163. package/vendor/directive-core/dist/doctor/checks.js +5 -3
  164. package/vendor/directive-core/dist/doctor/checks.js.map +1 -1
  165. package/vendor/directive-core/dist/hooks/scope.d.ts +57 -0
  166. package/vendor/directive-core/dist/hooks/scope.d.ts.map +1 -1
  167. package/vendor/directive-core/dist/hooks/scope.js +171 -0
  168. package/vendor/directive-core/dist/hooks/scope.js.map +1 -1
  169. package/vendor/directive-core/dist/index.d.ts +1 -0
  170. package/vendor/directive-core/dist/index.d.ts.map +1 -1
  171. package/vendor/directive-core/dist/index.js +1 -0
  172. package/vendor/directive-core/dist/index.js.map +1 -1
  173. package/vendor/directive-core/dist/init-deposit/scaffold.d.ts +1 -1
  174. package/vendor/directive-core/dist/init-deposit/scaffold.d.ts.map +1 -1
  175. package/vendor/directive-core/dist/init-deposit/scaffold.js +1 -1
  176. package/vendor/directive-core/dist/init-deposit/scaffold.js.map +1 -1
  177. package/vendor/directive-core/dist/packs/pack-render.d.ts +6 -1
  178. package/vendor/directive-core/dist/packs/pack-render.d.ts.map +1 -1
  179. package/vendor/directive-core/dist/packs/pack-render.js +103 -78
  180. package/vendor/directive-core/dist/packs/pack-render.js.map +1 -1
  181. package/vendor/directive-core/dist/packs/packs-root.d.ts +53 -0
  182. package/vendor/directive-core/dist/packs/packs-root.d.ts.map +1 -0
  183. package/vendor/directive-core/dist/packs/packs-root.js +83 -0
  184. package/vendor/directive-core/dist/packs/packs-root.js.map +1 -0
  185. package/vendor/directive-core/dist/packs/packs-slice.d.ts.map +1 -1
  186. package/vendor/directive-core/dist/packs/packs-slice.js +6 -6
  187. package/vendor/directive-core/dist/packs/packs-slice.js.map +1 -1
  188. package/vendor/directive-core/dist/policy/coverage-mode.d.ts +84 -0
  189. package/vendor/directive-core/dist/policy/coverage-mode.d.ts.map +1 -0
  190. package/vendor/directive-core/dist/policy/coverage-mode.js +226 -0
  191. package/vendor/directive-core/dist/policy/coverage-mode.js.map +1 -0
  192. package/vendor/directive-core/dist/policy/index.d.ts +2 -0
  193. package/vendor/directive-core/dist/policy/index.d.ts.map +1 -1
  194. package/vendor/directive-core/dist/policy/index.js +60 -40
  195. package/vendor/directive-core/dist/policy/index.js.map +1 -1
  196. package/vendor/directive-core/dist/pr-closing-keywords/main.d.ts.map +1 -1
  197. package/vendor/directive-core/dist/pr-closing-keywords/main.js +137 -7
  198. package/vendor/directive-core/dist/pr-closing-keywords/main.js.map +1 -1
  199. package/vendor/directive-core/dist/pre-pr-controller/controller.d.ts +2 -0
  200. package/vendor/directive-core/dist/pre-pr-controller/controller.d.ts.map +1 -1
  201. package/vendor/directive-core/dist/pre-pr-controller/controller.js +109 -14
  202. package/vendor/directive-core/dist/pre-pr-controller/controller.js.map +1 -1
  203. package/vendor/directive-core/dist/pre-pr-controller/evaluate.d.ts +2 -0
  204. package/vendor/directive-core/dist/pre-pr-controller/evaluate.d.ts.map +1 -1
  205. package/vendor/directive-core/dist/pre-pr-controller/evaluate.js +11 -1
  206. package/vendor/directive-core/dist/pre-pr-controller/evaluate.js.map +1 -1
  207. package/vendor/directive-core/dist/pre-pr-controller/index.d.ts +1 -1
  208. package/vendor/directive-core/dist/pre-pr-controller/index.d.ts.map +1 -1
  209. package/vendor/directive-core/dist/pre-pr-controller/index.js +1 -1
  210. package/vendor/directive-core/dist/pre-pr-controller/index.js.map +1 -1
  211. package/vendor/directive-core/dist/pre-pr-controller/phases.d.ts +10 -0
  212. package/vendor/directive-core/dist/pre-pr-controller/phases.d.ts.map +1 -1
  213. package/vendor/directive-core/dist/pre-pr-controller/phases.js +15 -1
  214. package/vendor/directive-core/dist/pre-pr-controller/phases.js.map +1 -1
  215. package/vendor/directive-core/dist/pre-pr-controller/types.d.ts +20 -1
  216. package/vendor/directive-core/dist/pre-pr-controller/types.d.ts.map +1 -1
  217. package/vendor/directive-core/dist/pre-pr-controller/types.js +2 -0
  218. package/vendor/directive-core/dist/pre-pr-controller/types.js.map +1 -1
  219. package/vendor/directive-core/dist/preflight-gh/pre-push.d.ts +40 -3
  220. package/vendor/directive-core/dist/preflight-gh/pre-push.d.ts.map +1 -1
  221. package/vendor/directive-core/dist/preflight-gh/pre-push.js +353 -27
  222. package/vendor/directive-core/dist/preflight-gh/pre-push.js.map +1 -1
  223. package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.d.ts +1 -1
  224. package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.d.ts.map +1 -1
  225. package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.js +1 -1
  226. package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.js.map +1 -1
  227. package/vendor/directive-core/dist/product-first-done-gate/index.d.ts +1 -1
  228. package/vendor/directive-core/dist/product-first-done-gate/index.d.ts.map +1 -1
  229. package/vendor/directive-core/dist/product-first-done-gate/index.js +1 -1
  230. package/vendor/directive-core/dist/product-first-done-gate/index.js.map +1 -1
  231. package/vendor/directive-core/dist/release/main.d.ts.map +1 -1
  232. package/vendor/directive-core/dist/release/main.js +3 -2
  233. package/vendor/directive-core/dist/release/main.js.map +1 -1
  234. package/vendor/directive-core/dist/release/version.d.ts +14 -0
  235. package/vendor/directive-core/dist/release/version.d.ts.map +1 -1
  236. package/vendor/directive-core/dist/release/version.js +28 -0
  237. package/vendor/directive-core/dist/release/version.js.map +1 -1
  238. package/vendor/directive-core/dist/render/project-render.d.ts.map +1 -1
  239. package/vendor/directive-core/dist/render/project-render.js +1 -0
  240. package/vendor/directive-core/dist/render/project-render.js.map +1 -1
  241. package/vendor/directive-core/dist/scope/file-scope-coverage-warn.d.ts +21 -0
  242. package/vendor/directive-core/dist/scope/file-scope-coverage-warn.d.ts.map +1 -0
  243. package/vendor/directive-core/dist/scope/file-scope-coverage-warn.js +95 -0
  244. package/vendor/directive-core/dist/scope/file-scope-coverage-warn.js.map +1 -0
  245. package/vendor/directive-core/dist/swarm/launch-cli.d.ts.map +1 -1
  246. package/vendor/directive-core/dist/swarm/launch-cli.js +12 -0
  247. package/vendor/directive-core/dist/swarm/launch-cli.js.map +1 -1
  248. package/vendor/directive-core/dist/swarm/launch.d.ts +6 -0
  249. package/vendor/directive-core/dist/swarm/launch.d.ts.map +1 -1
  250. package/vendor/directive-core/dist/swarm/launch.js +11 -0
  251. package/vendor/directive-core/dist/swarm/launch.js.map +1 -1
  252. package/vendor/directive-core/dist/swarm/leftover-before-activation.d.ts +27 -0
  253. package/vendor/directive-core/dist/swarm/leftover-before-activation.d.ts.map +1 -0
  254. package/vendor/directive-core/dist/swarm/leftover-before-activation.js +31 -0
  255. package/vendor/directive-core/dist/swarm/leftover-before-activation.js.map +1 -0
  256. package/vendor/directive-core/dist/verify-env/verify-hooks-installed.d.ts +3 -3
  257. package/vendor/directive-core/dist/verify-env/verify-hooks-installed.d.ts.map +1 -1
  258. package/vendor/directive-core/dist/verify-env/verify-hooks-installed.js +7 -11
  259. package/vendor/directive-core/dist/verify-env/verify-hooks-installed.js.map +1 -1
  260. package/vendor/directive-core/dist/verify-source/project-definition-mutation-boundary.d.ts.map +1 -1
  261. package/vendor/directive-core/dist/verify-source/project-definition-mutation-boundary.js +1 -0
  262. package/vendor/directive-core/dist/verify-source/project-definition-mutation-boundary.js.map +1 -1
  263. package/.githooks/_deft-run.sh +0 -47
  264. package/vendor/directive-content/.githooks/_deft-run.sh +0 -47
@@ -705,11 +705,16 @@ REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" || exit 1
705
705
  run_directive verify:encoding --staged --project-root "$REPO_ROOT" || exit $?
706
706
  `;
707
707
  const PRE_PUSH = `#!/usr/bin/env sh
708
+ # deft:pre-pr-bound-push-v1 — refuse-to-downgrade marker (#5804); marker-aware ensureGitHooks only
708
709
  REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" || exit 1
709
710
  # shellcheck source=/dev/null
710
711
  . "$REPO_ROOT/.githooks/_directive-run.sh"
711
712
  run_directive verify:branch --project-root "$REPO_ROOT" || exit $?
713
+ # Enrolled bound pre-PR arm: sole-stdin (do not redirect shared run_directive to /dev/null)
714
+ run_directive pre-pr:run --push-admit --project-root "$REPO_ROOT" || exit $?
712
715
  `;
716
+ /** Monotonic refuse-to-downgrade marker for marker-aware ensureGitHooks (#5804). */
717
+ export const PRE_PUSH_BOUND_PRE_PR_MARKER = "deft:pre-pr-bound-push-v1";
713
718
  /**
714
719
  * Current OVPR helpers plus supported latest-legacy Directive git hooks
715
720
  * (`_deft-run.sh` / `run_deft` / copied-core era). True third-party hooks
@@ -735,10 +740,31 @@ function isOurGitHookBody(rel, body) {
735
740
  const EXECUTABLE_GITHOOKS = new Set([".githooks/pre-commit", ".githooks/pre-push"]);
736
741
  /** AC8.6 / AC2.5 / F-008 — disclosed when hooks files exist but core.hooksPath cannot activate. */
737
742
  export const GIT_HOOKS_INACTIVE_NO_GIT = "Git hooks inactive until git init + eligible repair/self-complete (core.hooksPath not set)";
738
- export function ensureGitHooks(projectRoot) {
743
+ /**
744
+ * True when `rel` is tracked by git in `projectRoot` (#5837). Any git failure
745
+ * (no repo, no git binary) reads as untracked, which keeps the replace path lawful.
746
+ */
747
+ export function isGitTrackedPath(projectRoot, rel) {
748
+ try {
749
+ execFileSync("git", ["-C", projectRoot, "ls-files", "--error-unmatch", "--", rel], {
750
+ stdio: ["ignore", "ignore", "ignore"],
751
+ });
752
+ return true;
753
+ }
754
+ catch {
755
+ return false;
756
+ }
757
+ }
758
+ /** Disclosure for a tracked divergent managed hook kept in place (#5837). */
759
+ export function formatTrackedHookPreserved(rel) {
760
+ return `${rel}: tracked managed hook differs from the template; kept (not a failure). Review and pass --force-githooks to setup to replace it (#5837)`;
761
+ }
762
+ export function ensureGitHooks(projectRoot, options = {}) {
739
763
  const created = [];
740
764
  const modified = [];
741
765
  const conflicts = [];
766
+ const preserved = [];
767
+ const force = options.forceTrackedReplace === true;
742
768
  const files = [
743
769
  { rel: ".githooks/_directive-run.sh", body: GITHOOK_HELPER },
744
770
  { rel: ".githooks/pre-commit", body: PRE_COMMIT },
@@ -751,6 +777,21 @@ export function ensureGitHooks(projectRoot) {
751
777
  conflicts.push(`${file.rel}: existing hook is not Directive-managed; refusing to overwrite (chain or remove manually)`);
752
778
  continue;
753
779
  }
780
+ // Tracked divergent preserve (#5837): never overwrite a committed hook body,
781
+ // even a Directive-managed one, unless the operator forced the replace.
782
+ if (prior !== null && prior !== next && !force && isGitTrackedPath(projectRoot, file.rel)) {
783
+ preserved.push(formatTrackedHookPreserved(file.rel));
784
+ continue;
785
+ }
786
+ // Refuse-to-downgrade: marker-aware installer will not replace a newer enrolled
787
+ // pre-push arm with an older body that lacks the monotonic marker (#5804).
788
+ if (file.rel === ".githooks/pre-push" &&
789
+ prior !== null &&
790
+ prior.includes(PRE_PUSH_BOUND_PRE_PR_MARKER) &&
791
+ !next.includes(PRE_PUSH_BOUND_PRE_PR_MARKER)) {
792
+ conflicts.push(`${file.rel}: refuse-to-downgrade enrolled bound pre-PR arm (${PRE_PUSH_BOUND_PRE_PR_MARKER}); keeping newer hook`);
793
+ continue;
794
+ }
754
795
  const change = trackChange(projectRoot, file.rel, next);
755
796
  if (change.created)
756
797
  created.push(file.rel);
@@ -788,7 +829,10 @@ export function ensureGitHooks(projectRoot) {
788
829
  catch {
789
830
  stillReferenced = true;
790
831
  }
791
- if (!stillReferenced) {
832
+ if (!stillReferenced && !force && isGitTrackedPath(projectRoot, legacyHelperRel)) {
833
+ preserved.push(formatTrackedHookPreserved(legacyHelperRel));
834
+ }
835
+ else if (!stillReferenced) {
792
836
  try {
793
837
  const rem = containedRemove({ root: projectRoot, target: legacyHelperRel });
794
838
  if (rem.removed)
@@ -833,7 +877,7 @@ export function ensureGitHooks(projectRoot) {
833
877
  inactiveDisclosure = `Git hooks inactive: core.hooksPath is '${current}' (not .githooks)`;
834
878
  }
835
879
  }
836
- return { created, modified, conflicts, hooksPathActive, inactiveDisclosure };
880
+ return { created, modified, conflicts, preserved, hooksPathActive, inactiveDisclosure };
837
881
  }
838
882
  const MINIMAL_TASKFILE = `version: '3'
839
883
 
package/dist/setup.d.ts CHANGED
@@ -11,6 +11,8 @@ export interface SetupResult {
11
11
  readonly modified: string[];
12
12
  readonly removed: string[];
13
13
  readonly conflicts: string[];
14
+ /** Tracked divergent managed hooks kept in place; non-failure, present only when non-empty (#5837). */
15
+ readonly preserved?: string[];
14
16
  readonly message: string;
15
17
  }
16
18
  /**
@@ -22,6 +24,8 @@ export declare function runSetup(options: {
22
24
  readonly operation: SetupOperation;
23
25
  readonly from: string;
24
26
  readonly root: string;
27
+ /** Explicit pre-write operator force to replace tracked divergent managed hooks (#5837). */
28
+ readonly forceGitHooks?: boolean;
25
29
  }): SetupResult;
26
30
  export declare function setupChangeCount(result: SetupResult): number;
27
31
  //# sourceMappingURL=setup.d.ts.map
package/dist/setup.js CHANGED
@@ -223,6 +223,8 @@ function buildOwnershipArtifacts(projectRoot) {
223
223
  */
224
224
  export function runSetup(options) {
225
225
  const { operation, from, root } = options;
226
+ let preserved = [];
227
+ const withPreserved = () => (preserved.length > 0 ? { preserved } : {});
226
228
  const created = [];
227
229
  const modified = [];
228
230
  const removed = [];
@@ -297,7 +299,8 @@ export function runSetup(options) {
297
299
  const hooks = ensureHostHooks(root);
298
300
  created.push(...hooks.created);
299
301
  modified.push(...hooks.modified);
300
- const githooks = ensureGitHooks(root);
302
+ const githooks = ensureGitHooks(root, { forceTrackedReplace: options.forceGitHooks === true });
303
+ preserved = githooks.preserved;
301
304
  created.push(...githooks.created);
302
305
  modified.push(...githooks.modified);
303
306
  conflicts.push(...githooks.conflicts);
@@ -350,6 +353,7 @@ export function runSetup(options) {
350
353
  modified,
351
354
  removed,
352
355
  conflicts,
356
+ ...withPreserved(),
353
357
  message: "setup completed with conflicts",
354
358
  };
355
359
  }
@@ -371,6 +375,7 @@ export function runSetup(options) {
371
375
  modified,
372
376
  removed,
373
377
  conflicts,
378
+ ...withPreserved(),
374
379
  message: `setup ${operation} completed for ${runtimeVersion} (${RUNTIME_PREFIX}); ${disclosure}`,
375
380
  };
376
381
  }
@@ -388,6 +393,7 @@ export function runSetup(options) {
388
393
  modified,
389
394
  removed,
390
395
  conflicts,
396
+ ...withPreserved(),
391
397
  message: `setup ${operation} completed for ${runtimeVersion} (${RUNTIME_PREFIX})`,
392
398
  };
393
399
  }
package/dist/verify-ac.js CHANGED
@@ -12,7 +12,7 @@ import { join, resolve } from "node:path";
12
12
  import { fileURLToPath } from "node:url";
13
13
  import { resolveSessionCompletedVerifyAcTarget } from "../vendor/directive-core/dist/check/index.js";
14
14
  import { formatRejectedLedger, resolveLiteralAcceptanceDetailed, } from "../vendor/directive-core/dist/literal-acceptance/index.js";
15
- import { emitVerifyAcTerminalOutcome, evaluateVerifyAcFromPath, readAdmittedSourceDigest, readAdmittedSourceSentences, readPlanAcceptance, resolveAcceptanceGateProfile, resolveSoftMissingAcTargets, } from "../vendor/directive-core/dist/product-first-done-gate/index.js";
15
+ import { emitVerifyAcTerminalOutcome, evaluateVerifyAcFromPath, readAdmittedSourceDigest, readAdmittedSourceSentences, readBranchBindContext, readPlanAcceptance, resolveAcceptanceGateProfile, resolveSoftMissingAcTargets, } from "../vendor/directive-core/dist/product-first-done-gate/index.js";
16
16
  /** Parse verify:ac CLI args. */
17
17
  export function parseArgs(argv) {
18
18
  const parsed = {
@@ -287,11 +287,38 @@ export function run(argv) {
287
287
  }
288
288
  }
289
289
  else if (args.softMissingXbrief) {
290
+ const bindContext = readBranchBindContext(projectRoot);
290
291
  const selected = resolveSoftMissingAcTargets(projectRoot, {
291
292
  env: process.env,
292
293
  scannedPaths: found.paths,
294
+ branchBind: { ...bindContext, env: process.env },
293
295
  });
294
- if (selected.kind === "one") {
296
+ if (selected.kind === "untied") {
297
+ // #5855 P3: completed-target precedence, then soft-missing (no AC claimed).
298
+ const completed = resolveSessionCompletedVerifyAcTarget({
299
+ projectRoot,
300
+ env: process.env,
301
+ });
302
+ if (completed.kind === "target") {
303
+ paths = [completed.path];
304
+ if (!args.quiet) {
305
+ process.stdout.write(`verify:ac targeting just-completed brief (#3357): ${completed.path}\n`);
306
+ }
307
+ }
308
+ else if (completed.kind === "cannot") {
309
+ process.stderr.write(`${completed.message}\n`);
310
+ emitVerifyAcTerminalOutcome({ projectRoot, env: process.env, outcome: "config-error" });
311
+ return 1;
312
+ }
313
+ else {
314
+ if (!args.quiet) {
315
+ process.stdout.write(`${selected.message}\n`);
316
+ }
317
+ emitVerifyAcTerminalOutcome({ projectRoot, env: process.env, outcome: "soft-missing" });
318
+ return 0;
319
+ }
320
+ }
321
+ else if (selected.kind === "one") {
295
322
  paths = [selected.path];
296
323
  if (!args.quiet) {
297
324
  process.stdout.write(`verify:ac soft-missing multi-active (#4285): selected ${selected.path}\n`);
@@ -39,6 +39,8 @@ Two published packages: global **`@deftai/directive`** (launcher) and project-pi
39
39
 
40
40
  Framework maintainers of this repository use a separate Node 24 pin; see [CONTRIBUTING.md](../../CONTRIBUTING.md).
41
41
 
42
+ Maintainer execution on this repo: after `git pull` / FF, hooks and ordinary `task <verb>` use the pin under `node_modules/@deftai/directive-runtime`. Tip dogfood without publishing is an explicit `task materialize:runtime` into **this** checkout only (each worktree installs/materializes its own pin). See [launcher.md](./launcher.md).
43
+
42
44
  ---
43
45
 
44
46
  ## Installation
@@ -20,6 +20,7 @@ Accepted product decisions for the launcher + pinned-runtime install model. Docu
20
20
  | **Only package/readiness ignore entries change** | Ignore updates cover `node_modules` and `.deft/directive/wiring-ready.*.json`; `GENERATION.json` stays committed | Broader housekeeping stays where it is |
21
21
  | **Node 20 is best-effort** | Warning on Node 20; gates test 22 and 24 | Broad compatibility without blocking |
22
22
  | **`@deftai/directive` is the launcher** | Adding it locally does not activate a project; meaning changes from “the product” to “the launcher” at the split | Pin `@deftai/directive-runtime` via `directive install` |
23
+ | **FF alone is not tip dogfood** | On the maintainer monorepo, ordinary `task` and hooks stay on the checkout pin; workspace `packages/runtime/dist` is not a silent ordinary-verb fallback (#5805) | Run `task materialize:runtime` in the checkout that should dogfood tip; dest worktrees do not inherit primary materialize |
23
24
  | **Hooks cannot run while their runtime package is absent** | Host may block edits until packages are restored | No fallback to another version; recover with `npm i -g @deftai/directive`, then `directive install --repair` |
24
25
  | **No `--force`** | Conflicts are named and left | Destructive bypass is out of scope |
25
26
  | **Three private packages are not consumable** | `directive-core`, `directive-content`, and `directive-types` are not on npm for external use | Bundled into the runtime; loose ranges were part of the bug |
package/docs/launcher.md CHANGED
@@ -32,6 +32,16 @@ npm i -g @deftai/directive
32
32
  directive install --repair
33
33
  ```
34
34
 
35
+ ## Maintainer dogfood (this repository)
36
+
37
+ On the Directive monorepo, ordinary unprefixed `task <verb>` paths and Git hooks both execute the **checkout pin** at `node_modules/@deftai/directive-runtime/dist/bin.js` (#5805 / AC9.9). Fast-forwarding `master` alone does not run tip source. Tip without a public publish:
38
+
39
+ ```bash
40
+ task materialize:runtime
41
+ ```
42
+
43
+ That stages and packs tip via `packages/runtime/scripts/stage-bundle.mjs` + `pack-staged-runtime.mjs`, then replaces **this checkout's** pin only (no `package.json` / lockfile location-spec rewrite; primary materialize does not update dest worktree pins). CI tip probes that call `packages/runtime/dist/bin.js` directly stay carved out.
44
+
35
45
  ## Related
36
46
 
37
47
  - [Known limitations](./known-limitations.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive-runtime",
3
- "version": "0.127.0",
3
+ "version": "0.129.0",
4
4
  "description": "Directive runtime — pinned product commands, hooks, content, and engine.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://deftai.github.io/directive/",
@@ -207,7 +207,7 @@
207
207
  ],
208
208
  "path": "skills/deft-directive-pre-pr/SKILL.md",
209
209
  "version": "0.1",
210
- "body": "# Deft Directive Pre-PR -- Read, Write, Lint, Diff, Loop\n\nStructured self-review loop agents run before submitting a PR. Catches inconsistencies, missing enforcement markers, incomplete acceptance criteria, scope creep, and unintended changes before they reach the reviewer.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**See also**: [deft-directive-review-cycle](../deft-directive-review-cycle/SKILL.md) | [deft-directive-build](../deft-directive-build/SKILL.md) | [RWLDL tool](../../tools/RWLDL.md)\n\n> **Formerly `deft-rwldl`** -- renamed and scoped to PR readiness. For the broader iterative quality improvement loop (micro/macro review), see [tools/RWLDL.md](../../tools/RWLDL.md).\n\n## Branch-Protection Policy Guard\n\n! Before entering Phase 1 (Read), run the skill-level branch-policy guard documented in `task policy:show` / dual-invoke `deft verify:branch` (#746 / #747). Halt before any state mutation (the Phase 2 Write phase, the Phase 3 Lint phase that may touch files) when the policy is unresolvable AND no env-var bypass is active:\n\n```\ndeft verify:branch\n```\n\nor `task deft:verify:branch` when the consumer Taskfile include is present. Do not add a consumer `verify:branch` task. Pre-PR is the last gate before push, so a stale / unresolvable policy here is the highest-leverage place to catch the bug before it reaches the bot reviewer.\n\n## Deterministic Questions Contract\n\n! Every numbered-menu prompt rendered in this skill (per-finding decision menus in Phase 4 Diff, the Phase 5 Loop restart-vs-exit gate) MUST follow [`../../contracts/deterministic-questions.md`](../../contracts/deterministic-questions.md): the final two numbered options MUST be `Discuss` and `Back`, in that order. The Discuss-pause semantic is documented verbatim there -- implicit resumption is forbidden.\n\n\n## Ordered-plan target gate (#2402)\n\n! Before opening or pushing a PR, when an ordered-plan sequence may be active, verify the work unit matches the current authorized entry:\n\n1. Resolve the current entry kind and id:\n\n```\ntask plan-sequence:current\n```\n\n Use `task plan-sequence:current -- --json` when you need machine-readable `kind` / `id` fields from the current entry.\n\n2. Verify with the **entry kind** (not hardcoded `pr` — `story` / `issue` entries are common):\n\n```\ntask verify:plan-sequence -- --target-kind <entry-kind> --target <entry-id>\n```\n\n- ! Exit non-zero → fail closed; do not open an unauthorized PR.\n- ! Exit 0 with \"skipped (no active ordered-plan sequence)\" → proceed under normal pre-PR rules.\n- ⊗ Hardcode `--target-kind pr` when the current entry is `kind=story` or `kind=issue` — the verifier matches entry kind exactly (#2662).\n- ! After the PR's review cycle completes successfully, run `task plan-sequence:advance` so \"next\" resolves to the following entry (or exhausted).\n- ⊗ Treat skill-chaining or \"what's next?\" as permission to open a PR outside the current sequence entry.\n\n## Three-axis candidate validation (#4888)\n\nGitHub `mergeable_state` is **textual only**. Post-open behavioral/policy gates stay invisible until the merge-chokepoint `task check` / `deft check` runs against the current base (#4888).\n\n- ! On **conflict-resolve** and **behind-rebase** (PR open; local HEAD matches live remote PR head), MUST treat the merge-chokepoint full gate as candidate validation against current base — not optional polish. Prefer `deft check`; else tree-correct `task check` / `task deft:check`. Then MUST call `evaluateNonCascadeCandidateGreen` with an attestation from `buildCandidateValidationAttestationFromProbe` (allowlisted probe exit 0; blessed producer) keyed to `(pr_head_sha, target_head_sha)`. Fail closed names the probe.\n- ! On **pre-push**, MUST run that same merge-chokepoint full gate locally against current base before pushing. Do **not** require `evaluateNonCascadeCandidateGreen` until after push when a PR exists and local HEAD matches the live remote PR head — then obtain the SHA-pair attestation. First push (no PR yet) and tip-ahead-of-remote pushes use the local gate only (#4888).\n- ! Frame `#4883` CLEAN / forge `mergeable_state=clean` as axis-1 necessity only — never three-axis sufficiency.\n- ⊗ Skip the merge-chokepoint `task check` after conflict-resolve or behind-rebase because GitHub shows mergeable/clean (#4888).\n- ⊗ Call `evaluateNonCascadeCandidateGreen` as a pre-push blocker when no PR exists or local HEAD does not yet match the remote PR head (#4888).\n- ⊗ Satisfy semantic-drift visibility with a withdrawn Python semantic-drift script SoT (TS evaluateSemanticGreen owns the probe).\n- Depth: `scm/github.md` § Cascade / Three-axis (#4888); forge supersession `#633`/`#1517`.\n\n## Gate throughput — iteration fast lane vs merge chokepoint (#1704)\n\n> **Invariant:** every change MUST pass the full gate at least once before merge. Pre-PR is the merge chokepoint — NOT every iteration commit.\n\n- ! **Iteration lane (Phases 2–3 loop):** use affected/static gates on changed paths — `vitest run --coverage <paths>`, relevant `verify:*` on touched files, `task coverage:hotspots` — instead of full `task check` on every pre-PR iteration. Phase 3 sits inside this loop, so it uses the iteration lane, not a full suite.\n- ! **Merge chokepoint (once after the loop, before push/PR):** prefer `deft check` once before push/PR. If the CLI is missing, use the tree-correct task form (`task deft:check` on include-only consumers; `task check` in framework source). These are one gate, not two sequential runs. Do not add a fourth probe (#2893 / #4379). A bare `task check` miss on an include-only consumer is not \"gate unavailable\". This is a #1704 revision of the prior Phase 3 Lint exit + final confirm (two runs, one inside every iteration). The escape-rate guard below still applies; do not invent a separate surface.\n- ! **Escape-rate safety (#1703 Tier-1):** before recommending fleet-wide fast-lane tightening, cite `#1703` Tier-1 telemetry (`helped/crud-metrics.jsonl`) and `task eval:health` — do NOT invent a separate escape-rate surface.\n- ~ **In-engine incrementality (#1713):** content-hash cache + runner-delegated affected selection are sibling work (#1713).\n- ⊗ Treat Phase 3c targeted coverage alone as PR-ready without full `task check` at the merge chokepoint.\n- ⊗ Run full `task check` inside every pre-PR Phase 3 iteration — Phase 3 is inside the loop; the chokepoint is once after exit.\n\n## When to Use\n\n- ! Before pushing a branch for PR creation\n- ! After completing implementation but before the final merge-chokepoint `deft check` (#1704 / #4379)\n- ~ After addressing bot reviewer findings (run one pre-PR pass before pushing the fix batch)\n- ? During mid-implementation checkpoints on large changes\n\n## Controller invocation (#4912)\n\n! Start the prescribed pre-PR workflow through `deft pre-pr:run`. Opening this skill file is not completion. A generic mark-complete cannot mint a pass.\n\n- ! `deft pre-pr:run` starts a controller run. The run id is a lookup hint; the private store is authoritative.\n- ⊗ Treat reading this SKILL.md as pre-PR completion.\n- ⊗ Mint a passing record from an author-supplied run id, checkbox, gitignored marker, or generic mark-complete.\n- ⊗ Reuse a one-PR-unit verdict as pre-PR success.\n\nLive skip detection on deftai/directive additionally requires Limb 5 enrollment (#4976).\n\n## Loop Phases\n\nEach iteration proceeds through all phases in order. Do NOT skip phases or reorder them.\n\n### Phase 1 -- Read\n\n! Re-read each changed file end-to-end (`git diff master --name-only` to get the list).\n\n- ! Read every changed file in full -- do not skim or skip sections\n- ! Compare each file against its scope xBRIEF acceptance criteria in `xbrief/active/`\n- ~ If changed files include `xbrief/PROJECT-DEFINITION.xbrief.json`, a configured `codebase-map` provider artifact, or `.planning/codebase/MAP.md`, read the MAP and canonical metadata together. The MAP is orientation; `plan.architecture.codeStructure` and provider artifacts remain authoritative.\n- ! When adding a `!` or `⊗` rule that prohibits a specific command, pattern, or behavior, search the same file for any `~`, `≉`, or prose that recommends or permits the same command/pattern -- resolve all contradictions in the same commit before pushing\n- ! When strengthening a rule (e.g. upgrading `~` to `!`), grep for the term in the full file and verify no weaker-strength duplicate remains\n- ! When adding a weaker rule (`~`, `≉`, or prose that recommends or permits a command/pattern) beside an existing `!` or `⊗` for the same command/pattern in the same file, resolve the contradiction in the same commit — weaken-beside-a-MUST is the same-commit reconcile as adding or strengthening a MUST (#4135 / #4324)\n- ~ Note any inconsistencies, missing RFC2119 markers, stale cross-references, or incomplete sections\n- ~ Check that CHANGELOG.md entries match the actual changes made\n- ! If the change alters **user-visible behavior**, apply [coding/docs.md](../../coding/docs.md) (#447): update the matching user-facing surface (CHANGELOG when user/operator-visible, CLI help / commands.md for new or changed verbs/flags, README/getting-started for install/first-run, skill/strategy triggers when entry points change) in this PR\n- ⊗ Claim documentation was updated without those files in the diff\n- ~ Pure internal refactors with no user-visible behavior change do not require user-facing doc updates\n\n### Phase 2 -- Write\n\n! Fix any issues found in the Read phase.\n\n- ! Fix inconsistencies, add missing RFC2119 enforcement markers (`!`, `~`, `⊗`)\n- ! Complete any incomplete acceptance criteria or missing content\n- ! Update stale cross-references\n- ~ Improve clarity where intent is ambiguous\n- ⊗ Make changes beyond the scope of the current task -- if you notice unrelated issues, file them as ideas or future work, do not fix them now\n\n### Phase 3 -- Lint\n\n! Run the iteration-lane gates and fix any failures (#1704). Full `task check` is the post-loop merge chokepoint, not this per-iteration phase.\n\n- ! Run affected/static gates on changed paths (`vitest run --coverage <paths>`, relevant `verify:*`, `task coverage:hotspots`) — not full `task check` inside the loop\n- ! Fix all failures before proceeding to Phase 3b\n- ~ If a lint fix requires changing a file, that counts as a change for the Loop phase\n\n~ **Windows + Grok Build (#1353):** Avoid `|`, `>`, or `2>&1` in `run_terminal_command` strings -- use Python `pathlib`/`subprocess` or plain task commands instead.\n\n### Phase 3c -- Coverage headroom (#2683 / #5421)\n\n! Before the full `task check` coverage gate, decide coverage applicability for the complete reviewed diff, then either measure headroom or record authorized not-applicable.\n\n- ! Run the shared applicability path (`deft coverage:hotspots` classifies before requiring Istanbul when the reviewed base/head/tree binding is available): **applicable** → measured path; **not-applicable** → skip channel; **refuse** → fail closed.\n- ! When applicable: run targeted coverage first: `vitest run --coverage <changed-paths>` (or language equivalent) — not only full `task check`. Then run `task coverage:hotspots` / `deft coverage:hotspots` for uncovered branches / headroom. Exercise both sides of new branches (ternary / early-return / catch / default switch / `||` / `??`). Treat barely ≥ floor as insufficient — aim for ≥ floor + 0.3–0.5pp headroom on the branch metric relative to **your project's** vitest/coverage floor (may differ from 85%). Complements `deft verify:forward-coverage` (#1310) and `--allow-coverage-debt=#N` (#2573).\n- ! When not-applicable (every changed path proven inert): record `coverage_headroom` via **non-zero exit + exact skip reason** `reviewed diff has no coverable paths` (`ALLOWED_SKIP_REASONS.coverage_headroom`). The controller re-derives applicability from the run's PrePrInputBinding before honoring that skip. Hotspots exit 3 emits the machine-readable N/A artifact for this channel.\n- ! When coverage is N/A: do **not** invent `vitest --coverage`; keep applicable static / `verify:*` gates in Phase 3. Do not treat \"no coverable code\" as \"no lint obligations.\" A closed `lint_iteration` skip remains deferred.\n- ⊗ Satisfy `coverage_headroom` with an unbound exit-0 changed-file audit or any free-form exit-0 command that is not the authorized `deft coverage:hotspots` measured pass.\n- ⊗ Invent an Istanbul report, ask the operator to waive an irrelevant metric, or treat report-missing alone as not-applicable.\n- ⊗ Soften `coverage_headroom` to optional, lower the coverage floor, or claim a general docs-only CI bypass.\n- ! Toolchain-only N/A for executable changes on non-Istanbul projects (Coverlet adapters) remains open — do not paper over executable .NET with inert-classifier N/A.\n\n### Phase 3b -- Auto-Render Exports\n\n! If `xbrief/specification.xbrief.json` exists, refresh rendered exports before the diff check:\n\n- ! Run `task prd:render` if `PRD.md` already exists in the project root\n- ! Run `task spec:render` if `SPECIFICATION.md` already exists and does not contain `<!-- deft:deprecated-redirect -->`\n- ! If `plan.architecture.codeStructure`, a configured `codebase-map` provider artifact, or `.planning/codebase/MAP.md` changed, run `task codebase:map` and `task verify:codebase-map-fresh` so the generated orientation projection matches its canonical inputs.\n- ⊗ Create export files that don't already exist -- only refresh existing ones\n- ⊗ Hand-edit `.planning/codebase/MAP.md` to satisfy review; update canonical metadata or provider artifacts, then regenerate it\n\n### Phase 4 -- Diff\n\n! Review the full diff against the base branch for unintended changes.\n\n```\ngit --no-pager diff master\n```\n\n- ! Verify no files outside the task scope were modified\n- ! Check for scope creep -- changes that go beyond the spec task acceptance criteria\n- ! Verify no debug code, TODO comments, or temporary scaffolding remains\n- ! Confirm no unintended whitespace-only changes or formatting drift\n- ! **Closing-keyword policy (#3015 class D / #737 Layer 0):** Default PR body uses `Tracking: #N` / `Related: #N` / `Refs #N` only. Use `Closes` / `Fixes` / `Resolves #N` only when the **full issue DoD** is met (not Phase A partial / multi-phase mid-stream).\n- ⊗ Write `Closes #N Phase A`, `only if`, `partial`, or other conditional English around a real closing keyword — GitHub ignores the condition and auto-closes (#3015 enterprize#29).\n- ! **Run `task pr:check-closing-keywords` before opening the PR (default mode `both` = FP #737 + intent #3015).** Offline: `--body-file` / `--commits-file`. Scans body and commits for closing-keyword tokens in negation / quotation / example / code-block contexts (FP) and for any unallowlisted real close (intent). When full DoD close is intentional, pass `--allow-close <N,M>` (CLI allowlist only — body trailers are not an authorization path). FP-only: `--mode fp`. Known-safe quoted tokens: `--allow-known-false-positives`. Recurrence stack: #167, #697 / #698, #401 / #700, #735 (class A), #3015 (class D enterprize#29).\n- ~ Verify the diff tells a coherent story -- a reviewer reading it top-to-bottom should understand the change\n- ~ If the PR adds or moves any documentation, verify each new doc is reachable from the AGENTS.md reference chain -- an orphan doc is discovered <10% of the time yet still costs context when found (the reference-chain contract, #644 / #647). Add a pointer or fold it in rather than leaving it stranded.\n- ! **Gate integrity (#3156):** If the branch cleared a red gate, confirm the fix changed the product/process/test under test — not the gate definition, verifier, reward, required check, coverage floor, policy flag, or eval fixture that was failing. Deliberate gate changes need issue/PR rationale (constitution-tier disposal under #3164). Doctrine: [docs/gate-integrity.md](../../docs/gate-integrity.md). Refine-internal SkillOpt region stays on #2436 — do not re-implement it here.\n\n### Phase 5 -- Loop\n\n! Decide whether to restart or exit.\n\n- ! If ANY fixes were made in Phase 2 (Write) or Phase 3 (Lint): restart from Phase 1 (Read)\n- ~ Phase 3b auto-renders are intentional output refreshes; they do NOT trigger a loop restart\n- ! If a full Read-Write-Lint-Diff cycle produced zero changes: exit the loop\n- ~ Track iteration count -- if you exceed 3 iterations, pause and assess whether you are oscillating between competing fixes\n\n\n\n## Budget-aware pre-PR depth (#3266)\n\nWhen session effort-budget is hard-capped (`DEFT_MAX_TURNS` / `DEFT_MAX_BUDGET` / session:start `effort_budget`):\n\n- ! Complete the merge-chokepoint path that proves stated AC (full `task check` once, stated AC evidence) before optional polish that only deepens beyond the bar.\n- ! If remaining budget cannot fund another full Read-Write-Lint-Diff pass **and** a fix for a new finding, stop after the stated-pass chokepoint and record `deepening_skipped=true` with reason (#1006).\n- ! Dual-stop pre-PR defaults (max 3 polish / 2 no-diff) still apply; under a hard cap, prefer fewer polish iterations once AC + check are green.\n- ⊗ Start an unbounded self-imposed verification suite that exceeds stated AC while the hard budget is nearly exhausted (#3266).\n\n## Product-first done-gate (#3284) / literal AC (#3267)\n\n- ! Before Phase 3 Lint exit / push, when the active scope xBRIEF has acceptance commands (`plan.acceptance` or #3267 metadata/narratives), run `task verify:ac -- <active-xbrief>` and fail closed on exit 1. (`verify:literal-ac` is the mechanism alias.)\n- ! Commands must be the exact strings from the task statement — same flags and cwd. Self-chosen verification is supplementary only.\n- ! Full `task check` already runs `verify:ac` first; still run it explicitly before push when AC is stated so failures are visible without the full hygiene suite.\n- ⊗ Skip AC run on rapid/minimal ceremony dial — rapid = AC-only; AC never degrades when commands exist (#3284 / #3156).\n\n## Product-oracle gate integrity (#3322 / #3156)\n\nA red product verification may be resolved only by a product change or an independently re-derived oracle (both sides rebuilt from scratch, different method). In-place repair of the failing comparison then pass is not a pass — it is an unresolved discrepancy.\n\n- ! When a product oracle is red, resolve it by changing the product or by independently re-deriving the oracle, and record `independent_rederivation` on the run-summary `verification` event.\n- ! Emit a run-summary verification event `{check_id, method_fingerprint, outcome}` for each product-oracle attempt when `DEFT_RUN_SUMMARY_PATH` is set. `fail` then a different `method_fingerprint` then `pass` on one check id is machine-flagged.\n- ! `task verify:ac` treats comparison-method mutation as unresolved (exit non-zero) unless independent re-derivation is recorded. Lead the done report with any unresolved discrepancy (#1006).\n- ⊗ Self-adjudicate a red product oracle by editing the comparison (reference file, diff invocation, one-sided regenerate) and shipping the new pass as success.\n\n## Probe-then-fill remote claims (#3120)\n\n! Before filling any **remote** handoff field (PR URL, PR number, commit/HEAD SHA, CI green/success, review score) or claiming `status: pass` / ship/gate done, MUST **probe then fill**:\n\n1. Run same-turn `git` + forge probes (examples: `git rev-parse HEAD`, `gh api repos/<owner>/<repo>/pulls/<N>`, `task pr:watch -- <N> --one-shot`, checks API).\n2. Copy IDs / URLs / SHAs / scores **only** from that probe JSON/text into the evidence block.\n3. Set `proof_status: bound` and attach short raw probe snippets (`command` + `snippet`) for each remote claim.\n\n! Handoff evidence axes: **work** (local) / **ship** (pushed branch or PR) / **gate** (CI/review on HEAD). `proof_status` is `bound` | `unbound` | `n/a-no-remote-claim`.\n! **Legal partial:** local work `done` + ship `not_started` / `blocked` **without** PR/SHA/CI/review fields and `proof_status: n/a-no-remote-claim` (or `status: partial`) is valid — do not invent ship state.\n! **Fail ranking:** **invented-done** (false/unbound remote artifacts under pass) is **stricter** than **empty-done**. Unbound remote claims → invalid evidence (fail), not pass-with-notes.\n! Machine check: `validateHandoffEvidence` in `packages/core/src/handoff-evidence/` (see `templates/agent-prompt-preamble.md` §11).\n⊗ Fill PR / SHA / CI / review fields from recollection, narration, or prior-turn memory.\n⊗ Claim `status: pass` with remote fields when `proof_status` is not `bound` or probes are missing (#3120).\n\n## First-PR-open closed-PR path-intersection (#1178)\n\n! Own the **first-PR-open** closed-PR path-intersection pass here (and any implement-leaf `gh pr create` bypass MUST call this same contract). Swarm Phase 6 stays merge / protected-issue / finalize and MUST point at this pre-pr owner — ⊗ treat Phase 6 as the first-open closed-PR search owner.\n\nShared retrieval tokens match article-review pre-filing (#1178): closed-PR walk uses named default `PREFILING_CLOSED_PR_WINDOW` = **100**, outcome tokens `window-exhausted` | `list-exhausted` | `cap` | `error`, and file-list pagination must complete before path-intersection.\n\n- ! Before opening a product PR, walk closed/merged PRs inside `PREFILING_CLOSED_PR_WINDOW` (`GET .../pulls?state=closed&sort=updated&direction=desc`).\n- ! For each candidate, paginate `GET .../pulls/<n>/files` to completion. If file enumeration truncates or errors, record `error` / incomplete — ⊗ path-intersect on a truncated file list as a verified clear.\n- ! Mechanical trigger: any closed/merged PR inside the window whose files intersect the candidate changed-path set → MUST cite that PR and state what differs (disposition may still be `partial` / `unresolved`; overlap alone is not duplicate-scope proof).\n- ! Record the walk outcome token. Bounded no-match requires `window-exhausted` or `list-exhausted` with complete file lists for inspected PRs.\n- ⊗ Open a product PR with no closed-PR path-intersection pass.\n- ⊗ Import #5099 feedback:file closed-walk constants for this pass unless separately exported (cite-only).\n\n## Exit Condition\n\n! Exit when a complete Read-Write-Lint-Diff cycle produces **zero changes** -- no file edits in Write, no lint fixes in Lint, and no scope issues in Diff.\n\nAfter exiting:\n- ! Run the merge chokepoint once: prefer `deft check`; if the CLI is missing, use the tree-correct task form (`task deft:check` on include-only consumers; `task check` in framework source). These are one gate, not two sequential runs. Do not add a fourth probe (#2893 / #4379). Phase 3 used the iteration lane, so this is the first full suite in the loop, not a second run.\n- ! If that post-loop full gate is red and the fix changes files, restart from Phase 1 (Read). Do not only re-run the gate — those edits must pass Read and Diff (#4324).\n- ! After that restart exits with zero changes, run the same tree-correct full gate once again (recovery after a red merge chokepoint).\n- ! Re-run the full gate only after a red merge chokepoint or a new commit.\n- ~ The branch is now ready for push and PR creation\n\n\n## Significant decision log (#1396)\n\n! Before push, if this PR encodes a **significant** choice not already recorded, run `task decision:write` (significance filter: architecture, product behavior, security, boundaries, data model, topology, hard-to-reverse process).\n\n~ Check `task decision:list` for related process policy so the PR does not silently reverse a dogfood decision.\n\n⊗ Invent revisit-free rationale in the PR body as a substitute for a decision record when the choice is significant.\n⊗ Noise the log with trivial scope completions.\n\nDocs: `docs/decision-log.md`.\n\n## Anti-Patterns\n\n- ⊗ Open a product PR with no closed-PR path-intersection pass inside `PREFILING_CLOSED_PR_WINDOW` (#1178)\n- ⊗ Submit a PR without running this pre-PR loop (Read-Write-Lint-Diff) -- every PR branch should pass at least one full cycle\n- ⊗ Exit the loop after the Lint phase without completing the Diff phase -- Diff catches scope creep and unintended changes that Lint cannot detect\n- ⊗ Skip the Read phase and jump directly to Lint -- Read catches semantic issues (missing content, wrong RFC2119 markers, incomplete acceptance criteria) that linters do not check\n- ⊗ Make out-of-scope fixes during Write -- this introduces scope creep that Diff will flag, forcing another iteration\n- ⊗ Ignore the iteration count -- more than 3 iterations usually indicates oscillating fixes or an unclear spec task\n- ⊗ Add a prohibition (`!` or `⊗`) without scanning the same file for conflicting softer-strength rules (`~`, `≉`) that reference the same term\n- ⊗ Add a weaker rule (`~` / `≉`) beside an existing `!` / `⊗` for the same command/pattern without reconciling in the same commit\n- ⊗ After a red post-loop `task check`, fix files and re-run only the gate without restarting Read-Write-Lint-Diff\n- ⊗ Skip `task pr:check-closing-keywords` (#737) before pushing a PR. Intent mode (#3015) also refuses bare/conditional real `Closes #N` without `--allow-close`. The negation-context substring match is the Layer 0 (prevention) gate that prevents the recurring auto-close of umbrella / staying-OPEN issues observed in #697 (closed #642), #401 (closed #642), #700 (closed #233), and #735 (closed #734) -- each incident required manual reopen and downstream cleanup. The lint's three-state exit (0 clean / 1 hits found / 2 config error) MUST be treated as a hard refusal: rewrite the PR body / commit messages until clean, OR pass `--allow-known-false-positives` ONLY for legitimately-quoted occurrences (test fixtures, documentation that discusses the trigger token literally). See `skills/deft-directive-swarm/SKILL.md` Phase 6 Step 1 for the corresponding Layer 3 (recovery) `pr:check-protected-issues` rule (#701)\n- ⊗ Invent remote PR/SHA/CI/review claims in handoff evidence without same-turn probe binding — invented-done (#3120)\n- ⊗ Fill remote ship/gate fields from memory when only local work completed; legal partial omits PR fields (#3120)\n- ⊗ Clear a failing gate by editing the gate (definition, verifier, reward, required check, coverage floor, policy, eval fixture) instead of the work under test — gate integrity (#3156); see [docs/gate-integrity.md](../../docs/gate-integrity.md)\n- ⊗ Clear a red product oracle by editing the comparison method then treating the new pass as a pass — record independent re-derivation or fix the product (#3322 / #3156)\n- ⊗ Under a hard turn/cost budget, gold-plate pre-PR polish past the stated bar until the budget expires (#3266)\n- ⊗ Exit pre-PR after skipping deepen-for-budget without naming the skip in the summary (#3266 / #1006)\n",
210
+ "body": "# Deft Directive Pre-PR -- Read, Write, Lint, Diff, Loop\n\nStructured self-review loop agents run before submitting a PR. Catches inconsistencies, missing enforcement markers, incomplete acceptance criteria, scope creep, and unintended changes before they reach the reviewer.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**See also**: [deft-directive-review-cycle](../deft-directive-review-cycle/SKILL.md) | [deft-directive-build](../deft-directive-build/SKILL.md) | [RWLDL tool](../../tools/RWLDL.md)\n\n> **Formerly `deft-rwldl`** -- renamed and scoped to PR readiness. For the broader iterative quality improvement loop (micro/macro review), see [tools/RWLDL.md](../../tools/RWLDL.md).\n\n## Branch-Protection Policy Guard\n\n! Before entering Phase 1 (Read), run the skill-level branch-policy guard documented in `task policy:show` / dual-invoke `deft verify:branch` (#746 / #747). Halt before any state mutation (the Phase 2 Write phase, the Phase 3 Lint phase that may touch files) when the policy is unresolvable AND no env-var bypass is active:\n\n```\ndeft verify:branch\n```\n\nor `task deft:verify:branch` when the consumer Taskfile include is present. Do not add a consumer `verify:branch` task. Pre-PR is the last gate before push, so a stale / unresolvable policy here is the highest-leverage place to catch the bug before it reaches the bot reviewer.\n\n## Deterministic Questions Contract\n\n! Every numbered-menu prompt rendered in this skill (per-finding decision menus in Phase 4 Diff, the Phase 5 Loop restart-vs-exit gate) MUST follow [`../../contracts/deterministic-questions.md`](../../contracts/deterministic-questions.md): the final two numbered options MUST be `Discuss` and `Back`, in that order. The Discuss-pause semantic is documented verbatim there -- implicit resumption is forbidden.\n\n\n## Ordered-plan target gate (#2402)\n\n! Before opening or pushing a PR, when an ordered-plan sequence may be active, verify the work unit matches the current authorized entry:\n\n1. Resolve the current entry kind and id:\n\n```\ntask plan-sequence:current\n```\n\n Use `task plan-sequence:current -- --json` when you need machine-readable `kind` / `id` fields from the current entry.\n\n2. Verify with the **entry kind** (not hardcoded `pr` — `story` / `issue` entries are common):\n\n```\ntask verify:plan-sequence -- --target-kind <entry-kind> --target <entry-id>\n```\n\n- ! Exit non-zero → fail closed; do not open an unauthorized PR.\n- ! Exit 0 with \"skipped (no active ordered-plan sequence)\" → proceed under normal pre-PR rules.\n- ⊗ Hardcode `--target-kind pr` when the current entry is `kind=story` or `kind=issue` — the verifier matches entry kind exactly (#2662).\n- ! After the PR's review cycle completes successfully, run `task plan-sequence:advance` so \"next\" resolves to the following entry (or exhausted).\n- ⊗ Treat skill-chaining or \"what's next?\" as permission to open a PR outside the current sequence entry.\n\n## Three-axis candidate validation (#4888)\n\nGitHub `mergeable_state` is **textual only**. Post-open behavioral/policy gates stay invisible until the merge-chokepoint `task check` / `deft check` runs against the current base (#4888).\n\n- ! On **conflict-resolve** and **behind-rebase** (PR open; local HEAD matches live remote PR head), MUST treat the merge-chokepoint full gate as candidate validation against current base — not optional polish. Prefer `deft check`; else tree-correct `task check` / `task deft:check`. Then MUST call `evaluateNonCascadeCandidateGreen` with an attestation from `buildCandidateValidationAttestationFromProbe` (allowlisted probe exit 0; blessed producer) keyed to `(pr_head_sha, target_head_sha)`. Fail closed names the probe.\n- ! On **pre-push**, MUST run that same merge-chokepoint full gate locally against current base before pushing. Do **not** require `evaluateNonCascadeCandidateGreen` until after push when a PR exists and local HEAD matches the live remote PR head — then obtain the SHA-pair attestation. First push (no PR yet) and tip-ahead-of-remote pushes use the local gate only (#4888).\n- ! Frame `#4883` CLEAN / forge `mergeable_state=clean` as axis-1 necessity only — never three-axis sufficiency.\n- ⊗ Skip the merge-chokepoint `task check` after conflict-resolve or behind-rebase because GitHub shows mergeable/clean (#4888).\n- ⊗ Call `evaluateNonCascadeCandidateGreen` as a pre-push blocker when no PR exists or local HEAD does not yet match the remote PR head (#4888).\n- ⊗ Satisfy semantic-drift visibility with a withdrawn Python semantic-drift script SoT (TS evaluateSemanticGreen owns the probe).\n- Depth: `scm/github.md` § Cascade / Three-axis (#4888); forge supersession `#633`/`#1517`.\n\n## Gate throughput — iteration fast lane vs merge chokepoint (#1704)\n\n> **Invariant:** every change MUST pass the full gate at least once before merge. Pre-PR is the merge chokepoint — NOT every iteration commit.\n\n- ! **Iteration lane (Phases 2–3 loop):** use affected/static gates on changed paths — `vitest run --coverage <paths>`, relevant `verify:*` on touched files, `task coverage:hotspots` — instead of full `task check` on every pre-PR iteration. Phase 3 sits inside this loop, so it uses the iteration lane, not a full suite.\n- ! **Merge chokepoint (once after the loop, before push/PR):** prefer `deft check` once before push/PR. If the CLI is missing, use the tree-correct task form (`task deft:check` on include-only consumers; `task check` in framework source). These are one gate, not two sequential runs. Do not add a fourth probe (#2893 / #4379). A bare `task check` miss on an include-only consumer is not \"gate unavailable\". This is a #1704 revision of the prior Phase 3 Lint exit + final confirm (two runs, one inside every iteration). The escape-rate guard below still applies; do not invent a separate surface.\n- ! **Escape-rate safety (#1703 Tier-1):** before recommending fleet-wide fast-lane tightening, cite `#1703` Tier-1 telemetry (`helped/crud-metrics.jsonl`) and `task eval:health` — do NOT invent a separate escape-rate surface.\n- ~ **In-engine incrementality (#1713):** content-hash cache + runner-delegated affected selection are sibling work (#1713).\n- ⊗ Treat Phase 3c targeted coverage alone as PR-ready without full `task check` at the merge chokepoint.\n- ⊗ Run full `task check` inside every pre-PR Phase 3 iteration — Phase 3 is inside the loop; the chokepoint is once after exit.\n\n## When to Use\n\n- ! Before pushing a branch for PR creation\n- ! After completing implementation but before the final merge-chokepoint `deft check` (#1704 / #4379)\n- ~ After addressing bot reviewer findings (run one pre-PR pass before pushing the fix batch)\n- ? During mid-implementation checkpoints on large changes\n\n## Controller invocation (#4912)\n\n! Start the prescribed pre-PR workflow through `deft pre-pr:run`. Opening this skill file is not completion. A generic mark-complete cannot mint a pass.\n\n- ! `deft pre-pr:run` starts a controller run. The run id is a lookup hint; the private store is authoritative.\n- ⊗ Treat reading this SKILL.md as pre-PR completion.\n- ⊗ Mint a passing record from an author-supplied run id, checkbox, gitignored marker, or generic mark-complete.\n- ⊗ Reuse a one-PR-unit verdict as pre-PR success.\n\nLive skip detection on deftai/directive additionally requires Limb 5 enrollment (#4976).\n\n## Hard local refuse before push (#5804)\n\n! On enrolled tip OVPR, feature-branch git push of product/test changes fails closed unless a private-store deft pre-pr:run pass bound to HEAD covers outgoing paths (outgoing ⊆ reviewed pushBinding). Empty pre-push stdin denies.\n\n- ! Recovery when refuse fires: deft pre-pr:run then retry push.\n- ⊗ Treat reading this SKILL.md or narrating pre-PR as a push pass.\n- ⊗ Inherit evaluatePrePush empty-stdin allow for the enrolled arm.\n\n\n## Loop Phases\n\nEach iteration proceeds through all phases in order. Do NOT skip phases or reorder them.\n\n### Phase 1 -- Read\n\n! Re-read each changed file end-to-end (`git diff master --name-only` to get the list).\n\n- ! Read every changed file in full -- do not skim or skip sections\n- ! Compare each file against its scope xBRIEF acceptance criteria in `xbrief/active/`\n- ~ If changed files include `xbrief/PROJECT-DEFINITION.xbrief.json`, a configured `codebase-map` provider artifact, or `.planning/codebase/MAP.md`, read the MAP and canonical metadata together. The MAP is orientation; `plan.architecture.codeStructure` and provider artifacts remain authoritative.\n- ! When adding a `!` or `⊗` rule that prohibits a specific command, pattern, or behavior, search the same file for any `~`, `≉`, or prose that recommends or permits the same command/pattern -- resolve all contradictions in the same commit before pushing\n- ! When strengthening a rule (e.g. upgrading `~` to `!`), grep for the term in the full file and verify no weaker-strength duplicate remains\n- ! When adding a weaker rule (`~`, `≉`, or prose that recommends or permits a command/pattern) beside an existing `!` or `⊗` for the same command/pattern in the same file, resolve the contradiction in the same commit — weaken-beside-a-MUST is the same-commit reconcile as adding or strengthening a MUST (#4135 / #4324)\n- ~ Note any inconsistencies, missing RFC2119 markers, stale cross-references, or incomplete sections\n- ~ Check that CHANGELOG.md entries match the actual changes made\n- ! If the change alters **user-visible behavior**, apply [coding/docs.md](../../coding/docs.md) (#447): update the matching user-facing surface (CHANGELOG when user/operator-visible, CLI help / commands.md for new or changed verbs/flags, README/getting-started for install/first-run, skill/strategy triggers when entry points change) in this PR\n- ⊗ Claim documentation was updated without those files in the diff\n- ~ Pure internal refactors with no user-visible behavior change do not require user-facing doc updates\n\n### Phase 2 -- Write\n\n! Fix any issues found in the Read phase.\n\n- ! Fix inconsistencies, add missing RFC2119 enforcement markers (`!`, `~`, `⊗`)\n- ! Complete any incomplete acceptance criteria or missing content\n- ! Update stale cross-references\n- ~ Improve clarity where intent is ambiguous\n- ⊗ Make changes beyond the scope of the current task -- if you notice unrelated issues, file them as ideas or future work, do not fix them now\n\n### Phase 3 -- Lint\n\n! Run the iteration-lane gates and fix any failures (#1704). Full `task check` is the post-loop merge chokepoint, not this per-iteration phase.\n\n- ! Run affected/static gates on changed paths (`vitest run --coverage <paths>`, relevant `verify:*`, `task coverage:hotspots`) — not full `task check` inside the loop\n- ! Fix all failures before proceeding to Phase 3b\n- ~ If a lint fix requires changing a file, that counts as a change for the Loop phase\n\n~ **Windows + Grok Build (#1353):** Avoid `|`, `>`, or `2>&1` in `run_terminal_command` strings -- use Python `pathlib`/`subprocess` or plain task commands instead.\n\n### Phase 3c -- Coverage headroom (#2683 / #5421)\n\n! Before the full `task check` coverage gate, decide coverage applicability for the complete reviewed diff, then either measure headroom or record authorized not-applicable.\n\n- ! Run the shared applicability path (`deft coverage:hotspots` classifies before requiring Istanbul when the reviewed base/head/tree binding is available): **applicable** → measured path; **not-applicable** → inert skip channel; **coverageMode posture** (`initial`|`disabled`, exit 5) → mode skip channel (paths may still be coverable; authority is plan.policy.coverageMode); **refuse** → fail closed (or waived exit 4 when granted).\n- ! When applicable: run targeted coverage first: `vitest run --coverage <changed-paths>` (or language equivalent) — not only full `task check`. Then run `task coverage:hotspots` / `deft coverage:hotspots` for uncovered branches / headroom. Exercise both sides of new branches (ternary / early-return / catch / default switch / `||` / `??`). Treat barely ≥ floor as insufficient — aim for ≥ floor + 0.3–0.5pp headroom on the branch metric relative to **your project's** vitest/coverage floor (may differ from 85%). Complements `deft verify:forward-coverage` (#1310) and `--allow-coverage-debt=#N` (#2573).\n- ! When coverageMode is `initial` or `disabled` and no `coverage/coverage-final.json` is present: record `coverage_headroom` via **exit 5 + exact skip reason** `coverageMode posture skip (initial|disabled)` (`COVERAGE_HEADROOM_MODE_SKIP`). This is posture N/A — distinct from inert N/A and from forbidden report-missing-alone. The controller re-reads effective coverageMode at observe and commandSatisfied; hotspots exit 5 self-instructs the token and carries it on the mode artifact. When a coverage report exists, keep the measured path (report-present guard).\n- ! When not-applicable (every changed path proven inert): record `coverage_headroom` via **non-zero exit + exact skip reason** `reviewed diff has no coverable paths` (`ALLOWED_SKIP_REASONS.coverage_headroom`). The controller re-derives applicability from the run's PrePrInputBinding before honoring that skip. Hotspots exit 3 emits the machine-readable N/A artifact for this channel.\n- ! When coverageMode is `initial` or `disabled` and no `coverage/coverage-final.json` is present: record `lint_iteration` via **exit 5 + exact skip reason** `lint_iteration coverageMode posture skip (initial|disabled)` (`LINT_ITERATION_MODE_SKIP`). This discharges the Vitest-shaped observation only — keep applicable static / `verify:*` gates in Phase 3 and the merge_chokepoint phase. Do **not** invent `vitest --coverage`. The controller re-reads coverageMode at observe and commandSatisfied; refuse the mode skip when a coverage report exists (shared report-present guard with #5791). Never exit 0 and never bare any-nonzero for this channel.\n- ⊗ Satisfy `coverage_headroom` with an unbound exit-0 changed-file audit or any free-form exit-0 command that is not the authorized `deft coverage:hotspots` measured pass.\n- ⊗ Invent an Istanbul report, ask the operator to waive an irrelevant metric, or treat report-missing alone as not-applicable (mode posture skip requires coverageMode initial|disabled + exit 5 token — not a free-form missing-report claim).\n- ⊗ Soften `coverage_headroom` to optional, lower the coverage floor, or claim a general docs-only CI bypass.\n- ! Toolchain-only N/A for executable changes on non-Istanbul projects (Coverlet adapters) remains open — do not paper over executable .NET with inert-classifier N/A.\n\n### Phase 3b -- Auto-Render Exports\n\n! If `xbrief/specification.xbrief.json` exists, refresh rendered exports before the diff check:\n\n- ! Run `task prd:render` if `PRD.md` already exists in the project root\n- ! Run `task spec:render` if `SPECIFICATION.md` already exists and does not contain `<!-- deft:deprecated-redirect -->`\n- ! If `plan.architecture.codeStructure`, a configured `codebase-map` provider artifact, or `.planning/codebase/MAP.md` changed, run `task codebase:map` and `task verify:codebase-map-fresh` so the generated orientation projection matches its canonical inputs.\n- ⊗ Create export files that don't already exist -- only refresh existing ones\n- ⊗ Hand-edit `.planning/codebase/MAP.md` to satisfy review; update canonical metadata or provider artifacts, then regenerate it\n\n### Phase 4 -- Diff\n\n! Review the full diff against the base branch for unintended changes.\n\n```\ngit --no-pager diff master\n```\n\n- ! Verify no files outside the task scope were modified\n- ! Check for scope creep -- changes that go beyond the spec task acceptance criteria\n- ! Verify no debug code, TODO comments, or temporary scaffolding remains\n- ! Confirm no unintended whitespace-only changes or formatting drift\n- ! **Closing-keyword policy (#3015 class D / #737 Layer 0):** Default PR body uses `Tracking: #N` / `Related: #N` / `Refs #N` only. Use `Closes` / `Fixes` / `Resolves #N` only when the **full issue DoD** is met (not Phase A partial / multi-phase mid-stream).\n- ⊗ Write `Closes #N Phase A`, `only if`, `partial`, or other conditional English around a real closing keyword — GitHub ignores the condition and auto-closes (#3015 enterprize#29).\n- ! **Run `task pr:check-closing-keywords` before opening the PR (default mode `both` = FP #737 + intent #3015).** Offline: `--body-file` / `--commits-file`. Scans body and commits for closing-keyword tokens in negation / quotation / example / code-block contexts (FP) and for any unallowlisted real close (intent). When full DoD close is intentional, pass `--allow-close <N,M>` (CLI allowlist only — body trailers are not an authorization path). FP-only: `--mode fp`. Known-safe quoted tokens: `--allow-known-false-positives`. Recurrence stack: #167, #697 / #698, #401 / #700, #735 (class A), #3015 (class D enterprize#29).\n- ~ Verify the diff tells a coherent story -- a reviewer reading it top-to-bottom should understand the change\n- ~ If the PR adds or moves any documentation, verify each new doc is reachable from the AGENTS.md reference chain -- an orphan doc is discovered <10% of the time yet still costs context when found (the reference-chain contract, #644 / #647). Add a pointer or fold it in rather than leaving it stranded.\n- ! **Gate integrity (#3156):** If the branch cleared a red gate, confirm the fix changed the product/process/test under test — not the gate definition, verifier, reward, required check, coverage floor, policy flag, or eval fixture that was failing. Deliberate gate changes need issue/PR rationale (constitution-tier disposal under #3164). Doctrine: [docs/gate-integrity.md](../../docs/gate-integrity.md). Refine-internal SkillOpt region stays on #2436 — do not re-implement it here.\n\n### Phase 5 -- Loop\n\n! Decide whether to restart or exit.\n\n- ! If ANY fixes were made in Phase 2 (Write) or Phase 3 (Lint): restart from Phase 1 (Read)\n- ~ Phase 3b auto-renders are intentional output refreshes; they do NOT trigger a loop restart\n- ! If a full Read-Write-Lint-Diff cycle produced zero changes: exit the loop\n- ~ Track iteration count -- if you exceed 3 iterations, pause and assess whether you are oscillating between competing fixes\n\n\n\n## Budget-aware pre-PR depth (#3266)\n\nWhen session effort-budget is hard-capped (`DEFT_MAX_TURNS` / `DEFT_MAX_BUDGET` / session:start `effort_budget`):\n\n- ! Complete the merge-chokepoint path that proves stated AC (full `task check` once, stated AC evidence) before optional polish that only deepens beyond the bar.\n- ! If remaining budget cannot fund another full Read-Write-Lint-Diff pass **and** a fix for a new finding, stop after the stated-pass chokepoint and record `deepening_skipped=true` with reason (#1006).\n- ! Dual-stop pre-PR defaults (max 3 polish / 2 no-diff) still apply; under a hard cap, prefer fewer polish iterations once AC + check are green.\n- ⊗ Start an unbounded self-imposed verification suite that exceeds stated AC while the hard budget is nearly exhausted (#3266).\n\n## Product-first done-gate (#3284) / literal AC (#3267)\n\n- ! Before Phase 3 Lint exit / push, when the active scope xBRIEF has acceptance commands (`plan.acceptance` or #3267 metadata/narratives), run `task verify:ac -- <active-xbrief>` and fail closed on exit 1. (`verify:literal-ac` is the mechanism alias.)\n- ! Commands must be the exact strings from the task statement — same flags and cwd. Self-chosen verification is supplementary only.\n- ! Full `task check` already runs `verify:ac` first; still run it explicitly before push when AC is stated so failures are visible without the full hygiene suite.\n- ⊗ Skip AC run on rapid/minimal ceremony dial — rapid = AC-only; AC never degrades when commands exist (#3284 / #3156).\n\n## Product-oracle gate integrity (#3322 / #3156)\n\nA red product verification may be resolved only by a product change or an independently re-derived oracle (both sides rebuilt from scratch, different method). In-place repair of the failing comparison then pass is not a pass — it is an unresolved discrepancy.\n\n- ! When a product oracle is red, resolve it by changing the product or by independently re-deriving the oracle, and record `independent_rederivation` on the run-summary `verification` event.\n- ! Emit a run-summary verification event `{check_id, method_fingerprint, outcome}` for each product-oracle attempt when `DEFT_RUN_SUMMARY_PATH` is set. `fail` then a different `method_fingerprint` then `pass` on one check id is machine-flagged.\n- ! `task verify:ac` treats comparison-method mutation as unresolved (exit non-zero) unless independent re-derivation is recorded. Lead the done report with any unresolved discrepancy (#1006).\n- ⊗ Self-adjudicate a red product oracle by editing the comparison (reference file, diff invocation, one-sided regenerate) and shipping the new pass as success.\n\n## Probe-then-fill remote claims (#3120)\n\n! Before filling any **remote** handoff field (PR URL, PR number, commit/HEAD SHA, CI green/success, review score) or claiming `status: pass` / ship/gate done, MUST **probe then fill**:\n\n1. Run same-turn `git` + forge probes (examples: `git rev-parse HEAD`, `gh api repos/<owner>/<repo>/pulls/<N>`, `task pr:watch -- <N> --one-shot`, checks API).\n2. Copy IDs / URLs / SHAs / scores **only** from that probe JSON/text into the evidence block.\n3. Set `proof_status: bound` and attach short raw probe snippets (`command` + `snippet`) for each remote claim.\n\n! Handoff evidence axes: **work** (local) / **ship** (pushed branch or PR) / **gate** (CI/review on HEAD). `proof_status` is `bound` | `unbound` | `n/a-no-remote-claim`.\n! **Legal partial:** local work `done` + ship `not_started` / `blocked` **without** PR/SHA/CI/review fields and `proof_status: n/a-no-remote-claim` (or `status: partial`) is valid — do not invent ship state.\n! **Fail ranking:** **invented-done** (false/unbound remote artifacts under pass) is **stricter** than **empty-done**. Unbound remote claims → invalid evidence (fail), not pass-with-notes.\n! Machine check: `validateHandoffEvidence` in `packages/core/src/handoff-evidence/` (see `templates/agent-prompt-preamble.md` §11).\n⊗ Fill PR / SHA / CI / review fields from recollection, narration, or prior-turn memory.\n⊗ Claim `status: pass` with remote fields when `proof_status` is not `bound` or probes are missing (#3120).\n\n## First-PR-open closed-PR path-intersection (#1178)\n\n! Own the **first-PR-open** closed-PR path-intersection pass here (and any implement-leaf `gh pr create` bypass MUST call this same contract). Swarm Phase 6 stays merge / protected-issue / finalize and MUST point at this pre-pr owner — ⊗ treat Phase 6 as the first-open closed-PR search owner.\n\nShared retrieval tokens match article-review pre-filing (#1178): closed-PR walk uses named default `PREFILING_CLOSED_PR_WINDOW` = **100**, outcome tokens `window-exhausted` | `list-exhausted` | `cap` | `error`, and file-list pagination must complete before path-intersection.\n\n- ! Before opening a product PR, walk closed/merged PRs inside `PREFILING_CLOSED_PR_WINDOW` (`GET .../pulls?state=closed&sort=updated&direction=desc`).\n- ! For each candidate, paginate `GET .../pulls/<n>/files` to completion. If file enumeration truncates or errors, record `error` / incomplete — ⊗ path-intersect on a truncated file list as a verified clear.\n- ! Mechanical trigger: any closed/merged PR inside the window whose files intersect the candidate changed-path set → MUST cite that PR and state what differs (disposition may still be `partial` / `unresolved`; overlap alone is not duplicate-scope proof).\n- ! Record the walk outcome token. Bounded no-match requires `window-exhausted` or `list-exhausted` with complete file lists for inspected PRs.\n- ⊗ Open a product PR with no closed-PR path-intersection pass.\n- ⊗ Import #5099 feedback:file closed-walk constants for this pass unless separately exported (cite-only).\n\n## Exit Condition\n\n! Exit when a complete Read-Write-Lint-Diff cycle produces **zero changes** -- no file edits in Write, no lint fixes in Lint, and no scope issues in Diff.\n\nAfter exiting:\n- ! Run the merge chokepoint once: prefer `deft check`; if the CLI is missing, use the tree-correct task form (`task deft:check` on include-only consumers; `task check` in framework source). These are one gate, not two sequential runs. Do not add a fourth probe (#2893 / #4379). Phase 3 used the iteration lane, so this is the first full suite in the loop, not a second run.\n- ! If that post-loop full gate is red and the fix changes files, restart from Phase 1 (Read). Do not only re-run the gate — those edits must pass Read and Diff (#4324).\n- ! After that restart exits with zero changes, run the same tree-correct full gate once again (recovery after a red merge chokepoint).\n- ! Re-run the full gate only after a red merge chokepoint or a new commit.\n- ~ The branch is now ready for push and PR creation\n\n\n## Significant decision log (#1396)\n\n! Before push, if this PR encodes a **significant** choice not already recorded, run `task decision:write` (significance filter: architecture, product behavior, security, boundaries, data model, topology, hard-to-reverse process).\n\n~ Check `task decision:list` for related process policy so the PR does not silently reverse a dogfood decision.\n\n⊗ Invent revisit-free rationale in the PR body as a substitute for a decision record when the choice is significant.\n⊗ Noise the log with trivial scope completions.\n\nDocs: `docs/decision-log.md`.\n\n## Anti-Patterns\n\n- ⊗ Open a product PR with no closed-PR path-intersection pass inside `PREFILING_CLOSED_PR_WINDOW` (#1178)\n- ⊗ Submit a PR without running this pre-PR loop (Read-Write-Lint-Diff) -- every PR branch should pass at least one full cycle\n- ⊗ Exit the loop after the Lint phase without completing the Diff phase -- Diff catches scope creep and unintended changes that Lint cannot detect\n- ⊗ Skip the Read phase and jump directly to Lint -- Read catches semantic issues (missing content, wrong RFC2119 markers, incomplete acceptance criteria) that linters do not check\n- ⊗ Make out-of-scope fixes during Write -- this introduces scope creep that Diff will flag, forcing another iteration\n- ⊗ Ignore the iteration count -- more than 3 iterations usually indicates oscillating fixes or an unclear spec task\n- ⊗ Add a prohibition (`!` or `⊗`) without scanning the same file for conflicting softer-strength rules (`~`, `≉`) that reference the same term\n- ⊗ Add a weaker rule (`~` / `≉`) beside an existing `!` / `⊗` for the same command/pattern without reconciling in the same commit\n- ⊗ After a red post-loop `task check`, fix files and re-run only the gate without restarting Read-Write-Lint-Diff\n- ⊗ Skip `task pr:check-closing-keywords` (#737) before pushing a PR. Intent mode (#3015) also refuses bare/conditional real `Closes #N` without `--allow-close`. The negation-context substring match is the Layer 0 (prevention) gate that prevents the recurring auto-close of umbrella / staying-OPEN issues observed in #697 (closed #642), #401 (closed #642), #700 (closed #233), and #735 (closed #734) -- each incident required manual reopen and downstream cleanup. The lint's three-state exit (0 clean / 1 hits found / 2 config error) MUST be treated as a hard refusal: rewrite the PR body / commit messages until clean, OR pass `--allow-known-false-positives` ONLY for legitimately-quoted occurrences (test fixtures, documentation that discusses the trigger token literally). See `skills/deft-directive-swarm/SKILL.md` Phase 6 Step 1 for the corresponding Layer 3 (recovery) `pr:check-protected-issues` rule (#701)\n- ⊗ Invent remote PR/SHA/CI/review claims in handoff evidence without same-turn probe binding — invented-done (#3120)\n- ⊗ Fill remote ship/gate fields from memory when only local work completed; legal partial omits PR fields (#3120)\n- ⊗ Clear a failing gate by editing the gate (definition, verifier, reward, required check, coverage floor, policy, eval fixture) instead of the work under test — gate integrity (#3156); see [docs/gate-integrity.md](../../docs/gate-integrity.md)\n- ⊗ Clear a red product oracle by editing the comparison method then treating the new pass as a pass — record independent re-derivation or fix the product (#3322 / #3156)\n- ⊗ Under a hard turn/cost budget, gold-plate pre-PR polish past the stated bar until the budget expires (#3266)\n- ⊗ Exit pre-PR after skipping deepen-for-budget without naming the skip in the summary (#3266 / #1006)\n",
211
211
  "frontmatter_extra": null
212
212
  },
213
213
  {
@@ -101,6 +101,15 @@ GitHub `mergeable_state` is **textual only**. Post-open behavioral/policy gates
101
101
 
102
102
  Live skip detection on deftai/directive additionally requires Limb 5 enrollment (#4976).
103
103
 
104
+ ## Hard local refuse before push (#5804)
105
+
106
+ ! On enrolled tip OVPR, feature-branch git push of product/test changes fails closed unless a private-store deft pre-pr:run pass bound to HEAD covers outgoing paths (outgoing ⊆ reviewed pushBinding). Empty pre-push stdin denies.
107
+
108
+ - ! Recovery when refuse fires: deft pre-pr:run then retry push.
109
+ - ⊗ Treat reading this SKILL.md or narrating pre-PR as a push pass.
110
+ - ⊗ Inherit evaluatePrePush empty-stdin allow for the enrolled arm.
111
+
112
+
104
113
  ## Loop Phases
105
114
 
106
115
  Each iteration proceeds through all phases in order. Do NOT skip phases or reorder them.
@@ -145,12 +154,13 @@ Each iteration proceeds through all phases in order. Do NOT skip phases or reord
145
154
 
146
155
  ! Before the full `task check` coverage gate, decide coverage applicability for the complete reviewed diff, then either measure headroom or record authorized not-applicable.
147
156
 
148
- - ! Run the shared applicability path (`deft coverage:hotspots` classifies before requiring Istanbul when the reviewed base/head/tree binding is available): **applicable** → measured path; **not-applicable** → skip channel; **refuse** → fail closed.
157
+ - ! Run the shared applicability path (`deft coverage:hotspots` classifies before requiring Istanbul when the reviewed base/head/tree binding is available): **applicable** → measured path; **not-applicable** → inert skip channel; **coverageMode posture** (`initial`|`disabled`, exit 5) → mode skip channel (paths may still be coverable; authority is plan.policy.coverageMode); **refuse** → fail closed (or waived exit 4 when granted).
149
158
  - ! When applicable: run targeted coverage first: `vitest run --coverage <changed-paths>` (or language equivalent) — not only full `task check`. Then run `task coverage:hotspots` / `deft coverage:hotspots` for uncovered branches / headroom. Exercise both sides of new branches (ternary / early-return / catch / default switch / `||` / `??`). Treat barely ≥ floor as insufficient — aim for ≥ floor + 0.3–0.5pp headroom on the branch metric relative to **your project's** vitest/coverage floor (may differ from 85%). Complements `deft verify:forward-coverage` (#1310) and `--allow-coverage-debt=#N` (#2573).
159
+ - ! When coverageMode is `initial` or `disabled` and no `coverage/coverage-final.json` is present: record `coverage_headroom` via **exit 5 + exact skip reason** `coverageMode posture skip (initial|disabled)` (`COVERAGE_HEADROOM_MODE_SKIP`). This is posture N/A — distinct from inert N/A and from forbidden report-missing-alone. The controller re-reads effective coverageMode at observe and commandSatisfied; hotspots exit 5 self-instructs the token and carries it on the mode artifact. When a coverage report exists, keep the measured path (report-present guard).
150
160
  - ! When not-applicable (every changed path proven inert): record `coverage_headroom` via **non-zero exit + exact skip reason** `reviewed diff has no coverable paths` (`ALLOWED_SKIP_REASONS.coverage_headroom`). The controller re-derives applicability from the run's PrePrInputBinding before honoring that skip. Hotspots exit 3 emits the machine-readable N/A artifact for this channel.
151
- - ! When coverage is N/A: do **not** invent `vitest --coverage`; keep applicable static / `verify:*` gates in Phase 3. Do not treat "no coverable code" as "no lint obligations." A closed `lint_iteration` skip remains deferred.
161
+ - ! When coverageMode is `initial` or `disabled` and no `coverage/coverage-final.json` is present: record `lint_iteration` via **exit 5 + exact skip reason** `lint_iteration coverageMode posture skip (initial|disabled)` (`LINT_ITERATION_MODE_SKIP`). This discharges the Vitest-shaped observation only — keep applicable static / `verify:*` gates in Phase 3 and the merge_chokepoint phase. Do **not** invent `vitest --coverage`. The controller re-reads coverageMode at observe and commandSatisfied; refuse the mode skip when a coverage report exists (shared report-present guard with #5791). Never exit 0 and never bare any-nonzero for this channel.
152
162
  - ⊗ Satisfy `coverage_headroom` with an unbound exit-0 changed-file audit or any free-form exit-0 command that is not the authorized `deft coverage:hotspots` measured pass.
153
- - ⊗ Invent an Istanbul report, ask the operator to waive an irrelevant metric, or treat report-missing alone as not-applicable.
163
+ - ⊗ Invent an Istanbul report, ask the operator to waive an irrelevant metric, or treat report-missing alone as not-applicable (mode posture skip requires coverageMode initial|disabled + exit 5 token — not a free-form missing-report claim).
154
164
  - ⊗ Soften `coverage_headroom` to optional, lower the coverage floor, or claim a general docs-only CI bypass.
155
165
  - ! Toolchain-only N/A for executable changes on non-Istanbul projects (Coverlet adapters) remains open — do not paper over executable .NET with inert-classifier N/A.
156
166
 
package/tasks/agent.yml CHANGED
@@ -7,8 +7,6 @@ tasks:
7
7
  monitor:
8
8
  desc: "Sub-agent heartbeat sweep (#1365 / #2824). Three-state exit (0 ok / 1 stale-or-malformed / 2 config). Alias for the raw subagent-monitor engine."
9
9
  dir: '{{.USER_WORKING_DIR}}'
10
- deps:
11
- - task: :engine:_ts-build
12
10
  cmds:
13
11
  - task: :engine:invoke
14
12
  vars:
package/tasks/cache.yml CHANGED
@@ -31,8 +31,6 @@ tasks:
31
31
  put:
32
32
  desc: "Cache an entry -- task cache:put -- <source> <key> --raw-file PATH [--ttl-seconds N]"
33
33
  dir: '{{.USER_WORKING_DIR}}'
34
- deps:
35
- - task: :engine:_ts-build
36
34
  cmds:
37
35
  - task: :engine:invoke
38
36
  vars:
@@ -41,8 +39,6 @@ tasks:
41
39
  get:
42
40
  desc: "Read an entry -- task cache:get -- <source> <key> [--allow-stale | --no-stale]"
43
41
  dir: '{{.USER_WORKING_DIR}}'
44
- deps:
45
- - task: :engine:_ts-build
46
42
  cmds:
47
43
  - task: :engine:invoke
48
44
  vars:
@@ -51,8 +47,6 @@ tasks:
51
47
  invalidate:
52
48
  desc: "Drop an entry -- task cache:invalidate -- <source> <key> [--reason TEXT]"
53
49
  dir: '{{.USER_WORKING_DIR}}'
54
- deps:
55
- - task: :engine:_ts-build
56
50
  cmds:
57
51
  - task: :engine:invoke
58
52
  vars:
@@ -61,8 +55,6 @@ tasks:
61
55
  fetch-all:
62
56
  desc: "Bulk populate -- task cache:fetch-all -- --source github-issue --repo OWNER/NAME [--batch-size N] [--delay-ms N] [--ttl-seconds N] [--no-refresh-closed to skip open→closed reconcile]"
63
57
  dir: '{{.USER_WORKING_DIR}}'
64
- deps:
65
- - task: :engine:_ts-build
66
58
  cmds:
67
59
  - task: :engine:invoke
68
60
  vars:
@@ -71,8 +63,6 @@ tasks:
71
63
  prune:
72
64
  desc: "Drop expired or LRU-evict -- task cache:prune -- [--older-than-days 30] [--source github-issue] [--dry-run] [--to-cap]"
73
65
  dir: '{{.USER_WORKING_DIR}}'
74
- deps:
75
- - task: :engine:_ts-build
76
66
  cmds:
77
67
  - task: :engine:invoke
78
68
  vars:
@@ -82,8 +72,6 @@ tasks:
82
72
  archive-closed:
83
73
  desc: "Reversible archive of closed github-issue cache entries (#1137). -- task triage:cache-archive -- [--dry-run] [--older-than-days 30] [--repo OWNER/NAME] [--json]"
84
74
  dir: '{{.USER_WORKING_DIR}}'
85
- deps:
86
- - task: :engine:_ts-build
87
75
  cmds:
88
76
  - task: :engine:invoke
89
77
  vars:
@@ -92,8 +80,6 @@ tasks:
92
80
  archive-list:
93
81
  desc: "List archived github-issue cache entries (#1137). -- task triage:archive-list -- [--repo OWNER/NAME] [--format=json] [--since ISO] [--limit N]"
94
82
  dir: '{{.USER_WORKING_DIR}}'
95
- deps:
96
- - task: :engine:_ts-build
97
83
  cmds:
98
84
  - task: :engine:invoke
99
85
  vars:
@@ -102,8 +88,6 @@ tasks:
102
88
  restore-from-archive:
103
89
  desc: "Restore archived github-issue entry to live cache (#1137). -- task triage:restore-from-archive -- --issue N [--repo OWNER/NAME] [--force]"
104
90
  dir: '{{.USER_WORKING_DIR}}'
105
- deps:
106
- - task: :engine:_ts-build
107
91
  cmds:
108
92
  - task: :engine:invoke
109
93
  vars:
@@ -24,8 +24,6 @@ tasks:
24
24
  show:
25
25
  desc: "Capacity allocation target-vs-actual mix (advisory, offline). task capacity:show [-- --project-root <path>]"
26
26
  dir: '{{.USER_WORKING_DIR}}'
27
- deps:
28
- - task: :engine:_ts-build
29
27
  cmds:
30
28
  - task: :engine:invoke
31
29
  vars:
@@ -34,8 +32,6 @@ tasks:
34
32
  backfill:
35
33
  desc: "One-time capacity-bucket backfill for completed vBRIEFs (#1606): infer capacityBucket from origin-issue labels + stamp completedAt from git. Dry-run by default; idempotent; never touches cost. -- task capacity:backfill [-- --apply] [--window-only] [--cache-dir <path>] [--json]"
36
34
  dir: '{{.USER_WORKING_DIR}}'
37
- deps:
38
- - task: :engine:_ts-build
39
35
  cmds:
40
36
  - task: :engine:invoke
41
37
  vars:
package/tasks/change.yml CHANGED
@@ -11,8 +11,6 @@ tasks:
11
11
  changelog:check:
12
12
  desc: Verify CHANGELOG.md has an [Unreleased] section with at least one entry
13
13
  dir: '{{.USER_WORKING_DIR}}'
14
- deps:
15
- - task: :engine:_ts-build
16
14
  cmds:
17
15
  - task: :engine:invoke
18
16
  vars:
@@ -21,8 +19,6 @@ tasks:
21
19
  change:init:
22
20
  desc: Create a new change proposal directory structure in history/changes/<name>/
23
21
  dir: '{{.USER_WORKING_DIR}}'
24
- deps:
25
- - task: :engine:_ts-build
26
22
  cmds:
27
23
  - task: :engine:invoke
28
24
  vars:
@@ -9,8 +9,6 @@ tasks:
9
9
  dir: '{{.USER_WORKING_DIR}}'
10
10
  # Per conventions/task-caching.md: no sources/generates because this task
11
11
  # forwards user-supplied paths and project-root flags via CLI_ARGS.
12
- deps:
13
- - task: :engine:_ts-build
14
12
  cmds:
15
13
  - task: :engine:invoke
16
14
  vars:
@@ -19,8 +17,6 @@ tasks:
19
17
  extract-default:
20
18
  desc: "Emit the dependency-free default codebase-map artifact to stdout (#1595 PR3)."
21
19
  dir: '{{.USER_WORKING_DIR}}'
22
- deps:
23
- - task: :engine:_ts-build
24
20
  cmds:
25
21
  - task: :engine:invoke
26
22
  vars:
@@ -29,8 +25,6 @@ tasks:
29
25
  provider-map:
30
26
  desc: "Select an external codebase-map provider or fall back to the default artifact (#1595 PR3)."
31
27
  dir: '{{.USER_WORKING_DIR}}'
32
- deps:
33
- - task: :engine:_ts-build
34
28
  cmds:
35
29
  - task: :engine:invoke
36
30
  vars:
@@ -39,8 +33,6 @@ tasks:
39
33
  map:
40
34
  desc: "Generate .planning/codebase/MAP.md from the selected codebase-map artifact (#1595 PR4)."
41
35
  dir: '{{.USER_WORKING_DIR}}'
42
- deps:
43
- - task: :engine:_ts-build
44
36
  cmds:
45
37
  - task: :engine:invoke
46
38
  vars:
@@ -49,8 +41,6 @@ tasks:
49
41
  projection-registry:
50
42
  desc: "Inspect registered codebase projection kinds (#1595 PR3)."
51
43
  dir: '{{.USER_WORKING_DIR}}'
52
- deps:
53
- - task: :engine:_ts-build
54
44
  cmds:
55
45
  - task: :engine:invoke
56
46
  vars:
package/tasks/commit.yml CHANGED
@@ -11,8 +11,6 @@ tasks:
11
11
  commit:lint:
12
12
  desc: Validate HEAD commit message against conventional commit format
13
13
  dir: '{{.USER_WORKING_DIR}}'
14
- deps:
15
- - task: :engine:_ts-build
16
14
  cmds:
17
15
  - task: :engine:invoke
18
16
  vars:
@@ -7,8 +7,6 @@ tasks:
7
7
  hotspots:
8
8
  desc: "Coverage hotspots + branch headroom gate (#2683): read coverage/coverage-final.json, compare global metrics to project vitest thresholds, fail closed below floor or below configured headroom (default 0.3pp), and list lowest modules plus uncovered branch samples for git-diff paths (override with --path). Supports --json for agents."
9
9
  dir: '{{.USER_WORKING_DIR}}'
10
- deps:
11
- - task: :engine:_ts-build
12
10
  cmds:
13
11
  - task: :engine:invoke
14
12
  vars:
@@ -12,8 +12,6 @@ tasks:
12
12
  write:
13
13
  desc: "Write a lightweight structured decision record (#1396). -- task decision:write -- [--decision TEXT] [--governing-rule ...] [--alternative ...] [--why-winner ...] [--confidence low|medium|high] [--revisit-trigger ...] [--scope PATH] [--body-file PATH] [--json] [--dry-run]"
14
14
  dir: '{{.USER_WORKING_DIR}}'
15
- deps:
16
- - task: :engine:_ts-build
17
15
  cmds:
18
16
  - task: :engine:invoke
19
17
  vars:
@@ -22,8 +20,6 @@ tasks:
22
20
  list:
23
21
  desc: "List structured decision records under xbrief/decisions/ (#1396). -- task decision:list -- [--query TEXT] [--scope PATH] [--issue N] [--limit N] [--json]"
24
22
  dir: '{{.USER_WORKING_DIR}}'
25
- deps:
26
- - task: :engine:_ts-build
27
23
  cmds:
28
24
  - task: :engine:invoke
29
25
  vars:
@@ -14,7 +14,6 @@ vars:
14
14
  tasks:
15
15
  finish-loop:
16
16
  desc: "Outer walk-away cascade: finish-loop grant gate + queue scan + progress JSONL + optional pr:finish-loop; agent owns implement steps (#871)"
17
- deps: [":engine:_ts-build"]
18
17
  dir: '{{.USER_WORKING_DIR}}'
19
18
  cmds:
20
19
  - task: :engine:invoke