@codyswann/lisa 5.8.2 → 5.9.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 (115) 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 +8 -7
  4. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  5. package/package.json +4 -4
  6. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  7. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  8. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/validate-config.mjs +1 -0
  9. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +3 -2
  10. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-orphans.mjs +17 -1
  11. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +1 -1
  12. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +2 -1
  13. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/orphan-sweep.mjs +9 -2
  14. package/plugins/lisa/rules/reference/config-resolution.md +2 -1
  15. package/plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs +1 -0
  16. package/plugins/lisa/skills/lisa-session-manager/SKILL.md +3 -2
  17. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-orphans.mjs +17 -1
  18. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +1 -1
  19. package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +2 -1
  20. package/plugins/lisa/skills/lisa-session-manager/scripts/orphan-sweep.mjs +9 -2
  21. package/plugins/lisa-agy/plugin.json +1 -1
  22. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs +1 -0
  23. package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +3 -2
  24. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-orphans.mjs +17 -1
  25. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +1 -1
  26. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +2 -1
  27. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/orphan-sweep.mjs +9 -2
  28. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  30. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  31. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  35. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-copilot/rules/reference/config-resolution.md +2 -1
  37. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs +1 -0
  38. package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +3 -2
  39. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-orphans.mjs +17 -1
  40. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +1 -1
  41. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +2 -1
  42. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/orphan-sweep.mjs +9 -2
  43. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +2 -1
  45. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs +1 -0
  46. package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +3 -2
  47. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-orphans.mjs +17 -1
  48. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +1 -1
  49. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +2 -1
  50. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/orphan-sweep.mjs +9 -2
  51. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  53. package/plugins/lisa-devin/rules/reference/config-resolution.md +2 -1
  54. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs +1 -0
  55. package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +3 -2
  56. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-orphans.mjs +17 -1
  57. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +1 -1
  58. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +2 -1
  59. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/orphan-sweep.mjs +9 -2
  60. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-expo-agy/plugin.json +1 -1
  63. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  67. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  69. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  70. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  74. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  76. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  77. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  81. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  83. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  84. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  88. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  90. package/plugins/lisa-rails-agy/plugin.json +1 -1
  91. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  95. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  96. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  97. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  98. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  102. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  104. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  105. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  109. package/plugins/src/base/rules/reference/config-resolution.md +2 -1
  110. package/plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs +1 -0
  111. package/plugins/src/base/skills/lisa-session-manager/SKILL.md +3 -2
  112. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-orphans.mjs +17 -1
  113. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +1 -1
  114. package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +2 -1
  115. package/plugins/src/base/skills/lisa-session-manager/scripts/orphan-sweep.mjs +9 -2
package/package.json CHANGED
@@ -188,7 +188,7 @@
188
188
  "qs": "^6.16.0"
189
189
  },
190
190
  "name": "@codyswann/lisa",
191
- "version": "5.8.2",
191
+ "version": "5.9.0",
192
192
  "description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
193
193
  "main": "dist/index.js",
194
194
  "exports": {
@@ -351,7 +351,7 @@
351
351
  "test": "tests"
352
352
  },
353
353
  "types": "./dist/index.d.ts",
354
- "lisaReleaseCommit": "58fa5a05bc50d811130462acb0dffe168c1ff0ae",
355
- "gitHead": "58fa5a05bc50d811130462acb0dffe168c1ff0ae",
356
- "lisaReleaseTag": "v5.8.2"
354
+ "lisaReleaseCommit": "3ce3757ec0a820e3c491ca2fb6dcadfde29356c9",
355
+ "gitHead": "3ce3757ec0a820e3c491ca2fb6dcadfde29356c9",
356
+ "lisaReleaseTag": "v5.9.0"
357
357
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -680,6 +680,7 @@ const STALL_RULES = {
680
680
  noOutputMinutes: [n => n >= 0, "zero or a positive number"],
681
681
  maxAttempts: [n => Number.isInteger(n) && n > 0, "a positive integer"],
682
682
  requestionHours: [n => n >= 0, "zero or a positive number"],
683
+ orphanHours: [n => n >= 0, "zero or a positive number"],
683
684
  };
684
685
 
685
686
  /** Notification providers `sessionManager.notify.provider` accepts. */
@@ -514,8 +514,9 @@ just as long. Sweep both every cycle, after `classify` and before Dispatch:
514
514
  operators and the trusted authors come from the ledger and config, never from the input. It
515
515
  skips refs the ledger shows running or asking (their holds too, so an item waiting on a
516
516
  person's answer is never on the operator's list twice), items assigned to anyone but "me" or an
517
- operator, and items updated within `--stale-hours` (default 6) or with no `updatedAt`, which
518
- protects a person running `/lisa:implement` by hand. A live or foreign hold is skipped the
517
+ operator, and items updated within `sessionManager.stall.orphanHours` (default 2;
518
+ `--stale-hours` overrides it) or with no `updatedAt`, which protects a person running
519
+ `/lisa:implement` by hand. A live or foreign hold is skipped the
519
520
  same way; a fresh or undated one is not lifted this cycle, but its human reasons still reach
520
521
  the operator's list, so a new comment never makes the list change.
521
522
  2. **Act** per bucket. **Before every write** in this sweep (a finish, a return, a re-dispatch
@@ -129,6 +129,20 @@ function readEnvelope(ctx) {
129
129
  return { items: envelope.items, holds: envelope.holds };
130
130
  }
131
131
 
132
+ /**
133
+ * The stale threshold for the sweep: the flag, else the config, else the
134
+ * planner's own default.
135
+ * @param {number | undefined} flag - `--stale-hours`
136
+ * @param {{ stall?: { orphanHours?: unknown } } | null | undefined} config -
137
+ * Resolved `sessionManager` block, or absent
138
+ * @returns {{ staleHours?: number }} Spread into the planner options
139
+ */
140
+ function orphanStaleHours(flag, config) {
141
+ if (flag !== undefined) return { staleHours: flag };
142
+ const configured = config?.stall?.orphanHours;
143
+ return typeof configured === "number" ? { staleHours: configured } : {};
144
+ }
145
+
132
146
  /**
133
147
  * `orphan-plan [--input <file>] [--max <n>] [--stale-hours <n>]` (stdin
134
148
  * without --input: `{"complete":true,"items":[...],"holds":[...]}`).
@@ -155,7 +169,9 @@ export async function orphanPlan(ctx) {
155
169
  trustedAuthorIds: trustedReleaseEntries(config),
156
170
  now: new Date(),
157
171
  ...(max === undefined ? {} : { max }),
158
- ...(staleHours === undefined ? {} : { staleHours }),
172
+ // An explicit --stale-hours wins; otherwise the project's
173
+ // `stall.orphanHours` (CodySwannGT/lisa#4901).
174
+ ...orphanStaleHours(staleHours, config),
159
175
  previousDigest: ledger.control.holdDigest ?? null,
160
176
  ...holdPolicy(project),
161
177
  })
@@ -328,7 +328,7 @@ Per cycle
328
328
  trustedAuthorIds and the hold labels come from the ledger and config;
329
329
  the same keys in the input are ignored. Skips live, foreign (assigned
330
330
  to neither me nor an operator), fresh (updated within --stale-hours,
331
- default 6) and undated items. Live and foreign holds are skipped; a
331
+ else sessionManager.stall.orphanHours, default 2) and undated items. Live and foreign holds are skipped; a
332
332
  fresh or undated hold is not lifted (skipped fresh or undated) but its
333
333
  kept reasons still reach holds.keep and the digest. A lift left with
334
334
  nothing to write is skipped as nothing-to-write; decision is null for
@@ -50,6 +50,7 @@ export const SESSION_MANAGER_DEFAULTS = Object.freeze({
50
50
  noOutputMinutes: 60,
51
51
  maxAttempts: 3,
52
52
  requestionHours: 4,
53
+ orphanHours: 2,
53
54
  }),
54
55
  notify: Object.freeze({ provider: "none" }),
55
56
  });
@@ -74,7 +75,7 @@ export function notifyProvider(config) {
74
75
  * @typedef {{ maxWorkers: number, gbPerWorker: number, reserveGb: number,
75
76
  * cpuFraction: number, maxLoadPerCore: number }} CapacityBlock
76
77
  * @typedef {{ noOutputMinutes: number, maxAttempts: number,
77
- * requestionHours: number }} StallBlock
78
+ * requestionHours: number, orphanHours: number }} StallBlock
78
79
  * @typedef {{ provider: string, stateDir?: string }} NotifyBlock
79
80
  * @typedef {{
80
81
  * name: string,
@@ -38,8 +38,15 @@ export {
38
38
  /** At most this many writes per cycle unless the caller says otherwise. */
39
39
  export const DEFAULT_ORPHAN_MAX = 10;
40
40
 
41
- /** An item updated more recently than this many hours is left alone. */
42
- export const DEFAULT_STALE_HOURS = 6;
41
+ /**
42
+ * An item updated more recently than this many hours is left alone.
43
+ *
44
+ * Matches the documented `sessionManager.stall.orphanHours` default, which
45
+ * `orphan-plan` passes in. An in-progress item should never go two hours
46
+ * without a tracker update, so one that has is presumed abandoned
47
+ * (CodySwannGT/lisa#4901).
48
+ */
49
+ export const DEFAULT_STALE_HOURS = 2;
43
50
 
44
51
  /** The order buckets spend the cap in. */
45
52
  const CAPPED_BUCKETS = ["doneReady", "return", "redispatch", "parked"];
@@ -694,7 +694,7 @@ have a `.lisa.config.json` and their own `.git` (written as `"root": "."`).
694
694
  }
695
695
  },
696
696
  "capacity": { "maxWorkers": 6, "gbPerWorker": 3, "reserveGb": 8, "cpuFraction": 0.75, "maxLoadPerCore": 1.5 },
697
- "stall": { "noOutputMinutes": 60, "maxAttempts": 3, "requestionHours": 4 },
697
+ "stall": { "noOutputMinutes": 60, "maxAttempts": 3, "requestionHours": 4, "orphanHours": 2 },
698
698
  "notify": { "provider": "telegram", "stateDir": "~/.claude/channels/telegram-<project>" }
699
699
  }
700
700
  ```
@@ -719,6 +719,7 @@ operator chooses Telegram (`init-config --notify telegram`).
719
719
  | `sessionManager.stall.noOutputMinutes` | no | `60` | A live worker with no new output for this long counts as stalled (zero or positive). |
720
720
  | `sessionManager.stall.maxAttempts` | no | `3` | Fresh sessions per item before it moves to the configured `blocked` role (a positive integer). |
721
721
  | `sessionManager.stall.requestionHours` | no | `4` | How long an unanswered worker question waits before the manager asks again (zero or positive). |
722
+ | `sessionManager.stall.orphanHours` | no | `2` | An item in the `claimed` (or `review`) role with no live worker and no tracker update for this long is presumed abandoned, and the orphan sweep finishes, returns or re-dispatches it. Anything updated more recently is left alone, which protects someone running `/lisa:implement` by hand (zero or positive). |
722
723
  | `sessionManager.notify.provider` | no | `none` | `none` (no notification channel) or `telegram`. Absent, like an absent `notify` block, means `none`. Any other value fails validation. |
723
724
  | `sessionManager.notify.stateDir` | **yes** with `telegram`; must be absent otherwise | — | This project's own Telegram state dir. A `stateDir` without the `telegram` provider fails validation, because no bot would use it. Never the shared default `~/.claude/channels/telegram`, because one bot per state dir is how projects stay isolated. Setup writes `~/.claude/channels/telegram-<project>`. |
724
725
  | `sessionManager.trustedAuthorIds` | no | — | Optional list of **stable tracker user ids**, as strings: the GitHub numeric user id (`gh api users/<login> --jq .id`), the Jira `accountId`, or the Linear user id. Not logins or display names: matching compares ids, so a plain login silently matches no one and excludes every item. An entry may name its kind: `id:<v>` is an id, `login:<v>` a GitHub login (matched by the queue and on-item answers; the hold-release check compares ids only and ignores it). A login GitHub frees (after a rename or a deleted account) can be re-registered by someone else, so prefer `id:` for trust. `integration:<service>` trusts items an integration files with no person behind them (Linear's `botActor`, by `subType` such as `sentry`, else its bot `id`, never its self-chosen display name; never an item a person or an outside user filed; it trusts who filed the item, not text an outsider can get into it, such as a quoted error message); GitHub Apps and Jira automation file as an account, so trust them by `id:`. An unknown prefix or an empty value fails validation. When set, the manager takes only items authored by these people or integrations. It is also who may release a human hold, unless `trustedReleaseIds` is set — so removing it removes every hold releaser too. |
@@ -680,6 +680,7 @@ const STALL_RULES = {
680
680
  noOutputMinutes: [n => n >= 0, "zero or a positive number"],
681
681
  maxAttempts: [n => Number.isInteger(n) && n > 0, "a positive integer"],
682
682
  requestionHours: [n => n >= 0, "zero or a positive number"],
683
+ orphanHours: [n => n >= 0, "zero or a positive number"],
683
684
  };
684
685
 
685
686
  /** Notification providers `sessionManager.notify.provider` accepts. */
@@ -512,8 +512,9 @@ just as long. Sweep both every cycle, after `classify` and before Dispatch:
512
512
  operators and the trusted authors come from the ledger and config, never from the input. It
513
513
  skips refs the ledger shows running or asking (their holds too, so an item waiting on a
514
514
  person's answer is never on the operator's list twice), items assigned to anyone but "me" or an
515
- operator, and items updated within `--stale-hours` (default 6) or with no `updatedAt`, which
516
- protects a person running `/lisa:implement` by hand. A live or foreign hold is skipped the
515
+ operator, and items updated within `sessionManager.stall.orphanHours` (default 2;
516
+ `--stale-hours` overrides it) or with no `updatedAt`, which protects a person running
517
+ `/lisa:implement` by hand. A live or foreign hold is skipped the
517
518
  same way; a fresh or undated one is not lifted this cycle, but its human reasons still reach
518
519
  the operator's list, so a new comment never makes the list change.
519
520
  2. **Act** per bucket. **Before every write** in this sweep (a finish, a return, a re-dispatch
@@ -129,6 +129,20 @@ function readEnvelope(ctx) {
129
129
  return { items: envelope.items, holds: envelope.holds };
130
130
  }
131
131
 
132
+ /**
133
+ * The stale threshold for the sweep: the flag, else the config, else the
134
+ * planner's own default.
135
+ * @param {number | undefined} flag - `--stale-hours`
136
+ * @param {{ stall?: { orphanHours?: unknown } } | null | undefined} config -
137
+ * Resolved `sessionManager` block, or absent
138
+ * @returns {{ staleHours?: number }} Spread into the planner options
139
+ */
140
+ function orphanStaleHours(flag, config) {
141
+ if (flag !== undefined) return { staleHours: flag };
142
+ const configured = config?.stall?.orphanHours;
143
+ return typeof configured === "number" ? { staleHours: configured } : {};
144
+ }
145
+
132
146
  /**
133
147
  * `orphan-plan [--input <file>] [--max <n>] [--stale-hours <n>]` (stdin
134
148
  * without --input: `{"complete":true,"items":[...],"holds":[...]}`).
@@ -155,7 +169,9 @@ export async function orphanPlan(ctx) {
155
169
  trustedAuthorIds: trustedReleaseEntries(config),
156
170
  now: new Date(),
157
171
  ...(max === undefined ? {} : { max }),
158
- ...(staleHours === undefined ? {} : { staleHours }),
172
+ // An explicit --stale-hours wins; otherwise the project's
173
+ // `stall.orphanHours` (CodySwannGT/lisa#4901).
174
+ ...orphanStaleHours(staleHours, config),
159
175
  previousDigest: ledger.control.holdDigest ?? null,
160
176
  ...holdPolicy(project),
161
177
  })
@@ -328,7 +328,7 @@ Per cycle
328
328
  trustedAuthorIds and the hold labels come from the ledger and config;
329
329
  the same keys in the input are ignored. Skips live, foreign (assigned
330
330
  to neither me nor an operator), fresh (updated within --stale-hours,
331
- default 6) and undated items. Live and foreign holds are skipped; a
331
+ else sessionManager.stall.orphanHours, default 2) and undated items. Live and foreign holds are skipped; a
332
332
  fresh or undated hold is not lifted (skipped fresh or undated) but its
333
333
  kept reasons still reach holds.keep and the digest. A lift left with
334
334
  nothing to write is skipped as nothing-to-write; decision is null for
@@ -50,6 +50,7 @@ export const SESSION_MANAGER_DEFAULTS = Object.freeze({
50
50
  noOutputMinutes: 60,
51
51
  maxAttempts: 3,
52
52
  requestionHours: 4,
53
+ orphanHours: 2,
53
54
  }),
54
55
  notify: Object.freeze({ provider: "none" }),
55
56
  });
@@ -74,7 +75,7 @@ export function notifyProvider(config) {
74
75
  * @typedef {{ maxWorkers: number, gbPerWorker: number, reserveGb: number,
75
76
  * cpuFraction: number, maxLoadPerCore: number }} CapacityBlock
76
77
  * @typedef {{ noOutputMinutes: number, maxAttempts: number,
77
- * requestionHours: number }} StallBlock
78
+ * requestionHours: number, orphanHours: number }} StallBlock
78
79
  * @typedef {{ provider: string, stateDir?: string }} NotifyBlock
79
80
  * @typedef {{
80
81
  * name: string,
@@ -38,8 +38,15 @@ export {
38
38
  /** At most this many writes per cycle unless the caller says otherwise. */
39
39
  export const DEFAULT_ORPHAN_MAX = 10;
40
40
 
41
- /** An item updated more recently than this many hours is left alone. */
42
- export const DEFAULT_STALE_HOURS = 6;
41
+ /**
42
+ * An item updated more recently than this many hours is left alone.
43
+ *
44
+ * Matches the documented `sessionManager.stall.orphanHours` default, which
45
+ * `orphan-plan` passes in. An in-progress item should never go two hours
46
+ * without a tracker update, so one that has is presumed abandoned
47
+ * (CodySwannGT/lisa#4901).
48
+ */
49
+ export const DEFAULT_STALE_HOURS = 2;
43
50
 
44
51
  /** The order buckets spend the cap in. */
45
52
  const CAPPED_BUCKETS = ["doneReady", "return", "redispatch", "parked"];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -680,6 +680,7 @@ const STALL_RULES = {
680
680
  noOutputMinutes: [n => n >= 0, "zero or a positive number"],
681
681
  maxAttempts: [n => Number.isInteger(n) && n > 0, "a positive integer"],
682
682
  requestionHours: [n => n >= 0, "zero or a positive number"],
683
+ orphanHours: [n => n >= 0, "zero or a positive number"],
683
684
  };
684
685
 
685
686
  /** Notification providers `sessionManager.notify.provider` accepts. */
@@ -512,8 +512,9 @@ just as long. Sweep both every cycle, after `classify` and before Dispatch:
512
512
  operators and the trusted authors come from the ledger and config, never from the input. It
513
513
  skips refs the ledger shows running or asking (their holds too, so an item waiting on a
514
514
  person's answer is never on the operator's list twice), items assigned to anyone but "me" or an
515
- operator, and items updated within `--stale-hours` (default 6) or with no `updatedAt`, which
516
- protects a person running `/lisa:implement` by hand. A live or foreign hold is skipped the
515
+ operator, and items updated within `sessionManager.stall.orphanHours` (default 2;
516
+ `--stale-hours` overrides it) or with no `updatedAt`, which protects a person running
517
+ `/lisa:implement` by hand. A live or foreign hold is skipped the
517
518
  same way; a fresh or undated one is not lifted this cycle, but its human reasons still reach
518
519
  the operator's list, so a new comment never makes the list change.
519
520
  2. **Act** per bucket. **Before every write** in this sweep (a finish, a return, a re-dispatch
@@ -129,6 +129,20 @@ function readEnvelope(ctx) {
129
129
  return { items: envelope.items, holds: envelope.holds };
130
130
  }
131
131
 
132
+ /**
133
+ * The stale threshold for the sweep: the flag, else the config, else the
134
+ * planner's own default.
135
+ * @param {number | undefined} flag - `--stale-hours`
136
+ * @param {{ stall?: { orphanHours?: unknown } } | null | undefined} config -
137
+ * Resolved `sessionManager` block, or absent
138
+ * @returns {{ staleHours?: number }} Spread into the planner options
139
+ */
140
+ function orphanStaleHours(flag, config) {
141
+ if (flag !== undefined) return { staleHours: flag };
142
+ const configured = config?.stall?.orphanHours;
143
+ return typeof configured === "number" ? { staleHours: configured } : {};
144
+ }
145
+
132
146
  /**
133
147
  * `orphan-plan [--input <file>] [--max <n>] [--stale-hours <n>]` (stdin
134
148
  * without --input: `{"complete":true,"items":[...],"holds":[...]}`).
@@ -155,7 +169,9 @@ export async function orphanPlan(ctx) {
155
169
  trustedAuthorIds: trustedReleaseEntries(config),
156
170
  now: new Date(),
157
171
  ...(max === undefined ? {} : { max }),
158
- ...(staleHours === undefined ? {} : { staleHours }),
172
+ // An explicit --stale-hours wins; otherwise the project's
173
+ // `stall.orphanHours` (CodySwannGT/lisa#4901).
174
+ ...orphanStaleHours(staleHours, config),
159
175
  previousDigest: ledger.control.holdDigest ?? null,
160
176
  ...holdPolicy(project),
161
177
  })
@@ -328,7 +328,7 @@ Per cycle
328
328
  trustedAuthorIds and the hold labels come from the ledger and config;
329
329
  the same keys in the input are ignored. Skips live, foreign (assigned
330
330
  to neither me nor an operator), fresh (updated within --stale-hours,
331
- default 6) and undated items. Live and foreign holds are skipped; a
331
+ else sessionManager.stall.orphanHours, default 2) and undated items. Live and foreign holds are skipped; a
332
332
  fresh or undated hold is not lifted (skipped fresh or undated) but its
333
333
  kept reasons still reach holds.keep and the digest. A lift left with
334
334
  nothing to write is skipped as nothing-to-write; decision is null for
@@ -50,6 +50,7 @@ export const SESSION_MANAGER_DEFAULTS = Object.freeze({
50
50
  noOutputMinutes: 60,
51
51
  maxAttempts: 3,
52
52
  requestionHours: 4,
53
+ orphanHours: 2,
53
54
  }),
54
55
  notify: Object.freeze({ provider: "none" }),
55
56
  });
@@ -74,7 +75,7 @@ export function notifyProvider(config) {
74
75
  * @typedef {{ maxWorkers: number, gbPerWorker: number, reserveGb: number,
75
76
  * cpuFraction: number, maxLoadPerCore: number }} CapacityBlock
76
77
  * @typedef {{ noOutputMinutes: number, maxAttempts: number,
77
- * requestionHours: number }} StallBlock
78
+ * requestionHours: number, orphanHours: number }} StallBlock
78
79
  * @typedef {{ provider: string, stateDir?: string }} NotifyBlock
79
80
  * @typedef {{
80
81
  * name: string,
@@ -38,8 +38,15 @@ export {
38
38
  /** At most this many writes per cycle unless the caller says otherwise. */
39
39
  export const DEFAULT_ORPHAN_MAX = 10;
40
40
 
41
- /** An item updated more recently than this many hours is left alone. */
42
- export const DEFAULT_STALE_HOURS = 6;
41
+ /**
42
+ * An item updated more recently than this many hours is left alone.
43
+ *
44
+ * Matches the documented `sessionManager.stall.orphanHours` default, which
45
+ * `orphan-plan` passes in. An in-progress item should never go two hours
46
+ * without a tracker update, so one that has is presumed abandoned
47
+ * (CodySwannGT/lisa#4901).
48
+ */
49
+ export const DEFAULT_STALE_HOURS = 2;
43
50
 
44
51
  /** The order buckets spend the cap in. */
45
52
  const CAPPED_BUCKETS = ["doneReady", "return", "redispatch", "parked"];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "AWS CDK-specific Lisa plugin.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -694,7 +694,7 @@ have a `.lisa.config.json` and their own `.git` (written as `"root": "."`).
694
694
  }
695
695
  },
696
696
  "capacity": { "maxWorkers": 6, "gbPerWorker": 3, "reserveGb": 8, "cpuFraction": 0.75, "maxLoadPerCore": 1.5 },
697
- "stall": { "noOutputMinutes": 60, "maxAttempts": 3, "requestionHours": 4 },
697
+ "stall": { "noOutputMinutes": 60, "maxAttempts": 3, "requestionHours": 4, "orphanHours": 2 },
698
698
  "notify": { "provider": "telegram", "stateDir": "~/.claude/channels/telegram-<project>" }
699
699
  }
700
700
  ```
@@ -719,6 +719,7 @@ operator chooses Telegram (`init-config --notify telegram`).
719
719
  | `sessionManager.stall.noOutputMinutes` | no | `60` | A live worker with no new output for this long counts as stalled (zero or positive). |
720
720
  | `sessionManager.stall.maxAttempts` | no | `3` | Fresh sessions per item before it moves to the configured `blocked` role (a positive integer). |
721
721
  | `sessionManager.stall.requestionHours` | no | `4` | How long an unanswered worker question waits before the manager asks again (zero or positive). |
722
+ | `sessionManager.stall.orphanHours` | no | `2` | An item in the `claimed` (or `review`) role with no live worker and no tracker update for this long is presumed abandoned, and the orphan sweep finishes, returns or re-dispatches it. Anything updated more recently is left alone, which protects someone running `/lisa:implement` by hand (zero or positive). |
722
723
  | `sessionManager.notify.provider` | no | `none` | `none` (no notification channel) or `telegram`. Absent, like an absent `notify` block, means `none`. Any other value fails validation. |
723
724
  | `sessionManager.notify.stateDir` | **yes** with `telegram`; must be absent otherwise | — | This project's own Telegram state dir. A `stateDir` without the `telegram` provider fails validation, because no bot would use it. Never the shared default `~/.claude/channels/telegram`, because one bot per state dir is how projects stay isolated. Setup writes `~/.claude/channels/telegram-<project>`. |
724
725
  | `sessionManager.trustedAuthorIds` | no | — | Optional list of **stable tracker user ids**, as strings: the GitHub numeric user id (`gh api users/<login> --jq .id`), the Jira `accountId`, or the Linear user id. Not logins or display names: matching compares ids, so a plain login silently matches no one and excludes every item. An entry may name its kind: `id:<v>` is an id, `login:<v>` a GitHub login (matched by the queue and on-item answers; the hold-release check compares ids only and ignores it). A login GitHub frees (after a rename or a deleted account) can be re-registered by someone else, so prefer `id:` for trust. `integration:<service>` trusts items an integration files with no person behind them (Linear's `botActor`, by `subType` such as `sentry`, else its bot `id`, never its self-chosen display name; never an item a person or an outside user filed; it trusts who filed the item, not text an outsider can get into it, such as a quoted error message); GitHub Apps and Jira automation file as an account, so trust them by `id:`. An unknown prefix or an empty value fails validation. When set, the manager takes only items authored by these people or integrations. It is also who may release a human hold, unless `trustedReleaseIds` is set — so removing it removes every hold releaser too. |
@@ -680,6 +680,7 @@ const STALL_RULES = {
680
680
  noOutputMinutes: [n => n >= 0, "zero or a positive number"],
681
681
  maxAttempts: [n => Number.isInteger(n) && n > 0, "a positive integer"],
682
682
  requestionHours: [n => n >= 0, "zero or a positive number"],
683
+ orphanHours: [n => n >= 0, "zero or a positive number"],
683
684
  };
684
685
 
685
686
  /** Notification providers `sessionManager.notify.provider` accepts. */
@@ -512,8 +512,9 @@ just as long. Sweep both every cycle, after `classify` and before Dispatch:
512
512
  operators and the trusted authors come from the ledger and config, never from the input. It
513
513
  skips refs the ledger shows running or asking (their holds too, so an item waiting on a
514
514
  person's answer is never on the operator's list twice), items assigned to anyone but "me" or an
515
- operator, and items updated within `--stale-hours` (default 6) or with no `updatedAt`, which
516
- protects a person running `/lisa:implement` by hand. A live or foreign hold is skipped the
515
+ operator, and items updated within `sessionManager.stall.orphanHours` (default 2;
516
+ `--stale-hours` overrides it) or with no `updatedAt`, which protects a person running
517
+ `/lisa:implement` by hand. A live or foreign hold is skipped the
517
518
  same way; a fresh or undated one is not lifted this cycle, but its human reasons still reach
518
519
  the operator's list, so a new comment never makes the list change.
519
520
  2. **Act** per bucket. **Before every write** in this sweep (a finish, a return, a re-dispatch
@@ -129,6 +129,20 @@ function readEnvelope(ctx) {
129
129
  return { items: envelope.items, holds: envelope.holds };
130
130
  }
131
131
 
132
+ /**
133
+ * The stale threshold for the sweep: the flag, else the config, else the
134
+ * planner's own default.
135
+ * @param {number | undefined} flag - `--stale-hours`
136
+ * @param {{ stall?: { orphanHours?: unknown } } | null | undefined} config -
137
+ * Resolved `sessionManager` block, or absent
138
+ * @returns {{ staleHours?: number }} Spread into the planner options
139
+ */
140
+ function orphanStaleHours(flag, config) {
141
+ if (flag !== undefined) return { staleHours: flag };
142
+ const configured = config?.stall?.orphanHours;
143
+ return typeof configured === "number" ? { staleHours: configured } : {};
144
+ }
145
+
132
146
  /**
133
147
  * `orphan-plan [--input <file>] [--max <n>] [--stale-hours <n>]` (stdin
134
148
  * without --input: `{"complete":true,"items":[...],"holds":[...]}`).
@@ -155,7 +169,9 @@ export async function orphanPlan(ctx) {
155
169
  trustedAuthorIds: trustedReleaseEntries(config),
156
170
  now: new Date(),
157
171
  ...(max === undefined ? {} : { max }),
158
- ...(staleHours === undefined ? {} : { staleHours }),
172
+ // An explicit --stale-hours wins; otherwise the project's
173
+ // `stall.orphanHours` (CodySwannGT/lisa#4901).
174
+ ...orphanStaleHours(staleHours, config),
159
175
  previousDigest: ledger.control.holdDigest ?? null,
160
176
  ...holdPolicy(project),
161
177
  })
@@ -328,7 +328,7 @@ Per cycle
328
328
  trustedAuthorIds and the hold labels come from the ledger and config;
329
329
  the same keys in the input are ignored. Skips live, foreign (assigned
330
330
  to neither me nor an operator), fresh (updated within --stale-hours,
331
- default 6) and undated items. Live and foreign holds are skipped; a
331
+ else sessionManager.stall.orphanHours, default 2) and undated items. Live and foreign holds are skipped; a
332
332
  fresh or undated hold is not lifted (skipped fresh or undated) but its
333
333
  kept reasons still reach holds.keep and the digest. A lift left with
334
334
  nothing to write is skipped as nothing-to-write; decision is null for
@@ -50,6 +50,7 @@ export const SESSION_MANAGER_DEFAULTS = Object.freeze({
50
50
  noOutputMinutes: 60,
51
51
  maxAttempts: 3,
52
52
  requestionHours: 4,
53
+ orphanHours: 2,
53
54
  }),
54
55
  notify: Object.freeze({ provider: "none" }),
55
56
  });
@@ -74,7 +75,7 @@ export function notifyProvider(config) {
74
75
  * @typedef {{ maxWorkers: number, gbPerWorker: number, reserveGb: number,
75
76
  * cpuFraction: number, maxLoadPerCore: number }} CapacityBlock
76
77
  * @typedef {{ noOutputMinutes: number, maxAttempts: number,
77
- * requestionHours: number }} StallBlock
78
+ * requestionHours: number, orphanHours: number }} StallBlock
78
79
  * @typedef {{ provider: string, stateDir?: string }} NotifyBlock
79
80
  * @typedef {{
80
81
  * name: string,
@@ -38,8 +38,15 @@ export {
38
38
  /** At most this many writes per cycle unless the caller says otherwise. */
39
39
  export const DEFAULT_ORPHAN_MAX = 10;
40
40
 
41
- /** An item updated more recently than this many hours is left alone. */
42
- export const DEFAULT_STALE_HOURS = 6;
41
+ /**
42
+ * An item updated more recently than this many hours is left alone.
43
+ *
44
+ * Matches the documented `sessionManager.stall.orphanHours` default, which
45
+ * `orphan-plan` passes in. An in-progress item should never go two hours
46
+ * without a tracker update, so one that has is presumed abandoned
47
+ * (CodySwannGT/lisa#4901).
48
+ */
49
+ export const DEFAULT_STALE_HOURS = 2;
43
50
 
44
51
  /** The order buckets spend the cap in. */
45
52
  const CAPPED_BUCKETS = ["doneReady", "return", "redispatch", "parked"];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -699,7 +699,7 @@ have a `.lisa.config.json` and their own `.git` (written as `"root": "."`).
699
699
  }
700
700
  },
701
701
  "capacity": { "maxWorkers": 6, "gbPerWorker": 3, "reserveGb": 8, "cpuFraction": 0.75, "maxLoadPerCore": 1.5 },
702
- "stall": { "noOutputMinutes": 60, "maxAttempts": 3, "requestionHours": 4 },
702
+ "stall": { "noOutputMinutes": 60, "maxAttempts": 3, "requestionHours": 4, "orphanHours": 2 },
703
703
  "notify": { "provider": "telegram", "stateDir": "~/.claude/channels/telegram-<project>" }
704
704
  }
705
705
  ```
@@ -724,6 +724,7 @@ operator chooses Telegram (`init-config --notify telegram`).
724
724
  | `sessionManager.stall.noOutputMinutes` | no | `60` | A live worker with no new output for this long counts as stalled (zero or positive). |
725
725
  | `sessionManager.stall.maxAttempts` | no | `3` | Fresh sessions per item before it moves to the configured `blocked` role (a positive integer). |
726
726
  | `sessionManager.stall.requestionHours` | no | `4` | How long an unanswered worker question waits before the manager asks again (zero or positive). |
727
+ | `sessionManager.stall.orphanHours` | no | `2` | An item in the `claimed` (or `review`) role with no live worker and no tracker update for this long is presumed abandoned, and the orphan sweep finishes, returns or re-dispatches it. Anything updated more recently is left alone, which protects someone running `/lisa:implement` by hand (zero or positive). |
727
728
  | `sessionManager.notify.provider` | no | `none` | `none` (no notification channel) or `telegram`. Absent, like an absent `notify` block, means `none`. Any other value fails validation. |
728
729
  | `sessionManager.notify.stateDir` | **yes** with `telegram`; must be absent otherwise | — | This project's own Telegram state dir. A `stateDir` without the `telegram` provider fails validation, because no bot would use it. Never the shared default `~/.claude/channels/telegram`, because one bot per state dir is how projects stay isolated. Setup writes `~/.claude/channels/telegram-<project>`. |
729
730
  | `sessionManager.trustedAuthorIds` | no | — | Optional list of **stable tracker user ids**, as strings: the GitHub numeric user id (`gh api users/<login> --jq .id`), the Jira `accountId`, or the Linear user id. Not logins or display names: matching compares ids, so a plain login silently matches no one and excludes every item. An entry may name its kind: `id:<v>` is an id, `login:<v>` a GitHub login (matched by the queue and on-item answers; the hold-release check compares ids only and ignores it). A login GitHub frees (after a rename or a deleted account) can be re-registered by someone else, so prefer `id:` for trust. `integration:<service>` trusts items an integration files with no person behind them (Linear's `botActor`, by `subType` such as `sentry`, else its bot `id`, never its self-chosen display name; never an item a person or an outside user filed; it trusts who filed the item, not text an outsider can get into it, such as a quoted error message); GitHub Apps and Jira automation file as an account, so trust them by `id:`. An unknown prefix or an empty value fails validation. When set, the manager takes only items authored by these people or integrations. It is also who may release a human hold, unless `trustedReleaseIds` is set — so removing it removes every hold releaser too. |
@@ -680,6 +680,7 @@ const STALL_RULES = {
680
680
  noOutputMinutes: [n => n >= 0, "zero or a positive number"],
681
681
  maxAttempts: [n => Number.isInteger(n) && n > 0, "a positive integer"],
682
682
  requestionHours: [n => n >= 0, "zero or a positive number"],
683
+ orphanHours: [n => n >= 0, "zero or a positive number"],
683
684
  };
684
685
 
685
686
  /** Notification providers `sessionManager.notify.provider` accepts. */