Renata protected local-only SQL strategy

SQLite CLI Detection Strategy

Protected, read-only review of local sqlite3 CLI detection for the disposable role-set template dry-run path.

This is a protected, read-only review of local sqlite3 CLI detection. It does not install dependencies, target D1, use wrangler, add active migrations, write app data, or enable CRUD.

Purpose

This page documents the local-only sqlite3 CLI detection behavior for the manual disposable dry-run harness.

Default invocation still executes no SQL. The only SQL-capable path remains manual, local, disposable, and gated by --local-disposable-only.

Current Fallback Behavior

Fallback

SKIPPED_SQL_ENGINE_UNAVAILABLE

SKIPPED_SQL_ENGINE_UNAVAILABLE

Dependency Added

false

not-added

D1 Targeted

false

not-targeted

Wrangler Used

false

not-used

Local sqlite3 Detection Path

Strategy status Allowed binary Package script added Production target Preview target
local-cli-detection-only sqlite3 false false false
  • default invocation prints no-SQL usage only
  • manual SQL path requires --local-disposable-only
  • existing validator runs before SQLite detection
  • local sqlite3 CLI is checked with sqlite3 --version
  • sqlite3.exe may be checked on Windows as the same local CLI family
  • unavailable sqlite3 returns SKIPPED_SQL_ENGINE_UNAVAILABLE
  • available sqlite3 may run extracted approved SQL only against .tmp/role-set-template-dry-run
  • disposable artifacts are deleted by default

Manual Flag Requirement

The manual SQL path requires --local-disposable-only. Without it, the script prints the safe no-SQL usage message and exits without applying SQL.

Disposable Local Target Rules

When sqlite3 is available and the manual flag is present, SQL may apply only to a disposable local file under .tmp/role-set-template-dry-run/. The script must clean those artifacts by default and must never write tracked reports, app runtime database files, seed identities, active migrations, or endpoint code.

Safety Checks

  • manual flag required before any SQL path
  • validator must pass before any SQL path
  • draft artifact remains outside active migrations folder
  • draft artifact must contain LOCAL-ONLY and DO NOT RUN labels
  • approved role-set template tables only
  • prohibited table names rejected before execution
  • prohibited field names rejected before execution
  • D1 target remains none
  • wrangler usage remains none
  • production and preview targets remain none
  • active migrations folder remains unchanged
  • package scripts do not execute SQL
  • no dependency installation occurs

Stop Conditions

  • manual flag missing
  • validator fails
  • sqlite3 CLI unavailable
  • draft labels missing
  • draft appears in active migrations folder
  • unexpected active migration appears
  • prohibited table name appears
  • prohibited field name appears
  • D1 target appears
  • wrangler command appears
  • production or preview target appears
  • runtime write endpoint appears

What Remains Blocked

No dependency installation, automatic SQL execution, D1 target, wrangler command, active migration, production or preview database target, runtime query, write endpoint, CRUD UI, role-set runtime storage, user assignment, identity capture, submissions, staff decisions, tracking, analytics, scoring, billing, lead capture, or sensitive storage is active.

Prohibited binaries and commands: wrangler, d1, production target, preview target, remote database, Cloudflare D1 execute, network fallback.

  • package dependency installation
  • package script SQL execution
  • automatic SQL execution
  • D1 targeting
  • wrangler usage
  • production or preview database targeting
  • active migrations
  • runtime database queries
  • write endpoints
  • CRUD UI
  • role-set runtime storage
  • user assignment
  • role assignment
  • identity capture
  • identity storage
  • live submissions
  • staff decisions
  • attendance tracking
  • participation tracking
  • participation analytics
  • scoring, ranking, or compliance metrics
  • sensitive community content storage

Recommended Next Phase

Phase 7.15 - Disposable Local SQL Dry-Run Result Review

Boundaries: future phase only; review local dry-run result; no D1 activation; no wrangler execution; no active migration approval; no write endpoints; no CRUD UI; no user assignment; no submissions.

future-only