@codyswann/lisa 3.33.6 → 3.33.8

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 (101) hide show
  1. package/all/copy-overwrite/scripts/lisa-gates.mjs +35 -3
  2. package/all/copy-overwrite/scripts/lisa-run-gates.mjs +6 -0
  3. package/all/copy-overwrite/scripts/lisa-work-item.mjs +284 -2
  4. package/dist/configs/eslint/base.d.ts.map +1 -1
  5. package/dist/configs/eslint/base.js +8 -0
  6. package/dist/configs/eslint/base.js.map +1 -1
  7. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  8. package/dist/core/lisa-owned-hash-ledger.js +3 -0
  9. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  10. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  11. package/dist/core/upstream-evidence-manifest.js +12 -11
  12. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  13. package/eslint-plugin-component-structure/rules/enforce-component-structure.js +63 -43
  14. package/package.json +2 -1
  15. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  16. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  17. package/plugins/lisa/.codex-plugin/skills/lisa-git-submit-pr/SKILL.md +11 -4
  18. package/plugins/lisa/.codex-plugin/skills/lisa-github-sync/SKILL.md +7 -2
  19. package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +1 -1
  20. package/plugins/lisa/.codex-plugin/skills/lisa-jira-sync/SKILL.md +7 -2
  21. package/plugins/lisa/.codex-plugin/skills/lisa-linear-sync/SKILL.md +7 -2
  22. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-sync/SKILL.md +7 -2
  23. package/plugins/lisa/skills/lisa-git-submit-pr/SKILL.md +11 -4
  24. package/plugins/lisa/skills/lisa-github-sync/SKILL.md +7 -2
  25. package/plugins/lisa/skills/lisa-implement/SKILL.md +1 -1
  26. package/plugins/lisa/skills/lisa-jira-sync/SKILL.md +7 -2
  27. package/plugins/lisa/skills/lisa-linear-sync/SKILL.md +7 -2
  28. package/plugins/lisa/skills/lisa-tracker-sync/SKILL.md +7 -2
  29. package/plugins/lisa-agy/plugin.json +1 -1
  30. package/plugins/lisa-agy/skills/lisa-git-submit-pr/SKILL.md +11 -4
  31. package/plugins/lisa-agy/skills/lisa-github-sync/SKILL.md +7 -2
  32. package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +1 -1
  33. package/plugins/lisa-agy/skills/lisa-jira-sync/SKILL.md +7 -2
  34. package/plugins/lisa-agy/skills/lisa-linear-sync/SKILL.md +7 -2
  35. package/plugins/lisa-agy/skills/lisa-tracker-sync/SKILL.md +7 -2
  36. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  38. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  39. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-copilot/skills/lisa-git-submit-pr/SKILL.md +11 -4
  43. package/plugins/lisa-copilot/skills/lisa-github-sync/SKILL.md +7 -2
  44. package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +1 -1
  45. package/plugins/lisa-copilot/skills/lisa-jira-sync/SKILL.md +7 -2
  46. package/plugins/lisa-copilot/skills/lisa-linear-sync/SKILL.md +7 -2
  47. package/plugins/lisa-copilot/skills/lisa-tracker-sync/SKILL.md +7 -2
  48. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-cursor/skills/lisa-git-submit-pr/SKILL.md +11 -4
  50. package/plugins/lisa-cursor/skills/lisa-github-sync/SKILL.md +7 -2
  51. package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +1 -1
  52. package/plugins/lisa-cursor/skills/lisa-jira-sync/SKILL.md +7 -2
  53. package/plugins/lisa-cursor/skills/lisa-linear-sync/SKILL.md +7 -2
  54. package/plugins/lisa-cursor/skills/lisa-tracker-sync/SKILL.md +7 -2
  55. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  57. package/plugins/lisa-expo-agy/plugin.json +1 -1
  58. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  63. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  67. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  68. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  72. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  73. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  77. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  78. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-rails-agy/plugin.json +1 -1
  83. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  87. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  88. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  92. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  93. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  95. package/plugins/src/base/skills/lisa-git-submit-pr/SKILL.md +11 -4
  96. package/plugins/src/base/skills/lisa-github-sync/SKILL.md +7 -2
  97. package/plugins/src/base/skills/lisa-implement/SKILL.md +1 -1
  98. package/plugins/src/base/skills/lisa-jira-sync/SKILL.md +7 -2
  99. package/plugins/src/base/skills/lisa-linear-sync/SKILL.md +7 -2
  100. package/plugins/src/base/skills/lisa-tracker-sync/SKILL.md +7 -2
  101. package/typescript/copy-contents/.husky/pre-push +88 -1
@@ -66,10 +66,17 @@ When updating an existing PR, preserve any existing linkage line unless the new
66
66
  After creating or updating the PR, always make the reverse link durable on the source work item when `work_item_ref` is available:
67
67
 
68
68
  1. Resolve the live PR URL with `gh pr view <pr-number> --json url --jq .url`.
69
- 2. Invoke `lisa-tracker-sync` with the original work item ref, milestone `pr-ready`, `pr_url=<url>`, and `tracker_provider=<provider>` when known.
70
- 3. The vendor sync skill must prefer the provider's native development-link primitive where one is available and verifiable.
71
- 4. If native linkage is unavailable, unconfigured, or cannot be verified, the vendor sync skill must create or update a single managed `[lisa-pr-link]` comment on the work item containing the PR URL. The fallback comment is not optional; it is the ticket-side half of the two-way link.
72
- 5. When the PR later merges, invoke `lisa-tracker-sync` again with milestone `pr-merged`, the same `pr_url`, and the merge SHA when available, so the managed backlink reflects the final state.
69
+ 2. Run the backlink command. It is the executable form of this requirement — it writes the managed `[lisa-pr-link]` comment on the work item, or updates the one already there, for every tracker Lisa supports:
70
+
71
+ ```bash
72
+ node scripts/lisa-work-item.mjs backlink --ref <work_item_ref> --pr-url <url>
73
+ ```
74
+
75
+ It is idempotent, so run it on every push rather than deciding whether it is needed. It refuses loudly for a tracker it cannot write, and never silently no-ops. Do not hand-post the comment, and do not describe the posting procedure anywhere: the same file that writes it is the file that checks it, which is what keeps producer and consumer from drifting.
76
+ 3. Invoke `lisa-tracker-sync` with the original work item ref, milestone `pr-ready`, `pr_url=<url>`, and `tracker_provider=<provider>` when known. That is the progress-note and status side; it is not what satisfies the traceability check.
77
+ 4. When the PR later merges, invoke `lisa-tracker-sync` again with milestone `pr-merged`, the same `pr_url`, and the merge SHA when available.
78
+
79
+ **Why step 2 exists — do not "simplify" it away as redundant with the `Refs` line.** Under the non-closing rule above, GitHub never creates a native development link at all: that surface *is* the closing-reference mechanism, so no non-closing form can populate it. A PR carrying a perfectly correct `Refs` line still fails the required Work-Item Traceability check without the comment. The managed comment is the ticket-side half of the link, not a fallback for when native linkage happens to be absent.
73
80
 
74
81
  Do not report PR submission as fully synced while the PR body references the ticket but the ticket has neither a verified native PR link nor the managed backlink comment.
75
82
 
@@ -57,8 +57,13 @@ Optional arguments include `pr_url=<url>` for the live pull request and `merge_s
57
57
  When `$ARGUMENTS` includes `pr_url=<url>` for `PR ready` or `PR merged`, ensure the GitHub Issue has a durable ticket -> PR link:
58
58
 
59
59
  1. Make sure the PR body contains `Refs #<n>` (or the fully qualified cross-repo form) — never a closing keyword, per the GitHub rule in `lisa-git-submit-pr`. Read the issue side with `gh api graphql` against `issue.timelineItems`, or `gh issue view <number> --json closedByPullRequestsReferences`. **Not** `gh issue view --json timelineItems`: `timelineItems` is not a supported field for that command, so the check silently returns nothing useful rather than failing loudly.
60
- 2. Post or update a single managed issue comment starting with `[lisa-pr-link]`. Include the PR URL, milestone (`pr-ready` or `pr-merged`), and merge SHA when available. This is **unconditional**, not contingent on step 1 failing: under the non-closing rule GitHub never creates a native development link (that surface is the closing-reference mechanism), so this comment is the only ticket-side backlink there will be.
61
- 3. Keep the fallback idempotent: search existing comments for `[lisa-pr-link]` and the PR URL; update/replace that managed comment where the provider allows updates, otherwise skip when the current body already matches. Do not append duplicate backlink comments on reruns.
60
+ 2. Establish the managed backlink comment by running the command that owns it never by hand, and never by describing the procedure here:
61
+
62
+ ```bash
63
+ node scripts/lisa-work-item.mjs backlink --ref <work-item> --pr-url <url>
64
+ ```
65
+
66
+ It creates the `[lisa-pr-link]` comment or updates the one already present, instead of appending duplicates, so it is safe to run on every milestone. This is **unconditional**, not contingent on step 1 failing: under the non-closing rule GitHub never creates a native development link (that surface is the closing-reference mechanism), so this comment is the only ticket-side backlink there will be — run it whether or not native linkage exists or cannot be verified, because the required Work-Item Traceability check reads this comment and nothing else guarantees one. The comment carries the marker and the PR URL only; the milestone (`pr-ready` / `pr-merged`) and merge SHA belong in the milestone progress note, so that a rerun at a new milestone still converges on one backlink comment.
62
67
 
63
68
  Native GitHub linkage cannot be verified under the non-closing rule because it is never created in the first place, so the managed comment is not a contingency here — it is the mechanism. The issue must show the PR from at least one ticket-side surface, and this is the only one available.
64
69
 
@@ -341,7 +341,7 @@ Before shutting down the team, execute the Verify flow:
341
341
  5. Commit ALL outstanding changes in logical batches on the branch (minus sensitive data/information) — not just changes made by the agent team. This includes pre-existing uncommitted changes that were on the branch before the plan started. Do NOT filter commits to only "task-related" files. If it shows up in git status, it gets committed (unless it contains secrets).
342
342
  6. Push the changes - if any pre-push hook blocks you, create a task for the agent team to fix the error/problem whether it was pre-existing or not
343
343
  7. Open a pull request with auto-merge on via `lisa-git-submit-pr`, targeting the **base branch resolved from the ticket's environment** (`target_branch=<base>`, per the branch step above), and including the mandatory work-item ref so the PR can be linked natively to the source issue.
344
- 7a. Confirm two-way linkage before treating PR submission as complete: the PR body/title/branch must reference the work item, and the work item must have either a verified native PR link or a single managed `[lisa-pr-link]` fallback comment from `lisa-tracker-sync`.
344
+ 7a. Confirm two-way linkage before treating PR submission as complete: the PR body/title/branch must reference the work item, and the work item must have either a verified native PR link or the single managed `[lisa-pr-link]` comment. Establish that comment with `node scripts/lisa-work-item.mjs backlink --ref <work_item_ref> --pr-url <url>` rather than posting it by hand — it is idempotent, and it is the same file that enforces the check, so producer and consumer cannot drift.
345
345
  8. PR Watch Loop: Drive the PR to merge via the `drive-pr-to-merge` skill — the single source of truth for clearing every blocker (auto-merge with direct-merge fallback, `BEHIND` re-sync, conflict resolution, failing-check fixes, human + bot review-comment handling with thread resolution, stale `CHANGES_REQUESTED` dismissal, and post-merge ancestry verification). `git-submit-pr` already invokes it; if you reach this step with a PR already open, invoke `drive-pr-to-merge` directly with the PR number. For a large review backlog you may fan the code-fix work out to the agent team, but `drive-pr-to-merge` owns the loop and the terminal conditions — do not re-implement them.
346
346
  9. Merge the PR, then refresh the ticket-side backlink with `lisa-tracker-sync <work_item_ref> pr-merged pr_url=<url> merge_sha=<sha> tracker_provider=<provider>`.
347
347
  10. Monitor the deploy action that triggers automatically from the successful merge
@@ -55,8 +55,13 @@ Before adding a comment, check for an existing milestone comment to avoid duplic
55
55
  When `$ARGUMENTS` includes `pr_url=<url>` for `PR ready` or `PR merged`, ensure the JIRA ticket has a durable ticket -> PR link:
56
56
 
57
57
  1. Prefer the JIRA development-link surface when the site's GitHub/JIRA integration or remote-link API is available through `lisa-atlassian-access`; verify by re-reading the ticket's remote links / development metadata.
58
- 2. If native linkage is unavailable, unconfigured, cross-system, or cannot be verified, create or update a single managed JIRA comment containing the PR URL. The comment must start with `[lisa-pr-link]` and include the milestone (`pr-ready` or `pr-merged`) and merge SHA when available.
59
- 3. Keep the fallback idempotent: read existing comments, find the `[lisa-pr-link]` comment for the same PR URL, and update/skip it instead of appending duplicates. If the current access layer cannot update comments in place, skip when an identical managed comment already exists and otherwise add exactly one replacement comment with the stable marker.
58
+ 2. Establish the managed backlink comment by running the command that owns it never by hand, and never by describing the procedure here:
59
+
60
+ ```bash
61
+ node scripts/lisa-work-item.mjs backlink --ref <work-item> --pr-url <url>
62
+ ```
63
+
64
+ It creates the `[lisa-pr-link]` comment or updates the one already present, instead of appending duplicates, so it is safe to run on every milestone. This is **unconditional** — run it whether or not native linkage exists or cannot be verified, because the required Work-Item Traceability check reads this comment and nothing else guarantees one. The comment carries the marker and the PR URL only; the milestone (`pr-ready` / `pr-merged`) and merge SHA belong in the milestone progress note, so that a rerun at a new milestone still converges on one backlink comment.
60
65
 
61
66
  The PR body/branch issue key is the PR -> ticket side. This step is the required ticket -> PR side.
62
67
 
@@ -72,8 +72,13 @@ Call `lisa-linear-access operation: save-comment({issueId: <id>, body: <comment>
72
72
  When `$ARGUMENTS` includes `pr_url=<url>` for `pr-ready` or `pr-merged`, ensure the Linear Issue has a durable ticket -> PR link:
73
73
 
74
74
  1. Prefer Linear's native GitHub attachment / pull request link when the integration has attached the PR through the branch name, PR title, or PR body issue identifier. Verify by re-reading the Issue and its attachments / relations where the Linear access layer exposes them.
75
- 2. If native linkage is unavailable, unconfigured, cross-system, or cannot be verified, create or update a single managed Linear comment containing the PR URL. The comment must start with `[lisa-pr-link]` and include the milestone (`pr-ready` or `pr-merged`) and merge SHA when available.
76
- 3. Keep the fallback idempotent: read existing comments where the access layer exposes them, find the `[lisa-pr-link]` comment for the same PR URL, and update/skip it instead of appending duplicates. If comment update is unavailable, skip when an identical managed comment already exists and otherwise add exactly one replacement comment with the stable marker.
75
+ 2. Establish the managed backlink comment by running the command that owns it never by hand, and never by describing the procedure here:
76
+
77
+ ```bash
78
+ node scripts/lisa-work-item.mjs backlink --ref <work-item> --pr-url <url>
79
+ ```
80
+
81
+ It creates the `[lisa-pr-link]` comment or updates the one already present, instead of appending duplicates, so it is safe to run on every milestone. This is **unconditional** — run it whether or not native linkage exists or cannot be verified, because the required Work-Item Traceability check reads this comment and nothing else guarantees one. The comment carries the marker and the PR URL only; the milestone (`pr-ready` / `pr-merged`) and merge SHA belong in the milestone progress note, so that a rerun at a new milestone still converges on one backlink comment.
77
82
 
78
83
  The PR branch/title/body identifier is the PR -> Linear side. This phase is the required Linear -> PR side.
79
84
 
@@ -52,8 +52,13 @@ When `$ARGUMENTS` includes `pr_url=<url>` with milestone `pr-ready` or `pr-merge
52
52
 
53
53
  1. Prefer the provider's native development-link primitive when Lisa can write and verify it for that provider.
54
54
  2. Verify the native link using the provider read surface when available.
55
- 3. If the native link is unavailable, unconfigured, cross-system, or cannot be verified, create or update one managed backlink comment on the work item containing the PR URL and current milestone.
56
- 4. Keep the comment idempotent by using a stable marker such as `[lisa-pr-link]`; reruns update or skip the existing managed comment rather than appending duplicates.
55
+ 3. Whether or not the native link exists or cannot be verified, establish the managed backlink comment with the one command that owns it:
56
+
57
+ ```bash
58
+ node scripts/lisa-work-item.mjs backlink --ref <work-item> --pr-url <url>
59
+ ```
60
+
61
+ 4. That command is idempotent by construction — it updates the existing `[lisa-pr-link]` comment rather than appending duplicates — and it refuses loudly for a tracker it cannot write. Do not restate its procedure in a vendor skill; the file that writes the comment is the file that checks it, and that is what stops the two from drifting.
57
62
 
58
63
  This is the reverse half of `lisa-git-submit-pr`'s PR body linkage. A PR that mentions a ticket is not considered fully synced until the ticket also has either a verified native PR link or the managed fallback comment.
59
64
 
@@ -11,7 +11,74 @@ if ! command -v node >/dev/null 2>&1; then
11
11
  echo "❌ Push blocked: Node.js is required to validate tracker work items."
12
12
  exit 1
13
13
  fi
14
- node "$WORK_ITEM_SCRIPT" validate-push "${1:-origin}" || exit 1
14
+ # ---------------------------------------------------------------------------
15
+ # Work-item traceability, at the push moment.
16
+ #
17
+ # This call used to be unconditional, and it was the last check in either hook
18
+ # that ran outside the gate facade: `gates.traceability` could say `off` and it
19
+ # still ran, could say `required` and nothing changed. That is the defect #2680
20
+ # measured in CI, one moment earlier. The declaration decides now, and this is
21
+ # the FALLBACK:
22
+ #
23
+ # declared at push, at any level -> the registry owns the property. The gate
24
+ # runner below runs what the project
25
+ # declared, and this step stands down.
26
+ # not declared, or the registry
27
+ # cannot be read at all -> this runs, exactly as it always has. A
28
+ # project that has declared nothing loses
29
+ # no protection whatsoever.
30
+ #
31
+ # `off` needs no third branch, for the same reason it needed none in CI: an off
32
+ # declaration is still a declaration, the runner records it as covered, and the
33
+ # built-in step stands down having correctly done nothing. What is refused is
34
+ # the shape where this step runs and its exit code is discarded — a check that
35
+ # reports green having proved nothing is the defect the facade exists to remove.
36
+ #
37
+ # WHY THE DECISION IS RESOLVED HERE rather than read from the coverage file the
38
+ # other built-in steps consult. This step must run BEFORE the GIT_* set is
39
+ # unset below, and before anything else reads the hook's stdin, because Git
40
+ # feeds the refs being pushed in on stdin and that is what the validator parses.
41
+ # No coverage file exists this early, so the declaration is resolved directly.
42
+ # That makes deferring only half a decision; the other half is further down,
43
+ # where this runs after all if the registry never actually proved it.
44
+ # ---------------------------------------------------------------------------
45
+ GATE_REGISTRY=""
46
+ for LISA_GATE_REGISTRY_CANDIDATE in \
47
+ "node_modules/@codyswann/lisa/all/copy-overwrite/scripts/lisa-gates.mjs" \
48
+ "scripts/lisa-gates.mjs" \
49
+ "all/copy-overwrite/scripts/lisa-gates.mjs"
50
+ do
51
+ if [ -f "$LISA_GATE_REGISTRY_CANDIDATE" ]; then
52
+ GATE_REGISTRY="$LISA_GATE_REGISTRY_CANDIDATE"
53
+ break
54
+ fi
55
+ done
56
+ unset LISA_GATE_REGISTRY_CANDIDATE
57
+
58
+ # Nothing here discards stderr. A resolver that failed and a project that
59
+ # declared nothing produce the same empty answer, and both send this hook to the
60
+ # built-in step — which is the safe direction — but only one of them is a
61
+ # problem somebody needs to see.
62
+ TRACEABILITY_DECLARED=""
63
+ if [ -n "$GATE_REGISTRY" ]; then
64
+ TRACEABILITY_DECLARED=$(node "$GATE_REGISTRY" list --moment=push --json --include-off | node -e '
65
+ let raw = "";
66
+ process.stdin.on("data", chunk => { raw += chunk }).on("end", () => {
67
+ try {
68
+ const declared = JSON.parse(raw || "[]").some(gate => gate.id === "traceability");
69
+ process.stdout.write(declared ? "declared" : "");
70
+ } catch (error) {
71
+ process.stderr.write(`\u26a0\ufe0f Could not read the gate registry: ${error.message}\n`);
72
+ }
73
+ });
74
+ ')
75
+ fi
76
+
77
+ if [ "$TRACEABILITY_DECLARED" = "declared" ]; then
78
+ echo "ℹ️ gates.traceability is declared at push; the gate registry decides what runs."
79
+ else
80
+ node "$WORK_ITEM_SCRIPT" validate-push "${1:-origin}" || exit 1
81
+ fi
15
82
 
16
83
  # Git supplies repository-local GIT_* variables to hooks. Keep them for push
17
84
  # validation above, then remove exactly Git's documented local set so nested
@@ -117,6 +184,26 @@ lisa_gate_covers() {
117
184
  # BEGIN: built-in checks — the pre-registry path, kept step for step so a
118
185
  # project without a `gates` block behaves exactly as it did before.
119
186
 
187
+ # Work-item traceability, when the registry took the property and then proved
188
+ # nothing with it — no runner on disk, a runner that could not run, a coverage
189
+ # file that could not be written. Each of those means nothing was proved, and a
190
+ # declared gate must never be a quieter way of turning a check off than
191
+ # declaring it `off`.
192
+ #
193
+ # A late run is not identical to the early one: the repository-local GIT_*
194
+ # variables are gone by here, and a declared gate that read stdin has already
195
+ # consumed the pushed refs. `validate-push` survives both — with empty stdin it
196
+ # falls back to `git rev-list HEAD --not --remotes=<remote>` — which is what
197
+ # makes a degraded run worth having, and why the early position stays the
198
+ # normal one.
199
+ if lisa_gate_covers traceability; then
200
+ echo "ℹ️ Covered by the traceability gate; the built-in work-item validation stands down."
201
+ elif [ "$TRACEABILITY_DECLARED" = "declared" ]; then
202
+ echo "⚠️ gates.traceability is declared at push, but the gate registry proved nothing here."
203
+ echo " Running the built-in work-item validation so the property is not lost."
204
+ node "$WORK_ITEM_SCRIPT" validate-push "${1:-origin}" || exit 1
205
+ fi
206
+
120
207
  # Run the whole-project type check once before code leaves the machine. It is
121
208
  # intentionally not a pre-commit gate because TypeScript cannot check only the
122
209
  # staged files and rebuilding the full program makes small commits too slow.