Market sizes, prices, revenue projections and success metrics in the
business docs, the Erfassung PRD and VISION carried no source and no
label. They are now marked as estimates, planned prices or targets.
The three 'case studies' reported results with no evidence behind
them; they are now illustrative scenarios with target outcomes. The
SOC 2 compliance claim becomes a target, since no audit exists.
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD
Co-authored-by: Claude <noreply@anthropic.com>
- docs/business/README.md was a pasted chat transcript holding four docs at
once (an old index, the business case, the full use cases and a stale copy
of the architecture doc). Keep only the business case; restore the full
use cases into use-cases.md (it held only the first 13 lines).
- Point related-doc links at docs that exist; fix the blog.ts path and the
backend migrate command (pnpm -C backend run migrate).
- Live site: remove the FAQ nav link (/about/faq) and the footer's Privacy,
Terms and Contact links — all four answered 404 and no such pages exist.
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD
Co-authored-by: Claude <noreply@anthropic.com>
A cloud session has no ~/.claude/CLAUDE.md, so it never saw the org rules.
Those stay in bitbaum/fleet AGENTS.md (packages by default, searchkit,
chatkit, names, identity). This file only points there.
The date field of the form builder showed the browser's bare "tt.mm.jjjj"
box. It now renders whenkit's DateInput, a drop-in with the same props and
onChange(event), in the same field classes (including dark mode); the empty
state and weekday/month words follow <html lang>, and the real date input
stays on top so the picker, keyboard and validation are unchanged.
Typecheck passes with the Prisma client generated (the errors in a fresh
worktree without it are all @prisma/client); lint --max-warnings 0 passes.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
datacat had no liveness route, so every post-deploy check read 404 and could
not tell a live release from a dead one. Fleet convention, same contract as
surf-your-life and petvity's /api/healthz: status code is the contract, the
body never carries internals. Two tests; the 503 one was mutation-checked.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
server/auth/orangecat.ts (the v4 provider) is gone: the provider is
accountkit's orangecatProviderV4 — client_secret_post, PKCE, identity scopes,
and a profile without email, so the address arrives as contactEmail and is
never an identity. The sub-keyed find-or-create, including the insert race
datacat found, is accountkit's resolveOrangecatUser (it took datacat's as a
source). What stays is datacat's Prisma store: where the shared rule would
store a .invalid placeholder, datacat stores null, as before. The in-memory
Prisma tests (P2002 race, no email takeover) still run against it.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
OrangeCat (OIDC) becomes the primary way into datacat on /login and
/register; email + password stays behind a disclosure, and is the only
form shown when the box has no OrangeCat client credentials.
- next-auth v4 provider "orangecat": client_secret_post, PKCE + state,
scope "openid profile email", issuer https://orangecat.ch
(ORANGECAT_OAUTH_ISSUER overrides). Absent, not broken, while
ORANGECAT_OAUTH_CLIENT_ID/_SECRET are unset.
- Users keyed on the OIDC sub (new nullable unique users.orangecatSub).
A new sub always creates a new user; it is never linked to an
existing account by email (OrangeCat email_verified is untrustworthy).
If the email is already held, the new user gets email NULL, so
users.email becomes nullable. Additive migration only.
- Identity only: no OrangeCat token is kept or refreshed.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The fleet render sweep (nav contract rule 3) counted 21 sub-44px nav
controls: the desktop header links and the Loesungen menu button were 24px
tall (FAQ and Blog also under 44px wide), and the footer's Privacy / Terms /
Contact links were 24px strips. Each control now carries min-h-11 (and
min-w-11 where the label is short); the header row trades py-4 for py-3 so it
keeps its height. Text size unchanged.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.
The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.
If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.
Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
The canonical name on the LEFT of every entry was the retired display name, so
every commit -- new ones authored correctly included -- rendered under that
retired name in git log, git shortlog and GitHub's contributor views. It is
backwards: the retired forms map TO the current identity, never the reverse.
Every existing right-hand mapping is kept and a few missing ones added, so
history still collapses to one person rather than fragmenting: shortlog goes
from 3 distinct authors to 2 over an unchanged 175 commits.
Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(repo): drop ralph.sh residue, ignore the generated Prisma client at the root
ralph.sh was byte-identical to reparaturbonus-zh/ralph.sh ("Ralph Loop for
Revamp-Hirn") and PROMPT.md was its blank task template; nothing in CI, docs
or scripts referenced either.
backend/generated/ is produced by `prisma generate` (typecheck, build and
Dockerfile.backend all run it) and was already ignored by backend/.gitignore,
so it was never committed — but tools that only read the root ignore file
(the fleet jscpd sweep) counted its ~1,300 generated lines as duplicated
source and reported the repo at 4.4%. Listing it at the root too makes those
sweeps see what git sees.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8
* refactor(backend): log through one pino instance, lint console.log out
The backend had pino-http for requests and bare console.log everywhere else
(index.js, jobs/, services/websocket.js — 26 lines). lib/logger.js now owns
the pino-http middleware and exposes its logger, so application logs and
request logs share level, destination and redaction. pino stays an indirect
dependency: pnpm does not hoist pino-http's copy, and a second pino would be
a second place to configure.
The backend had no linter at all. eslint.config.mjs enables exactly one rule,
no-console (warn/error allowed), so this cannot drift back; the root `lint`
now runs both halves, which is what `verify` and CI call.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8
* refactor(ingest): one shared kit for the image/video/audio/database ingestion components and the /ingest pages
The four data-ingestion components each carried their own copy of the
upload state machine (idle → uploading → processing → complete/error), the
file picker + drag-drop + object-URL preview, the auth header, the response
reader, the drop zone, progress bar, error banner, result card and submit
button. The five /ingest/<kind> pages likewise repeated the page frame, the
"Recent …" panel with its loading/error/empty states, the status badge and
the detail panel, plus a private copy of formatFileSize/formatDate.
Now there is one of each:
- components/data-ingestion/shared.tsx — useIngestionUpload, useFilePreview,
authHeaders, readIngestionResponse and the shared markup pieces
- components/data-ingestion/icons.tsx — the inline SVG paths as data, one
OutlineIcon/SpinnerIcon component
- ingest/shared.tsx — IngestPage, RecentPanel, StatusBadge, DetailPanel and
the useRecentSources fetch
- lib/format.ts — formatFileSize/formatDuration/formatDate, with a test
Markup and copy are unchanged; the components render exactly what they did.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8
* refactor(forms): type the stored form structure once, drop the dead quick-field builder
`/api/v1/forms` returned `schema as any` and every consumer re-derived its
shape. `StoredFormStructure` / `FormListRow` in types/saved-form.ts are now
the one description of what the builder writes into the Json column, used by
the route, SavedFormsLibrary, ModernFormBuilderLayout and the builder page.
DynamicForm loses its unused `addQuickField` duplicate of FormFieldBuilder's
own field factory and an unused `handleCreateGroup` argument; the autosave
draft effect reads the current form through a ref instead of listing the
form as a dependency (which is what the exhaustive-deps warning was pointing
at — re-running it per keystroke would clobber the user's input).
SavedFormsLibrary wraps fetchForms in useCallback so the token effect is
honest about what it depends on; its `handleLoginSuccess` was never wired to
anything. Rendered output is unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8
* refactor(frontend): fix every ESLint warning, gate lint at --max-warnings 0, ban console.log
The frontend lint config had downgraded no-unused-vars, no-explicit-any,
ban-ts-comment, exhaustive-deps, no-unescaped-entities and no-img-element to
"warn" ("temporarily, for build success") and `eslint .` ran with no
warning cap, so 152 warnings sat there unread. Every one is fixed at the
source rather than silenced:
- no-explicit-any: real types — jose's private `email` claim, the next-auth
Session/User augmentation (`session.user.id` is set by the session
callback), OpenAI.APIError for the vision route's status checks, typed
event/data shapes elsewhere. The ambient `declare module '@dnd-kit/*'`
stub is gone: `@dnd-kit/utilities` is now a declared dependency so its own
types load.
- no-unused-vars: unused imports/params/state dropped. Seven components and
one hook turned out to be rendered nowhere (BuilderToolbar,
FormBuilderQuickStart, FormCreationHub, ModernSidebarStore, MultiStepForm,
MultiStepFormBuilderStore, QuickActions, useApiRequest) — deleted, and the
README paragraph that described the *Store wrappers updated.
- exhaustive-deps: callbacks memoised so the dependency arrays are truthful.
- ban-ts-comment / no-unescaped-entities: the comments were covering typed
code; the entities are escaped.
- The 5 console.log calls in frontend/src (debug leftovers in components
and services) are removed; console.warn/error stay. `no-console` (allow
warn/error) is now an error so they cannot come back, with scripts/**
exempt because printing is their job. (Of the 82 console.log in the repo,
26 were the backend — routed through pino in the previous commit — and
the rest are operator scripts, which print by design.)
The downgrade block is gone, so upstream next/core-web-vitals defaults
apply, and `lint` runs with `--max-warnings 0`: a warning fails the gate.
152 → 0.
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>
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
4 files changed, 6 insertions(+), 6 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>
SavedForms.tsx was 533 lines that nothing rendered. Only the SavedForm TYPE
it exported was used, by two files, and that is exactly what kept the
component alive: every look for an unused import found one and stopped.
So the type moves to types/saved-form.ts and the component goes. That also
removes the duplication it was carrying — 74 lines byte-identical to
SavedFormsLibrary, differing by a single blank line. The right fix for a
duplicated dead file is to delete the dead file, not to extract an
abstraction from it; what remains is one live copy and one structurally
similar sibling, which is under the threshold for extracting anything.
Two defects in the code that does run:
Filter zurücksetzen did not clear the per-facet pill search. That state
lives in FilterControls while onClearAll only resets the parent, so a
reader who typed into the tag box and pressed reset was left with a
filtered list of pills — and isFiltered had gone false, so the button that
would clear it was no longer rendered. A filter with no way out.
Beliebte Vorlagen ignored the tag facet. Two judgements of "is this list
narrowed?" in one component disagreed: isFiltered counted tags, the strip's
own condition did not, so selecting tags left the strip showing templates
the active filter excluded, directly above a list that excluded them. It
now follows isFiltered, so there is one answer.
And page is bounded. The ceiling was Number.MAX_SAFE_INTEGER, which bounds
the page number and not the arithmetic done with it: skip = (page-1)*limit
left the safe range and the offset reaching Postgres was a rounded
approximation. Clamping follows this module's existing convention, the one
limit already uses — too large is capped, below the minimum or non-integer
is a 400. Proved by mutation: with the old ceiling restored, the suite goes
red.
Not adopting listkit here. Its escapeLike is byte-identical to this repo's
escapeLikePattern on every adversarial input I tried, so swapping would add
a dependency to delete three correct, tested, documented lines. The
duplication that would have justified it is gone with the dead file.
Claude-Session: https://claude.ai/code/session_01TE8oRvuwExm6GXkQVW3Jf9
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The concurrency group was keyed by branch with cancel-in-progress, so a
newer merge cancels an older commit's CI — and every deploy path keys off
that run. One that waits for CI to pass on the commit finds a cancelled run
and stops. One chained on workflow_run sees conclusion=cancelled and skips.
auto-merge also re-arms CI with a dispatch, and under one group-per-branch
that dispatch cancels the push run for the SAME commit.
Measured across the fleet on 2026-09-11: 28 of 39 ci.yml files had this
shape. It broke two repos that day, in the two ways it can break.
fleetcrown failed silently — Deploy skipped, four merges sat on main with
every check green and nothing red while the box served the previous build,
each needing a hand-dispatched deploy. hirnli failed loudly, erroring at
its wait-for-CI step, which is the better outcome because somebody sees it.
Keying main per commit lets both runs finish, so whatever the deploy path
looks for is there. Branch behaviour is unchanged: the newest push is still
the only one that matters there.
The templates this was copied from are fixed in bitbaum/fleet#53, which
also adds a ci-strands-commits rule to the hygiene audit so the remaining
repos are found by a sweep rather than by an outage.
Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mechanical fleet bump 0.2.6 -> ^0.2.7. bip-kit 0.2.7 moves the code-copy
button into normal flow (a toolbar row above the <pre>) instead of
absolute-positioning it over the code, deleting the fixed clearance that
let a consumer's 44px touch-target rule push the button onto the first
code line. This site has no such rule and showed no overlap; the bump is
for fleet uniformity and to remove the fragility, not to fix a visible
defect.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Login was completely broken in production. `authOptions` read a secret from
the environment and used it only to sign its own inner access token; it never
set `secret:` on the options object, so next-auth v4 itself had none. In
production next-auth refuses to run without one, so every page load hit
/api/auth/session and got a 500 — four console errors per visitor, per page,
with nothing louder than a MissingSecretError line in the journal. The value
was on the box the whole time, as JWT_SECRET, a name next-auth does not read.
`secret: resolveAuthSecret()` now prefers NEXTAUTH_SECRET (next-auth's
canonical name) and falls back to JWT_SECRET, so the fix works against the
environment that already exists and nobody has to mint a value. The inner
access token deliberately keeps reading JWT_SECRET alone: three verifiers
hardcode that name (frontend/src/lib/auth.ts, backend middleware/auth.js,
backend middleware/trpc.js), and signing it with NEXTAUTH_SECRET would break
every authenticated API call the day the two values differ. A blank value is
treated as absent — `NEXTAUTH_SECRET=` is an ordinary line to leave in a .env.
The absence no longer waits to be discovered by visitors: src/instrumentation.ts
asserts both secrets once at server startup and fails hard with a message
naming every env var that would satisfy it. It is scoped so it cannot fire in
dev (where the throwaway fallback is legitimate) or during `next build` (a
build machine has no runtime env).
Guarded by frontend/src/server/auth/options.test.ts, which asserts the wiring
and never a value: whenever the environment supplies a secret, it must reach
authOptions.secret. Mutation-proved — deleting the `secret:` line turns five
of its six tests red, restoring it turns them green. vitest gained the `@/`
alias from tsconfig, without which no module importing through `@/` could be
tested at all.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
/blog/intake-engine rendered two broken-image boxes: a `coverImage`
frontmatter key pointing at /images/blog/intake-engine/cover.jpg (400 through
next/image) and an inline pipeline.svg (404). Neither asset exists —
frontend/public/images/ has no commits in this repo's history at all, so both
references were dead from the day the post landed. The artwork does not exist
to restore, so the references go. Nothing substantive is lost: the figure sat
directly above the ordered list (Formulare / Sensor- & API-Streams /
Contextual Prompts / AI-Insights) that already carries its content, and its
caption ("Vom Formular über Streams bis zur KI") only restated that list.
Both code paths already guard on `post.coverImage &&`, so the absent key
renders nothing rather than an empty box.
The durable half is scripts/check-content-images.mjs, wired into the root
`verify` (and therefore CI): it walks every content file, extracts each local
image path from frontmatter and from markdown/HTML image syntax, and fails
naming the file and the unresolvable path. Remote and data: URIs and fenced
code samples are out of scope. Nothing could have caught this before —
markdown needs no build step, `next build` never resolves a runtime src, and
lint/typecheck cannot see that a string is a path.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
A visual QA pass over /blog/intake-engine at 1440x900 and 390x844, in both
light and dark, found no layout defect: no horizontal overflow, ordered and
unordered list markers present, the table scrolls inside its wrapper, the TOC
never intersects the text column (sticky at 1440, static at 390), the progress
bar covers no text, and body text measures 7.56:1 light / 7.8:1 dark.
This bump is not a fix for something visible here — it keeps the fleet on one
version of the shared renderer. bip-kit 0.2.5 stops the copy button covering
the opening line of a code block, and 0.2.6 makes that button visible on touch
devices. This article has no code blocks, so neither is observable today; the
value is that the next article with one is already correct.
The 0.2.4 slug seam is crossed but does not move anchors: bip-kit pins its
default slug policy byte-for-byte. Confirmed live — all 12 in-page anchors
resolve, ids unchanged (einleitung, 1-qualitaet-schlaegt-quantitaet, ...).
Two broken images on this article are NOT addressed here; see the PR body.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
`pnpm run verify` — the command this repo's definition of done names — exits
non-zero on a clean checkout of main, for two independent reasons that have
nothing to do with any change. CI cannot see either one.
**1. Generated output from tooling that was removed.**
#254 replaced contentlayer with bip-kit and deleted the `.contentlayer` line
from frontend/.prettierignore. Correct — the tool is gone. But the directory it
generated survives in every checkout that had built the blog before then, and
losing the ignore entry moved it from "invisible" to "in prettier's scope".
Prettier cannot parse its import assertions, so `format:check`, the FIRST gate,
died with a SyntaxError naming a generated file nobody wrote. A fresh clone has
no such directory, which is exactly why CI is green.
Two checkouts here had it, including the worktree of a session running right
now, whose verify is red for this reason as I write it. So preflight grows a
fourth check — same shape as the stale-node_modules one, and covering every
worktree rather than just the current one:
! generated output from removed tooling: frontend/.contentlayer
.claude/worktrees/complete-fetch/frontend/.contentlayer
`--fix` deletes them. Proved by recreating the exact stale state, watching the
read-only run flag both paths, then watching --fix clear them.
**2. A required artifact that no step in the gate produced.**
`typecheck` ran `tsc` against a Prisma client that only ever got generated by
`@prisma/client`'s own postinstall hook, or by `build` — which runs *after*
typecheck. The hook fires in CI; it did not fire here, because pnpm gates
dependency build scripts and caches their side effects. So a clean
`pnpm install --frozen-lockfile` left the client ungenerated and verify died:
src/lib/db.ts(1,10): error TS2305: Module '"@prisma/client"'
has no exported member 'PrismaClient'.
Reproduced from an empty node_modules twice before changing anything. The fix
is not to re-approve a hook: a gate should not depend on an install side
effect it does not control. `typecheck` now runs `prisma generate` itself
(~300ms) and the artifact exists because the step that needs it made it.
Both fixes are the same principle — `verify` must depend on the repo, not on
what a previous install or a previous version of the tooling happened to leave
behind. The CLAUDE.md build section is corrected alongside: it still described
contentlayer as the blog pipeline and told the reader to run
`pnpm exec contentlayer build`, which would have recreated failure #1.
verify, from a wiped frontend/node_modules: prettier ok, lint 0 errors / 152
warnings, tsc clean, 96/96 tests (76 frontend + 20 backend), build ok.
Claude-Session: https://claude.ai/code/session_01LKTTAr8jsTvoZN6HneFtK9
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
blog.css carried two rules (`.bp-article .bp-ul/.bp-ol { list-style-type }`)
added in #256 to put back the bullets and numbers Tailwind's preflight
erased — bip-kit coloured `::marker` but never declared a list type, so the
marker being coloured did not exist. Its own comment said to drop the rules
once a bip-kit release declared the types itself. 0.2.3 does, on the bare
`.bp-ul`/`.bp-ol`/`.bp-footnotes-list` selectors and the nested levels, with
a package test guarding it — so the patch and its note go, and the
declarations now arrive from the package.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The comment added a few hours ago says GITHUB_TOKEN cannot merge a PR that
touches .github/workflows. That is contradicted by this fleet's own history:
github-actions[bot] merged datacat#253 and ai-kit#42 today, and both change a
workflow file. I asserted it from the reusable workflow's docstring without
checking, then found the counter-evidence while looking for something else.
Two stalled PRs were offered as proof and neither survives either. ai-kit#11
opened 2026-08-29 and this repo's sweep was not added until 2026-09-04, so for
most of that PR's life nothing was sweeping at all. aoz-housing#122 is still
unexplained — I merged it before diagnosing it, which destroyed the evidence.
The THROUGHPUT reason is unaffected and is why the line stays. A dispatch made
with GITHUB_TOKEN triggers no workflows — the same rule the deploy reconciler
exists for — so after a merge the re-armed CI run's completion fires no
workflow_run and nothing wakes the sweep for the next PR. It waits for the
cron, which GitHub throttles: fleetcrown's sweeps land 50-65 minutes apart
against a */10 schedule. A PAT-created dispatch does emit workflow_run.
The wrong claim is recorded in the file rather than quietly deleted, so the
next reader does not re-derive it from the same docstring I did.
No behaviour change: an undefined secret still resolves to empty and the
reusable workflow still falls back to github.token.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
bip-kit's stylesheet styles list markers (`.bp-ul .bp-li::marker`) but never
re-declares a list type, relying on the browser default. Tailwind's preflight
resets `list-style: none` on every ul/ol, so under Tailwind bip-kit colours
markers that do not exist: every bullet and every number in an article
disappeared, leaving indented naked lines.
Caught by screenshotting the live page rather than the HTML — the markup is
identical either way, which is exactly why the structural checks in the
migration PR passed over it.
The durable fix belongs upstream in bip-kit/styles.css, since this hits every
Tailwind consumer of the renderer. These two rules are the local unblock and
carry a note to drop them once a bip-kit release declares the list types.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
GITHUB_TOKEN cannot merge a PR that touches .github/workflows. The sweep tries,
the merge API refuses, it logs "leaving for the next sweep", and repeats — while
still exiting 0. So the failure is invisible: every run reports success and the
PR simply never merges.
That is not hypothetical. ai-kit #11 (bump actions/checkout) sat green, CLEAN
and MERGEABLE for nine days; aoz-housing #122 (bump actions/upload-artifact)
for nine more. Both had to be merged by hand today. Every Dependabot
`github_actions` bump in the fleet is in this class, permanently.
A PAT fixes a second thing that costs more: THROUGHPUT. A dispatch made with
GITHUB_TOKEN emits no workflow_run, so after each merge nothing wakes the sweep
to take the next PR — it waits for the cron, and GitHub throttles scheduled
workflows to roughly hourly regardless of what the cron says. Observed in
fleetcrown: sweeps ~50-65 minutes apart against a */10 schedule. A PAT-created
dispatch does emit workflow_run, so the queue drains at CI speed instead.
The reusable workflow has always supported this — GH_TOKEN is
`secrets.token || github.token`. This just passes it.
SAFE BEFORE THE SECRET EXISTS: an undefined secret resolves to empty, and the
fallback picks github.token. So this changes nothing until FLEET_PAT is created
as an organisation secret, and needs no second pass afterwards.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
contentlayer generated a typed `.contentlayer/generated` package at
install/build time and compiled each post's MDX into a JS function. That
indirection had already cost this app a working blog: contentlayer 0.3.x
calls a React internal (`getOwner`) that React 19 removed, so the compiled
body crashed during prerender AND during SSR. The workaround shipped in
MDXContentClient.tsx was to render the post body client-only
(`next/dynamic`, `ssr: false`) — every reader and every crawler got
"Lade Inhalt…" and the article appeared only after hydration.
Posts are now markdown read from disk and parsed with bip-kit 0.2.2:
- content/blog/intake-engine.mdx → .md. The `<Callout type="tip">` became
GitHub callout syntax (`> [!TIP]`), the `<Infographic>` a captioned
figure, and the MDX `import` line is gone. ` ` became a real U+00A0,
since typed blocks have no HTML passthrough to render an entity through.
Word-level parity verified: zero words lost, and the article parses to the
28 blocks you would expect (callout, figure, ol, table, hr, …).
- src/lib/blog.ts is the collection: parseFrontmatter + parseContentBlocks +
extractToc + readingTime. It enforces the `title`/`date` requirement that
contentlayer's field schema used to, and guards the slug before it reaches
the filesystem.
- /blog/[slug] renders through bip-kit's async server ArticleBody. The route
is prerendered (SSG) again instead of being a client-only shell, and it
gains a scroll-spy TOC, a reading-progress hairline, server-side shiki
highlighting, figure lightbox and reading time.
- /blog is a server component again: as a client component it shipped its
own list-and-sort to every reader for data that comes off disk.
- setHighlighterLoader(() => import('shiki')) is registered at module scope
because this app builds `output: standalone`, where bip-kit's zero-config
shiki import is invisible to Next's file tracer — without the literal,
production would ship unhighlighted while dev looked right.
Deleted with it: contentlayer, next-contentlayer, rehype-pretty-code,
remark-gfm, @mdx-js/react; contentlayer.config.ts; MDXContent.tsx,
MDXContentClient.tsx, MDXComponents.tsx; `withContentlayer` in next.config;
the `contentlayer:build` script, the `postinstall` hook that ran it, and
the SKIP_CONTENTLAYER seams in both Dockerfiles and deploy.yml.disabled that
existed only to switch that build off; the `.contentlayer` entries in
.gitignore/.prettierignore/eslint ignores; and the
estree-util-value-to-estree + toml overrides, which pinned packages nothing
depends on any more (deepmerge-ts stays — it comes via @prisma/config).
Security: contentlayer was the only path to @opentelemetry/core and
@opentelemetry/sdk-trace-node. `pnpm audit` in frontend/ goes from
"2 vulnerabilities found — 1 moderate | 1 high" to "No known
vulnerabilities found".
Visible: the article carried `prose prose-indigo dark:prose-invert` with no
@tailwindcss/typography plugin installed, so those classes matched nothing
and the post rendered as unstyled browser defaults. src/app/blog/blog.css
maps datacat's palette onto bip-kit's --bp-* contract for BOTH themes —
datacat's dark mode is prefers-color-scheme, the same axis bip-kit switches
on, so the article now darkens with the page instead of ignoring it.
Only frontend/ is touched; backend/ is untouched.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This repo shipped its own scripts/ci/auto-merge-sweep.sh: 297 lines against the
canonical's 446, differing on 149. Every fix that landed in bitbaum/fleet since
the copy was taken reached here never — which is the whole reason SHARED.md
tracks this duplication as a ratchet rather than as advice.
Auto-merge did not appear broken, and that is the point: a sweep merges what it
can and exits 0, so a copy missing a third of the canonical looks exactly like a
working one until the missing third is what you needed.
The concrete gain is the DEPLOY RECONCILER. The old copy listed deploy.yml in
REARM_WORKFLOWS, which dispatches it once and cannot tell whether the deploy
actually landed. The canonical compares main's tip against the last successful
deploy and re-dispatches when they differ, so a deploy that never fired — or
fired and failed — is retried on the next sweep instead of leaving a commit
merged-but-not-live. That failure is invisible without it: CI green, PR merged,
box unchanged.
Also gained: checks:read + statuses:read on the caller. Public repos do not need
them, so their absence is silent here — but the caller is now identical to every
other repo's, which is what makes the next fix a one-file change.
What stays local is only what genuinely varies: the workflow_run trigger must
name the CI workflow exactly as its own `name:` field spells it, and the
schedule. Everything else is inputs.
DEPLOYMENT.md pointed at the deleted script; it now names the reusable workflow.
A doc that describes a file which no longer exists is the same class of problem
as the copy itself.
Verified: the generated YAML parses, resolves to
bitbaum/fleet/.github/workflows/auto-merge-sweep.yml@main, and passes
base_branch / ci_workflow / rearm_workflows / deploy_workflow — all four
confirmed against the reusable workflow's declared inputs. No file outside the
workflow still references the removed script.
NOTE: this PR touches .github/workflows, which GITHUB_TOKEN cannot merge, and
scheduled sweeps read the workflow from the default branch. It needs one
hand-merge; after that the sweep here is the shared one.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* refactor(ai): complete() owns the request, the per-vendor dedupe goes, and the tests can finally run
Three things, and the third is why the first two were invisible.
1. THE 429 BODY WAS READ AND DISCARDED. The hand-rolled `attempt`
ended a failed request at
`chat failed (${res.status}): ${detail.slice(0, 200)}` — fetched,
truncated, and read by nothing. The three kinds of 429 share that
status code and want opposite responses:
capacity — a burst; demoting is right.
daily — the vendor's whole org-wide budget is spent; every other
model there is already dead.
size — one request exceeded the per-minute allowance alone; the
next model down has a SMALLER ceiling, so demoting is
strictly worse.
The old `fetch` also had NO deadline, so a vendor that accepted the
connection and never answered held an ingestion job open forever and
the fallback beneath it was never reached.
2. THE PER-VENDOR DEDUPE IS GONE, and that is the point rather than a
tidy-up. It kept one link per vendor because "a second model at the
same vendor draws on the same daily budget". True of the DAILY case
and only that case — and it discarded the retry that rescues the two
failures that actually keep happening: a retired model id, and a model
that is momentarily busy while the vendor is fine. complete() makes
the distinction per failure KIND instead of up front, so a daily 429
still condemns the vendor (the dedupe's real benefit, kept) while a
404 demotes within it. Strictly more chain, not less.
3. NOTHING IN backend/ COULD RUN A TEST. `backend/package.json`'s script
was `echo "Error: no test specified" && exit 1`, and the root `test`
only ever ran the frontend. backend/utils/responseHandlers.test.js has
been sitting there, committed, executed by nothing — its own docstring
says so. So a chain change here would have shipped with no coverage,
and any test I added would have joined it in the dark.
Wired: backend `test` → `vitest run`, root `test` → frontend AND
backend. 71 frontend + 20 backend, ten of those twenty running for the
first time.
The 10 new tests drive every failure through a real response BODY,
because the body is the only thing that separates the three 429s. The
SIZE one asserts exactly one request was made — asserting that it threw
would not show the walk STOPPED, since everything failing throws too.
Mocks are real Response objects built per call: one body reads once, so
a shared instance makes link two fail with "Body has already been read",
a fake failure in front of the real one.
verify green.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHDLTKGirKU7He8q2YR2y4
* ci: install backend deps, or the test script I just wired makes the gate red
The previous commit pointed root `test` at both halves. CI installs only
`frontend`, so `pnpm run verify` would have reached `test:backend` and
died with "Command vitest not found" — a wired script and a red gate,
which is worse than the gate that was simply absent.
Adds an `Install (backend)` step and caches on both lockfiles. Verified
`pnpm install --frozen-lockfile` succeeds in backend/ against the
committed lockfile, which is what CI runs.
Also corrects the comment above `Verify`. It described the gate as
"lint + typecheck + build"; it is format + lint + typecheck + test +
build, and `test` now covers both halves. That comment is what a reader
trusts about what "verified" means in this repo, so leaving it describing
the old bundle would be its own quiet lie.
The job id stays `verify-frontend` even though it is now a misnomer:
renaming a job renames the status check, and a required check that
disappears blocks merges rather than failing loudly.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHDLTKGirKU7He8q2YR2y4
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
frontend/src/app/submissions/[formId]/page.tsx fetches
`GET /api/v1/submissions/form/<id>` from its own origin. The Next app only
ever had `POST /api/v1/submissions`, so that GET 404s and the page renders
"Error: Failed to fetch submissions." for every form, every time. Nobody can
read a submission through the UI today.
The Express backend does implement the route — but Deploy ships `datacat-web`
alone and sets no BACKEND_URL, so next.config's proxy rewrite is inert and
nothing reaches Express. The route belongs in the Next app anyway, next to the
other v1 routes and pointing at the same architecture the roadmap is
consolidating on.
Raw SQL rather than findMany: the search box spans whatever shape the form
happens to have, `data` is a Json column, and Prisma's Json filters can only
match a known path — not "any value in this document contains X". Every value
is a bound parameter. Filter parsing lives in lib/submissionFilters.ts, a pure
module, so the contract is testable without a database: unparseable dates and
inverted ranges are 400s rather than silent no-ops, limit is clamped, and
LIKE wildcards in the search term are escaped so searching "50%" doesn't match
every row.
Proved against a real Postgres before shipping (throwaway db, schema pushed,
four submissions across two owners, then dropped):
no filters {"names":["Carol","Bob","Alice"],"total":3} <- other owner's row excluded
search=alice {"names":["Alice"],"total":1}
search=50% {"names":["Alice"],"total":1} <- literal, not a wildcard
search=% {"names":["Alice"],"total":1} <- 1 of 3, escaping holds
date window Feb {"names":["Bob"],"total":1}
page 2 limit 1 {"names":["Bob"],"total":3} <- count ignores the page
bad date {"error":"Invalid startDate"}
Three defects in the page itself, all of which would have made the endpoint
look broken once it existed:
- `if (loading) return ...` unmounted the whole filter bar on every 500ms
debounce, so the search box lost focus mid-word. Loading and error now
render inside the content area and the filters stay mounted.
- `error` was never cleared on a successful refetch, so the first failure was
permanent — with the filter bar unmounted, there was no way back at all.
- Cells were indexed by each row's own keys while headers came from row 0, so
two submissions with different fields (an edited form) shifted values under
the wrong columns. Both now come from the union of keys.
And no silent cap: when the filter matches more rows than the page holds, it
says so and says the CSV covers only those.
verify: prettier ok, lint 0 errors / 156 warnings, tsc clean, 61/61 tests
(11 new), build ok — /api/v1/submissions/form/[formId] in the route manifest.
Claude-Session: https://claude.ai/code/session_01LKTTAr8jsTvoZN6HneFtK9
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every dynamic API route destructured `ctx.params` synchronously:
const { id } = ctx.params as { id: string };
Next 15+ resolves route params asynchronously. A **dev** server hands the
handler a proxy that still answers sync property reads (with a console
warning); a **production** build hands it a plain Promise with no own
properties. So `id` is the real value locally and `undefined` in production.
Receipt, from a local production build of this app with a throwaway probe
route: `GET /api/paramcheck/hello-123` returned
`{"sync":null,"awaited":"hello-123"}`.
`undefined` is not an error to Prisma — it means "no filter". The consequences
in production:
- `GET /api/v1/forms/public/[id]` became
`findFirst({ where: { isPublished: true } })` — every public form link
resolves to the same arbitrary published form, whoever owns it. A respondent
opening a share link fills in someone else's form while the page's
submit still posts under the form id from the URL.
- `PUT`/`DELETE /api/v1/forms/[id]` and `PUT /api/v1/forms/[id]/status` reach
`prisma.form.update|delete({ where: { id: undefined } })`, which Prisma
rejects for a unique input — so editing, deleting and publishing a form are
500s in production. Nothing was silently overwritten.
The fix: `frontend/src/lib/routeParams.ts` — `RouteContext<'id'>` types the
context so `ctx.params.id` is a compile error, and `getRouteParam(ctx, 'id')`
awaits and returns `null` for a missing or empty value, which each caller turns
into a 404. An absent id can no longer reach a query as `undefined`.
Four instances of one mistake is a class, not four bugs, so it gets the
automation rather than a fifth fix: `no-restricted-syntax` in
eslint.config.mjs rejects both the sync cast and the sync read, with the
replacement named in the message. Lint is in `verify` and in CI, so the next
one fails before it can ship. Proved on a scratch file carrying the original
pattern — 2 errors, both pointing at getRouteParam.
verify: prettier ok, lint 0 errors / 157 warnings (was 161 — the four
`ctx: any` are gone), tsc clean, 50/50 tests (4 new, covering the missing and
empty param cases and the bare-promise read that started this), build ok.
Claude-Session: https://claude.ai/code/session_01LKTTAr8jsTvoZN6HneFtK9
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
pnpm audit --fix override in backend/ and frontend/; all alerts were
transitive (lockfile-only). Remaining: extract-zip (high, via puppeteer)
has NO patched version upstream — it unzips the Chrome archive puppeteer
downloads from Google, accepted residual until upstream patches.
Smoke-verified the risky major jumps (uuid 8->11 under bull, lodash
4.18) load and run, since backend has no test suite. Also drops the
stale ai-kit codeload allowBuilds entry left behind by #248.
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>
- npm/npx commands -> pnpm across all docs (packageManager pnpm@11.25.0); dropped npm-only --legacy-peer-deps and the `--` arg separator
- package-lock.json -> pnpm-lock.yaml in the preflight description
- Next.js 15 -> 16, Node 18+ -> 20+ (.nvmrc pins 24) wherever stated
- Jest "planned" -> Vitest active (frontend + backend, one runner); Playwright E2E documented as deferred from CI
- DEPLOYMENT.md CI/CD section now describes the real workflows: ci.yml verify gate, auto-merge sweep, deploy.yml -> selfhost-deploy to the Hetzner box (bitbaum, behind Caddy)
- README structure block matches the real layout (frontend/ + backend/, no apps/ or packages/); backend port 5000 -> 5001
- docs/README.md index renamed Formular -> DataCat and now links only documents that exist; erfassung README's never-written guides marked planned
- clone URLs your-org -> bitbaum/datacat; cd formular -> cd datacat
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>