QA-source: #21721 · cli.dev-automigrate-policy · acceptance[5]
Clause A6 of cli.dev-automigrate-policy (rev 1) fails in the 17.7 pre-release run #21721 (subject 251a7dd4); verifier V6 reproduced it on fresh copies: CONFIRMED, medium. Predates 17.6.0.
Reproduction
- Blank scaffold: one object
scaf_item with an org-scoped field qa_code: { unique: true }, no plugins, no datasources.
os dev --no-watch -d file:A.db creates the NULL-safe index uniq_scaf_item_organization_id_qa_code … (COALESCE(organization_id,'__global__'), qa_code); stop.
- Replace it:
DROP INDEX uniq_scaf_item_organization_id_qa_code; CREATE UNIQUE INDEX uniq_scaf_item_organization_id_qa_code ON scaf_item (organization_id, qa_code);
os migrate plan --database-url file:A.db lists it as Safe: [recreate_index] … (auto-applied at boot under dev autoMigrate: 'safe').
os dev --no-watch -d file:A.db (twice): only [schema-drift] … (auto-applied at boot under dev autoMigrate: 'safe') is logged — itself misleading — and the index stays bare.
Control: the same staged DB booted with OS_MODE=off logs [schema-drift] auto-reconciled recreate_index on scaf_item.organization_id and the index comes back NULL-safe (it also creates A.telemetry.db, which the default boot does not). Host configs (a plugins[] entry with init, e.g. the showcase) self-heal too, so a showcase-based run never sees this.
Mechanism
Every non-host config goes shouldBootWithLibrary (packages/cli/src/utils/plugin-detection.ts:47) → createStandaloneStack (serve.ts ~2763), which builds the SQLite datasource with driverConfig = { filename } and no autoMigrate (packages/runtime/src/standalone-stack.ts ~745-760); DefaultDatasourcePlugin's factory passes autoMigrate only when the config has it (service-datasource/src/default-datasource-driver-factory.ts:1140). Because a datasource plugin is present, shouldAutoRegisterStorageDriver (stack-collections.ts:276) is false, so the isDev ? { autoMigrate: 'safe' } injection (storage-driver.ts:370) never runs — nor the telemetry datasource's 'safe' (serve.ts:3283).
What declares the behaviour
content/docs/deployment/cli.mdx:966: "os dev runs the SQL driver with autoMigrate: 'safe' … applied … automatically on restart"; the clause; the CLI's own plan / drift text. (Side observation, not checked for intent: the standalone path also has no telemetry datasource.)
Generated by Claude Code
QA-source: #21721 · cli.dev-automigrate-policy · acceptance[5]
Clause A6 of
cli.dev-automigrate-policy(rev 1) fails in the 17.7 pre-release run #21721 (subject251a7dd4); verifier V6 reproduced it on fresh copies: CONFIRMED, medium. Predates 17.6.0.Reproduction
scaf_itemwith an org-scoped fieldqa_code: { unique: true }, no plugins, no datasources.os dev --no-watch -d file:A.dbcreates the NULL-safe indexuniq_scaf_item_organization_id_qa_code … (COALESCE(organization_id,'__global__'), qa_code); stop.DROP INDEX uniq_scaf_item_organization_id_qa_code; CREATE UNIQUE INDEX uniq_scaf_item_organization_id_qa_code ON scaf_item (organization_id, qa_code);os migrate plan --database-url file:A.dblists it as Safe:[recreate_index] … (auto-applied at boot under dev autoMigrate: 'safe').os dev --no-watch -d file:A.db(twice): only[schema-drift] … (auto-applied at boot under dev autoMigrate: 'safe')is logged — itself misleading — and the index stays bare.Control: the same staged DB booted with
OS_MODE=offlogs[schema-drift] auto-reconciled recreate_index on scaf_item.organization_idand the index comes back NULL-safe (it also createsA.telemetry.db, which the default boot does not). Host configs (aplugins[]entry withinit, e.g. the showcase) self-heal too, so a showcase-based run never sees this.Mechanism
Every non-host config goes
shouldBootWithLibrary(packages/cli/src/utils/plugin-detection.ts:47) →createStandaloneStack(serve.ts~2763), which builds the SQLite datasource withdriverConfig = { filename }and noautoMigrate(packages/runtime/src/standalone-stack.ts~745-760);DefaultDatasourcePlugin's factory passesautoMigrateonly when the config has it (service-datasource/src/default-datasource-driver-factory.ts:1140). Because a datasource plugin is present,shouldAutoRegisterStorageDriver(stack-collections.ts:276) is false, so theisDev ? { autoMigrate: 'safe' }injection (storage-driver.ts:370) never runs — nor the telemetry datasource's'safe'(serve.ts:3283).What declares the behaviour
content/docs/deployment/cli.mdx:966: "os devruns the SQL driver withautoMigrate: 'safe'… applied … automatically on restart"; the clause; the CLI's own plan / drift text. (Side observation, not checked for intent: the standalone path also has no telemetry datasource.)Generated by Claude Code