@codyswann/lisa 5.1.7 → 5.2.1

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/lib/github-attestation-provider.mjs +15 -0
  2. package/all/copy-overwrite/scripts/lib/npm-update-allocate.mjs +32 -39
  3. package/all/copy-overwrite/scripts/lib/npm-update-authorization.mjs +12 -2
  4. package/all/copy-overwrite/scripts/lib/npm-update-checkpoint.mjs +10 -30
  5. package/all/copy-overwrite/scripts/lib/npm-update-execution-adapter.mjs +4 -1
  6. package/all/copy-overwrite/scripts/lib/npm-update-helper-graph.mjs +1 -1
  7. package/all/copy-overwrite/scripts/lib/npm-update-helper-inventory.mjs +4 -0
  8. package/all/copy-overwrite/scripts/lib/npm-update-hosted-hook.mjs +2 -1
  9. package/all/copy-overwrite/scripts/lib/npm-update-invariants.mjs +15 -1
  10. package/all/copy-overwrite/scripts/lib/npm-update-leaf-contract.mjs +41 -9
  11. package/all/copy-overwrite/scripts/lib/npm-update-leaf.mjs +23 -35
  12. package/all/copy-overwrite/scripts/lib/npm-update-policy.mjs +41 -6
  13. package/all/copy-overwrite/scripts/lib/npm-update-recovery.mjs +16 -3
  14. package/all/copy-overwrite/scripts/lib/npm-update-tracker-jira.mjs +300 -0
  15. package/all/copy-overwrite/scripts/lib/npm-update-tracker-linear.mjs +304 -0
  16. package/all/copy-overwrite/scripts/lib/npm-update-tracker-wire.mjs +298 -0
  17. package/all/copy-overwrite/scripts/lib/npm-update-tracker.mjs +179 -0
  18. package/all/copy-overwrite/scripts/lisa-npm-updater.mjs +16 -2
  19. package/all/copy-overwrite/scripts/lisa-work-item.mjs +1 -1
  20. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +62 -14
  21. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  22. package/dist/core/lisa-owned-hash-ledger.js +96 -0
  23. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  24. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  25. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  26. package/dist/core/upstream-evidence-manifest.js +84 -77
  27. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  28. package/package.json +4 -5
  29. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  31. package/plugins/lisa-agy/plugin.json +1 -1
  32. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  35. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  39. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  43. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  45. package/plugins/lisa-expo-agy/plugin.json +1 -1
  46. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  50. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  53. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  57. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  59. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  60. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  64. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  66. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  67. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  71. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  73. package/plugins/lisa-rails-agy/plugin.json +1 -1
  74. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  78. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  80. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  81. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  85. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  87. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  88. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  92. package/scripts/check-phrase-manifest-parity.mjs +6 -3
  93. package/scripts/classify-phrase-tests.mjs +109 -20
  94. package/scripts/fix-namespace-test-assertions.mjs +3 -20
  95. package/scripts/lib/phrase-tests/doc-taint.mjs +708 -0
  96. package/scripts/lib/phrase-tests/inventory.mjs +381 -0
  97. package/scripts/lib/phrase-tests/manifest.mjs +14 -2
  98. package/scripts/lib/phrase-tests/marker-classes.mjs +323 -0
  99. package/scripts/lib/phrase-tests/redact.mjs +88 -0
  100. package/scripts/two-channel-couplings.json +1 -1
  101. package/typescript/copy-overwrite/.prettierignore +4 -0
@@ -24,7 +24,10 @@
24
24
  *
25
25
  * Usage:
26
26
  * node scripts/check-phrase-manifest-parity.mjs --base <ref> [--head <ref>] [--exact]
27
- * `bun run check:phrase-manifest-parity` pins the fold commit as the range.
27
+ * The fold's own range was `--base 02b59a6297 --head 5207036771 --exact`. It
28
+ * is no longer a package script: CodySwannGT/lisa#4867 pruned the manifest to
29
+ * its load-bearing entries, so the fold's wording pins are gone from it by
30
+ * design, and the check is a record of how the fold was proven, not a gate.
28
31
  * @module scripts/check-phrase-manifest-parity
29
32
  */
30
33
  import { readFileSync } from "node:fs";
@@ -48,8 +51,8 @@ import {
48
51
  const argv = process.argv.slice(2);
49
52
 
50
53
  /**
51
- * The value of the last occurrence of a flag, so a flag appended to
52
- * `bun run check:phrase-manifest-parity` overrides the package script's.
54
+ * The value of the last occurrence of a flag, so a flag given later on the
55
+ * command line overrides an earlier one.
53
56
  * @param {string} name - Flag name, e.g. `--base`.
54
57
  * @returns {string | undefined} Its value, or undefined when absent.
55
58
  */
@@ -8,9 +8,33 @@
8
8
  * node scripts/classify-phrase-tests.mjs # one line per file
9
9
  * node scripts/classify-phrase-tests.mjs --json # machine-readable
10
10
  * node scripts/classify-phrase-tests.mjs --all # also rejected files, with reasons
11
+ *
12
+ * Phrase classes (CodySwannGT/lisa#4867; rules in `lib/phrase-tests/marker-classes.mjs`):
13
+ * node scripts/classify-phrase-tests.mjs --classify-manifest # every manifest entry, JSON
14
+ * node scripts/classify-phrase-tests.mjs --classify-assertions # every Markdown phrase assertion in tests, JSON
15
+ * node scripts/classify-phrase-tests.mjs --prune-manifest # drop WORDING; move NOT-MARKDOWN entries to the source-text guards
16
+ * Each entry is MACHINE-TOKEN (with the parser that reads it), STRUCTURAL or
17
+ * WORDING; an assertion whose argument is not a literal is UNRESOLVED.
18
+ * `counts` covers only assertions on Markdown text; `bySource` also counts
19
+ * those on other text (script output) and on text it could not trace.
11
20
  * @module scripts/classify-phrase-tests
12
21
  */
22
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
23
+ import path from "node:path";
24
+
13
25
  import { classifyTestSource } from "./lib/phrase-tests/classify.mjs";
26
+ import {
27
+ classifyAssertions,
28
+ classifyManifest,
29
+ countByClass,
30
+ countBySource,
31
+ pruneManifest,
32
+ } from "./lib/phrase-tests/inventory.mjs";
33
+ import {
34
+ MANIFEST_PATH,
35
+ SOURCE_GUARDS_PATH,
36
+ } from "./lib/phrase-tests/manifest.mjs";
37
+ import { redactDeep, redactText } from "./lib/phrase-tests/redact.mjs";
14
38
  import {
15
39
  REPO_ROOT,
16
40
  workingTreeReader,
@@ -19,36 +43,101 @@ import {
19
43
 
20
44
  const args = new Set(process.argv.slice(2));
21
45
  const readSource = workingTreeReader(REPO_ROOT);
22
- const verdicts = workingTreeTestFiles(REPO_ROOT).map(file =>
23
- classifyTestSource(file, readSource(file) ?? "", readSource)
24
- );
25
- const phraseOnly = verdicts.filter(verdict => verdict.phraseOnly);
26
- const shown = args.has("--all") ? verdicts : phraseOnly;
46
+ const manifestFile = path.join(REPO_ROOT, MANIFEST_PATH);
27
47
 
28
- if (args.has("--json")) {
29
- console.log(
30
- JSON.stringify(
31
- {
32
- testFiles: verdicts.length,
33
- phraseOnly: phraseOnly.length,
34
- assertionSites: phraseOnly.reduce((sum, v) => sum + v.assertions, 0),
35
- files: shown,
36
- },
37
- null,
38
- 2
39
- )
48
+ /**
49
+ * Print a report as JSON, with every credential-shaped string redacted: the
50
+ * reports copy assertion arguments verbatim, and some are fixture secrets.
51
+ * Never follow this with `process.exit`: stdout to a pipe is asynchronous,
52
+ * and exiting early truncates the report at 64 KiB.
53
+ * @param {unknown} report - The report.
54
+ */
55
+ function printJson(report) {
56
+ process.stdout.write(`${JSON.stringify(redactDeep(report), null, 2)}\n`);
57
+ }
58
+
59
+ /**
60
+ * The required-phrases manifest on disk.
61
+ * @returns {import("./lib/phrase-tests/manifest.mjs").Manifest} The manifest.
62
+ */
63
+ function readManifest() {
64
+ return JSON.parse(readFileSync(manifestFile, "utf8"));
65
+ }
66
+
67
+ /** `--classify-assertions`: every Markdown phrase assertion in the tests. */
68
+ function reportAssertions() {
69
+ const sites = workingTreeTestFiles(REPO_ROOT).flatMap(file =>
70
+ classifyAssertions(file, readSource(file) ?? "")
40
71
  );
41
- } else {
72
+ const markdown = sites.filter(site => site.source === "markdown");
73
+ const files = [...new Set(sites.map(site => site.file))].map(file => {
74
+ const own = sites.filter(site => site.file === file);
75
+ return {
76
+ file,
77
+ sites: own.length,
78
+ counts: countByClass(own.filter(site => site.source === "markdown")),
79
+ bySource: countBySource(own),
80
+ };
81
+ });
82
+ printJson({
83
+ testFiles: files.length,
84
+ sites: sites.length,
85
+ markdownSites: markdown.length,
86
+ counts: countByClass(markdown),
87
+ bySource: countBySource(sites),
88
+ files,
89
+ verdicts: sites,
90
+ });
91
+ }
92
+
93
+ /** The original mode: which test files are phrase-only (#4609). */
94
+ function reportPhraseOnlyFiles() {
95
+ const verdicts = workingTreeTestFiles(REPO_ROOT).map(file =>
96
+ classifyTestSource(file, readSource(file) ?? "", readSource)
97
+ );
98
+ const phraseOnly = verdicts.filter(verdict => verdict.phraseOnly);
99
+ const shown = args.has("--all") ? verdicts : phraseOnly;
100
+ const sites = phraseOnly.reduce((sum, v) => sum + v.assertions, 0);
101
+ if (args.has("--json")) {
102
+ printJson({
103
+ testFiles: verdicts.length,
104
+ phraseOnly: phraseOnly.length,
105
+ assertionSites: sites,
106
+ files: shown,
107
+ });
108
+ return;
109
+ }
42
110
  for (const verdict of shown) {
43
111
  const tail = verdict.phraseOnly
44
112
  ? ""
45
113
  : ` REJECTED: ${verdict.reasons.join("; ")}`;
46
114
  console.log(
47
- `${String(verdict.assertions).padStart(5)} ${verdict.file}${tail}`
115
+ redactText(
116
+ `${String(verdict.assertions).padStart(5)} ${verdict.file}${tail}`
117
+ )
48
118
  );
49
119
  }
50
120
  console.log(
51
121
  `${phraseOnly.length} phrase-only of ${verdicts.length} test files; ` +
52
- `${phraseOnly.reduce((sum, v) => sum + v.assertions, 0)} assertion sites`
122
+ `${sites} assertion sites`
53
123
  );
54
124
  }
125
+
126
+ if (args.has("--classify-manifest")) {
127
+ printJson(classifyManifest(readManifest()));
128
+ } else if (args.has("--prune-manifest")) {
129
+ const guardsFile = path.join(REPO_ROOT, SOURCE_GUARDS_PATH);
130
+ const existingGuards = existsSync(guardsFile)
131
+ ? JSON.parse(readFileSync(guardsFile, "utf8"))
132
+ : undefined;
133
+ const { manifest, sourceGuards } = pruneManifest(
134
+ readManifest(),
135
+ existingGuards
136
+ );
137
+ writeFileSync(manifestFile, `${JSON.stringify(manifest, null, 2)}\n`);
138
+ writeFileSync(guardsFile, `${JSON.stringify(sourceGuards, null, 2)}\n`);
139
+ } else if (args.has("--classify-assertions")) {
140
+ reportAssertions();
141
+ } else {
142
+ reportPhraseOnlyFiles();
143
+ }
@@ -25,16 +25,9 @@ function patchFile(file, replacements) {
25
25
  }
26
26
 
27
27
  const testPatches = [
28
- // Skill invocation refs in tests (colon → hyphen for skills). The
29
- // phrase-only suites this also patched were folded into
30
- // tests/phrase-manifest/required-phrases.json (CodySwannGT/lisa#4609).
31
- [
32
- "tests/unit/strategies/prd-intake-s10-hard-gate.test.ts",
33
- [
34
- ["lisa:tracker-validate", "lisa-tracker-validate"],
35
- ["lisa:task-decomposition", "lisa-task-decomposition"],
36
- ],
37
- ],
28
+ // The phrase-only suites this also patched were folded into the phrase
29
+ // manifest (CodySwannGT/lisa#4609), and their wording pins were later
30
+ // culled (CodySwannGT/lisa#4867), so they no longer appear here.
38
31
  // agent-transformer output uses normalized skill names
39
32
  [
40
33
  "tests/unit/codex/agent-transformer.test.ts",
@@ -80,16 +73,6 @@ const testPatches = [
80
73
  ],
81
74
  ],
82
75
  ],
83
- // prd-intake-verify-dispatch: rule cites /lisa:verify-prd command
84
- [
85
- "tests/unit/strategies/prd-intake-verify-dispatch.test.ts",
86
- [
87
- [
88
- 'const VERIFY = "lisa-verify-prd";',
89
- 'const VERIFY = "/lisa:verify-prd";',
90
- ],
91
- ],
92
- ],
93
76
  // harper-fabric template script name unchanged
94
77
  [
95
78
  "tests/unit/strategies/harper-fabric-template-no-advisory-pollution.test.ts",