docs(cache): rewrite §7.1, §7.2, §7.3 and amend §8 PR-009 per ADR 0006 - #1004
Merged
AnthonyMDev merged 2 commits intoMay 29, 2026
Merged
Conversation
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 8d877dcfae46028f1a68c4d4 ✅ AI Style Review — No Changes DetectedNo MDX files were changed in this pull request. Review Log: View detailed log
|
Base automatically changed from
cache-rewrite/adr-0006-list-storage
to
cache-rewrite/phase-1-plan
May 29, 2026 16:31
ADR 0006 (#1002) ratified the in-place row-per-element layout with a `position` column extending the records-table PK. This commit propagates that decision into the engineering plan and execution plan. cache-rewrite-phase1-plan.md changes: - §7.1 DDL: removes `list_value TEXT`; adds `position INTEGER NOT NULL DEFAULT -1`; PK becomes `(cache_key, field_name, position)`. Adds a brief preamble explaining the row-per-element semantics and citing ADR 0006. Updates `child_key_value` comment to acknowledge its dual use for nested-list sub-record indirection. Schema version bumped from 3 to 4. - §7.2 Operations: `selectRecords` now orders by `(cache_key, field_name, position)` and the decoder branches on `position` to dispatch scalar vs list-element rows. `addOrUpdate` produces one row per scalar field and N rows per list-typed field; list-element rows for a field are rewritten atomically. `deleteRecord` handles the depth ≥ 2 cascading reachability walk for nested-list sub-records. - §7.3 Migration: trigger updated from "< 3" to "< 4". Adds a sentence noting that the trigger absorbs both 2.x upgrades and any local-dev databases on v3; v3 never tagged externally. cache-rewrite-phase1-execution.md changes: - §8 PR-009 entry: title updated to "feat(sqlite): row-per-element CRUD with position-keyed schema"; tests-required rewritten to cover position-keyed CRUD, nested-list recursion at depth ≥ 2, atomic list-element rewrite, and the v3 → v4 schema version bump. Adds a note that this PR supersedes the prior "JSON list_value" scope but retains the row-per-field harness landed in the original implementation. LoC estimate bumped from ~600 to ~700, which crosses execution plan §6 trigger 1's 600-LoC threshold. Reviewer awareness is flagged in the PR description; the amended scope is genuinely larger than the original because it covers the schema update, the nested-list recursion, and the atomic-rewrite contract. If the actual diff materially exceeds this estimate, PR-009 should escalate per §6 trigger 1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…009 (CRUD) The prior commit collapsed both the DDL replacement and the position-aware CRUD work into PR-009's amended scope, bumping its LoC estimate to ~700 — across the §6 trigger 1 (600 LoC) threshold. That also conflated work that conceptually belongs to two different phase slots: PR-008's theme (records-table DDL) and PR-009's theme (CRUD on that DDL). This commit splits the work back into two PRs matching the existing sub-ID convention used by PR-004a, PR-004b, PR-011a, PR-011b, PR-022a (sub-IDs extend a parent PR's theme with additional related work): - New PR-008b: replaces the records DDL with the position-keyed v4 schema per ADR 0006. Drops/recreates the records table; bumps schema_metadata version 3 → 4; updates the migration trigger to `< 4`. ~150 LoC. Base: PR-008. - Narrowed PR-009: position-aware CRUD against PR-008b's DDL. No longer carries the schema version bump. Back to ~600 LoC, under the §6 trigger 1 threshold. Base: PR-008b. Phase 1A header bumped from "(10 PRs)" to "(11 PRs)". The "Phase 1A done" condition on line 331 (PR-005 through PR-012 merged) still covers PR-008b — sub-IDs land within the range. The convention precedent (sub-IDs extend, don't replace) is the deciding factor for naming this PR-008b rather than PR-009b: PR-008b *adds* a DDL replacement to PR-008's theme; PR-009b would *replace* PR-009's planned output, which none of the existing sub-IDs do. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AnthonyMDev
force-pushed
the
cache-rewrite/adr-0006-plan-updates
branch
from
May 29, 2026 16:33
edf4ec5 to
9550491
Compare
AnthonyMDev
merged commit May 29, 2026
4dfb34e
into
cache-rewrite/phase-1-plan
8 of 10 checks passed
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Propagates ADR 0006 — List storage: in-place row-per-element with
position— into the engineering plan and execution plan.Stacked on #1002. Targets the ADR PR's branch (
cache-rewrite/adr-0006-list-storage). When #1002 merges intocache-rewrite/phase-1-plan, this PR rebases and retargets per execution plan §7's re-stack policy.Engineering plan changes (
cache-rewrite-phase1-plan.md)§7.1 DDL —
list_value TEXTremoved;position INTEGER NOT NULL DEFAULT -1added; PK extended to(cache_key, field_name, position). Brief preamble explains the row-per-element semantics and cites ADR 0006. Schema version bumped from 3 to 4.§7.2 Operations —
selectRecordsorders by(cache_key, field_name, position); decoder branches onpositionto dispatch scalar (= -1) vs list-element (>= 0) rows.addOrUpdateproduces one row per scalar field and N rows per list-typed field, with atomic list-element rewrite.deleteRecordcovers the depth ≥ 2 cascading reachability walk for nested-list sub-records.§7.3 Migration — trigger updated from
< 3to< 4. Adds a sentence noting that the trigger absorbs both 2.x upgrades and any local-dev databases on v3.Execution plan changes (
cache-rewrite-phase1-execution.md)§8 Phase 1A table — split the DDL replacement and CRUD work into two PR slots that follow the existing sub-ID convention (PR-004a, PR-004b, PR-011a, PR-011b, PR-022a all extend a parent PR's theme with additional related work):
PR-008b (new) —
feat(sqlite): replace records DDL with position-keyed v4 schema per ADR 0006. Drops/recreates the records table with the extended PK; bumpsschema_metadataversion 3 → 4; updates the migration trigger to< 4. ~150 LoC. Base: PR-008.PR-009 (narrowed) —
feat(sqlite): row-per-element CRUD against position-keyed schema. Position-aware encoder + decoder; nested-list synthetic sub-record recursion at depth ≥ 2; atomic list-element rewrite. No longer carries the schema version bump (lives in PR-008b). ~600 LoC, back under the §6 trigger 1 threshold. Base: PR-008b. Supersedes the original "JSON list_value CRUD" scope.Phase 1A header bumped from
(10 PRs)to(11 PRs). PR-010 and beyond unchanged (PR-010's Base stays PR-009).One judgement call to confirm — schema version bumped 3 → 4
PR-008 (already merged) stamped v3 with the old JSON-list shape. ADR 0006 changes the records-table column shape, PK, and row semantics. Bumping to v4 gives any local-dev databases that ran the v3 shape on the plan branch a clean drop-and-rebuild on next launch (the §7.3 migration trigger catches
< 4). Keeping v3 with redefined meaning was the alternative; I picked the bump for cleaner version-history discipline. v3 never tagged externally so no end-user installation is affected either way.What stays the same
Revision history
282a1ee71— initial split: §7.1/§7.2/§7.3 rewritten; §8 PR-009 collapsed both DDL + CRUD into a single amended row with ~700 LoC.edf4ec586— split PR-009's amended scope into PR-008b (DDL) + narrowed PR-009 (CRUD), per the existing sub-ID convention. PR-009 LoC back to ~600, no longer crosses §6 trigger 1.Out of scope
gh apiPATCH after this PR opens (adds the PR-008b row in Phase 1A and amends PR-009's row title; bumps the Phase 1A counter).Test plan
deleteRecord.gh apiPATCH after this PR is opened).🤖 Generated with Claude Code