@codyswann/lisa 3.48.7 → 3.50.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 (141) hide show
  1. package/dist/cli/doctor-hook-copy-parity.d.ts +8 -0
  2. package/dist/cli/doctor-hook-copy-parity.d.ts.map +1 -0
  3. package/dist/cli/doctor-hook-copy-parity.js +121 -0
  4. package/dist/cli/doctor-hook-copy-parity.js.map +1 -0
  5. package/dist/cli/doctor.d.ts.map +1 -1
  6. package/dist/cli/doctor.js +6 -0
  7. package/dist/cli/doctor.js.map +1 -1
  8. package/dist/cli/gate-report-agent-hooks.d.ts +40 -0
  9. package/dist/cli/gate-report-agent-hooks.d.ts.map +1 -0
  10. package/dist/cli/gate-report-agent-hooks.js +226 -0
  11. package/dist/cli/gate-report-agent-hooks.js.map +1 -0
  12. package/dist/cli/gate-report-assemble.d.ts +37 -0
  13. package/dist/cli/gate-report-assemble.d.ts.map +1 -0
  14. package/dist/cli/gate-report-assemble.js +69 -0
  15. package/dist/cli/gate-report-assemble.js.map +1 -0
  16. package/dist/cli/gate-report-cells.d.ts +27 -2
  17. package/dist/cli/gate-report-cells.d.ts.map +1 -1
  18. package/dist/cli/gate-report-cells.js +59 -14
  19. package/dist/cli/gate-report-cells.js.map +1 -1
  20. package/dist/cli/gate-report-contexts.d.ts +70 -0
  21. package/dist/cli/gate-report-contexts.d.ts.map +1 -0
  22. package/dist/cli/gate-report-contexts.js +72 -0
  23. package/dist/cli/gate-report-contexts.js.map +1 -0
  24. package/dist/cli/gate-report-facade.d.ts +62 -0
  25. package/dist/cli/gate-report-facade.d.ts.map +1 -0
  26. package/dist/cli/gate-report-facade.js +224 -0
  27. package/dist/cli/gate-report-facade.js.map +1 -0
  28. package/dist/cli/gate-report-fragment.d.ts +11 -0
  29. package/dist/cli/gate-report-fragment.d.ts.map +1 -0
  30. package/dist/cli/gate-report-fragment.js +100 -0
  31. package/dist/cli/gate-report-fragment.js.map +1 -0
  32. package/dist/cli/gate-report-html.d.ts +47 -0
  33. package/dist/cli/gate-report-html.d.ts.map +1 -0
  34. package/dist/cli/gate-report-html.js +49 -0
  35. package/dist/cli/gate-report-html.js.map +1 -0
  36. package/dist/cli/gate-report-joins.d.ts +37 -0
  37. package/dist/cli/gate-report-joins.d.ts.map +1 -0
  38. package/dist/cli/gate-report-joins.js +104 -0
  39. package/dist/cli/gate-report-joins.js.map +1 -0
  40. package/dist/cli/gate-report-merge.d.ts +22 -0
  41. package/dist/cli/gate-report-merge.d.ts.map +1 -0
  42. package/dist/cli/gate-report-merge.js +79 -0
  43. package/dist/cli/gate-report-merge.js.map +1 -0
  44. package/dist/cli/gate-report-preview.d.ts +0 -18
  45. package/dist/cli/gate-report-preview.d.ts.map +1 -1
  46. package/dist/cli/gate-report-preview.js +35 -266
  47. package/dist/cli/gate-report-preview.js.map +1 -1
  48. package/dist/cli/gate-report-rows.d.ts +39 -0
  49. package/dist/cli/gate-report-rows.d.ts.map +1 -0
  50. package/dist/cli/gate-report-rows.js +209 -0
  51. package/dist/cli/gate-report-rows.js.map +1 -0
  52. package/dist/cli/gate-report-sections.d.ts +32 -0
  53. package/dist/cli/gate-report-sections.d.ts.map +1 -0
  54. package/dist/cli/gate-report-sections.js +164 -0
  55. package/dist/cli/gate-report-sections.js.map +1 -0
  56. package/dist/cli/gate-report-style.d.ts +19 -0
  57. package/dist/cli/gate-report-style.d.ts.map +1 -0
  58. package/dist/cli/gate-report-style.js +97 -0
  59. package/dist/cli/gate-report-style.js.map +1 -0
  60. package/dist/cli/gate-report-summary.d.ts.map +1 -1
  61. package/dist/cli/gate-report-summary.js +3 -0
  62. package/dist/cli/gate-report-summary.js.map +1 -1
  63. package/dist/cli/gate-report-types.d.ts +132 -1
  64. package/dist/cli/gate-report-types.d.ts.map +1 -1
  65. package/dist/cli/gate-report-types.js +1 -1
  66. package/dist/cli/gate-report-upstream.d.ts +70 -0
  67. package/dist/cli/gate-report-upstream.d.ts.map +1 -0
  68. package/dist/cli/gate-report-upstream.js +90 -0
  69. package/dist/cli/gate-report-upstream.js.map +1 -0
  70. package/dist/cli/gate-report.d.ts +2 -0
  71. package/dist/cli/gate-report.d.ts.map +1 -1
  72. package/dist/cli/gate-report.js +98 -140
  73. package/dist/cli/gate-report.js.map +1 -1
  74. package/dist/cli/ui-cmd.d.ts +4 -0
  75. package/dist/cli/ui-cmd.d.ts.map +1 -1
  76. package/dist/cli/ui-cmd.js +10 -2
  77. package/dist/cli/ui-cmd.js.map +1 -1
  78. package/dist/cli/ui-gate-report.d.ts +57 -0
  79. package/dist/cli/ui-gate-report.d.ts.map +1 -0
  80. package/dist/cli/ui-gate-report.js +95 -0
  81. package/dist/cli/ui-gate-report.js.map +1 -0
  82. package/dist/core/hook-copy-parity.d.ts +81 -0
  83. package/dist/core/hook-copy-parity.d.ts.map +1 -0
  84. package/dist/core/hook-copy-parity.js +111 -0
  85. package/dist/core/hook-copy-parity.js.map +1 -0
  86. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  87. package/dist/core/upstream-evidence-manifest.js +28 -2
  88. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  89. package/package.json +1 -1
  90. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  92. package/plugins/lisa-agy/plugin.json +1 -1
  93. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  96. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  102. package/plugins/lisa-expo-agy/plugin.json +1 -1
  103. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  107. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  108. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  110. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  111. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  112. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  113. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  115. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  116. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  117. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  118. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  120. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  121. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  122. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  123. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  124. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  125. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  126. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  127. package/plugins/lisa-rails-agy/plugin.json +1 -1
  128. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  129. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  130. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  131. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  132. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  133. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  134. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  135. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  136. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  137. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  138. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  139. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  140. package/ui/README.md +56 -3
  141. package/ui/index.html +52 -0
@@ -0,0 +1,8 @@
1
+ import type { DoctorCheck } from "./doctor.js";
2
+ /**
3
+ * Report hooks whose tracked copies declare different features.
4
+ * @param targetPath - Project path to inspect
5
+ * @returns Doctor check result
6
+ */
7
+ export declare function checkHookCopyParity(targetPath: string): Promise<DoctorCheck>;
8
+ //# sourceMappingURL=doctor-hook-copy-parity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-hook-copy-parity.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-hook-copy-parity.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA2E/C;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAgDtB"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Report sibling copies of one git hook that disagree about a declared feature.
3
+ *
4
+ * Answers a question no other check asks. The Lisa-owned artifact check
5
+ * (`doctor-lisa-owned-artifacts`) compares one destination path in a project
6
+ * against the copies the package ships for it — "is this host running a stale
7
+ * copy of what we shipped?". This asks the orthogonal question: "do the copies
8
+ * inside ONE tree agree with each other?" A second copy at a different path,
9
+ * in a directory the package does not ship, is invisible to the first check by
10
+ * construction and was invisible for four weeks (CodySwannGT/lisa#2847).
11
+ *
12
+ * Naturally quiet in a host project, where each hook has exactly one tracked
13
+ * copy and there is nothing to disagree.
14
+ * @module cli/doctor-hook-copy-parity
15
+ */
16
+ import { execFile } from "node:child_process";
17
+ import { readFile } from "node:fs/promises";
18
+ import * as path from "node:path";
19
+ import { promisify } from "node:util";
20
+ import { declaredHookFeatures, deriveHookCopyGroups, describeHookCopyFinding, findHookCopyDrift, } from "../core/hook-copy-parity.js";
21
+ const CHECK_NAME = "Hook copies agree?";
22
+ const GIT_TIMEOUT_MS = 10_000;
23
+ const GIT_MAX_BUFFER_BYTES = 8 * 1024 * 1024;
24
+ const MAX_REPORTED_FINDINGS = 5;
25
+ const run = promisify(execFile);
26
+ /**
27
+ * Every path git tracks in a checkout.
28
+ * @param targetPath - Project path to inspect
29
+ * @returns Repo-relative tracked paths, or undefined when git cannot answer
30
+ */
31
+ async function trackedPaths(targetPath) {
32
+ try {
33
+ const { stdout } = await run("git", ["ls-files", "-z"], {
34
+ cwd: targetPath,
35
+ maxBuffer: GIT_MAX_BUFFER_BYTES,
36
+ timeout: GIT_TIMEOUT_MS,
37
+ });
38
+ return stdout.split("\0").filter(entry => entry.length > 0);
39
+ }
40
+ catch {
41
+ return undefined;
42
+ }
43
+ }
44
+ /**
45
+ * Read one hook copy and extract what it declares.
46
+ *
47
+ * A copy that cannot be read is reported as declaring nothing rather than
48
+ * dropped: dropping it would let an unreadable copy silently leave the roster,
49
+ * which is the failure this check exists to prevent.
50
+ * @param targetPath - Project root
51
+ * @param relative - Repo-relative path of the copy
52
+ * @returns The copy and its declared features
53
+ */
54
+ async function readHookCopy(targetPath, relative) {
55
+ try {
56
+ const source = await readFile(path.join(targetPath, relative), "utf8");
57
+ return { path: relative, features: declaredHookFeatures(source) };
58
+ }
59
+ catch {
60
+ return { path: relative, features: [] };
61
+ }
62
+ }
63
+ /**
64
+ * Collect every disagreement between sibling copies of a hook in one checkout.
65
+ * @param targetPath - Project path to inspect
66
+ * @param paths - Repo-relative tracked paths
67
+ * @returns Findings across every hook with more than one copy
68
+ */
69
+ async function collectFindings(targetPath, paths) {
70
+ const groups = deriveHookCopyGroups(paths).filter(group => group.paths.length > 1);
71
+ const perGroup = await Promise.all(groups.map(async (group) => {
72
+ const copies = await Promise.all(group.paths.map(relative => readHookCopy(targetPath, relative)));
73
+ return findHookCopyDrift(group.hook, copies);
74
+ }));
75
+ return perGroup.flat();
76
+ }
77
+ /**
78
+ * Report hooks whose tracked copies declare different features.
79
+ * @param targetPath - Project path to inspect
80
+ * @returns Doctor check result
81
+ */
82
+ export async function checkHookCopyParity(targetPath) {
83
+ const paths = await trackedPaths(targetPath);
84
+ if (paths === undefined) {
85
+ return {
86
+ name: CHECK_NAME,
87
+ status: "warn",
88
+ detail: "Could not list tracked files, so sibling hook copies were not compared. " +
89
+ "This is not a pass — run `lisa doctor` from inside a git checkout",
90
+ };
91
+ }
92
+ const multiCopy = deriveHookCopyGroups(paths).filter(group => group.paths.length > 1);
93
+ if (multiCopy.length === 0) {
94
+ return {
95
+ name: CHECK_NAME,
96
+ status: "ok",
97
+ detail: "No hook has more than one tracked copy",
98
+ };
99
+ }
100
+ const findings = await collectFindings(targetPath, paths);
101
+ if (findings.length === 0) {
102
+ const copies = multiCopy.reduce((total, group) => total + group.paths.length, 0);
103
+ return {
104
+ name: CHECK_NAME,
105
+ status: "ok",
106
+ detail: `${copies} tracked copies across ${multiCopy.length} hook(s) declare the same features`,
107
+ };
108
+ }
109
+ const shown = findings
110
+ .slice(0, MAX_REPORTED_FINDINGS)
111
+ .map(describeHookCopyFinding);
112
+ const more = findings.length > MAX_REPORTED_FINDINGS
113
+ ? ` (+${findings.length - MAX_REPORTED_FINDINGS} more)`
114
+ : "";
115
+ return {
116
+ name: CHECK_NAME,
117
+ status: "fail",
118
+ detail: `${findings.length} feature(s) differ between copies of the same hook: ${shown.join("; ")}${more}`,
119
+ };
120
+ }
121
+ //# sourceMappingURL=doctor-hook-copy-parity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-hook-copy-parity.js","sourceRoot":"","sources":["../../src/cli/doctor-hook-copy-parity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,GAGlB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,UAAU,GAAG,oBAAoB,CAAC;AACxC,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,oBAAoB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7C,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEhC;;;;GAIG;AACH,KAAK,UAAU,YAAY,CACzB,UAAkB;IAElB,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE;YACtD,GAAG,EAAE,UAAU;YACf,SAAS,EAAE,oBAAoB;YAC/B,OAAO,EAAE,cAAc;SACxB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,KAAK,UAAU,YAAY,CACzB,U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IACtC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;CACjD;AAaD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,EAChD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,WAAW,CAAC,CAyBtB;AA4MD;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,aAAa,EACtB,YAAY,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC7C,OAAO,CAAC,YAAY,CAAC,CAgFvB"}
@@ -23,6 +23,7 @@ import { checkApplyFailure } from "./doctor-apply-failure.js";
23
23
  import { renderDoctorResult } from "./doctor-render.js";
24
24
  import { checkSkipJobsMigration } from "./doctor-skip-jobs-migration.js";
25
25
  import { checkTraceabilityGate } from "./doctor-traceability-gate.js";
26
+ import { checkHookCopyParity } from "./doctor-hook-copy-parity.js";
26
27
  import { checkWorktreeHygiene } from "./doctor-worktree-hygiene.js";
27
28
  import { checkWorktreeWorkAtRisk } from "./doctor-worktree-work-at-risk.js";
28
29
  import { STARTERS } from "./starters.js";
@@ -306,6 +307,11 @@ export async function runDoctor(targetPath, options, dependencies = {}) {
306
307
  // Static answer to a runtime failure that is deliberately silent: an
307
308
  // incomplete serialize opt-in warns at 2am on a green job and nowhere else.
308
309
  await checkSerializeLegsContract(resolvedTarget),
310
+ // Sibling copies of one hook inside THIS tree, which the Lisa-owned
311
+ // artifact check cannot see: its axis is host copy vs shipped package copy
312
+ // for one destination, so a second copy at another path is outside it by
313
+ // construction (CodySwannGT/lisa#2847).
314
+ await checkHookCopyParity(resolvedTarget),
309
315
  await checkWorktreeHygiene(resolvedTarget),
310
316
  // Immediately after the count check, and deliberately separate from it.
311
317
  // Hygiene answers "how many checkouts is every crawler walking past"; this
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CA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AC;QAC1C,wEAAwE;QACxE,2EAA2E;QAC3E,yEAAyE;QACzE,uEAAuE;QACvE,MAAM,uBAAuB,CAAC,cAAc,CAAC;QAC7C,MAAM,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC;QACxD,SAAS,CAAC,cAAc,CAAC;QACzB,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI;YAC5B,CAAC,CAAC,CAAC,MAAM,wBAAwB,CAAC,cAAc,CAAC,CAAC;YAClD,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CACrC,MAAM,EACN,cAAc,EACd,OAAO,EACP,IAAI,CAAC,KAAK,CACX,CAAC;IAEF,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { AgentHookEvidence, Finding } from "./gate-report-types.js";
2
+ /** Injectable boundaries, so tests never read the real home directory. */
3
+ export interface AgentHookDependencies {
4
+ /** Home directory holding the installed marketplaces. */
5
+ readonly homedir?: () => string;
6
+ }
7
+ /**
8
+ * Whether a matcher selects a tool that writes a file.
9
+ *
10
+ * Compared alternative by alternative rather than by substring, because
11
+ * `TodoWrite` contains `Write` and a substring test therefore reports a hook
12
+ * on the task list as edit-time enforcement. Over-reporting here is not a
13
+ * harmless surplus: the count it feeds is an operator's measure of how much
14
+ * runs that they cannot govern.
15
+ * @param matcher - The matcher as the manifest spells it
16
+ * @returns True when it selects a file-writing tool
17
+ */
18
+ export declare function matchesEditTool(matcher: string): boolean;
19
+ /**
20
+ * The script a hook command runs.
21
+ *
22
+ * A command is not always a bare path — some are a small shell pipeline — so
23
+ * the last path-like token wins and a command with no script falls back to its
24
+ * first word rather than to a slice of shell syntax.
25
+ * @param command - The registered command
26
+ * @returns A short, operator-readable name
27
+ */
28
+ export declare function scriptNameOf(command: string): string;
29
+ /**
30
+ * Every edit-time hook proved installed and active for this project.
31
+ *
32
+ * Degrades to `unknown` rather than to an empty list. "No agent hooks run
33
+ * here" and "this run could not see which plugins are installed" are different
34
+ * answers, and only the first of them is a finding.
35
+ * @param projectRoot - Project root
36
+ * @param dependencies - Injectable boundaries
37
+ * @returns The evidence, or an honest unknown
38
+ */
39
+ export declare function collectAgentHooks(projectRoot: string, dependencies?: AgentHookDependencies): Promise<Finding<readonly AgentHookEvidence[]>>;
40
+ //# sourceMappingURL=gate-report-agent-hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-report-agent-hooks.d.ts","sourceRoot":"","sources":["../../src/cli/gate-report-agent-hooks.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAWzE,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;CACjC;AA4DD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAKxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOpD;AAuED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,YAAY,GAAE,qBAA0B,GACvC,OAAO,CAAC,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAAC,CAyBhD"}
@@ -0,0 +1,226 @@
1
+ /**
2
+ * What enforces on every file an agent writes — the `pre-tool` moment.
3
+ *
4
+ * No registry entry lists `pre-tool` in its moments, so no gate can be
5
+ * declared there and the column renders as a wall of "not legal here". Read
6
+ * literally that says nothing happens at this moment. What actually happens is
7
+ * the more alarming state: six scripts fire on every edit — formatting,
8
+ * linting, structural scanning, suppression blocking — running, ungoverned,
9
+ * and impossible to declare.
10
+ *
11
+ * They live in the INSTALLED plugin rather than the project checkout, which is
12
+ * why the emitter did not see them. That is a statement about where the
13
+ * emitter was looking, not about whether the fact is knowable: which plugins a
14
+ * project enables is in its own settings file, and which hooks those plugins
15
+ * register is on the machine running the report. "Not where I was looking" and
16
+ * "not derivable" are different answers and the three-state rule means the
17
+ * difference has to be said rather than rendered as absence.
18
+ *
19
+ * Only file names are reported, never the absolute paths they were read from.
20
+ * An absolute path differs per machine and would break the byte-identical
21
+ * property the report is built on.
22
+ * @module cli/gate-report-agent-hooks
23
+ */
24
+ import { readFile } from "node:fs/promises";
25
+ import { homedir as defaultHomedir } from "node:os";
26
+ import * as path from "node:path";
27
+ /** The harness events that fire around a single tool call. */
28
+ const PRE_TOOL_EVENTS = ["PreToolUse", "PostToolUse"];
29
+ /** The tools that write a file, as a matcher spells them. */
30
+ const EDIT_TOOLS = new Set(["Write", "Edit", "MultiEdit", "NotebookEdit"]);
31
+ /** File extensions a hook command's script carries. */
32
+ const SCRIPT_SUFFIXES = [".sh", ".mjs", ".js", ".py", ".ts"];
33
+ /**
34
+ * Parse a JSON file, treating anything unreadable as absent.
35
+ * @param file - Absolute path
36
+ * @returns The parsed value, or undefined
37
+ */
38
+ async function readJson(file) {
39
+ const source = await readFile(file, "utf8").catch(() => undefined);
40
+ if (source === undefined)
41
+ return undefined;
42
+ try {
43
+ return JSON.parse(source);
44
+ }
45
+ catch {
46
+ return undefined;
47
+ }
48
+ }
49
+ /**
50
+ * The plugins the project's settings file switches on.
51
+ * @param projectRoot - Project root
52
+ * @returns Plugin references in `name@marketplace` form, sorted
53
+ */
54
+ async function enabledPlugins(projectRoot) {
55
+ const settings = await readJson(path.join(projectRoot, ".claude", "settings.json"));
56
+ if (settings === null || typeof settings !== "object")
57
+ return null;
58
+ const enabled = Reflect.get(settings, "enabledPlugins");
59
+ if (enabled === null || typeof enabled !== "object")
60
+ return [];
61
+ return Object.entries(enabled)
62
+ .filter(([, value]) => value === true)
63
+ .map(([key]) => key)
64
+ .sort((left, right) => left.localeCompare(right));
65
+ }
66
+ /**
67
+ * Where each installed marketplace was unpacked.
68
+ * @param home - Home directory
69
+ * @returns Marketplace name -> install location
70
+ */
71
+ async function marketplaceLocations(home) {
72
+ const known = await readJson(path.join(home, ".claude", "plugins", "known_marketplaces.json"));
73
+ if (known === null || typeof known !== "object" || Array.isArray(known)) {
74
+ return new Map();
75
+ }
76
+ return new Map(Object.entries(known).flatMap(([name, entry]) => {
77
+ if (entry === null || typeof entry !== "object")
78
+ return [];
79
+ const location = Reflect.get(entry, "installLocation");
80
+ return typeof location === "string" && location.length > 0
81
+ ? [[name, location]]
82
+ : [];
83
+ }));
84
+ }
85
+ /**
86
+ * Whether a matcher selects a tool that writes a file.
87
+ *
88
+ * Compared alternative by alternative rather than by substring, because
89
+ * `TodoWrite` contains `Write` and a substring test therefore reports a hook
90
+ * on the task list as edit-time enforcement. Over-reporting here is not a
91
+ * harmless surplus: the count it feeds is an operator's measure of how much
92
+ * runs that they cannot govern.
93
+ * @param matcher - The matcher as the manifest spells it
94
+ * @returns True when it selects a file-writing tool
95
+ */
96
+ export function matchesEditTool(matcher) {
97
+ return matcher
98
+ .split("|")
99
+ .map(part => part.trim())
100
+ .some(part => EDIT_TOOLS.has(part));
101
+ }
102
+ /**
103
+ * The script a hook command runs.
104
+ *
105
+ * A command is not always a bare path — some are a small shell pipeline — so
106
+ * the last path-like token wins and a command with no script falls back to its
107
+ * first word rather than to a slice of shell syntax.
108
+ * @param command - The registered command
109
+ * @returns A short, operator-readable name
110
+ */
111
+ export function scriptNameOf(command) {
112
+ const tokens = command.split(/\s+/).filter(token => token.length > 0);
113
+ const scripts = tokens.filter(token => SCRIPT_SUFFIXES.some(suffix => token.endsWith(suffix)));
114
+ const chosen = scripts[scripts.length - 1] ?? tokens[0] ?? command;
115
+ return chosen.slice(chosen.lastIndexOf("/") + 1);
116
+ }
117
+ /**
118
+ * Every command a hook group registers.
119
+ * @param group - One entry of a hook event's array
120
+ * @returns The commands, in declaration order
121
+ */
122
+ function commandsOf(group) {
123
+ if (group === null || typeof group !== "object")
124
+ return [];
125
+ const hooks = Reflect.get(group, "hooks");
126
+ if (!Array.isArray(hooks))
127
+ return [];
128
+ return hooks.flatMap(hook => {
129
+ if (hook === null || typeof hook !== "object")
130
+ return [];
131
+ const command = Reflect.get(hook, "command");
132
+ return typeof command === "string" ? [command] : [];
133
+ });
134
+ }
135
+ /**
136
+ * The edit-time hooks one plugin manifest registers.
137
+ * @param reference - The plugin as the settings file spells it
138
+ * @param manifest - The parsed plugin manifest
139
+ * @returns Evidence, one entry per registered command
140
+ */
141
+ function hooksOfManifest(reference, manifest) {
142
+ if (manifest === null || typeof manifest !== "object")
143
+ return [];
144
+ const hooks = Reflect.get(manifest, "hooks");
145
+ if (hooks === null || typeof hooks !== "object")
146
+ return [];
147
+ return PRE_TOOL_EVENTS.flatMap(event => {
148
+ const groups = Reflect.get(hooks, event);
149
+ if (!Array.isArray(groups))
150
+ return [];
151
+ return groups.flatMap(group => {
152
+ const matcher = group !== null && typeof group === "object"
153
+ ? Reflect.get(group, "matcher")
154
+ : undefined;
155
+ if (typeof matcher !== "string" || !matchesEditTool(matcher))
156
+ return [];
157
+ return commandsOf(group).map(command => ({
158
+ plugin: reference,
159
+ event,
160
+ matcher,
161
+ script: scriptNameOf(command),
162
+ }));
163
+ });
164
+ });
165
+ }
166
+ /**
167
+ * Read one enabled plugin's manifest from its installed marketplace.
168
+ * @param reference - `name@marketplace`
169
+ * @param locations - Marketplace name -> install location
170
+ * @returns Evidence from that plugin alone
171
+ */
172
+ async function hooksOfPlugin(reference, locations) {
173
+ const separator = reference.lastIndexOf("@");
174
+ if (separator <= 0)
175
+ return [];
176
+ const name = reference.slice(0, separator);
177
+ const location = locations.get(reference.slice(separator + 1));
178
+ if (location === undefined)
179
+ return [];
180
+ const manifest = await readJson(path.join(location, "plugins", name, ".claude-plugin", "plugin.json"));
181
+ return hooksOfManifest(reference, manifest);
182
+ }
183
+ /**
184
+ * Every edit-time hook proved installed and active for this project.
185
+ *
186
+ * Degrades to `unknown` rather than to an empty list. "No agent hooks run
187
+ * here" and "this run could not see which plugins are installed" are different
188
+ * answers, and only the first of them is a finding.
189
+ * @param projectRoot - Project root
190
+ * @param dependencies - Injectable boundaries
191
+ * @returns The evidence, or an honest unknown
192
+ */
193
+ export async function collectAgentHooks(projectRoot, dependencies = {}) {
194
+ const enabled = await enabledPlugins(projectRoot);
195
+ if (enabled === null) {
196
+ return {
197
+ state: "unknown",
198
+ reason: "agent-settings-unreadable",
199
+ message: "This project's .claude/settings.json could not be read, so which agent hooks are active on every edit is unknown. It is not a claim that none are.",
200
+ };
201
+ }
202
+ const home = (dependencies.homedir ?? defaultHomedir)();
203
+ const locations = await marketplaceLocations(home);
204
+ if (enabled.length > 0 && locations.size === 0) {
205
+ return {
206
+ state: "unknown",
207
+ reason: "installed-plugins-unreadable",
208
+ message: "This project enables plugins, but the installed marketplaces on this machine could not be read, so the hooks they register on every edit are unknown.",
209
+ };
210
+ }
211
+ const found = await Promise.all(enabled.map(async (reference) => await hooksOfPlugin(reference, locations)));
212
+ const flat = found.flat();
213
+ return { state: "verified", value: [...flat].sort(byPluginThenScript) };
214
+ }
215
+ /**
216
+ * Order two hooks so the report is stable across machines.
217
+ * @param left - One hook
218
+ * @param right - Another hook
219
+ * @returns A comparison result
220
+ */
221
+ function byPluginThenScript(left, right) {
222
+ return (left.plugin.localeCompare(right.plugin) ||
223
+ left.event.localeCompare(right.event) ||
224
+ left.script.localeCompare(right.script));
225
+ }
226
+ //# sourceMappingURL=gate-report-agent-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-report-agent-hooks.js","sourceRoot":"","sources":["../../src/cli/gate-report-agent-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;G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AAoB,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC/C,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,8BAA8B;YACtC,OAAO,EACL,uJAAuJ;SAC1J,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAC7B,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,SAAS,EAAC,EAAE,CAAC,MAAM,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAC1E,CAAC;IACF,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB,CACzB,IAAuB,EACvB,KAAwB;IAExB,OAAO,CACL,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC;QACrC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CACxC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Assemble one gate's row from its cells.
3
+ *
4
+ * Separated from the report's own module because the two do different work:
5
+ * that one reads the world, this one shapes what was read. Everything here is
6
+ * pure — the same inputs give the same row, which is what makes the byte-
7
+ * identical property testable without touching a filesystem.
8
+ * @module cli/gate-report-assemble
9
+ */
10
+ import { type CellContext } from "./gate-report-cells.js";
11
+ import type { GateRegistryModule, ResolvedGate } from "./gate-report-registry.js";
12
+ import type { GateReportRow } from "./gate-report-types.js";
13
+ /** One moment's resolution, in axis order. */
14
+ export interface ResolvedMoment {
15
+ /** The moment, `:environment` suffix included. */
16
+ readonly moment: string;
17
+ /** `resolveMoment(..., includeOff: true)` keyed by gate id, or null. */
18
+ readonly resolved: Map<string, ResolvedGate> | null;
19
+ /** Why `resolved` is null, when it is. */
20
+ readonly failure: string | null;
21
+ }
22
+ /**
23
+ * Invert the static job table so a gate can name its CI job.
24
+ * @param registry - The shipped registry
25
+ * @returns Gate id -> job id
26
+ */
27
+ export declare function invertJobTable(registry: GateRegistryModule): Map<string, string>;
28
+ /**
29
+ * Build one gate's row.
30
+ * @param context - Report-wide cell inputs
31
+ * @param moments - Per-moment resolution results, in axis order
32
+ * @param id - Gate id
33
+ * @param jobForGate - Gate id -> `quality.yml` job
34
+ * @returns The row
35
+ */
36
+ export declare function buildRow(context: CellContext, moments: readonly ResolvedMoment[], id: string, jobForGate: ReadonlyMap<string, string>): GateReportRow;
37
+ //# sourceMappingURL=gate-report-assemble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-report-assemble.d.ts","sourceRoot":"","sources":["../../src/cli/gate-report-assemble.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5E,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAI,CAAC;IACpD,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAkBD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,kBAAkB,GAC3B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAQrB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,aAAa,CA8Bf"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Assemble one gate's row from its cells.
3
+ *
4
+ * Separated from the report's own module because the two do different work:
5
+ * that one reads the world, this one shapes what was read. Everything here is
6
+ * pure — the same inputs give the same row, which is what makes the byte-
7
+ * identical property testable without touching a filesystem.
8
+ * @module cli/gate-report-assemble
9
+ */
10
+ import { buildCell } from "./gate-report-cells.js";
11
+ /**
12
+ * A gate-level `run` override from the settings file.
13
+ * @param gates - The gates block
14
+ * @param id - Gate id
15
+ * @returns The task, or null
16
+ */
17
+ function projectLevelTask(gates, id) {
18
+ const gate = gates[id];
19
+ if (typeof gate !== "object" || gate === null)
20
+ return null;
21
+ const run = Reflect.get(gate, "run");
22
+ return typeof run === "string" ? run : null;
23
+ }
24
+ /**
25
+ * Invert the static job table so a gate can name its CI job.
26
+ * @param registry - The shipped registry
27
+ * @returns Gate id -> job id
28
+ */
29
+ export function invertJobTable(registry) {
30
+ // Reversed before the Map is built so that when two jobs name one gate the
31
+ // FIRST in declaration order wins, which is the order the table reads in.
32
+ return new Map(Object.entries(registry.QUALITY_JOB_GATES)
33
+ .map(([job, gate]) => [gate, job])
34
+ .reverse());
35
+ }
36
+ /**
37
+ * Build one gate's row.
38
+ * @param context - Report-wide cell inputs
39
+ * @param moments - Per-moment resolution results, in axis order
40
+ * @param id - Gate id
41
+ * @param jobForGate - Gate id -> `quality.yml` job
42
+ * @returns The row
43
+ */
44
+ export function buildRow(context, moments, id, jobForGate) {
45
+ const definition = context.registry.REGISTRY[id];
46
+ const mergeIndex = moments.findIndex(entry => entry.moment === context.mergeMoment);
47
+ const qualityJob = jobForGate.get(id) ?? null;
48
+ const cells = moments.map(moment => buildCell(context, moment, id, qualityJob));
49
+ return {
50
+ id,
51
+ label: definition?.label ?? id,
52
+ summary: definition?.summary ?? "",
53
+ legalMoments: [...(definition?.moments ?? [])].sort((left, right) => left.localeCompare(right)),
54
+ defaultTask: definition?.task ?? null,
55
+ taskAt: { ...definition?.taskAt },
56
+ projectTask: projectLevelTask(context.gates, id),
57
+ mayRewrite: definition?.mayRewrite === true,
58
+ costly: definition?.costly === true,
59
+ interceptor: context.registry.INTERCEPTORS[id] ?? null,
60
+ qualityJob,
61
+ moments: cells,
62
+ merge: context.merge({
63
+ expectedContext: cells[mergeIndex]?.expectedContext ?? null,
64
+ task: cells[mergeIndex]?.task ?? null,
65
+ label: definition?.label ?? id,
66
+ }),
67
+ };
68
+ }
69
+ //# sourceMappingURL=gate-report-assemble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-report-assemble.js","sourceRoot":"","sources":["../../src/cli/gate-report-assemble.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAiBrE;;;;;GAKG;AACH,SAAS,gBAAgB,CACvB,KAA8B,EAC9B,EAAU;IAEV,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACvB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC3D,MAAM,GAAG,GAAY,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,QAA4B;IAE5B,2EAA2E;IAC3E,0EAA0E;IAC1E,OAAO,IAAI,GAAG,CACZ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