Skip to content

refactor(db): remove demo seed data — clean empty DB on first deploy (v0.6.0) - #90

Merged
argszero merged 1 commit into
mainfrom
refactor/remove-demo-seed
Aug 19, 2026
Merged

argszero merged 1 commit into
mainfrom
refactor/remove-demo-seed

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Remove all demo seed data per host rant 2026-08-19T10:41:03 (project aitokenpool): production standard — no seed_demo flag, no fake accounts / balances / placeholder keys. First deployment = clean empty DB (tables only).

Changes

  • db::open() no longer calls seed() — first deploy creates an empty schema-only database
  • Old seed() (demo/admin/ops users, balance 12471, placeholder key) → #[cfg(test)] seed_test_users() test-fixture helper — production builds exclude it entirely
  • Test helpers (test_state in routes/gateway, tmp_db in billing, plus db tests) now explicitly call the helper to keep 102/102 tests green
  • auth::hash_password → #[cfg(test)] (no production callers until a register endpoint exists)
  • UI (ui/index.html): login email/password prefill, demo-hint line, settings email placeholder — demo credentials removed
  • README (v0.6.0): login section now documents the clean empty DB and manual first-admin creation (SQLite example); changelog entry added
  • docs/architecture.md: seed-account mention updated

Tests

  • cargo test — 102/102 pass
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --check — clean
  • node --check on all ui/js/*.js — clean

…(v0.6.0)

Rant 2026-08-19T10:41:03: remove all demo seed data; production standard
(no seed_demo flag, no fake accounts/balances/placeholder keys).

- db::open() no longer seeds; first deploy = clean empty DB (tables only)
- old seed() -> #[cfg(test)] seed_test_users() helper (test fixtures only,
  excluded from production builds)
- test_state/tmp_db helpers in routes, gateway, billing now call the helper
- db tests assert empty DB + seed helper idempotency
- auth::hash_password -> #[cfg(test)] (no production callers yet)
- UI: login prefill, demo-hint, settings email placeholder cleared
- README/docs: login section documents manual first-admin creation
- 102/102 tests, clippy -D warnings, fmt clean
@argszero
argszero merged commit 35291b3 into main Aug 19, 2026
1 check passed
argszero added a commit that referenced this pull request Sep 27, 2026
…315)

Three sentences in ui/README.md named something a reader cannot find.
Each is corrected in place, with the change that invalidated it named
(the idiom the file already uses for its endpoint-card and login-page
sections).

1. bump() wiring. The line claimed 4 balance-change sites including
   "raise-request approval" and an "isMe" guard. The code has 3 sites
   (4 bump() calls: two for the wallet top-up, one for the operator
   crediting themselves, one for the chat deduction). The approval site
   lived in the local mock branch that mutated D.USER.balance in place;
   89963f3 (#94, zero-mock) deleted that branch and approveRaise() now
   only reloads the list, so the bump went with it. The same refactor
   inlined the self-top-up guard to `u.email === D.USER.email`.

2. The login "remember me" bullet still said a `demo-hint` element
   showed the demo account. 35291b3 (#90, v0.6.0 demo-seed removal)
   deleted that element; the class rule in ui/css/style.css is now
   orphaned and the `login.demo` pack key already sits in the
   unreachable sunset list.

3. The C2113 section cited
   `transactions_model_and_key_filters_match_the_displayed_placeholder`.
   No such test ever existed: dfa7318 (#231) added the README line and
   a test named `tx_model_and_key_filters_match_the_displayed_placeholder`
   in the same commit. The name now matches the file it cites.

The corrections describe what was removed rather than re-printing the
removed identifiers, so a grep for a stale name still lands nowhere
(this is how the C2138 correction above already reads; the login-page
section is the deliberate exception -- there the deleted selectors are
the section's own subject).

Docs only: no production code, no i18n key, no cache-bust token. The
orphaned .demo-hint rule is left alone on purpose (removing CSS is a
separate, cache-busting change).
cargo test 413/0, fmt/clippy clean.
argszero added a commit that referenced this pull request Sep 30, 2026
#332)

`ui/css/style.css` carried four rules whose names no longer appear on any
element — in the markup, in the scripts, or in the design baseline the file
itself declares (`ui/css/style.css:4`, `docs/prototype/aitokenpool-console.html`):

- `.demo-hint` — the element went away with the demo-seed cleanup (#90
  `35291b3`); the rule stayed, and its i18n key was already retired.
- `.login-divider` (+ `::before` / `::after`) — #159 `f46882c` moved the
  markup to the prototype's own name, `.divider`; the old rules kept a
  "historic alias" comment and nothing else.
- `.wallet-note` — #156 `41bb6d1` rewrote the element as
  `.wallet-hero-note`; the old rule was left in place.
- `.sidebar #toggle-mode-btn` (inside the mobile media query) — the button it
  hides never reached the product; the `#logout-btn` next to it in the same
  selector list is live.

A rule nobody carries still applies — writing `class="wallet-note"` today
still gets its 12px — which is why these read as live component rules for
elements that no longer exist. `.delta` (three rules) is deliberately kept:
the prototype's `statCard()` really does emit `<div class="delta ok">`, so it
is design-baseline vocabulary, not a leftover.

The rules are deleted; the one inside the media query is dropped from the
selector list only (the sibling `#logout-btn` stays). No behaviour changes:
nothing renders these names.

`src/layout_gate.rs` gains a fourth rule, `every_selector_lands_on_an_element`,
so the next such rule is caught when it appears. The token roster is derived
from the selector text and the script roster is borrowed from `js_gate`, so a
new `ui/js/*.js` cannot slip past it; there is no hand-written name list. The
read is deliberately wide (a name mentioned anywhere, even in a comment,
counts as a landing site) and the baseline corpus is an intentional escape
hatch — the gate proves a name has a landing site, not that the landing site
is the element it was written for.
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