Commit Graph
135 Commits
Author SHA1 Message Date
dependabot[bot] a0936524dd ci: bump github/codeql-action from 4.38.2 to 4.39.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.38.2 to 4.39.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.38.2...v4.39.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 18:24:57 +00:00
Cato d2dbb21ccc Unify article drafting and edits with WritingKit (#1565)
* fix(articles): unify drafting and edits with WritingKit

* fix(articles): use secure randomness for draft operation identities
2026-11-05 18:05:28 +01:00
Cato 702d5593de fix(cat): preserve failed turns and expose safe diagnostics (#1543) 2026-11-04 14:52:20 +01:00
Cato 8172121e7d Enable Cat to manage project investor rooms (#1538) 2026-11-03 08:54:30 +01:00
Cato f65d12a23e fix(cat): preserve live-data answers and expose investor-room navigation (#1530)
* fix(cat): ground investor-room navigation and exercise real conversations

* fix(cat): ground replies in completed live-data tool results
2026-11-02 10:56:15 +01:00
CatoandClaude Opus 5.5 25ec4c3f6a feat(notify): OrangeCat's bots reach the owner through Loki's one gateway (#1524)
* feat(notify): OrangeCat's bots reach the owner through Loki's one gateway

The owner wants Telegram to be the way any of his bots reaches him, and only
with a one-tap action. Loki now owns that contract (loki
src/lib/notify/policy.ts); OrangeCat hands it the owner's news over the
existing signed rail instead of keeping it in-app only.

- services/loki/notify-owner.ts: posts the owner's notices (only when the
  recipient IS the owner, OPS_NOTIFY_USER_ID) to /api/orangecat/notify.
- The Cat's daily brief and fired watches go there with "Open the Cat".
- Ops alerts go there with no button, so they land in Loki's list and never
  ring the phone.
- uptime.yml: the outage message carries "Run Box doctor"; the recovery
  message is gone (nothing to do).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

* chore(env): list LOKI_NOTIFY_URL in .env.example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtzUbLhg3oqt4X1NaN

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 07:08:23 +01:00
CatoandClaude cc57921fd7 ci: run mcp-servers smoke test in build-and-smoke (#1517)
mcp-servers/smoke.mjs (#1491) holds a real MCP exchange with all seven
servers (initialize, tools/list, one read-only tools/call where there is
one) and exits 1 if any fails to start or answer, but nothing ran it.

Wire it into build-and-smoke right after the root install: lint-server's
probe needs the repo's prettier in node_modules/.bin, which that job
already has. `npm ci` in mcp-servers is ~6s and the smoke takes about a
second. Placeholders only; no network, no real credentials.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:01:49 +01:00
CatoandClaude Fable 5.1 dc62ac87df feat(bots): what a bot did stays in the thread; the five demos as one live rehearsal (#1514)
* feat(bots): a bot writes first, on the person's own key

A person can tell one of their bots to write first, every day at a time
they pick, with a prompt they wrote. The run happens on the person's own
OpenRouter key only; without a key the routine is kept, shown as waiting,
and skipped with the reason, so no platform key is ever spent by a timer
(fleet standing rule 2026-09-25).

- companion_routines table (one per person per bot, owner-only RLS),
  routines-store (time validation, next run in the person's zone) and the
  runner behind a cron route + 15-minute systemd timer, registered as a
  person-asked timer in the no-background-ai gate with a marker check.
- GET/PUT/DELETE /api/ai-assistants/[id]/routine for the owner.
- RoutineRow in a bot's own chat: "Writes first, every day", time and
  prompt inline, a line to Settings when a key is missing.
- Hands: the proposal line names what will be set up, never only "Sure";
  a created event's outcome carries its link.

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

* feat(bots): a bot can ask Loki, as the person — the first connector

ask_loki: a Cat action (communication, low risk, confirmed) in the hands
launch set. The bot relays a question over the signed OrangeCat → Loki rail
to Loki's POST /api/orangecat/ask, which runs a read-only turn as the Loki
user linked to the actor; Loki's own sentence is the outcome the person
reads, and a refusal (no linked account, a spent budget) is relayed as
written. A relayed question can never dispatch, approve or spend: that stays
with send_task_to_loki, and the two verbs name each other so a question is
never dispatched as a task.

ADR-0013: D6 first connector and D7 recorded as shipped.

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

* fix(bots): the routine's day-in-zone comes from the timezone helper

check:app-locale (new on main) refuses a literal locale handed to Intl; the
routine's next-run computation now takes the day in the person's zone from
instantToWallTime, the one rendering the app already trusts.

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

* fix(bots): the chip knows the verb of ask_loki

The tool-label table of leading verbs gains ask → Asking / Asked, so the
chip for a bot's question to Loki never falls back to the generic label.

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

* fix(cat): a failed "Do it?" card shows the server's sentence, not [object Object]

The confirm and reject hook handed the API's error envelope (an object) to
new Error(), so every failed action read "[object Object]". Seen live the
first time a bot asked Loki for an account not linked to Loki: Loki's
sentence naming the one step was on the action row and lost on the card.
The hook, the memory import and the interests list now read the message
through apiErrorMessage, the reader written for exactly this.

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

* fix(companions): a bot keeps offering its hands on a repeat ask

Live on 2026-11-01 the second "Ask Loki" in one thread came back as
"I can ask Loki for you." with no fence and no "Do it?" card. The
proposal fence is taken off a reply before it is stored, so the model
saw its own earlier offers as plain sentences and copied them.

- The queued proposal is kept in the assistant message's metadata.
- The history given to the model writes the fence back onto those
  turns (withProposal), so a proposal in the history looks like one.
- proposeFromReply returns the proposal as queued; hands tests cover
  the round trip and metadata reading.

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

* fix(companions): a proposal is a worked example, and a bare block still becomes a card

Live on 2026-11-01 a fresh bot's first "Ask Loki" came back as "Here's the
query I'll send to Loki:" over a json fence holding {"question": "..."}:
the free-tier model copied the template's inner half and left out the
action, so the person saw code and no card.

- The hands section ends with a complete block for a real offered action,
  required fields filled with their own names, instead of a template with
  <id> and {...}; it says the block is the proposal itself and to write no
  other code block.
- extractProposal reads a propose, json or untagged fence at the end; a
  block with fields but no "action" names the one offered action that owns
  every field and has its required ones present; a propose fence that said
  nothing usable comes off so it is never shown as code.
- Tests for the example, the lenient read, the inference and its refusals.

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

* fix(bots): a failed "Do it?" card is finished, a second card starts clean, no empty bubble

Seen live on 2026-11-01 (fresh thread, two asks of Loki):
- a card whose action ran and failed kept Confirm/Reject under the reason;
  the reason is now the outcome line, as a success would be
- the second card in the thread showed the first card's failure line inside
  it: the card is keyed by its action
- a model that wrote only the block left an empty bubble above the card:
  the card's description stands in for the words, and ask_loki is described
  as the question ("Ask Loki: ...") rather than "Execute Ask Loki"

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

* test(bots): the five demos as one live rehearsal, run by a person

tests/e2e/bots-rehearsal.live.spec.ts walks the live site as a brand-new
person (a pseudonymous account minted at the start, no fixture secret): one
door, the shelf and a real letter, a group with two specialists in their
lanes, an event proposed and created from a "Do it?" card, Loki asked twice
with an honest outcome and a clean second card, a routine set and stopped,
and the API edges. Every assertion names the value it protects.

The Live rehearsal workflow runs it on workflow_dispatch only and keeps the
screenshots; it has no schedule, because a free-tier key is spent only when
a person asks (fleet rule 2026-09-25). docs/testing/live-rehearsal.md.

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

* feat(bots): what a bot did stays in the thread

A "Do it?" card's outcome lived only in the slot above the composer: it left
the screen when a second card arrived and was gone on reload (seen live
2026-11-01). The confirm route now records the outcome as a line of the bot
conversation the card came from (services/companions/outcomes.ts): the
handler's own sentence with its page, or the reason it failed. The chat
re-reads the thread after the tap, so the line shows where it was asked
for, and the bot's next turn knows what happened.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 17:27:00 +01:00
CatoandClaude Sonnet 5.5 398463e70a feat(cat): the Cat chat is chatkit's ChatApp (#1447)
* feat(cat): the Cat chat is chatkit's ChatApp

The Cat chat now renders @bitbaum/chatkit 0.18's ChatApp: its header, chat
list (drawer on a phone, rail from 64rem) with search and Today/Yesterday/
Earlier, rename and delete, New chat, Temporary chat, reopening the open chat
after a reload, Camera · Photos · Files with thumbnails, the queue, Stop and
Retry. The Cat keeps only its transport and its words.

- useCatTransport: the Cat's stream (and the local-model loop) as ChatApp's
  transport; tool calls stream as steps; a temporary chat runs in an unlisted
  ephemeral row deleted when it is left.
- catConversationStore: chatkit's ConversationStore over API_ROUTES.CAT;
  the chat route still writes every turn (append is a no-op), nothing is
  kept on the device but the open chat's id.
- API: PATCH /api/cat/conversations/[id] renames; GET is a 404 for a chat
  that is not the person's (it returned the default thread); POST takes a title.
- CatAnswerFooter under each answer: tool chips, destinations, actions,
  action results, drafts, provenance, fallback, upgrade nudge, failure fixes.
- Deleted: ConversationRail, useConversations (incl. its temporary chat),
  useChatHistory, useChatMessages, ChatHeader, MessageBubble,
  MessageAttachments, ErrorDisplay; TalkRoom draws chatkit's ChatMessage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* fix(cat): 44px targets in the chat's composer and header

The model picker, Loki and tool chips sat under 44px beside ChatApp's own
controls; the model's name hides on a phone so the composer's tools stay
one row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* feat(cat): PDF reading through ChatApp — chatkit 0.21's attach.readFile

Moving the Cat onto ChatApp dropped the PDF reading main's #1449 added to the
old composer (chatkit's attach refused every PDF). chatkit 0.21.0 adds
attach.readFile; the Cat's reader (readCatFile) calls the same attachPdf as
before: same size limit, same sentences, same pictures-per-message (5, shared
with staged photos), same text-or-sheets result. The live PDF spec now reads
chatkit's staged strip.

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

* ci(cat): browser-smoke.yml — the real-browser check the rollout gate asks of a chat consumer

The fleet's shared-package gate holds a chatkit consumer PR until
browser-smoke.yml has passed on its commit; OrangeCat had no such workflow on
main (only on the unmerged PayKit branch), so every chatkit PR here waited
forever. This one builds the standalone app, signs in as the E2E account and
opens the Cat at 390 and 1280 (composer, Send, Files input, no sideways
scroll), then runs the live PDF-attach spec against it. No model call.

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

* test(cat): the smoke spec says what the page showed when the composer is missing

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 23:51:36 +01:00
Cato 79fcf1afce fix(deploy): use verified workspace-aware receipt producer (#1457) 2026-10-27 23:35:00 +01:00
Cato 741e908057 fix(deploy): stage and verify public package artifact receipts (#1456) 2026-10-27 23:12:21 +01:00
CatoandClaude Opus 5.5 ea27dfbec8 test(e2e): prove on the live site that the Cat reads PDFs (#1451)
* test(e2e): prove on the live site that the Cat reads PDFs

Added to the production E2E run (Chromium, Firefox, WebKit), signed in as
the E2E account. It checks that pdf.js's worker and JPEG 2000 decoder are
served from /pdfjs/, that a PDF of slide pictures (JPEG 2000, no text layer
— the shape of the deck that started this) attaches as page sheets that are
actually drawn, and that a text PDF attaches as a file. Nothing is sent to
the Cat, so a run costs no model call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmt7KKvAA6LzcgFqXA3

* ci(e2e): report live failures as annotations, readable without the log

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmt7KKvAA6LzcgFqXA3

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 20:57:02 +01:00
CatoandClaude 0c56355f80 test(e2e): one route contract that CI runs, in place of six that ran nowhere (#1445)
CI ran only workflow-matrix.spec.ts. Six other read-only specs sat beside
it, ran in no job, and drifted:
- they expected /loans, /circles and /assets to ask for sign-in, but
  /loans and /circles became Discover tabs and /assets moved under the
  dashboard;
- three messaging tests were skip(true) and never ran (the matrix covers
  messaging);
- the page checks asked only for a visible <body>, which a 404 also has,
  so /fundraising, /fund-us, /donate and /browse turned into 404s with
  every check green.

route-contract.spec.ts reads the HTTP status of every page and covers:
- public pages render;
- the legacy redirects land on Discover;
- signed-in pages send a signed-out visitor to /auth?mode=login with the
  right return address;
- /api/health answers.

It starts with no session, because global setup may have saved one. CI
runs it against the local standalone server on every build; it needs no
test account. Run against https://orangecat.ch: 19 passed.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 05:35:28 +01:00
CatoandClaude Sonnet 5.5 f2fd9e33f2 chore(chatkit): the broken-word audit runs on the Cat and money surfaces (#1411)
* chore(chatkit): the broken-word audit runs on the Cat and money surfaces

check:broken-words opens the landing page, /pay/<username>, the Cat chat and
the money surface (/receive, /send, /requests) in Chromium at 320/390/1440 and
fails on any word drawn across two lines, measured by findBrokenWords from
@bitbaum/chatkit/audit (chatkit ^0.13 -> ^0.14.2). CI runs it against the
standalone build; signed-in pages open with the E2E credentials and are named
as not opened, never passed, without them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* chore(ci): hand the word audit to Playwright as a function, not source text

CodeQL read page.evaluate on a string as code injection (2 high alerts on
this PR). findBrokenWords is self-contained, so Playwright can serialise it
itself.

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

* chore(ci): the word audit takes no path or URL from the environment unchecked

BASE_URL is parsed to its origin, PAY_USERNAME must look like a handle, and
screenshots are named by page index instead of by the page path. Aimed at the
two CodeQL path/URL alerts on this PR.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 18:17:01 +02:00
Catoandcatomean 61edd853b6 ci: cut scheduled CI minutes (CI audit) (#1379)
* ci: cut scheduled CI minutes (CI audit)

* ci: cut scheduled CI minutes (CI audit)

* ci: cut scheduled CI minutes (CI audit)

* ci: cut scheduled CI minutes (CI audit)

---------

Co-authored-by: catomean <catomean@users.noreply.github.com>
2026-10-21 20:42:56 +02:00
CatoandClaude Opus 5.5 a6d33c92dd perf(ci): main does not re-verify a tree its pull request already verified (#1298)
CI runs verify on a PR and again on main before deploying. When the base did
not move while the PR was open, the squash commit's tree is byte-for-byte the
tree the PR's CI tested (refs/pull/N/merge) — 18 of 30 recent merges. The PR
job now records the tree it verified as an artifact (verified-tree-<sha>),
for PRs from this repository only; main looks HEAD's tree up and skips the
Verify step on an exact match. Build, smoke tests and the artifact CD ships
still run. Any doubt — no match, an API error, a fork, unreadable output —
means verify runs as before; the script always exits 0.

9 tests run the real script against a fake gh/git, including every
fail-safe path; mutation-proved (dropping the same-repository filter fails).
Fields checked against the live artifacts API.


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 09:03:02 -07:00
CatoandClaude Opus 5.5 f00b279213 ci(dependabot): react, react-dom and their types update as one (#1280)
React refuses to run when react and react-dom differ. With no group, Dependabot
paired react with @types/react on its own and left react-dom behind: #1176
moved react to 19.3.0 with react-dom on 19.2.8, and every component test file
failed to load (0 tests). Grouped, the next React update cannot go red that
way and merges itself like any other non-major Dependabot update.


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 06:48:29 -07:00
dependabot[bot] e9874579ef ci: bump github/codeql-action from 4.38.1 to 4.38.2 (#1168)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.38.1 to 4.38.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.38.1...v4.38.2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.38.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-08 06:33:18 -07:00
CatoandClaude Opus 5.5 90689cabca perf(ci): verify runs in parallel lanes; CD's recovery path asks about the tip (#1270)
verify was 24 steps chained with &&, though none reads another's output.
Measured on CI 2026-10-07 it took ~280s (unit 151s, eslint 51s, the two
type-checks 31s + 32s, the rest ~10s), and it runs twice per change — on the
PR and again on main — before anything deploys. scripts/verify.mjs runs the
same steps in three lanes on CI (unit | type-checks | lint + static checks);
locally it stays serial in the old order, since parallel gates were OOM-killed
on a loaded laptop. VERIFY_LANES overrides. A test keeps the lane list and the
serial list identical, so a check cannot run in one mode and not the other.

cd.yml's bare-dispatch path (the fleet reconcilers) asked for "the newest
successful CI run on main" and refused unless it was the tip. Every merge gets
a cancelled duplicate CI run, and the answer depends on list order; it refused
green tips four times on 2026-10-07, leaving a red CD run after each merge.
It now asks for a successful run of the tip itself.


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:41:03 -07:00
CatoandClaude 189c380026 refactor(chat): the attach rule comes from chatkit, not a local copy (#1250)
ModernChatPanel kept its own copy of the Camera / Photos / Files input rule
(accept + capture per source). It now imports ATTACH_SOURCE_INPUT from
@bitbaum/chatkit, keeping only its labels and the `multiple` choice, so a
fix to the rule reaches OrangeCat with the next chatkit release.

chatkit moves to the merged 0.4.1 commit; `verify` runs
`check:file-inputs` (fails any file input whose accept mixes image and
document families); Dependabot groups @bitbaum/* releases.

Pinned to the commit until 0.4.1 is on npm; then it becomes ^0.4.1.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 05:29:01 -07:00
dependabot[bot] 58bce2ccb7 ci: bump github/codeql-action from 4.38.0 to 4.38.1 (#1103)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.38.0 to 4.38.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.38.0...v4.38.1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.38.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-23 13:36:00 -07:00
Cato 4174f53ac0 perf(ci): speed recovery deploys and cache Chromium (#1127)
* perf(ci): reuse CI artifact on CD recovery and cache Playwright Chromium

* fix(ci): retry transient GitHub API errors during deploy
2026-09-23 12:19:42 -07:00
Cato 14fd09774f fix(ci): pass repo to CD live-sha guard (#1123) 2026-09-23 08:45:46 -07:00
Cato baa5af1f4e fix(ci): authenticate CD live-sha guard (#1122) 2026-09-23 15:25:04 +00:00
Cato 2444f16586 fix(ci): route deploys through one verified handoff (#1121) 2026-09-23 08:03:42 -07:00
Cato 10bd7ef099 fix(ci): reuse verified bundle and skip duplicate deploys (#1115) 2026-09-23 02:42:03 -07:00
CatoandClaude 9567897667 feat(commerce): build the till, leave it shut until the company exists (#1097)
OrangeCat is not a registered company, so it must not take money — not for
credits, not for plans. Everything else about paid plans is finished: real
prices, a working ledger, Lightning plumbing tested end to end. Only the last
step refuses.

THE GATE WAS AN INFRASTRUCTURE SETTING

Until now the only thing between OrangeCat and someone's money was
`platformReceiveEnabled()`, which asks whether a receiving wallet URI happens
to be configured. That is an infrastructure question standing in for a legal
one: configuring a wallet in order to test a top-up would have opened the till
as a side effect. Nobody would decide that. It would simply have happened, and
we would have found out afterwards.

`PAID_PLANS_OPEN` (src/config/commerce.ts) is now the commercial switch, and
it is separate from the wallet check on purpose — a configured wallet means we
CAN take money, the flag means we MAY.

It FAILS CLOSED. Only the exact string "true" opens it, so a missing env var,
a typo, or a new deploy target with a half-copied config all mean shut. That
direction is chosen: taking money we are not allowed to take is the expensive
error, and turning away money we could have had is merely disappointing.

Enforced server-side in both places that can mint an obligation — the route
and `initiateTopUp` itself — so no caller reaches the wallet by another path.
`credits/route.ts` reports `topupEnabled` as the AND of both conditions.

ONE DELIBERATE ASYMMETRY

`checkTopUp` is NOT gated. Shutting a till must never strand money already in
flight: if an invoice was paid while it was open, that user is owed the credit
whatever the switch says afterwards. Refusing to honour a payment already made
would be a worse failure than the one the gate exists to prevent.

WHAT IS NOT GATED, AND NEVER WILL BE

Payments BETWEEN users. Funding a project, buying a listing, settling a loan —
that money goes from one person to another over Bitcoin at 0%, never touches
OrangeCat, and there is nothing here to switch off. It is the product; the
paid Cat plans are a service sold on top of it. A test pins that the free and
BYOK routes stay available, because "OrangeCat cannot take payments" is a
sentence a user could easily misread as "payments are broken".

THE MOMENT OF TRUTH SAYS WHY

A disabled button labelled "Top up (soon)" makes someone hunt for a reason and
guess at a fault. The top-up surface now states that OrangeCat is not yet a
registered company, that prices are real and the plumbing is built, that the
free pool and their own key both still work, and that paying other people was
never affected. Prices stay VISIBLE on every plan — a plan you cannot evaluate
is worse than one you cannot yet buy.

THE FLAG REACHES THE BUILD

`publicFlagsReachTheBundle` caught that NEXT_PUBLIC_PAID_PLANS_OPEN was absent
from ci.yml — a client flag the build never sets can never be turned ON, which
would have made this permanently unflippable. Wired as a repo variable, so
opening for business is a one-variable change rather than a code change. The
gate that caught it is the same one that found voice input dead on arrival.

WRITING

content/blog: "What Cat Costs, and Why You Cannot Pay Us Yet" — the four
routes, the free pool's real ceiling (it binds on tokens-per-minute, not
messages-per-day, so it strains on simultaneity rather than volume), and the
reasoning above in the company's voice.

24 new tests (411 files, 3838 passing). pnpm run verify green.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-20 07:27:53 -07:00
CatoandClaude Opus 5 fe32fdc53a fix(cd): a cancelled CI run is a question, not a verdict (#1069)
Observed 2026-09-17. Three PRs merged inside two minutes (#1066, #1067,
#1064). CI's concurrency group cancelled the earlier runs on main, and the
deploy job was gated on

    github.event.workflow_run.conclusion == 'success'

so `cancelled` skipped it — four runs in a row, `completed/skipped`. A skip
turns NOTHING red: every check on the PR was green, the merge looked
complete, `gh run list` reported success-shaped output, and the box kept
serving the previous release while /api/health answered 200 throughout. Two
verified, merged PRs sat undeployed on a green main until someone dispatched
CD by hand.

This is the failure the repo's own CLAUDE.md warns about in the section on the
two hand-offs — "CI is green, no check is red, and nothing deploys" — arriving
through a third route that neither hand-off covers.

The fix treats a cancelled run as a question rather than an answer. The job
now also starts on `cancelled`, and a new first step asks the Actions API
whether ANY CI run for the same commit concluded success. If one did, deploy.
If none did, don't — and say so, since the auto-merge sweep's reconcile will
dispatch CD once a green run exists.

Three details worth keeping:

  - It fails CLOSED. A failed or forbidden API read sets ok=false rather than
    deploying on an unverified commit.
  - It gates on the EXIT STATUS of `gh api`, never on what it printed: with
    `--jq`, a 403 writes its error payload to stdout, which reads like a value.
  - `permissions:` is now explicit, because the guard needs `actions: read`.

Verified by extracting the guard's script out of the YAML and running it
against a fake `gh` across every branch: success -> deploy, cancelled with a
passing sibling -> deploy, cancelled with none -> hold, API error -> hold.
The workflow is also checked with a duplicate-key-rejecting YAML loader, since
GitHub silently refuses a file that PyYAML happily parses.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 02:52:59 -07:00
CatoandClaude Opus 5 3e6c202c59 refactor(config): the deploy target is configuration, not a literal (#1061)
Three hardcoded things in a public repo, each of which is someone else's
value baked into the source.

The box address had a literal fallback in five places: the CD workflow and
four operational shell scripts. A fallback literal guarantees the variable
is never exercised — if the variable were missing or wrong, every run would
still succeed against the baked-in address and nobody would find out until
the address changed. So:

  - cd.yml takes the address from vars.OC_BOX, or root@ the HETZNER_IP
    variable, and a new guard step fails the run with ::error:: when the
    result is empty. The ssh-keyscan and ssh-config host now derive from
    the host half of OC_BOX instead of repeating the literal, so the two
    cannot drift apart silently.
  - apply-migrations.sh, db/dump-live-schema.sh, db/gen-types.sh and
    deploy-selfhost.sh use ${OC_BOX:?...}: they stop with one clear line
    instead of reaching for a default. The two of them invoked by the
    deploy script are already passed OC_BOX explicitly, and the workflow
    sets it in the job env, so the configured path is unchanged.

An audit log was committed under logs/ in 2025-10 with 14 absolute paths
from a developer's machine. Nothing in the repo reads it (the only mentions
of the filename are inside the file itself). The `logs/` ignore rule was
added five days after the file, so it never applied to it — removed, and
the rule now says why, because ignoring a directory does not untrack what
is already inside it.

scripts/db/setup-db.ts signed in as a personal email address written into
the source. It now reads USER_EMAIL, matching the USER_PASSWORD it already
read, and exits with a clear message when unset.

Verified: bash -n on all four scripts and each one run with OC_BOX unset
(exit 1, clear message); the workflow parses and the guard step is in
place; pnpm run type-check:scripts green; prettier clean; the two unit
tests that read deploy-selfhost.sh pass.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:07:48 -07:00
dependabot[bot] 28c59aa085 ci: bump github/codeql-action from 4.37.9 to 4.38.0 (#1023)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.9 to 4.38.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.9...v4.38.0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-14 11:43:20 -07:00
CatoandClaude Fable 5.1 9a352d3646 refactor: rename FleetCrown to Loki across the integration (#1016)
The sibling product was renamed on 2026-09-14. Every reference follows:
service and route paths (src/services/loki, /api/integrations/loki),
env keys (LOKI_*), the build-intent audience and timeline source ('loki'),
ecosystem config, docs, tests, and 13 file names.

Tool labels keep "Loki" capitalised: the old name had an internal capital
and passed the "looks like a name" shape test for free; a one-word name
needs listing, so softLower now carries a small PROPER_NOUNS set.

Box and data were moved ahead of this: LOKI_* keys sit beside the old ones
in the app env, the OAuth client is `loki` with the new callback host, and
timeline/metadata rows carrying the old name were rewritten.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:40:27 -07:00
CatoandClaude Opus 5 b7260c0c6a fix(ci): a commit must not cancel another commit's run (#980)
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>
2026-09-11 14:43:01 -07:00
CatoandClaude Opus 5 774173c77a ci(auto-merge): hand the sweep a PAT so workflow PRs stop stalling (#924)
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>
2026-09-08 17:09:58 +00:00
CatoandClaude Opus 5 4740894792 fix(deploy): ship the standalone tree as a tarball so its symlinks survive (#915)
CD failed on 4fda8351 with `Cannot find module
'@swc/helpers/_/_interop_require_default'`, and succeeded on 817bdf60 from the
same workflow and the same artifact path. The difference was not in the code.

Next's standalone output under pnpm is a symlink farm. `node_modules/next` is a
link into `node_modules/.pnpm/next@…/node_modules/next`, and next's peers —
`@swc/helpers` among them — are linked in as its SIBLINGS there. Node resolves
the peer by walking up from the real path, so the link is not a convenience;
it is the resolution mechanism.

upload-artifact takes a directory and does not reliably preserve links. When it
dereferences, `next` is materialised as a real directory at
`node_modules/next`, which lifts it out of the directory where its peers live.
The `@swc/helpers` store entry still ships. Nothing can reach it.

Measured on the box, same workflow, consecutive deploys:

  live release (booted):   137 symlinks, node_modules/next -> .pnpm/next@…
  failed release:            0 symlinks, node_modules/next a real directory

and booting the failed tree by hand reproduces the error exactly, with the
require stack terminating at next/dist/shared/lib/constants.js.

tar records links as links, so the tree arrives byte-identical and the variable
is gone rather than merely less likely. Three changes:

- CI packages `.next/standalone` into a tarball and uploads that.
- CD unpacks it and ASSERTS the tree still contains symlinks. A pnpm standalone
  always has them; zero is not a warning, it is this bug. It fails there,
  one line from the cause, instead of forty minutes away in a boot test on the
  box — and deliberately does not fall through to a rebuild, because a silent
  rebuild ships green and leaves the artifact path broken forever.
- The boot test greps the cause BEFORE the tail. Node prints the one line that
  identifies the failure first, then a stack that runs well past twenty lines,
  so `tail -25` kept everything that identifies nothing and cut the only line
  that mattered.

Note CI's existing "Start server (standalone)" step could not have caught this:
it runs against the local tree, before the artifact round-trip, so it passes on
a tree that is not the one shipped.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 04:31:55 -07:00
30f6d45216 chore: pnpm — the fleet has one package manager (#889)
* chore: pnpm — the fleet has one package manager

- packageManager pnpm@11.25.0; lockfile via pnpm import, package-lock.json
  removed
- npm "overrides" moved to pnpm-workspace.yaml overrides (pnpm ignores the
  npm-only package.json field); nested gray-matter>js-yaml pin kept; $sharp
  reference spelled out (pnpm 11 deprecates $ syntax)
- allowBuilds for native/postinstall deps; temporary minimumReleaseAgeExclude
  for our own @bitbaum/ai-kit@0.6.2 (published <24h ago — pnpm 11's
  supply-chain window would refuse it)
- postinstall dropped: it was the npm optional-deps sharp workaround
  (npm/cli#4828); pnpm resolves optional deps correctly
- CI/CD/e2e-auth workflows: pnpm/action-setup@v6, store-dir pinned outside
  the action's bin dir, cache: pnpm, frozen-lockfile installs, pnpm run;
  Next cache key now hashes pnpm-lock.yaml; npm audit → pnpm audit --prod
- phantom deps declared: espree (eslint.config.mjs) and @mdx-js/mdx
  (scripts/check-mdx.mjs), previously resolved via npm hoisting only
- package.json scripts, husky hooks, deploy-selfhost.sh converted to pnpm

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

* fix: another phantom dep only the CI clean room could see

@radix-ui/react-visually-hidden (CommandPalette.tsx) resolved locally through
the parent repo's hoisted npm node_modules. Declared; a full src/ bare-import
sweep against package.json now reports no other undeclared specifier.

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

* fix: declare wait-on — npx fetched it on the fly, pnpm exec requires it

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

* fix(ci): security job — no install means no pnpm store, so no cache to save

The audit step itself passed (2 moderate, below the high gate); the job went
red in setup-node's POST step, which fails when the cache path it was told to
save (the pnpm store) was never created. This job only needs the lockfile.

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

---------

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 10:47:14 +00:00
dependabot[bot] 681c2240c8 ci: Bump github/codeql-action from 4.37.8 to 4.37.9 (#867)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.8 to 4.37.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.8...v4.37.9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-31 18:41:48 +00:00
GandClaude Fable 5 0d3a3a61b7 chore(ci): CI and .nvmrc follow the box to Node 24 (#860)
The box ran Node 20 four months past EOL; it moved to 24.20.0 today with
every service health-verified. CI validating on 20 now validates against
a runtime nothing uses.

The npm-audit gate's node/npm coupling comment told the bumper to re-check
its exit code first (npm 11 stops honoring --audit-level): re-checked on
npm 11.11 — the tree is clean at every level, exit 0 — and the comment now
records that instead of still claiming node 20.


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

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 18:57:26 +02:00
bae4be1aa3 refactor(test): migrate the unit suite from Jest 30 to Vitest 4 (#859)
Full parity: 282 test files / 2645 tests green before and after.

- vitest.config.ts mirrors the old moduleNameMapper as ordered resolve.alias
  entries; jsdom env, globals, 30s timeout, v8 coverage with the same ratchet.
- vitest.setup.ts ports jest.setup.ts; lucide-react is now a vi.mock Proxy
  (any icon resolves — the old CJS-alias Proxy surfaced no named exports and
  every unlisted icon crashed renders as "Element type is invalid").
- Codemod jest.* -> vi.* across tests; @jest-environment -> @vitest-environment.
- Constructor mocks use function expressions (vitest news the implementation;
  arrows are not constructable).
- Factories returning a bare component now return { default: ... };
  one TDZ factory moved under vi.hoisted; one require() -> await import().
- jest.isolateModulesAsync dropped in the auth smoke test (resetModules +
  doMock per test covers it).
- Scripts ported (positional path filters replace --testPathPatterns);
  verify's --watchAll flag removed; ci.yml comment updated.
- Deleted jest.config.js, jest.setup.ts, __mocks__/vitest.js,
  tsconfig.test.json, tests/jest-dom.d.ts, and the unimported jest-era
  tests/utils.ts; uninstalled jest, ts-jest, jest-environment-jsdom,
  @types/jest; dropped the dead mcp:jest script.
- Snapshot file rewritten in Vitest format (content byte-identical).


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

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 16:14:36 +00:00
GandClaude Opus 5 4cb188e064 docs(ci): the sweep lives in bitbaum/fleet, not dotfiles (#810)
The `uses:` line is already correct. What was stale is the prose next to
it, which told the reader the policy lives in bitbaum/dotfiles and to go
change it THERE. That file no longer exists in dotfiles — the sweep moved
to bitbaum/fleet on 2026-08-28, because a repo holding someone's .bashrc
is not where a fleet's deploy policy belongs.

A comment that misroutes a fix is worse than a missing one: it sends the
next person to edit a repo where the change would reach nobody, which is
the precise failure the shared sweep exists to prevent.

Files: .github/workflows/auto-merge.yml


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 12:04:51 +00:00
GandClaude Opus 5 43f4ec049a chore(ci): call the auto-merge sweep from bitbaum/fleet (#805)
The fleet automation moved out of dotfiles on 2026-08-28; the dotfiles path
is now a forwarding shim. This points the caller at the sweep's real home.
One line; the reusable workflow's interface is unchanged.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 10:40:03 +02:00
5c909fd8dd ci: fail when a uses: points at a redirect, so there is no third time (#803)
Twice in two days an owner change stopped every merge and every deploy
in this repo: `maonakamoto` → `catomean` on 2026-08-26, then the move to
the `bitbaum` org, fixed in #800. Each fix pointed at a name that became
a redirect the next time.

Both outages were invisible in every place anyone looks. GitHub redirects
a renamed owner for the REST API and for git remotes, so `gh api` answers
and `git push` works; the Actions resolver is the one consumer that does
not follow the redirect. It fails before any step exists, with "This run
likely failed because of a workflow file issue" and no readable log,
while pull requests stay green, clean and mergeable. The red run is on
main, under a workflow nobody opens. Work simply stops shipping.

Two instances is where the rule says stop fixing instances. This asks the
REST API what each referenced repo is really called and fails when that
disagrees with what the workflow says — that disagreement IS the bug,
because REST resolves the redirect and Actions does not.

A static allowlist could not catch it: after a rename the workflow file
and the allowlist would both hold the same stale name and agree with each
other. Only asking GitHub what the repo is called today can tell.

Lives in CI rather than in `npm run verify`, which is the offline SSOT
bundle and must stay deterministic; without a token this skips rather
than passing quietly. A non-200 that is not a 404 exits 2 — could-not-look
is never reported as looks-fine.

Proven by mutation: restoring `catomean/dotfiles` fails with the
canonical name to use. Also fixes the last CLAUDE.md reference to the
2026-08-26 owner.


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

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 07:40:48 +00:00
GandClaude Opus 5 5d2df78776 fix(ci): point Actions at the bitbaum org, so merges and deploys resume (#800)
* fix(ci): point Actions at the bitbaum org, so merges and deploys resume

The fleet moved to the bitbaum org. Actions' `uses:` resolver does not follow
a repo transfer — unlike the REST API, `git clone` and `git push`, which all
do. So every reference here still looked correct to every tool that could be
used to check it, while the runs died before a single job started: zero jobs,
no logs, and a bare "workflow file issue".

That failure mode is invisible in the usual places. A PR shows CLEAN and
MERGEABLE with no red check, because the workflow that would have reported the
red never ran. Nothing is marked broken; work simply stops moving.

Files changed: auto-merge.yml

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

* fix(ci): restore secret scanning, which the org move silently disabled

gitleaks-action is free for PERSONAL accounts only. Under an organization it
refuses to scan and exits "missing gitleaks license", so moving this repo into
bitbaum turned secret scanning off while leaving the job, its name, and its
place in the checks list exactly as they were.

It failed loudly here only because the licence check errors. A wrapper that had
skipped instead would have reported green while scanning nothing — and the
comment above the step still read "Free for public repos; no license needed",
so the file asserted the opposite of what was happening.

Replaced with the gitleaks CLI, which is MIT and unaffected. Same scope as
before: the incoming commit range, not full history (~173 pre-existing 2025-era
findings live there and only a history rewrite clears them).

Verified against 8.30.1 before writing it, because a secret scanner is exactly
the kind of check that is trusted without ever being watched:
  - clean range           -> exit 0
  - planted sk-ant key    -> exit 1, "leaks found"
  - EMPTY range           -> exit 0, scans nothing, reports success

That last one is why the step counts commits itself and fails on zero. A
scanner that silently reads no commits is worse than one that is obviously
broken, because it keeps reporting green.

Note the first mutation attempt did NOT go red: it planted AWS's published
EXAMPLEKEY, which gitleaks allowlists by design. The test was wrong, not the
scanner. A mutation that stays green is a hole in the test.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 08:31:14 +02:00
e7f2d8cf69 fix(ci): auto-merge points at an owner that no longer exists (#789)
Nothing has merged or deployed since the GitHub account was renamed from
`maonakamoto` to `catomean`. Every auto-merge run since fails before it
starts, with "This run likely failed because of a workflow file issue"
and no log to read.

    uses: maonakamoto/dotfiles/.github/workflows/auto-merge-sweep.yml@master

GitHub redirects a renamed owner for the REST API and for git remotes —
`gh api repos/maonakamoto/dotfiles` still answers, which is exactly what
makes this hard to see — but the Actions resolver does NOT follow the
redirect when loading a reusable workflow. It looks for an owner that is
not there any more and fails the whole run before any step exists.

The failure mode is the bad one this file's own header warns about, from
the other direction: a green PR that GitHub reports as CLEAN and
MERGEABLE, no red check anywhere on it, and nothing merging. The sweep is
the only thing that is red, and it is red on `main` rather than on the
PR, so looking at the pull request tells you nothing is wrong. It also
takes the RECONCILER down with it — the part that re-dispatches cd.yml
when main's tip and the last successful deploy differ — so merges made
before the rename would not have shipped either.

Fixed by naming the current owner. This is the only load-bearing
reference in .github (`git grep maonakamoto origin/main -- .github` finds
this line and the comment above it, nothing else).

Renames like this cannot be caught by CI in the repo that breaks: the
workflow that would run the check is the workflow that fails to load.
Worth a fleet sweep for `uses: maonakamoto/` in every repo, since one
account rename breaks every repo that calls a shared workflow, all at
once and all silently.

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 23:13:07 +02:00
3c89c462df fix(security): clear the advisories, then make the audit gate able to fail (#746)
The dependency audit blocked only on CRITICAL and merely annotated HIGH. That
was a deliberate staged rollout, not an accident — the comment said so, and set
an exit condition: "escalate once the tree is clean." Nobody came back. The
annotation ran on every build, addressed to no one, while three HIGH advisories
accumulated behind it (postcss ×2, js-yaml).

None of them were version-pinned. Every fix was already inside a range the repo
had allowed all along; the lockfile had simply drifted:

  postcss  8.5.10 -> 8.5.26   (range ^8.5.10 always permitted it)
  js-yaml  4.3.0  -> 4.3.1    (range ^4.1.1  always permitted it)
  hono     4.12.27-> 4.13.4   (range ^4.12.27 always permitted it)

So this needed no override edits and no version negotiation — just a lock
refresh. `npm audit --omit=dev` now reports 0 vulnerabilities, which is the
condition the old comment named, so the gate is escalated and the warning is
deleted. One command at --audit-level=high, not two: blocking at high already
covers critical.

Proven by mutation, using real data rather than a synthetic defect — the
pre-fix lockfile IS the mutation:

  escalated gate vs. yesterday's lockfile : exit 1  (would have blocked)
  escalated gate vs. this commit's lockfile: exit 0

Also recorded a latent trap found while proving it. The step is coupled to
`node-version: 20` (npm 10). On npm 11, `npm audit --audit-level=critical` was
observed exiting 1 against a tree whose own --json reported
{moderate:2, high:1, critical:0} — the level stops gating the exit code. A
future Node bump would silently turn this into "block on ANY advisory", wedge
every merge, and get the gate weakened instead of debugged. Commented in place.

`--omit=dev` is kept deliberate: dev-only advisories do not ship. js-yaml was
dev-only and was patched anyway, because it cost nothing.

Note on verification: the postcss bump is validated by CI's `npm ci` + build,
not by a local run — this worktree has no node_modules and resolves up to the
main checkout, which still has 8.5.10 installed. Installing locally would mutate
node_modules shared with other active sessions.

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 13:28:18 +00:00
791f6e2c39 ci(verify): run verify from a worktree — the shape agents work in (#745)
* ci(verify): run verify from a worktree — the shape agents work in

CI checks out a normal clone and runs `npm ci`, so node_modules sits at the
checkout root. A script that hardcodes `join(ROOT,'node_modules',…)` resolves
there and CI goes green. A git worktree contains only TRACKED files — it has no
node_modules of its own and inherits the main checkout's by letting Node walk UP
the directory chain. Same code, two shapes, two outcomes.

Worktrees are the default working mode for every agent in this fleet, so that
blind spot is not academic: on 2026-08-24 `npm run verify` — the repo's SSOT for
"verified" — could not run to completion from any worktree while CI stayed green
throughout. The fix landed; nothing stopped it regressing.

Proven by mutation before the job was written. Reintroducing the hardcoded jscpd
path gives, on identical code:

  normal checkout : exit 0, "[check-duplication] OK"   <- what CI sees today
  worktree        : ENOENT crash

Adds a `verify-in-worktree` job that creates a real nested worktree and runs
`npm run verify` verbatim from it. Three calls worth naming:

- Nested under .claude/worktrees/ (gitignored), not a sibling path. The nesting
  is what lets Node's upward resolution reach <checkout>/node_modules; a sibling
  would resolve nothing and would be testing a shape nobody works in.
- The whole `verify`, not a hand-picked "worktree-sensitive" subset. Of the two
  real failures one was a path-resolution script and the other was a unit test —
  no honest subset holds both, and a subset drifts from `verify` besides.
- Deliberately NOT in post-main's verdict, and commented as such. It proves
  agents can verify locally; it says nothing about whether the commit is safe to
  ship, which build-and-smoke already established on the same code. Blocking a
  deploy of verified code on a developer-experience gate would trade a real
  outage for a process bug. Enforcement is at PR time, where auto-merge needs
  every check green.

The job also fails if the worktree ever acquires its own node_modules, so a
future step cannot quietly turn it into a gate that can't go red.

Swept for other instances of the class: every remaining `node_modules` mention
under scripts/ is a directory-skip filter, not path construction, and the
.env.local readers are ad-hoc seed scripts outside verify's surface.

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

* TEMP(do-not-merge): reintroduce the hardcoded jscpd path to prove the gate

Deliberate defect, reverted before this PR leaves draft. Expectation: build-and-smoke GREEN (normal checkout has node_modules at the root) and verify-in-worktree RED (worktree does not). If both are green the new job is inert and must be fixed, not trusted.

Committed with --no-verify: the pre-commit hook runs eslint/tsc/jest, none of which touch check-duplication, so running it on a throwaway defect proves nothing.

* Revert "TEMP(do-not-merge): reintroduce the hardcoded jscpd path to prove the gate"

This reverts commit 3d730a8b24.

---------

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 12:31:34 +00:00
dependabot[bot] fb37f76b95 ci: bump github/codeql-action from 4.37.7 to 4.37.8 (#740)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.7 to 4.37.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.7...v4.37.8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-24 20:17:11 +00:00
GandClaude Opus 5 dfa67843a6 ci: call the central auto-merge sweep — its coverage moved first (#719)
This repo was the last of the two deliberately excluded from the fleet rollout.
Its copy of auto-merge-sweep.sh shipped merges by re-arming CI so that cd.yml
(workflow_run on CI) would fire — a chain with a known hole: a CI run started by
GITHUB_TOKEN emits no workflow_run event, so CD never fires for an automated
merge. The canonical sweep closes that with a RECONCILER, enabled here via
`deploy_workflow: cd.yml`: every sweep compares main's tip against the last
successful cd.yml run and dispatches it directly when they differ. The
`post-main` hand-off in ci.yml stays as a second path; the reconciler is the
net under both.

THE TESTS MOVED BEFORE THE SCRIPT WAS DELETED. This repo was one of only two in
the fleet that ever wrote tests for the sweep, and its suite covered four things
the canonical suite did not — the in-progress defer, the stale-run wait, and
the full red-base carve-out set (green-on-failing-jobs merges; no coverage
refused; PARTIAL coverage refused). All of it is now in
dotfiles/scripts/ci/test-auto-merge-sweep.sh (17 cases, mutation-proven),
ported in maonakamoto/dotfiles#34 so no assertion is lost between the two
commits.

One block of auto-merge-base-guard.test.ts was NOT about the sweep: the source
assertions on refresh-e2e-reset-tokens.mjs (fixture keyed on GITHUB_RUN_ATTEMPT,
leftover fixture cleared instead of failed on). That script stays in this repo,
so its guard stays too — moved to e2e-reset-fixture.test.ts, its own file,
because the thing it tests no longer shares context with a script this repo no
longer carries.

Verified before deleting the local copy: diffed it against the canonical and
accounted for every differing line — all of them are main_* vs base_* naming
for identical logic, the cancelled-rerun the canonical generalises, and the CI
re-arm the canonical does via REARM_WORKFLOWS. The update-branch behaviour this
repo's branch-currency tests pinned is in the canonical verbatim.

CLAUDE.md repointed: the policy section and the two-hand-offs section both named
scripts/ci/auto-merge-sweep.sh, which would have become a lie the moment this
merged.

Fleet duplication: 8 copies -> 7.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 13:04:17 +00:00
dependabot[bot] 665c39efa7 ci: Bump github/codeql-action from 4.37.6 to 4.37.7 (#710)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.6 to 4.37.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.6...v4.37.7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-17 19:55:52 +00:00
GandClaude 6c53b83de4 fix(ci): ship content/ inside the standalone artifact (#680)
PR #679 fixed the blog's 'Untitled' fabrication two ways: skip posts with
missing frontmatter, and add outputFileTracingIncludes for content/blog.
Production now shows the honest failure instead — 'No posts found' —
because the tracing include did not land the files on the box. Stop
relying on tracing for request-time fs reads entirely: the assemble step
already copies .next/static and public/ into the artifact by hand, so
copy content/ the same deterministic way.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-12 14:01:01 +00:00
dependabot[bot] 504f33c269 ci: Bump github/codeql-action from 4.37.4 to 4.37.6 (#665)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.4 to 4.37.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.4...v4.37.6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-10 20:56:20 +00:00