@codyswann/lisa 8.10.0 → 8.10.1
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.
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.json +17 -5
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-jira-read-ticket/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-linear-read-issue/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
- package/plugins/lisa/rules/reference/tracked-work.md +8 -0
- package/plugins/lisa/skills/lisa-jira-read-ticket/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-linear-read-issue/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
- package/plugins/lisa/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
- package/plugins/lisa/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-jira-read-ticket/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-linear-read-issue/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/rules/reference/tracked-work.md +8 -0
- package/plugins/lisa-copilot/skills/lisa-jira-read-ticket/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-linear-read-issue/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/rules/tracked-work-reference.mdc +8 -0
- package/plugins/lisa-cursor/skills/lisa-jira-read-ticket/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-linear-read-issue/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/rules/reference/tracked-work.md +8 -0
- package/plugins/lisa-devin/skills/lisa-jira-read-ticket/SKILL.md +2 -0
- package/plugins/lisa-devin/skills/lisa-linear-read-issue/SKILL.md +2 -0
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/rules/reference/tracked-work.md +8 -0
- package/plugins/src/base/skills/lisa-jira-read-ticket/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-linear-read-issue/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-secrets-access/scripts/task-action.mjs +3 -1
- package/plugins/src/base/skills/lisa-secrets-access/scripts/task-context-write.mjs +40 -9
- package/plugins/src/base/skills/lisa-secrets-access/scripts/task-unbound.mjs +169 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a session with no work item bound may still do, and what it is told.
|
|
3
|
+
*
|
|
4
|
+
* With no binding and no prepared context there is no task whose access could
|
|
5
|
+
* be proved, so the guard refuses project work. Two things are not project
|
|
6
|
+
* work and stay possible: reading (the fixed read commands the guard already
|
|
7
|
+
* admits), and writing a file that lands in no git repository at all, such as
|
|
8
|
+
* an agent's scratch or memory file. The refusal names the read command for
|
|
9
|
+
* this installation, because an agent cannot guess an absolute plugin path.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
12
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
import {
|
|
15
|
+
configuredIssueRepository,
|
|
16
|
+
issueFields,
|
|
17
|
+
} from "../../lisa-github-read-issue/read-contract.mjs";
|
|
18
|
+
|
|
19
|
+
const owner = join(
|
|
20
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
21
|
+
"preflight-secrets.mjs"
|
|
22
|
+
);
|
|
23
|
+
const FILE_TOOLS = new Set(["Write", "Edit", "MultiEdit", "write", "edit"]);
|
|
24
|
+
const PATCH_TARGET =
|
|
25
|
+
/^\*\*\* (?:Add File|Update File|Delete File|Move to): (.*)$/;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The real location a path would be written to: the deepest existing
|
|
29
|
+
* ancestor's real path, with the not-yet-existing remainder appended.
|
|
30
|
+
* @param {string} target Absolute path.
|
|
31
|
+
* @returns {string|null} Resolved location, or null when unresolvable.
|
|
32
|
+
*/
|
|
33
|
+
function realLocation(target) {
|
|
34
|
+
let existing = target;
|
|
35
|
+
while (!existsSync(existing)) {
|
|
36
|
+
const parent = dirname(existing);
|
|
37
|
+
if (parent === existing) return null;
|
|
38
|
+
existing = parent;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
return join(realpathSync(existing), relative(existing, target));
|
|
42
|
+
} catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Whether any directory from `location` up to the root holds `.git`.
|
|
49
|
+
* @param {string} location Resolved absolute path.
|
|
50
|
+
* @returns {boolean} True when the path is inside a git repository.
|
|
51
|
+
*/
|
|
52
|
+
function insideRepository(location) {
|
|
53
|
+
for (let dir = location; ; dir = dirname(dir)) {
|
|
54
|
+
try {
|
|
55
|
+
statSync(join(dir, ".git"));
|
|
56
|
+
return true;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (!["ENOENT", "ENOTDIR"].includes(error.code)) return true;
|
|
59
|
+
}
|
|
60
|
+
if (dirname(dir) === dir) return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Whether a write to `target` changes no project: it resolves outside the
|
|
66
|
+
* project and outside every git repository. Any doubt is a refusal.
|
|
67
|
+
* @param {unknown} target The path the tool names.
|
|
68
|
+
* @param {string} projectRoot This project's root.
|
|
69
|
+
* @returns {boolean} True when the write touches no repository.
|
|
70
|
+
*/
|
|
71
|
+
export function outsideEveryRepository(target, projectRoot) {
|
|
72
|
+
if (typeof target !== "string" || !isAbsolute(target)) return false;
|
|
73
|
+
const location = realLocation(resolve(target));
|
|
74
|
+
if (!location) return false;
|
|
75
|
+
let root;
|
|
76
|
+
try {
|
|
77
|
+
root = realpathSync(projectRoot);
|
|
78
|
+
} catch {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (location === root || location.startsWith(root + sep)) return false;
|
|
82
|
+
return !insideRepository(location);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Every path a file-writing tool call names, or null for any other shape.
|
|
87
|
+
* @param {Record<string, any>} input Hook event.
|
|
88
|
+
* @returns {string[]|null} Target paths.
|
|
89
|
+
*/
|
|
90
|
+
function writeTargets(input) {
|
|
91
|
+
const args = input?.tool_input;
|
|
92
|
+
if (!args || typeof args !== "object") return null;
|
|
93
|
+
if (FILE_TOOLS.has(input.tool_name)) {
|
|
94
|
+
const target = args.file_path ?? args.filePath;
|
|
95
|
+
return typeof target === "string" ? [target] : null;
|
|
96
|
+
}
|
|
97
|
+
if (input.tool_name === "NotebookEdit")
|
|
98
|
+
return typeof args.notebook_path === "string" ? [args.notebook_path] : null;
|
|
99
|
+
if (input.tool_name === "apply_patch" && typeof args.command === "string") {
|
|
100
|
+
const targets = args.command
|
|
101
|
+
.split("\n")
|
|
102
|
+
.map(line => PATCH_TARGET.exec(line)?.[1])
|
|
103
|
+
.filter(Boolean);
|
|
104
|
+
return targets.length ? targets : null;
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Whether an unbound session's tool call only writes outside every repository.
|
|
111
|
+
* @param {Record<string, any>} input Hook event.
|
|
112
|
+
* @param {{projectRoot: string}} cfg Task configuration.
|
|
113
|
+
* @returns {boolean} True to admit it.
|
|
114
|
+
*/
|
|
115
|
+
export function unboundWrite(input, cfg) {
|
|
116
|
+
const targets = writeTargets(input);
|
|
117
|
+
return (
|
|
118
|
+
targets !== null &&
|
|
119
|
+
targets.every(target => outsideEveryRepository(target, cfg.projectRoot))
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The exact read command this installation admits with no work item bound.
|
|
125
|
+
* @param {Record<string, any>} cfg Task configuration.
|
|
126
|
+
* @returns {string|null} Command text with a placeholder ticket, or null.
|
|
127
|
+
*/
|
|
128
|
+
function readCommand(cfg) {
|
|
129
|
+
const c = cfg.effective ?? {};
|
|
130
|
+
const script = /^[\w./@+-]+$/.test(owner)
|
|
131
|
+
? owner
|
|
132
|
+
: `'${owner.replaceAll("'", "'\\''")}'`;
|
|
133
|
+
if (c.tracker === "linear" && c.linear?.teamKey)
|
|
134
|
+
return `node ${script} --tracker-intake-read --ref ${c.linear.teamKey}-<number> --read issue`;
|
|
135
|
+
if (c.tracker === "jira" && c.jira?.project)
|
|
136
|
+
return `node ${script} --tracker-intake-read --ref ${c.jira.project}-<number> --read issue`;
|
|
137
|
+
const repo = c.github && configuredIssueRepository(c.github);
|
|
138
|
+
if (repo && (!c.tracker || c.tracker === "github"))
|
|
139
|
+
return `gh issue view <number> --repo ${repo} --json ${issueFields}`;
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The refusal for a session with no work item bound, in plain English.
|
|
145
|
+
* @param {Record<string, any>} cfg Task configuration.
|
|
146
|
+
* @returns {{allowed: false, code: string, action: string}} Refusal.
|
|
147
|
+
*/
|
|
148
|
+
export function unboundRefusal(cfg) {
|
|
149
|
+
const read = readCommand(cfg);
|
|
150
|
+
const comments =
|
|
151
|
+
read && read.includes("--read issue")
|
|
152
|
+
? " Use `--read comments` for its comments."
|
|
153
|
+
: "";
|
|
154
|
+
return {
|
|
155
|
+
allowed: false,
|
|
156
|
+
code: "work-item-unbound",
|
|
157
|
+
action: [
|
|
158
|
+
"No work item is bound to this checkout, so only reading is allowed.",
|
|
159
|
+
"Read files with the Read, Grep and Glob tools.",
|
|
160
|
+
read
|
|
161
|
+
? `Read a ticket with exactly this command, with the ticket's number in place of <number>: ${read}.${comments}`
|
|
162
|
+
: "",
|
|
163
|
+
"A file written outside every git repository, such as a scratch or memory file, is allowed.",
|
|
164
|
+
"To change anything in this project, bind its ticket first with lisa-track.",
|
|
165
|
+
]
|
|
166
|
+
.filter(Boolean)
|
|
167
|
+
.join(" "),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
@@ -6,6 +6,14 @@ Apply `do-it-now` before creating work from incidental findings. Declining an ob
|
|
|
6
6
|
|
|
7
7
|
The project tracker is the durable operator-facing record for project work. Every session that will produce a durable project outcome must establish exactly one live configured-tracker leaf before the first durable mutation. Durable outcomes include code, tests, configuration, documentation, committed research or plans, investigation findings, commits, and pull requests. Read-only questions, discussion, and repository orientation are exempt until they turn into durable work.
|
|
8
8
|
|
|
9
|
+
In a project with `.lisa.config.json`, the task-readiness guard enforces this. With no ticket bound, it refuses shell commands and project writes with `work-item-unbound`, and admits only:
|
|
10
|
+
|
|
11
|
+
- the Read, Grep and Glob tools;
|
|
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.
|
|
14
|
+
|
|
15
|
+
Answering a question about a ticket needs none of this. Never bind a ticket just to read one.
|
|
16
|
+
|
|
9
17
|
## Resolve, claim, bind
|
|
10
18
|
|
|
11
19
|
Use `lisa-track` as the single entry point:
|