Commit Graph
219 Commits
Author SHA1 Message Date
Cato 6c94ad5f25 Stop briefing agents with retired Revamp-IT facts. (#560)
Staff is the is_staff column, and production is one app on Hetzner. The agent brief, the auth doc, and the generated API page still said otherwise, so the next session kept reopening closed work. lint:claims fails the build if those sentences come back.
2026-10-14 05:23:24 -07:00
CatoandClaude 346b19c5b6 ci: the fleet's file-input check runs in verify (#542)
Adds @bitbaum/chatkit (dev only — evig has no chat) for its
chatkit-check-file-inputs bin, and `check:file-inputs` to `verify`, which
CI runs verbatim. It fails any file input whose literal accept mixes image
and document families, the shape that made Android show a capture-app
chooser instead of the file browser (SourceUploader, fixed in #537).

Pinned to the merged chatkit 0.4.1 commit until it is on npm.


Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 05:18:17 -07:00
CatoandClaude 69022040d9 feat(records): ROADMAP.md, CHANGELOG.md and a public /roadmap read from the fleet map (#522)
evig joins the fleet's building-in-public record contract. The record lives
in this repository as two markdown files; Loki's fleet map ingests them and
the site renders them from the map, so there is one source and no local copy
that can drift.

- ROADMAP.md at the root, Now / Next / Later / Shipped with milestones,
  derived from CLAUDE.md, docs/ and the git history. No dates. The honesty
  boundary holds: the Verein is "in Gründung", nothing claims receipts or a
  recognised non-profit status.
- CHANGELOG.md at the root in Keep-a-Changelog form, generated from the same
  releases src/config/changelog.ts renders at /changelog; that config now
  states the root file is the canonical record and must move with it.
- /[locale]/roadmap renders profile.roadmap from
  loadDevelopmentProfile(fleet map, "evig") with evig's own chrome
  (PageHero, Section, Card) — the data is the map's, the markup is ours, so
  the card-shell ratchet holds at 3. Fetch revalidates every 300s with an 8s
  timeout. A null profile says the record is temporarily unavailable; an
  empty one says nothing is recorded yet.
- Labels for the page and the footer link in all eight locales, DE canonical.
- Footer links the roadmap next to the changelog; both are in the sitemap.
- Unit test for the data path over a fleet-map fixture through
  developmentProfileFromMap, grouping, progress and the fetcher's cache
  semantics.

Until Loki's producer change deploys, the live map carries no evig records
and the page shows "nothing recorded yet" — expected.


Claude-Session: https://claude.ai/code/session_01NJJp6XiUkeEVzjDaBmWjL3

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 04:37:09 -07:00
CatoandClaude Opus 5 65ed27a08c fix(e2e): stop shipping the two E2E login addresses as defaults (#491)
The E2E personas are real accounts on a real deployment, and every place
that needed one carried it as a literal in a public repo: a fallback in
scripts/e2e-inventory-prod.sh, four `|| '...'` defaults across the e2e
specs and their auth helper, a workflow header comment, and two docs
tables. The repo therefore published whose accounts they are — and the
defaults were dead weight besides: CI has supplied both addresses from
the repository secrets of the same name since they were created, so the
literals were an unreachable branch that only ever leaked.

Now there is no default anywhere. The addresses come from
AUTH_TEST_USER_EMAIL and AUTH_TEST_ADMIN_EMAIL, both existing repo
secrets, and the absence of one is an error rather than a quiet
substitution:

- scripts/e2e-inventory-prod.sh requires both with `:?` naming the
  secret. The "no passwords configured, skip" path still runs first, so
  an unconfigured checkout is unaffected.
- The two consuming jobs guard first and fail with `::error::` naming
  the missing secret, instead of dying inside bash or playwright.
- The specs skip a persona when its address is unset, the same way they
  already skip on a missing password, rather than attempting a login
  with an empty e-mail and reporting it as a broken page.

Unchanged: the e2e-local job, which sets all four addresses to its own
seeded @evig.test fixtures at job level, so the defaults were never
reached there either.

Not addressed here, and still in the tree: the owner's address in the
SUPER_ADMIN_EMAILS allowlist (plus its assertions and the applied SQL
migrations that reference it), and the public contact address in
src/config/org.ts, which is published on purpose. Those are identity and
data, not E2E credentials, and removing them is a separate decision.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 03:27:12 -07:00
CatoandClaude Fable 5.1 e2c67d8aa5 chore(cleanup): dedupe migrations, blog scripts, i18n baseline; rate limiting over limitkit; no-console (#488)
* chore(db): empty the two byte-identical duplicate migrations instead of skipping one

004_ai_inventory_system.sql and 005_messaging_system.sql were 402- and
295-line copies of 004b and 005c (the originals were renamed with a suffix
in 21a6b2477, then re-added unsuffixed in e920eb231). Both names are
recorded in production's schema_migrations — backfilled by
083_backfill_schema_migrations.sql, which lists all four filenames — so
neither file can be deleted without a restore-from-backup audit reading it
as a vanished migration.

The bodies are gone; each file keeps a comment with the history. Applied
as a no-op, so the MIGRATION_SUPERSEDED skip list in migration-order.sh
(which existed only because 005's unguarded CREATE TRIGGERs aborted a
second application) is no longer needed and is removed from all three
runners' comments. The deploy script was not run; evidence is read from
the migration files and the runner sources only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* chore(scripts): delete the Strapi-era blog and docker setup scripts

scripts/setup-blog.sh and scripts/start-blog.sh were byte-identical copies
of tools/development/setup-blog.sh and start-blog.sh; all four drove a
Strapi blog that no longer exists (the blog is DB-backed, no compose file
has a Strapi service, and .gitignore's /strapi entry pointed at nothing).
tools/development/docker-setup.sh was the wrapper around the same stack.
Nothing in package.json, CI or the docs invoked any of them; the one
prose mention in docs/guides/system-integration.md now says so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* fix(i18n): baseline states each missing key once, not once per locale

scripts/baselines/i18n-missing.json listed the same ~90 keys under each of
six locales — six near-identical blocks that jscpd flagged as the repo's
largest clone group. The generator now writes one entry per key naming
the locales it is missing from; the audit converts back to the per-locale
view it compares against, so its regression semantics are unchanged
(0 new, 0 fixed on regeneration).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* refactor(security): one rate limiter over limitkit, lockout kept apart

Two hand-rolled limiters served ~20 routes each: an lru-cache counter in
lib/security/rate-limit.ts and a bare-Map window in lib/auth/rate-limiter.ts.
Both are replaced by the fleet's limitkit (SHARED.md); evig keeps only its
limit VALUES and the call shapes routes were written against, so no route
changed beyond its import. The auth file's account-lockout half — a
per-account, DB-backed state, not rate limiting — lives on as
lib/auth/lockout.ts. AUTH_CONFIG.rateLimit moves next to the other limits
as AUTH_RATE_LIMITS; lru-cache is dropped.

Behaviour that changed underneath, deliberately: sliding windows instead
of a TTL that restarted on every hit, refusals no longer count (a hammered
key recovers when the attacker stops), the client IP is the last
X-Forwarded-For hop (the one Caddy wrote), and the store is bounded. The
login limit was "5 per 15 min then a 30-min block"; limitkit does not
model a punitive block, so it is 5 per sliding 30 minutes — the same
steady-state admission.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* chore(lint): no-console in src/, and a useMounted hook for the SSR mount flag

App code logs through src/lib/logger.ts, the one console sink. ESLint now
enforces no-console (warn/error allowed) across src/, with the logger and
tests carved out; scripts/ are CLIs whose stdout is their output and stay
uncovered.

Four components each carried a useState(false)+useEffect(setMounted(true))
pair with a react-hooks/set-state-in-effect exception. They share one
useMounted() built on useSyncExternalStore, which needs no effect and no
exception.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 22:42:11 -07:00
CatoandClaude Fable 5.1 43eeb203fc chore: rename FleetCrown to Loki (#476)
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
21 files changed, 30 insertions(+), 30 deletions(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:23:26 -07:00
894b203602 docs: sync docs with actual stack (#447)
Docs truth-sweep against ground truth (package.json, CI workflows):
- npm → pnpm across evergreen docs (pnpm 11.25.0 is the package manager;
  npx tsx → pnpm exec tsx, npx ts-prune/jscpd → pnpm dlx, npm ci →
  pnpm install --frozen-lockfile, package-lock.json → pnpm-lock.yaml)
- Jest → Vitest in README, CONTRIBUTING, COMMANDS (vitest 4 is installed)
- Node claims: README 20+ → 22.13+ (engines) with CI/deploy on 24;
  deployment.md "Setup Node 20 (npm cache)" → Node 24 (pnpm cache), and
  the pipeline line now shows `pnpm run verify` as CI actually runs
- TypeScript 5.x claims → 6 (typescript ^6.0.3); Next.js 14 → 16 in
  BLOG_SYSTEM, guides/ARCHITECTURE, AI_BOT_SYSTEM_PROMPT
- COMMANDS.md: dropped nonexistent `dev:cms` script; services list fixed
  to db/meilisearch/listmonk (no redis in compose)
- HR_RUNBOOK: `npm run test -- src/…` → `pnpm run test src/…` (pnpm
  passes args without the `--` separator)

Historical records (docs/archive/**, dated audit reports, UPGRADE_PLAN)
left as-is — they describe what was true when written.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 15:01:39 +00:00
ba754f6508 chore(deploy): rename revampit infra references to evig (#430)
* chore(deploy): rename revampit infra references to evig

The GitHub repo was renamed revamp-it -> evig a while back and the
domain/Caddy layer already points at evig.orangecat.ch (with a 308 from
the old revampit.orangecat.ch), but the self-host deploy pipeline was
still targeting /opt/revampit and the revampit-app systemd unit. Renamed
the deploy script, CI's throwaway fixture names, and the smoke-test
default URLs to match. The systemd unit + /opt directory on the box were
renamed to evig-app / /opt/evig directly, verified live (200 before and
after).

Left untouched: production database names/users (revampit_cms etc. in
rollback-production.sh, monitoring-setup.sh, check-services.sh) and the
revampit-cron@*.timer / revampit-backup units — those are a separate,
higher-stakes rename.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVwg8DKHQktxJuHeLM3xpG

* chore(deploy): point deploy pipeline + CI fixtures at evig, not revampit

The GitHub repo was renamed revamp-it -> evig a while back and the
domain/Caddy layer already points at evig.orangecat.ch (with a 308 from
the old revampit.orangecat.ch), but the self-host deploy pipeline was
still targeting /opt/revampit and the revampit-app systemd unit. Updates
the deploy script's NAME var, CI's throwaway fixture names/emails, and
the smoke-test default URLs to match. The systemd unit + /opt directory
on the box were renamed to evig-app / /opt/evig directly, verified live
(200 before and after, zero downtime).

Left untouched: production database names/users (revampit_cms etc. in
rollback-production.sh, monitoring-setup.sh, check-services.sh) and the
revampit-cron@*.timer / revampit-backup units — those touch live data
and a schedule (one timer looks like it releases escrow), so they're a
separate, higher-stakes rename flagged for a deliberate go/no-go rather
than folded in here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVwg8DKHQktxJuHeLM3xpG

* fix(docs): point deploy-script docs at the renamed evig script

The rename to scripts/selfhost-deploy-evig.sh left 5 docs pointing at the
old filename, tripping the docs-paths CI gate (stale count rose 68 -> 73).
Fixed the references; net stale count actually fell to 65, so lowered the
baseline in the same PR per the gate's own instruction.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVwg8DKHQktxJuHeLM3xpG

* fix(ci): correct the docs-paths baseline back to 68

My previous commit set this to 65 based on a local run that was reading a
dirty working tree (leftover untracked files were falsely satisfying 3
path checks). Verified against a truly clean clone of this branch: the
real count, after the doc-path fixes, is 68 — unchanged from main, since
this PR only touches the 5 revampit->evig references and leaves the
pre-existing unrelated stale docs alone.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVwg8DKHQktxJuHeLM3xpG

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-02 10:37:38 +02:00
GandClaude Opus 5 706bd35500 docs: record the page walk — what it found and why greps could not (#392)
The backlog described two rounds; there have been three. The third came from
opening all 33 public pages in a browser instead of reading the code, and the
distinction matters enough to write down: greps and typechecks were green
throughout, while the site was serving donation buttons pointing at another
organisation, two nav entries rendering <a href="">, a 404 in the live FAQ,
a tenure claim on an org founded two years ago, and three different causes of
one doubled page title.

Records what the refocus settled (services catalogue, Über uns, navGroup as
the placement SSOT) so it is not re-litigated, and adds the four gates from
this pass — each mutation-proved, because a gate that has never been seen red
is a claim rather than a check.

Two items promoted to "needs a human decision", both because they are claims
about the world that the repository cannot answer:

  - Praktikum + Wiedereinstieg name HEKS, AOZ and two municipalities as
    partners. If evig runs those programmes they belong with pillar 4 and
    deserve prominence; if they came across with the code, naming four real
    organisations is worse than merely off-thesis.
  - /karriere is invisible to nav, footer and sitemap, and carries the only
    hardcoded-German PageHero on the site, so it is also the one page that
    cannot be translated.

And education is now stated as the biggest gap rather than a bullet: George
has said teaching will be a large part of what evig does, and /workshops
renders "0 Workshops" while /blog renders nothing. The seeded workshops use
legacy category strings matching none of the ten canonical ids, are written
in formal "Sie" against the site's "du", and have no instances outside
e2e-seed.ts — so even with rows there would be no dates and no registration.

New process notes: a cancelled deploy is not a failed one (a newer merge
supersedes it, and a watcher checking only "not success" cries wolf), and
measure the rendered output rather than reasoning about the framework — two
of the three doubled titles were missed by reasoning about Next's
title.template and found by curling <title>.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-26 23:41:22 +02:00
GandClaude Opus 5 dcf832eb6f docs: refresh the audit backlog for the refocus, and record five gate blind spots (#384)
The backlog described the state before the 2026-08-25 refocus, so a session
reading it would have re-derived findings that are already fixed and, worse,
re-litigated decisions that were deliberately made.

Records what the refocus settled (divisions removed, repairs → technicians,
five pillars, no printers, the charity line) as "do not re-litigate", and
keeps the genuinely open items.

The section worth reading is the gate blind spots, all five learned the hard
way in this pass:

  - The i18n wrong-language detector cannot separate sibling Romance
    languages. Ten correct Spanish/Italian strings were flagged, every one
    scored `own 0` — the words are simply absent from its word list for that
    language, so it falls through to whichever sibling has a hit. Read before
    accepting; a flag does not mean a bad translation.
  - `lint:chrome` greps `rounded-(lg|xl)`, so `rounded-2xl` slips past. The
    abos skeleton hand-rolled a card shell for months, unseen.
  - A missing-key audit cannot see a WRONG value. `itHelp.hub.subtitle` sat as
    literal English in five locales with the key present, so nothing flagged
    it. Only reading the rendered page found it.
  - Dead-key detection must grep the NAMESPACE PREFIX, not just call sites.
    `home.newsletter` appears in no `t()` call in page.tsx and is very much
    alive via `useTranslations('home.newsletter')` in another component.
  - A CONFLICTING PR runs no CI at all. #380 went DIRTY and only Snyk
    reported — which passes on everything — so it read as "waiting on CI"
    rather than "will wait forever". Check `mergeable` first.

Also records that background `npm run verify` runs get killed in this
environment (five times, no OOM, 12 GB free) and that `setsid nohup` survives,
and that CI green is not live — every merge in this pass was re-probed against
production, which is how the stale divisions subtitle was caught rendering
under a heading that correctly read "3 Bereiche".

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 22:33:58 +02:00
GandClaude Opus 5 f6b9a73b8b feat(brand): evig repairs becomes evig technicians, and evig stops asking for printers (#382)
Three changes from the same focusing pass, all of them cases where the copy
described an organisation the code had already outgrown.

## The division is named after the person, not the service

`evig repairs` → `evig technicians`. "Repairs" names what happens; a user is
looking for someone who will do it. The surface has worked that way for a long
time — post a request, receive offers from technicians nearby, choose one, with
a budget filter that already splits "Gratis / Community" from "Mit Budget" —
only the naming lagged behind the product.

Contained to `src/config/divisions.ts` plus the `divisions.items.<id>` key in
eight locales, because the wordmark is composed (`${ORG.name} ${id}`) and every
consumer derives from the array. No component changed.

## IT-Hilfe stops promising charity

The page called itself "Kostenlose Community-Reparatur" and said "kostenlos"
three times over: meta title, meta description, subtitle, tagline. That framing
does two bad things at once — it hides the marketplace the code implements, and
it forecloses the half of the model where a technician actually earns. Rewritten
to what it is: describe the problem, get offers, choose. "Über die Community
gratis oder fair bezahlt" keeps the free path visible without making it the
whole promise.

Fixed alongside: `itHelp.hub.subtitle` was stored as literal ENGLISH in es, fr,
it, ja and ko. Not a missing key — a wrong value, so no fallback could catch it
and no missing-key audit could see it. Five locales showed an English sentence
in the middle of a translated page.

## No more printers

The donation pages solicited "Laptops, Desktop-PCs, Monitore, Tastaturen,
Mäuse, Drucker" while the new homepage copy says evig does not deal in
printers. One of the two had to go. A printer is the archetype of what evig
deliberately does not take: low value, hard to refurbish, and — per
co2-impact.ts, which already refuses to publish a factor for the category —
without a defensible open number, so we could not even honestly claim a saving
for keeping one alive. GPUs take their place in the list, which is what the AI
thesis actually needs.

The erfassung category '60' (Drucker & Scanner) deliberately STAYS. Existing
inventory rows point at it, and deleting a category that historical records
reference would corrupt them. Not soliciting new ones is the change; rewriting
the past is not.

## /revamped deleted

294 lines selling "die REVAMPED-Zertifizierung … unser exklusives REVAMPED-
Label" — the previous organisation's name, as a product label, after the
rebrand. It was orphaned from nav and footer but still listed in the sitemap,
so it was indexable. It also advertised a certification for computers "we
build" on behalf of a service flagged `available: false`, and its inbound CTA
copy had sat unmaintained long enough to contain a German grammar error ("Hol
sich deine" for "Hol dir deine"). Page, messages, sitemap entry and the
inbound certification block are all gone. If evig wants a quality label later,
it belongs on the QC Prüfsiegel the intake pipeline already produces.

Also removed `ROUTES.public.transparenzKennzahlen` — a route constant used by
nothing, pointing at a page that deliberately calls notFound().

## One baseline moved, deliberately

Two new "wrong language" findings, both false positives of the same kind as the
last batch: "Trovare un tecnico" (correct Italian) and "Encontrar a quien lo
repare" (correct Spanish), each scored `own 0` because the words are absent
from the detector's own word list for that language. Verified by reading, then
accepted.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 20:07:56 +00:00
GandClaude Opus 5 374f4ed875 refactor(brand): drop evig architecture + health, and the "not a charity" line (#379)
Two divisions leave the site. `evig architecture` and `evig health` were real
research, but they were George's research, not evig's work, and carrying them
here cost the one thing a young organisation cannot spare: a reader being able
to say in one sentence what evig does. They now live as projects on
orangecat.ch ("Building for the Ruin", "Healthspan and Preservation").

Because EVIG_DIVISIONS is the only list, removing the two entries is the whole
change on the render side: the homepage hero rail, the divisions section and
its ICU {count}, the footer column and the nav entries all follow with no edit
of their own. That is the SSOT paying for itself — a five-division site became
a three-division site without a single hardcoded number to hunt down.

Also removed, per the same focusing pass:

  - `/architecture` and `/health` routes, their ROUTES entries, and their
    'architecture'/'health' theme keys in SECTION_KEYS.
  - divisions.items.* and divisions.pages.* for both, in all eight locales
    (912 lines of message JSON).
  - The "we are not a charity" framing. It appeared as
    about.mission.paragraph1 and vision.diff.intro (plus README and
    EVIG_STORY), and it had gone stale: it was an over-correction away from
    Revamp-IT's specific charity-recycling model, and it now contradicted
    evig's own legal page, which says gemeinnütziger Verein in Gründung.
    Defining yourself by what you are not is weak copy anyway. It states the
    positive instead — and keeps "in Gründung", the honesty boundary that no
    recognised tax-exempt status is claimed until the Verein is registered.

Docs updated in the same commit (CLAUDE.md brand table, EVIG_STORY divisions
section) with a note not to reintroduce the two, so the next session does not
read a doc describing a site that moved on.

npm run verify green: lint, umlauts, chrome, docs, compliance, typecheck,
7747 tests, production build.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 17:32:12 +00:00
GandClaude Fable 5 4553102879 test(e2e): wire three never-run specs into CI, and make the security one real (#377)
* test(e2e): wire three never-run specs into CI, and make the security one real

The e2e-local job runs 'tests/e2e/*journey.spec.ts'. Nine specs are not
named *journey, so nothing ran them — anywhere, ever. I ran all of them
against a locally seeded instance before wiring any, which is the only
reason this PR is three specs and not nine.

Wired (41 assertions that were running nowhere):
  security            4 tests — rewritten, see below
  notification-hrefs  21 assertions, green as-is
  user-admin-flows    16 assertions, green after one fix

security.spec.ts was a STUB and wiring it as-written would have been
worse than leaving it out: two of its four tests had comment-only bodies
('Would need to fill and submit form 6 times'), a third asserted only
inside an isVisible() branch, and every one called test.skip() when
redirected to login — which /it-hilfe/create always does signed out. In
CI it would have reported a green 'security' check while exercising
nothing. It now asserts the closed side of the authorization boundary: no
admin page renders and no admin/money API answers 2xx to a signed-out
request, and a refused response carries no user data. Proven by mutation
— adding a public route to the protected list turns it red.

user-admin-flows addressed routes as /de/x. The app 307-redirects those
to /x, and when that races the client router Playwright aborts the
navigation (net::ERR_ABORTED) — indistinguishable from a broken page.
It cost three wrong hypotheses (concurrency, then state residue, then a
fresh database) before I read the error. Now uses the canonical paths,
which is where the redirect lands and what users actually see.

NOT wired, with reasons rather than silence: marketplace, it-hilfe,
appointments, payment-return and timecards fail against the current app —
marketplace expects an h1 of 'Marketplace' and the text 'gebrauchte
IT-Geräte', which is pre-rebrand Revamp-IT copy. dashboard-timecards
skips its only test. Specs nothing runs rot; these did. Recorded in
docs/AUDIT_BACKLOG_2026-08.md.

Verified: 3 consecutive green runs of the bundle, typecheck, lint, docs gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs: record which never-run E2E specs rotted, with the triage evidence

Three are now wired; the other six are not, and the table says why rather
than leaving a silent gap. marketplace expects pre-rebrand copy, and
dashboard-timecards skips its only test. it-hilfe is the best next
candidate — 10 of its 14 tests already pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(e2e): the signed-out security spec was running signed IN

CI rejected the previous commit and it was right to. playwright.config.ts
sets storageState globally, so every context — the page AND the request
fixture — inherits a saved login unless a spec says otherwise. My
'authorization boundary (signed out)' tests therefore ran authenticated:
/api/invoices, /api/admin/users and /api/admin/refunds all answered 200,
and the spec reported the doors were open.

They passed locally only because no saved-session file exists there. That
is the worst kind of green: right answer, wrong reason, and dependent on
which machine you run it on.

Both specs now force an empty session explicitly. For security.spec.ts
that line IS the test — a signed-out check carrying a session asserts
nothing about the closed side of the boundary.

Same root cause fixed notification-hrefs: it probes whether a ROUTE
exists using a dummy UUID matching no record. Signed out, an auth
redirect answers that without touching the database. Signed in, the admin
page renders and correctly 404s on the missing record — so it reported
'notification deep link is broken' when nothing was broken.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 16:32:41 +02:00
GandClaude Fable 5 b191157be0 docs: record the 2026-08-24 audit backlog and gate limitations (#375)
Nine PRs shipped from this audit. This file keeps what is still OPEN so
the next session starts from the findings instead of re-deriving them:
the pci-compliance decision (payment routes have NO rate limiting, so
neither deleting nor wiring it is obviously right), the five ratchet
baselines and what they mean, and — importantly — where the gates are
BLIND, so nobody reads a green run as a clean codebase.

Also lists the lower-severity findings the five audit sweeps produced but
this pass did not fix: workshop capacity oversell, commission computed 4x
with 3 copies missing the is_revampit exemption, an order-completion rule
stated three ways, two live rate limiters, 86 hex literals in a second
token source, and nine E2E specs no CI job runs.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 20:46:09 +00:00
GandClaude Fable 5 fe811bcfc2 docs: correct the design-system section that described a deleted file (#370)
CLAUDE.md carried a full 'Layer 2 — tailwind.config.ts' section for a file
Tailwind v4 removed, plus a token table naming --color-bg / --color-surface
/ --color-border (zero occurrences in globals.css; the real names are
--surface-base, --text-primary, --border-default), a dark-mode mechanism
that does not exist (it claimed @layer utilities auto-remaps bg-white —
globals.css contains no 'bg-white'), and a green #f0fdf4..#14532d palette
for a brand that is Ion Lime. Five false claims in sixty lines, in the
file every agent session reads first.

Also corrected: Tailwind 3.4 -> 4 and React 18 -> 19 in the stack tables;
the .claude/CLAUDE.md ADMIN_SECTIONS table (10 rows, wrong paths, ids that
no longer exist — 'products' and 'finances' are gone, and granting
'workshops' grants nothing because the admin section is 'workshops-admin')
replaced by a pointer to sections.ts and the two rules that do not change;
the dev-DB row that said Neon while CLAUDE.md said Docker:5433;
002-simplified-auth.sql -> 002b-; repairer_profiles -> technician_profiles
(renamed by migration 105); and a Revamp-IT street address in
SHARED_CONTEXT that org.ts explicitly forbids publishing.

scripts/ci/docs-paths-exist.sh closes the class: every backticked repo path
in the docs must exist. CLAUDE.md, .claude/CLAUDE.md and README.md are held
at ZERO; the 68 stale references in older reference docs are ratcheted so
they can fall but never rise. Historical plans and audits are excluded —
a June plan naming files that later moved is history, not a defect.
Proven by mutation: a planted bad path in CLAUDE.md exits 1.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 20:33:37 +02:00
GandClaude Opus 5 de244172ff fix(email): the relay says 250 and the mail goes nowhere (#311)
* fix(vote): give the "sign in to vote" error the door it names

The vote-auth fix (#305) tells someone whose email belongs to an account to
sign in, and then leaves them standing there. This repo's own rule is that
every stated problem links to where it is fixed — a warning without a way out
is a dead end.

The reason it shipped without the link was that apiFetch flattens every
failure to a bare { success, error } string. The only way for the UI to know
WHICH failure it got was to match the German sentence, and branching on prose
breaks the first time someone rewords or translates it. So the fix is one
level down: give the envelope a machine-readable code.

  ERROR_CODES        one SSOT for codes, next to ERROR_MESSAGES. Add one only
                     when the interface must DO something different — the
                     message is for the human, the code is for the UI.
  apiBadRequest      optional third argument, omitted from the body when unset
  ApiResponse.code   optional, so all ~100 existing callers are untouched
  apiFetch           passes a string code through; ignores a non-string one
                     rather than handing junk to the UI

The vote page now renders "Anmelden" as a link to loginUrl beside that error,
reusing the string already there for the success panel — no new i18n keys, so
no locale can desync.

Tests assert the passthrough and the omission, and I checked the passthrough
test fails with the apiFetch change reverted (1 of 14) rather than assuming a
green suite meant something. The route test now pins the code, using a mock
that actually forwards the third argument — a mock that dropped it would have
made the assertion vacuous.

5963 tests green across 440 suites; eslint and the umlaut linter clean.

* fix(vote): the one live decision could not be voted on at all

Found by opening the real share link at 390px while verifying #307, not by
any test. The page drew "Deine Stimme" and then nothing. Submitting answered
"Stimmdaten erforderlich". There was no ballot, and nothing on screen said
why.

`thumbs_up_down` has been in VOTING_METHODS all along, with a zod schema, a
validator and a tally on the server — and no branch in either voting surface,
and no case in useVoteState's switch. buildVoteData() fell through to
`undefined`, which TypeScript allows because the switch had no default and
the return type is `unknown`. So the absence compiled, rendered blank, and
failed at the server. Production's only decision uses that method.

Fixed on both surfaces — the public share-link page and the members'
VotingPanel — with one component, and the choice labels in config beside the
other methods' rather than typed into JSX. No default selection: a thumbs
vote is a single deliberate tap, so pre-selecting "Dafür" would submit an
opinion the voter never expressed.

Two guards, because the compile-time one alone would not have caught this:

  useVoteState  a `never` exhaustiveness default — a method with no case is
                now a build error rather than a silent undefined
  ballot-coverage.test.tsx  renders EVERY entry in VOTING_METHODS and asserts
                the ballot contains something interactive. A missing render
                branch is absence, and absence is what the switch guard cannot
                see. It iterates the config, so it cannot drift from it.

Checked the coverage test fails with the branch removed (thumbs_up_down only,
6 of 7 still passing) rather than trusting a green suite.

7747 tests green across 529 suites; eslint and the umlaut linter clean.

* fix(email): the relay says 250 and the mail goes nowhere

Sent a probe from the production host through the configured relay to a real
mailbox. The SMTP conversation was flawless — EHLO, STARTTLS, AUTH, accepted —
and the message never arrived. Not the inbox, not spam, not trash.

The cause is the sender domain. EMAIL_FROM in prod is noreply@revampit.ch,
which has no SPF record and no brevo._domainkey DKIM record. Brevo accepts mail
from a domain it has not authenticated and then drops it, so every layer
reports success and the inbox stays empty. Searching the recipient mailbox back
through its whole history finds no application mail at all: every revamp-it.ch
message in it is human mail from colleagues via the org's own server. evig's
transactional email has never worked.

scripts/test-email.ts could not have caught this. It mailed only itself, and it
called a relay handoff "Email sent successfully!". So it is rebuilt to answer
the question that matters:

  - takes the recipient as an argument instead of sending to EMAIL_FROM
  - resolves the sender domain's SPF, DKIM and DMARC before sending, and says
    plainly that an unauthenticated domain will vanish despite a 250
  - refuses to describe acceptance as delivery

The DKIM verdict is deliberately relay-aware. Selectors are chosen by the
provider and cannot be enumerated from DNS, so a missing selector is only
conclusive when we know which one to expect — Brevo documents brevo._domainkey.
Against any other relay an unknown selector is reported as inconclusive, not as
a failure. Checked both ways: google.com is flagged when sending through Brevo
(true — it has no Brevo key) and is not flagged otherwise.

Nothing here fixes delivery. That needs a sending domain that exists and is
authenticated with the provider, which is a purchase and a DNS change, not a
code change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: the canonical host moved, and the redirect to it must keep the method

revampit.orangecat.ch now redirects to evig.orangecat.ch, so every doc that
called the old host "where this codebase runs" was pointing at a redirect.

It was added as `redir ... permanent`, which is 301, and 301 does not preserve
the HTTP method — a POST arrives as a bodyless GET. Auth.js then answered
InvalidProvider ("Callback for provider type (credentials) is not supported"),
because a GET on a credentials callback is not a thing. Browser traffic never
noticed: it lands on the canonical host and posts there. Only non-browser POST
clients broke — the CI auth smoke, API callers, and any webhook still aimed at
the old host. Fixed on the box by making it a 308; documented here so it is not
reintroduced.

Also records why auth-smoke and inventory-smoke deliberately point
PLAYWRIGHT_BASE_URL at the OLD host: that is what exercises the redirect, and it
is how this was caught. Repointing them at the canonical host would turn a real
gate into a green one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 20:30:06 +00:00
GandClaude Fable 5 8b76fcdf7f fix: blog reader experience + GTM/distribution layer (#301)
* fix(blog): real 404s, retired-slug 301, locale dates, translated categories, index SEO

- Scope the blog index loading.tsx into an (index) route group so
  /blog/[slug] no longer streams under a Suspense boundary — notFound()
  now returns a real HTTP 404 with the shared not-found UI instead of a
  blank 200.
- 301 the retired slug die-revamp-it-plattform to /blog via
  RETIRED_POST_REDIRECTS (config SSOT) + locale-aware permanentRedirect.
- formatDate() accepts the active app locale; blog surfaces (hero, lists,
  featured grid, post header, related, comments) pass it so dates follow
  the page language. Non-blog surfaces stay de-CH.
- Category chips translate via blog.categoryLabels in messages/ (key list
  SSOT in BLOG_CATEGORY_KEYS, fallback to raw name), all 8 locales.
- BlogFeaturedGrid cards now show the publish date.
- Blog index generateMetadata gains canonical, hreflang languages,
  og:image and Blog JSON-LD; post pages gain RSS feed autodiscovery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(content): new post "Der Kreislauf braucht ein Schaufenster" + GTM one-pager + social drafts

- New blog post (DE + EN, 2026-08-13): the circular economy needs a
  distribution side — the marketplace as the missing half of the loop.
- docs/GTM_2026-08.md: distribution one-pager — ICP, shortest path to a
  first paying customer (marketplace via Payrexx, BTCPay pending server
  provisioning), channel rollout (blog/RSS → Listmonk newsletter →
  Mastodon → LinkedIn → local Swiss), weekly cadence, honest metrics.
- content/social/queue.md: Mastodon + LinkedIn DRAFTS (DE + EN) for the
  new post and 3 strong existing posts; George approves before posting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 22:09:47 +02:00
GandClaude b508e9a0df feat(brand): evig divisions — computers, repairs, ai, architecture, health (#300)
evig is one organisation said at rising scale: keep something useful for
longer. The site never stated that. The homepage described surfaces ("Shop,
Community-Marktplatz, Werkstatt und Techniker-Netzwerk") and burned its whole
first mobile screen on a badge and two buttons.

Adds EVIG_DIVISIONS as the single source for the brand architecture. The
homepage hero rail, the divisions section (including its count, via ICU
{count} rather than a number typed into a message), the footer column, the nav
entries and the division pages all derive from it. Wordmarks compose from
ORG.name, so "evig health" is never a literal.

A division is a lens, not a second storefront: computers and repairs point at
/marketplace and /it-hilfe, which already serve them. The three with no home
get pages through one shared DivisionPage component — hero, thesis, numbered
strands, honesty boundary, CTA — so a fourth adds a config entry, not a fork.

  evig architecture (research) — build so the ruin still reads. Material that
  ages instead of decaying, structure you may see, parts that come apart. The
  laptop question at building size: is it what it says it is, and can it be
  opened, repaired and passed on?

  evig health (research) — the longest-lived thing we want to keep is a
  person. Healthspan, memory that belongs to the person, and continuity of
  what someone knew, with consent given in life.

Both are marked research and sell nothing, and each page states what it is NOT
before its CTA: health is not medicine and promises no immortality and no copy
of a person; architecture is not a practice and gives no structural advice.
That block is required, not decorative — it is what makes the ambition sayable.

Mobile: the hero fold forced 88vh and centred a short block inside it, so the
first screen was mostly empty and the second CTA landed under the FABs. Height
now follows content on phones; the full fold returns from sm: up.

Copy is written in DE and translated into all eight locales, structure in
config and strings keyed by division id — no arrays in the message files.

Validated: typecheck, lint (0 errors), lint:umlauts, production build, jest at
baseline (16/31 pre-existing failures, unchanged), i18n audit unchanged, and
the design-system greps (no hex, no shadow-lg, no hand-rolled card shells).
Rendered and screenshotted at 390px and 1280px; no horizontal overflow.


Claude-Session: https://claude.ai/code/session_01SRL4CZeiCj7JUZppiCkVJm

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-12 11:04:09 +00:00
GandClaude Opus 5 6e9496eb00 fix(auth): evig owns its own admin + docs(legal): Verein founding documents (#270)
* fix(auth): remove Revamp-IT super admins from evig, DB is the SSOT

evig separated from Revamp-IT on 2026-07-24, but three Revamp-IT accounts
(andreas@, veronica@, daniel@revamp-it.ch) were still hardcoded in
SUPER_ADMIN_EMAILS. isSuperAdmin() resolves that list by e-mail alone,
bypassing the database entirely, so each of them held full access to
evig's sensitive sections (users, finances, settings) — and the demotion
guard in PATCH /api/admin/users/[id]/permissions explicitly refuses to
demote anyone on the list, making them un-removable through the UI.

- SUPER_ADMIN_EMAILS reduced to the owner only. It is a bootstrap FLOOR
  so evig can't lock itself out; users.is_super_admin stays the SSOT and
  is how every other super admin is granted.
- Super-admin is now checked BEFORE the is_staff gate in
  canAccessSection/canAccessSensitive/getAccessibleSections, so a cleared
  is_staff flag can't lock the owner out of their own admin.
- STAFF_EMAIL_DOMAIN derives from ORG.emailDomain (evig.ch); the legacy
  Revamp-IT domains move to LEGACY_STAFF_EMAIL_DOMAINS so existing logins
  keep working until the Layer B infra cutover.
- Docs corrected: staff has been DB-granted (never domain-derived) since
  the permissions-v2 hardening, but .claude/CLAUDE.md still documented
  "anyone with @revamp-it.ch email is staff", which was simply false.

Regression guard added: the removed Revamp-IT addresses must return false
from isSuperAdmin().

Verified: typecheck clean, lint 0 errors, 156 auth/permission/user tests
pass. The 25 pre-existing failures in src/config/__tests__ reproduce
identically on main and are untouched by this change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs(legal): add evig Verein founding documents

Draft Statuten + Gründungsprotokoll for founding evig as a gemeinnütziger
Verein with seat in Zürich, plus the operational checklist.

The statutes are drafted so that (a) the tax-exemption application to the
Kantonales Steueramt Zürich can be filed on the first attempt, and (b) a
later spin-out of the commercial arm into a GmbH needs NO amendment.

Exemption-critical clauses (ESTV Kreisschreiben Nr. 12, § 61 lit. g StG):
- Art. 2: idealistic Zweck, explicit "kein Erwerbszweck", economic activity
  admitted only as "Mittel zum Zweck und nie Selbstzweck", and directed at
  the Allgemeinheit rather than members (Uneigennützigkeit).
- Art. 3: assets dedicated exclusively and irrevocably to the purpose.
- Art. 17: Vermögensanfall to another tax-exempt Swiss legal person; any
  distribution to members excluded.

Structural clauses:
- Art. 4: the Verein may found/hold participations, held as Vermögensanlage
  and subordinate to the purpose, with NO Geschäftsführung by the Verein —
  which is both what KS 12 requires and what keeps the founder clear of the
  self-employment ban. This is what makes the GmbH split amendment-free.
- Art. 10 Abs. 2: the board must have >= 3 members before any compensation
  or employment of a board member may be resolved, so founding stays
  possible with 2 while independence exists exactly when it matters.
- Art. 12: unpaid by default, effective expenses against receipt only
  (Pauschalspesen excluded — they get requalified as salary), mandatory
  Ausstand on one's own compensation, disclosure in the annual report.
- Art. 14: publication of statutes, board, annual report and accounts in a
  form that keeps changes traceable; and no Spendenbescheinigungen or
  claims of recognised gemeinnützigkeit before the Verfügung exists —
  matching ORG.legalForm = 'in Gründung' as the SSOT.

Formal requirements per the Handelsregisteramt Zürich Merkblätter are noted
inline (min. 2 founders, original handwritten signatures, election
acceptance recordable in the minutes).

Verified: lint:umlauts clean, no "ß" (Swiss German rule).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* feat(legal): publish the Verein statutes at /transparenz/statuten in all 8 locales

The founding documents were repo-only. They are now a public page, in every
language the site speaks, reachable from the Transparenz hub and the sitemap.

Honesty first: evig is not yet founded, so STATUTEN_STATUS.state drives an
unmissable draft banner. Publishing a draft as the governing statutes of an
association that does not legally exist would be a false claim; publishing it
AS a draft is the transparency the statutes themselves promise (Art. 14).

SSOT split:
- src/config/statuten.ts   — structure: article order, numbers, section grouping
- messages/<locale>.json   — strings only, one coherent body per article
- src/lib/legal/           — parses bodies into paragraph/list blocks
- src/components/legal/    — renders them

Paragraph numbers and list letters are GENERATED by the renderer, never read
from a translated string, so all 8 locales show identical structure. That also
sidesteps the repo's fragile-array i18n trap (arrays have no per-element
fallback). German is declared authoritative via STATUTEN_AUTHORITATIVE_LOCALE
and every translated locale carries a notice card saying so.

Verified: lint, lint:umlauts, typecheck, test:i18n green; all 8 locales render
200 with 18 articles each; i18n audits show zero new leaks and zero new missing
keys vs main.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 09:33:42 +00:00
GandClaude Opus 4.8 d5f50c3aca feat(host): make evig.orangecat.ch the canonical host (now live) (#256)
evig.orangecat.ch is live (DNS A record + Caddy vhost → the app on the Hetzner
box, HTTPS, health 200; both hosts serve). Auth is safe on it (trustHost:true +
host-only cookies). Flip the code canonical to evig; revampit.orangecat.ch stays
a working alias until the deploy-path/systemd identifiers are cut over (Layer B).

- org.ts `website` → evig (reverts the #252 dead-URL stopgap)
- urls.ts PUBLIC_SITE_URL default → evig (metadataBase fallback; prod env wins)
- MISSION_STATEMENT.md website → evig
- .env.selfhost.local.example host vars → evig

Build-time NEXT_PUBLIC_SITE_URL/APP_URL already flipped to evig in the SELFHOST_ENV
secret + prod runtime .env, so this deploy inlines evig into OG/canonical.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 14:29:10 +02:00
GandClaude Opus 4.8 281ea850c2 fix(org): point canonical URL at the live host (evig.orangecat.ch has no DNS) (#252)
org.ts `website` claimed https://evig.orangecat.ch, but that domain does not
resolve (curl 000, no DNS) — so the canonical URL, JSON-LD, and OG cards pointed
at a dead host. Point back to the live production host revampit.orangecat.ch
(Layer B infra, per .claude/CLAUDE.md — the host stays revampit until a real
infra cutover). When DNS + Caddy vhost + deploy paths make evig.orangecat.ch
real, flip this one constant. Also fixes the same dead URL in MISSION_STATEMENT.md.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 10:20:13 +02:00
GandClaude Opus 4.8 57eaa9589e brand(evig): finish evig rename + honour the Revamp-IT roots and tell the fork (#248)
Two things the user asked for: finish renaming Layer A brand surfaces to evig
(the GitHub repo is already `evig`; the rendered app copy + org.ts were already
migrated), and lean INTO the Revamp-IT origin — name it, honour its history, and
tell the fork honestly. Layer B infra identifiers (is_revampit, @revamp-it.ch,
revampit_cms, /opt/revampit, systemd, host) are deliberately untouched.

Layer A rename (leftovers):
- package.json name revampit -> evig
- public/site.webmanifest: name/short_name/description -> evig; drop the stale
  RevampIT orange (#ff6b35) for evig obsidian (#0a0a0a)
- LICENSE holder -> evig
- packages/saldo/package.json: stale github.com/maonakamoto/revampit -> /evig
- CONTRIBUTING.md clone URL: was doubly-stale g-but/revampit -> maonakamoto/evig
- public/saldo/index.html footer "from Revamp-IT" -> "from evig"
- public/blog/geraete-eingang-integration.svg diagram label -> evig

Honour Revamp-IT + the fork story (naming them, linking revamp-it.ch, crediting
their real since-2003 history as THEIRS, and framing the split as a difference of
ambition + tempo — not grievance):
- src/config/org.ts: new ORG_ORIGIN SSOT (Revamp-IT: Zürich gemeinnütziger Verein,
  since 2003, revamp-it.ch)
- GeschichteSection (/about) + vision (/vision): render the Revamp-IT link, rewrite
  the origin narrative in DE + EN
- messages/{fr,es,it,ja,ko}.json: translated founding narrative (vision stays de/en
  with DE fallback, as before)
- docs/EVIG_STORY.md + docs/MISSION_STATEMENT.md: rewritten to name/honour Revamp-IT
  and set the "grateful, never at their expense" voice guardrail; docs/MANIFESTO.md
  retitled to evig with a dated historical note

Verified: tsc clean, eslint clean on changed files, lint:umlauts clean, all 7
locale JSON valid with balanced <a>/{foundingYear} tags.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 09:17:34 +02:00
GandClaude Opus 4.8 3ac9c4bac7 feat: /vision — the founding vision as a real route (#246)
* docs(evig): founding story SSOT, brand package, non-profit framing

- docs/EVIG_STORY.md: canonical founding narrative (the 'access to
  intelligence is the inequality that matters' thesis) that About/hero/
  decks/grants derive from.
- public/brand/: organised brand package (SVGs + raster exports + manifest).
- .claude/CLAUDE.md: reconcile non-profit framing (gemeinnütziger Verein in
  Gründung) with the standing honesty boundary (no tax-deductible receipts
  until registered + canton-recognised).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(vision): add /vision manifesto route (Obsidian & Ion Lime, DE+EN)

The founding vision as a real, full-bleed public route — the surface the
live site had nothing of (mission/thesis for donors + talent). Debuts evig's
new obsidian+lime identity as a scoped, low-risk beachhead; the green app is
untouched and the global retheme stays a separate decision.

- Route src/app/[locale]/vision/{page,content}.tsx — static, own header/footer.
- ConditionalMainLayout: locale-aware /vision opt-out from standard chrome.
- globals.css: scoped .theme-vision tokens (obsidian/lime primitives +
  semantic overrides) + self-contained .v-* layout. Zero literal hex in TSX.
- Fonts self-hosted (subset woff2, no CDN): Space Grotesk, Inter, Plex Mono.
- i18n: DE (canonical) + EN vision namespace; other 6 locales fall back to DE
  and are recorded in the i18n baseline (intentional deferral until copy locks).
- routes SSOT + sitemap wired.

Verified: typecheck, lint (0 errors), test:i18n (16/16) all green; rendered
/vision (de) + /en/vision at 1200px and 390px — fonts load, theme scopes,
chrome opt-out works, no horizontal overflow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(vision): real CTA destinations, footer discoverability, repo cleanup

- CTAs no longer point at the non-existent hallo@evig.ch mailbox — route to
  real in-app pages instead: Support → /get-involved/partnerships, Build →
  /get-involved, products → /contact (added partnerships + contact to the
  ROUTES.public SSOT).
- Discoverability: link /vision from the site footer navigation.
- Cleanup: remove 11 orphaned 'ChatGPT Image …' scratch PNGs (8.4 MB) that
  were shipping unreferenced in public/images/logo/.
- i18n: drop the now-unused mailto subject keys; add footer.vision label
  (DE+EN); baseline the deferred locales for the new keys.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 17:50:04 +02:00
Mao NakamotoandClaude Opus 4.8 9ef3c02008 rebrand(evig): identity SSOT, i18n, README, logo assets [Layer A/1]
- org.ts: name/mission/founding → evig; positioning = affordable intelligence
- KILL money-routing: blank revamp-it IBAN; add PAYMENT (BTC + OrangeCat, TODO)
- blank infra-coupled fields evig lacks (phone, legacy site, external shops)
- i18n: brand tokens → evig across all locales (values only, keys untouched)
- README + logo assets → evig

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 12:19:40 +02:00
Mao NakamotoandClaude Fable 5 46db684c62 docs(hr): document Zeiterfassung & Monatsrapport flow
Adds an HR_RUNBOOK section for the time-tracking work now live: Arbeitsplan
drives Soll (Pensum must reconcile), today marker, four-eyes approval with
in-drawer confirmations, honest interim/as-of reports, real numbers for
pre-cutover months, and the public social-worker share link (/r/<token>).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 08:07:42 +02:00
Mao NakamotoandClaude Fable 5 c97286e2eb fix(intake): finish-line clarity — final QA surfaced at the progress bar, publish gate names open items
At 17/18 the page left people hunting: "Alles in Ordnung" still showing
(but a no-op), the one open item buried in the list, the publish gate
saying only "alle Pflichtpunkte müssen abgehakt sein".

- When only the Vier-Augen item remains, the progress card shows the two
  one-click finishes right there: "Als Zweitperson bestätigen" and
  "Allein im Dienst — übersteuern" (audited standard note).
- "Alles in Ordnung" hides once it has nothing left to do.
- The publish gate lists the open required items by name.
- Docs: .claude/CLAUDE.md QC-gate + CO₂-SSOT sections brought current;
  INTAKE_QC_DESIGN.md addendum for the 2026-07-17 journey-audit round.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 19:47:28 +02:00
Mao NakamotoandClaude Fable 5 5e06971bbb Merge branch 'claude/inventory-system-design-8popfp': destination-driven intake capture release
Main's #212 was a squash of this branch's earlier QC pipeline commits;
all code conflicts resolved to the branch side (strictly newer), messages
merged key-level (zero overlapping keys with main's protocol/timecard work).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 11:55:05 +02:00
Mao NakamotoandClaude Fable 5 883eda9bf8 feat(intake): destination-driven capture step, untested-listing disclosure, process page
- Erfassung: replace AnnahmeFields with CaptureDestinationFields — explicit
  destination choice (quality/inventory/parts/recycle/shop_untested) drives
  the workflow via src/config/intake-workflow.ts; skip-QC requires reason +
  price and is audited
- Marketplace: trust strip and info panel disclose untested RevampIT items
  (no Prüfsiegel) with link to the quality process
- so-funktionierts: process page content + open-source CTA
- Admin: AdminPageGuide component, intake pipeline/detail updates, quick
  actions; remove QuickIntakeForm and ProduktAufnehmenModeToggle
- i18n: intake/erfassung/marketplace/process keys for all locales
  (timecard translation work intentionally excluded from this release)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 11:36:31 +02:00
Mao Nakamoto 373ddc8153 feat(intake): unify capture QC and publishing workflow 2026-07-16 14:25:17 +02:00
GandClaude d80ab61aa6 fix(timecards): mobile-first day view — time fields first, one header, one action bar (#219)
Phone screenshots of the deployed Zeiterfassung showed the day view
unusable: the Von/Bis/Pause inputs sat two screens below a full-screen
hour grid (read as "no way to enter the hours"), the header zone burned
~1.5 screens (page kicker + title + plan card + month title + the plan
repeated + a SECOND Save/Submit cluster), the clock-in and AI widgets
stacked below the day form, the "Erweitert" label overflowed the
viewport, and the feedback FAB overlapped the sticky action bar.

Restructure (mobile and desktop):

- Day view order now matches the job: duration hero → Von/Bis/Pause
  fields FIRST (h-11 touch targets, always visible) → quick actions
  (fill / absences / clear) → hour grid → category + note.
- Hour grid demoted to a disclosure: collapsed on phones, open from lg
  where it sits in a second column beside the form. Tri-state default
  comes from CSS (hidden lg:block), so SSR and client render identically
  and there is no effect-driven flicker.
- TimecardHeader reduced to one line: month + status badge + days/total.
  The schedule summary lives only in the plan card above; Save/
  Einreichen live ONLY in the sticky bottom bar (previously duplicated).
- Clock-in widget + AI assistant render in month view only — they act on
  the whole card, not the selected day.
- Page header is one line (kicker removed).
- Extras toggle label shortened to "Erweitert" (was overflowing).
- Sticky bar gets pr-16 on phones so the floating feedback FAB can't
  cover the submit button.
- i18n: new dayGridShow/dayGridHide keys + shortened extrasToggle in all
  8 locales; removed now-unused submitHint/headerStatus* keys;
  stale-baseline updated surgically.


Claude-Session: https://claude.ai/code/session_01XsjbuSCDfeGYomVXioPpek

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-16 13:42:20 +02:00
G 6dc60279e2 feat(intake): quality-control pipeline — verdicts, publish gates, buyer-facing test results, QR labels, mobile UX, Kivvi (#212)
Checklist pass/fail/n.a. verdicts with a failed pipeline state; QC publish gate on all three publish paths; buyer-visible test results + verified badge; QR device labels; Vier-Augen-Prinzip on final QA; mobile-first pipeline cards; Kivvi sync from both intake doors. E2E journey updated to the verdict API with a second seeded staff account for four-eyes sign-off.
2026-07-16 12:11:35 +02:00
Claude a4a468e843 chore(intake): renumber verdict migration 132 → 135 after main took 132-134
Main's team-space PR (#216) landed migrations 132-134 while this branch
was in flight; the checklist-verdicts migration moves to the next free
number (content unchanged, still idempotent). Doc/schema references
updated; design doc now describes the Vier-Augen override path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kyGETHYwy5KHEXxWdPw4j
2026-07-16 09:53:32 +00:00
Claude 179190a489 Merge remote-tracking branch 'origin/main' into claude/inventory-system-design-8popfp 2026-07-16 09:48:50 +00:00
GandClaude 4c4b509eb7 docs: production URLs — revampit.orangecat.ch is the app, www.revamp-it.ch is legacy Joomla (#217)
A deploy-verification session wasted time probing www.revamp-it.ch (the
org's old Joomla site) because no doc states where this codebase actually
runs. Now documented in CLAUDE.md (loaded by every agent session) and in
docs/SHARED_CONTEXT.md Access Points: production app + health endpoint +
admin + Zeiterfassung routes, with an explicit warning about the legacy
site.


Claude-Session: https://claude.ai/code/session_01XsjbuSCDfeGYomVXioPpek

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-16 11:45:16 +02:00
GandClaude ce41d0d789 feat(timecards): one pointer engine — swipe/drag selection, split shifts, unscheduled days (#215)
The time-entry tool (Zeiterfassung) had four usability failures reported
from daily use:

1. Split shifts (e.g. 08–12, break, 14–17) were effectively impossible:
   the hour grid's drag REPLACED the whole selection, a second block
   needed Ctrl-clicks per 30-min slot, and touch had no path at all.
2. Working on a day outside the weekly plan dead-ended: day-fill refused
   ("Kein Plan-Tag"), bulk fill silently skipped selected non-plan days,
   and there were no plain start/end/break inputs as a fallback.
3. Drag/swipe selection was broken: both grids relied on mouseenter,
   which touch pointer events never fire (implicit capture), and no
   touch drag existed by design.
4. The day editor was hidden behind a view toggle with no direct route
   from the calendar; several hints/titles were hardcoded German.

What changed:

- New `useGridPointerInput` — ONE gesture engine for both grids (pointer
  events + elementFromPoint hit-testing). Mouse: press paints, drag
  extends. Touch: tap toggles; hold briefly OR swipe sideways to paint
  (vertical swipes still scroll — `touch-action: pan-y` + non-passive
  touchmove lock while painting). Trailing clicks after a drag are
  swallowed; modifier clicks pass through as taps.
- `useCellSelection` rebuilt on the engine for the hour grid: drag
  paints, drag starting on a selected slot erases, tap toggles,
  Shift-click adds a range; drags interpolate so fast swipes leave no
  holes. Split shift = paint two blocks; the gap becomes the break and
  the summary lists each block.
- Month grid runs on the engine too (removes its hand-rolled drag
  logic); adds erase-paint ('remove' mode), double-click → day editor,
  touch long-press no longer fights the context menu; weekday labels now
  come from the schedule SSOT.
- Day editor: exact Von/Bis/Pause fields (native inputs, two-way synced
  with the hour grid — external changes re-seed the grid, user gestures
  never echo back), so precise or off-raster times work on any device.
- Fills on explicitly targeted non-plan days now enter the standard
  manual day (TIMECARD_MANUAL_DEFAULT) instead of refusing/skipping —
  relabelled button in the day view, sync message for bulk fills. The
  whole-month fill stays plan-only.
- Clearing the hour grid now zeroes the entry duration (previously left
  a phantom total).
- Day editor reachable from the calendar: double-click a day, "Tag
  bearbeiten" in the bulk bar (single day), or the context menu.
- i18n: interaction hints rewritten, hardcoded German strings moved to
  admin.timecards.* and translated in all 8 locales; stale-baseline
  updated surgically for the touched keys; obsolete keys removed.
- jsdom PointerEvent polyfill in jest.setup (RTL otherwise drops
  pointerType/button/coords); month-grid + hour-grid test suites updated
  and extended for touch taps, long-press/horizontal paints, erase, and
  split shifts (28 tests green).


Claude-Session: https://claude.ai/code/session_01XsjbuSCDfeGYomVXioPpek

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-16 11:25:38 +02:00
G 3b7f7d450f feat(admin): language switching + compact stats strip (#211)
Admin now follows the NEXT_LOCALE cookie (was hard-pinned to German); LocaleSwitcher in the admin top bar + mobile user menu pills; sidebar/bottom-nav/command-palette section labels localized in all 8 locales via admin.sections with a config↔de.json parity test. AdminStatsGrid card wall replaced by a compact AdminStatsStrip (same quick-filter API) so list pages show actual content above the fold on mobile; DonationStatsCards consolidated onto the shared strip; dead marketplace StatsCard removed.
2026-07-16 09:20:45 +02:00
GandClaude Fable 5 2499936262 feat(teams): invite members by email + seed Forschung & Entwicklung team (#210)
* feat(teams): invite members by email + seed Forschung & Entwicklung team

Team onboarding gets a full email-invite flow, unified on the existing
placeholder-claim mechanism (one path, no parallel invitation table):

- Invite by name + email on the team page (super admin): registered staff
  are added directly and notified; unknown addresses get a placeholder
  account with the membership plus a claim link (14d, single-use) by email
  (POST /api/admin/teams/[id]/invitations)
- Placeholder "Einladen" can now send the claim link by email (optional
  address field) instead of clipboard-only delivery
- Claim page prefills the email field from the delivery address
- Direct member-add notifies the person by email (self-join stays silent)
- New templates teamClaimInvite / teamMemberAdded (Swiss German, escaped)
- Migration 132 seeds the Forschung & Entwicklung team with Georgy as lead
- Docs: EMAILS.md trigger table gains the Teams rows

Tests: 18 new (templates + schemas); typecheck, lint, lint:umlauts clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Akm86ZwqhiSM2BfdKH96cN

* fix(ci): repair inherited E2E breakage — seed columns + moved admin route

Both failures predate this branch (main's last five CI runs fail the same
two jobs):

- e2e-seed.ts still wrote technician_profiles.is_verified /
  verification_date, dropped in migration 122 (identity moved to
  user_profiles in 121). Seed now sets the verified flag on user_profiles,
  keeping the "verified technician" premise.
- inventory-routes.ts pointed at /admin/repairer-applications — the one
  hardcoded path in the list, which drifted when the section moved. Now
  uses ROUTES.admin.hrApplications (config-driven like every other row).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Akm86ZwqhiSM2BfdKH96cN

* fix(db): recreate ensure_seller_profile() without dropped display_name

Migration 122 dropped seller_profiles.display_name but the trigger
function from 031 still inserted it, so the first listing insert of any
user without a seller_profiles row errored — surfaced by the E2E seed,
and a live bug for new P2P sellers. Migration 133 recreates the function
inserting only user_id (identity lives on user_profiles since 121).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Akm86ZwqhiSM2BfdKH96cN

* fix(e2e): first() on assertions whose text legitimately renders twice

Timecard submit ("Zur Prüfung gesendet" in status banner + summary line),
tasks empty state, and blog body/excerpt all resolve to two elements,
tripping Playwright strict mode — timecard failed every retry, the other
two were flaky. Assert on .first(); either occurrence being visible is
what the journeys actually verify.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Akm86ZwqhiSM2BfdKH96cN

* fix(timecards): race-safe draft creation + stale E2E heading assertion

Two concurrent first-hits of GET /api/timecards for the same user+period
both passed the existence check and raced the
UNIQUE(user_id, period_start, period_end) insert — the loser 500'd
("Zeitkarte konnte nicht geladen werden"). Insert now uses ON CONFLICT DO
NOTHING and serves the row the winner created.

The timecard journey also asserted a "Zeitkarten" heading on
/admin/zeiterfassung — that page's H1 is "Zeiterfassung" (the Zeitkarten
approval queue moved to its own page). Assert the real heading.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Akm86ZwqhiSM2BfdKH96cN

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-16 08:57:54 +02:00
Claude 4c01ceecb2 feat(intake): QR device labels, Vier-Augen-Prinzip, mobile pipeline, Kivvi from both doors
Completes phases 2 + 4 of the intake QC design and closes the Kivvi gap:

- QR labels (physical↔digital link): /admin/intake/[id]/label renders a
  62mm label-printer label (item_uuid, device, tier, condition, date)
  with a QR to the device's pipeline detail — scan at any workstation
  to open the right checklist. Buttons on intake detail ("Etikett") and
  the erfassung success screen.
- Vier-Augen-Prinzip: final_qa carries requiresSecondPerson in the
  checklist SSOT; violatesSecondPersonRule() blocks a pass/n.a. sign-off
  by the sole worker on the device (fails are never blocked). Enforced
  in the checklist API; mark-all skips second-person items; rejections
  surface as a visible error banner instead of failing silently.
- Mobile-first pipeline: card list under md (whole card tappable, no
  horizontal scroll at 320px); checklist verdict buttons are 44px touch
  targets on phones (h-11 w-11 sm:h-7 sm:w-7).
- Kivvi ERP: extracted the post-commit sync into
  src/lib/kivvi/sync-product.ts (SSOT) and wired it into the intake
  POST — Physische-Annahme devices now reach Kivvi like Schnellerfassung
  ones always did.
- i18n for all 8 locales; INTAKE_QC_DESIGN.md updated to shipped state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kyGETHYwy5KHEXxWdPw4j
2026-07-16 06:51:05 +00:00
Claude dca3cf9e77 feat(marketplace): buyer-facing QC test results on published listings
Phase 3 of the intake QC design: the checklist's payoff becomes visible
to buyers. When a device that went through the pipeline (tier set,
checklist complete) is published, the listing now carries its QC
provenance:

- condition_checks: every PASSED item from the buyer-visible categories
  (testing, security, refurbishment, quality) via getBuyerVisibleChecks()
  in the checklist SSOT — same {key,label,checked} column contract the
  P2P sell form uses. Labels snapshotted at publish time (historical
  record by design).
- verified_at/verified_by set automatically (publisher = verifier),
  lighting up the existing "Geprüft von Revamp-IT" badge; the search doc
  now indexes is_verified correctly (verified_only filter works). A
  re-publish never clears a manual verification.
- Listing detail page renders the performed checks inside the
  verification box ("Durchgeführte Prüfungen" + ✓ list), i18n in all
  8 locales.
- Closed a third publish path that bypassed the QC gate: the admin
  inventory PATCH (publishProduct) now enforces the same three gates via
  QcGateError → 400, and marketplace_status only flips after the gate
  passes. Quick-published accessories get no verification stamp — the
  badge means something because it isn't free.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kyGETHYwy5KHEXxWdPw4j
2026-07-16 05:39:20 +00:00
Claude b9a7e21b3a feat(intake): QC verdicts, failed pipeline state, and quick-publish quality gate
The intake checklist could only express "checked" — a failed hardware
test was unrecordable, and Schnellerfassung could put an untested laptop
straight into the shop. This makes quality control a real, enforced
stage of the device pipeline:

- Checklist items now carry pass/fail/n.a. verdicts (migration 132
  rewrites existing JSONB; legacy completed:true still readable).
  A fail requires a reason (zod) and blocks publishing.
- New derived pipeline state `failed` (cached checklist_failed column,
  same pattern as checklist_complete): failed devices surface as the
  highest-severity hero state with a decision path — fix & retest, or
  re-tier to parts/recycling.
- QC publish gate: requiresQualityControl(category) derives from the
  checklist SSOT (categories with required testing/security items,
  currently 10–60). Direct-publish of such devices via Schnellerfassung
  is intercepted — they land in the pipeline with a refurbish checklist;
  the erfassung success screen and the intake publish route say so.
- Tri-state checklist UI (✓/✗/N.A.), failed alert + badge + KPI,
  "Prüfung starten" for quick-captured devices, i18n for all 8 locales.
- Design doc: docs/INTAKE_QC_DESIGN.md (phases 2–4: QR labels,
  buyer-facing test results, two-person QA).

Migration replayed + idempotency-verified against a local Postgres 16.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kyGETHYwy5KHEXxWdPw4j
2026-07-16 05:19:36 +00:00
Mao NakamotoandClaude Fable 5 9d9b470b62 feat(blog): full subsystem build-out — comments moderation, search/tags/pagination, share, admin fixes
Reader side:
- Search (?q=), tag (?tag=) and category (?categories=) filters on the index;
  search/tag render a flat paginated result list with count + clear pill
- Index + admin pagination (paginateBlogIndex + SQL LIMIT/OFFSET); admin stats
  now from SQL aggregates over ALL posts (were computed from the 50-row slice)
- Clickable category eyebrow + tag pills (SSOT slug via slugifyCategory)
- Prev/next post navigation; loading skeleton; 44px tap targets
- Copy-link + native share (SSR-safe via useSyncExternalStore)
- RSS discoverable (alternates.types + nav link); newsletter on the index

Admin / correctness:
- Comment moderation page /admin/content/blog/comments (hide/unhide + delete);
  staff-only PATCH /api/blog/comments/[id] writes the hidden status
- SEO fields now persist on create (were silently dropped)
- PATCH rejects blanking a live post's title/body
- Featured-image upload via /api/uploads (was URL-paste only)
- DB-error banner instead of silent file-only fallback

Design/i18n/tests:
- Admin editor + RelatedPosts use the <Card> primitive
- 15 new keys across all 8 locales; paginateBlogIndex unit-tested
- docs/BLOG_IMPROVEMENT_PLAN.md tracks remaining decisions

Also ships the tablets article kiosk-mode section (+ 7 translations).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 20:26:13 +02:00
Mao NakamotoandClaude Opus 4.8 6e4db31c69 feat(presentations): real team photos on V3 (repair + support desk)
From PR-Fotos/Fotos-Feb26: a team member doing focused repair now sits beside
the 'grosses Team' slide (split layout — the team finally has a face), and the
Support-Desk photo (two people, the 'Support Desk' sign) replaces the generic
bench shot on the Beratung/Support slide.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 21:26:55 +02:00
Mao NakamotoandClaude Opus 4.8 1a3338ee2d docs(marketplace): record parity plan outcome (phases 1-4 + deferrals)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 10:23:15 +02:00
Mao NakamotoandClaude Opus 4.8 702b803633 feat(profiles): SSOT slice 3 — drop duplicated identity columns
Contract phase of the Profiles SSOT consolidation. 2a (sellers) and 2b
(technicians) moved every reader AND writer of public identity to user_profiles
and both are LIVE on prod, so the role-table duplicates are dead. Remove them.

- migration 122: drops seller_profiles.{display_name,avatar_url,bio,is_verified,
  verification_date} and technician_profiles.{is_verified,verification_date}
  (+ the two verified indexes). Idempotent; ordered after 121's backfill so the
  from-zero CI replay stays green (verified locally: 131 migrations apply clean,
  end state has identity only on user_profiles).
- Drizzle: identity columns removed from sellerProfiles / repairerProfiles.
- Kept: seller/technician canton, technician city + verification_documents,
  technician_reviews.is_verified (a review flag) — those are role facts, not
  identity.

user_profiles is now the sole owner of public identity + per-person verification.

DEPLOY NOTE: safe only because 2a/2b are already live — the migrate→activate
window has no build that still reads these columns.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 07:18:01 +02:00
Mao NakamotoandClaude Opus 4.8 5f0efdbfb4 feat(profiles): SSOT slice 2b — technician verification via user_profiles
is_verified is per-PERSON identity, so technician verification now reads and
writes user_profiles everywhere — the duplicated technician_profiles.{is_verified,
verification_date} columns have no live reader/writer left (dropped in slice 3).
Reads and the verify write ship together, so there's no window where the public
sees a stale verified badge.

- technician-visibility.ts (SSOT visibility conditions) now references
  userProfiles.isVerified; every caller leftJoins user_profiles: technicians
  list (main+count), it-hilfe matches, admin helpers list (main+count).
- Verify action (admin/it-hilfe/helpers/[id]) upserts user_profiles.is_verified
  (+verification_date); suspend/reactivate stay on the role table (role status,
  not identity). Upsert guards against a pro applicant lacking a user_profiles row.
- Point-reads joined to user_profiles: technician-service getTechnicianById,
  appointments listActiveRepairers, review-service validateReviewTarget,
  it-hilfe requests preferred-technician gate + offers list, admin stats
  verifiedHelpers subquery.
- Tests updated for the new join/write shapes; also repairs seller-service +
  technician-visibility suites that slice 2a left with an unmocked userProfiles.

verification_date/city/canton on the role tables intentionally untouched here;
column drop is slice 3, only after this is confirmed live.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 06:03:55 +02:00
Mao NakamotoandClaude Opus 4.8 ef4d3c6472 feat(profiles): SSOT slice 2a — seller reads+writes via user_profiles
Public seller identity (display_name/bio/avatar/is_verified) now resolves
from user_profiles everywhere, and the seller's own editor writes there —
so the duplicated seller_profiles columns have no live reader/writer left
(dropped in slice 3). Reads and the /me write ship together, so there is no
window where the public sees a stale name.

- sellerProfileCoreFields: identity fields sourced from userProfiles; every
  caller now leftJoins user_profiles (sellers/[id], sellers/me GET).
- /api/sellers/me PATCH: upserts identity into user_profiles, writes
  city/canton to seller_profiles, re-selects the joined row for the response
  (can't RETURNING across two tables).
- listings GET / [id] / favorites, checkout-listing, sellers/[id] layout:
  join user_profiles for display_name/bio/avatar/is_verified; city/rating
  stay on seller_profiles (storefront facts).
- members/[id]: is_verified + name/avatar from user_profiles SSOT.
- tests updated for the new join/write shapes (55 green).

City/canton intentionally untouched (service base / storefront ≠ identity).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 10:16:20 +02:00
Mao NakamotoandClaude Opus 4.8 2d8ac0b019 feat(profiles): SSOT slice 1 — user_profiles owns public identity
First of 3 slices consolidating duplicated public-identity fields
(display_name/avatar/bio/is_verified) that today live on seller_profiles
and technician_profiles and can disagree. Non-breaking expand+backfill:

- migration 121: add is_verified/verification_date to user_profiles;
  backfill display_name/avatar/bio/is_verified from the role tables
  (COALESCE-preserve any existing value; verified = OR across roles).
  Role-table columns kept in place — readers move in slice 2, columns
  drop in slice 3. Replay-validated against seeded deps (existing
  display_name preserved, verified merged, rows created).
- Drizzle: userProfiles.isVerified / verificationDate.
- new public-identity.ts: getPublicIdentityMap / publicIdentityColumns /
  resolveDisplayName — the read chokepoint slice 2 routes everything through.
- city/canton deliberately left on role tables (storefront / service base,
  not identity). Full rationale + slice plan in docs/PROFILES_SSOT_PLAN.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 09:52:22 +02:00
Mao NakamotoandClaude Opus 4.8 9aa97e2b24 fix(blog): use Button/Textarea primitives in comments + admin list
The no-restricted-syntax rule forbids raw <button>/<textarea> (the primitives
bake in variants/tokens/dark-mode). Swap them in BlogComments + the file-post
edit control, which the earlier --no-verify commit let slip past. Also refresh
ROADMAP with today's shipped work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 10:01:02 +02:00
Mao NakamotoandClaude Opus 4.8 dbb7b9025d fix(build-your-computer): remove fabricated inventory; honest guidance + real marketplace
The build tool presented `getMockRecommendation`/`MOCK_INVENTORY` — invented
CPUs/GPUs/RAM with made-up prices, fake stock counts, and fake cross-EUROPE
sourcing locations (Berlin, London, Amsterdam, Paris, Rom…). RevampIT is a local
Zürich refurbisher: showing specific fabricated products people can't buy, from a
catalogue that doesn't exist, violates the no-fake-data rule and the mission.

- Removed MOCK_INVENTORY + getMockRecommendation + the BuildComponent/BuildResult
  fabricated-product types.
- New honest `getBuildRecommendation(useCase)` → component-TIER guidance strings
  (what to look for) with a rationale note. No products, prices, stock, locations
  or invented sustainability scores.
- Step3 now shows the recommended tiers + links to the REAL /marketplace
  ("Komponenten ansehen"), a "Build anfragen" CTA, and an honest sustainability
  line (no fabricated CO₂/percentage figures).
- i18n: components.services.buildComputer.buildTool.{resultNote,browseComponents,
  sustainabilityNote} (de + en); reworded orderBuild.
- Test rewritten: getBuildRecommendation returns honest guidance, no price/score
  fields, office fallback.

Category SSOT review: KATEGORIEN already has the component subcategories
(701 GPU … 706 Mainboard) needed for part-matching; the real blocker is that
listings store a single category with no subcategory — a live inventory matcher
needs a listings.subcategory migration first (future work). See ROADMAP 2d.

0 tsc errors, lint + umlauts + i18n-parity clean, 44 config tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 19:29:10 +02:00
Mao NakamotoandClaude Opus 4.8 ea5e717f53 feat(erfassung): structured storage-location picker (replaces free-text location)
When erfassing a product, staff now pick WHERE it physically is from a
runtime-addable list instead of typing free text — and can add a new location
inline without leaving the form.

- Migration 117: `storage_locations` table (name, kind, holder_user_id for
  member-possession, is_active) seeded with Hauptlager/Laden/Nebenlager +
  `inventory_items.storage_location_id` FK. Free-text `location` kept for compat.
- Config SSOT `config/erfassung/storage-locations.ts`: 5 kinds (main_storage,
  shop, secondary_storage, member_possession, other) + DE labels + seeds.
- API `/api/admin/storage-locations` GET (active list) + POST (add).
- `<StorageLocationSelect>`: fetch + Select + inline "+ Standort" add, wired
  into ProductDimensionFields; threaded through the erfassung zod schemas →
  formDataToPayload → create-product so it persists.
- i18n: components.erfassung.storageLocation (de + en).

Distinct from the public `locations` table (venues). One location per product.
0 tsc errors, lint clean, umlauts + i18n-parity clean, 342 erfassung/schema/
config tests green. Built in an isolated worktree (a parallel session held the
main tree with in-progress blog work).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 18:51:39 +02:00