@codyswann/lisa 5.1.1 → 5.1.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.
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +19 -7
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- 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-codify-verification/SKILL.md +4 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa/agents/test-specialist.md +1 -1
- package/plugins/lisa/agents/verification-specialist.md +1 -1
- package/plugins/lisa/rules/eager/falsifiable-checks.md +1 -1
- package/plugins/lisa/rules/reference/falsifiable-checks.md +30 -6
- package/plugins/lisa/rules/reference/verification.md +1 -1
- package/plugins/lisa/skills/lisa-codify-verification/SKILL.md +4 -2
- package/plugins/lisa/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-agy/agents/test-specialist.md +1 -1
- package/plugins/lisa-agy/agents/verification-specialist.md +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-codify-verification/SKILL.md +4 -2
- package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +1 -1
- 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/agents/test-specialist.agent.md +1 -1
- package/plugins/lisa-copilot/agents/verification-specialist.agent.md +1 -1
- package/plugins/lisa-copilot/rules/eager/falsifiable-checks.md +1 -1
- package/plugins/lisa-copilot/rules/reference/falsifiable-checks.md +30 -6
- package/plugins/lisa-copilot/rules/reference/verification.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-codify-verification/SKILL.md +4 -2
- package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/agents/test-specialist.md +1 -1
- package/plugins/lisa-cursor/agents/verification-specialist.md +1 -1
- package/plugins/lisa-cursor/rules/falsifiable-checks-reference.mdc +30 -6
- package/plugins/lisa-cursor/rules/falsifiable-checks.mdc +1 -1
- package/plugins/lisa-cursor/rules/verification-reference.mdc +1 -1
- package/plugins/lisa-cursor/skills/lisa-codify-verification/SKILL.md +4 -2
- package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/agents/test-specialist.md +1 -1
- package/plugins/lisa-devin/agents/verification-specialist.md +1 -1
- package/plugins/lisa-devin/rules/eager/falsifiable-checks.md +1 -1
- package/plugins/lisa-devin/rules/reference/falsifiable-checks.md +30 -6
- package/plugins/lisa-devin/rules/reference/verification.md +1 -1
- package/plugins/lisa-devin/skills/lisa-codify-verification/SKILL.md +4 -2
- package/plugins/lisa-devin/skills/lisa-implement/SKILL.md +1 -1
- 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/agents/test-specialist.md +1 -1
- package/plugins/src/base/agents/verification-specialist.md +1 -1
- package/plugins/src/base/rules/eager/falsifiable-checks.md +1 -1
- package/plugins/src/base/rules/reference/falsifiable-checks.md +30 -6
- package/plugins/src/base/rules/reference/verification.md +1 -1
- package/plugins/src/base/skills/lisa-codify-verification/SKILL.md +4 -2
- package/plugins/src/base/skills/lisa-implement/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
"qs": "^6.16.0"
|
|
189
189
|
},
|
|
190
190
|
"name": "@codyswann/lisa",
|
|
191
|
-
"version": "5.1.
|
|
191
|
+
"version": "5.1.3",
|
|
192
192
|
"description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
|
|
193
193
|
"main": "dist/index.js",
|
|
194
194
|
"exports": {
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
"test": "tests"
|
|
352
352
|
},
|
|
353
353
|
"types": "./dist/index.d.ts",
|
|
354
|
-
"lisaReleaseCommit": "
|
|
355
|
-
"gitHead": "
|
|
356
|
-
"lisaReleaseTag": "v5.1.
|
|
354
|
+
"lisaReleaseCommit": "be81e6d767745ccf8cc349c84313e29a9e4f89c4",
|
|
355
|
+
"gitHead": "be81e6d767745ccf8cc349c84313e29a9e4f89c4",
|
|
356
|
+
"lisaReleaseTag": "v5.1.3"
|
|
357
357
|
}
|
|
@@ -151,10 +151,12 @@ Confirm:
|
|
|
151
151
|
|
|
152
152
|
Do it one of these ways, in order of preference:
|
|
153
153
|
|
|
154
|
-
- **Run against the pre-fix commit** (bug fixes):
|
|
155
|
-
- **Break the property
|
|
154
|
+
- **Run against the pre-fix commit** (bug fixes): add a throwaway detached worktree at the failing commit (`git worktree add --detach <tmp> <pre-fix-sha>`). Copy the new test, plus every new helper or fixture it imports, to the same paths there (`mkdir -p` the parent directories first), and give the copy its dependencies (symlink `node_modules` from your tree, or run the project's install there). Run the test and confirm it fails **at the assertion**, not on an import or a missing module, then `git worktree remove --force <tmp>`. Your own branch is never checked out away from.
|
|
155
|
+
- **Break the property on a scratch copy**: add a throwaway detached worktree (`git worktree add --detach <tmp> HEAD`), apply the uncommitted diff (`git diff --binary HEAD | git -C <tmp> apply --allow-empty`), copy in untracked new files, and give it its dependencies as above. Run the test there **before** breaking anything and confirm it is green: a red baseline means the copy is incomplete, not that the test bites. Then delete the field, revert the line, or flip the condition; run; remove the worktree. Prefer this when there is no single pre-fix commit. The full recipe is in `falsifiable-checks`.
|
|
156
156
|
- **Unit-test the checker against synthetic bad input**: required when the input is generated, schema-validated, or cached — a revert can silently fail to change what the test reads (a generator that errors leaves the previous artifact in place, and the test then "passes" on stale input).
|
|
157
157
|
|
|
158
|
+
Every break runs on a scratch copy, never in a worktree another agent is editing. A worktree has one working tree, so an in-place mutation writes into a concurrent builder's files, and a restore that lands after their next save can delete or commit their work. Restore must never depend on the shared tree's state; discarding the scratch worktree is the restore.
|
|
159
|
+
|
|
158
160
|
Two properties the failure itself must have:
|
|
159
161
|
|
|
160
162
|
- It must **name the right location**. A failure that does not localize is weak evidence the test is measuring the intended thing.
|
|
@@ -344,7 +344,7 @@ Before finishing, execute the Verify flow:
|
|
|
344
344
|
7a. Confirm two-way linkage before treating PR submission as complete: the PR body/title/branch must reference the work item, and the work item must have either a verified native PR link or the single managed `[lisa-pr-link]` comment. Establish that comment with `node scripts/lisa-work-item.mjs backlink --ref <work_item_ref> --pr-url <url>` rather than posting it by hand — it is idempotent, and it is the same file that enforces the check, so producer and consumer cannot drift.
|
|
345
345
|
8. PR Watch Loop: Drive the PR to merge via the `drive-pr-to-merge` skill — the single source of truth for clearing every blocker (auto-merge with direct-merge fallback, `BEHIND` re-sync, conflict resolution, failing-check fixes, human + bot review-comment handling with thread resolution, stale `CHANGES_REQUESTED` dismissal, and post-merge ancestry verification). `git-submit-pr` already invokes it; if you reach this step with a PR already open, invoke `drive-pr-to-merge` directly with the PR number. For a large review backlog you may delegate independent code fixes to subagents, but `drive-pr-to-merge` owns the loop and the terminal conditions — do not re-implement them.
|
|
346
346
|
9. Merge the PR, then refresh the ticket-side backlink with `lisa-tracker-sync <work_item_ref> pr-merged pr_url=<url> merge_sha=<sha> tracker_provider=<provider>`.
|
|
347
|
-
10. Monitor the deploy action that triggers automatically from the successful merge
|
|
347
|
+
10. Monitor the deploy action that triggers automatically from the successful merge, in the own turn of the agent running this flow (the lead) with a bounded foreground watch. Do not look the run up again: `lisa-drive-pr-to-merge` already confirmed it during step 8 (its deploy-run check). If step 8 returned `blocked:deploy` or `blocked:no-deploy-run`, no deploy run fired, and that is not a code failure: treat it as blocked under the blocked-deploy rule below, and never open a fix PR for it. Otherwise watch the run step 8 confirmed. The ceiling is 60 minutes from the merge, unless the work item or the deploy workflow's own `timeout-minutes` sets another. Before each watch, first read `gh run view <run id> --json status,conclusion`: a run that has already concluded is judged by its conclusion, whatever the time. Only for a run still in progress, compute the seconds remaining before the ceiling; if none remain, stop watching and apply the blocked-deploy rule. Otherwise watch with `timeout <n> gh run watch <run id> --interval 30 --exit-status`, where `<n>` is the smaller of 540 and the seconds remaining (`timeout <n>` where the `timeout` utility exists; otherwise rely on the harness's own command timeout), give the tool call a timeout just above `<n>` (at most 600000 ms on Claude Code), and re-poll `gh run view <run id> --json status,conclusion` after each return until the run concludes. A run that concluded successfully proceeds to step 12; one that concluded unsuccessfully is a deploy failure — go to step 11. A run still in progress at the ceiling is not a code failure: treat it as blocked under the blocked-deploy rule, and never open a fix PR for it. Blocked-deploy rule: diagnose why no run fired or why the run did not finish. A repository-owned technical gap (a misconfigured trigger, a missing `workflow_dispatch`, a deploy job that hangs) is an actionable blocker under step 2a — file and link the build-ready ticket. Missing access, credentials or a human decision is a human-only blocker under step 2a. Either way, record the blocked verdict and end the flow there: skip steps 11–14, still post evidence (step 15), and keep the binding (step 16). **Never wait on the deploy with a detached or background watcher** — no trailing `&`, no `nohup`, no harness background task, no scheduled re-check — because its result reaches only the agent that started it, never the lead, which then sits idle after the deploy has finished. This is the same rule `lisa-drive-pr-to-merge` applies to the CI wait. If a watcher subagent is used anyway, it must `SendMessage` the lead the moment the run succeeds or fails, and the lead's turn may end only to wait for that message. On runtimes without cross-agent messaging, the foreground watch is the only option.
|
|
348
348
|
11. If deploy fails, fix the failure, open a new PR and then go back to step 7
|
|
349
349
|
12. Remote verification: `verification-specialist` verifies in target environment (same checks as local verification, but on remote), and refreshes the verdict (step 2a) to reflect the remote result. Resolve credentials through the `verification-lifecycle` lookup order before declaring any missing. If they remain genuinely unavailable, do not complete on artifact-only evidence: post a tracker comment naming every credential source checked and what could not be verified as a result, transition the work item to the configured blocked state, and apply the configured `needs-human` / `human-review` label (creating it when the tracker supports label creation and it is missing). The comment is what makes the escalation auditable — a label alone records that something stopped, not what was tried or why. Evidence must explicitly distinguish `verified empirically` from `artifact-only / verification deferred`.
|
|
350
350
|
13. `ops-specialist`: post-deploy health check via `lisa-monitor <env> --report-only`, monitor for errors in first minutes. `--report-only` is REQUIRED: it keeps the post-deploy check a pure health/audit report so monitor's standalone ticket-filing never fires inside this flow.
|
|
@@ -25,7 +25,7 @@ When your task belongs to a tracked work item — it names `work_item_context` o
|
|
|
25
25
|
|
|
26
26
|
Do not write tests against the implementation's shape — they pass through a rewrite that breaks behaviour, which is the opposite of the job. Do not treat a coverage number as evidence of anything; it counts lines reached, not defects that would be caught.
|
|
27
27
|
|
|
28
|
-
Do not hand on a test you have not watched fail. A test that cannot fail is worse than a missing one: it reports the defect as absent and ends the search. Break the behaviour, watch the assertion fail and name the right place, restore. Watch especially for the assertion that is satisfiable by the test's own fixture rather than by the artifact under test — that one passes no matter what the production code does. `.claude/rules/falsifiable-checks.md` has the four observed shapes.
|
|
28
|
+
Do not hand on a test you have not watched fail. A test that cannot fail is worse than a missing one: it reports the defect as absent and ends the search. Break the behaviour on a scratch copy, never in a worktree another agent is editing, watch the assertion fail and name the right place, restore. Watch especially for the assertion that is satisfiable by the test's own fixture rather than by the artifact under test — that one passes no matter what the production code does. `.claude/rules/falsifiable-checks.md` has the four observed shapes.
|
|
29
29
|
|
|
30
30
|
## What you hand on
|
|
31
31
|
|
|
@@ -134,7 +134,7 @@ For every empirical verification that produced PASS evidence, invoke the `codify
|
|
|
134
134
|
- Follow the verification lifecycle: confirm quality gates, classify, check tooling, fail fast, plan, execute, codify, spec conformance, loop
|
|
135
135
|
- Every passing empirical verification must be codified as a regression test via `codify-verification` before declaring done (skip allowed only for PR / Documentation / Deploy / Investigate-Only)
|
|
136
136
|
- Tests, typecheck, lint, and format are quality gates (prerequisites), NOT verification — never report them as verification evidence
|
|
137
|
-
- Falsify every check you author before reporting a clean result: break the guarded property, confirm the check fails and NAMES the right location, restore. Report what you broke alongside the result — see `.claude/rules/falsifiable-checks.md`
|
|
137
|
+
- Falsify every check you author before reporting a clean result: break the guarded property, confirm the check fails and NAMES the right location, restore. Run the break on a scratch copy (a throwaway detached `git worktree add` or a temp copy of the touched files), never in a worktree another agent is editing: an in-place mutate/restore races a builder's edits and can delete or commit their work. Report what you broke alongside the result — see `.claude/rules/falsifiable-checks.md`
|
|
138
138
|
- A zero-hit sweep is meaningless until the detector has found known instances on a ref where the defect still exists; a passing probe needs a deliberate bite control that MUST report a problem
|
|
139
139
|
- State each clean result's blind spot (presence vs. value, reachability, class completeness) — a negative result describes what the check can perceive, not the code
|
|
140
140
|
- Discover existing project scripts and tools before creating new ones
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Falsifiable Checks (load-bearing)
|
|
2
2
|
|
|
3
|
-
A check that cannot fail is not evidence. Before you report a clean result from a check you wrote or changed, break the guarded property and confirm the check fails at the right location. Then restore it, and say what you broke. If you did not falsify a check, report it as unvalidated.
|
|
3
|
+
A check that cannot fail is not evidence. Before you report a clean result from a check you wrote or changed, break the guarded property and confirm the check fails at the right location. Do the break on a scratch copy, never in a worktree another agent is editing. Then restore it, and say what you broke. If you did not falsify a check, report it as unvalidated.
|
|
4
4
|
|
|
5
5
|
- Read the command's own exit status. `gate | tail` reports the status of `tail`, so use `gate >log 2>&1 || status=$?`.
|
|
6
6
|
- To mutation-prove a guard, disable it in production code, run the whole suite, and read which tests fail. Zero failures means the guard is inert.
|
|
@@ -157,19 +157,43 @@ A clean result is a statement about what the check can perceive, not about the c
|
|
|
157
157
|
## How to apply
|
|
158
158
|
|
|
159
159
|
1. Author the check.
|
|
160
|
-
2.
|
|
160
|
+
2. On a scratch copy, never in a worktree another agent is editing, deliberately break the guarded property — specifically, introduce **the exact regression the guard exists to prevent**, not a nearby or convenient break.
|
|
161
161
|
3. Confirm the check **fails and names the right file/line**, then read the failure count and the failing test *names* per the yardstick below.
|
|
162
|
-
4. Restore
|
|
162
|
+
4. Restore by discarding the scratch copy. The green baseline you took in the copy before the break is the green-again evidence; the shared tree was never changed, so there is nothing to restore there.
|
|
163
163
|
5. Report the falsification alongside the result.
|
|
164
164
|
|
|
165
|
+
### Break on a scratch copy, never in a shared worktree
|
|
166
|
+
|
|
167
|
+
A worktree has one working tree. When a builder or another agent is editing it, an in-place mutation is a write into their files: the break and its revert race their concurrent edits, and a revert that lands after their next save can clobber their work or sweep it into a commit. Restore must not depend on the shared tree's state.
|
|
168
|
+
|
|
169
|
+
So every falsification break (steps 2 to 4 above, and the mutation proof below) runs on a scratch copy, made from the repository root:
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
tmp=$(mktemp -d)
|
|
173
|
+
git worktree add --detach "$tmp" HEAD
|
|
174
|
+
git diff --binary HEAD | git -C "$tmp" apply --allow-empty # tracked changes, binaries included
|
|
175
|
+
git ls-files --others --exclude-standard -z |
|
|
176
|
+
rsync -a --from0 --files-from=- ./ "$tmp"/ # untracked new files
|
|
177
|
+
ln -s "$PWD/node_modules" "$tmp/node_modules" # dependencies (or run the project's install in "$tmp")
|
|
178
|
+
# 1. baseline: run the check in "$tmp" BEFORE breaking anything; it must be green
|
|
179
|
+
# 2. break the property in "$tmp", run the check there, read the failure
|
|
180
|
+
git worktree remove --force "$tmp" # discarding the copy is the restore
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The copy must be complete before the break means anything. `git diff` carries only tracked changes, so new files need the explicit untracked copy, and a fresh worktree has no installed dependencies, so link them (never install into the linked directory from the copy) or install them there. **In a workspace monorepo, install in the copy instead of linking:** a linked `node_modules` resolves each workspace package back to the original checkout, so a break reached through a workspace package name never runs, the check stays green, and the guard is wrongly reported inert. Then take the **baseline**: run the check in the copy before breaking anything and confirm it is green. A red baseline means the copy is incomplete (a missing new file, missing dependencies), not that the guard bites; fix the copy first. That green baseline is also the green-again evidence for the restore, because discarding the copy is the restore and the shared tree was never touched.
|
|
184
|
+
|
|
185
|
+
Make the scratch copy with a plain `git worktree add --detach` at a temp path and address it by absolute path. Never use a harness tool that switches the session's working directory into it (for example Claude Code's `EnterWorktree`): that moves every agent sharing the session out of the tree it is working in.
|
|
186
|
+
|
|
187
|
+
A temp copy of only the touched files is acceptable when the check can run against them in isolation; it needs the same baseline. Either way, the shared tree is never written to.
|
|
188
|
+
|
|
165
189
|
### The failure count is part of the evidence
|
|
166
190
|
|
|
167
191
|
Step 3's cardinality is not pedantry; each deviation names a distinct defect. Run it as four steps, in this order:
|
|
168
192
|
|
|
169
|
-
1. **Neuter the protection in production code** — delete the branch, drop the token from the enum, remove the check. Editing a *test* proves nothing about the guard; it only proves the test file is loaded.
|
|
193
|
+
1. **Neuter the protection in production code, on a scratch copy** (never in a worktree another agent is editing; see above) — delete the branch, drop the token from the enum, remove the check. Editing a *test* proves nothing about the guard; it only proves the test file is loaded.
|
|
170
194
|
2. **Run the whole suite.** Never a single test file, and never a path filter.
|
|
171
195
|
3. **Count the failures and read their names.** The count alone is ambiguous; the names are what separate "several failures of one regression" from "several unrelated failures."
|
|
172
|
-
4. **
|
|
196
|
+
4. **Restore by discarding the scratch copy.** The green baseline taken in the copy before the break is the green-again evidence.
|
|
173
197
|
|
|
174
198
|
Then read the result:
|
|
175
199
|
|
|
@@ -280,10 +304,10 @@ A check that cannot fail is not evidence.
|
|
|
280
304
|
|
|
281
305
|
A passing test, a clean lint run, a zero-hit sweep, a green ratchet: each is evidence **only if that check is known to be capable of failing.** Otherwise it is a checkbox, and a green suite that protects nothing is worse than none — it suppresses the search for the defect.
|
|
282
306
|
|
|
283
|
-
**Before reporting any clean, zero, or passing result from a check you authored or modified, prove it fails on known-bad input.** Break the thing being guarded, confirm the check fails *and names the right location*, then
|
|
307
|
+
**Before reporting any clean, zero, or passing result from a check you authored or modified, prove it fails on known-bad input.** Break the thing being guarded on a scratch copy, never in a worktree another agent is editing, confirm the check fails *and names the right location*, then discard the copy. That falsification is part of the deliverable, not an optional extra.
|
|
284
308
|
|
|
285
309
|
- **Falsify before reporting.** No clean result is reportable until the check has been shown to fail on a deliberate break. **"Mentally reverting" does not count** — reasoning that the assertion *would* fail is precisely the step that lets a non-functional guard ship, because the author already believes it is load-bearing. Run the break.
|
|
286
|
-
- **Mutation-prove the guard, then read the cardinality.** Neuter the protection **in production code**, run the **whole suite
|
|
310
|
+
- **Mutation-prove the guard, then read the cardinality.** Neuter the protection **in production code**, on a scratch copy, run the **whole suite** there, count the failures and **read their names**, then discard the copy. **Zero** ⇒ the guard is inert (one pinning a single field shipped with all 50 tests green while the regression walked through). **Many, unrelated** ⇒ over-broad; its next failure will not name the cause. **Exactly one, or several all named for the same regression** ⇒ load-bearing and correctly scoped. A **zero is robust to contention** — load only ever adds failures — so only the non-zero counts need a quiet machine.
|
|
287
311
|
- **The automated mutation gate is language-scoped; the manual probe above is not.** Stryker instruments the JavaScript and TypeScript family plus Vue, HTML and Svelte — there is **no shell parser**, so a guard whose logic lives in `.sh` yields no mutants under **any** `mutate` list. Adding one aborts the whole run (`No parser registered for .sh!` — measured, not inferred), taking every other guard's score with it. A mutation gate grey or green on a shell-guard change **measured nothing about that guard**; reading it as coverage is the fifth failure mode above wearing a config file. Shell guards are covered by **driving tests only**: execute the script against a payload table and assert the blocked/allowed verdict, with a control on **both** sides — a refusal case *and* an allowed case. A shell guard nothing executes has no bite evidence at all, whatever the gate printed.
|
|
288
312
|
- **Never scope the probe by filename, and never infer absent coverage from a grep.** Suites split at the line cap, so a protection's tests often sit in a sibling file: a filename-scoped probe reported cardinality 0 on a live security fix that a whole-suite run showed failing 4 tests, every one named for it.
|
|
289
313
|
- **Assert that no copy is wrong, not that some copy is right.** An existential assertion over duplicated content is satisfied by the correct copy and cannot see the broken one — rewriting one suite's assertions to universal negatives took the same mutation from **0 to 18** failures. Enumerate the property (*every* marker uses an em-dash), never the one known-bad spelling.
|
|
@@ -22,7 +22,7 @@ Never assume something works because the code "looks correct." Run a command, ob
|
|
|
22
22
|
|
|
23
23
|
**If all you did was run tests, typecheck, and lint — you have NOT verified.** You have only confirmed quality checks pass. Verification requires running the actual system and observing the results: making HTTP requests, clicking through the UI, executing CLI commands, querying the database, or otherwise interacting with the running software as an end user would.
|
|
24
24
|
|
|
25
|
-
**A check that cannot fail is not evidence either.** Every gate, probe, sweep, and codified spec you author is subject to the `falsifiable-checks` rule: break the guarded property, see the check fail at the right location, restore, and report that falsification.
|
|
25
|
+
**A check that cannot fail is not evidence either.** Every gate, probe, sweep, and codified spec you author is subject to the `falsifiable-checks` rule: break the guarded property on a scratch copy, never in a worktree another agent is editing, see the check fail at the right location, restore, and report that falsification.
|
|
26
26
|
|
|
27
27
|
### Browser-controller neutrality
|
|
28
28
|
|
|
@@ -149,10 +149,12 @@ Confirm:
|
|
|
149
149
|
|
|
150
150
|
Do it one of these ways, in order of preference:
|
|
151
151
|
|
|
152
|
-
- **Run against the pre-fix commit** (bug fixes):
|
|
153
|
-
- **Break the property
|
|
152
|
+
- **Run against the pre-fix commit** (bug fixes): add a throwaway detached worktree at the failing commit (`git worktree add --detach <tmp> <pre-fix-sha>`). Copy the new test, plus every new helper or fixture it imports, to the same paths there (`mkdir -p` the parent directories first), and give the copy its dependencies (symlink `node_modules` from your tree, or run the project's install there). Run the test and confirm it fails **at the assertion**, not on an import or a missing module, then `git worktree remove --force <tmp>`. Your own branch is never checked out away from.
|
|
153
|
+
- **Break the property on a scratch copy**: add a throwaway detached worktree (`git worktree add --detach <tmp> HEAD`), apply the uncommitted diff (`git diff --binary HEAD | git -C <tmp> apply --allow-empty`), copy in untracked new files, and give it its dependencies as above. Run the test there **before** breaking anything and confirm it is green: a red baseline means the copy is incomplete, not that the test bites. Then delete the field, revert the line, or flip the condition; run; remove the worktree. Prefer this when there is no single pre-fix commit. The full recipe is in `falsifiable-checks`.
|
|
154
154
|
- **Unit-test the checker against synthetic bad input**: required when the input is generated, schema-validated, or cached — a revert can silently fail to change what the test reads (a generator that errors leaves the previous artifact in place, and the test then "passes" on stale input).
|
|
155
155
|
|
|
156
|
+
Every break runs on a scratch copy, never in a worktree another agent is editing. A worktree has one working tree, so an in-place mutation writes into a concurrent builder's files, and a restore that lands after their next save can delete or commit their work. Restore must never depend on the shared tree's state; discarding the scratch worktree is the restore.
|
|
157
|
+
|
|
156
158
|
Two properties the failure itself must have:
|
|
157
159
|
|
|
158
160
|
- It must **name the right location**. A failure that does not localize is weak evidence the test is measuring the intended thing.
|
|
@@ -342,7 +342,7 @@ Before finishing, execute the Verify flow:
|
|
|
342
342
|
7a. Confirm two-way linkage before treating PR submission as complete: the PR body/title/branch must reference the work item, and the work item must have either a verified native PR link or the single managed `[lisa-pr-link]` comment. Establish that comment with `node scripts/lisa-work-item.mjs backlink --ref <work_item_ref> --pr-url <url>` rather than posting it by hand — it is idempotent, and it is the same file that enforces the check, so producer and consumer cannot drift.
|
|
343
343
|
8. PR Watch Loop: Drive the PR to merge via the `drive-pr-to-merge` skill — the single source of truth for clearing every blocker (auto-merge with direct-merge fallback, `BEHIND` re-sync, conflict resolution, failing-check fixes, human + bot review-comment handling with thread resolution, stale `CHANGES_REQUESTED` dismissal, and post-merge ancestry verification). `git-submit-pr` already invokes it; if you reach this step with a PR already open, invoke `drive-pr-to-merge` directly with the PR number. For a large review backlog you may delegate independent code fixes to subagents, but `drive-pr-to-merge` owns the loop and the terminal conditions — do not re-implement them.
|
|
344
344
|
9. Merge the PR, then refresh the ticket-side backlink with `lisa-tracker-sync <work_item_ref> pr-merged pr_url=<url> merge_sha=<sha> tracker_provider=<provider>`.
|
|
345
|
-
10. Monitor the deploy action that triggers automatically from the successful merge
|
|
345
|
+
10. Monitor the deploy action that triggers automatically from the successful merge, in the own turn of the agent running this flow (the lead) with a bounded foreground watch. Do not look the run up again: `lisa-drive-pr-to-merge` already confirmed it during step 8 (its deploy-run check). If step 8 returned `blocked:deploy` or `blocked:no-deploy-run`, no deploy run fired, and that is not a code failure: treat it as blocked under the blocked-deploy rule below, and never open a fix PR for it. Otherwise watch the run step 8 confirmed. The ceiling is 60 minutes from the merge, unless the work item or the deploy workflow's own `timeout-minutes` sets another. Before each watch, first read `gh run view <run id> --json status,conclusion`: a run that has already concluded is judged by its conclusion, whatever the time. Only for a run still in progress, compute the seconds remaining before the ceiling; if none remain, stop watching and apply the blocked-deploy rule. Otherwise watch with `timeout <n> gh run watch <run id> --interval 30 --exit-status`, where `<n>` is the smaller of 540 and the seconds remaining (`timeout <n>` where the `timeout` utility exists; otherwise rely on the harness's own command timeout), give the tool call a timeout just above `<n>` (at most 600000 ms on Claude Code), and re-poll `gh run view <run id> --json status,conclusion` after each return until the run concludes. A run that concluded successfully proceeds to step 12; one that concluded unsuccessfully is a deploy failure — go to step 11. A run still in progress at the ceiling is not a code failure: treat it as blocked under the blocked-deploy rule, and never open a fix PR for it. Blocked-deploy rule: diagnose why no run fired or why the run did not finish. A repository-owned technical gap (a misconfigured trigger, a missing `workflow_dispatch`, a deploy job that hangs) is an actionable blocker under step 2a — file and link the build-ready ticket. Missing access, credentials or a human decision is a human-only blocker under step 2a. Either way, record the blocked verdict and end the flow there: skip steps 11–14, still post evidence (step 15), and keep the binding (step 16). **Never wait on the deploy with a detached or background watcher** — no trailing `&`, no `nohup`, no harness background task, no scheduled re-check — because its result reaches only the agent that started it, never the lead, which then sits idle after the deploy has finished. This is the same rule `lisa-drive-pr-to-merge` applies to the CI wait. If a watcher subagent is used anyway, it must `SendMessage` the lead the moment the run succeeds or fails, and the lead's turn may end only to wait for that message. On runtimes without cross-agent messaging, the foreground watch is the only option.
|
|
346
346
|
11. If deploy fails, fix the failure, open a new PR and then go back to step 7
|
|
347
347
|
12. Remote verification: `verification-specialist` verifies in target environment (same checks as local verification, but on remote), and refreshes the verdict (step 2a) to reflect the remote result. Resolve credentials through the `verification-lifecycle` lookup order before declaring any missing. If they remain genuinely unavailable, do not complete on artifact-only evidence: post a tracker comment naming every credential source checked and what could not be verified as a result, transition the work item to the configured blocked state, and apply the configured `needs-human` / `human-review` label (creating it when the tracker supports label creation and it is missing). The comment is what makes the escalation auditable — a label alone records that something stopped, not what was tried or why. Evidence must explicitly distinguish `verified empirically` from `artifact-only / verification deferred`.
|
|
348
348
|
13. `ops-specialist`: post-deploy health check via `lisa-monitor <env> --report-only`, monitor for errors in first minutes. `--report-only` is REQUIRED: it keeps the post-deploy check a pure health/audit report so monitor's standalone ticket-filing never fires inside this flow.
|
|
@@ -25,7 +25,7 @@ When your task belongs to a tracked work item — it names `work_item_context` o
|
|
|
25
25
|
|
|
26
26
|
Do not write tests against the implementation's shape — they pass through a rewrite that breaks behaviour, which is the opposite of the job. Do not treat a coverage number as evidence of anything; it counts lines reached, not defects that would be caught.
|
|
27
27
|
|
|
28
|
-
Do not hand on a test you have not watched fail. A test that cannot fail is worse than a missing one: it reports the defect as absent and ends the search. Break the behaviour, watch the assertion fail and name the right place, restore. Watch especially for the assertion that is satisfiable by the test's own fixture rather than by the artifact under test — that one passes no matter what the production code does. `.claude/rules/falsifiable-checks.md` has the four observed shapes.
|
|
28
|
+
Do not hand on a test you have not watched fail. A test that cannot fail is worse than a missing one: it reports the defect as absent and ends the search. Break the behaviour on a scratch copy, never in a worktree another agent is editing, watch the assertion fail and name the right place, restore. Watch especially for the assertion that is satisfiable by the test's own fixture rather than by the artifact under test — that one passes no matter what the production code does. `.claude/rules/falsifiable-checks.md` has the four observed shapes.
|
|
29
29
|
|
|
30
30
|
## What you hand on
|
|
31
31
|
|
|
@@ -134,7 +134,7 @@ For every empirical verification that produced PASS evidence, invoke the `codify
|
|
|
134
134
|
- Follow the verification lifecycle: confirm quality gates, classify, check tooling, fail fast, plan, execute, codify, spec conformance, loop
|
|
135
135
|
- Every passing empirical verification must be codified as a regression test via `codify-verification` before declaring done (skip allowed only for PR / Documentation / Deploy / Investigate-Only)
|
|
136
136
|
- Tests, typecheck, lint, and format are quality gates (prerequisites), NOT verification — never report them as verification evidence
|
|
137
|
-
- Falsify every check you author before reporting a clean result: break the guarded property, confirm the check fails and NAMES the right location, restore. Report what you broke alongside the result — see `.claude/rules/falsifiable-checks.md`
|
|
137
|
+
- Falsify every check you author before reporting a clean result: break the guarded property, confirm the check fails and NAMES the right location, restore. Run the break on a scratch copy (a throwaway detached `git worktree add` or a temp copy of the touched files), never in a worktree another agent is editing: an in-place mutate/restore races a builder's edits and can delete or commit their work. Report what you broke alongside the result — see `.claude/rules/falsifiable-checks.md`
|
|
138
138
|
- A zero-hit sweep is meaningless until the detector has found known instances on a ref where the defect still exists; a passing probe needs a deliberate bite control that MUST report a problem
|
|
139
139
|
- State each clean result's blind spot (presence vs. value, reachability, class completeness) — a negative result describes what the check can perceive, not the code
|
|
140
140
|
- Discover existing project scripts and tools before creating new ones
|
|
@@ -149,10 +149,12 @@ Confirm:
|
|
|
149
149
|
|
|
150
150
|
Do it one of these ways, in order of preference:
|
|
151
151
|
|
|
152
|
-
- **Run against the pre-fix commit** (bug fixes):
|
|
153
|
-
- **Break the property
|
|
152
|
+
- **Run against the pre-fix commit** (bug fixes): add a throwaway detached worktree at the failing commit (`git worktree add --detach <tmp> <pre-fix-sha>`). Copy the new test, plus every new helper or fixture it imports, to the same paths there (`mkdir -p` the parent directories first), and give the copy its dependencies (symlink `node_modules` from your tree, or run the project's install there). Run the test and confirm it fails **at the assertion**, not on an import or a missing module, then `git worktree remove --force <tmp>`. Your own branch is never checked out away from.
|
|
153
|
+
- **Break the property on a scratch copy**: add a throwaway detached worktree (`git worktree add --detach <tmp> HEAD`), apply the uncommitted diff (`git diff --binary HEAD | git -C <tmp> apply --allow-empty`), copy in untracked new files, and give it its dependencies as above. Run the test there **before** breaking anything and confirm it is green: a red baseline means the copy is incomplete, not that the test bites. Then delete the field, revert the line, or flip the condition; run; remove the worktree. Prefer this when there is no single pre-fix commit. The full recipe is in `falsifiable-checks`.
|
|
154
154
|
- **Unit-test the checker against synthetic bad input**: required when the input is generated, schema-validated, or cached — a revert can silently fail to change what the test reads (a generator that errors leaves the previous artifact in place, and the test then "passes" on stale input).
|
|
155
155
|
|
|
156
|
+
Every break runs on a scratch copy, never in a worktree another agent is editing. A worktree has one working tree, so an in-place mutation writes into a concurrent builder's files, and a restore that lands after their next save can delete or commit their work. Restore must never depend on the shared tree's state; discarding the scratch worktree is the restore.
|
|
157
|
+
|
|
156
158
|
Two properties the failure itself must have:
|
|
157
159
|
|
|
158
160
|
- It must **name the right location**. A failure that does not localize is weak evidence the test is measuring the intended thing.
|
|
@@ -342,7 +342,7 @@ Before finishing, execute the Verify flow:
|
|
|
342
342
|
7a. Confirm two-way linkage before treating PR submission as complete: the PR body/title/branch must reference the work item, and the work item must have either a verified native PR link or the single managed `[lisa-pr-link]` comment. Establish that comment with `node scripts/lisa-work-item.mjs backlink --ref <work_item_ref> --pr-url <url>` rather than posting it by hand — it is idempotent, and it is the same file that enforces the check, so producer and consumer cannot drift.
|
|
343
343
|
8. PR Watch Loop: Drive the PR to merge via the `drive-pr-to-merge` skill — the single source of truth for clearing every blocker (auto-merge with direct-merge fallback, `BEHIND` re-sync, conflict resolution, failing-check fixes, human + bot review-comment handling with thread resolution, stale `CHANGES_REQUESTED` dismissal, and post-merge ancestry verification). `git-submit-pr` already invokes it; if you reach this step with a PR already open, invoke `drive-pr-to-merge` directly with the PR number. For a large review backlog you may delegate independent code fixes to subagents, but `drive-pr-to-merge` owns the loop and the terminal conditions — do not re-implement them.
|
|
344
344
|
9. Merge the PR, then refresh the ticket-side backlink with `lisa-tracker-sync <work_item_ref> pr-merged pr_url=<url> merge_sha=<sha> tracker_provider=<provider>`.
|
|
345
|
-
10. Monitor the deploy action that triggers automatically from the successful merge
|
|
345
|
+
10. Monitor the deploy action that triggers automatically from the successful merge, in the own turn of the agent running this flow (the lead) with a bounded foreground watch. Do not look the run up again: `lisa-drive-pr-to-merge` already confirmed it during step 8 (its deploy-run check). If step 8 returned `blocked:deploy` or `blocked:no-deploy-run`, no deploy run fired, and that is not a code failure: treat it as blocked under the blocked-deploy rule below, and never open a fix PR for it. Otherwise watch the run step 8 confirmed. The ceiling is 60 minutes from the merge, unless the work item or the deploy workflow's own `timeout-minutes` sets another. Before each watch, first read `gh run view <run id> --json status,conclusion`: a run that has already concluded is judged by its conclusion, whatever the time. Only for a run still in progress, compute the seconds remaining before the ceiling; if none remain, stop watching and apply the blocked-deploy rule. Otherwise watch with `timeout <n> gh run watch <run id> --interval 30 --exit-status`, where `<n>` is the smaller of 540 and the seconds remaining (`timeout <n>` where the `timeout` utility exists; otherwise rely on the harness's own command timeout), give the tool call a timeout just above `<n>` (at most 600000 ms on Claude Code), and re-poll `gh run view <run id> --json status,conclusion` after each return until the run concludes. A run that concluded successfully proceeds to step 12; one that concluded unsuccessfully is a deploy failure — go to step 11. A run still in progress at the ceiling is not a code failure: treat it as blocked under the blocked-deploy rule, and never open a fix PR for it. Blocked-deploy rule: diagnose why no run fired or why the run did not finish. A repository-owned technical gap (a misconfigured trigger, a missing `workflow_dispatch`, a deploy job that hangs) is an actionable blocker under step 2a — file and link the build-ready ticket. Missing access, credentials or a human decision is a human-only blocker under step 2a. Either way, record the blocked verdict and end the flow there: skip steps 11–14, still post evidence (step 15), and keep the binding (step 16). **Never wait on the deploy with a detached or background watcher** — no trailing `&`, no `nohup`, no harness background task, no scheduled re-check — because its result reaches only the agent that started it, never the lead, which then sits idle after the deploy has finished. This is the same rule `lisa-drive-pr-to-merge` applies to the CI wait. If a watcher subagent is used anyway, it must `SendMessage` the lead the moment the run succeeds or fails, and the lead's turn may end only to wait for that message. On runtimes without cross-agent messaging, the foreground watch is the only option.
|
|
346
346
|
11. If deploy fails, fix the failure, open a new PR and then go back to step 7
|
|
347
347
|
12. Remote verification: `verification-specialist` verifies in target environment (same checks as local verification, but on remote), and refreshes the verdict (step 2a) to reflect the remote result. Resolve credentials through the `verification-lifecycle` lookup order before declaring any missing. If they remain genuinely unavailable, do not complete on artifact-only evidence: post a tracker comment naming every credential source checked and what could not be verified as a result, transition the work item to the configured blocked state, and apply the configured `needs-human` / `human-review` label (creating it when the tracker supports label creation and it is missing). The comment is what makes the escalation auditable — a label alone records that something stopped, not what was tried or why. Evidence must explicitly distinguish `verified empirically` from `artifact-only / verification deferred`.
|
|
348
348
|
13. `ops-specialist`: post-deploy health check via `lisa-monitor <env> --report-only`, monitor for errors in first minutes. `--report-only` is REQUIRED: it keeps the post-deploy check a pure health/audit report so monitor's standalone ticket-filing never fires inside this flow.
|
|
@@ -25,7 +25,7 @@ When your task belongs to a tracked work item — it names `work_item_context` o
|
|
|
25
25
|
|
|
26
26
|
Do not write tests against the implementation's shape — they pass through a rewrite that breaks behaviour, which is the opposite of the job. Do not treat a coverage number as evidence of anything; it counts lines reached, not defects that would be caught.
|
|
27
27
|
|
|
28
|
-
Do not hand on a test you have not watched fail. A test that cannot fail is worse than a missing one: it reports the defect as absent and ends the search. Break the behaviour, watch the assertion fail and name the right place, restore. Watch especially for the assertion that is satisfiable by the test's own fixture rather than by the artifact under test — that one passes no matter what the production code does. [`rules/reference/falsifiable-checks.md`](../rules/reference/falsifiable-checks.md) has the four observed shapes.
|
|
28
|
+
Do not hand on a test you have not watched fail. A test that cannot fail is worse than a missing one: it reports the defect as absent and ends the search. Break the behaviour on a scratch copy, never in a worktree another agent is editing, watch the assertion fail and name the right place, restore. Watch especially for the assertion that is satisfiable by the test's own fixture rather than by the artifact under test — that one passes no matter what the production code does. [`rules/reference/falsifiable-checks.md`](../rules/reference/falsifiable-checks.md) has the four observed shapes.
|
|
29
29
|
|
|
30
30
|
## What you hand on
|
|
31
31
|
|
|
@@ -134,7 +134,7 @@ For every empirical verification that produced PASS evidence, invoke the `codify
|
|
|
134
134
|
- Follow the verification lifecycle: confirm quality gates, classify, check tooling, fail fast, plan, execute, codify, spec conformance, loop
|
|
135
135
|
- Every passing empirical verification must be codified as a regression test via `codify-verification` before declaring done (skip allowed only for PR / Documentation / Deploy / Investigate-Only)
|
|
136
136
|
- Tests, typecheck, lint, and format are quality gates (prerequisites), NOT verification — never report them as verification evidence
|
|
137
|
-
- Falsify every check you author before reporting a clean result: break the guarded property, confirm the check fails and NAMES the right location, restore. Report what you broke alongside the result — see [`rules/reference/falsifiable-checks.md`](../rules/reference/falsifiable-checks.md)
|
|
137
|
+
- Falsify every check you author before reporting a clean result: break the guarded property, confirm the check fails and NAMES the right location, restore. Run the break on a scratch copy (a throwaway detached `git worktree add` or a temp copy of the touched files), never in a worktree another agent is editing: an in-place mutate/restore races a builder's edits and can delete or commit their work. Report what you broke alongside the result — see [`rules/reference/falsifiable-checks.md`](../rules/reference/falsifiable-checks.md)
|
|
138
138
|
- A zero-hit sweep is meaningless until the detector has found known instances on a ref where the defect still exists; a passing probe needs a deliberate bite control that MUST report a problem
|
|
139
139
|
- State each clean result's blind spot (presence vs. value, reachability, class completeness) — a negative result describes what the check can perceive, not the code
|
|
140
140
|
- Discover existing project scripts and tools before creating new ones
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Falsifiable Checks (load-bearing)
|
|
2
2
|
|
|
3
|
-
A check that cannot fail is not evidence. Before you report a clean result from a check you wrote or changed, break the guarded property and confirm the check fails at the right location. Then restore it, and say what you broke. If you did not falsify a check, report it as unvalidated.
|
|
3
|
+
A check that cannot fail is not evidence. Before you report a clean result from a check you wrote or changed, break the guarded property and confirm the check fails at the right location. Do the break on a scratch copy, never in a worktree another agent is editing. Then restore it, and say what you broke. If you did not falsify a check, report it as unvalidated.
|
|
4
4
|
|
|
5
5
|
- Read the command's own exit status. `gate | tail` reports the status of `tail`, so use `gate >log 2>&1 || status=$?`.
|
|
6
6
|
- To mutation-prove a guard, disable it in production code, run the whole suite, and read which tests fail. Zero failures means the guard is inert.
|
|
@@ -157,19 +157,43 @@ A clean result is a statement about what the check can perceive, not about the c
|
|
|
157
157
|
## How to apply
|
|
158
158
|
|
|
159
159
|
1. Author the check.
|
|
160
|
-
2.
|
|
160
|
+
2. On a scratch copy, never in a worktree another agent is editing, deliberately break the guarded property — specifically, introduce **the exact regression the guard exists to prevent**, not a nearby or convenient break.
|
|
161
161
|
3. Confirm the check **fails and names the right file/line**, then read the failure count and the failing test *names* per the yardstick below.
|
|
162
|
-
4. Restore
|
|
162
|
+
4. Restore by discarding the scratch copy. The green baseline you took in the copy before the break is the green-again evidence; the shared tree was never changed, so there is nothing to restore there.
|
|
163
163
|
5. Report the falsification alongside the result.
|
|
164
164
|
|
|
165
|
+
### Break on a scratch copy, never in a shared worktree
|
|
166
|
+
|
|
167
|
+
A worktree has one working tree. When a builder or another agent is editing it, an in-place mutation is a write into their files: the break and its revert race their concurrent edits, and a revert that lands after their next save can clobber their work or sweep it into a commit. Restore must not depend on the shared tree's state.
|
|
168
|
+
|
|
169
|
+
So every falsification break (steps 2 to 4 above, and the mutation proof below) runs on a scratch copy, made from the repository root:
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
tmp=$(mktemp -d)
|
|
173
|
+
git worktree add --detach "$tmp" HEAD
|
|
174
|
+
git diff --binary HEAD | git -C "$tmp" apply --allow-empty # tracked changes, binaries included
|
|
175
|
+
git ls-files --others --exclude-standard -z |
|
|
176
|
+
rsync -a --from0 --files-from=- ./ "$tmp"/ # untracked new files
|
|
177
|
+
ln -s "$PWD/node_modules" "$tmp/node_modules" # dependencies (or run the project's install in "$tmp")
|
|
178
|
+
# 1. baseline: run the check in "$tmp" BEFORE breaking anything; it must be green
|
|
179
|
+
# 2. break the property in "$tmp", run the check there, read the failure
|
|
180
|
+
git worktree remove --force "$tmp" # discarding the copy is the restore
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The copy must be complete before the break means anything. `git diff` carries only tracked changes, so new files need the explicit untracked copy, and a fresh worktree has no installed dependencies, so link them (never install into the linked directory from the copy) or install them there. **In a workspace monorepo, install in the copy instead of linking:** a linked `node_modules` resolves each workspace package back to the original checkout, so a break reached through a workspace package name never runs, the check stays green, and the guard is wrongly reported inert. Then take the **baseline**: run the check in the copy before breaking anything and confirm it is green. A red baseline means the copy is incomplete (a missing new file, missing dependencies), not that the guard bites; fix the copy first. That green baseline is also the green-again evidence for the restore, because discarding the copy is the restore and the shared tree was never touched.
|
|
184
|
+
|
|
185
|
+
Make the scratch copy with a plain `git worktree add --detach` at a temp path and address it by absolute path. Never use a harness tool that switches the session's working directory into it (for example Claude Code's `EnterWorktree`): that moves every agent sharing the session out of the tree it is working in.
|
|
186
|
+
|
|
187
|
+
A temp copy of only the touched files is acceptable when the check can run against them in isolation; it needs the same baseline. Either way, the shared tree is never written to.
|
|
188
|
+
|
|
165
189
|
### The failure count is part of the evidence
|
|
166
190
|
|
|
167
191
|
Step 3's cardinality is not pedantry; each deviation names a distinct defect. Run it as four steps, in this order:
|
|
168
192
|
|
|
169
|
-
1. **Neuter the protection in production code** — delete the branch, drop the token from the enum, remove the check. Editing a *test* proves nothing about the guard; it only proves the test file is loaded.
|
|
193
|
+
1. **Neuter the protection in production code, on a scratch copy** (never in a worktree another agent is editing; see above) — delete the branch, drop the token from the enum, remove the check. Editing a *test* proves nothing about the guard; it only proves the test file is loaded.
|
|
170
194
|
2. **Run the whole suite.** Never a single test file, and never a path filter.
|
|
171
195
|
3. **Count the failures and read their names.** The count alone is ambiguous; the names are what separate "several failures of one regression" from "several unrelated failures."
|
|
172
|
-
4. **
|
|
196
|
+
4. **Restore by discarding the scratch copy.** The green baseline taken in the copy before the break is the green-again evidence.
|
|
173
197
|
|
|
174
198
|
Then read the result:
|
|
175
199
|
|
|
@@ -280,10 +304,10 @@ A check that cannot fail is not evidence.
|
|
|
280
304
|
|
|
281
305
|
A passing test, a clean lint run, a zero-hit sweep, a green ratchet: each is evidence **only if that check is known to be capable of failing.** Otherwise it is a checkbox, and a green suite that protects nothing is worse than none — it suppresses the search for the defect.
|
|
282
306
|
|
|
283
|
-
**Before reporting any clean, zero, or passing result from a check you authored or modified, prove it fails on known-bad input.** Break the thing being guarded, confirm the check fails *and names the right location*, then
|
|
307
|
+
**Before reporting any clean, zero, or passing result from a check you authored or modified, prove it fails on known-bad input.** Break the thing being guarded on a scratch copy, never in a worktree another agent is editing, confirm the check fails *and names the right location*, then discard the copy. That falsification is part of the deliverable, not an optional extra.
|
|
284
308
|
|
|
285
309
|
- **Falsify before reporting.** No clean result is reportable until the check has been shown to fail on a deliberate break. **"Mentally reverting" does not count** — reasoning that the assertion *would* fail is precisely the step that lets a non-functional guard ship, because the author already believes it is load-bearing. Run the break.
|
|
286
|
-
- **Mutation-prove the guard, then read the cardinality.** Neuter the protection **in production code**, run the **whole suite
|
|
310
|
+
- **Mutation-prove the guard, then read the cardinality.** Neuter the protection **in production code**, on a scratch copy, run the **whole suite** there, count the failures and **read their names**, then discard the copy. **Zero** ⇒ the guard is inert (one pinning a single field shipped with all 50 tests green while the regression walked through). **Many, unrelated** ⇒ over-broad; its next failure will not name the cause. **Exactly one, or several all named for the same regression** ⇒ load-bearing and correctly scoped. A **zero is robust to contention** — load only ever adds failures — so only the non-zero counts need a quiet machine.
|
|
287
311
|
- **The automated mutation gate is language-scoped; the manual probe above is not.** Stryker instruments the JavaScript and TypeScript family plus Vue, HTML and Svelte — there is **no shell parser**, so a guard whose logic lives in `.sh` yields no mutants under **any** `mutate` list. Adding one aborts the whole run (`No parser registered for .sh!` — measured, not inferred), taking every other guard's score with it. A mutation gate grey or green on a shell-guard change **measured nothing about that guard**; reading it as coverage is the fifth failure mode above wearing a config file. Shell guards are covered by **driving tests only**: execute the script against a payload table and assert the blocked/allowed verdict, with a control on **both** sides — a refusal case *and* an allowed case. A shell guard nothing executes has no bite evidence at all, whatever the gate printed.
|
|
288
312
|
- **Never scope the probe by filename, and never infer absent coverage from a grep.** Suites split at the line cap, so a protection's tests often sit in a sibling file: a filename-scoped probe reported cardinality 0 on a live security fix that a whole-suite run showed failing 4 tests, every one named for it.
|
|
289
313
|
- **Assert that no copy is wrong, not that some copy is right.** An existential assertion over duplicated content is satisfied by the correct copy and cannot see the broken one — rewriting one suite's assertions to universal negatives took the same mutation from **0 to 18** failures. Enumerate the property (*every* marker uses an em-dash), never the one known-bad spelling.
|
|
@@ -22,7 +22,7 @@ Never assume something works because the code "looks correct." Run a command, ob
|
|
|
22
22
|
|
|
23
23
|
**If all you did was run tests, typecheck, and lint — you have NOT verified.** You have only confirmed quality checks pass. Verification requires running the actual system and observing the results: making HTTP requests, clicking through the UI, executing CLI commands, querying the database, or otherwise interacting with the running software as an end user would.
|
|
24
24
|
|
|
25
|
-
**A check that cannot fail is not evidence either.** Every gate, probe, sweep, and codified spec you author is subject to the `falsifiable-checks` rule: break the guarded property, see the check fail at the right location, restore, and report that falsification.
|
|
25
|
+
**A check that cannot fail is not evidence either.** Every gate, probe, sweep, and codified spec you author is subject to the `falsifiable-checks` rule: break the guarded property on a scratch copy, never in a worktree another agent is editing, see the check fail at the right location, restore, and report that falsification.
|
|
26
26
|
|
|
27
27
|
### Browser-controller neutrality
|
|
28
28
|
|
|
@@ -149,10 +149,12 @@ Confirm:
|
|
|
149
149
|
|
|
150
150
|
Do it one of these ways, in order of preference:
|
|
151
151
|
|
|
152
|
-
- **Run against the pre-fix commit** (bug fixes):
|
|
153
|
-
- **Break the property
|
|
152
|
+
- **Run against the pre-fix commit** (bug fixes): add a throwaway detached worktree at the failing commit (`git worktree add --detach <tmp> <pre-fix-sha>`). Copy the new test, plus every new helper or fixture it imports, to the same paths there (`mkdir -p` the parent directories first), and give the copy its dependencies (symlink `node_modules` from your tree, or run the project's install there). Run the test and confirm it fails **at the assertion**, not on an import or a missing module, then `git worktree remove --force <tmp>`. Your own branch is never checked out away from.
|
|
153
|
+
- **Break the property on a scratch copy**: add a throwaway detached worktree (`git worktree add --detach <tmp> HEAD`), apply the uncommitted diff (`git diff --binary HEAD | git -C <tmp> apply --allow-empty`), copy in untracked new files, and give it its dependencies as above. Run the test there **before** breaking anything and confirm it is green: a red baseline means the copy is incomplete, not that the test bites. Then delete the field, revert the line, or flip the condition; run; remove the worktree. Prefer this when there is no single pre-fix commit. The full recipe is in `falsifiable-checks`.
|
|
154
154
|
- **Unit-test the checker against synthetic bad input**: required when the input is generated, schema-validated, or cached — a revert can silently fail to change what the test reads (a generator that errors leaves the previous artifact in place, and the test then "passes" on stale input).
|
|
155
155
|
|
|
156
|
+
Every break runs on a scratch copy, never in a worktree another agent is editing. A worktree has one working tree, so an in-place mutation writes into a concurrent builder's files, and a restore that lands after their next save can delete or commit their work. Restore must never depend on the shared tree's state; discarding the scratch worktree is the restore.
|
|
157
|
+
|
|
156
158
|
Two properties the failure itself must have:
|
|
157
159
|
|
|
158
160
|
- It must **name the right location**. A failure that does not localize is weak evidence the test is measuring the intended thing.
|
|
@@ -342,7 +342,7 @@ Before finishing, execute the Verify flow:
|
|
|
342
342
|
7a. Confirm two-way linkage before treating PR submission as complete: the PR body/title/branch must reference the work item, and the work item must have either a verified native PR link or the single managed `[lisa-pr-link]` comment. Establish that comment with `node scripts/lisa-work-item.mjs backlink --ref <work_item_ref> --pr-url <url>` rather than posting it by hand — it is idempotent, and it is the same file that enforces the check, so producer and consumer cannot drift.
|
|
343
343
|
8. PR Watch Loop: Drive the PR to merge via the `drive-pr-to-merge` skill — the single source of truth for clearing every blocker (auto-merge with direct-merge fallback, `BEHIND` re-sync, conflict resolution, failing-check fixes, human + bot review-comment handling with thread resolution, stale `CHANGES_REQUESTED` dismissal, and post-merge ancestry verification). `git-submit-pr` already invokes it; if you reach this step with a PR already open, invoke `drive-pr-to-merge` directly with the PR number. For a large review backlog you may delegate independent code fixes to subagents, but `drive-pr-to-merge` owns the loop and the terminal conditions — do not re-implement them.
|
|
344
344
|
9. Merge the PR, then refresh the ticket-side backlink with `lisa-tracker-sync <work_item_ref> pr-merged pr_url=<url> merge_sha=<sha> tracker_provider=<provider>`.
|
|
345
|
-
10. Monitor the deploy action that triggers automatically from the successful merge
|
|
345
|
+
10. Monitor the deploy action that triggers automatically from the successful merge, in the own turn of the agent running this flow (the lead) with a bounded foreground watch. Do not look the run up again: `lisa-drive-pr-to-merge` already confirmed it during step 8 (its deploy-run check). If step 8 returned `blocked:deploy` or `blocked:no-deploy-run`, no deploy run fired, and that is not a code failure: treat it as blocked under the blocked-deploy rule below, and never open a fix PR for it. Otherwise watch the run step 8 confirmed. The ceiling is 60 minutes from the merge, unless the work item or the deploy workflow's own `timeout-minutes` sets another. Before each watch, first read `gh run view <run id> --json status,conclusion`: a run that has already concluded is judged by its conclusion, whatever the time. Only for a run still in progress, compute the seconds remaining before the ceiling; if none remain, stop watching and apply the blocked-deploy rule. Otherwise watch with `timeout <n> gh run watch <run id> --interval 30 --exit-status`, where `<n>` is the smaller of 540 and the seconds remaining (`timeout <n>` where the `timeout` utility exists; otherwise rely on the harness's own command timeout), give the tool call a timeout just above `<n>` (at most 600000 ms on Claude Code), and re-poll `gh run view <run id> --json status,conclusion` after each return until the run concludes. A run that concluded successfully proceeds to step 12; one that concluded unsuccessfully is a deploy failure — go to step 11. A run still in progress at the ceiling is not a code failure: treat it as blocked under the blocked-deploy rule, and never open a fix PR for it. Blocked-deploy rule: diagnose why no run fired or why the run did not finish. A repository-owned technical gap (a misconfigured trigger, a missing `workflow_dispatch`, a deploy job that hangs) is an actionable blocker under step 2a — file and link the build-ready ticket. Missing access, credentials or a human decision is a human-only blocker under step 2a. Either way, record the blocked verdict and end the flow there: skip steps 11–14, still post evidence (step 15), and keep the binding (step 16). **Never wait on the deploy with a detached or background watcher** — no trailing `&`, no `nohup`, no harness background task, no scheduled re-check — because its result reaches only the agent that started it, never the lead, which then sits idle after the deploy has finished. This is the same rule `lisa-drive-pr-to-merge` applies to the CI wait. If a watcher subagent is used anyway, it must `SendMessage` the lead the moment the run succeeds or fails, and the lead's turn may end only to wait for that message. On runtimes without cross-agent messaging, the foreground watch is the only option.
|
|
346
346
|
11. If deploy fails, fix the failure, open a new PR and then go back to step 7
|
|
347
347
|
12. Remote verification: `verification-specialist` verifies in target environment (same checks as local verification, but on remote), and refreshes the verdict (step 2a) to reflect the remote result. Resolve credentials through the `verification-lifecycle` lookup order before declaring any missing. If they remain genuinely unavailable, do not complete on artifact-only evidence: post a tracker comment naming every credential source checked and what could not be verified as a result, transition the work item to the configured blocked state, and apply the configured `needs-human` / `human-review` label (creating it when the tracker supports label creation and it is missing). The comment is what makes the escalation auditable — a label alone records that something stopped, not what was tried or why. Evidence must explicitly distinguish `verified empirically` from `artifact-only / verification deferred`.
|
|
348
348
|
13. `ops-specialist`: post-deploy health check via `lisa-monitor <env> --report-only`, monitor for errors in first minutes. `--report-only` is REQUIRED: it keeps the post-deploy check a pure health/audit report so monitor's standalone ticket-filing never fires inside this flow.
|
|
@@ -25,7 +25,7 @@ When your task belongs to a tracked work item — it names `work_item_context` o
|
|
|
25
25
|
|
|
26
26
|
Do not write tests against the implementation's shape — they pass through a rewrite that breaks behaviour, which is the opposite of the job. Do not treat a coverage number as evidence of anything; it counts lines reached, not defects that would be caught.
|
|
27
27
|
|
|
28
|
-
Do not hand on a test you have not watched fail. A test that cannot fail is worse than a missing one: it reports the defect as absent and ends the search. Break the behaviour, watch the assertion fail and name the right place, restore. Watch especially for the assertion that is satisfiable by the test's own fixture rather than by the artifact under test — that one passes no matter what the production code does. [`rules/falsifiable-checks-reference.mdc`](../rules/falsifiable-checks-reference.mdc) has the four observed shapes.
|
|
28
|
+
Do not hand on a test you have not watched fail. A test that cannot fail is worse than a missing one: it reports the defect as absent and ends the search. Break the behaviour on a scratch copy, never in a worktree another agent is editing, watch the assertion fail and name the right place, restore. Watch especially for the assertion that is satisfiable by the test's own fixture rather than by the artifact under test — that one passes no matter what the production code does. [`rules/falsifiable-checks-reference.mdc`](../rules/falsifiable-checks-reference.mdc) has the four observed shapes.
|
|
29
29
|
|
|
30
30
|
## What you hand on
|
|
31
31
|
|
|
@@ -134,7 +134,7 @@ For every empirical verification that produced PASS evidence, invoke the `codify
|
|
|
134
134
|
- Follow the verification lifecycle: confirm quality gates, classify, check tooling, fail fast, plan, execute, codify, spec conformance, loop
|
|
135
135
|
- Every passing empirical verification must be codified as a regression test via `codify-verification` before declaring done (skip allowed only for PR / Documentation / Deploy / Investigate-Only)
|
|
136
136
|
- Tests, typecheck, lint, and format are quality gates (prerequisites), NOT verification — never report them as verification evidence
|
|
137
|
-
- Falsify every check you author before reporting a clean result: break the guarded property, confirm the check fails and NAMES the right location, restore. Report what you broke alongside the result — see [`rules/falsifiable-checks-reference.mdc`](../rules/falsifiable-checks-reference.mdc)
|
|
137
|
+
- Falsify every check you author before reporting a clean result: break the guarded property, confirm the check fails and NAMES the right location, restore. Run the break on a scratch copy (a throwaway detached `git worktree add` or a temp copy of the touched files), never in a worktree another agent is editing: an in-place mutate/restore races a builder's edits and can delete or commit their work. Report what you broke alongside the result — see [`rules/falsifiable-checks-reference.mdc`](../rules/falsifiable-checks-reference.mdc)
|
|
138
138
|
- A zero-hit sweep is meaningless until the detector has found known instances on a ref where the defect still exists; a passing probe needs a deliberate bite control that MUST report a problem
|
|
139
139
|
- State each clean result's blind spot (presence vs. value, reachability, class completeness) — a negative result describes what the check can perceive, not the code
|
|
140
140
|
- Discover existing project scripts and tools before creating new ones
|