Skip to content

[ai][docs] vocabulary plan: migrations declare and test their delete paths - #671

Merged
ddol merged 1 commit into
mainfrom
dd/docs/vocab-delete-semantics
Oct 4, 2026
Merged

ddol merged 1 commit into
mainfrom
dd/docs/vocab-delete-semantics

Conversation

@ddol

@ddol ddol commented Oct 4, 2026

Copy link
Copy Markdown
Member

Purpose

Carry the two still-valid items from the retired SQLite schema v2 freeze plan into the two-phase vocabulary programme (#631). That plan was removed in 510415a, before #559 merged. A review against #631 found nothing else in it that survives the shared-VRLOG design (VRLOG as the observation authority, SQLite as a rebuildable catalogue), so the plan itself is not restored.

Changes

  • The "000055 pattern" bullet in the vocabulary plan now also requires every new or rebuilt foreign key to declare its ON DELETE action and have a delete-path test, with PRAGMA foreign_key_check after the move. A rename keeps today's cascades without anyone noticing.
  • P2-B (clips and labels) acceptance:
    • Deleting a clip has a declared, tested effect on its labels. Today lidar_replay_annotations.replay_case_id is ON DELETE CASCADE, so deleting a clip deletes reviewed labels, which no recording can rebuild.
    • Nothing writes pcap_file once it is a read-only projection.
  • P2-F (sites and surveys) acceptance: deleting a site has a declared, tested effect on its deployments. Today site_config_periods.site_id is ON DELETE CASCADE.

Validation

  • Both cascades were checked in internal/db/schema.sql (lines 451 and 966).
  • The rest of the retired plan is covered by existing work, so it is not carried over:
    • startup refuses a dirty migration (migrate.go);
    • schema drift is checked (schema_consistency_test.go, P1-B);
    • rejected rows are quarantined (migration_rejects);
    • aliases expire (P1-A/P2-G);
    • foreign_key_check already runs in migration_055_test.go.
  • Prettier, backtick-path and plan-hygiene checks pass.

Checklist

  • Uses British English spelling/wording where applicable.
  • Design is confirmed and aligns with DESIGN.md.
  • Any maths/derived values are valid and up to date.
  • Version has been bumped where required. (Not required: documentation only.)
  • Documentation is up to date.
  • README.md is up to date. (Not affected.)
  • docs/DEVLOG.md is up to date. (Plan acceptance items only.)

🤖 Generated with Claude Code

…paths

Carries the two still-valid items from the retired SQLite schema v2
freeze plan (removed in 510415a, before #559 merged) into the two-phase
programme; nothing else in it survives the shared-VRLOG design.

- The 000055-pattern bullet: every new or rebuilt foreign key declares its
  ON DELETE action and has a delete-path test, with PRAGMA
  foreign_key_check after the move.
- P2-B acceptance: deleting a clip has a declared, tested effect on its
  labels (lidar_replay_annotations.replay_case_id cascades today, so it
  deletes reviewed labels), and nothing writes pcap_file once it is a
  read-only projection.
- P2-F acceptance: deleting a site has a declared, tested effect on its
  deployments (site_config_periods.site_id cascades today).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ddol
ddol merged commit 9b80e22 into main Oct 4, 2026
7 of 8 checks passed
@ddol
ddol deleted the dd/docs/vocab-delete-semantics branch October 4, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants