@codyswann/lisa 4.95.2 → 4.95.3

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 (83) hide show
  1. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  2. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  3. package/dist/core/upstream-evidence-manifest.js +9 -3
  4. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  5. package/dist/health/governance-probes.js +1 -1
  6. package/dist/health/governance-probes.js.map +1 -1
  7. package/dist/health/template-inspection.d.ts.map +1 -1
  8. package/dist/health/template-inspection.js +61 -35
  9. package/dist/health/template-inspection.js.map +1 -1
  10. package/package.json +4 -4
  11. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  12. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  13. package/plugins/lisa-agy/plugin.json +1 -1
  14. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  15. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  16. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  17. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  21. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  24. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  25. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  27. package/plugins/lisa-expo-agy/plugin.json +1 -1
  28. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  32. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  34. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  35. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  39. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  41. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  42. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  46. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  48. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  49. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  53. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  55. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  56. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  60. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-rails-agy/plugin.json +1 -1
  63. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  67. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  69. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  70. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  74. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  76. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  77. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  81. package/scripts/detect-stale-workflow-inputs.mjs +99 -18
  82. package/scripts/lib/reusable-workflow-contract.d.mts +10 -0
  83. package/scripts/lib/reusable-workflow-contract.mjs +80 -5
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "TypeScript-specific hooks for formatting, linting, and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "Distributable LLM Wiki kernel — ingest, query, lint, and maintain a git-native markdown knowledge base across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "4.95.2",
3
+ "version": "4.95.3",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -30,9 +30,18 @@
30
30
  * CLI:
31
31
  * node scripts/detect-stale-workflow-inputs.mjs [--project <dir>]... [--contracts-root <dir>] [--json]
32
32
  *
33
+ * Caller lines are read in every shape Lisa's pin step writes, including the
34
+ * trailing `# v<version>` comment and quoted references (#4641). A `uses:` line
35
+ * that names a Lisa reusable workflow but cannot be read is reported with
36
+ * status `unparsed` rather than dropped, so a file the detector could not read
37
+ * never counts as clean.
38
+ *
33
39
  * Exit codes:
34
- * 0 — no stale inputs found (includes the case of zero callers scanned).
35
- * 1 — stale input(s) found in at least one caller.
40
+ * 0 — every Lisa caller was read and none has a stale input. This includes a
41
+ * project with no Lisa reusable-workflow callers at all; the summary line
42
+ * says so explicitly.
43
+ * 1 — stale input(s) found in at least one caller, or at least one Lisa
44
+ * caller line could not be read (`unparsed`).
36
45
  * 2 — operational/usage error: unknown flag, a flag missing its value, a
37
46
  * `--project` that isn't a directory, or a filesystem error while scanning.
38
47
  *
@@ -48,6 +57,7 @@ import {
48
57
  diffStaleKeys,
49
58
  extractCallerJobs,
50
59
  extractDeclaredInputs,
60
+ findUnparsedLisaCallerLines,
51
61
  parseReusableReference,
52
62
  } from "./lib/reusable-workflow-contract.mjs";
53
63
 
@@ -55,6 +65,7 @@ export {
55
65
  diffStaleKeys,
56
66
  extractCallerJobs,
57
67
  extractDeclaredInputs,
68
+ findUnparsedLisaCallerLines,
58
69
  parseReusableReference,
59
70
  };
60
71
 
@@ -103,22 +114,49 @@ function resolveContractInputs(contractsRoot, reusableFile) {
103
114
  return extractDeclaredInputs(fs.readFileSync(contractPath, "utf8"));
104
115
  }
105
116
 
117
+ /**
118
+ * Whether a parsed caller job calls one of Lisa's reusable workflows. Owner and
119
+ * repository compare case-insensitively, as GitHub resolves them.
120
+ *
121
+ * @param {{ owner?: string | null, repo?: string | null }} job - a caller row.
122
+ * @returns {boolean} true for a Lisa caller.
123
+ */
124
+ function isLisaCaller(job) {
125
+ return (
126
+ job.owner?.toLowerCase() === LISA_OWNER &&
127
+ job.repo?.toLowerCase() === LISA_REPO
128
+ );
129
+ }
130
+
106
131
  /**
107
132
  * Scan one caller workflow file and classify each of its reusable-workflow
108
133
  * jobs against the contracts root.
109
134
  *
110
135
  * @param {string} filePath - absolute path to the caller workflow file.
111
136
  * @param {string} contractsRoot - directory holding current reusable workflows.
112
- * @returns {{ reusableFile: string, ref: string, withKeys: string[], staleInputs: string[], status: "ok" | "stale" | "unknown-contract" }[]}
113
- * one row per reusable-workflow job found in the file.
137
+ * @returns {{ reusableFile: string | null, ref: string | null, withKeys: string[], staleInputs: string[], status: "ok" | "stale" | "unknown-contract" | "unparsed", line?: number, text?: string }[]}
138
+ * one row per reusable-workflow job found in the file, plus one `unparsed`
139
+ * row per line naming a Lisa reusable workflow that the parser could not
140
+ * read.
114
141
  */
115
142
  function scanCallerFile(filePath, contractsRoot) {
116
- const jobs = extractCallerJobs(fs.readFileSync(filePath, "utf8"));
117
- return jobs.map(job => {
118
- const isLisaContract =
119
- job.owner?.toLowerCase() === LISA_OWNER &&
120
- job.repo?.toLowerCase() === LISA_REPO;
121
- const declared = isLisaContract
143
+ const content = fs.readFileSync(filePath, "utf8");
144
+ const jobs = extractCallerJobs(content);
145
+ // Fail closed (#4641): a Lisa caller line the parser cannot read must be
146
+ // reported, never silently counted as "nothing stale".
147
+ const unparsed = findUnparsedLisaCallerLines(content).map(entry => ({
148
+ line: entry.line,
149
+ owner: null,
150
+ ref: null,
151
+ repo: null,
152
+ reusableFile: null,
153
+ staleInputs: [],
154
+ status: "unparsed",
155
+ text: entry.text,
156
+ withKeys: [],
157
+ }));
158
+ const classified = jobs.map(job => {
159
+ const declared = isLisaCaller(job)
122
160
  ? resolveContractInputs(contractsRoot, job.reusableFile)
123
161
  : null;
124
162
  if (declared === null) {
@@ -131,6 +169,7 @@ function scanCallerFile(filePath, contractsRoot) {
131
169
  status: staleInputs.length > 0 ? "stale" : "ok",
132
170
  };
133
171
  });
172
+ return [...classified, ...unparsed];
134
173
  }
135
174
 
136
175
  /**
@@ -175,16 +214,21 @@ export function buildReport(results, opts) {
175
214
  const unknownContract = results.filter(
176
215
  r => r.status === "unknown-contract"
177
216
  ).length;
217
+ const unparsed = results.filter(r => r.status === "unparsed").length;
218
+ // An unparsed line is a caller the detector could NOT check, so it is
219
+ // reported separately and never counted among the caller jobs scanned.
220
+ const scanned = results.length - unparsed;
178
221
  return {
179
222
  contractsRoot: opts.contractsRoot,
180
223
  projects: opts.projects,
181
224
  results,
182
225
  schemaVersion: 1,
183
226
  summary: {
184
- ok: results.length - stale - unknownContract,
185
- scanned: results.length,
227
+ ok: scanned - stale - unknownContract,
228
+ scanned,
186
229
  stale,
187
230
  unknownContract,
231
+ unparsed,
188
232
  },
189
233
  };
190
234
  }
@@ -203,10 +247,42 @@ function cell(value) {
203
247
  return text === "" ? "-" : text.replace(/\r?\n/g, " ").replace(/\|/g, "\\|");
204
248
  }
205
249
 
250
+ /**
251
+ * Render the summary line under the human-readable table.
252
+ *
253
+ * A project with no Lisa caller is stated outright, so a reader can tell
254
+ * "nothing of Lisa's to check" apart from "checked and clean" (#4641) — also
255
+ * when the project has third-party callers that were counted. Unreadable Lisa
256
+ * caller lines get a hint naming the shape the detector needs; when nothing
257
+ * else was scanned, that hint leads and the "0 of 0" counts are dropped.
258
+ *
259
+ * @param {{ scanned: number, stale: number, unknownContract: number, unparsed: number }} summary
260
+ * the report's summary counts.
261
+ * @param {boolean} hasLisaCaller - whether any row is a Lisa caller, parsed or
262
+ * not.
263
+ * @returns {string} the summary line.
264
+ */
265
+ function summaryLine(summary, hasLisaCaller) {
266
+ const noLisa = "no Lisa reusable-workflow callers found";
267
+ if (summary.scanned === 0 && !hasLisaCaller) {
268
+ return `${noLisa} — nothing to check`;
269
+ }
270
+ // Detection stays fail-closed: any non-comment line naming a Lisa workflow
271
+ // path is listed. The hint covers both reasons a line can land here, so an
272
+ // operator is not told to "fix" a caller that is really prose in a script.
273
+ const unparsed = `${summary.unparsed} Lisa caller line(s) could not be read. If a listed line is a real caller, rewrite it as \`uses: CodySwannGT/lisa/.github/workflows/<file>@<ref>\`; if it only mentions the path (for example inside a \`run:\` script), reword or move that text.`;
274
+ if (summary.scanned === 0 && summary.unparsed > 0) {
275
+ return unparsed;
276
+ }
277
+ const counts = `${summary.stale} of ${summary.scanned} caller jobs have stale inputs (${summary.unknownContract} unresolvable contract(s))`;
278
+ const tail = summary.unparsed > 0 ? `; ${unparsed}` : "";
279
+ return `${counts}${tail}${hasLisaCaller ? "" : ` — ${noLisa}`}`;
280
+ }
281
+
206
282
  /**
207
283
  * Render the human-readable markdown table + summary line.
208
284
  *
209
- * @param {{ results: ReadonlyArray<Record<string, unknown>>, summary: { scanned: number, stale: number, unknownContract: number } }} report
285
+ * @param {{ results: ReadonlyArray<Record<string, unknown>>, summary: { scanned: number, stale: number, unknownContract: number, unparsed: number } }} report
210
286
  * the report object.
211
287
  * @returns {string} the rendered table.
212
288
  */
@@ -216,10 +292,12 @@ function humanTable(report) {
216
292
  "| --- | --- | --- | --- | --- |";
217
293
  const rows = report.results.map(
218
294
  r =>
219
- `| ${cell(r.project)} | ${cell(r.file)} | ${cell(r.reusableFile)} | ${cell(r.staleInputs)} | ${cell(r.status)} |`
295
+ `| ${cell(r.project)} | ${cell(r.line === undefined ? r.file : `${r.file}:${r.line}`)} | ${cell(r.reusableFile)} | ${cell(r.staleInputs)} | ${cell(r.status)} |`
296
+ );
297
+ const hasLisaCaller = report.results.some(
298
+ r => r.status === "unparsed" || isLisaCaller(r)
220
299
  );
221
- const summary = `\n${report.summary.stale} of ${report.summary.scanned} caller jobs have stale inputs (${report.summary.unknownContract} unresolvable contract(s))`;
222
- return [header, ...rows].join("\n") + summary;
300
+ return `${[header, ...rows].join("\n")}\n${summaryLine(report.summary, hasLisaCaller)}`;
223
301
  }
224
302
 
225
303
  /**
@@ -282,7 +360,8 @@ export function parseArgs(argv) {
282
360
  * @param {readonly string[]} argv - arguments (without node/script prefix).
283
361
  * @param {{ stdout?: { write(s: string): void }, stderr?: { write(s: string): void } }} [io]
284
362
  * injectable streams (defaults to process streams).
285
- * @returns {number} the exit code (0 ok, 1 stale found, 2 usage error).
363
+ * @returns {number} the exit code (0 ok, 1 stale or unparsed found, 2 usage
364
+ * error).
286
365
  */
287
366
  export function main(argv, io = {}) {
288
367
  const out = io.stdout ?? process.stdout;
@@ -317,7 +396,9 @@ export function main(argv, io = {}) {
317
396
  }
318
397
  const report = buildReport(results, opts);
319
398
  emitReport(out, report, opts.json);
320
- return results.some(r => r.status === "stale") ? 1 : 0;
399
+ return results.some(r => r.status === "stale" || r.status === "unparsed")
400
+ ? 1
401
+ : 0;
321
402
  }
322
403
 
323
404
  if (invokedAsScript(import.meta.url)) {
@@ -15,6 +15,16 @@ export function parseReusableReference(usesValue: string): {
15
15
  export function extractCallerJobs(
16
16
  content: string
17
17
  ): readonly ReusableCallerJob[];
18
+ export interface UnparsedLisaCallerLine {
19
+ /** 1-based line number within the file. */
20
+ readonly line: number;
21
+ /** The line's text, trimmed. */
22
+ readonly text: string;
23
+ }
24
+
25
+ export function findUnparsedLisaCallerLines(
26
+ content: string
27
+ ): readonly UnparsedLisaCallerLine[];
18
28
  export function extractDeclaredInputs(
19
29
  content: string
20
30
  ): readonly string[] | null;
@@ -1,5 +1,52 @@
1
1
  /** Pure reusable-workflow caller/contract comparison shared by health and CLI. */
2
2
 
3
+ /**
4
+ * A job-level `uses:` line, in every shape Lisa itself writes.
5
+ *
6
+ * `src/core/reusable-workflow-pin.ts` rewrites each caller to
7
+ * `uses: <owner>/<repo>/.github/workflows/<file>@<sha> # v<version>`, keeping
8
+ * any surrounding quotes. This pattern accepts that shape: an optional matching
9
+ * `"` or `'` around the reference and an optional trailing YAML comment. It
10
+ * used to be end-anchored right after the reference, so the pin comment made
11
+ * every pinned caller invisible and both stale-input checks passed having
12
+ * compared nothing (CodySwannGT/lisa#4641). A round-trip test keeps the
13
+ * pinner's output and this reader in agreement.
14
+ *
15
+ * A `#` starts a YAML comment only after whitespace: `@main#note` is the ref
16
+ * `main#note` to GitHub, so that shape is rejected here (and then reported as
17
+ * unparsed) rather than read as ref `main`.
18
+ *
19
+ * Split in two so each pattern stays readable: `USES_LINE` finds the key and
20
+ * its indentation, `USES_VALUE` reads what follows it.
21
+ * `USES_VALUE` groups: 1 = double-quoted, 2 = single-quoted, 3 = bare value.
22
+ */
23
+ const USES_LINE = /^(\s*)uses:[ \t]*(.*)$/;
24
+ const USES_VALUE =
25
+ /^(?:"([^"\s]+)"|'([^'\s]+)'|([^\s"'#]+))(?:[ \t]+#.*)?[ \t]*$/;
26
+
27
+ /**
28
+ * Any mention of a Lisa reusable workflow path. Owner and repository match
29
+ * case-insensitively, as GitHub resolves them.
30
+ */
31
+ const LISA_WORKFLOW_PATH = /codyswanngt\/lisa\/\.github\/workflows\//i;
32
+
33
+ /** A line that is entirely a YAML comment. */
34
+ const COMMENT_LINE = /^\s*#/;
35
+
36
+ /**
37
+ * Parse one line as a reusable-workflow `uses:` reference.
38
+ *
39
+ * @param {string} line
40
+ * @returns {{ indentation: number, reference: { file: string, ref: string, owner: string | null, repo: string | null } } | null}
41
+ */
42
+ function parseUsesLine(line) {
43
+ const match = USES_LINE.exec(line);
44
+ const value = match ? USES_VALUE.exec(match[2]) : null;
45
+ if (!match || !value) return null;
46
+ const reference = parseReusableReference(value[1] ?? value[2] ?? value[3]);
47
+ return reference ? { indentation: match[1].length, reference } : null;
48
+ }
49
+
3
50
  /** @param {string} line @returns {number} */
4
51
  function indentOf(line) {
5
52
  return line.length - line.trimStart().length;
@@ -56,11 +103,9 @@ export function extractCallerJobs(content) {
56
103
  const lines = content.split(/\r?\n/);
57
104
  const jobs = [];
58
105
  for (let index = 0; index < lines.length; index++) {
59
- const usesMatch = /^(\s*)uses:\s*(\S+)\s*$/.exec(lines[index]);
60
- if (!usesMatch) continue;
61
- const reference = parseReusableReference(usesMatch[2]);
62
- if (!reference) continue;
63
- const indentation = usesMatch[1].length;
106
+ const parsed = parseUsesLine(lines[index]);
107
+ if (!parsed) continue;
108
+ const { indentation, reference } = parsed;
64
109
  let withKeys = [];
65
110
  for (let child = index + 1; child < lines.length; child++) {
66
111
  const line = lines[child];
@@ -85,6 +130,36 @@ export function extractCallerJobs(content) {
85
130
  return jobs;
86
131
  }
87
132
 
133
+ /**
134
+ * Every `uses:` line naming a Lisa reusable workflow that `extractCallerJobs`
135
+ * cannot read.
136
+ *
137
+ * Both stale-input checks treat "no callers parsed" as "nothing stale". A Lisa
138
+ * caller the parser skips is therefore a check that passes having inspected
139
+ * nothing — the failure CodySwannGT/lisa#4641 found on every pinned host. This
140
+ * lets each check fail closed: report the line instead of dropping it.
141
+ *
142
+ * Any non-comment line mentioning a Lisa reusable workflow path counts, not
143
+ * only `uses:` lines: a `uses:` value split onto the next line, or a flow
144
+ * mapping such as `job: { uses: … }`, is still a call the parser cannot check.
145
+ * Commented-out lines are documentation, not calls, and are never reported.
146
+ *
147
+ * @param {string} content
148
+ * @returns {{ line: number, text: string }[]} 1-based line number and the
149
+ * trimmed line text, in file order.
150
+ */
151
+ export function findUnparsedLisaCallerLines(content) {
152
+ return content
153
+ .split(/\r?\n/)
154
+ .flatMap((line, index) =>
155
+ !COMMENT_LINE.test(line) &&
156
+ LISA_WORKFLOW_PATH.test(line) &&
157
+ parseUsesLine(line) === null
158
+ ? [{ line: index + 1, text: line.trim() }]
159
+ : []
160
+ );
161
+ }
162
+
88
163
  /** @param {string} content @returns {string[] | null} */
89
164
  export function extractDeclaredInputs(content) {
90
165
  const lines = content.split(/\r?\n/);