@codyswann/lisa 8.10.2 → 8.10.4

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 (131) hide show
  1. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  2. package/dist/core/upstream-evidence-manifest.json +29 -9
  3. package/dist/opencode/plugin-templates/task-readiness-guard.mjs +1 -1
  4. package/package.json +4 -4
  5. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  6. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  7. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/preflight-secrets.mjs +21 -1
  8. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-action.mjs +35 -6
  9. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-intake-read.mjs +1 -1
  10. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-tracker-create.mjs +423 -0
  11. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs +72 -14
  12. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-unbound.mjs +13 -3
  13. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-write/SKILL.md +2 -0
  14. package/plugins/lisa/hooks/task-readiness-guard.mjs +1 -1
  15. package/plugins/lisa/rules/reference/tool-access-gate.md +21 -2
  16. package/plugins/lisa/rules/reference/tracked-work.md +4 -1
  17. package/plugins/lisa/skills/lisa-secrets-access/scripts/preflight-secrets.mjs +21 -1
  18. package/plugins/lisa/skills/lisa-secrets-access/scripts/task-action.mjs +35 -6
  19. package/plugins/lisa/skills/lisa-secrets-access/scripts/task-intake-read.mjs +1 -1
  20. package/plugins/lisa/skills/lisa-secrets-access/scripts/task-tracker-create.mjs +423 -0
  21. package/plugins/lisa/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs +72 -14
  22. package/plugins/lisa/skills/lisa-secrets-access/scripts/task-unbound.mjs +13 -3
  23. package/plugins/lisa/skills/lisa-tracker-write/SKILL.md +2 -0
  24. package/plugins/lisa-agy/plugin.json +1 -1
  25. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/preflight-secrets.mjs +21 -1
  26. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-action.mjs +35 -6
  27. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-intake-read.mjs +1 -1
  28. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-tracker-create.mjs +423 -0
  29. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs +72 -14
  30. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-unbound.mjs +13 -3
  31. package/plugins/lisa-agy/skills/lisa-tracker-write/SKILL.md +2 -0
  32. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  35. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  39. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-copilot/hooks/task-readiness-guard.mjs +1 -1
  41. package/plugins/lisa-copilot/rules/reference/tool-access-gate.md +21 -2
  42. package/plugins/lisa-copilot/rules/reference/tracked-work.md +4 -1
  43. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/preflight-secrets.mjs +21 -1
  44. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-action.mjs +35 -6
  45. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-intake-read.mjs +1 -1
  46. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-tracker-create.mjs +423 -0
  47. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs +72 -14
  48. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-unbound.mjs +13 -3
  49. package/plugins/lisa-copilot/skills/lisa-tracker-write/SKILL.md +2 -0
  50. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-cursor/hooks/task-readiness-guard.mjs +1 -1
  52. package/plugins/lisa-cursor/rules/tool-access-gate-reference.mdc +21 -2
  53. package/plugins/lisa-cursor/rules/tracked-work-reference.mdc +4 -1
  54. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/preflight-secrets.mjs +21 -1
  55. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-action.mjs +35 -6
  56. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-intake-read.mjs +1 -1
  57. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-tracker-create.mjs +423 -0
  58. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs +72 -14
  59. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-unbound.mjs +13 -3
  60. package/plugins/lisa-cursor/skills/lisa-tracker-write/SKILL.md +2 -0
  61. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  63. package/plugins/lisa-devin/hooks/task-readiness-guard.mjs +1 -1
  64. package/plugins/lisa-devin/rules/reference/tool-access-gate.md +21 -2
  65. package/plugins/lisa-devin/rules/reference/tracked-work.md +4 -1
  66. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/preflight-secrets.mjs +21 -1
  67. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-action.mjs +35 -6
  68. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-intake-read.mjs +1 -1
  69. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-tracker-create.mjs +423 -0
  70. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs +72 -14
  71. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-unbound.mjs +13 -3
  72. package/plugins/lisa-devin/skills/lisa-tracker-write/SKILL.md +2 -0
  73. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  75. package/plugins/lisa-expo-agy/plugin.json +1 -1
  76. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  80. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  83. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  87. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  89. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  90. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  94. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  95. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  96. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  97. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  101. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  103. package/plugins/lisa-rails-agy/plugin.json +1 -1
  104. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  108. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  110. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  111. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  115. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  116. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  117. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  118. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  120. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  121. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  122. package/plugins/src/base/hooks/task-readiness-guard.mjs +1 -1
  123. package/plugins/src/base/rules/reference/tool-access-gate.md +21 -2
  124. package/plugins/src/base/rules/reference/tracked-work.md +4 -1
  125. package/plugins/src/base/skills/lisa-secrets-access/scripts/preflight-secrets.mjs +21 -1
  126. package/plugins/src/base/skills/lisa-secrets-access/scripts/task-action.mjs +35 -6
  127. package/plugins/src/base/skills/lisa-secrets-access/scripts/task-intake-read.mjs +1 -1
  128. package/plugins/src/base/skills/lisa-secrets-access/scripts/task-tracker-create.mjs +423 -0
  129. package/plugins/src/base/skills/lisa-secrets-access/scripts/task-tracker-intake.mjs +72 -14
  130. package/plugins/src/base/skills/lisa-secrets-access/scripts/task-unbound.mjs +13 -3
  131. package/plugins/src/base/skills/lisa-tracker-write/SKILL.md +2 -0
@@ -235,6 +235,42 @@ function response(raw) {
235
235
  }
236
236
  }
237
237
 
238
+ /**
239
+ * One GraphQL request through the Linear owner's adapter, identity-matched to
240
+ * the configured workspace and team. The key never enters this process's argv.
241
+ * @param {object} cfg Task configuration.
242
+ * @param {string} query GraphQL document.
243
+ * @param {object} variables GraphQL variables.
244
+ * @returns {object} The parsed response body.
245
+ */
246
+ export function linearRequest(cfg, query, variables) {
247
+ const { workspace, teamKey } = cfg.effective.linear ?? {};
248
+ if (
249
+ typeof workspace !== "string" ||
250
+ !/^[A-Za-z0-9-]+$/u.test(workspace) ||
251
+ typeof teamKey !== "string" ||
252
+ !/^[A-Z][A-Z0-9]*$/u.test(teamKey)
253
+ )
254
+ throw new AccessFailure("config-invalid");
255
+ const raw = transportFor(cfg)(
256
+ "bash",
257
+ [
258
+ linearAdapter,
259
+ "--workspace",
260
+ workspace,
261
+ "--team-key",
262
+ teamKey,
263
+ "--query-file",
264
+ "-",
265
+ "--variables",
266
+ JSON.stringify(variables),
267
+ ],
268
+ query,
269
+ { 3: "credential-missing", 4: "identity-mismatch" }
270
+ );
271
+ return response(raw);
272
+ }
273
+
238
274
  function readLinear(cfg, { ref, project, operation }) {
239
275
  const workspace = cfg.effective.linear.workspace;
240
276
  if (typeof workspace !== "string" || !/^[A-Za-z0-9-]+$/u.test(workspace))
@@ -282,18 +318,21 @@ function readLinear(cfg, { ref, project, operation }) {
282
318
  throw new AccessFailure("capability-unreachable");
283
319
  }
284
320
 
285
- function readJira(cfg, request) {
286
- const { ref, project, operation } = request;
287
- const { cloudId, email, site } = cfg.effective.atlassian ?? {};
321
+ /**
322
+ * The configured Jira REST client, identity-matched against `/myself`.
323
+ * @param {object} cfg Task configuration.
324
+ * @returns {{call: Function} | {unavailable: string}} A client, or why the
325
+ * API token path is unavailable (`config-invalid` or a credential code).
326
+ */
327
+ export function jiraApi(cfg) {
328
+ const { cloudId, email } = cfg.effective.atlassian ?? {};
288
329
  if (
289
330
  typeof cloudId !== "string" ||
290
331
  !/^[A-Za-z0-9-]+$/u.test(cloudId) ||
291
332
  typeof email !== "string" ||
292
333
  !/^[^\s:@]+@[^\s:@]+$/u.test(email)
293
- ) {
294
- if (site) return readJiraWithAcli(cfg, request);
295
- throw new AccessFailure("config-invalid");
296
- }
334
+ )
335
+ return { unavailable: "config-invalid" };
297
336
  const key = `ATLASSIAN_API_TOKEN_${email.toLowerCase().replaceAll(/[.@]/gu, "_")}`;
298
337
  const env = process.env.ATLASSIAN_API_TOKEN?.trim()
299
338
  ? process.env
@@ -302,16 +341,14 @@ function readJira(cfg, request) {
302
341
  ATLASSIAN_API_TOKEN: process.env[key],
303
342
  };
304
343
  const credential = jiraCredential(cfg, env);
305
- if (!credential.available) {
306
- if (!site) throw new AccessFailure(credential.code);
307
- return readJiraWithAcli(cfg, request);
308
- }
344
+ if (!credential.available) return { unavailable: credential.code };
309
345
  const encoded = Buffer.from(`${email}:${credential.value}`).toString(
310
346
  "base64"
311
347
  );
312
348
  const base = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3`;
313
349
  const transport = transportFor(cfg);
314
- const get = endpoint => {
350
+ // A payload is not secret, so it travels in argv; the credential never does.
351
+ const call = (endpoint, method = "GET", payload) => {
315
352
  const raw = transport(
316
353
  "curl",
317
354
  [
@@ -325,16 +362,37 @@ function readJira(cfg, request) {
325
362
  "@-",
326
363
  "--header",
327
364
  "Accept: application/json",
365
+ ...(method === "GET"
366
+ ? []
367
+ : [
368
+ "--request",
369
+ method,
370
+ "--header",
371
+ "Content-Type: application/json",
372
+ "--data-binary",
373
+ JSON.stringify(payload),
374
+ ]),
328
375
  `${base}${endpoint}`,
329
376
  ],
330
377
  `Authorization: Basic ${encoded}\n`
331
378
  );
332
379
  if (raw.includes(credential.value) || raw.includes(encoded))
333
380
  throw new AccessFailure("capability-unreachable");
334
- return response(raw);
381
+ return raw.trim() === "" ? null : response(raw);
335
382
  };
336
- if (get("/myself")?.emailAddress?.toLowerCase() !== email.toLowerCase())
383
+ if (call("/myself")?.emailAddress?.toLowerCase() !== email.toLowerCase())
337
384
  throw new AccessFailure("identity-mismatch");
385
+ return { call };
386
+ }
387
+
388
+ function readJira(cfg, request) {
389
+ const { ref, project, operation } = request;
390
+ const api = jiraApi(cfg);
391
+ if (api.unavailable) {
392
+ if (cfg.effective.atlassian?.site) return readJiraWithAcli(cfg, request);
393
+ throw new AccessFailure(api.unavailable);
394
+ }
395
+ const get = api.call;
338
396
  const endpoint = `/issue/${ref}`;
339
397
  const issue = get(`${endpoint}?fields=*all`);
340
398
  if (issue?.key !== ref || issue.fields?.project?.key !== project)
@@ -150,6 +150,16 @@ export function unboundWrite(input, cfg) {
150
150
  );
151
151
  }
152
152
 
153
+ /**
154
+ * This installation's prepare/read owner script as one shell word.
155
+ * @returns {string} The path, quoted only when it needs to be.
156
+ */
157
+ function ownerWord() {
158
+ return /^[\w./@+-]+$/.test(owner)
159
+ ? owner
160
+ : `'${owner.replaceAll("'", "'\\''")}'`;
161
+ }
162
+
153
163
  /**
154
164
  * The exact read command this installation admits with no work item bound.
155
165
  * @param {Record<string, any>} cfg Task configuration.
@@ -157,9 +167,7 @@ export function unboundWrite(input, cfg) {
157
167
  */
158
168
  function readCommand(cfg) {
159
169
  const c = cfg.effective ?? {};
160
- const script = /^[\w./@+-]+$/.test(owner)
161
- ? owner
162
- : `'${owner.replaceAll("'", "'\\''")}'`;
170
+ const script = ownerWord();
163
171
  if (c.tracker === "linear" && c.linear?.teamKey)
164
172
  return `node ${script} --tracker-intake-read --ref ${c.linear.teamKey}-<number> --read issue`;
165
173
  if (c.tracker === "jira" && c.jira?.project)
@@ -192,6 +200,8 @@ export function unboundRefusal(cfg) {
192
200
  : "",
193
201
  "A file written outside every git repository, such as a scratch or memory file, is allowed.",
194
202
  "To change anything in this project, bind its ticket first with lisa-track.",
203
+ `Its prepare step needs no shell input: write the prepare JSON to a file outside every repository, then run exactly: node ${ownerWord()} --prepare --ref <ticket> --input-file <absolute path of that file>.`,
204
+ `If the work has no ticket yet, file one the same way: write {"title", "body", "labels", "readiness"} to a file outside every repository, then run exactly: node ${ownerWord()} --tracker-create --input-file <absolute path of that file>.`,
195
205
  ]
196
206
  .filter(Boolean)
197
207
  .join(" "),
@@ -41,6 +41,8 @@ See the `config-resolution` rule for the full configuration schema and skill-map
41
41
  - **3b (github):** Invoke `lisa-github-write-issue` via the Skill tool, passing `$ARGUMENTS` verbatim.
42
42
  - **3c (linear):** Invoke `lisa-linear-write-issue` via the Skill tool, passing `$ARGUMENTS` verbatim.
43
43
 
44
+ **No ticket bound yet.** In a project with `.lisa.config.json`, the readiness guard refuses every tracker write until a ticket is bound, so the vendor writer cannot run its own create command. For a CREATE in that state, the vendor writer still drafts and validates the item, then files it through the one admitted command instead: write `{"title", "body", "labels", "readiness"}` (`readiness`: `build-ready`, `human-gate` or `container`; Jira also takes `issue_type`) to a file outside every git repository and run exactly `node <owner>/preflight-secrets.mjs --tracker-create --input-file <absolute path>`, where `<owner>` is the path the guard's `work-item-unbound` refusal names. It prints `{"code":"tracker-created","ref","url"}`; continue with that ref (verify, claim, prepare and bind). See `tool-access-gate`.
45
+
44
46
  4. **Surface the vendor skill's output unchanged.** Do not paraphrase; downstream callers parse the structured response.
45
47
 
46
48
  ## Rules
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "8.10.2",
3
+ "version": "8.10.4",
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": "8.10.2",
3
+ "version": "8.10.4",
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": "8.10.2",
3
+ "version": "8.10.4",
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": "8.10.2",
3
+ "version": "8.10.4",
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": "8.10.2",
3
+ "version": "8.10.4",
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": "8.10.2",
3
+ "version": "8.10.4",
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": "8.10.2",
3
+ "version": "8.10.4",
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": "8.10.2",
3
+ "version": "8.10.4",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -76,7 +76,7 @@ try {
76
76
  } else if (result.status !== 0) {
77
77
  // Only the fixed owner result is published. Environment errors never echo.
78
78
  const safe =
79
- /^(?:credential-missing|provider-unreachable|capability-unreachable|bootstrap-missing|tool-missing|config-invalid|config-unreadable|config-undiscovered|config-unknown|identity-mismatch|adapter-unsupported|requirements-stale|requirements-prepared|native-proof-needed|native-response-unrepresented): [^\n]*\n?$/.test(
79
+ /^(?:credential-missing|provider-unreachable|capability-unreachable|bootstrap-missing|tool-missing|config-invalid|config-unreadable|config-undiscovered|config-unknown|identity-mismatch|adapter-unsupported|requirements-stale|work-item-unbound|requirements-prepared|native-proof-needed|native-response-unrepresented): [^\n]*\n?$/.test(
80
80
  result.stderr ?? ""
81
81
  );
82
82
  console.error(
@@ -23,11 +23,29 @@ the resolver or read its inputs.
23
23
 
24
24
  Supply a complete values-free `required_access` array and
25
25
  `requirements_complete: true` as JSON on stdin to the owner's
26
- `--prepare --ref <canonical-ref>` mode. For the first context, include the complete
26
+ `--prepare --ref <canonical-ref>` mode. An agent's shell tool has no stdin:
27
+ write the same JSON to a file outside every git repository (such a write is
28
+ admitted with no ticket bound) and run exactly
29
+ `node <owner>/preflight-secrets.mjs --prepare --ref <canonical-ref> --input-file <absolute path>`.
30
+ The path is one plain word; nothing may follow it. For the first context, include the complete
27
31
  unedited `context_body` on that same stdin; it creates
28
32
  only the fixed ignored0600 context after Git-ignore and EAS checks. Existing
29
33
  context cannot be replaced through `context_body`. This is the bounded initial
30
34
  resolver metadata transaction, not a general Write or shell exception.
35
+
36
+ With no ticket bound, the same owner files the ticket the work needs. Write
37
+ `{"title", "body", "labels", "readiness", "issue_type"}` (labels and
38
+ issue_type optional) to a file outside every git repository and run exactly
39
+ `node <owner>/preflight-secrets.mjs --tracker-create --input-file <absolute path>`.
40
+ `readiness` is `build-ready`, `human-gate` or `container`, and the body must
41
+ agree with it: a `human-gate` body declares the `[lisa-human-gate]` hold, and a
42
+ `container` body carries `None — container: state rolls up from children` and
43
+ no leaf type. Anything else is refused with `tracker-create-refused` and nothing
44
+ is filed. The owner files only into the configured repository, team or project;
45
+ for `build-ready` it applies the configured ready label or state itself. It
46
+ prints `{"code":"tracker-created","ref","url"}`. It is the transport only: the
47
+ writer's validation gates still run before it, and every other tracker write
48
+ stays refused until a ticket is bound.
31
49
  For the native Claude `Write` tool, pass the complete canonical context as
32
50
  `{file_path: "<absolute project root>/.lisa/work-item-context.md", content: "<leading requirements header plus full body>"}`.
33
51
  Use the header schema above with current root/ref/config/surface/body/requirements
@@ -92,7 +110,8 @@ reflect requirement identifiers/resources/paths, parse errors or provider output
92
110
  Do not block unrelated tasks or require optional integrations universally.
93
111
 
94
112
  The exact readiness owner command (`node <owner>/preflight-secrets.mjs --task
95
- --ref <canonical-ref>`, or `--prepare` with that ref and JSON on terminal stdin)
113
+ --ref <canonical-ref>`, or `--prepare` with that ref and JSON on terminal stdin
114
+ or in an `--input-file` outside every repository)
96
115
  remains available during refusal. It grants no work: task mode still reports its
97
116
  real verdict, and preparation only refreshes the ignored requirements metadata.
98
117
  Only the exact native context Write/Add File forms above carry private metadata.
@@ -10,10 +10,13 @@ In a project with `.lisa.config.json`, the task-readiness guard enforces this. W
10
10
 
11
11
  - the Read, Grep and Glob tools;
12
12
  - the fixed ticket read commands. The refusal names the exact one for that installation: `preflight-secrets.mjs --tracker-intake-read --ref <KEY> --read issue|comments` for Linear and Jira, `gh issue view <n> --repo <org>/<repo> --json …` for GitHub;
13
- - a write that lands in no git repository, such as a scratch or memory file.
13
+ - a write that lands in no git repository, such as a scratch or memory file;
14
+ - filing the ticket the work needs: `preflight-secrets.mjs --tracker-create --input-file <absolute path>`, which files into the configured tracker only and refuses a filing with no readiness declaration (see `tool-access-gate`).
14
15
 
15
16
  Answering a question about a ticket needs none of this. Never bind a ticket just to read one.
16
17
 
18
+ To start work on an existing ticket from an unbound session, prepare it first, then bind it. Write the prepare JSON to a file outside every repository, then run the admitted `preflight-secrets.mjs --prepare --ref <ticket> --input-file <absolute path>` (see `tool-access-gate`). Once the ticket is prepared, the guard decides by that ticket's readiness, and `lisa-work-item.mjs link`, the claim and the work run normally.
19
+
17
20
  ## Resolve, claim, bind
18
21
 
19
22
  Use `lisa-track` as the single entry point:
@@ -42,6 +42,7 @@ import { failure } from "./task-readiness.mjs";
42
42
  import { runTaskAction } from "./task-action.mjs";
43
43
  import { AccessFailure } from "./config-layers.mjs";
44
44
  import { prepareRequirements } from "./task-requirements.mjs";
45
+ import { outsideEveryRepository } from "./task-unbound.mjs";
45
46
  import { runIntakeRead } from "./task-intake-read.mjs";
46
47
  import { runTrackerIntakeRead } from "./task-tracker-intake.mjs";
47
48
  export { taskReadiness, credentialAvailability } from "./task-readiness.mjs";
@@ -364,10 +365,29 @@ function main() {
364
365
  runIntakeRead();
365
366
  return;
366
367
  }
368
+ if (process.argv.includes("--tracker-create")) {
369
+ // Loaded on demand: it reaches into sibling skills and the plugin's
370
+ // scripts, and a missing file there must never break this module's hooks.
371
+ import("./task-tracker-create.mjs").then(
372
+ module => module.runTrackerCreate(),
373
+ () => {
374
+ const result = failure("tool-missing");
375
+ console.error(`${result.code}: ${result.action}`);
376
+ process.exitCode = 2;
377
+ }
378
+ );
379
+ return;
380
+ }
367
381
  if (process.argv.includes("--prepare")) {
368
382
  const cfg = readTaskConfig();
369
383
  const index = process.argv.indexOf("--ref");
370
- const input = JSON.parse(readFileSync(0, "utf8"));
384
+ const fileIndex = process.argv.indexOf("--input-file");
385
+ // An agent's shell tool has no stdin. It writes the JSON to a file outside
386
+ // every repository (admitted while unbound) and names it here instead.
387
+ const file = fileIndex >= 0 ? process.argv[fileIndex + 1] : undefined;
388
+ if (fileIndex >= 0 && !outsideEveryRepository(file, cfg.projectRoot))
389
+ throw new AccessFailure("requirements-stale");
390
+ const input = JSON.parse(readFileSync(fileIndex >= 0 ? file : 0, "utf8"));
371
391
  console.log(
372
392
  JSON.stringify(
373
393
  prepareRequirements(
@@ -9,7 +9,11 @@ import { readTaskRequirements } from "./task-requirements.mjs";
9
9
  import { lifecycleEvents, resetNativeEvent } from "./task-native-lifecycle.mjs";
10
10
  import { intakeRead } from "./task-intake.mjs";
11
11
  import { nativeContext } from "./task-native-context.mjs";
12
- import { unboundRefusal, unboundWrite } from "./task-unbound.mjs";
12
+ import {
13
+ outsideEveryRepository,
14
+ unboundRefusal,
15
+ unboundWrite,
16
+ } from "./task-unbound.mjs";
13
17
  import {
14
18
  linearIntakeRead,
15
19
  observeLinearIntake,
@@ -26,17 +30,42 @@ const owner = join(
26
30
  const refs = /^(?:[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+#\d+|[A-Z][A-Z0-9]+-\d+)$/;
27
31
  const quote = path => `'${path.replaceAll("'", "'\\''")}'`;
28
32
 
29
- /** Exact canonical recovery command. JSON uses structured child/terminal stdin, not redirects. */
30
- export function readinessOwnerInvocation(command) {
33
+ /** A file path that a shell reads as exactly one plain word. */
34
+ const plainPath = /^\/[A-Za-z0-9_./@+-]+$/;
35
+
36
+ /**
37
+ * Exact canonical recovery command. JSON uses structured child/terminal
38
+ * stdin, or a file outside every repository that an agent's shell tool can
39
+ * name, since it has no stdin to supply.
40
+ * @param {unknown} command Shell command text.
41
+ * @param {string} [root] Project root, for the input file's location check.
42
+ * @returns {boolean} True for an exact recovery command.
43
+ */
44
+ export function readinessOwnerInvocation(command, root = process.cwd()) {
31
45
  if (typeof command !== "string") return false;
32
46
  for (const runtime of ["node", process.execPath, quote(process.execPath)])
33
47
  for (const script of [owner, quote(owner)]) {
34
48
  if (command === `${runtime} ${script} --task`) return true;
49
+ // Filing the ticket the work needs is tracker bookkeeping; the owner
50
+ // files only into the configured tracker and enforces readiness itself.
51
+ const create = `${runtime} ${script} --tracker-create --input-file `;
52
+ if (command.startsWith(create)) {
53
+ const file = command.slice(create.length);
54
+ return plainPath.test(file) && outsideEveryRepository(file, root);
55
+ }
35
56
  for (const mode of ["task", "prepare"]) {
36
57
  const prefix = `${runtime} ${script} --${mode} --ref `;
58
+ if (!command.startsWith(prefix)) continue;
59
+ const rest = command.slice(prefix.length);
60
+ if (refs.test(rest)) return true;
61
+ const [ref, flag, file, ...extra] = rest.split(" ");
37
62
  if (
38
- command.startsWith(prefix) &&
39
- refs.test(command.slice(prefix.length))
63
+ mode === "prepare" &&
64
+ refs.test(ref) &&
65
+ flag === "--input-file" &&
66
+ extra.length === 0 &&
67
+ plainPath.test(file ?? "") &&
68
+ outsideEveryRepository(file, root)
40
69
  )
41
70
  return true;
42
71
  }
@@ -52,7 +81,7 @@ function orientation(input) {
52
81
  return true;
53
82
  if (input?.tool_name !== "Bash") return false;
54
83
  return (
55
- readinessOwnerInvocation(input.tool_input?.command) ||
84
+ readinessOwnerInvocation(input.tool_input?.command, input.cwd) ||
56
85
  [
57
86
  "pwd",
58
87
  "ls -la",
@@ -93,7 +93,7 @@ function requireThreadRepository(value, repo) {
93
93
  throw new AccessFailure("identity-mismatch");
94
94
  }
95
95
  /** Probe native first; only genuine unavailability may select the supported fallback. */
96
- function selectedAccess(cfg, repo) {
96
+ export function selectedAccess(cfg, repo) {
97
97
  const requirement = { operation: "repository-read", resource: repo };
98
98
  const native = githubAccess(cfg, requirement, undefined, { intake: true });
99
99
  if (native.code === "identity-mismatch" || native.code === "tool-missing")