refactor(config): mandatory app-config rows seeded in DB; rename to session.setup_timeout

All registry keys must exist as rows in the config table: main seeds
missing keys with their defaults at startup, LoadApp fails fast on a
missing key, and the code-side fallback const/helper for the onboarding
setup timeout is gone -- the value rides in SessionConfig.SetupTimeout.
The key is renamed session.idle_timeout -> session.setup_timeout, and
the /config page's 'overridden' now means 'differs from the default'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 18:17:24 +02:00
parent 8c9285f33c
commit 0e6cf00dba
16 changed files with 127 additions and 120 deletions

View File

@@ -22,8 +22,8 @@
**Files:**
- Create: `backend/internal/store/migrations/0003_profile.sql`
- Create: `backend/internal/store/profile.go`
- Test: `backend/internal/store/profile_test.go`
- Create: `../../../backend/internal/store/profiles.go`
- Test: `../../../backend/internal/store/profiles_test.go`
**Interfaces:**
- Produces: `store.Profile` struct, `(db *DB) GetProfile(ctx context.Context) (Profile, error)`, `(db *DB) UpdateProfile(ctx context.Context, p Profile) error`.
@@ -72,7 +72,7 @@ INSERT INTO profile (id) VALUES (1);
- [ ] **Step 2: Write the failing test**
Create `backend/internal/store/profile_test.go`:
Create `../../../backend/internal/store/profiles_test.go`:
```go
package store
@@ -130,9 +130,9 @@ func TestProfile_DefaultsThenUpdate(t *testing.T) {
Run: `cd backend && go test ./internal/store/... -run TestProfile -v`
Expected: FAIL — `db.GetProfile undefined` (compile error, `Profile` type/methods don't exist yet).
- [ ] **Step 4: Write `profile.go`**
- [ ] **Step 4: Write `profiles.go`**
Create `backend/internal/store/profile.go`:
Create `../../../backend/internal/store/profiles.go`:
```go
package store
@@ -253,7 +253,7 @@ Expected: PASS
- [ ] **Step 6: Commit**
```bash
cd backend && git add internal/store/migrations/0003_profile.sql internal/store/profile.go internal/store/profile_test.go
cd backend && git add internal/store/migrations/0003_profile.sql internal/store/profiles.go internal/store/profiles_test.go
git commit -m "feat: add single-profile settings table and store layer"
```
(If this is the first commit in the repo, run `git init` first and skip any `git add` of files outside `backend/` — later tasks add frontend files separately.)
@@ -876,7 +876,7 @@ Expected: all PASS.
- [ ] **Step 7: Commit**
```bash
cd backend && git add internal/api/profile.go internal/api/server.go internal/api/api_test.go
cd backend && git add internal/api/profiles.go internal/api/server.go internal/api/api_test.go
git commit -m "feat: add profile REST endpoints with HR zone validation"
```