@codyswann/lisa 2.345.0 → 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.
- 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 +59 -12
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- 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-parity-safety-net-rules/SKILL.md +8 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-parity-sentry-sdk-setup/SKILL.md +14 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-parity-sentry-seer/SKILL.md +5 -3
- 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-parity-safety-net-rules/SKILL.md +8 -3
- package/plugins/lisa/skills/lisa-parity-sentry-sdk-setup/SKILL.md +14 -2
- package/plugins/lisa/skills/lisa-parity-sentry-seer/SKILL.md +5 -3
- 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-parity-safety-net-rules/SKILL.md +8 -3
- package/plugins/lisa-agy/skills/lisa-parity-sentry-sdk-setup/SKILL.md +14 -2
- package/plugins/lisa-agy/skills/lisa-parity-sentry-seer/SKILL.md +5 -3
- 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-parity-safety-net-rules/SKILL.md +8 -3
- package/plugins/lisa-copilot/skills/lisa-parity-sentry-sdk-setup/SKILL.md +14 -2
- package/plugins/lisa-copilot/skills/lisa-parity-sentry-seer/SKILL.md +5 -3
- 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-parity-safety-net-rules/SKILL.md +8 -3
- package/plugins/lisa-cursor/skills/lisa-parity-sentry-sdk-setup/SKILL.md +14 -2
- package/plugins/lisa-cursor/skills/lisa-parity-sentry-seer/SKILL.md +5 -3
- 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-parity-safety-net-rules/SKILL.md +8 -3
- package/plugins/src/base/skills/lisa-parity-sentry-sdk-setup/SKILL.md +14 -2
- package/plugins/src/base/skills/lisa-parity-sentry-seer/SKILL.md +5 -3
- 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
|
@@ -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 |
|
|
@@ -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 |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
display_name: "Ops Db Ops"
|
|
2
|
-
short_description: "Database migrations, reverts, schema generation,
|
|
2
|
+
short_description: "Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend…"
|
|
3
3
|
default_prompt:
|
|
4
|
-
- "Use $ops-db-ops: Database migrations, reverts, schema generation,
|
|
4
|
+
- "Use $ops-db-ops: Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend…."
|
|
@@ -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 |
|
|
@@ -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 |
|