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
chore(db): drop users.salt once no running instance reads it #1956
Follow-up split out of #313 (everything else in #313 is done on main).
users.salt is no longer read or written by any non-test Go code (#1514 removed the reads, #1560 unified the column list). What is left:
A migration ALTER TABLE users DROP COLUMN salt.
The raw-SQL test fixtures that still INSERT salt (about 15 across internal/api/*_integration_test.go and other fixtures) must change in the same commit as the migration.
Deploy gate: migrations run at server startup, so the drop must not ship until no running instance reads the column (a rolling deploy would break logins on old instances). Land it only after the #1514 build is deployed everywhere.
Claimed by claude-platform-2 (coordinator assignment 2026-11-14; not touching store_postgres.go, plans.ts, recommendations.ts): premise-check against main, then implement and close (Closes #1956) or post the evidence/blocker.
Update (claude-platform-2): not implemented, deliberately. The issue's own deploy gate says the drop must not ship until the #1514 build (no reads of users.salt) is deployed to every running instance, because migrations run at server startup and a rolling deploy with an old instance still reading the column would break logins. Whether every environment (dev, staging, prod) runs a build at or after #1514 is live deployment state I cannot verify from the repo, so releasing the claim; owner confirms the deployed version, then the work is mechanical: migration ALTER TABLE users DROP COLUMN salt (number taken at merge, after #669's 000168 and any others) plus removing salt from the ~15 raw-SQL integration fixtures in the same commit. Logged in owner-decisions.md.
Reader/writer check for users.salt (claude-platform, on origin/main). The drop stays gated on the owner; nothing was dropped.
Runtime Go code: 0 readers, 0 writers. The only grep hits outside tests are unrelated: the hkdf nil salt argument (internal/auth/service_helpers.go:42) and a comment (internal/auth/service_password.go:65).
Migrations (historic, all run before any drop): 000001_initial_schema.up.sql:131 defines the column; 000005_create_admin_user.up.sql:25,34 and 000006_ensure_admin_user.up.sql:27,36 insert an empty salt.
Fixtures that INSERT a salt column (would fail after the drop): 6 api fixture files (combined_plan_purchase_integration_test.go:364,391,429; handler_plans_concurrency_integration_test.go:74; handler_purchases_retry_family_integration_test.go:52; handler_purchases_retry_submit_race_integration_test.go:103; handler_purchases_run_update_any_integration_test.go:30; handler_purchases_submit_dedupe_integration_test.go:164,325) and 11 migration test files (for example 000057_drop_user_role_to_groups_test.go:59,102,109,148; 000099_user_deactivated_at_test.go:28; 000103_api_key_password_version_test.go:23). internal/auth/store_postgres_no_salt_db_test.go:24 already drops the column in a throwaway database.
Docs: docs/audits/codebase-audit-2026-09-02.md:7949 says the Salt field goes once the column is gone. No runbook reads the column.
Implication: the drop migration is safe for the running app (no runtime reader), but about 17 fixtures must stop naming salt in the same commit. Recommended order: fixtures first, then the drop with a pre-drop column backup. Owner gate applies.
Verification after the normal CI deploy (claude-platform, 2026-11-20), read-only queries against the single dev database (owner-approved): schema_migrations is at version 176 and not dirty, so 000175 is applied. The users table has 10 rows and users_salt_backup_000175 has 10 rows, and the users.salt column no longer exists. The down migration restores the salts from that backup table. Drop the backup table (DROP TABLE users_salt_backup_000175) once you are satisfied; it holds the old salt values until then.
Activity
refactor(auth): keep auth test doubles out of production builds
refactor(auth): keep auth test doubles out of production builds
cristim commentedon Nov 14, 2026
Claimed by claude-platform-2 (coordinator assignment 2026-11-14; not touching store_postgres.go, plans.ts, recommendations.ts): premise-check against main, then implement and close (Closes #1956) or post the evidence/blocker.
cristim commentedon Nov 14, 2026
Update (claude-platform-2): not implemented, deliberately. The issue's own deploy gate says the drop must not ship until the #1514 build (no reads of users.salt) is deployed to every running instance, because migrations run at server startup and a rolling deploy with an old instance still reading the column would break logins. Whether every environment (dev, staging, prod) runs a build at or after #1514 is live deployment state I cannot verify from the repo, so releasing the claim; owner confirms the deployed version, then the work is mechanical: migration
ALTER TABLE users DROP COLUMN salt(number taken at merge, after #669's 000168 and any others) plus removing salt from the ~15 raw-SQL integration fixtures in the same commit. Logged in owner-decisions.md.cristim commentedon Nov 15, 2026
Reader/writer check for users.salt (claude-platform, on origin/main). The drop stays gated on the owner; nothing was dropped.
Runtime Go code: 0 readers, 0 writers. The only grep hits outside tests are unrelated: the hkdf nil salt argument (internal/auth/service_helpers.go:42) and a comment (internal/auth/service_password.go:65).
Migrations (historic, all run before any drop): 000001_initial_schema.up.sql:131 defines the column; 000005_create_admin_user.up.sql:25,34 and 000006_ensure_admin_user.up.sql:27,36 insert an empty salt.
Fixtures that INSERT a salt column (would fail after the drop): 6 api fixture files (combined_plan_purchase_integration_test.go:364,391,429; handler_plans_concurrency_integration_test.go:74; handler_purchases_retry_family_integration_test.go:52; handler_purchases_retry_submit_race_integration_test.go:103; handler_purchases_run_update_any_integration_test.go:30; handler_purchases_submit_dedupe_integration_test.go:164,325) and 11 migration test files (for example 000057_drop_user_role_to_groups_test.go:59,102,109,148; 000099_user_deactivated_at_test.go:28; 000103_api_key_password_version_test.go:23). internal/auth/store_postgres_no_salt_db_test.go:24 already drops the column in a throwaway database.
Docs: docs/audits/codebase-audit-2026-09-02.md:7949 says the Salt field goes once the column is gone. No runbook reads the column.
Implication: the drop migration is safe for the running app (no runtime reader), but about 17 fixtures must stop naming salt in the same commit. Recommended order: fixtures first, then the drop with a pre-drop column backup. Owner gate applies.
test(users): stop naming the salt column in fixtures (#1956)
cristim commentedon Nov 20, 2026
Verification after the normal CI deploy (claude-platform, 2026-11-20), read-only queries against the single dev database (owner-approved): schema_migrations is at version 176 and not dirty, so 000175 is applied. The users table has 10 rows and users_salt_backup_000175 has 10 rows, and the users.salt column no longer exists. The down migration restores the salts from that backup table. Drop the backup table (DROP TABLE users_salt_backup_000175) once you are satisfied; it holds the old salt values until then.