@codyswann/lisa 2.345.1 → 2.348.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.
- package/all/copy-overwrite/scripts/check-state-classification.mjs +609 -0
- package/all/copy-overwrite/scripts/lisa-command-envelope.mjs +194 -0
- package/all/copy-overwrite/scripts/lisa-schema-validate.mjs +208 -0
- package/all/copy-overwrite/scripts/schemas/lisa-command-envelope.v1.schema.json +119 -0
- package/all/copy-overwrite/scripts/schemas/lisa-state-contract.v1.schema.json +191 -0
- package/all/create-only/state/README.md +41 -0
- package/all/create-only/state/state-contract.example.json +46 -0
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +92 -10
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/expo/copy-overwrite/scripts/bdd/baseline.mjs +224 -0
- package/expo/copy-overwrite/scripts/bdd/contract.mjs +121 -0
- package/expo/copy-overwrite/scripts/bdd/envelope.mjs +231 -0
- package/expo/copy-overwrite/scripts/bdd/parse.mjs +220 -0
- package/expo/copy-overwrite/scripts/bdd/render.mjs +170 -0
- package/expo/copy-overwrite/scripts/bdd/report.mjs +361 -0
- package/expo/copy-overwrite/scripts/bdd/validate.mjs +282 -0
- package/expo/copy-overwrite/scripts/bdd/waivers.mjs +210 -0
- package/expo/copy-overwrite/scripts/bdd-matrix.mjs +278 -0
- package/expo/copy-overwrite/scripts/check-bdd-coverage.mjs +657 -0
- package/expo/create-only/bdd/coverage-map.json +38 -0
- package/expo/create-only/bdd/features/.keep +5 -0
- package/expo/github-rulesets/bdd-coverage.json +33 -0
- package/expo/package-lisa/package.lisa.json +3 -0
- package/package.json +1 -1
- 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-acceptance-criteria/SKILL.md +1 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-codify-verification/SKILL.md +4 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-research/SKILL.md +7 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-task-decomposition/SKILL.md +2 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-test-strategy/SKILL.md +1 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-verification-lifecycle/SKILL.md +1 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-verify/SKILL.md +1 -1
- package/plugins/lisa/rules/eager/reset-seed-coverage.md +48 -0
- package/plugins/lisa/rules/reference/reset-seed-coverage.md +231 -0
- package/plugins/lisa/skills/lisa-acceptance-criteria/SKILL.md +1 -0
- package/plugins/lisa/skills/lisa-codify-verification/SKILL.md +4 -0
- package/plugins/lisa/skills/lisa-implement/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-research/SKILL.md +7 -1
- package/plugins/lisa/skills/lisa-task-decomposition/SKILL.md +2 -0
- package/plugins/lisa/skills/lisa-test-strategy/SKILL.md +1 -0
- package/plugins/lisa/skills/lisa-verification-lifecycle/SKILL.md +1 -0
- package/plugins/lisa/skills/lisa-verify/SKILL.md +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-acceptance-criteria/SKILL.md +1 -0
- package/plugins/lisa-agy/skills/lisa-codify-verification/SKILL.md +4 -0
- package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-research/SKILL.md +7 -1
- package/plugins/lisa-agy/skills/lisa-task-decomposition/SKILL.md +2 -0
- package/plugins/lisa-agy/skills/lisa-test-strategy/SKILL.md +1 -0
- package/plugins/lisa-agy/skills/lisa-verification-lifecycle/SKILL.md +1 -0
- package/plugins/lisa-agy/skills/lisa-verify/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-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/rules/eager/reset-seed-coverage.md +48 -0
- package/plugins/lisa-copilot/rules/reference/reset-seed-coverage.md +231 -0
- package/plugins/lisa-copilot/skills/lisa-acceptance-criteria/SKILL.md +1 -0
- package/plugins/lisa-copilot/skills/lisa-codify-verification/SKILL.md +4 -0
- package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-research/SKILL.md +7 -1
- package/plugins/lisa-copilot/skills/lisa-task-decomposition/SKILL.md +2 -0
- package/plugins/lisa-copilot/skills/lisa-test-strategy/SKILL.md +1 -0
- package/plugins/lisa-copilot/skills/lisa-verification-lifecycle/SKILL.md +1 -0
- package/plugins/lisa-copilot/skills/lisa-verify/SKILL.md +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/rules/reset-seed-coverage-reference.mdc +236 -0
- package/plugins/lisa-cursor/rules/reset-seed-coverage.mdc +53 -0
- package/plugins/lisa-cursor/skills/lisa-acceptance-criteria/SKILL.md +1 -0
- package/plugins/lisa-cursor/skills/lisa-codify-verification/SKILL.md +4 -0
- package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-research/SKILL.md +7 -1
- package/plugins/lisa-cursor/skills/lisa-task-decomposition/SKILL.md +2 -0
- package/plugins/lisa-cursor/skills/lisa-test-strategy/SKILL.md +1 -0
- package/plugins/lisa-cursor/skills/lisa-verification-lifecycle/SKILL.md +1 -0
- package/plugins/lisa-cursor/skills/lisa-verify/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/.codex-plugin/skills/ops-db-ops/SKILL.md +93 -2
- package/plugins/lisa-expo/skills/ops-db-ops/SKILL.md +94 -3
- package/plugins/lisa-expo/skills/ops-db-ops/agents/openai.yaml +2 -2
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-agy/skills/ops-db-ops/SKILL.md +94 -3
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/skills/ops-db-ops/SKILL.md +94 -3
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/skills/ops-db-ops/SKILL.md +94 -3
- 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-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-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-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-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-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-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/src/base/rules/eager/reset-seed-coverage.md +48 -0
- package/plugins/src/base/rules/reference/reset-seed-coverage.md +231 -0
- package/plugins/src/base/skills/lisa-acceptance-criteria/SKILL.md +1 -0
- package/plugins/src/base/skills/lisa-codify-verification/SKILL.md +4 -0
- package/plugins/src/base/skills/lisa-implement/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-research/SKILL.md +7 -1
- package/plugins/src/base/skills/lisa-task-decomposition/SKILL.md +2 -0
- package/plugins/src/base/skills/lisa-test-strategy/SKILL.md +1 -0
- package/plugins/src/base/skills/lisa-verification-lifecycle/SKILL.md +1 -0
- package/plugins/src/base/skills/lisa-verify/SKILL.md +1 -1
- package/plugins/src/expo/skills/ops-db-ops/SKILL.md +94 -3
- package/scripts/check-state-classification.mjs +27 -0
|
@@ -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: ops-db-ops
|
|
3
|
-
description: Database migrations, reverts, schema generation,
|
|
3
|
+
description: Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- Bash
|
|
6
6
|
- Read
|
|
@@ -8,9 +8,10 @@ allowed-tools:
|
|
|
8
8
|
|
|
9
9
|
# Ops: Database Operations
|
|
10
10
|
|
|
11
|
-
Manage database migrations, schema generation,
|
|
11
|
+
Manage database migrations, schema generation, GraphQL code generation, and the project's
|
|
12
|
+
reset/seed/verify state operations.
|
|
12
13
|
|
|
13
|
-
**Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`) and optional environment (default: `dev`)
|
|
14
|
+
**Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`, `seed`, `reset`, `reset:verify`, `state:inventory`, `state:classify`) and optional environment (default: `dev`)
|
|
14
15
|
|
|
15
16
|
## Path Convention
|
|
16
17
|
|
|
@@ -21,6 +22,21 @@ Manage database migrations, schema generation, and GraphQL code generation.
|
|
|
21
22
|
|
|
22
23
|
**CRITICAL**: Never run migrations or reverts against production without explicit human confirmation.
|
|
23
24
|
|
|
25
|
+
**Destructive state operations are stricter than that.** `reset` (and any `seed` that clears before
|
|
26
|
+
it writes) is governed by the `reset-seed-coverage` rule and never runs on the strength of a
|
|
27
|
+
confirmation alone:
|
|
28
|
+
|
|
29
|
+
- Run `--dry-run` first, always, and read what it says it will change. A dry run that reports an
|
|
30
|
+
entity whose ownership it cannot establish is a STOP, not a warning.
|
|
31
|
+
- The environment is whatever the adapter resolves server-side. A `--stage`, `TEST_ENV`, URL, host,
|
|
32
|
+
or public build-time variable is a *request* the adapter checks, never the answer. If the requested
|
|
33
|
+
stage and the resolved environment disagree, that is a refusal to investigate — not something to
|
|
34
|
+
re-run with a different flag.
|
|
35
|
+
- **Production has no override, in any repo, ever.** There is no flag, variable, or confirmation
|
|
36
|
+
phrase that makes a production reset correct. If one appears to exist, stop and report it.
|
|
37
|
+
- Never invent a reset. If the project ships no reset adapter, say so and stop; do not improvise
|
|
38
|
+
deletions with ad-hoc queries or the migration tooling.
|
|
39
|
+
|
|
24
40
|
## Discovery
|
|
25
41
|
|
|
26
42
|
Read the backend `package.json` to discover available migration and schema scripts:
|
|
@@ -31,10 +47,22 @@ Read the backend `package.json` to discover available migration and schema scrip
|
|
|
31
47
|
- `generate:sql-schema*` — regenerate SQL schema for MCP
|
|
32
48
|
- AWS credential/profile scripts such as `aws:signin:*` and any environment-backed remote profile
|
|
33
49
|
|
|
50
|
+
Read the backend and frontend `package.json` to discover the state operations. Discover them; do not
|
|
51
|
+
assume these exact names — a project may expose them under its own, and this skill runs whatever the
|
|
52
|
+
project declares:
|
|
53
|
+
- `db:seed` / `seed:*` — write the fixture baseline
|
|
54
|
+
- `db:reset` / `reset:*` — converge state back to that baseline
|
|
55
|
+
- `db:reset:verify` / `reset:verify:*` — prove the post-state, by exact counts
|
|
56
|
+
- `state:inventory` — enumerate what the running environment actually holds
|
|
57
|
+
- `check:state-classification` — compare that inventory against the state contract
|
|
58
|
+
|
|
34
59
|
Read the frontend `package.json` to discover codegen scripts:
|
|
35
60
|
- `fetch:graphql:schema:*` — fetch GraphQL schema
|
|
36
61
|
- `generate:types:*` — generate TypeScript types
|
|
37
62
|
|
|
63
|
+
If a state script the operation needs does not exist, report the absence and the scripts that DO
|
|
64
|
+
exist. Do not substitute a different script, and do not fall back to running SQL by hand.
|
|
65
|
+
|
|
38
66
|
## AWS Prerequisite
|
|
39
67
|
|
|
40
68
|
All database operations (except `codegen`) require AWS credentials. Verify the target profile first:
|
|
@@ -113,11 +141,74 @@ STAGE={env} bun run generate:sql-schema
|
|
|
113
141
|
|
|
114
142
|
**Note**: The backend must be running (locally or deployed) for schema fetching to work.
|
|
115
143
|
|
|
144
|
+
### seed (write the fixture baseline)
|
|
145
|
+
|
|
146
|
+
Run the project's discovered seed script for the target environment. A seed is additive or
|
|
147
|
+
convergent, never a blind wipe; if the project's seed clears first, treat it as a reset and follow
|
|
148
|
+
the reset sequence below.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
cd "${BACKEND_DIR:-../backend-v2}"
|
|
152
|
+
{package-manager} run {discovered-seed-script} --stage {env}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### reset (converge state back to the baseline)
|
|
156
|
+
|
|
157
|
+
Never a single command. The sequence is fixed:
|
|
158
|
+
|
|
159
|
+
1. **Dry run.** `{discovered-reset-script} --dry-run --stage {env}`. Read the enumeration. Stop on
|
|
160
|
+
any entity of unknown ownership, on any `forbidden`-classified entity appearing at all, and on
|
|
161
|
+
any disagreement between the requested stage and the resolved environment.
|
|
162
|
+
2. **Classify first if the contract is stale.** If `check:state-classification` reports an
|
|
163
|
+
unclassified entity, the reset does not run — an unclassified entity is neither safe to keep nor
|
|
164
|
+
safe to delete. Fix the state contract, then start over at step 1.
|
|
165
|
+
3. **Apply**, passing an idempotency key when running in CI:
|
|
166
|
+
`{discovered-reset-script} --stage {env} --idempotency-key {run-id}`.
|
|
167
|
+
4. **Verify** with `reset:verify`. A reset that mutated but did not verify is a failure, not a
|
|
168
|
+
partial success.
|
|
169
|
+
5. **Converge check.** Applying a second time must report no further change. If the second run keeps
|
|
170
|
+
deleting, the ownership predicate is wrong — report it rather than re-running.
|
|
171
|
+
|
|
172
|
+
### reset:verify (prove the post-state)
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
{package-manager} run {discovered-verify-script} --stage {env}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Verification asserts **exact** expected counts per fixture entity. "At least one" passes against a
|
|
179
|
+
leak, which is the condition being guarded.
|
|
180
|
+
|
|
181
|
+
### state:inventory (enumerate what the environment actually holds)
|
|
182
|
+
|
|
183
|
+
Produces the runtime inventory the classification check compares against. A complete inventory
|
|
184
|
+
covers more than rows: identity-provider objects, object storage prefixes, search indexes, queues
|
|
185
|
+
and dead-letter backlogs, caches with a persistence tier, derived and materialized views, and
|
|
186
|
+
runtime-created jobs. Record anything that could not be enumerated, with the reason.
|
|
187
|
+
|
|
188
|
+
### state:classify (compare the inventory to the contract)
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
node scripts/check-state-classification.mjs
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Exit 0 = every entity the environment holds is classified and every policy obligation is met.
|
|
195
|
+
Nonzero = an unclassified entity, an unswept `fixture-owned` entity, a stale classification, an
|
|
196
|
+
incomplete inventory, or a missing assurance. Report the findings verbatim — each names the entity
|
|
197
|
+
and what is missing.
|
|
198
|
+
|
|
116
199
|
## Output Format
|
|
117
200
|
|
|
201
|
+
Every state operation returns the standard command envelope on stdout — one JSON object with
|
|
202
|
+
`schemaVersion`, `capability`, `mode`, `operation`, `environment`, `contractVersion`, `dryRun`,
|
|
203
|
+
`status`, `correlationId`, and `summary{deleted,created,preserved}`. Report from that envelope, not
|
|
204
|
+
from prose scraped off stderr. A destructive operation that produced no envelope has not been
|
|
205
|
+
verified, whatever its exit code said.
|
|
206
|
+
|
|
118
207
|
Report operation result:
|
|
119
208
|
|
|
120
209
|
| Operation | Environment | Target | Status | Details |
|
|
121
210
|
|-----------|-------------|--------|--------|---------|
|
|
122
211
|
| migrate | dev | local DB | SUCCESS | 2 migrations applied |
|
|
123
212
|
| codegen | dev | frontend | SUCCESS | Types regenerated |
|
|
213
|
+
| reset | dev | reset adapter | completed | deleted 12 / preserved 31, converged on second apply, correlation `abc123` |
|
|
214
|
+
| state:classify | dev | state contract | failed | `public.notes` unclassified — fail closed |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Lisa's own adopter entry point for the shipped state-classification check.
|
|
4
|
+
*
|
|
5
|
+
* Lisa holds no persistent state of its own, so there is nothing here to
|
|
6
|
+
* classify. What this file buys is that the *shipped* mechanism — the
|
|
7
|
+
* copy-overwrite script plus the `🧬 State Classification` job in the reusable
|
|
8
|
+
* quality workflow — runs on Lisa's own pull requests instead of only on
|
|
9
|
+
* adopters. Without it, a regression in the gate would ship silently and be
|
|
10
|
+
* discovered downstream.
|
|
11
|
+
*
|
|
12
|
+
* It points the check at `state/demo-project/`, a small worked example standing
|
|
13
|
+
* in for an adopter repo: a handful of entities across all four policies,
|
|
14
|
+
* including state that is not rows. A change that makes the check stop failing
|
|
15
|
+
* on an unclassified or unswept entity turns Lisa's own CI red.
|
|
16
|
+
*
|
|
17
|
+
* This is the same path `lisa apply` writes into an adopter (`scripts/`), so
|
|
18
|
+
* adopters get the file itself, not this wrapper.
|
|
19
|
+
* @module scripts/check-state-classification
|
|
20
|
+
*/
|
|
21
|
+
import { main } from "../all/copy-overwrite/scripts/check-state-classification.mjs";
|
|
22
|
+
|
|
23
|
+
process.exitCode = main([
|
|
24
|
+
...process.argv.slice(2),
|
|
25
|
+
"--root",
|
|
26
|
+
"state/demo-project",
|
|
27
|
+
]);
|