Commit Graph
6 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 d09c4d621d fix(sh): grep -q reads a here-string, not a pipe — no SIGPIPE false negatives under pipefail (#509)
* fix(sh): grep -q reads a here-string, not a pipe — no SIGPIPE false negatives under pipefail

Under pipefail, `producer | grep -q PAT` can report a miss for text that is there: grep -q exits on its first match, the producer dies of SIGPIPE, and pipefail returns 141.

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

* fix(sh): grep -q reads a here-string, not a pipe — no SIGPIPE false negatives under pipefail

Under pipefail, `producer | grep -q PAT` can report a miss for text that is there: grep -q exits on its first match, the producer dies of SIGPIPE, and pipefail returns 141.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 04:47:57 -07:00
CatoandClaude Opus 5 f71ad23316 chore(config): stop duplicating the box IP, the old repo path, and the retired host (#489)
Five literals that each duplicated a fact owned somewhere else, or named
something that no longer exists.

1. packages/saldo/package.json — `homepage` pointed at
   `revampit.orangecat.ch/saldo`. That host is retired: the organisation renamed
   to evig, the canonical host is `evig.orangecat.ch`, and this repo's own
   `src/config/urls.ts` and `.env.selfhost.local.example` already say so. A
   published package's homepage is the one copy that would outlive the Caddy
   redirect keeping the old name alive.

2. scripts/setup-deploy-keybind.sh — the generated trigger script baked
   `PROJECT_DIR="/home/g/dev/revampit"`, wrong twice over: it names one
   developer's laptop, and it names the repo by a directory it no longer uses.
   The checkout knows where it is, so ask it: PROJECT_DIR is now derived from
   the setup script's own resolved location (`scripts/` -> repo root), which is
   the same root the rest of the file already assumes. The heredoc had to become
   interpolating for that, so the generated script's own `$PROJECT_DIR`
   references are escaped to stay literal. Verified by running it: the generated
   file lands on the parent of `scripts/`, and `bash -n` passes on both.

3+4. The Hetzner box IP was written out twice — `ssh-keyscan -H 167.233.22.31`
   in .github/workflows/deploy-selfhost.yml and
   `BOX="${BOX:-ubuntu@167.233.22.31}"` in scripts/selfhost-deploy-evig.sh — for
   one fact that already has an org-wide definition: the `HETZNER_IP` Actions
   variable (visibility: all). Both now read it, the workflow passing it to the
   script through the job env.

   Each end fails LOUDLY rather than proceeding on an empty value.
   `ssh-keyscan -H ""` writes nothing and exits 0, so an unset variable would
   have produced a deploy that died much later with an unhelpful host-key error;
   the step now emits `::error::` and stops. The script uses `${HETZNER_IP:?…}`
   so it refuses to guess a target. Setting BOX explicitly still overrides both,
   for a one-off host. Proved by mutation: unset -> exit 1 with the message;
   set -> ubuntu@<ip>; BOX set with HETZNER_IP unset -> BOX wins.

5. src/config/e2e-test-accounts.ts held two real personal addresses as a shipped
   `as const` array. That published who they were in a public repo and made
   changing them a release. The list is configuration: it now comes from
   `E2E_TEST_ACCOUNT_EMAILS` (comma-separated) and defaults to EMPTY.

   Empty is the safe direction and the reason this is not a behaviour risk: the
   list only ever RELAXES a rate limit, so an unset variable means nobody is
   exempt — the strict path every other account already takes. The opposite
   default would trust an address nobody configured on every deployment of this
   code. It is read at call time, not module load, so the value cannot be
   snapshotted before the environment is populated. This follows the direction
   scripts/e2e-inventory-prod.sh already took when it dropped its own hardcoded
   account default.

   OPERATIONAL NOTE: until `E2E_TEST_ACCOUNT_EMAILS` is added to `SELFHOST_ENV`,
   the prod dual-persona smoke runs under normal rate limits. Documented in
   .env.example and .env.selfhost.local.example.

   The test asserted the hardcoded list's length, which is no longer a property
   of the source. It now sets the variable itself with fictional fixture
   addresses — a test naming a real person's mailbox is the same leak the source
   just stopped committing — and adds the two cases that matter most: unset and
   empty must both exempt nobody.

Deliberately NOT touched: src/config/org.ts DEFAULT_CONTACT_EMAIL. The comment
above it records that the gmail address is a live decision because evig.ch is
not registered and the previous address bounced.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:57:08 -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
CatoandClaude Opus 5 f091488f98 refactor(blog): typed blocks render the article — react-markdown rendered DB content with no sanitizer (#466)
* refactor(blog): typed blocks render the article — react-markdown rendered DB content with no sanitizer

The blog body went through react-markdown + remark-gfm with a hand-written
component map. That map was fine for the git-authored posts it was written
for, but the same component renders DB posts — including bodies that arrive
through the public submission flow — and no sanitizer sat anywhere on that
path. bip-kit's parser removes the surface rather than filtering it: markdown
becomes a discriminated union of typed blocks, and the reference renderer
emits React elements from typed data, so there is no HTML passthrough for
submitted content to hide in.

One module owns the pipeline for both content sources
(src/lib/longform/): parse.ts normalizes author-flavored markdown into
bip-kit's vocabulary (`*`/`+` bullets, indented items, a stray body `# h1`)
and re-slugs headings with evig's unicode-friendly slugger, because bip-kit's
is ASCII-only and would have renamed every published anchor in the de/ja/ko/ru
translations. LongformBody.tsx is the renderer; longform.css maps evig's
tokens onto bip-kit's --bp-* contract for both themes and keeps the 19px/1.75
editorial measure.

Heading extraction leaves blog-toc.ts: the TOC now derives from the same
typed blocks the article renders, so the rail and the anchors cannot drift.
evig's own sticky TOC shell stays — bip-kit's Toc has no i18n label and no
scroll-spy aria-current — fed by the extracted entries.

Capabilities that came with the swap: heading anchors, shiki highlighting,
callouts, figures with the Lightbox island, ReadingProgress, and mermaid.
The `setHighlighterLoader(() => import('shiki'))` one-liner lives in our code
on purpose: bip-kit's zero-config load goes through a bundler-hidden dynamic
import the Next tracer cannot see, and a standalone build would ship without
shiki while dev looked fine. The deploy script restores the top-level
node_modules/shiki symlink output-tracing drops — the same hole FleetCrown
and OrangeCat both fell into.

Verified by a word-level diff of old vs new rendered output across all 100
file posts (every locale) and every DB post: 113 of 113 identical.
react-markdown and remark-gfm stay in package.json — the deliverables chat
and the career detail page still use them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

* fix(blog): bip-kit 0.2.3 — Tailwind's reset ate the list bullets

`bip-kit/styles.css` colored `::marker` but never declared `list-style-type`,
so under a reset that zeroes `ul, ol { list-style: none }` — which Tailwind's
preflight does — every bulleted and numbered list in an article rendered with
no marker at all. Invisible in the word-level parity diff, because a missing
bullet removes no words. 0.2.3 declares the type explicitly (disc/decimal,
with circle/square and lower-alpha at depth).

Parity re-run at 0.2.3: still 113 of 113 posts identical.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 03:43:21 +00:00
d2662cfe22 chore(pnpm): convert to pnpm 11 (#446)
* chore: pnpm — the fleet has one package manager

- packageManager pnpm@11.25.0; lockfile via pnpm import, package-lock.json gone
- npm overrides moved to pnpm-workspace.yaml overrides (pnpm ignores
  package.json overrides); allowBuilds for @parcel/watcher, @sentry/cli,
  @swc/core, esbuild, puppeteer, unrs-resolver, and the ai-forms git dep
  (pnpm requires the exact resolved URL for git-dep prepare builds)
- @tiptap/core added as a direct dependency: RichTextEditor.tsx augments
  'module @tiptap/core' and tiptap-markdown's Storage augmentation rides on
  it — a phantom dependency npm's hoisting hid and pnpm's isolation exposed
- all workflows: pnpm/action-setup@v6 before setup-node, cache: pnpm,
  store-dir pinned, pnpm install --frozen-lockfile; Next cache key now
  hashes pnpm-lock.yaml
- scripts/ci/dependency-audit.sh: pnpm audit --prod (parses both npm-v2
  'vulnerabilities' and pnpm's v1 'advisories' shapes)
- selfhost-deploy-evig.sh, ship.sh, start-all.sh, e2e-inventory-prod.sh,
  husky pre-commit, Dockerfile.prod (node 24 + corepack) converted
- engines: node >=22.13

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

* fix(deps): declare espree — eslint.config.mjs imports it directly

npm's hoisting provided it as a phantom; pnpm's isolated node_modules
exposed ERR_MODULE_NOT_FOUND in CI. Verified in a true clean room
(parent node_modules masked): full verify green, 7783 tests.

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

* fix(deps): declare tsx — npx fetched it on demand, pnpm exec does not

e2e:seed (and the hirn:*/setup-admins scripts) ran 'npx tsx', which
silently downloaded tsx because it was never in devDependencies. pnpm
exec only resolves installed bins, so CI's Seed E2E step died with
'Command tsx not found'. Declare it.

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

* fix(ci): drop '--' separators — pnpm run forwards them verbatim

npm strips the first '--' before handing args to the script; pnpm 11
passes it through, so 'pnpm run start -- -p 3001' executed
'next start -- -p 3001' and next read '-p' as a project directory.
pnpm forwards everything after the script name anyway, so the
separator is dead weight: remove it in ci.yml (start, e2e journeys,
e2e guards) and ship.sh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 12:06:36 +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