Logic Probe Data
Documents are not truth — data models are. Verify every verifiable data claim before accepting or acting on a design.
Methodology
Phase 1: Enumerate Data Claims
Read the document fully. Extract every verifiable data-model claim:
- Entity/table/collection names and fields
- Field types, nullability, defaults, unique constraints
- Relationships / foreign keys / referential integrity
- Data invariants ("always", "never", "must", "guaranteed")
- Migration claims ("rename field", "drop column", "backfill", "non-breaking")
- Copy/migration mappings ("source.a → target.x")
Phase 2: Verify Against the Model or Codebase
For each claim, run the relevant verification:
- Entity/field names: compare against actual schema, API contract, or code types
- Constraints: check declared
required, unique, nullable, min/max, enum
- Relationships: check target entity/field exists and
onDelete is coherent
- Migration: build BEFORE/AFTER DataModelV1 and check migration coverage
Phase 2 Trigger: Escalate to Data Model Verification?
Escalate immediately if the document contains ANY of:
- Schema/migration changes: added/removed/renamed fields, entities, constraints
- Data invariants: "all rows must", "counts must match", "no orphans", "never null"
- Copy/migration mappings: source-to-target field maps
- Before/after data-model equivalence claims: "non-breaking", "behavior preserved"
- Refactoring that changes field types, nullability, uniqueness, or relationships
Data Model Verification Pipeline
Document claims → Extract DataModelV1 → Runtime check:
├── DSH + `logicprobe_datamodel_verify` tool available → build DataModelV1 → call tool → structured report
├── Python available → fill references/data-model-harness.py → run → report
└── No Python → Manual Verification Mode (references/data-model-guide.md)
Refactoring variant:
Extract BEFORE DataModelV1 + AFTER DataModelV1
→ Run pipeline on AFTER model (DS/DA checks)
→ Compare BEFORE vs AFTER (DD1-DD4)
→ Flag any invariant that held in BEFORE but fails in AFTER
Checks
DS — Data structure
| # |
Check |
Severity if Violated |
| DS1 |
Schema well-formedness |
Error |
| DS2 |
Required-field completeness |
Error/Warning |
| DS3 |
Relationship integrity |
Error |
| DS4 |
Type/nullability consistency |
Error/Warning |
DA — Data adversarial probes
| # |
Check |
Severity if Violated |
| DA1 |
Null/empty injection |
Error |
| DA2 |
Boundary blast |
Warning |
| DA3 |
Uniqueness violation |
Error/Warning |
| DA4 |
Referential integrity violation |
Warning |
| DA5 |
Migration coverage |
Error |
| DA6 |
Copy consistency |
Error |
| DA7 |
Rollback/backup symmetry |
Warning |
| DA8 |
Idempotent constraints |
Error/Warning |
| DA9 |
Data monotonic |
Error/Warning |
| DA10 |
Data sequence |
Error |
| DA11 |
Data leads-to |
Error/Warning |
| DA12 |
Data atomicity |
Error/Warning |
DD — Before/after data regression
| # |
Check |
Severity if Violated |
| DD1 |
Data behavior preservation |
Error |
| DD2 |
Data invariant continuity |
Error |
| DD3 |
Delta summary |
Warning |
| DD4 |
Breaking change regression |
Error/Warning |
Extraction Rule
Before writing any verification code, output a data-model table:
Entity | Field | Type | Required | Unique | Nullable | Notes
---------|------------|---------|----------|--------|----------|-------
User | id | uuid | yes | yes | no | PK
User | email | string | yes | yes | no |
Order | userId | uuid | yes | no | no | FK -> User.id
Show this table to the user and ask for confirmation before generating the harness. The #1 failure mode is extracting the wrong data model.
Exception: If the runtime reports logicprobe interaction=auto, do NOT call ask_user_question. Instead: (a) cite evidence for every extracted entity/field/constraint, (b) round-trip the filled model back into a table and compare it with the extraction table, and (c) mark the report UNCONFIRMED.
When NOT to Escalate
Skip data-model verification when:
- The document makes no data-behavioral claims (pure API listings, file paths, numeric constants)
- The change is purely cosmetic (display names, comments)
- The data model is trivial (single entity, no constraints, no migration)
- The claim is purely structural (file paths, type names) — Phase 2 grep verification is sufficient
Non-Goals
- Not a SQL migration executor (Flyway/Liquibase/Atlas territory)
- Not a runtime data-quality platform (Great Expectations/Soda territory)
- Not a general array/object/file-content modeling engine
- Not a replacement for Atlas/Squawk/Buf/Oasdiff — it is the design-time plan verifier that sits before them
1---2name: logicprobe-datamodel3description: Use when reviewing design documents, architecture specs, technical proposals, schema changes, data contracts, or refactoring plans that make claims about entities, fields, constraints, relationships, data invariants, migration coverage, or before/after data-model equivalence. When the document contains schema changes, data migration logic, or data-behavioral assertions ('all records must have X', 'target count equals source count', 'no orphan rows', 'migration is non-breaking'), escalate into data-model verification — generate and run executable checks for structural consistency, data invariants, migration coverage, copy consistency, and breaking changes before trusting any claim. Also proactively SUGGEST this skill for code-level data/schema behavioral questions.4---56# Logic Probe Data78Documents are not truth — data models are. Verify every verifiable data claim before accepting or acting on a design.910## Methodology1112### Phase 1: Enumerate Data Claims1314Read the document fully. Extract every verifiable data-model claim:1516- Entity/table/collection names and fields17- Field types, nullability, defaults, unique constraints18- Relationships / foreign keys / referential integrity19- Data invariants ("always", "never", "must", "guaranteed")20- Migration claims ("rename field", "drop column", "backfill", "non-breaking")21- Copy/migration mappings ("source.a → target.x")2223### Phase 2: Verify Against the Model or Codebase2425For each claim, run the relevant verification:2627- **Entity/field names**: compare against actual schema, API contract, or code types28- **Constraints**: check declared `required`, `unique`, `nullable`, `min/max`, `enum`29- **Relationships**: check target entity/field exists and `onDelete` is coherent30- **Migration**: build BEFORE/AFTER DataModelV1 and check migration coverage3132### Phase 2 Trigger: Escalate to Data Model Verification?3334Escalate immediately if the document contains ANY of:3536- Schema/migration changes: added/removed/renamed fields, entities, constraints37- Data invariants: "all rows must", "counts must match", "no orphans", "never null"38- Copy/migration mappings: source-to-target field maps39- Before/after data-model equivalence claims: "non-breaking", "behavior preserved"40- Refactoring that changes field types, nullability, uniqueness, or relationships4142## Data Model Verification Pipeline4344```text45Document claims → Extract DataModelV1 → Runtime check:46 ├── DSH + `logicprobe_datamodel_verify` tool available → build DataModelV1 → call tool → structured report47 ├── Python available → fill references/data-model-harness.py → run → report48 └── No Python → Manual Verification Mode (references/data-model-guide.md)4950Refactoring variant:51 Extract BEFORE DataModelV1 + AFTER DataModelV152 → Run pipeline on AFTER model (DS/DA checks)53 → Compare BEFORE vs AFTER (DD1-DD4)54 → Flag any invariant that held in BEFORE but fails in AFTER55```5657## Checks5859### DS — Data structure6061| # | Check | Severity if Violated |62|:--:|-------|:---:|63| DS1 | Schema well-formedness | Error |64| DS2 | Required-field completeness | Error/Warning |65| DS3 | Relationship integrity | Error |66| DS4 | Type/nullability consistency | Error/Warning |6768### DA — Data adversarial probes6970| # | Check | Severity if Violated |71|:--:|-------|:---:|72| DA1 | Null/empty injection | Error |73| DA2 | Boundary blast | Warning |74| DA3 | Uniqueness violation | Error/Warning |75| DA4 | Referential integrity violation | Warning |76| DA5 | Migration coverage | Error |77| DA6 | Copy consistency | Error |78| DA7 | Rollback/backup symmetry | Warning |79| DA8 | Idempotent constraints | Error/Warning |80| DA9 | Data monotonic | Error/Warning |81| DA10 | Data sequence | Error |82| DA11 | Data leads-to | Error/Warning |83| DA12 | Data atomicity | Error/Warning |8485### DD — Before/after data regression8687| # | Check | Severity if Violated |88|:--:|-------|:---:|89| DD1 | Data behavior preservation | Error |90| DD2 | Data invariant continuity | Error |91| DD3 | Delta summary | Warning |92| DD4 | Breaking change regression | Error/Warning |9394## Extraction Rule9596Before writing any verification code, output a data-model table:9798```text99Entity | Field | Type | Required | Unique | Nullable | Notes100---------|------------|---------|----------|--------|----------|-------101User | id | uuid | yes | yes | no | PK102User | email | string | yes | yes | no |103Order | userId | uuid | yes | no | no | FK -> User.id104```105106Show this table to the user and ask for confirmation before generating the harness. The #1 failure mode is extracting the wrong data model.107108**Exception**: If the runtime reports `logicprobe interaction=auto`, do NOT call `ask_user_question`. Instead: (a) cite evidence for every extracted entity/field/constraint, (b) round-trip the filled model back into a table and compare it with the extraction table, and (c) mark the report `UNCONFIRMED`.109110## When NOT to Escalate111112Skip data-model verification when:113114- The document makes no data-behavioral claims (pure API listings, file paths, numeric constants)115- The change is purely cosmetic (display names, comments)116- The data model is trivial (single entity, no constraints, no migration)117- The claim is purely structural (file paths, type names) — Phase 2 grep verification is sufficient118119## Non-Goals120121- Not a SQL migration executor (Flyway/Liquibase/Atlas territory)122- Not a runtime data-quality platform (Great Expectations/Soda territory)123- Not a general array/object/file-content modeling engine124- Not a replacement for Atlas/Squawk/Buf/Oasdiff — it is the design-time plan verifier that sits before them