You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ARCH-11: God files far beyond the repo 500-line rule (store_postgres.go 2790, recommendations.ts 5235) #40
Evidence:
CUDly/CLAUDE.md states "Keep files under 500 lines". store_postgres.go has 76 funcs / 51 SQL statements spanning service configs, plans+executions, accounts and overrides; sibling concerns were already split out (store_postgres_recommendations.go), showing the intended pattern. recommendations.ts mixes filtering, grouping, bulk-buy modal and rendering despite a working modular layout elsewhere.
Impact:
Highest-churn surfaces; size makes reviews shallow, invites intra-file duplication, and the rule is unenforced (no lint gate).
Recommendation:
Split along visible seams; add a max-lines warning to .golangci.yml / eslint to stop regression.
Claimed by claude-platform-2 (coordinator assignment 2026-11-14): premise-check against main first, then finish and close (or narrow with the leftovers named).
Premise check by claude-platform-2 on main: the issue's numbers are stale and the problem has grown: internal/config/store_postgres.go 4962 lines (was 2790), frontend/src/recommendations.ts 6119 (5235), settings.ts 3896, plans.ts 2621, riexchange.ts 2324, history.ts 2195, scheduler.go 1878, internal/mocks/stores.go 2912, types.go 1754, purchase/execution.go 1646. A move-only split counts every moved line twice against the 400-line commit cap (about 200 lines moved per commit), so this is dozens of commits, and it cannot be done conflict-free right now: at least ten live worktrees carry unmerged edits to store_postgres.go (e.g. #669 backend and #1858 with dirty changes, #631 ramp ledger), and recommendations.ts / plans.ts are held by the claude-platform recommendation/plan/ladder workstreams. Moving functions under them would turn each of their rebases into conflict resolution. Decision (owner rule): do not start the splits now; leave #40 open as a scheduled refactor. Proposed order when those workstreams are quiet: (1) store_postgres.go by area into store_postgres_.go (service configs, plans+executions, accounts, overrides, ledger), move-only, one area per commit, no behaviour change, go build + the full integration suite per commit; (2) scheduler.go; (3) frontend files after the recommendation workstream lands; (4) add a file-length warning (eslint max-lines for frontend; a small Go test or script for the 500-line rule) once the biggest files are under it, so it does not regress.
Claimed by claude-platform-2: starting the move-only split of internal/config/store_postgres.go (same package, no behaviour change, <=400 lines per commit).
Landed on main as a series ending at e393f1e (CI green on that SHA): internal/config/store_postgres.go went from 4990 to 80 lines (struct, constructor, tx and null/TTL helpers); 38 move-only store_postgres_.go files, each under 175 lines, commits each <=375 added+deleted. Verified move-only: the multiset of non-blank lines across all non-test store_postgres*.go files is identical before and after (12966 each), excluding package and import lines. One extra commit adds the new executions_list file to the misspell path exclusion in .golangci.yml. The file is free for other work; new methods belong in the matching store_postgres_.go.
Activity
cristim commentedon Nov 14, 2026
Claimed by claude-platform-2 (coordinator assignment 2026-11-14): premise-check against main first, then finish and close (or narrow with the leftovers named).
cristim commentedon Nov 14, 2026
Premise check by claude-platform-2 on main: the issue's numbers are stale and the problem has grown: internal/config/store_postgres.go 4962 lines (was 2790), frontend/src/recommendations.ts 6119 (5235), settings.ts 3896, plans.ts 2621, riexchange.ts 2324, history.ts 2195, scheduler.go 1878, internal/mocks/stores.go 2912, types.go 1754, purchase/execution.go 1646. A move-only split counts every moved line twice against the 400-line commit cap (about 200 lines moved per commit), so this is dozens of commits, and it cannot be done conflict-free right now: at least ten live worktrees carry unmerged edits to store_postgres.go (e.g. #669 backend and #1858 with dirty changes, #631 ramp ledger), and recommendations.ts / plans.ts are held by the claude-platform recommendation/plan/ladder workstreams. Moving functions under them would turn each of their rebases into conflict resolution. Decision (owner rule): do not start the splits now; leave #40 open as a scheduled refactor. Proposed order when those workstreams are quiet: (1) store_postgres.go by area into store_postgres_.go (service configs, plans+executions, accounts, overrides, ledger), move-only, one area per commit, no behaviour change,
go build+ the full integration suite per commit; (2) scheduler.go; (3) frontend files after the recommendation workstream lands; (4) add a file-length warning (eslint max-lines for frontend; a small Go test or script for the 500-line rule) once the biggest files are under it, so it does not regress.cristim commentedon Nov 14, 2026
Claimed by claude-platform-2: starting the move-only split of internal/config/store_postgres.go (same package, no behaviour change, <=400 lines per commit).
refactor(config): move global_config store methods to store_postgres_…
refactor(config): move global_config_update store methods to store_po…
refactor(config): move global_config_save store methods to store_post…
refactor(config): move service_overrides store methods to store_postg…
23 remaining items
refactor(config): move cloud_accounts_update and cloud_accounts_list …
refactor(config): move executions_save store methods to store_postgre…
refactor(config): move executions_retry store methods to store_postgr…
refactor(config): move executions_transition store methods to store_p…
refactor(config): move executions_cancel store methods to store_postg…
refactor(config): move executions_list store methods to store_postgre…
refactor(config): move executions_stale and executions_plan_locks sto…
refactor(config): move executions_get store methods to store_postgres…
refactor(config): move executions_count store methods to store_postgr…
refactor(config): move executions_scan store methods to store_postgre…
refactor(config): move plan_step store methods to store_postgres_plan…
refactor(config): move plan_mutations store methods to store_postgres…
chore(lint): extend the misspell path exclusion to store_postgres_exe…
cristim commentedon Nov 14, 2026
Landed on main as a series ending at e393f1e (CI green on that SHA): internal/config/store_postgres.go went from 4990 to 80 lines (struct, constructor, tx and null/TTL helpers); 38 move-only store_postgres_.go files, each under 175 lines, commits each <=375 added+deleted. Verified move-only: the multiset of non-blank lines across all non-test store_postgres*.go files is identical before and after (12966 each), excluding package and import lines. One extra commit adds the new executions_list file to the misspell path exclusion in .golangci.yml. The file is free for other work; new methods belong in the matching store_postgres_.go.