Apply SQLite-specific judgment only when it is material. Establish the SQLite
library version, driver, filesystem and deployment model, schema and migration
ownership, connection policy, protected-data boundary, and task authority
before recommending a construct or response. Use the highest justified
Green — routine, Yellow — caution, Orange — warning, or
Red — crisis / stop response for one coherent current decision.
Keep writer, transaction, journal, checkpoint, sidecar, file, and recovery ownership explicit. Static structure warns about proposed growth; it cannot establish live contention, journal state, filesystem safety, or recoverability. This provisional profile classifies and recommends and does not grant authority to open or operate on a database.
Do not use this profile for:
ATTACH, pragma change, migration,
checkpoint, backup, restore, replacement, extension load, or deletion;ATTACH, backup, integrity, filesystems, permissions,
protected data, and live authority independently of structure.implementing-with-test-discipline may remain primary for an authorized
behavior or migration change; reviewing-and-verifying-repository-work may
remain primary for acceptance review. This profile supplies SQLite judgment
without silently invoking either.These defaults apply mainly to proposed growth in maintained hand-written SQLite SQL and migrations. They are review signals, not runtime, contention, durability, or migration-safety claims.
| Signal | Green — routine | Yellow — caution | Orange — warning | Red — crisis / stop |
|---|---|---|---|---|
| SQL or migration physical lines | <= 200 |
201–350 |
351–600 |
>= 601 |
| Top-level statements per migration direction | <= 8 |
9–16 |
17–30 |
>= 31 |
| Distinct tables, indexes, triggers, or views touched | <= 3 |
4–7 |
8–12 |
>= 13 |
| Join edges in one statement | <= 2 |
3–5 |
6–8 |
>= 9 |
| Maximum CTE/subquery depth | <= 1 |
2 |
3–4 |
>= 5 |
| Ordered schema-rebuild steps | 0 |
1–5 |
6–12 |
>= 13 |
| State-mutating PRAGMA families | 0 |
1–2 |
3–4 |
>= 5 |
| Transaction/attached-database families | 0–1 |
2 |
3 |
>= 4 |
| Trigger definitions affecting one owner | 0–1 |
2–3 |
4–6 |
>= 7 |
| Top-level body actions in one trigger | 0–3 |
4–6 |
7–10 |
>= 11 |
| Independent data-copy/backfill families | 0 |
1 |
2–3 |
>= 4 |
| Independent responsibility families | 0–1 |
2 |
3 |
>= 4 |
Count physical lines after universal-newline decoding; blanks, comments,
strings, quoted identifiers, embedded data, and a final non-empty unterminated
segment count. Measure up and down migration directions independently and
disclose the combined file result.
Count top-level statements with an SQLite-aware parser or lexical scanner.
Ignore semicolons in comments, strings, quoted identifiers, and trigger bodies.
A complete CREATE TRIGGER ... BEGIN ... END; is one outer statement; measure
its top-level body actions separately. Count each distinct schema object once
per direction when it is a DDL target, DML source or target in data movement,
or explicitly recreated dependent object. Do not count aliases or CTE names.
Join edges are explicit joins plus comma-join sources after the first across
the complete nested query tree; record the maximum one-statement result. Query
depth starts at zero and adds one for each CTE body, scalar subquery, EXISTS,
IN, or parenthesized query. Compound arms remain at their containing depth;
recursive iterations do not increase static depth.
Rebuild steps include explicit transaction and foreign-key setup/restoration,
replacement-table creation, data copy, old-table removal, rename, dependent
index/trigger/view recreation, checks, commit, and schema capture. The table is
literal: >= 13 is Red. A cohesive canonical rebuild may remain Orange only
through the ordinary accepted bounded exception with explicit rationale, no
other Red, exact transaction and integrity evidence, focused validation,
growth bound, and truthful recovery or forward correction. Syntactic
completeness never automatically downgrades Red.
Count each distinct state-changing PRAGMA name once. Read-only inspection forms
and foreign_key_check do not count as mutation but remain validation evidence.
Repeated off/on changes are one family with the transition disclosed.
Transaction/attached-database families are transaction lifecycle, explicit
DEFERRED/IMMEDIATE/EXCLUSIVE selection, savepoint lifecycle,
ATTACH/DETACH, and cross-database atomicity coordination.
Trigger breadth is owner-scoped. Use the higher result from affected trigger definitions and maximum top-level body actions; disclose indirect writes and read dependencies. A data-copy/backfill family is one independently reversible source-to-target, transformation, population, cleanup, import/export, or table- copy contract. Responsibilities are independently changeable schema, integrity, data movement, compatibility, trigger, connection/journal, attached-database, performance, and recovery concerns.
Object and statement breadth, rebuild and data movement, trigger definitions and actions, and joins and query depth often describe the same change. Disclose correlation rather than stacking them automatically.
Historical migrations, generated schemas, dumps, snapshots, fixtures, framework output, and maintained conformance corpora keep their producer and historical ownership. Do not rewrite, squash, split, or hand-refactor them solely because they exceed a threshold. Repeated dump inserts normally form one data family. Measure embedded SQL units where useful and review generator reproducibility, consumer compatibility, restore behavior, and protected-data exposure.
An existing Red legacy artifact may receive the smallest safe fix when current authority permits it, the change adds no independent responsibility, and it avoids meaningful growth. Record the preserved boundary. New responsibility or major feature growth remains Red. A classified cohesive artifact changes a Red response only through an accepted bounded exception; semantic Red remains Red.
ATTACH, extension names, or filesystem paths.DEFERRED can fail on read-to-write upgrade; IMMEDIATE reserves write
capability at start; rollback-mode EXCLUSIVE also blocks readers. Long or
material concurrency changes are Orange. Unknown state, unsafe non-idempotent
retry, or unbounded duration is Red.SQLITE_BUSY handling is Yellow. Writer-
ownership redesign is Orange. Assuming simultaneous writers, ignoring busy,
or retrying forever is Red.-wal/-shm are manipulated
independently.integrity_check alone.ALTER TABLE is Yellow on controlled data and Orange live.
A generalized rebuild is Orange only under the bounded structural contract.
An unsafe rename-old-first sequence, partial replacement, or uncontrolled
writable_schema editing is Red.STRICT adoption is Yellow after
minimum-version and driver checks and Orange for conversion. Correctness that
falsely depends on rigid ordinary declared types is Red.INTEGER PRIMARY KEY identity can be Green. AUTOINCREMENT is
Yellow only for a documented never-reuse requirement. Implicit ROWID
stability across rebuild or VACUUM is not a durable external contract.AFTER triggers can be Yellow.
Hidden multi-table side effects are Orange. Undefined BEFORE trigger
behavior, unsafe unqualified TEMP trigger targets, or unresolved reader
incompatibility is Red.journal_mode, synchronous, extension, URI, or ATTACH behavior
overrides lower structural counts. Durability-policy change is Orange. For
authoritative persistent data, journal_mode=OFF, journal_mode=MEMORY, or
synchronous=OFF is Red.ATTACH with qualified names can be Yellow or Orange. Assuming
cross-file atomicity when the main database is WAL or in-memory is Red.VACUUM INTO, or replacement is Orange with exact
authority, target, busy, space, permission, and recovery evidence. A backup-
API completion, copy, checksum, or integrity result is not a tested restore.
An untested backup used to justify destructive file replacement is Red.integrity_check,
foreign_key_check, and relevant application-level semantic validation.
quick_check or one integrity result alone is not complete proof..fullschema statistics, dumps, paths, backups, logs, and
errors must remain within authorized minimized sinks. Leakage is Red.The repository owns the SQLite library and driver versions, build options, connection and pool policy, migration framework, schema and compatibility, transaction and busy policy, journal and checkpoint mode, filesystem and process topology, VFS and URI policy, extensions, file ownership and permissions, backup mechanism, validation, deployment, tests, and exceptions. The current task owns whether any database may be opened, queried, attached, checkpointed, migrated, backed up, restored, replaced, or deleted. This profile does not grant live database access.
Report the actual SQLite library and parser basis, artifact classification, structural measurements, connection/journal/filesystem assumptions, known and unknown live facts, protected-data boundary, highest response, focused validation, and truthful recovery or forward-correction plan. Static review cannot establish writer contention, lock state, journal state, database size, filesystem guarantees, permissions, or restore success.
This provisional profile was inspected on 2026-07-21 against SQLite 3.53.3, released 2026-06-26. SQLite states that its core code and documentation are dedicated to the public domain; adjacent build tooling, wrappers, extensions, and proprietary offerings can have different terms. This profile uses independently written synthesis. Refresh for a later release, materially different driver/build configuration, changed WAL guidance, or changed rights boundary.
Stop for any Red signal, including injected grammar or extension loading,
unsafe writer or retry assumptions, WAL/network or sidecar hazards, silently
disabled integrity, unsafe rebuilds, false row identity, unsafe durability
PRAGMAs, unintended URI/path/ATTACH access, an untested backup used for
destruction, protected-data leakage, destructive file replacement, or live
database access without exact authority. Meaningful crisis-level structural
growth also stops pending decomposition or an accepted bounded exception.
SQLITE_BUSY indefinitely.ROWID as a
durable external identity.journal_mode or synchronous as if it were ordinary query text.Removal is bounded: remove this leaf, its relative projection, catalog and capability-map rows, known-unmanaged entry, and focused tests while retaining the historical ADR, evaluation, exit, and provenance record.