@codyswann/lisa 4.97.2 → 4.97.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) 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 +24 -12
  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 +115 -6
  9. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +28 -9
  10. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/references/runbook-template.md +4 -2
  11. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
  12. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
  13. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
  14. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  15. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +2 -1
  16. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
  17. package/plugins/lisa/.codex-plugin/skills/lisa-setup-session-manager/SKILL.md +15 -2
  18. package/plugins/lisa/rules/reference/config-resolution.md +8 -5
  19. package/plugins/lisa/scripts/operator-id-kinds.mjs +120 -0
  20. package/plugins/lisa/scripts/ready-queue-order.mjs +89 -15
  21. package/plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
  22. package/plugins/lisa/skills/lisa-session-manager/SKILL.md +28 -9
  23. package/plugins/lisa/skills/lisa-session-manager/references/runbook-template.md +4 -2
  24. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
  25. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
  26. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
  27. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  28. package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +2 -1
  29. package/plugins/lisa/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
  30. package/plugins/lisa/skills/lisa-setup-session-manager/SKILL.md +15 -2
  31. package/plugins/lisa-agy/plugin.json +1 -1
  32. package/plugins/lisa-agy/scripts/operator-id-kinds.mjs +120 -0
  33. package/plugins/lisa-agy/scripts/ready-queue-order.mjs +89 -15
  34. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
  35. package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +28 -9
  36. package/plugins/lisa-agy/skills/lisa-session-manager/references/runbook-template.md +4 -2
  37. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
  38. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
  39. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
  40. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  41. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +2 -1
  42. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
  43. package/plugins/lisa-agy/skills/lisa-setup-session-manager/SKILL.md +15 -2
  44. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  46. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  47. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  51. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-copilot/rules/reference/config-resolution.md +8 -5
  53. package/plugins/lisa-copilot/scripts/operator-id-kinds.mjs +120 -0
  54. package/plugins/lisa-copilot/scripts/ready-queue-order.mjs +89 -15
  55. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
  56. package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +28 -9
  57. package/plugins/lisa-copilot/skills/lisa-session-manager/references/runbook-template.md +4 -2
  58. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
  59. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
  60. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
  61. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  62. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +2 -1
  63. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
  64. package/plugins/lisa-copilot/skills/lisa-setup-session-manager/SKILL.md +15 -2
  65. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +8 -5
  67. package/plugins/lisa-cursor/scripts/operator-id-kinds.mjs +120 -0
  68. package/plugins/lisa-cursor/scripts/ready-queue-order.mjs +89 -15
  69. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
  70. package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +28 -9
  71. package/plugins/lisa-cursor/skills/lisa-session-manager/references/runbook-template.md +4 -2
  72. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
  73. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
  74. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
  75. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  76. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +2 -1
  77. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
  78. package/plugins/lisa-cursor/skills/lisa-setup-session-manager/SKILL.md +15 -2
  79. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  81. package/plugins/lisa-devin/rules/reference/config-resolution.md +8 -5
  82. package/plugins/lisa-devin/scripts/operator-id-kinds.mjs +120 -0
  83. package/plugins/lisa-devin/scripts/ready-queue-order.mjs +89 -15
  84. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
  85. package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +28 -9
  86. package/plugins/lisa-devin/skills/lisa-session-manager/references/runbook-template.md +4 -2
  87. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
  88. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
  89. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
  90. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  91. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +2 -1
  92. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
  93. package/plugins/lisa-devin/skills/lisa-setup-session-manager/SKILL.md +15 -2
  94. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  95. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  96. package/plugins/lisa-expo-agy/plugin.json +1 -1
  97. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  101. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  103. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  104. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  108. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  110. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  111. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-nestjs-devin/.devin-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-openclaw-devin/.claude-plugin/plugin.json +1 -1
  121. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  122. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  123. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  124. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  125. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  126. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  127. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  128. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  129. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  130. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  131. package/plugins/lisa-rails-agy/plugin.json +1 -1
  132. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  134. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  135. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  136. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  137. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  138. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  139. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  140. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  141. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  142. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  143. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  144. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  145. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  146. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  147. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  148. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  149. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  150. package/plugins/src/base/rules/reference/config-resolution.md +8 -5
  151. package/plugins/src/base/scripts/operator-id-kinds.mjs +120 -0
  152. package/plugins/src/base/scripts/ready-queue-order.mjs +89 -15
  153. package/plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs +115 -6
  154. package/plugins/src/base/skills/lisa-session-manager/SKILL.md +28 -9
  155. package/plugins/src/base/skills/lisa-session-manager/references/runbook-template.md +4 -2
  156. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-cycle.mjs +7 -2
  157. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-manager.mjs +9 -2
  158. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-runtime.mjs +9 -4
  159. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  160. package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +2 -1
  161. package/plugins/src/base/skills/lisa-session-manager/scripts/human-answer.mjs +38 -9
  162. package/plugins/src/base/skills/lisa-setup-session-manager/SKILL.md +15 -2
@@ -16,6 +16,7 @@ import path from "node:path";
16
16
 
17
17
  import {
18
18
  resolveSessionManagerConfig,
19
+ sessionManagerWarnings,
19
20
  validateSessionManager,
20
21
  } from "./config.mjs";
21
22
  import {
@@ -134,15 +135,19 @@ function validationView(config) {
134
135
  * Read both config files and resolve the `sessionManager` block.
135
136
  * @param {string} root - Absolute project root
136
137
  * @returns {{ global: object | undefined, local: object | undefined,
137
- * config: object | null, errors: string[] }} Raw files, resolved block
138
- * (null when absent) and validation errors
138
+ * config: object | null, errors: string[], warnings: string[] }} Raw
139
+ * files, resolved block (null when absent), validation errors, and
140
+ * warnings that never block a command (such as a plain all-digit
141
+ * operator entry, #4623)
139
142
  */
140
143
  export function loadProject(root) {
141
144
  const global = readConfigFile(path.join(root, GLOBAL_CONFIG_FILE));
142
145
  const local = readConfigFile(path.join(root, LOCAL_CONFIG_FILE));
143
146
  const config = resolveSessionManagerConfig(global, local);
144
- const errors = config ? validateSessionManager(validationView(config)) : [];
145
- return { global, local, config, errors };
147
+ const view = config ? validationView(config) : null;
148
+ const errors = view ? validateSessionManager(view) : [];
149
+ const warnings = view ? sessionManagerWarnings(view) : [];
150
+ return { global, local, config, errors, warnings };
146
151
  }
147
152
 
148
153
  /**
@@ -116,7 +116,9 @@ Config and routing
116
116
  repo-dir [--repo <key>] [--raw]
117
117
  stdout {repo,dir}; --raw prints the bare dir. Exit 2 for an
118
118
  unknown key or a dir without .lisa.config.json.
119
- validate stdout {valid,errors}; exit 2 when invalid or absent.
119
+ validate stdout {valid,errors[,warnings]}; exit 2 when invalid or absent.
120
+ warnings (only when any, never fatal) names an ambiguous entry,
121
+ such as a plain all-digit operatorIds entry.
120
122
  init-config [--slug <slug>] [--notify none|telegram] [--write]
121
123
  stdout {written,block[,reason:"exists",layer][,path]}. --notify picks
122
124
  the notification channel (default none): none writes
@@ -159,7 +161,9 @@ Per cycle
159
161
  reason}]}. An item with a pending question in the ledger is excluded
160
162
  (pending-question) from both tiers, and every other item still comes
161
163
  back, so one item waiting on a human never stops dispatch. ordered: items assigned to sessionManager.operatorIds
162
- first, then to --me, then unassigned; each group by priority, then age.
164
+ first (a login: entry matches a GitHub assignee login, an id: entry
165
+ an assignee account id, a plain entry as --me does), then to --me,
166
+ then unassigned; each group by priority, then age.
163
167
  Items assigned to anyone else are excluded (assigned-to-other).
164
168
  --me defaults to the ledger's control.me.
165
169
  With sessionManager.backlogPickup true, also prints backlogTotal,
@@ -204,7 +208,8 @@ Per cycle
204
208
  blocked-plan [--input <file>] [--ref <ref>] STDIN (without --input): JSON
205
209
  {labels,body,comments,humanNeededLabel?,edges,pendingQuestion?}.
206
210
  Trusted hold releasers are sessionManager.trustedAuthorIds (none when
207
- unset); trustedHumanActorIds in the input is ignored. stdout
211
+ unset; plain and id: entries, compared as ids; login: entries never
212
+ release); trustedHumanActorIds in the input is ignored. stdout
208
213
  {action:release|keep|escalate|skip-human-gate,reason,edges,gate}.
209
214
  --ref fills pendingQuestion from the ledger.
210
215
  mark-plan <ref> --kind <kind> [--cause <cause>] [--item-label <l>]...
@@ -254,8 +259,9 @@ Per cycle
254
259
  Queues the human's answer from the item's comments (source "item"):
255
260
  the first comment after the latest [lisa-session-manager-question]
256
261
  comment whose author's STABLE id (GitHub login or numeric id, Jira
257
- accountId, Linear user id; never a name, displayName or email; an
258
- all-digit entry is a numeric id, never matched against a login) is in
262
+ accountId, Linear user id; never a name, displayName or email; a
263
+ plain all-digit entry is a numeric id, never matched against a login;
264
+ login:<v> matches only a login, id:<v> only an id) is in
259
265
  sessionManager.operatorIds or trustedAuthorIds, and that is not a
260
266
  machine comment, checked first (body starting with a bracketed tag
261
267
  such as [lisa-...] or [claude-sync]; [lisa- or <!-- lisa: anywhere;
@@ -21,10 +21,11 @@ import { isAbsolute, resolve, sep } from "node:path";
21
21
  import {
22
22
  mergeConfigLayers as mergeLayers,
23
23
  parseLoopInterval,
24
+ sessionManagerWarnings,
24
25
  validateSessionManager,
25
26
  } from "../../lisa-secrets-access/scripts/validate-config.mjs";
26
27
 
27
- export { parseLoopInterval, validateSessionManager };
28
+ export { parseLoopInterval, sessionManagerWarnings, validateSessionManager };
28
29
  export { detectRepoLayout, detectRepos, draftHints } from "./repo-detect.mjs";
29
30
 
30
31
  /**
@@ -18,8 +18,11 @@
18
18
  * login or numeric id, a Jira accountId, a Linear user id, never a display
19
19
  * name or email, which anyone can set. An all-digit allowed entry is a
20
20
  * numeric id and matches only the `id` or `accountId` field, never a login,
21
- * which its owner chooses and may make all digits (#4571). The text is
22
- * carried as data.
21
+ * which its owner chooses and may make all digits (#4571). A kind-keyed
22
+ * entry names one identity for this matcher, the queue and the claim alike
23
+ * (#4623): `login:<v>` matches only a `login`, `id:<v>` only an `id` or
24
+ * `accountId`, and an entry with an unknown prefix or an empty value matches
25
+ * nobody. The text is carried as data.
23
26
  *
24
27
  * The question the answer must follow is the comment whose id the manager
25
28
  * recorded last; with no recorded id, the latest comment that STARTS with
@@ -28,6 +31,7 @@
28
31
  * answer by posting the marker after it.
29
32
  * @module session-manager/human-answer
30
33
  */
34
+ import { parseIdEntries } from "../../../scripts/operator-id-kinds.mjs";
31
35
  import { QUESTION_MARKER } from "./human-needed.mjs";
32
36
 
33
37
  /** Body markers that make a comment a machine's, never a human's answer. */
@@ -46,6 +50,9 @@ const QUOTE_LINE = /^\s*>/;
46
50
  /** The comment fields that carry its tracker id. */
47
51
  const COMMENT_ID_KEYS = ["id", "node_id"];
48
52
 
53
+ /** The author field a `login:` entry matches. */
54
+ const LOGIN_KEYS = ["login"];
55
+
49
56
  /** The author fields that are stable ids, never settable display text. */
50
57
  const STABLE_ID_KEYS = ["login", "id", "accountId"];
51
58
 
@@ -60,6 +67,28 @@ const NUMERIC_ID_KEYS = ["id", "accountId"];
60
67
  /** An allowed entry that is a numeric account id, never a login. */
61
68
  const ALL_DIGITS = /^\d+$/;
62
69
 
70
+ /**
71
+ * The allowed values, split by the author fields each may match. A plain
72
+ * entry keeps its #4571 meaning (all digits: an id only; otherwise a login
73
+ * or an id); a kind-keyed entry matches its own kind only.
74
+ * @param {readonly unknown[]} allowed - Answerer entries
75
+ * @returns {{ ids: Set<string>, logins: Set<string>, named: Set<string> }}
76
+ * Values matched against id fields, login fields, and any stable field
77
+ */
78
+ function answererSets(allowed) {
79
+ const entries = parseIdEntries(allowed);
80
+ const plain = entries.filter(entry => entry.kind === "plain");
81
+ const valuesOf = list => new Set(list.map(entry => entry.value));
82
+ return {
83
+ ids: valuesOf([
84
+ ...plain.filter(entry => ALL_DIGITS.test(entry.value)),
85
+ ...entries.filter(entry => entry.kind === "id"),
86
+ ]),
87
+ logins: valuesOf(entries.filter(entry => entry.kind === "login")),
88
+ named: valuesOf(plain.filter(entry => !ALL_DIGITS.test(entry.value))),
89
+ };
90
+ }
91
+
63
92
  /**
64
93
  * The string or number values of `keys` on `value`, as strings.
65
94
  * @param {unknown} value - Object to read
@@ -148,11 +177,12 @@ function questionIndex(rows, managerCommentIds, authorOf) {
148
177
  * reported in `refused`, never returned: returning it made every later cycle
149
178
  * pick the same reply and fail on it again, so a corrected reply posted after
150
179
  * it was never read (CodySwannGT/lisa#4571).
151
- * @param {{comments: unknown, allowed: readonly string[],
180
+ * @param {{comments: unknown, allowed: readonly (string|number)[],
152
181
  * managerCommentIds?: readonly (string|number)[],
153
182
  * refuses?: (text: string) => string | null | undefined}} input - The
154
- * item's comments, the answerer ids, the ids the manager posted, and why a
155
- * reply's text may not be queued (null when it may)
183
+ * item's comments, the answerer entries (plain, `login:` or `id:`), the
184
+ * ids the manager posted, and why a reply's text may not be queued (null
185
+ * when it may)
156
186
  * @returns {{answer: {text: string, author: string, at: string|null} | null,
157
187
  * reason: string, refused?: {id: string|null, author: string, why: string}[]}}
158
188
  * The answer, or null with why there is none, and (only when any were)
@@ -168,13 +198,12 @@ export function pickItemAnswer({
168
198
  throw new Error('stdin must be JSON {"comments":[...]}');
169
199
  }
170
200
  const rows = comments.filter(row => row && typeof row === "object");
171
- const allow = allowed.map(String);
172
- const numeric = new Set(allow.filter(id => ALL_DIGITS.test(id)));
173
- const named = new Set(allow.filter(id => !ALL_DIGITS.test(id)));
201
+ const { ids, logins, named } = answererSets(allowed);
174
202
  const authorOf = row => {
175
203
  const author = row.author ?? row.user;
176
204
  return (
177
- idsOf(author, NUMERIC_ID_KEYS).find(id => numeric.has(id)) ??
205
+ idsOf(author, NUMERIC_ID_KEYS).find(id => ids.has(id)) ??
206
+ idsOf(author, LOGIN_KEYS).find(login => logins.has(login)) ??
178
207
  idsOf(author, STABLE_ID_KEYS).find(id => named.has(id))
179
208
  );
180
209
  };
@@ -68,7 +68,10 @@ writes `$SM`, and pass `--project-root "$ROOT"` (the absolute project root) on e
68
68
  set `sessionManager.trustedAuthorIds`. Without it, any author's Ready item reaches a
69
69
  bypass-permissions worker; say so plainly. The list holds stable tracker user ids as strings,
70
70
  never logins: the GitHub numeric user id (`gh api users/<login> --jq .id`), the Jira
71
- `accountId`, or the Linear user id. A login matches no one and silently excludes every item.
71
+ `accountId`, or the Linear user id. A plain login matches no one in the queue and silently
72
+ excludes every item; to trust a GitHub login on purpose write it as `login:<login>`, and to say
73
+ outright that an entry is an id write `id:<id>`. A login GitHub frees (after a rename or a
74
+ deleted account) can be re-registered by someone else, so prefer `id:` for trust.
72
75
  4. Set `sessionManager.operatorIds` to a non-empty **array** holding the operator's own tracker
73
76
  user id, e.g. `"operatorIds": ["<operator-id>"]` (a bare string fails `validate`). Look up the
74
77
  OPERATOR, not the credential: `gh api user` / `viewer.id` return whoever the tracker credential
@@ -81,6 +84,13 @@ writes `$SM`, and pass `--project-root "$ROOT"` (the absolute project root) on e
81
84
  "me", spelled as the tracker API returns it: the GitHub **login** (`gh api users/<login> --jq
82
85
  .login`), the Jira `accountId`, or the Linear user id (the operator's entry in the team's member
83
86
  list, or `viewer.id` only when the operator runs the lookup with their own credential).
87
+ **Prefer the kind-keyed form**, which every reader (the queue, the claim and answers on the
88
+ item) matches the same way: `"login:<github-login>"` on GitHub, `"id:<accountId or user id>"` on
89
+ Jira and Linear. A plain entry still works as before, but a plain **all-digit** GitHub login is
90
+ read as a login by the queue and as a numeric id by the answer matcher, so the operator could
91
+ not answer on the item and the unrelated account whose numeric id equals it could; `validate`
92
+ warns about it (in `warnings`, never failing) and names both forms. An unknown prefix
93
+ (`user:octocat`) or an empty value (`login:`) fails `validate`, naming the entry.
84
94
  **Recommend setting it in every setup**, even a single-user one: it is also who may answer a
85
95
  human-needed question by replying on the item. With neither `operatorIds` nor
86
96
  `trustedAuthorIds` set, the manager reads no answer off the item at all, because the tracker
@@ -91,10 +101,13 @@ writes `$SM`, and pass `--project-root "$ROOT"` (the absolute project root) on e
91
101
  is exhausted and a worker slot is still free, the manager then looks at backlog items (open
92
102
  leaves in no lifecycle role) that nobody else is assigned to, that are not human-held and have
93
103
  no unfinished blocker. Each one that passes the full tracker validation, including the
94
- stateless-pickup check, is assigned to the first `operatorIds` entry, moved to Ready and
104
+ stateless-pickup check, is assigned to the first `operatorIds` entry (its bare login or id,
105
+ without the `login:` / `id:` prefix), moved to Ready and
95
106
  dispatched. Say plainly that this lets the manager start work nobody marked Ready, so it needs
96
107
  `operatorIds` and should go with `trustedAuthorIds` on any tracker outsiders can write to.
97
108
  6. `node "$SM/session-manager.mjs" validate --project-root "$ROOT"` must print `valid: true`.
109
+ Show the operator every entry of `warnings`, when there is one, in plain words, and offer to
110
+ rewrite a plain all-digit operator entry in the `login:` / `id:` form it names.
98
111
 
99
112
  ## Step 3: Store the bot token
100
113
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.97.2",
3
+ "version": "4.97.3",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Kind-keyed identity entries for `sessionManager.operatorIds` and
3
+ * `sessionManager.trustedAuthorIds` (CodySwannGT/lisa#4623).
4
+ *
5
+ * ## Why this exists
6
+ *
7
+ * One plain config value used to mean two identities. An all-digit entry was
8
+ * a numeric account id to the answer matcher (#4571: anyone can register an
9
+ * all-digit login, nobody picks their own numeric id) but a login to the
10
+ * Ready-queue order and the claim. So an operator whose GitHub login is all
11
+ * digits could not answer on the item, and the stranger whose numeric id
12
+ * equals that login could; switching the entry to the numeric id fixed the
13
+ * answers and broke the queue. A kind-keyed entry names one identity, and
14
+ * every reader matches it the same way:
15
+ *
16
+ * - `login:<v>` is a GitHub login and matches only a `login` field.
17
+ * - `id:<v>` is an account id (a GitHub numeric id, a Jira accountId, a
18
+ * Linear user id) and matches only an id field.
19
+ * - A plain entry (no prefix) keeps exactly the meaning each reader gave it
20
+ * before kind-keyed entries existed. Changing that is a later, breaking
21
+ * change.
22
+ *
23
+ * ## The prefix rule
24
+ *
25
+ * A prefix is one run of ASCII letters followed by `:` at the very start.
26
+ * Jira accountIds can hold a colon (`557058:<uuid>`), but their part before
27
+ * it is digits, so they stay plain. Jira Service Management portal customers
28
+ * have accountIds that start with letters (`qm:<id>`); `qm` is therefore not
29
+ * a prefix and such an id stays plain too. Any other letters-and-colon start
30
+ * is an unknown prefix, and an entry whose prefix is followed by nothing is
31
+ * an empty value. Both are invalid: a reader matches them against nobody and
32
+ * `validate-config.mjs` refuses them, naming the entry.
33
+ *
34
+ * The validator ships as a standalone payload script and keeps its own copy
35
+ * of this grammar; `tests/unit/scripts/operator-id-kinds.test.ts` pins the
36
+ * two together on a table of entries.
37
+ * @module operator-id-kinds
38
+ */
39
+
40
+ /** The kinds a prefixed entry may name. */
41
+ export const ID_ENTRY_KINDS = Object.freeze(["login", "id"]);
42
+
43
+ /** A letters-only prefix at the start of an entry. */
44
+ const PREFIX = /^([A-Za-z]+):/;
45
+
46
+ /**
47
+ * Letters-and-colon starts that belong to a real tracker id, never a prefix:
48
+ * Jira Service Management portal customers' accountIds start `qm:`.
49
+ */
50
+ const PLAIN_ID_STARTS = new Set(["qm"]);
51
+
52
+ /**
53
+ * @typedef {{ kind: "login" | "id" | "plain", value: string }
54
+ * | { kind: "invalid", problem: "unknown-prefix" | "empty-value", prefix: string }} IdEntry
55
+ */
56
+
57
+ /**
58
+ * Parse one entry. A number (a hand-written numeric id) reads as its string,
59
+ * exactly as the readers have always taken it.
60
+ * @param {unknown} entry - One `operatorIds` / `trustedAuthorIds` entry
61
+ * @returns {IdEntry | null} The parsed entry; null for a non-string,
62
+ * non-number value
63
+ */
64
+ export function parseIdEntry(entry) {
65
+ if (typeof entry === "number") return { kind: "plain", value: String(entry) };
66
+ if (typeof entry !== "string") return null;
67
+ const prefix = PREFIX.exec(entry)?.[1];
68
+ if (prefix === undefined || PLAIN_ID_STARTS.has(prefix)) {
69
+ return { kind: "plain", value: entry };
70
+ }
71
+ if (!ID_ENTRY_KINDS.includes(prefix)) {
72
+ return { kind: "invalid", problem: "unknown-prefix", prefix };
73
+ }
74
+ const value = entry.slice(prefix.length + 1).trim();
75
+ return value === ""
76
+ ? { kind: "invalid", problem: "empty-value", prefix }
77
+ : { kind: prefix, value };
78
+ }
79
+
80
+ /**
81
+ * Parse a configured list, dropping values that are not entries at all.
82
+ * @param {unknown} entries - The configured list
83
+ * @returns {IdEntry[]} Parsed entries, invalid ones kept so a reader can
84
+ * count them (an invalid trusted entry still means a filter is set)
85
+ */
86
+ export function parseIdEntries(entries) {
87
+ return (Array.isArray(entries) ? entries : [])
88
+ .map(parseIdEntry)
89
+ .filter(entry => entry !== null);
90
+ }
91
+
92
+ /**
93
+ * Whether one parsed entry names the identity whose fields are given. Each
94
+ * field is the reader's value for that kind: `plain` is what a plain entry
95
+ * has always been compared with there, `login` the GitHub login (null when
96
+ * the tracker has none), `id` the account id. A missing field never matches.
97
+ * @param {IdEntry} entry - Parsed entry
98
+ * @param {{ plain?: string | null, login?: string | null, id?: string | null }} fields
99
+ * @returns {boolean} Whether it matches
100
+ */
101
+ export function entryMatches(entry, fields) {
102
+ if (entry.kind === "invalid") return false;
103
+ const actual = fields[entry.kind];
104
+ return typeof actual === "string" && actual !== "" && actual === entry.value;
105
+ }
106
+
107
+ /**
108
+ * The values an id-only comparator may hold, for a reader that compares
109
+ * account ids and nothing else (the hold-release check in
110
+ * `intake-blocker-reprobe.mjs`): plain entries as written and `id:` values.
111
+ * A `login:` entry names a login, which such a reader never sees, so it is
112
+ * dropped rather than compared with an id it could collide with.
113
+ * @param {unknown} entries - The configured list
114
+ * @returns {string[]} Values to compare as ids
115
+ */
116
+ export function idComparableValues(entries) {
117
+ return parseIdEntries(entries)
118
+ .filter(entry => entry.kind === "plain" || entry.kind === "id")
119
+ .map(entry => entry.value);
120
+ }
@@ -27,6 +27,13 @@
27
27
  * {@link assertPagedToCompletion} refuses to order a half-read queue, because
28
28
  * a truncated sweep silently reorders by omission (#3529, #4105).
29
29
  *
30
+ * Operator and trusted-author entries may be kind-keyed (#4623): `login:<v>`
31
+ * matches only a GitHub login, `id:<v>` only an account id, and a plain entry
32
+ * is compared exactly as before (with the normalized assignee id, or the
33
+ * normalized author id). Each normalizer therefore also carries the login and
34
+ * the account id of the assignee and the login of the author, where its
35
+ * tracker has them, so the kinds never have to be guessed.
36
+ *
30
37
  * Held items are judged by {@link isHumanGated}, the one shared answer to "is
31
38
  * a person holding this?", rather than by a local label check (#3805).
32
39
  *
@@ -42,6 +49,7 @@ import {
42
49
  DEFAULT_HUMAN_NEEDED_LABEL,
43
50
  isHumanGated,
44
51
  } from "./intake-blocker-reprobe.mjs";
52
+ import { entryMatches, parseIdEntries } from "./operator-id-kinds.mjs";
45
53
 
46
54
  /** Rank for GitHub `priority:<value>` labels; no label ranks 4. */
47
55
  const GITHUB_PRIORITY_RANKS = Object.freeze({
@@ -187,13 +195,18 @@ export function normalizeGithubIssue(issue, options = {}) {
187
195
  title: text(issue.title),
188
196
  // GitHub "me" is the login (`gh api user --jq .login`), so match on it.
189
197
  assigneeId: idOrNull(assignee?.login),
198
+ assigneeLogin: idOrNull(assignee?.login),
199
+ assigneeAccountId: idOrNull(assignee?.id),
190
200
  priorityRank: ranks.length > 0 ? Math.min(...ranks) : GITHUB_NO_PRIORITY,
191
201
  createdAt: text(issue.created_at),
192
202
  updatedAt: text(issue.updated_at),
193
203
  labels,
194
204
  body: text(issue.body),
195
- // Authors are trusted by stable id, never by login (ready-role-filing).
205
+ // Plain and `id:` trusted-author entries trust by stable id (ready-role-
206
+ // filing); a `login:` entry trusts a login the operator opted into
207
+ // explicitly, knowing a freed login can be re-registered (#4623).
196
208
  authorId: idOrNull(issue.user?.id),
209
+ authorLogin: idOrNull(issue.user?.login),
197
210
  isContainer: Number(summary?.total ?? 0) > Number(summary?.completed ?? 0),
198
211
  // `blocked_by` in the dependency summary counts only OPEN blockers.
199
212
  openBlockers: count(issue.issue_dependencies_summary?.blocked_by),
@@ -225,12 +238,15 @@ export function normalizeJiraIssue(issue) {
225
238
  ref: text(issue?.key),
226
239
  title: text(fields.summary),
227
240
  assigneeId: idOrNull(fields.assignee?.accountId),
241
+ assigneeLogin: null,
242
+ assigneeAccountId: idOrNull(fields.assignee?.accountId),
228
243
  priorityRank: JIRA_PRIORITY_RANKS[priority] ?? JIRA_UNKNOWN_PRIORITY,
229
244
  createdAt: text(fields.created),
230
245
  updatedAt: text(fields.updated),
231
246
  labels,
232
247
  body: adfText(fields.description),
233
248
  authorId: idOrNull(fields.reporter?.accountId ?? fields.creator?.accountId),
249
+ authorLogin: null,
234
250
  isContainer:
235
251
  Number(type.hierarchyLevel ?? 0) > 0 ||
236
252
  text(type.name).toLowerCase() === "epic" ||
@@ -265,6 +281,8 @@ export function normalizeLinearIssue(issue) {
265
281
  ref: text(issue?.identifier),
266
282
  title: text(issue?.title),
267
283
  assigneeId: idOrNull(issue?.assignee?.id),
284
+ assigneeLogin: null,
285
+ assigneeAccountId: idOrNull(issue?.assignee?.id),
268
286
  priorityRank:
269
287
  Number.isInteger(native) && native >= 1 && native <= 4
270
288
  ? native - 1
@@ -274,6 +292,7 @@ export function normalizeLinearIssue(issue) {
274
292
  labels,
275
293
  body: text(issue?.description),
276
294
  authorId: idOrNull(issue?.creator?.id),
295
+ authorLogin: null,
277
296
  isContainer: children.some(
278
297
  child => !LINEAR_FINISHED_STATE_TYPES.has(child?.state?.type)
279
298
  ),
@@ -285,32 +304,73 @@ export function normalizeLinearIssue(issue) {
285
304
  * The one item shape every normalizer returns, in a fixed key order.
286
305
  * `updatedAt` keys the backlog tier's validation cache; `openBlockers` counts
287
306
  * dependencies whose blocker is not finished. The Ready tier ignores both.
288
- * @param {{ ref: string, title: string, assigneeId: string | null, priorityRank: number, createdAt: string, updatedAt: string, labels: string[], body: string, authorId: string | null, isContainer: boolean, openBlockers: number }} input
307
+ * `assigneeLogin` / `authorLogin` are GitHub logins (null on trackers with
308
+ * none) and `assigneeAccountId` the assignee's account id, for kind-keyed
309
+ * entries (#4623).
310
+ * @param {{ ref: string, title: string, assigneeId: string | null, assigneeLogin: string | null, assigneeAccountId: string | null, priorityRank: number, createdAt: string, updatedAt: string, labels: string[], body: string, authorId: string | null, authorLogin: string | null, isContainer: boolean, openBlockers: number }} input
289
311
  */
290
312
  function shape(input) {
291
313
  return {
292
314
  ref: input.ref,
293
315
  title: input.title,
294
316
  assigneeId: input.assigneeId,
317
+ assigneeLogin: input.assigneeLogin,
318
+ assigneeAccountId: input.assigneeAccountId,
295
319
  priorityRank: input.priorityRank,
296
320
  createdAt: input.createdAt,
297
321
  updatedAt: input.updatedAt,
298
322
  labels: input.labels,
299
323
  body: input.body,
300
324
  authorId: input.authorId,
325
+ authorLogin: input.authorLogin,
301
326
  isContainer: input.isContainer,
302
327
  openBlockers: input.openBlockers,
303
328
  repoLabels: repoLabelsOf(input.labels),
304
329
  };
305
330
  }
306
331
 
332
+ /**
333
+ * Whether an operator entry names the item's assignee: a plain entry by the
334
+ * normalized assignee id, as before; `login:` by the assignee's GitHub login;
335
+ * `id:` by the assignee's account id.
336
+ * @param {Record<string, any>} item
337
+ * @param {ReturnType<typeof orderingContext>} context
338
+ * @returns {boolean}
339
+ */
340
+ function isOperatorItem(item, context) {
341
+ const fields = {
342
+ plain: idOrNull(item.assigneeId),
343
+ login: idOrNull(item.assigneeLogin),
344
+ id: idOrNull(item.assigneeAccountId),
345
+ };
346
+ return context.operators.some(entry => entryMatches(entry, fields));
347
+ }
348
+
349
+ /**
350
+ * Whether a trusted-author entry names the item's author: a plain entry by
351
+ * the normalized author id, as before; `login:` by the author's GitHub login;
352
+ * `id:` by the author id (a GitHub numeric id, Jira accountId, Linear id).
353
+ * @param {Record<string, any>} item
354
+ * @param {ReturnType<typeof orderingContext>} context
355
+ * @returns {boolean}
356
+ */
357
+ function isTrustedAuthor(item, context) {
358
+ const author = idOrNull(item.authorId);
359
+ const fields = {
360
+ plain: author,
361
+ login: idOrNull(item.authorLogin),
362
+ id: author,
363
+ };
364
+ return context.trusted.some(entry => entryMatches(entry, fields));
365
+ }
366
+
307
367
  /**
308
368
  * Why an item may not be dispatched, or null when it may.
309
369
  *
310
370
  * Order matters only for the reason reported: an item can fail several rules,
311
371
  * and "someone else owns it" is the most useful thing to say about it.
312
372
  * @param {Record<string, any>} item
313
- * @param {{ me: string | null, operators: ReadonlySet<string>, trusted: ReadonlySet<string>, humanNeededLabel: string }} context
373
+ * @param {ReturnType<typeof orderingContext>} context
314
374
  * @returns {string | null}
315
375
  */
316
376
  function exclusionReason(item, context) {
@@ -318,7 +378,7 @@ function exclusionReason(item, context) {
318
378
  if (
319
379
  assignee !== null &&
320
380
  assignee !== context.me &&
321
- !context.operators.has(assignee)
381
+ !isOperatorItem(item, context)
322
382
  ) {
323
383
  return "assigned-to-other";
324
384
  }
@@ -334,10 +394,7 @@ function exclusionReason(item, context) {
334
394
  ) {
335
395
  return "human-gated";
336
396
  }
337
- if (
338
- context.trusted.size > 0 &&
339
- !context.trusted.has(idOrNull(item.authorId))
340
- ) {
397
+ if (context.trusted.length > 0 && !isTrustedAuthor(item, context)) {
341
398
  return "untrusted-author";
342
399
  }
343
400
  return null;
@@ -366,8 +423,10 @@ function compareWithinGroup(left, right) {
366
423
  * `me` and no operators, every assigned item is someone else's — the safe
367
424
  * direction, since claiming assigned work steals it.
368
425
  *
369
- * `operators` match the way `me` does, against the normalized assignee id:
370
- * GitHub login, Jira accountId, Linear user id.
426
+ * A plain `operators` entry matches the way `me` does, against the
427
+ * normalized assignee id: GitHub login, Jira accountId, Linear user id. A
428
+ * `login:` entry matches only a GitHub assignee login, an `id:` entry only
429
+ * the assignee's account id (#4623).
371
430
  * @param {readonly Record<string, any>[]} items - Normalized items
372
431
  * @param {{ me?: string | null, operators?: readonly unknown[], trustedAuthorIds?: readonly unknown[], humanNeededLabel?: string }} [options]
373
432
  * @returns {{ ordered: Record<string, any>[], excluded: { ref: string, reason: string }[] }}
@@ -411,6 +470,23 @@ export function orderBacklogQueue(items, options = {}) {
411
470
  );
412
471
  }
413
472
 
473
+ /**
474
+ * Parsed operator or trusted-author entries. A plain entry is trimmed and a
475
+ * blank one dropped, as before; an invalid kind-keyed entry is kept so it
476
+ * still counts as a configured filter while matching nobody.
477
+ * @param {readonly unknown[] | undefined} entries
478
+ * @returns {import("./operator-id-kinds.mjs").IdEntry[]}
479
+ */
480
+ function configuredEntries(entries) {
481
+ return parseIdEntries(entries)
482
+ .map(entry =>
483
+ entry.kind === "plain"
484
+ ? { ...entry, value: idOrNull(entry.value) }
485
+ : entry
486
+ )
487
+ .filter(entry => entry.kind !== "plain" || entry.value !== null);
488
+ }
489
+
414
490
  /**
415
491
  * The identities and policy every ordering judges against.
416
492
  * @param {{ me?: string | null, operators?: readonly unknown[], trustedAuthorIds?: readonly unknown[], humanNeededLabel?: string }} options
@@ -418,10 +494,8 @@ export function orderBacklogQueue(items, options = {}) {
418
494
  function orderingContext(options) {
419
495
  return {
420
496
  me: idOrNull(options.me),
421
- operators: new Set((options.operators ?? []).map(idOrNull).filter(Boolean)),
422
- trusted: new Set(
423
- (options.trustedAuthorIds ?? []).map(idOrNull).filter(Boolean)
424
- ),
497
+ operators: configuredEntries(options.operators),
498
+ trusted: configuredEntries(options.trustedAuthorIds),
425
499
  humanNeededLabel: options.humanNeededLabel ?? DEFAULT_HUMAN_NEEDED_LABEL,
426
500
  };
427
501
  }
@@ -441,7 +515,7 @@ function rank(items, judge, context) {
441
515
  const group = item => {
442
516
  const assignee = idOrNull(item.assigneeId);
443
517
  if (assignee === null) return 2;
444
- return context.operators.has(assignee) ? 0 : 1;
518
+ return isOperatorItem(item, context) ? 0 : 1;
445
519
  };
446
520
 
447
521
  return {