Skip to content

refactor: sprint 0 wave 3 (layer linter, second ratchet, db split into migrater and dbconn) - #423

Merged
PHPCraftdream merged 8 commits into
mainfrom
feat/sprint0-w3-pr-20261115
Nov 15, 2026
Merged

PHPCraftdream merged 8 commits into
mainfrom
feat/sprint0-w3-pr-20261115

Conversation

@PHPCraftdream

Copy link
Copy Markdown
Owner

Wave 3 of sprint 0.

  • Guards: layer linter (check_layers.sh, empty exception list), second ratchet over all files of a directory (at most 21, check_dir_files.sh) and a blocking list of files over 900 lines (check_file_size_900.sh), with selftests, wired into pre-push, pre-push-fast and the checks job.
  • DB split lanes DB-A and DB-B: internal/store/db/migrater (migrations, legacy import, driver pair, Migrate, PendingVersions) and internal/store/db/dbconn (compact, diskfree).
  • Ratchet fixes, isolation-fixture fix, and dbtest OpenFK/OpenSingle for platforms with the ncruces driver (mips64 lint).

Verified by the full fork CI run 43707656116 on 5458965 (all jobs green). The only difference between this head and the result of the merge is docs/plans from PR 422.

🤖 Generated with Claude Code

PHPCraftdream and others added 8 commits November 15, 2026 11:19
…d layer linter

Three guards with selftests and falling ratchet lists, wired into pre-push, pre-push-fast and the checks job: all hand-written code files of a directory including tests at most 21 (seeded with 25 directories), files above 900 lines may not grow (seeded with 38), and imports may only point down the groups kit < store < session < config < agent < app < serve (no production violations; two test files seeded, internal/agent/supervision_notice_binding_app_test.go and internal/config/task1314_oauth_disk_sync_test.go).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… db/migrater

DB-A of the db split: migrater owns the schema migrations (embedded, closed behind ActiveFS), the legacy store importer (split into the policy/driver half and the copying half), the SQLite driver pair with the pragma set and BusyTimeout, and Migrate. Only the intended hunks change: renamed exports, qualified call sites in connect.go, sdk, app, session and cmd, a local requireTableExists copy and dbtest.OpenFK/OpenSingle for tests that crossed the boundary. sqlc generate is a no-op with the new schema path; the db ratchet entry falls 16 -> 9 and ci-policy owners follow the new migrations path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DB-B of the db split: compact, the free-space probe and its OS pair move to db/dbconn; sessions compact calls them there. internal/store/db reaches 7 elements and leaves the dir-entries ratchet. compact_test.go keeps db.Connect/db.ReleaseAll qualified until the pool itself moves (DB-C).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…update pinned seeds

The db split leaves internal/store/db at 7 elements and 13 files with tests, so its dir-entries line (previous commit) and its dir-files line leave the ratchets; the real-repository selftest cases pin the new seeded sizes (38 and 24).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e migrating

The local openFixture copy lost the cleanup and the ping of the original helper, so the store file stayed open and TempDir removal failed on Windows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The modernc-only dbtest.go left OpenFK and OpenSingle undefined under
GOOS=linux GOARCH=mips64, so golangci-lint of ./internal/store/db/...
failed there. The negated-constraint twin mirrors the fixture pragmas.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@PHPCraftdream
PHPCraftdream merged commit 03924f5 into main Nov 15, 2026
1 check passed
@PHPCraftdream
PHPCraftdream deleted the feat/sprint0-w3-pr-20261115 branch November 15, 2026 12:15
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.

1 participant