Self-hosted SCHEMA_VERSION bump destroys the live pipeline's own runner.db mid-drive #473
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#473
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Single-epoch recreation (db.rb) wipes .sdlc/runner.db whenever the binary's SCHEMA_VERSION differs from the DB's. In the #467 self-hosted drive, the worked ticket bumped the version and the pipeline destroyed its own state at the next runner call; the stale plugin-cache binary then re-wiped in the other direction on every SubagentStart hook fire. Two implementations lost (O6, docs/os-sdlc-rebuild/poodr-map-first-drive.md). Fix needs design: exempt the DB backing an active implementation, or refuse-with-message instead of silent recreate.
Skeptic verdict: CREATE — data-loss defect, hard floor, needs its own design decision.
Origin
Work started on branch 473-474-guards. Agreed design: keep the automatic schema wipe, but refuse (StaleSchemaError) when the DB holds an implementation with no terminal stamp; old file archives to pipeline.db.stale on every wipe. Amends ADR-0129 (ADR to follow).
Resolution
Done: Db.connect keeps the automatic wipe but refuses with StaleSchemaError when the stale file holds an implementation row with no terminal stamp (shared Lifecycle.active?, row-wise so pre-18 schemas are safe); every permitted wipe archives the old file to pipeline.db.stale instead of File.delete. TDD, Codex-reviewed design.
Evidence: Commit
dc1fa24, merged2d4babeon main; ADR-0155 amends ADR-0129; tests in tests/runner/db_migration_test.rb incl. all four terminal stamps, refusal message versions, refused-wipe integrity, and a hand-built v17 fixture without escalated_at; full suite 1218 runs 0 failures; plugin cache refreshed.Follow-ups: none — Codex-suggested process-wide lock rejected as speculative hardening (archive rename removes the destructive race half), recorded in ADR-0155 alternatives