@codyswann/lisa 2.345.1 → 2.346.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/all/copy-overwrite/scripts/check-state-classification.mjs +609 -0
  2. package/all/copy-overwrite/scripts/lisa-command-envelope.mjs +194 -0
  3. package/all/copy-overwrite/scripts/lisa-schema-validate.mjs +208 -0
  4. package/all/copy-overwrite/scripts/schemas/lisa-command-envelope.v1.schema.json +119 -0
  5. package/all/copy-overwrite/scripts/schemas/lisa-state-contract.v1.schema.json +191 -0
  6. package/all/create-only/state/README.md +41 -0
  7. package/all/create-only/state/state-contract.example.json +46 -0
  8. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  9. package/dist/core/upstream-evidence-manifest.js +56 -9
  10. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  11. package/package.json +1 -1
  12. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  13. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  14. package/plugins/lisa/.codex-plugin/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  15. package/plugins/lisa/.codex-plugin/skills/lisa-codify-verification/SKILL.md +4 -0
  16. package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +2 -0
  17. package/plugins/lisa/.codex-plugin/skills/lisa-research/SKILL.md +7 -1
  18. package/plugins/lisa/.codex-plugin/skills/lisa-task-decomposition/SKILL.md +2 -0
  19. package/plugins/lisa/.codex-plugin/skills/lisa-test-strategy/SKILL.md +1 -0
  20. package/plugins/lisa/.codex-plugin/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  21. package/plugins/lisa/.codex-plugin/skills/lisa-verify/SKILL.md +1 -1
  22. package/plugins/lisa/rules/eager/reset-seed-coverage.md +48 -0
  23. package/plugins/lisa/rules/reference/reset-seed-coverage.md +231 -0
  24. package/plugins/lisa/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  25. package/plugins/lisa/skills/lisa-codify-verification/SKILL.md +4 -0
  26. package/plugins/lisa/skills/lisa-implement/SKILL.md +2 -0
  27. package/plugins/lisa/skills/lisa-research/SKILL.md +7 -1
  28. package/plugins/lisa/skills/lisa-task-decomposition/SKILL.md +2 -0
  29. package/plugins/lisa/skills/lisa-test-strategy/SKILL.md +1 -0
  30. package/plugins/lisa/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  31. package/plugins/lisa/skills/lisa-verify/SKILL.md +1 -1
  32. package/plugins/lisa-agy/plugin.json +1 -1
  33. package/plugins/lisa-agy/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  34. package/plugins/lisa-agy/skills/lisa-codify-verification/SKILL.md +4 -0
  35. package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +2 -0
  36. package/plugins/lisa-agy/skills/lisa-research/SKILL.md +7 -1
  37. package/plugins/lisa-agy/skills/lisa-task-decomposition/SKILL.md +2 -0
  38. package/plugins/lisa-agy/skills/lisa-test-strategy/SKILL.md +1 -0
  39. package/plugins/lisa-agy/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  40. package/plugins/lisa-agy/skills/lisa-verify/SKILL.md +1 -1
  41. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  43. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  44. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-copilot/rules/eager/reset-seed-coverage.md +48 -0
  48. package/plugins/lisa-copilot/rules/reference/reset-seed-coverage.md +231 -0
  49. package/plugins/lisa-copilot/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  50. package/plugins/lisa-copilot/skills/lisa-codify-verification/SKILL.md +4 -0
  51. package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +2 -0
  52. package/plugins/lisa-copilot/skills/lisa-research/SKILL.md +7 -1
  53. package/plugins/lisa-copilot/skills/lisa-task-decomposition/SKILL.md +2 -0
  54. package/plugins/lisa-copilot/skills/lisa-test-strategy/SKILL.md +1 -0
  55. package/plugins/lisa-copilot/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  56. package/plugins/lisa-copilot/skills/lisa-verify/SKILL.md +1 -1
  57. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-cursor/rules/reset-seed-coverage-reference.mdc +236 -0
  59. package/plugins/lisa-cursor/rules/reset-seed-coverage.mdc +53 -0
  60. package/plugins/lisa-cursor/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  61. package/plugins/lisa-cursor/skills/lisa-codify-verification/SKILL.md +4 -0
  62. package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +2 -0
  63. package/plugins/lisa-cursor/skills/lisa-research/SKILL.md +7 -1
  64. package/plugins/lisa-cursor/skills/lisa-task-decomposition/SKILL.md +2 -0
  65. package/plugins/lisa-cursor/skills/lisa-test-strategy/SKILL.md +1 -0
  66. package/plugins/lisa-cursor/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  67. package/plugins/lisa-cursor/skills/lisa-verify/SKILL.md +1 -1
  68. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-expo/.codex-plugin/skills/ops-db-ops/SKILL.md +93 -2
  71. package/plugins/lisa-expo/skills/ops-db-ops/SKILL.md +94 -3
  72. package/plugins/lisa-expo/skills/ops-db-ops/agents/openai.yaml +2 -2
  73. package/plugins/lisa-expo-agy/plugin.json +1 -1
  74. package/plugins/lisa-expo-agy/skills/ops-db-ops/SKILL.md +94 -3
  75. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-expo-copilot/skills/ops-db-ops/SKILL.md +94 -3
  77. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-expo-cursor/skills/ops-db-ops/SKILL.md +94 -3
  79. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  81. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  82. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  86. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  87. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  91. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  92. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  95. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  96. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  97. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  101. package/plugins/lisa-rails-agy/plugin.json +1 -1
  102. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  106. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  107. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  110. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  111. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  112. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  114. package/plugins/src/base/rules/eager/reset-seed-coverage.md +48 -0
  115. package/plugins/src/base/rules/reference/reset-seed-coverage.md +231 -0
  116. package/plugins/src/base/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  117. package/plugins/src/base/skills/lisa-codify-verification/SKILL.md +4 -0
  118. package/plugins/src/base/skills/lisa-implement/SKILL.md +2 -0
  119. package/plugins/src/base/skills/lisa-research/SKILL.md +7 -1
  120. package/plugins/src/base/skills/lisa-task-decomposition/SKILL.md +2 -0
  121. package/plugins/src/base/skills/lisa-test-strategy/SKILL.md +1 -0
  122. package/plugins/src/base/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  123. package/plugins/src/base/skills/lisa-verify/SKILL.md +1 -1
  124. package/plugins/src/expo/skills/ops-db-ops/SKILL.md +94 -3
  125. package/scripts/check-state-classification.mjs +27 -0
package/package.json CHANGED
@@ -120,7 +120,7 @@
120
120
  }
121
121
  },
122
122
  "name": "@codyswann/lisa",
123
- "version": "2.345.1",
123
+ "version": "2.346.0",
124
124
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
125
125
  "main": "dist/index.js",
126
126
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.345.1",
3
+ "version": "2.346.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.345.1",
3
+ "version": "2.346.0",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -65,6 +65,7 @@ For each acceptance criterion:
65
65
  - Every user flow must include at least one error path
66
66
  - Use Gherkin format (Given/When/Then) for user flows to enable direct translation into test cases
67
67
  - For frontend work, the `bdd-e2e-coverage` rule applies: name the scenario IDs the item will add or change in the project's behavior contract and the platforms each must hold on, and list the contract update plus the aligned e2e automation as explicit acceptance criteria -- they are deliverables, not implied work. List the passing coverage gate and the regenerated matrix and burndown as explicit acceptance criteria too -- the item is not done on a code-complete mapping alone
68
+ - For work that adds or changes persistent state, the `reset-seed-coverage` rule applies: name the persistent entities the item introduces or changes and the reset policy each takes (`fixture-owned` / `preserve` / `derived-rebuild` / `forbidden`), and list the state-contract update, the sweep for anything `fixture-owned`, and the passing state-classification check as explicit acceptance criteria -- they are deliverables, not implied work. Rows are only one kind of state: identity-provider objects, object storage, search indexes, queues, caches and derived views count too
68
69
  - When verifying, always run the feature -- never review by only reading code
69
70
  - If you cannot run the feature (missing dependencies, services unavailable), report as a blocker -- do not guess
70
71
  - If the changes are purely internal (refactoring, config, tooling), report "No user-facing impact" and explain why
@@ -83,6 +83,10 @@ For **frontend work** — any verification whose validation journey exercised a
83
83
 
84
84
  Every artifact encodes the SAME verified journey against a different platform. One is never a substitute for another, and a passing test on one platform never seals another platform's obligation.
85
85
 
86
+ ### 2b. Codifying persistent state (non-demotable)
87
+
88
+ When the verified journey **created, changed, or depended on persistent state**, the `reset-seed-coverage` rule governs what else this codification owes. Classify every entity the work touched in the project's state contract, give anything `fixture-owned` an ownership predicate and a sweep, and run the project's state-classification check the same way the coverage gate is run above — a contract edited but never checked is not proof. Where the journey depended on seeded state, the seed's verify step asserts **exact expected counts** for that state: "at least one" passes against a leak, which is precisely the condition being guarded. Cite the rule for the policy vocabulary and the assurances; do not restate them here.
89
+
86
90
  Permitted exits, mirroring the regression-spec rule in `lisa-implement` (never a silent skip, never "optional", and never a bare `N/A`):
87
91
 
88
92
  - The project genuinely has no runner configured for that platform → record a dated `platformWaivers` entry naming the locations checked and "no runner configured" as the reason, exactly like any other unsealable obligation, per the rule. This is never left as a bare `N/A` — an undated absence has no forcing function to ever get revisited.
@@ -149,6 +149,8 @@ IF it is a Fix (bug), execute the Reproduce sub-flow FIRST:
149
149
 
150
150
  For any Fix flow, and for any Build flow that changes user-visible behavior, regression coverage is a required deliverable at the highest practical observation level for the reported surface. If the project has a browser, device, or end-to-end harness for that platform (for example Playwright, Maestro, Detox, Cypress, or an equivalent runtime), the task plan and definition of done MUST include a deterministic regression spec against the reported surface, using mocked or seeded data where needed. This is alongside unit or integration coverage, not a substitute for it. For **frontend work** the deliverable is defined by the `bdd-e2e-coverage` rule and has two halves, both landing in this PR: the Gherkin scenario (stable ID, required platforms) added or updated in the project's behavior contract, and aligned automation in the project's configured runner for **every** platform that scenario requires — no runner substitutes for another, because they guard different platforms of the same behavior. The coverage gate must pass and the matrix and burndown be regenerated before the item is done. Cite the rule; do not restate its scenario, waiver, or bootstrap mechanics here.
151
151
 
152
+ For work that adds or changes **persistent state**, the `reset-seed-coverage` rule adds a second non-demotable deliverable landing in this same PR: every entity the item introduces or changes is classified in the project's state contract (`fixture-owned` / `preserve` / `derived-rebuild` / `forbidden`) with a reason and an owner, anything `fixture-owned` declares its ownership predicate and is actually swept, and the state-classification check passes. Writing a flow that creates a record and deletes it only on its happy path does NOT satisfy this — that is the leak, not the coverage. Cite the rule; do not restate its policy, waiver, or bootstrap mechanics here.
153
+
152
154
  The team lead may not waive, defer, demote, or phrase this regression spec as "optional", "if cheap", "nice to have", or equivalent. The only permitted exits are:
153
155
 
154
156
  1. The project genuinely has no end-to-end harness for the affected platform; record the checked locations and that absence in the task metadata, PR, and work-item evidence.
@@ -62,7 +62,13 @@ EARS-pattern shape, each with a measurable fit criterion, plus the non-functiona
62
62
  story with frontend scope, its user-facing behavior MUST be expressed as — or in a shape directly
63
63
  convertible to — Given/When/Then scenarios, naming the platforms each behavior must hold on, per the
64
64
  `bdd-e2e-coverage` rule; narrative-only frontend behavior forces that shape to be invented later,
65
- inconsistently, by whoever picks up the ticket. Each scenario stub carries its originating requirement
65
+ inconsistently, by whoever picks up the ticket. Where a requirement introduces or changes
66
+ **persistent state** — anything the system writes that outlives the process that wrote it, rows being
67
+ only one kind — the PRD MUST name that state and the reset policy it is expected to take, per the
68
+ `reset-seed-coverage` rule, so the classification is a stated requirement rather than something
69
+ discovered when a leaked record breaks a suite; that rule also covers the non-row cases (identity
70
+ objects, object storage, search indexes, queues, caches, derived views) a narrative spec routinely
71
+ omits. Each scenario stub carries its originating requirement
66
72
  atom (`R1`, `R2`, …) even though the stable `@BDD-<DOMAIN>-<NNN>` ID is not minted until Plan or
67
73
  Implement — this is what lets a later stage's provenance tag, and `spec-conformance`'s traceability
68
74
  check, walk back from a shipped scenario to the PRD requirement it was written to satisfy, instead of
@@ -56,6 +56,8 @@ For each task, define what "done" looks like:
56
56
 
57
57
  For a **frontend task** -- one that adds or changes a user-observable surface -- the `bdd-e2e-coverage` rule makes two further criteria mandatory on the item itself, never left implied: (a) the Gherkin scenarios it adds or changes in the project's behavior contract, with their stable IDs and required platforms, and (b) aligned e2e automation in the project's configured runner for each of those platforms, with the coverage gate passing and the matrix and burndown regenerated. Carry both into the item's Validation Journey. A project with no behavior contract yet does not get an exemption -- the first such task carries the bootstrap scaffolding as a deliverable, scoped to its own behavior (cite the rule; do not restate its bootstrap steps).
58
58
 
59
+ For a task that adds or changes **persistent state** -- anything the system writes that outlives the process that wrote it, including identity-provider objects, object storage, search indexes, queues, caches and derived views, not only rows -- the `reset-seed-coverage` rule makes two further criteria mandatory on the item itself, never left implied: (a) every entity it introduces or changes is classified in the project's state contract with a reason and an owner, and (b) anything classified `fixture-owned` has a declared ownership predicate and an actual sweep, with the state-classification check passing. Carry both into the item's Validation Journey. A project with no state contract yet does not get an exemption -- the first such task carries the bootstrap scaffolding as a deliverable, scoped to its own state (cite the rule; do not restate its bootstrap steps).
60
+
59
61
  ### 3. Assign Verification Type
60
62
 
61
63
  Each task must have a verification method. Choose the most appropriate:
@@ -58,6 +58,7 @@ Structure findings as:
58
58
  - Always run `bun run test` to understand current test state before recommending or writing new tests
59
59
  - Match existing test conventions -- do not introduce new test patterns
60
60
  - For frontend work, the strategy is not complete until every required scenario-platform obligation has aligned e2e automation in the project's configured runner for that platform, or a dated waiver naming the runner limitation (`bdd-e2e-coverage`). A unit test, a route boot, or a passing test on a different platform never seals an obligation
61
+ - For work that adds or changes persistent state, the strategy is not complete until each new entity is classified in the project's state contract and anything `fixture-owned` has a sweep, per the `reset-seed-coverage` rule. Per-flow self-cleanup is not a strategy: a flow that deletes what it created only on its happy path leaks on every failure in between, which is how state pollution becomes an unreproducible flake months later
61
62
  - Every test must have a clear "why" -- no tests for testing's sake
62
63
  - Focus on testing behavior, not implementation details
63
64
  - Verification commands must be runnable locally (no CI/CD dependencies)
@@ -374,6 +374,7 @@ A task is done only when:
374
374
  - Proof artifacts are captured
375
375
  - Every passing empirical verification is codified as a regression test (or has an explicit, documented skip reason from the allowed set)
376
376
  - For frontend work, the `bdd-e2e-coverage` contract is satisfied: every user-facing behavior added or changed exists as a Gherkin scenario with a stable ID traceable to the work item, every required scenario-platform obligation is mapped to aligned e2e automation in the project's configured runner for that platform or carries a dated waiver, and the coverage gate passes with the matrix and burndown regenerated and committed. Missing BDD coverage is a verification failure, not a warning
377
+ - For work that adds or changes persistent state, the `reset-seed-coverage` contract is satisfied: every entity introduced or changed is classified in the project's state contract with a reason and an owner, anything `fixture-owned` declares its ownership predicate and is actually swept, and the state-classification check passes in the same PR. An unclassified entity fails closed; per-flow self-cleanup is not coverage
377
378
  - For a leaf work unit, every typed `[EVIDENCE: <artifact-type>: <name>]` marker declared in its Validation Journey has a captured, non-empty artifact of the declared type attached to the ticket (the evidence manifest is fully satisfied)
378
379
  - Cross-work-item `EVIDENCE-REF` pointers were excluded from the local manifest and did not satisfy S14 or completion; a runtime-changing leaf has at least one local claiming marker
379
380
  - Spec conformance verdict is `CONFORMS` (not `PARTIAL`, not `DIVERGES`)
@@ -35,7 +35,7 @@ Treat the first successful lead-spawn request (or, on the Codex fallback, the fi
35
35
 
36
36
  Execute the **Verify** flow as defined in the `intent-routing` rule (loaded via the lisa plugin). The flow includes:
37
37
 
38
- 1. **Pre-flight: codification gate** — confirm that every passing local empirical verification on this branch was codified as a regression test (the Implement flow's codify step). If any verification has no committed test and no allowed skip reason (PR / Documentation / Deploy / Investigate-Only), invoke `codify-verification` now and amend the PR before shipping. For frontend work the gate additionally enforces the `bdd-e2e-coverage` rule: the shipped behavior exists as a Gherkin scenario with a stable ID, every required scenario-platform obligation has aligned automation in the project's configured runner for that platform or a dated waiver, and the project's coverage gate passes with the matrix regenerated. A missing runner is never a bare recorded absence — it needs a dated `platformWaivers` entry (per the rule) and, where the runner could reasonably be added, a linked build-ready follow-up ticket referenced from it; never a silent skip. Missing BDD coverage is a verification failure that blocks the ship, not a warning. A change cannot ship until its verifications are guarded.
38
+ 1. **Pre-flight: codification gate** — confirm that every passing local empirical verification on this branch was codified as a regression test (the Implement flow's codify step). If any verification has no committed test and no allowed skip reason (PR / Documentation / Deploy / Investigate-Only), invoke `codify-verification` now and amend the PR before shipping. For frontend work the gate additionally enforces the `bdd-e2e-coverage` rule: the shipped behavior exists as a Gherkin scenario with a stable ID, every required scenario-platform obligation has aligned automation in the project's configured runner for that platform or a dated waiver, and the project's coverage gate passes with the matrix regenerated. A missing runner is never a bare recorded absence — it needs a dated `platformWaivers` entry (per the rule) and, where the runner could reasonably be added, a linked build-ready follow-up ticket referenced from it; never a silent skip. Missing BDD coverage is a verification failure that blocks the ship, not a warning. A change cannot ship until its verifications are guarded. For work that adds or changes persistent state the gate additionally enforces the `reset-seed-coverage` rule: every entity the work introduces or changes is classified in the project's state contract, anything `fixture-owned` has an ownership predicate and a sweep, and the state-classification check passes — an unclassified entity fails closed and blocks the ship exactly as missing BDD coverage does.
39
39
  2. **Commit** any pending changes via `lisa-git-commit`
40
40
  3. **Push and PR** via `lisa-git-submit-pr`
41
41
  4. **PR Watch Loop** — drive the PR to MERGED via `lisa-drive-pr-to-merge`, 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 (it invokes `lisa-pull-request-review` itself), stale `CHANGES_REQUESTED` dismissal, and post-merge ancestry verification. Do not re-implement the loop or its terminal conditions.
@@ -0,0 +1,48 @@
1
+ # Reset/Seed Coverage & State Classification (load-bearing)
2
+
3
+ **Every persistent entity a project owns carries exactly one declared reset policy, and a work item that adds or changes persistent state is not done until the reset/seed contract covers it.** An entity the running system holds but the contract does not classify is a contract violation, and the check that finds it **fails closed** — an unclassified entity is never treated as safe to keep and never treated as safe to delete.
4
+
5
+ **One vendor-neutral contract, cited by** `lisa-research`, `lisa-acceptance-criteria`, `lisa-task-decomposition`, `lisa-test-strategy`, `lisa-implement`, `lisa-codify-verification`, `lisa-verification-lifecycle`, and `lisa-verify` (the `leaf-only-lifecycle` / `repo-scope-split` precedent: one shared slug, never divergent per-skill prose). It never names a database engine, cloud, identity provider, or test runner — those are project configuration.
6
+
7
+ ## Why this exists
8
+
9
+ Test suites create state. Without a contract, cleanup is a habit: a flow creates a uniquely-marked record and deletes it on the happy path only, so every early failure leaks one more. Nothing sweeps it, nothing complains, and the suite degrades until someone reads a flake as a product bug. The observed shape is always the same — leaked records accumulate silently until a list view, a uniqueness constraint, or a count assertion breaks. Per-flow self-cleanup is not coverage; it is the failure mode.
10
+
11
+ ## Membership
12
+
13
+ Membership is **state, not repo name, ticket label, or storage engine**: an entity is in scope the moment something the project writes **outlives the process that wrote it**. That includes rows and tables, but rows are only one kind of state. Also in scope: identity-provider objects (accounts, groups, memberships, sessions), object storage (buckets, prefixes, uploaded files), search indexes, queues and topics (in-flight and dead-letter), caches with a persistence tier, materialized/derived views and projections, feature-flag and configuration overrides, scheduled jobs created at runtime, and analytics or third-party side effects a run leaves behind. Out of scope: values that live only in memory for the duration of one process.
14
+
15
+ A work item is in scope when it **adds** such an entity, **changes what owns or writes** one, or **changes the lifetime** of one. Renames count as changes, not as new entities plus deletions.
16
+
17
+ ## The four policies
18
+
19
+ Every entity is classified as exactly one of:
20
+
21
+ - **`fixture-owned`** — the reset may create, mutate, and delete rows here, but only those it owns. Ownership is declared as a predicate (a reserved id shape, a reserved account or namespace, a marker attribute), never as "everything in this entity."
22
+ - **`preserve`** — the reset must leave this untouched. Catalog, reference data, anything a migration seeds, anything expensive or impossible to rebuild, and any state belonging to someone who is not the fixture.
23
+ - **`derived-rebuild`** — not authored by anyone; recomputed from its sources after the reset (projections, materialized views, search indexes, caches). The reset rebuilds it rather than clearing or preserving it, and proves it converged.
24
+ - **`forbidden`** — the reset must be structurally unable to touch it: ledgers, payments, wallets, withdrawals, audit trails, anything irreversible. Declaring `forbidden` obliges naming the enforcement outside the script — a least-privilege role, a revoked grant, a separate account or credential boundary — because a script-only promise dies in the refactor that drops the safe caller.
25
+
26
+ **Classify by provenance, never by observation.** "The table looked empty" is not evidence it is unused; runtime statistics are approximations, and a table that has never been analyzed reports rows it holds. Ask who writes it and whether anything can put it back.
27
+
28
+ ## Keep-lists are a detector, not the safety model
29
+
30
+ Deriving the clear-list by subtracting a keep-list from a schema listing is a **useful detector** — run it, and let it flag entities the contract has not seen. It is not the boundary. It cannot model renames, multiple schemas, framework-generated entities, views, partitions, row-level ownership, or any of the non-DB state above, and "new entities are cleared unless exempted" erases unrelated data the first time something adds one. The boundary is the classification; subtraction only tells you the classification is stale.
31
+
32
+ ## Required assurances
33
+
34
+ A reset contract is not complete until it declares, and points at evidence for, all of: non-fixture and catalog data survive; reserved fixture identifiers are rejected on collision with anything real; foreign references into preserved entities are refused rather than cascaded; every write is **acknowledged** (a mutation reported by the caller and not confirmed by the system is a failure, not a success); a second apply converges to the same state and reports no further change; the post-state is verified by **exact expected counts**, not "at least one"; and production fails closed with no override of any kind. Where the platform can enforce a boundary with roles, grants, or constraints, it does — the in-process guard remains as defense in depth, never as the primary control.
35
+
36
+ ## Definition of done
37
+
38
+ A work item that adds or changes persistent state is not done until: (1) every entity it introduces or changes is classified in the project's state contract with a reason and an owner; (2) `fixture-owned` entities it introduces declare their ownership predicate **and** are actually swept by the reset — an entity a suite creates but nothing removes is the leak this rule exists to prevent; (3) `preserve`/`forbidden` entities it introduces name their enforcement; (4) any seed the suite depends on covers the new state, with the verify step asserting exact counts; and (5) the state-classification check passes in the same PR. **A missing or stale classification is a verification failure, not a warning** — it blocks completion exactly as a `PARTIAL` spec-conformance verdict does, and is never demoted to "optional", "if cheap", or a follow-up without a linked build-ready ticket created before merge.
39
+
40
+ ## Bootstrap, noop, and degradation
41
+
42
+ A project with no state contract yet is not exempt: the first work item touching persistent state scaffolds the minimum (the contract file, its own entities classified, the check wired into CI) and covers **its own** state. It never backfills the whole system — pre-existing unclassified entities are recorded as burndown with an owner and a date, not treated as this item's blocker. A project that genuinely holds no persistent state declares a **machine-readable noop** (`mode: "declared-noop"` with reason, owner, and a capability-manifest reference) which the check verifies against the repo rather than taking on faith — a bare exit 0 is indistinguishable from a successful destructive run and never satisfies this rule. A project that cannot produce a runtime inventory records the checked sources and the absence, exactly as the regression-spec absence path in `verification` does; a silent skip is never one of the exits.
43
+
44
+ ## Command envelope
45
+
46
+ Every reset, seed, verify, inventory, and classification adapter answers the **same interface** — one validated JSON result on stdout, exit 0 only when the operation both completed **and** verified, `--dry-run` mandatory before anything destructive, and a requested stage always re-checked against server-resolved identity rather than trusted. The envelope is specified in the reference body and is what makes "every repo answers the same question the same way" checkable instead of aspirational.
47
+
48
+ Full contract (state-contract schema, check semantics, detectors, envelope schema, enforcement patterns, bootstrap procedure): [reference/reset-seed-coverage.md](../reference/reset-seed-coverage.md).
@@ -0,0 +1,231 @@
1
+ # Reset/Seed Coverage & State Classification
2
+
3
+ Automated suites create state, and the state outlives them. The historical pattern is per-flow
4
+ self-cleanup: a flow creates a uniquely-marked record at the top and deletes it as its last step, so
5
+ the record survives every failure that happens in between. Nothing sweeps the survivors and nothing
6
+ reports them, so the leak is invisible until a list view, a uniqueness constraint, a pagination
7
+ boundary, or an exact-count assertion breaks — at which point it presents as a product bug or an
8
+ unreproducible flake. The same story has now played out on several entity types in several
9
+ codebases, always with the same three ingredients: state a suite creates, cleanup that only runs on
10
+ the happy path, and no inventory that would have noticed.
11
+
12
+ This contract removes the discipline requirement. Instead of asking every author to remember to
13
+ sweep what they created, it makes the *absence* of a decision a failing check.
14
+
15
+ It is a **single vendor-neutral contract** consumed by `lisa-research` (specs state what persistent
16
+ state the work introduces), `lisa-acceptance-criteria` and `lisa-task-decomposition` (the
17
+ classification and the sweep are explicit deliverables on the work item, not implied work),
18
+ `lisa-test-strategy` and `lisa-implement` (building the item includes both),
19
+ `lisa-codify-verification` (the verify step asserts the post-reset baseline), and
20
+ `lisa-verification-lifecycle` / `lisa-verify` (the check is run, and a miss fails the item). Those
21
+ skills cite this slug; they do not restate it.
22
+
23
+ ## Vendor neutrality is the point
24
+
25
+ This contract never names a database engine, a cloud, an identity provider, an object store, a
26
+ search engine, a queue, or a test runner. Projects use different ones, several at once, and change
27
+ them without touching this contract. What is fixed is the *obligation*: every entity that holds
28
+ state across process boundaries carries exactly one policy, and the running system's inventory is
29
+ compared against that declaration.
30
+
31
+ The words "table" and "row" appear in this document only as examples. An entity is anything with a
32
+ durable identity and a lifetime: a table, a collection, a bucket prefix, an index, a topic, a
33
+ user-pool group, a materialized view, a scheduled job.
34
+
35
+ ## Why "new entities are cleared by default" is the wrong safety model
36
+
37
+ An earlier version of this pattern derived the clear-list by subtracting a hand-maintained keep-list
38
+ from a schema listing: anything new is cleared unless someone deliberately exempts it. It is
39
+ attractive because it fails toward action, and the failure it prevents (a new entity silently
40
+ accumulating) is real. It is still wrong as the *boundary*, for reasons that are structural rather
41
+ than stylistic:
42
+
43
+ - **It erases unrelated data on first contact.** The first change that adds an entity nobody has
44
+ classified deletes its contents on the next run, in whatever non-production environment happened
45
+ to run first. "Non-production" is not "worthless" — shared development environments hold hand-built
46
+ scenarios, support reproductions, and partner sandboxes.
47
+ - **A migrations-directory diff does not model reality.** It cannot see renames (which read as one
48
+ deletion plus one unclassified addition), multiple schemas or namespaces, framework- or
49
+ ORM-generated entities that no migration file names, views, partitions and inheritance children,
50
+ entities created by a deploy rather than a migration, or row-level ownership — the common case
51
+ where an entity holds both fixture rows and rows that must survive.
52
+ - **It only sees the database.** Identity-provider accounts, object-storage prefixes, search indexes,
53
+ queue backlogs, and third-party side effects are invisible to it, and those are precisely where
54
+ leaked test state is most expensive.
55
+
56
+ Subtraction survives in this contract as a **detector**: run it, and treat every entity it finds
57
+ that the contract has not classified as a finding. The safety decision is the classification.
58
+
59
+ ## The state contract
60
+
61
+ Default location `state/state-contract.json` (a project with an equivalent artifact keeps its own
62
+ path and records it in `.lisa.config.json`). It is checked in, reviewed like code, and versioned:
63
+
64
+ | Field | Meaning |
65
+ |---|---|
66
+ | `schemaVersion` | The schema this document conforms to. Pinned; a bump is a deliberate migration. |
67
+ | `contractVersion` | The project's own version for *its* declared state. Bumped whenever policies or ownership predicates change, so evidence from one run cannot be read as evidence for a different contract. |
68
+ | `mode` | `contract` (the normal case) or `declared-noop`. |
69
+ | `owner` | Who answers questions about this file. A team or role, not an individual's personal account. |
70
+ | `environments` | The environments a reset may target, and the identity source each is resolved from. Never a list the caller can extend at runtime. |
71
+ | `fixtureIdentity` | How fixture-owned records are recognized: reserved id shape, reserved account/namespace, marker attribute. This is the ownership predicate the whole model rests on. |
72
+ | `entities[]` | One entry per persistent entity. |
73
+ | `assurances` | The required properties below, each with a pointer to the evidence that proves it. |
74
+ | `waivers[]` | Dated IOUs for entities that genuinely cannot be classified yet. |
75
+
76
+ Each `entities[]` entry carries `id` (stable, fully qualified — namespace plus name), `kind` (the
77
+ project's own vocabulary for what sort of state it is), `policy` (one of the four), `reason` (why,
78
+ in one sentence a reviewer can check), `owner`, and policy-specific obligations:
79
+
80
+ - `fixture-owned` → `ownership` (the predicate identifying rows/objects the reset may delete) and
81
+ `sweptBy` (the routine that removes them). An entity classified `fixture-owned` with no sweep is
82
+ the exact leak this rule exists to catch and fails the check.
83
+ - `preserve` → `reason` must name the provenance (migration-seeded, ingested catalog, human-authored,
84
+ belongs to a real person) and, where available, `enforcedBy`.
85
+ - `derived-rebuild` → `rebuiltFrom` (the sources) and `rebuiltBy` (the routine). The reset rebuilds
86
+ and proves convergence rather than clearing.
87
+ - `forbidden` → `enforcedBy` is **required** and must name a control outside the reset process: a
88
+ least-privilege role, a revoked grant, a separate credential or account boundary, a database
89
+ constraint. "The script does not touch it" is not an enforcement.
90
+
91
+ ### Waivers are dated IOUs, never classifications
92
+
93
+ An entity nobody can classify today is recorded with its id, a reason, an owner, a ticket, and a
94
+ `recordedAt` date. It stays visible in the report, it never counts as classified, and it never
95
+ authorizes the reset to touch the entity — a waived entity is treated as `preserve` for safety while
96
+ remaining a finding. A waiver is invalid, and fails the check, when it names an entity that is not in
97
+ the inventory, duplicates an existing classification, or carries no owner, ticket, or date.
98
+
99
+ ## The check
100
+
101
+ The check compares a **runtime inventory** — what the system actually holds, enumerated from the
102
+ running environment — against the contract. Static sources are inputs to discovery, never a
103
+ substitute for the inventory: the whole point is to catch what the repository does not describe.
104
+
105
+ Semantics, in order:
106
+
107
+ 1. **Contract absent** → `not-adopted`. Reported visibly, exits 0, and the context is not required.
108
+ Adoption is an explicit act; a not-yet-adopted repo is not silently passing a gate it never wired.
109
+ 2. **Contract malformed, unparseable, or failing schema validation** → fail. A broken contract is
110
+ never treated as an empty one.
111
+ 3. **`mode: "declared-noop"`** → the noop must carry a reason, an owner, and a capability-manifest
112
+ reference, **and** the detectors must find no persistence signals in the repository. A repo with
113
+ persistence cannot declare a reset noop; the check rejects it rather than trusting the
114
+ declaration.
115
+ 4. **Entity in the inventory with no classification and no waiver** → **fail closed**, naming the
116
+ entity. This is the primary failure this contract exists to produce.
117
+ 5. **Entity classified but absent from the inventory** → fail as stale, unless the entry is marked
118
+ retired with a date. A contract that describes a system that no longer exists is not protection.
119
+ 6. **Policy obligations unmet** — `fixture-owned` with no ownership predicate or no sweep,
120
+ `forbidden` with no external enforcement, `derived-rebuild` with no rebuild routine → fail.
121
+ 7. **A required assurance missing or unevidenced** → fail.
122
+ 8. **Detector findings that the inventory did not surface** (a schema or migration source naming an
123
+ entity the inventory did not return) → fail, because it means the inventory is incomplete and
124
+ every other conclusion is unsound.
125
+ 9. **No inventory available** → `detection-only`. The detectors run, findings are reported, and the
126
+ result is explicitly labeled non-authoritative. It never reports the same status as a verified
127
+ run, and it never satisfies the definition of done on its own.
128
+
129
+ Every exit path emits the standard command envelope, so a caller can tell "verified clean" from
130
+ "could not look" without parsing prose.
131
+
132
+ ### Non-database discovery
133
+
134
+ The inventory is only complete when it enumerates every kind of state the project holds. At minimum,
135
+ discovery asks each of these and records either the enumeration or a documented absence: identity
136
+ provider (accounts, groups, memberships, long-lived sessions and devices), object storage (buckets
137
+ and prefixes written by the app or by tests), search indexes and their aliases, queues and topics
138
+ including dead-letter backlogs, caches with a persistence tier, derived views and projections,
139
+ runtime-created scheduled jobs and webhooks, feature-flag and configuration overrides, and outbound
140
+ side effects (email, SMS, billing, analytics events, third-party records). "We checked and there is
141
+ none" is an acceptable answer and must be written down; not asking is not.
142
+
143
+ ## Required assurances
144
+
145
+ These are the properties a reset must have. Each is declared in `assurances` with a pointer to the
146
+ test, guard, or role that proves it — a declaration with no evidence pointer fails the check.
147
+
148
+ | Assurance | What it means | Why |
149
+ |---|---|---|
150
+ | `preserves-non-fixture-data` | Catalog, reference, and any non-fixture data survive a reset unchanged. | The expensive-to-rebuild data is usually the data a blunt reset destroys, and it is often not restorable by re-running any seed in the repo. |
151
+ | `rejects-reserved-id-collision` | A reserved fixture identifier that collides with a real record aborts rather than overwriting. | The ownership predicate is the entire safety boundary; a collision means it is no longer identifying. |
152
+ | `rejects-foreign-references` | A fixture record referencing a preserved record it does not own is refused, never cascaded. | Cascades are how a fixture-scoped delete reaches outside its scope. |
153
+ | `requires-write-acknowledgment` | Every mutation is confirmed by the system, not assumed from a returned status. | An unacknowledged write is an unknown state, and "unknown" reported as success is how a half-applied reset becomes a mystery failure downstream. |
154
+ | `converges-on-second-apply` | Applying twice produces the same state and the second run reports no further change. | Convergence is what makes the reset safe to re-run, and re-running is what makes partial failure recoverable. |
155
+ | `verifies-exact-counts` | Verification asserts the exact expected count per fixture entity. | "At least one" passes against a leak. Exact counts are what detect one. |
156
+ | `production-fails-closed` | Production is refused with no override, escape hatch, or environment variable that changes the answer. | A single variable that authorizes production mutation will eventually be set by something that is not a person. |
157
+ | `guard-at-the-choke-point` | The environment check runs immediately before every outbound mutation, not only at startup. | A startup-only check does not survive a refactor that adds a second code path. |
158
+ | `enumerates-before-mutating` | `--dry-run` enumerates exactly what would change and fails on anything whose ownership it cannot establish. | Unknown ownership must block, not default to delete. |
159
+
160
+ Prefer platform enforcement over process enforcement wherever it exists: a role that cannot see the
161
+ forbidden entities, grants revoked rather than merely unused, constraints that make a cross-boundary
162
+ reference impossible, separate credentials per environment. A test proves the code behaves today; a
163
+ revoked grant makes the behavior unavailable.
164
+
165
+ ## Standard command envelope
166
+
167
+ Every adapter in this family — reset, seed, verify, inventory, classification check — returns **one**
168
+ JSON object on stdout and nothing else. Human-readable narration goes to stderr, redacted of secrets
169
+ and personal data.
170
+
171
+ ```json
172
+ {
173
+ "schemaVersion": "lisa-command-envelope-v1",
174
+ "capability": "<reset|seed|reset-verify|state-inventory|state-classification|...>",
175
+ "mode": "<real|declared-noop|not-applicable>",
176
+ "operation": "<the operation performed>",
177
+ "environment": "<server-resolved environment identity>",
178
+ "contractVersion": "<the project's state-contract version>",
179
+ "dryRun": true,
180
+ "status": "<completed|no-op|denied|invalid|failed|verification-mismatch|not-adopted|detection-only>",
181
+ "correlationId": "<stable id joining logs, audit records, and CI output>",
182
+ "summary": { "deleted": 0, "created": 0, "preserved": 0 }
183
+ }
184
+ ```
185
+
186
+ Rules that make the envelope load-bearing rather than decorative:
187
+
188
+ - **Exit 0 means completed *and* verified.** Any nonzero exit means denied, invalid, failed, or
189
+ verification-mismatch, and the envelope's `status` says which. An adapter that mutated successfully
190
+ but could not verify exits nonzero.
191
+ - **`--dry-run` is mandatory for every destructive adapter**, enumerates the intended mutations, and
192
+ fails on any entity whose ownership it cannot establish.
193
+ - **`--stage` (or equivalent) is a *request*, never the source of truth.** The adapter resolves the
194
+ environment from server-side deployment identity and fails if the request disagrees. A
195
+ caller-supplied stage, URL, host, or public build-time variable never authorizes a destructive
196
+ operation.
197
+ - **`--idempotency-key` is required in CI**, so a retried invocation is recognized rather than
198
+ repeated.
199
+ - **A noop returns `mode: "declared-noop"`** with a reason, an owner, and a capability-manifest
200
+ reference. A bare exit 0 with no envelope is indistinguishable from a successful destructive run
201
+ and is never an acceptable noop.
202
+ - **`correlationId` appears in the envelope, the audit record, and the CI log**, so a run can be
203
+ reconstructed after the fact.
204
+ - The audit record for a destructive run additionally names the actor, the CI run, the resolved
205
+ environment and account, the contract version, and before/after counts — and contains no secrets
206
+ or personal data.
207
+
208
+ ## Bootstrap procedure
209
+
210
+ 1. Enumerate the runtime inventory from a non-production environment, including the non-database
211
+ sources listed above. Record what could not be enumerated and why.
212
+ 2. Classify every entity. Start from provenance: who writes it, and can anything put it back? Prefer
213
+ `preserve` when unsure — an over-preserved entity leaks; an over-cleared one destroys.
214
+ 3. Declare `fixtureIdentity` and the ownership predicate before classifying anything as
215
+ `fixture-owned`.
216
+ 4. Write the assurances with pointers to the tests or roles that prove them. Missing evidence is a
217
+ work item, not a field to leave blank.
218
+ 5. Wire the check into CI so the next unclassified entity fails the pull request that introduces it.
219
+ 6. Record everything still unclassified as dated waivers with owners, and burn them down.
220
+
221
+ The first work item does not backfill the whole system. It classifies what it touches, scaffolds the
222
+ file, and turns the check on; everything else is burndown that stays visible.
223
+
224
+ ## What this contract does not do
225
+
226
+ It does not decide *how* a reset is executed, where it runs, or what invokes it. It does not
227
+ prescribe intra-run isolation. It does not replace a threat model for a destructive control plane —
228
+ where a reset is reachable from CI, that control plane has its own security obligations (identity,
229
+ least privilege, leases, audit) which this contract assumes rather than specifies. What it
230
+ guarantees is narrower and load-bearing: **no persistent state exists in the system that nobody has
231
+ decided about, and no work item adds some without saying so.**
@@ -65,6 +65,7 @@ For each acceptance criterion:
65
65
  - Every user flow must include at least one error path
66
66
  - Use Gherkin format (Given/When/Then) for user flows to enable direct translation into test cases
67
67
  - For frontend work, the `bdd-e2e-coverage` rule applies: name the scenario IDs the item will add or change in the project's behavior contract and the platforms each must hold on, and list the contract update plus the aligned e2e automation as explicit acceptance criteria -- they are deliverables, not implied work. List the passing coverage gate and the regenerated matrix and burndown as explicit acceptance criteria too -- the item is not done on a code-complete mapping alone
68
+ - For work that adds or changes persistent state, the `reset-seed-coverage` rule applies: name the persistent entities the item introduces or changes and the reset policy each takes (`fixture-owned` / `preserve` / `derived-rebuild` / `forbidden`), and list the state-contract update, the sweep for anything `fixture-owned`, and the passing state-classification check as explicit acceptance criteria -- they are deliverables, not implied work. Rows are only one kind of state: identity-provider objects, object storage, search indexes, queues, caches and derived views count too
68
69
  - When verifying, always run the feature -- never review by only reading code
69
70
  - If you cannot run the feature (missing dependencies, services unavailable), report as a blocker -- do not guess
70
71
  - If the changes are purely internal (refactoring, config, tooling), report "No user-facing impact" and explain why
@@ -83,6 +83,10 @@ For **frontend work** — any verification whose validation journey exercised a
83
83
 
84
84
  Every artifact encodes the SAME verified journey against a different platform. One is never a substitute for another, and a passing test on one platform never seals another platform's obligation.
85
85
 
86
+ ### 2b. Codifying persistent state (non-demotable)
87
+
88
+ When the verified journey **created, changed, or depended on persistent state**, the `reset-seed-coverage` rule governs what else this codification owes. Classify every entity the work touched in the project's state contract, give anything `fixture-owned` an ownership predicate and a sweep, and run the project's state-classification check the same way the coverage gate is run above — a contract edited but never checked is not proof. Where the journey depended on seeded state, the seed's verify step asserts **exact expected counts** for that state: "at least one" passes against a leak, which is precisely the condition being guarded. Cite the rule for the policy vocabulary and the assurances; do not restate them here.
89
+
86
90
  Permitted exits, mirroring the regression-spec rule in `lisa-implement` (never a silent skip, never "optional", and never a bare `N/A`):
87
91
 
88
92
  - The project genuinely has no runner configured for that platform → record a dated `platformWaivers` entry naming the locations checked and "no runner configured" as the reason, exactly like any other unsealable obligation, per the rule. This is never left as a bare `N/A` — an undated absence has no forcing function to ever get revisited.
@@ -149,6 +149,8 @@ IF it is a Fix (bug), execute the Reproduce sub-flow FIRST:
149
149
 
150
150
  For any Fix flow, and for any Build flow that changes user-visible behavior, regression coverage is a required deliverable at the highest practical observation level for the reported surface. If the project has a browser, device, or end-to-end harness for that platform (for example Playwright, Maestro, Detox, Cypress, or an equivalent runtime), the task plan and definition of done MUST include a deterministic regression spec against the reported surface, using mocked or seeded data where needed. This is alongside unit or integration coverage, not a substitute for it. For **frontend work** the deliverable is defined by the `bdd-e2e-coverage` rule and has two halves, both landing in this PR: the Gherkin scenario (stable ID, required platforms) added or updated in the project's behavior contract, and aligned automation in the project's configured runner for **every** platform that scenario requires — no runner substitutes for another, because they guard different platforms of the same behavior. The coverage gate must pass and the matrix and burndown be regenerated before the item is done. Cite the rule; do not restate its scenario, waiver, or bootstrap mechanics here.
151
151
 
152
+ For work that adds or changes **persistent state**, the `reset-seed-coverage` rule adds a second non-demotable deliverable landing in this same PR: every entity the item introduces or changes is classified in the project's state contract (`fixture-owned` / `preserve` / `derived-rebuild` / `forbidden`) with a reason and an owner, anything `fixture-owned` declares its ownership predicate and is actually swept, and the state-classification check passes. Writing a flow that creates a record and deletes it only on its happy path does NOT satisfy this — that is the leak, not the coverage. Cite the rule; do not restate its policy, waiver, or bootstrap mechanics here.
153
+
152
154
  The team lead may not waive, defer, demote, or phrase this regression spec as "optional", "if cheap", "nice to have", or equivalent. The only permitted exits are:
153
155
 
154
156
  1. The project genuinely has no end-to-end harness for the affected platform; record the checked locations and that absence in the task metadata, PR, and work-item evidence.
@@ -62,7 +62,13 @@ EARS-pattern shape, each with a measurable fit criterion, plus the non-functiona
62
62
  story with frontend scope, its user-facing behavior MUST be expressed as — or in a shape directly
63
63
  convertible to — Given/When/Then scenarios, naming the platforms each behavior must hold on, per the
64
64
  `bdd-e2e-coverage` rule; narrative-only frontend behavior forces that shape to be invented later,
65
- inconsistently, by whoever picks up the ticket. Each scenario stub carries its originating requirement
65
+ inconsistently, by whoever picks up the ticket. Where a requirement introduces or changes
66
+ **persistent state** — anything the system writes that outlives the process that wrote it, rows being
67
+ only one kind — the PRD MUST name that state and the reset policy it is expected to take, per the
68
+ `reset-seed-coverage` rule, so the classification is a stated requirement rather than something
69
+ discovered when a leaked record breaks a suite; that rule also covers the non-row cases (identity
70
+ objects, object storage, search indexes, queues, caches, derived views) a narrative spec routinely
71
+ omits. Each scenario stub carries its originating requirement
66
72
  atom (`R1`, `R2`, …) even though the stable `@BDD-<DOMAIN>-<NNN>` ID is not minted until Plan or
67
73
  Implement — this is what lets a later stage's provenance tag, and `spec-conformance`'s traceability
68
74
  check, walk back from a shipped scenario to the PRD requirement it was written to satisfy, instead of
@@ -56,6 +56,8 @@ For each task, define what "done" looks like:
56
56
 
57
57
  For a **frontend task** -- one that adds or changes a user-observable surface -- the `bdd-e2e-coverage` rule makes two further criteria mandatory on the item itself, never left implied: (a) the Gherkin scenarios it adds or changes in the project's behavior contract, with their stable IDs and required platforms, and (b) aligned e2e automation in the project's configured runner for each of those platforms, with the coverage gate passing and the matrix and burndown regenerated. Carry both into the item's Validation Journey. A project with no behavior contract yet does not get an exemption -- the first such task carries the bootstrap scaffolding as a deliverable, scoped to its own behavior (cite the rule; do not restate its bootstrap steps).
58
58
 
59
+ For a task that adds or changes **persistent state** -- anything the system writes that outlives the process that wrote it, including identity-provider objects, object storage, search indexes, queues, caches and derived views, not only rows -- the `reset-seed-coverage` rule makes two further criteria mandatory on the item itself, never left implied: (a) every entity it introduces or changes is classified in the project's state contract with a reason and an owner, and (b) anything classified `fixture-owned` has a declared ownership predicate and an actual sweep, with the state-classification check passing. Carry both into the item's Validation Journey. A project with no state contract yet does not get an exemption -- the first such task carries the bootstrap scaffolding as a deliverable, scoped to its own state (cite the rule; do not restate its bootstrap steps).
60
+
59
61
  ### 3. Assign Verification Type
60
62
 
61
63
  Each task must have a verification method. Choose the most appropriate:
@@ -58,6 +58,7 @@ Structure findings as:
58
58
  - Always run `bun run test` to understand current test state before recommending or writing new tests
59
59
  - Match existing test conventions -- do not introduce new test patterns
60
60
  - For frontend work, the strategy is not complete until every required scenario-platform obligation has aligned e2e automation in the project's configured runner for that platform, or a dated waiver naming the runner limitation (`bdd-e2e-coverage`). A unit test, a route boot, or a passing test on a different platform never seals an obligation
61
+ - For work that adds or changes persistent state, the strategy is not complete until each new entity is classified in the project's state contract and anything `fixture-owned` has a sweep, per the `reset-seed-coverage` rule. Per-flow self-cleanup is not a strategy: a flow that deletes what it created only on its happy path leaks on every failure in between, which is how state pollution becomes an unreproducible flake months later
61
62
  - Every test must have a clear "why" -- no tests for testing's sake
62
63
  - Focus on testing behavior, not implementation details
63
64
  - Verification commands must be runnable locally (no CI/CD dependencies)
@@ -374,6 +374,7 @@ A task is done only when:
374
374
  - Proof artifacts are captured
375
375
  - Every passing empirical verification is codified as a regression test (or has an explicit, documented skip reason from the allowed set)
376
376
  - For frontend work, the `bdd-e2e-coverage` contract is satisfied: every user-facing behavior added or changed exists as a Gherkin scenario with a stable ID traceable to the work item, every required scenario-platform obligation is mapped to aligned e2e automation in the project's configured runner for that platform or carries a dated waiver, and the coverage gate passes with the matrix and burndown regenerated and committed. Missing BDD coverage is a verification failure, not a warning
377
+ - For work that adds or changes persistent state, the `reset-seed-coverage` contract is satisfied: every entity introduced or changed is classified in the project's state contract with a reason and an owner, anything `fixture-owned` declares its ownership predicate and is actually swept, and the state-classification check passes in the same PR. An unclassified entity fails closed; per-flow self-cleanup is not coverage
377
378
  - For a leaf work unit, every typed `[EVIDENCE: <artifact-type>: <name>]` marker declared in its Validation Journey has a captured, non-empty artifact of the declared type attached to the ticket (the evidence manifest is fully satisfied)
378
379
  - Cross-work-item `EVIDENCE-REF` pointers were excluded from the local manifest and did not satisfy S14 or completion; a runtime-changing leaf has at least one local claiming marker
379
380
  - Spec conformance verdict is `CONFORMS` (not `PARTIAL`, not `DIVERGES`)
@@ -35,7 +35,7 @@ Treat the first successful lead-spawn request (or, on the Codex fallback, the fi
35
35
 
36
36
  Execute the **Verify** flow as defined in the `intent-routing` rule (loaded via the lisa plugin). The flow includes:
37
37
 
38
- 1. **Pre-flight: codification gate** — confirm that every passing local empirical verification on this branch was codified as a regression test (the Implement flow's codify step). If any verification has no committed test and no allowed skip reason (PR / Documentation / Deploy / Investigate-Only), invoke `codify-verification` now and amend the PR before shipping. For frontend work the gate additionally enforces the `bdd-e2e-coverage` rule: the shipped behavior exists as a Gherkin scenario with a stable ID, every required scenario-platform obligation has aligned automation in the project's configured runner for that platform or a dated waiver, and the project's coverage gate passes with the matrix regenerated. A missing runner is never a bare recorded absence — it needs a dated `platformWaivers` entry (per the rule) and, where the runner could reasonably be added, a linked build-ready follow-up ticket referenced from it; never a silent skip. Missing BDD coverage is a verification failure that blocks the ship, not a warning. A change cannot ship until its verifications are guarded.
38
+ 1. **Pre-flight: codification gate** — confirm that every passing local empirical verification on this branch was codified as a regression test (the Implement flow's codify step). If any verification has no committed test and no allowed skip reason (PR / Documentation / Deploy / Investigate-Only), invoke `codify-verification` now and amend the PR before shipping. For frontend work the gate additionally enforces the `bdd-e2e-coverage` rule: the shipped behavior exists as a Gherkin scenario with a stable ID, every required scenario-platform obligation has aligned automation in the project's configured runner for that platform or a dated waiver, and the project's coverage gate passes with the matrix regenerated. A missing runner is never a bare recorded absence — it needs a dated `platformWaivers` entry (per the rule) and, where the runner could reasonably be added, a linked build-ready follow-up ticket referenced from it; never a silent skip. Missing BDD coverage is a verification failure that blocks the ship, not a warning. A change cannot ship until its verifications are guarded. For work that adds or changes persistent state the gate additionally enforces the `reset-seed-coverage` rule: every entity the work introduces or changes is classified in the project's state contract, anything `fixture-owned` has an ownership predicate and a sweep, and the state-classification check passes — an unclassified entity fails closed and blocks the ship exactly as missing BDD coverage does.
39
39
  2. **Commit** any pending changes via `lisa-git-commit`
40
40
  3. **Push and PR** via `lisa-git-submit-pr`
41
41
  4. **PR Watch Loop** — drive the PR to MERGED via `lisa-drive-pr-to-merge`, 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 (it invokes `lisa-pull-request-review` itself), stale `CHANGES_REQUESTED` dismissal, and post-merge ancestry verification. Do not re-implement the loop or its terminal conditions.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.345.1",
3
+ "version": "2.346.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -65,6 +65,7 @@ For each acceptance criterion:
65
65
  - Every user flow must include at least one error path
66
66
  - Use Gherkin format (Given/When/Then) for user flows to enable direct translation into test cases
67
67
  - For frontend work, the `bdd-e2e-coverage` rule applies: name the scenario IDs the item will add or change in the project's behavior contract and the platforms each must hold on, and list the contract update plus the aligned e2e automation as explicit acceptance criteria -- they are deliverables, not implied work. List the passing coverage gate and the regenerated matrix and burndown as explicit acceptance criteria too -- the item is not done on a code-complete mapping alone
68
+ - For work that adds or changes persistent state, the `reset-seed-coverage` rule applies: name the persistent entities the item introduces or changes and the reset policy each takes (`fixture-owned` / `preserve` / `derived-rebuild` / `forbidden`), and list the state-contract update, the sweep for anything `fixture-owned`, and the passing state-classification check as explicit acceptance criteria -- they are deliverables, not implied work. Rows are only one kind of state: identity-provider objects, object storage, search indexes, queues, caches and derived views count too
68
69
  - When verifying, always run the feature -- never review by only reading code
69
70
  - If you cannot run the feature (missing dependencies, services unavailable), report as a blocker -- do not guess
70
71
  - If the changes are purely internal (refactoring, config, tooling), report "No user-facing impact" and explain why
@@ -83,6 +83,10 @@ For **frontend work** — any verification whose validation journey exercised a
83
83
 
84
84
  Every artifact encodes the SAME verified journey against a different platform. One is never a substitute for another, and a passing test on one platform never seals another platform's obligation.
85
85
 
86
+ ### 2b. Codifying persistent state (non-demotable)
87
+
88
+ When the verified journey **created, changed, or depended on persistent state**, the `reset-seed-coverage` rule governs what else this codification owes. Classify every entity the work touched in the project's state contract, give anything `fixture-owned` an ownership predicate and a sweep, and run the project's state-classification check the same way the coverage gate is run above — a contract edited but never checked is not proof. Where the journey depended on seeded state, the seed's verify step asserts **exact expected counts** for that state: "at least one" passes against a leak, which is precisely the condition being guarded. Cite the rule for the policy vocabulary and the assurances; do not restate them here.
89
+
86
90
  Permitted exits, mirroring the regression-spec rule in `lisa-implement` (never a silent skip, never "optional", and never a bare `N/A`):
87
91
 
88
92
  - The project genuinely has no runner configured for that platform → record a dated `platformWaivers` entry naming the locations checked and "no runner configured" as the reason, exactly like any other unsealable obligation, per the rule. This is never left as a bare `N/A` — an undated absence has no forcing function to ever get revisited.
@@ -149,6 +149,8 @@ IF it is a Fix (bug), execute the Reproduce sub-flow FIRST:
149
149
 
150
150
  For any Fix flow, and for any Build flow that changes user-visible behavior, regression coverage is a required deliverable at the highest practical observation level for the reported surface. If the project has a browser, device, or end-to-end harness for that platform (for example Playwright, Maestro, Detox, Cypress, or an equivalent runtime), the task plan and definition of done MUST include a deterministic regression spec against the reported surface, using mocked or seeded data where needed. This is alongside unit or integration coverage, not a substitute for it. For **frontend work** the deliverable is defined by the `bdd-e2e-coverage` rule and has two halves, both landing in this PR: the Gherkin scenario (stable ID, required platforms) added or updated in the project's behavior contract, and aligned automation in the project's configured runner for **every** platform that scenario requires — no runner substitutes for another, because they guard different platforms of the same behavior. The coverage gate must pass and the matrix and burndown be regenerated before the item is done. Cite the rule; do not restate its scenario, waiver, or bootstrap mechanics here.
151
151
 
152
+ For work that adds or changes **persistent state**, the `reset-seed-coverage` rule adds a second non-demotable deliverable landing in this same PR: every entity the item introduces or changes is classified in the project's state contract (`fixture-owned` / `preserve` / `derived-rebuild` / `forbidden`) with a reason and an owner, anything `fixture-owned` declares its ownership predicate and is actually swept, and the state-classification check passes. Writing a flow that creates a record and deletes it only on its happy path does NOT satisfy this — that is the leak, not the coverage. Cite the rule; do not restate its policy, waiver, or bootstrap mechanics here.
153
+
152
154
  The team lead may not waive, defer, demote, or phrase this regression spec as "optional", "if cheap", "nice to have", or equivalent. The only permitted exits are:
153
155
 
154
156
  1. The project genuinely has no end-to-end harness for the affected platform; record the checked locations and that absence in the task metadata, PR, and work-item evidence.
@@ -62,7 +62,13 @@ EARS-pattern shape, each with a measurable fit criterion, plus the non-functiona
62
62
  story with frontend scope, its user-facing behavior MUST be expressed as — or in a shape directly
63
63
  convertible to — Given/When/Then scenarios, naming the platforms each behavior must hold on, per the
64
64
  `bdd-e2e-coverage` rule; narrative-only frontend behavior forces that shape to be invented later,
65
- inconsistently, by whoever picks up the ticket. Each scenario stub carries its originating requirement
65
+ inconsistently, by whoever picks up the ticket. Where a requirement introduces or changes
66
+ **persistent state** — anything the system writes that outlives the process that wrote it, rows being
67
+ only one kind — the PRD MUST name that state and the reset policy it is expected to take, per the
68
+ `reset-seed-coverage` rule, so the classification is a stated requirement rather than something
69
+ discovered when a leaked record breaks a suite; that rule also covers the non-row cases (identity
70
+ objects, object storage, search indexes, queues, caches, derived views) a narrative spec routinely
71
+ omits. Each scenario stub carries its originating requirement
66
72
  atom (`R1`, `R2`, …) even though the stable `@BDD-<DOMAIN>-<NNN>` ID is not minted until Plan or
67
73
  Implement — this is what lets a later stage's provenance tag, and `spec-conformance`'s traceability
68
74
  check, walk back from a shipped scenario to the PRD requirement it was written to satisfy, instead of
@@ -56,6 +56,8 @@ For each task, define what "done" looks like:
56
56
 
57
57
  For a **frontend task** -- one that adds or changes a user-observable surface -- the `bdd-e2e-coverage` rule makes two further criteria mandatory on the item itself, never left implied: (a) the Gherkin scenarios it adds or changes in the project's behavior contract, with their stable IDs and required platforms, and (b) aligned e2e automation in the project's configured runner for each of those platforms, with the coverage gate passing and the matrix and burndown regenerated. Carry both into the item's Validation Journey. A project with no behavior contract yet does not get an exemption -- the first such task carries the bootstrap scaffolding as a deliverable, scoped to its own behavior (cite the rule; do not restate its bootstrap steps).
58
58
 
59
+ For a task that adds or changes **persistent state** -- anything the system writes that outlives the process that wrote it, including identity-provider objects, object storage, search indexes, queues, caches and derived views, not only rows -- the `reset-seed-coverage` rule makes two further criteria mandatory on the item itself, never left implied: (a) every entity it introduces or changes is classified in the project's state contract with a reason and an owner, and (b) anything classified `fixture-owned` has a declared ownership predicate and an actual sweep, with the state-classification check passing. Carry both into the item's Validation Journey. A project with no state contract yet does not get an exemption -- the first such task carries the bootstrap scaffolding as a deliverable, scoped to its own state (cite the rule; do not restate its bootstrap steps).
60
+
59
61
  ### 3. Assign Verification Type
60
62
 
61
63
  Each task must have a verification method. Choose the most appropriate: