@codyswann/lisa 4.27.5 → 4.27.7

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 (93) hide show
  1. package/all/copy-overwrite/scripts/lisa-enforcement-fallback.sh +27 -4
  2. package/all/copy-overwrite/scripts/lisa-hooks/block-direct-issue-create.sh +507 -11
  3. package/dist/cli/doctor-enforcement-coverage.d.ts +14 -0
  4. package/dist/cli/doctor-enforcement-coverage.d.ts.map +1 -0
  5. package/dist/cli/doctor-enforcement-coverage.js +103 -0
  6. package/dist/cli/doctor-enforcement-coverage.js.map +1 -0
  7. package/dist/cli/doctor.d.ts.map +1 -1
  8. package/dist/cli/doctor.js +9 -0
  9. package/dist/cli/doctor.js.map +1 -1
  10. package/dist/core/enforcement-census-report.d.ts +19 -0
  11. package/dist/core/enforcement-census-report.d.ts.map +1 -0
  12. package/dist/core/enforcement-census-report.js +198 -0
  13. package/dist/core/enforcement-census-report.js.map +1 -0
  14. package/dist/core/enforcement-census.d.ts +177 -0
  15. package/dist/core/enforcement-census.d.ts.map +1 -0
  16. package/dist/core/enforcement-census.js +252 -0
  17. package/dist/core/enforcement-census.js.map +1 -0
  18. package/dist/core/enforcement-coverage.d.ts +168 -0
  19. package/dist/core/enforcement-coverage.d.ts.map +1 -0
  20. package/dist/core/enforcement-coverage.js +342 -0
  21. package/dist/core/enforcement-coverage.js.map +1 -0
  22. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  23. package/dist/core/lisa-owned-hash-ledger.js +8 -0
  24. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  25. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  26. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  27. package/dist/core/upstream-evidence-manifest.js +21 -5
  28. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  29. package/dist/opencode/plugin-templates/lisa-block-direct-issue-create.ts +180 -19
  30. package/package.json +4 -3
  31. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  33. package/plugins/lisa/.codex-plugin/skills/lisa-setup-automations/SKILL.md +23 -0
  34. package/plugins/lisa/hooks/block-direct-issue-create.sh +507 -11
  35. package/plugins/lisa/skills/lisa-setup-automations/SKILL.md +23 -0
  36. package/plugins/lisa-agy/hooks/block-direct-issue-create.sh +507 -11
  37. package/plugins/lisa-agy/plugin.json +1 -1
  38. package/plugins/lisa-agy/skills/lisa-setup-automations/SKILL.md +23 -0
  39. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  41. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  42. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-copilot/hooks/block-direct-issue-create.sh +507 -11
  46. package/plugins/lisa-copilot/skills/lisa-setup-automations/SKILL.md +23 -0
  47. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-cursor/hooks/block-direct-issue-create.sh +507 -11
  49. package/plugins/lisa-cursor/skills/lisa-setup-automations/SKILL.md +23 -0
  50. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa-expo-agy/plugin.json +1 -1
  53. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  57. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  58. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  63. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  67. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  68. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  72. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  73. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  77. package/plugins/lisa-rails-agy/plugin.json +1 -1
  78. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  83. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-typescript-cursor/.claude-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/src/base/hooks/block-direct-issue-create.sh +507 -11
  91. package/plugins/src/base/skills/lisa-setup-automations/SKILL.md +23 -0
  92. package/scripts/lisa-enforcement-census.mjs +168 -0
  93. package/scripts/lisa-enforcement-fallback.sh +27 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-enforcement-coverage.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-enforcement-coverage.ts"],"names":[],"mappings":"AAsCA,wEAAwE;AACxE,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB;AAcD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAsDxB"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Doctor check: does THIS checkout resolve enforcement, and of what vintage?
3
+ *
4
+ * The dispatcher already answers this to an agent session, once per session.
5
+ * Nobody had asked it from outside a session, which is why nothing noticed that
6
+ * most checkouts in a fleet resolve nothing at all (CodySwannGT/lisa#3490).
7
+ * `lisa doctor` is where an operator asks a checkout what state it is in, so
8
+ * this is the local half of the census — the half a host project gets, since
9
+ * the fleet roster the fleet census reads exists only on the machine that
10
+ * manages the fleet.
11
+ *
12
+ * Three findings, kept apart on purpose:
13
+ *
14
+ * - **Resolves nothing.** Not a stale guard — no guard. An agent working here
15
+ * is checked by nothing and the session says nothing.
16
+ * - **Resolves something old, or undateable.** A stale copy still refuses
17
+ * things and names its vintage in every refusal, so it is the quieter half
18
+ * of the same question, not the same finding.
19
+ * - **Installed behind declared.** This one fails in the affirmative: the
20
+ * guards run, every check answers, and every answer is about a version
21
+ * nobody is using — which is how a reviewer diffed a branch against
22
+ * templates from a version majors behind the one being claimed, and got a
23
+ * confident wrong answer.
24
+ *
25
+ * Warn, never fail, for the same reason `doctor-apply-freshness` warns: the
26
+ * remedy is one command, a checkout mid-upgrade is legitimately in this state
27
+ * for a few minutes, and reddening the exit code trains operators to ignore it.
28
+ * @module cli/doctor-enforcement-coverage
29
+ */
30
+ import { getPackageVersion } from "./version.js";
31
+ import { collectCheckoutCoverage } from "../core/enforcement-coverage.js";
32
+ import { isInstallBehindDeclared } from "../core/enforcement-census.js";
33
+ const CHECK_NAME = "Enforcement guards resolve in this checkout?";
34
+ const FLEET_HINT = "Run `node scripts/lisa-enforcement-census.mjs` from the Lisa monorepo to ask the same question of every checkout on the fleet roster.";
35
+ const REPAIR = "npx @codyswann/lisa apply";
36
+ /**
37
+ * Read this build's own version without throwing when metadata is unreadable.
38
+ * @returns The version, or null when it cannot be determined
39
+ */
40
+ function referenceVersion() {
41
+ try {
42
+ return getPackageVersion();
43
+ }
44
+ catch {
45
+ return null;
46
+ }
47
+ }
48
+ /**
49
+ * Report what this checkout resolves.
50
+ * @param targetPath - Project path
51
+ * @returns The check result
52
+ */
53
+ export async function checkEnforcementCoverage(targetPath) {
54
+ const coverage = await collectCheckoutCoverage({
55
+ label: targetPath,
56
+ checkoutPath: targetPath,
57
+ reference: referenceVersion(),
58
+ });
59
+ if (coverage.resolution === "unreadable") {
60
+ return {
61
+ name: CHECK_NAME,
62
+ status: "warn",
63
+ detail: `Could not look: ${coverage.unreadableReason ?? "unknown"}. That is not the same as being unprotected, and it is not the same as being covered.`,
64
+ };
65
+ }
66
+ if (coverage.resolution === "none") {
67
+ return {
68
+ name: CHECK_NAME,
69
+ status: "warn",
70
+ detail: `This checkout resolves NO Lisa enforcement guard. Not a stale guard — none. A tool call here is checked by nothing, and nothing in the session says so. Searched scripts/lisa-hooks/ and plugins/lisa/hooks/. Repair: \`${REPAIR}\`. ${FLEET_HINT}`,
71
+ };
72
+ }
73
+ const notes = [
74
+ coverage.resolution === "partial"
75
+ ? `only ${coverage.guards.length - coverage.unresolvedGuards.length} of ${coverage.guards.length} guards resolve (missing: ${coverage.unresolvedGuards.join(", ")})`
76
+ : null,
77
+ coverage.vintage === "undateable"
78
+ ? "the copy in force carries no Lisa manifest beside it, so it cannot be shown current"
79
+ : null,
80
+ coverage.vintage === "behind"
81
+ ? `the copy in force is lisa ${coverage.governing?.version ?? "?"}, behind ${referenceVersion() ?? "the newest known"}`
82
+ : null,
83
+ coverage.receipt.present
84
+ ? null
85
+ : "no apply receipt records a completed `lisa apply` here",
86
+ isInstallBehindDeclared(coverage)
87
+ ? `installed @codyswann/lisa is ${coverage.install.installed ?? "?"} while this project declares ${coverage.install.declared ?? "?"} — every answer read out of node_modules is about a version nobody is running`
88
+ : null,
89
+ ].filter((note) => note !== null);
90
+ if (notes.length === 0) {
91
+ return {
92
+ name: CHECK_NAME,
93
+ status: "ok",
94
+ detail: `All ${coverage.guards.length} guards resolve from ${coverage.governing?.tree === "host" ? "scripts/lisa-hooks/" : "plugins/lisa/hooks/"} at lisa ${coverage.governing?.version ?? "?"}, with an apply receipt.`,
95
+ };
96
+ }
97
+ return {
98
+ name: CHECK_NAME,
99
+ status: "warn",
100
+ detail: `${notes.join("; ")}. Repair: \`${REPAIR}\`. ${FLEET_HINT}`,
101
+ };
102
+ }
103
+ //# sourceMappingURL=doctor-enforcement-coverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-enforcement-coverage.js","sourceRoot":"","sources":["../../src/cli/doctor-enforcement-coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,MAAM,UAAU,GAAG,8CAA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OAAO,kBAAkB,CAAC;IAC9C,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;CACjD;AAwBD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,EAChD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,WAAW,CAAC,CAyBtB;AA8JD;;;;;;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,CA4HvB"}
@@ -7,6 +7,7 @@ import { migrateInstructionFiles } from "../core/instruction-files-migration.js"
7
7
  import { probeKaneReadiness } from "../core/kane-cli.js";
8
8
  import { probeSonarReadiness } from "../core/sonar-integration.js";
9
9
  import { checkApplyFreshness, checkYamlRuntime, } from "./doctor-apply-freshness.js";
10
+ import { checkEnforcementCoverage } from "./doctor-enforcement-coverage.js";
10
11
  import { checkLockfileReconciliation } from "./doctor-reconciliation.js";
11
12
  import { checkKaneProvider } from "./doctor-kane.js";
12
13
  import { checkLearningsLedger } from "./doctor-learnings-ledger.js";
@@ -247,6 +248,14 @@ export async function runDoctor(targetPath, options, dependencies = {}) {
247
248
  // consumers it never did, and the only symptom was a frozen-lockfile
248
249
  // failure in CI hours later (CodySwannGT/lisa#2750).
249
250
  await checkLockfileReconciliation(resolvedTarget),
251
+ // Third in the same run of questions, and the one nothing was asking. The
252
+ // two above ask whether apply ran and whether its lockfile repair landed;
253
+ // this asks whether the guards that apply writes actually RESOLVE here, and
254
+ // of what vintage. A checkout resolving none of them produces no output at
255
+ // all from inside a session, so "protected by an old policy" and "not
256
+ // protected" are indistinguishable there — which is how most of a fleet
257
+ // came to resolve nothing without anyone noticing (CodySwannGT/lisa#3490).
258
+ await checkEnforcementCoverage(resolvedTarget),
250
259
  checkYamlRuntime(),
251
260
  await checkProjectConfig(resolvedTarget),
252
261
  // Immediately after the config check, because it repairs the same file and
@@ -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,EACL,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,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,0B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AAC,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { FleetCensus } from "./enforcement-census.js";
2
+ /**
3
+ * Replace every real path in a census with a stable anonymous label.
4
+ *
5
+ * The paths this census reads name real local checkouts, and they embed client
6
+ * and product names that must never reach a public issue, PR, or commit. The
7
+ * counts and the per-checkout rows survive redaction intact, so a fleet finding
8
+ * loses nothing by being quoted safely.
9
+ * @param census - A measured fleet
10
+ * @returns The same fleet with paths replaced by derived labels
11
+ */
12
+ export declare function redactCensus(census: FleetCensus): FleetCensus;
13
+ /**
14
+ * Render the whole census for a terminal.
15
+ * @param census - A measured fleet
16
+ * @returns The report
17
+ */
18
+ export declare function renderFleetCensusReport(census: FleetCensus): string;
19
+ //# sourceMappingURL=enforcement-census-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforcement-census-report.d.ts","sourceRoot":"","sources":["../../src/core/enforcement-census-report.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAiB3D;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CA6B7D;AAyJD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAgBnE"}
@@ -0,0 +1,198 @@
1
+ import { isInstallBehindDeclared, redactedLabel, } from "./enforcement-census.js";
2
+ /** Where a host tree lives inside a checkout. */
3
+ const HOST_TREE = "scripts/lisa-hooks";
4
+ /** Where the monorepo's own tree lives inside a checkout. */
5
+ const PLUGIN_TREE = "plugins/lisa/hooks";
6
+ /** What dates a host tree. */
7
+ const HOST_DATED_BY = ".lisa/apply-receipt.json";
8
+ /** What dates a plugin tree. */
9
+ const PLUGIN_DATED_BY = "plugins/lisa/.claude-plugin/plugin.json";
10
+ /** What a redacted field says instead of a real path. */
11
+ const REDACTED = "redacted";
12
+ /**
13
+ * Replace every real path in a census with a stable anonymous label.
14
+ *
15
+ * The paths this census reads name real local checkouts, and they embed client
16
+ * and product names that must never reach a public issue, PR, or commit. The
17
+ * counts and the per-checkout rows survive redaction intact, so a fleet finding
18
+ * loses nothing by being quoted safely.
19
+ * @param census - A measured fleet
20
+ * @returns The same fleet with paths replaced by derived labels
21
+ */
22
+ export function redactCensus(census) {
23
+ const scrubTree = (tree, label) => ({
24
+ ...tree,
25
+ root: `${label}/${tree.tree === "host" ? HOST_TREE : PLUGIN_TREE}`,
26
+ datedBy: `${label}/${tree.tree === "host" ? HOST_DATED_BY : PLUGIN_DATED_BY}`,
27
+ });
28
+ const scrub = (coverage) => {
29
+ const label = redactedLabel(coverage.checkoutPath);
30
+ return {
31
+ ...coverage,
32
+ label,
33
+ checkoutPath: label,
34
+ guards: coverage.guards.map(guard => ({ ...guard, script: null })),
35
+ trees: coverage.trees.map(tree => scrubTree(tree, label)),
36
+ governing: coverage.governing === null
37
+ ? null
38
+ : scrubTree(coverage.governing, label),
39
+ };
40
+ };
41
+ return {
42
+ ...census,
43
+ rosterOrigin: REDACTED,
44
+ referenceSource: REDACTED,
45
+ checkouts: census.checkouts.map(scrub),
46
+ };
47
+ }
48
+ /**
49
+ * Describe which copy governs a checkout and how old it is.
50
+ * @param coverage - One record
51
+ * @param reference - Newest Lisa the run could point at
52
+ * @returns One operator-readable clause
53
+ */
54
+ function describeGoverning(coverage, reference) {
55
+ const governing = coverage.governing;
56
+ if (governing === null)
57
+ return "no copy in force";
58
+ const where = governing.tree === "host" ? HOST_TREE : PLUGIN_TREE;
59
+ if (governing.version === null) {
60
+ return `governed by ${where} — vintage unknown, so it cannot be shown current`;
61
+ }
62
+ if (coverage.vintage === "behind") {
63
+ return `governed by ${where} — lisa ${governing.version}, behind ${reference ?? "the newest on this disk"}`;
64
+ }
65
+ return `governed by ${where} — lisa ${governing.version}`;
66
+ }
67
+ /**
68
+ * Say what a checkout has installed against what it declares.
69
+ * @param coverage - One record
70
+ * @returns One operator-readable clause
71
+ */
72
+ function describeInstallDrift(coverage) {
73
+ return `installed ${coverage.install.installed ?? "?"}, declares ${coverage.install.declared ?? "?"}`;
74
+ }
75
+ /**
76
+ * One row for a checkout that resolves at least one guard.
77
+ * @param coverage - One record
78
+ * @param reference - Newest Lisa the run could point at
79
+ * @returns The row
80
+ */
81
+ function resolvingRow(coverage, reference) {
82
+ const parts = [
83
+ describeGoverning(coverage, reference),
84
+ coverage.receipt.present ? null : "no apply receipt",
85
+ coverage.resolution === "partial"
86
+ ? `unresolved: ${coverage.unresolvedGuards.join(", ")}`
87
+ : null,
88
+ isInstallBehindDeclared(coverage) ? describeInstallDrift(coverage) : null,
89
+ ].filter((part) => part !== null);
90
+ return ` - ${coverage.label} — ${parts.join("; ")}`;
91
+ }
92
+ /**
93
+ * Build the section for checkouts that resolve nothing.
94
+ *
95
+ * First in the report, and never merged into the stale section below it. These
96
+ * are not behind — they are unenforced, and the remedy is different.
97
+ * @param census - A measured fleet
98
+ * @returns The section
99
+ */
100
+ function unguardedSection(census) {
101
+ const rows = census.checkouts
102
+ .filter(entry => entry.resolution === "none")
103
+ .map(entry => ` - ${entry.label}`);
104
+ return {
105
+ heading: `NOT ENFORCING — ${rows.length} of ${census.summary.total} resolve no guard at all`,
106
+ note: "An agent working in one of these is checked by nothing, and nothing in the session says so. Repair: run `npx @codyswann/lisa apply` in that checkout.",
107
+ rows,
108
+ };
109
+ }
110
+ /**
111
+ * Build the section for checkouts the census could not read.
112
+ * @param census - A measured fleet
113
+ * @returns The section
114
+ */
115
+ function unreadableSection(census) {
116
+ const rows = census.checkouts
117
+ .filter(entry => entry.resolution === "unreadable")
118
+ .map(entry => ` - ${entry.label} — ${entry.unreadableReason ?? "unknown"}`);
119
+ return {
120
+ heading: `COULD NOT LOOK — ${rows.length} of ${census.summary.total}`,
121
+ note: "Not counted as covered and not counted as unenforced: the census does not know. Repair: fix the path on the roster, or remove it.",
122
+ rows,
123
+ };
124
+ }
125
+ /**
126
+ * Build the section for checkouts that resolve at least one guard.
127
+ * @param census - A measured fleet
128
+ * @returns The section
129
+ */
130
+ function resolvingSection(census) {
131
+ const { summary } = census;
132
+ const rows = census.checkouts
133
+ .filter(entry => entry.resolution === "partial" || entry.resolution === "full")
134
+ .map(entry => resolvingRow(entry, census.reference));
135
+ return {
136
+ heading: `ENFORCING — ${summary.resolving} of ${summary.total} (${summary.partial} of them only partly)`,
137
+ note: `behind: ${summary.behind} · vintage unknown: ${summary.undateable} · current: ${summary.current} · no apply receipt: ${summary.withoutReceipt}`,
138
+ rows,
139
+ };
140
+ }
141
+ /**
142
+ * Build the section for checkouts whose installed Lisa is behind their own
143
+ * manifest.
144
+ *
145
+ * Its own section because it fails in the affirmative: these checkouts resolve
146
+ * guards, run them, and answer confidently about a version nobody is using.
147
+ * @param census - A measured fleet
148
+ * @returns The section
149
+ */
150
+ function installDriftSection(census) {
151
+ const rows = census.checkouts
152
+ .filter(entry => isInstallBehindDeclared(entry))
153
+ .map(entry => ` - ${entry.label} — ${describeInstallDrift(entry)}`);
154
+ return {
155
+ heading: `INSTALLED BEHIND DECLARED — ${rows.length} of ${census.summary.total}`,
156
+ note: "These answer every question confidently about a Lisa version nobody is running. Repair: reinstall dependencies in that checkout.",
157
+ rows,
158
+ };
159
+ }
160
+ /**
161
+ * Render one section, or nothing when it is empty and uninteresting.
162
+ * @param section - The section
163
+ * @param always - Whether to print it even when empty
164
+ * @returns The rendered lines
165
+ */
166
+ function renderSection(section, always) {
167
+ if (section.rows.length === 0 && !always)
168
+ return [];
169
+ return [
170
+ "",
171
+ section.heading,
172
+ ` ${section.note}`,
173
+ ...(section.rows.length === 0 ? [" (none)"] : section.rows),
174
+ ];
175
+ }
176
+ /**
177
+ * Render the whole census for a terminal.
178
+ * @param census - A measured fleet
179
+ * @returns The report
180
+ */
181
+ export function renderFleetCensusReport(census) {
182
+ const { summary } = census;
183
+ const lines = [
184
+ `Lisa enforcement fleet census — ${census.measuredAt}`,
185
+ `Roster: ${census.rosterOrigin} (${summary.total} checkout${summary.total === 1 ? "" : "s"})`,
186
+ `Newest Lisa found: ${census.reference ?? "none"} (${census.referenceSource})`,
187
+ ...renderSection(unguardedSection(census), true),
188
+ ...renderSection(unreadableSection(census), true),
189
+ ...renderSection(resolvingSection(census), true),
190
+ ...renderSection(installDriftSection(census), false),
191
+ "",
192
+ `Covered — all six guards, a current copy, and an apply receipt: ${summary.covered} of ${summary.total}.`,
193
+ "This census reports and never gates: its exit status is 0 whatever it finds.",
194
+ "A checkout not on the roster was not measured, which is not the same as covered.",
195
+ ];
196
+ return `${lines.join("\n")}\n`;
197
+ }
198
+ //# sourceMappingURL=enforcement-census-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforcement-census-report.js","sourceRoot":"","sources":["../../src/core/enforcement-census-report.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,uBAAuB,EACvB,aAAa,GACd,MAAM,yBAAyB,CAAC;AAEjC,iDAAiD;AACjD,MAAM,SAAS,GAAG,oBAAoB,CAAC;AACvC,6DAA6D;AAC7D,MAAM,WAAW,GAAG,oBAAoB,CAAC;AACzC,8BAA8B;AAC9B,MAAM,aAAa,GAAG,0BAA0B,CAAC;AACjD,gCAAgC;AAChC,MAAM,eAAe,GAAG,yCAAyC,CAAC;AAClE,yDAAyD;AACzD,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,MAAmB;IAC9C,MAAM,SAAS,GAAG,CAChB,IAAO,EACP,KAAa,EACV,EAAE,CAAC,CAAC;QACP,GAAG,IAAI;QACP,IAAI,EAAE,GAAG,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE;QAClE,OAAO,EAAE,GAAG,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAA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AsB,MAAM,CAAC,SAAS,IAAI,MAAM,KAAK,MAAM,CAAC,eAAe,GAAG;QAC9E,GAAG,aAAa,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;QAChD,GAAG,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;QACjD,GAAG,aAAa,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;QAChD,GAAG,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC;QACpD,EAAE;QACF,mEAAmE,OAAO,CAAC,OAAO,OAAO,OAAO,CAAC,KAAK,GAAG;QACzG,8EAA8E;QAC9E,kFAAkF;KACnF,CAAC;IACF,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,177 @@
1
+ import type { CheckoutCoverage } from "./enforcement-coverage.js";
2
+ /** Where a checkout on the roster came from. */
3
+ export type RosterSource = "roster" | "scan" | "argument";
4
+ /** One checkout the census intends to look at. */
5
+ export interface RosterEntry {
6
+ /** Operator-facing label. */
7
+ readonly label: string;
8
+ /** Absolute path to look at. */
9
+ readonly checkoutPath: string;
10
+ /** How this entry reached the roster. */
11
+ readonly source: RosterSource;
12
+ }
13
+ /**
14
+ * The disjoint classes a fleet falls into.
15
+ *
16
+ * `unreadable`, `unguarded`, `partial` and `full` partition the roster — they
17
+ * sum to `total` by construction. `behind`, `undateable` and `current`
18
+ * partition the *resolving* subset only, and never see an unguarded or
19
+ * unreadable checkout.
20
+ */
21
+ export interface FleetCensusSummary {
22
+ /** Checkouts the census set out to look at. */
23
+ readonly total: number;
24
+ /** Checkouts it could not look into. Never counted as covered. */
25
+ readonly unreadable: number;
26
+ /** Checkouts that resolve NO guard. Not stale — unenforced. */
27
+ readonly unguarded: number;
28
+ /** Checkouts that resolve some guards but not all six. */
29
+ readonly partial: number;
30
+ /** Checkouts that resolve all six guards. */
31
+ readonly full: number;
32
+ /** Checkouts resolving at least one guard. */
33
+ readonly resolving: number;
34
+ /** Resolving checkouts whose governing copy is behind the reference. */
35
+ readonly behind: number;
36
+ /** Resolving checkouts whose governing copy cannot be dated at all. */
37
+ readonly undateable: number;
38
+ /** Resolving checkouts whose governing copy is current. */
39
+ readonly current: number;
40
+ /** Resolving checkouts carrying no apply receipt. */
41
+ readonly withoutReceipt: number;
42
+ /** Checkouts whose installed Lisa is behind the version they declare. */
43
+ readonly installBehindDeclared: number;
44
+ /** All six guards, current copy, apply receipt present. */
45
+ readonly covered: number;
46
+ }
47
+ /** One complete census run. */
48
+ export interface FleetCensus {
49
+ /** When the census ran. */
50
+ readonly measuredAt: string;
51
+ /** Newest Lisa the run could point at, and what proved it. */
52
+ readonly reference: string | null;
53
+ /** Where the reference came from, in the operator's language. */
54
+ readonly referenceSource: string;
55
+ /** Where the roster came from. */
56
+ readonly rosterOrigin: string;
57
+ /** One record per checkout, in roster order. */
58
+ readonly checkouts: readonly CheckoutCoverage[];
59
+ /** The disjoint classes. */
60
+ readonly summary: FleetCensusSummary;
61
+ }
62
+ /** The fleet roster `scripts/lisa-update-local.sh` already maintains. */
63
+ export declare const DEFAULT_ROSTER_FILE = ".lisa.workspaces.json";
64
+ /**
65
+ * Read a fleet roster file.
66
+ *
67
+ * The primary shape is the one already on disk: an object mapping checkout path
68
+ * to target branch, which `scripts/lisa-update-local.sh` reads. An array of
69
+ * paths is accepted too, so a census can be pointed at an ad-hoc list without
70
+ * inventing a branch for each entry.
71
+ * @param rosterPath - Path to the roster file
72
+ * @returns The checkouts it names, or null when it cannot be read
73
+ */
74
+ export declare function readFleetRoster(rosterPath: string): Promise<readonly RosterEntry[] | null>;
75
+ /**
76
+ * Find checkouts under a directory, without a roster.
77
+ *
78
+ * Discovery exists because a hand-maintained roster can go stale the same way
79
+ * the frozen comment did: a checkout nobody added is a checkout the census
80
+ * cannot see, and an unseen checkout reads as coverage it does not have. A
81
+ * candidate is any directory containing a `.git` entry, found no deeper than
82
+ * `depth` levels so the walk stays bounded on a large disk.
83
+ * @param root - Directory to search
84
+ * @param depth - How many levels below `root` to descend
85
+ * @returns The checkouts found, in listing order
86
+ */
87
+ export declare function scanForCheckouts(root: string, depth: number): Promise<readonly RosterEntry[]>;
88
+ /**
89
+ * Collapse entries that name the same checkout twice.
90
+ *
91
+ * Two roster spellings of one directory, or a roster entry a scan also found,
92
+ * would otherwise be counted twice — inflating both the numerator and the
93
+ * denominator and making the census disagree with itself.
94
+ * @param entries - Entries from every source
95
+ * @returns One entry per distinct checkout, first spelling wins
96
+ */
97
+ export declare function dedupeRoster(entries: readonly RosterEntry[]): Promise<readonly RosterEntry[]>;
98
+ /**
99
+ * Count the resolving checkouts whose governing copy is behind.
100
+ *
101
+ * Defined over the resolving set on purpose, and named so that folding the
102
+ * unguarded class into it is a visible edit rather than an accident. A checkout
103
+ * that resolves nothing has no copy to be behind: calling it stale describes a
104
+ * guard that would refuse things, and there is none.
105
+ * @param checkouts - Every record in the run
106
+ * @returns How many resolving checkouts are behind the reference
107
+ */
108
+ export declare function countStale(checkouts: readonly CheckoutCoverage[]): number;
109
+ /**
110
+ * Reduce a run to its disjoint classes.
111
+ * @param checkouts - Every record in the run
112
+ * @returns The summary
113
+ */
114
+ export declare function summarizeFleetCensus(checkouts: readonly CheckoutCoverage[]): FleetCensusSummary;
115
+ /**
116
+ * Whether a checkout's installed Lisa is older than the one it declares.
117
+ *
118
+ * The comparison is against the range's own floor, read as a plain version once
119
+ * the usual range punctuation is stripped. A range this cannot parse yields
120
+ * `false` — absence of proof never becomes proof of drift.
121
+ * @param coverage - One record
122
+ * @returns Whether the installed copy is behind the declared one
123
+ */
124
+ export declare function isInstallBehindDeclared(coverage: CheckoutCoverage): boolean;
125
+ /**
126
+ * Resolve the newest Lisa this run can point at.
127
+ *
128
+ * A maximum over evidence found on the same disk during the same run, never a
129
+ * network lookup and never a nominated authority. A copy is reported behind
130
+ * only when something newer can actually be pointed at, so the worst case is
131
+ * silence rather than a fleet-wide false alarm.
132
+ * @param checkouts - Records collected with no reference
133
+ * @param seed - A version the caller can vouch for, such as its own manifest
134
+ * @returns The reference version and what proved it
135
+ */
136
+ export declare function resolveReference(checkouts: readonly CheckoutCoverage[], seed: string | null): {
137
+ readonly version: string | null;
138
+ readonly source: string;
139
+ };
140
+ /** Everything a census run needs. */
141
+ export interface FleetCensusOptions {
142
+ /** Checkouts to look at, already deduped. */
143
+ readonly roster: readonly RosterEntry[];
144
+ /** Where that roster came from, for the report header. */
145
+ readonly rosterOrigin: string;
146
+ /** A version the caller can vouch for, folded into the reference. */
147
+ readonly seedVersion?: string | null;
148
+ /** An explicit reference, which suppresses the maximum entirely. */
149
+ readonly reference?: string | null;
150
+ /** Clock seam, so the report is reproducible under test. */
151
+ readonly now?: () => Date;
152
+ }
153
+ /**
154
+ * Run the census.
155
+ *
156
+ * Never throws for a fleet finding and never returns a status: the caller
157
+ * prints this and exits 0. The only thing that can fail here is the census
158
+ * itself, and a checkout it cannot read comes back as `unreadable` rather than
159
+ * as an exception, because one unreachable directory must not stop the other
160
+ * twenty-six from being measured.
161
+ * @param options - Roster and reference inputs
162
+ * @returns The measured fleet
163
+ */
164
+ export declare function runFleetCensus(options: FleetCensusOptions): Promise<FleetCensus>;
165
+ /**
166
+ * A stable, path-free label for a checkout.
167
+ *
168
+ * The census names real local checkouts, and those paths embed client and
169
+ * product names that must never reach a public issue or PR. Redaction keeps the
170
+ * counts and the per-checkout rows — which is all a fleet finding needs — while
171
+ * making the report safe to paste. It is derived from the path, so the same
172
+ * checkout carries the same label between runs and can still be discussed.
173
+ * @param checkoutPath - The real path
174
+ * @returns A stable anonymous label
175
+ */
176
+ export declare function redactedLabel(checkoutPath: string): string;
177
+ //# sourceMappingURL=enforcement-census.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforcement-census.d.ts","sourceRoot":"","sources":["../../src/core/enforcement-census.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,gB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