Commit Graph
6 Commits
Author SHA1 Message Date
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
GandClaude Opus 5 a21d8906af chore: add a formatter, and close a CSS comment that was never closed (#419)
* chore: add a formatter, matching the style this repo already writes

singleQuote=true was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

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

* style: format with prettier, and close a comment that was never closed

The formatter refused this repo outright, which turned out to be a real defect
rather than a tooling complaint. kivitendo-intake.css opens a header comment,
and line 17 contains an inner /* ⚠ PRÜFEN */ — CSS comments do not nest, so
that inner terminator CLOSES the header. Everything after it is parsed as CSS
until the stray */ on line 20. A browser mis-parses it the same way.

The file exists in two places (public/presentations/ and deliverables/), both
carrying the same defect; fixing one still failed the gate, which is how the
duplicate surfaced at all.

Mechanical otherwise. This SHA is listed in .git-blame-ignore-revs.

* chore: teach git blame to skip the reformat

* fix: undo a 3-way merge duplication in AdminSidebar.tsx

Merging main with -X theirs duplicated a 30-line block: main's currency-sweep
commit and this branch's prettier reformat both touched overlapping lines in
the single-destination-group render path, and the -X theirs strategy inserted
rather than replaced, leaving two near-identical copies and a dangling closing
brace — SyntaxError: ',' expected at line 298.

The branch has no legitimate change to this file's logic, only formatting, so
main's content is correct outright. Took it wholesale rather than hand-editing
the merge result.

* fix(lint): reattach 5 directives the reformat detached

Four eslint-disable-next-line sites for react-hooks/set-state-in-effect and one
@ts-expect-error, all the same defect: the directive sat above useEffect( (or
above a JSX element), while the statement that actually errors is 1-2 lines
further down inside the block. eslint/tsc report at the real statement; the
directive, still bound to its original line number, protects nothing there.

TimecardReviewDrawer.tsx (x2), DataEntryTabs.tsx, AppointmentBookingForm.tsx,
CreatePoolModal.tsx. Same root cause documented for hirnli, fleetcrown and
ivy-portal earlier today — a positional directive is a hidden dependency on
formatting, and this is the fourth distinct shape it's taken.

* fix(i18n): restore a same-line audit-exemption marker

Fifth shape of today's positional-directive defect, this time the repo's own
i18n-hardcoded-audit convention rather than eslint or tsc: a // i18n-ok comment
exempts a hardcoded string only when it trails the SAME line. prettier wrapped
this one if-statement's long condition onto its own line, leaving the marker
on the return statement below — the exact sibling one line down
('fortgeschrittene bis experten') stayed on one line because it was short
enough not to wrap, and it alone kept passing.

Restored the one-line form and added // prettier-ignore so a future reformat
cannot re-split it. Verified against the real audit script locally: 0 new
violations.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 13:35:50 +00:00
GandClaude Fable 5 2b0699faba ci(compliance): five named gates had never run — wire four, state the fifth (#374)
package.json defined 'compliance' (ssot + i18n + i18n-hardcoded +
i18n-leaks + i18n-stale). grep across .github, .husky and package.json
found ZERO callers: the only one was scripts/ship.sh, which is manual.
npm run verify — the bundle CI actually calls — did not include it. Five
named gates buying confidence none of them had earned, while
docs/TRANSLATION.md said 'Pipe it into CI'.

Unrun, they had drifted far red: 1723 hardcoded-string violations, 175
missing translation keys, and locale leaks at ja 169 / ko 170 / ru 35
against a baseline of 9.

compliance:ci (ssot + i18n + hardcoded + leaks) now runs inside verify,
so it gates every PR AND the deploy. The three baselines are refreshed to
today's counts: that ACCEPTS the existing debt, deliberately. Ratcheted
debt that cannot grow beats invisible debt that has been growing for
months, and the numbers are stated here rather than buried.

compliance:i18n-stale is deliberately NOT in the bundle. Its --update
records that locale strings match the current German text — a claim only
a translator can make. A machine refreshing it to go green would be
writing down something false. It stays a manual command.

Mutation-tested rather than trusted, which surfaced a real blind spot:
the hardcoded scanner only reads QUOTED string literals, so a German
sentence written as JSX TEXT (<p>Keine Einträge…</p>) yields '0 new' and
a green gate. Attribute values and props ARE caught. Documented at the
top of the scanner so nobody reads green as 'no hardcoded German'.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 20:31:31 +00: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.7 aab03321bf tools(i18n): expand audit + translation-pipeline scripts
New scripts:
- i18n-leaks.mjs / i18n-apply-leaks.mjs — detect+merge per-locale
  values that are identical to en.json/de.json source (untranslated leaks)
- i18n-hardcoded-audit.mjs — catches German UI strings hardcoded in
  tsx outside messages/ AND wrong-language values inside messages/<locale>.json
- i18n-split-chunks.mjs / i18n-merge-chunks.mjs — split _missing/<locale>.json
  into N chunks for parallel translation, then reassemble

Modified:
- i18n-apply.mjs / i18n-audit.mjs / i18n-missing.mjs / merge-messages.ts
  — accept 'ru' as a valid locale
- package.json — new npm scripts: compliance:i18n-hardcoded, i18n:leaks,
  i18n:apply-leaks; bundled into the compliance umbrella

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-09 09:30:46 +02:00
g-butandClaude Sonnet 4.6 6e92b316ba chore: add compliance audit scripts, simplify ship.sh, fix i18n badge key
- npm run compliance:ssot / compliance:i18n — new audit scripts that detect
  SSOT and i18n violations in CI or local runs
- scripts/baselines/ — snapshot files for the audits
- ship.sh simplified to a minimal quality gate (lint, typecheck, test)
- services/data.ts: badgeKey replaces hardcoded badge string so the 'soon'
  label is driven by translations (messages/*.json services.badges.soon)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 10:31:49 +02:00