mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 10:48:20 +01:00
f25958dc65697c070d3eceeb44786d74fcd94bf9
665
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a1aed85daa |
fix(cold-start): a brief becomes a repo and a live site through the normal path (#569)
* fix(cold-start): the starter ships a lockfile, so its first Deploy can install selfhost-deploy.yml refuses to install without a lockfile and installs with --frozen-lockfile; the Next starter declared pnpm and shipped no lock, so every fresh site failed before building. The lock is resolved once by scripts/templates/refresh-starter-lock.ts into a generated asset and seeded with the starter (one Git tree call, no pnpm on the app box). scripts/test/starter-lock.ts fails on drift, missing standalone output, a missing packageManager, or starter docs that point at npm. Seeding failures are recoverable: provision on a linked but bare repo re-seeds it instead of refusing with 409. The starter embeds the project-scoped feedback widget from its first commit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * fix(cold-start): liveUrl means a Deploy on the current commit and a public 200 Registration persisted liveUrl because register-site.sh exited 0 with --no-deploy. Now: strict setup, then a workflow dispatch; GET reports pending/failed/live and the UI polls it. describeSiteDeployment (pure, tested) treats a queued run or a just-sent dispatch as starting, closing the race where the first poll after dispatch read as "no deployment exists". A status the client cannot read is shown as a failure, not swallowed. The deploy workflow resolves a freshly registered slug from the box register and proves the checkout belongs to the caller; deploy.sh builds with the same package manager that installed; register-site.sh runs release siblings, locks the register, fails without a deploy secret, and seeds a runtime env. check:deploy-ready no longer reads a box-registered checkout as laptop drift. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * fix(feedback): Implement addresses the project id, never a same-named tab Feedback and kickoff dispatch resolve user_projects by stable entity id; a renamed project or a same-named sibling can no longer redirect a run, and the hosted fallback is off for actions tied to a tracked run. Batch Implement only advances when a run was accepted. Fix prompts require the normal ship path and live evidence; Resolve stays with the operator. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * docs: FleetCrown builds independently; tab names are transport, not identity Product copy and agent docs describe FleetCrown as an independent product with optional OrangeCat linking that is not publication consent. Control drops the Focus terminal chip (Open terminal stays). Adds the cold-start handoff. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
fed8298080 |
feat(orangecat): the handoff now says who the client is, and fills the brief (#570)
A build handoff from OrangeCat created a project with a name, a description and three canned lines — no owner, no origin URL, no next step — so the agent dossier briefed builders with blanks, and a page set up for someone else (ADR-0005 on the OrangeCat side) arrived without the one fact a builder asks first: who is this for, and who do I talk to? The intent payload now carries an optional `owner` block (kind, display name, OrangeCat page, and the steward answering for an unclaimed page). It is written into the project notes as a client block and into the profile — owner, url, customers, status, next_step — deterministically, with a best-effort Groq pass over the description for mission/customers/problem/ solution behind it (onlyMissing, so an owner's own words are never replaced). Older tokens without `owner` behave exactly as before; a pure test pins both. Claude-Session: https://claude.ai/code/session_017FU2m6NxPYYFkEdyufcSrX Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
fefdc64320 |
fix(register): name the host that actually serves, and stop calling a box path drift (#567)
Three defects, all the same shape: the register recorded an address that was
true once, and something downstream believed it.
1. aoz-wohnen's domain was a REDIRECT, not the canonical host
The row said `aoz-wohnen.orangecat.ch`. That host only 301s to
`aoz.orangecat.ch`, which is where AOZ Begleitung actually serves — the box's
own vhost comment says so ("One product, one URL"), and George settled it
months ago: "it should consistently be aoz. not wg, not aoz-wohnen."
This was not cosmetic. sync-infra.sh rewrites /etc/caddy/apps.d/<name>.caddy
from this field with an unconditional `tee`, so the next sync would have
emitted a block for the redirect host only and DELETED the aoz.orangecat.ch
site block — taking a live client's real URL off the air. Fixed by naming the
canonical host.
2. revamp-info listed a domain that must NOT be generated
`hirnli.orangecat.ch` is the same app, but it is served by a hand-maintained
hirnli.caddy (the middleware reads the Host header for tenant chrome). Listing
it here meant a sync would emit it a SECOND time inside revamp-info.caddy, and
two site blocks for one address fails `caddy validate` — which sync-infra runs
immediately before `systemctl reload`, so the reload aborts and every other
app's pending vhost change silently fails with it.
3. A repo_path on the box was reported as drift, and blocked everyone
dogfood-site-sep10-1201 was scaffolded directly onto the box, so its
repo_path is /home/ubuntu/dev/... — a path that cannot exist on the laptop
however healthy the fleet is. check-deploy-ready.sh called that drift and
exited 1, failing pre-push for every laptop push, on a register row that was
correct and a site serving 200. That is the category error this file's own
header warns about: judging state that is not in front of you.
Now split by DEV_ROOT: missing under DEV_ROOT is still drift and still fails;
anywhere else is announced ("not checkable here — repo_path lives on another
host") and does not fail.
The CI/CD verdicts were also fixed to count what was INSPECTED, not every
register row. With one app uninspected they said "all 16 deployed apps have
it" — absence reading as success, one level up, in the number itself.
The register's `domains` field is provisioning input, not documentation: it must
name the host that serves, and must not name a host that must not be generated.
The register NAME (`aoz-wohnen`), the systemd unit, /opt path and `aoz_wohnen`
database keep the housing-era name on purpose — they are addresses nobody reads,
and renaming them is a migration. The product is AOZ Begleitung; its SSOT is the
app's own brand.ts. Comments now say all of this in the file itself.
Verified: deploy-ready gate 20 passed (2 new cases — a box-side path is
announced and does not fail; the verdict counts only inspected apps),
client-ledger 12, uptime-sweep 66, apply-schema 34.
NOT done here, needs a box change: aoz-wohnen.orangecat.ch's 301 still lives
INSIDE the generated vhost, so a sync drops it (bookmarks break, canonical
survives). It belongs in its own aoz-legacy-redirect.caddy, the way
sink-legacy-redirect.caddy already does it.
Claude-Session: https://claude.ai/code/session_01HVudRzEmLqLHvGNqFSpJq6
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
cc135862c0 |
chore(register): add heidi (4025) and the missing diplodoctor row (4024) (#566)
heidi.orangecat.ch is provisioned on the box (unit, vhost, monitoring) and needs this row on main before selfhost-deploy.yml can resolve it. diplodoctor was provisioned today and is live on 4024 with a Caddy vhost, but never got its apps.conf row — so the allocator's "max port + 1" would have handed heidi the same port. Registering it is what made 4025 correct. Claude-Session: https://claude.ai/code/session_01KXoMmDTW3jq6xb1JC1Yh4e Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
0e5c687d20 |
fix(register): resilient deploy.yml push; finish dogfood bootstrap deploy (#557)
Register no longer dies when Contents API already landed the secrets fix. Bootstrap resets the dogfood checkout, treats register push races as non-fatal, and always runs deploy.sh for the slug. Co-authored-by: Cato <catomean@users.noreply.github.com> |
||
|
|
40f80e5118 |
fix(cold-start): idempotent register + cross-owner deploy secrets (#554)
Register site must succeed when apps.conf already has the slug (compatible repo path): re-ensure deploy.yml, secret, and sync-infra, print live URL, and let registerProjectSiteCd write liveUrl — do not refuse as already exists. Prefer the /opt release copy of register-site.sh so a stale durable checkout cannot keep refusing after Deploy. Pass HETZNER_SSH_PRIVATE_KEY explicitly in deploy shims; secrets: inherit fails for catomean/* → bitbaum/fleetcrown and left dogfood Deploy dead on arrival. Co-authored-by: Cato <catomean@users.noreply.github.com> |
||
|
|
43d9296ed1 |
chore(register): add dogfood-site-sep10-1201 to apps.conf (#553)
Registered on the studio box after #552 so Make it happen CD dogfood has a durable apps.conf row (port 4023, orangecat.ch host). Co-authored-by: Cato <catomean@users.noreply.github.com> |
||
|
|
8bcbe93675 |
fix(cold-start): auto-register CD when box has script+key (#552)
* fix(cold-start): auto-register CD when box has script+key Dogfood after #551 got a repo and a bash command only: kickoff hid the reason, and canRunRegisterSiteLocally failed because the deploy key lived on the laptop, not under ubuntu on fleetcrown.orangecat.ch. Probe script/key/SITE_CD_AUTO with an explicit gate+reason, prefer /home/ubuntu/dev for durable apps.conf, show the reason in Make it happen, add Register site retry, and document the one-time box key/env. * fix(lint): drop unused canRunRegisterSiteLocally import --------- Co-authored-by: Cato <catomean@users.noreply.github.com> |
||
|
|
f7438b64aa |
fix(cold-start): register Hetzner CD after kickoff provision (#551)
* fix(cold-start): register Hetzner CD after kickoff provision Make it happen created a GitHub repo but never wired apps.conf / deploy secret / live URL. After provision, call register-cd: seed deploy.yml, run register-site.sh on the studio box when possible, otherwise return that one command — and record liveUrl only when registration succeeds. * style: prettier on kickoff + site-cd-register --------- Co-authored-by: Cato <catomean@users.noreply.github.com> |
||
|
|
03141d39c1 |
fix(cold-start): close GPT audit gaps for kickoff, feedback, OC, docs (#550)
Stop kickoff after a failed repo step; keep the operator's exact brief; mark feedback Queued only with a real run id; link Check live to the reported page; never backfill OC wall history from before publish consent; document eligible-only cloud builder and the new-site vs provision starter split. Co-authored-by: Cato <catomean@users.noreply.github.com> |
||
|
|
8504d9abbf |
fix(feedback): Done only after live proof, not inject/run SUCCESS (#549)
* fix(feedback): Done only after live proof, not inject/run SUCCESS
Done meant "agent run closed SUCCESS" (and auto-resolved + emailed
visitors), which claimed the live product shipped when only a prompt
was delivered and a session ended.
- SUCCESS/PARTIAL closed runs → NEEDS_VERIFY ("Check live")
- Done only when status is RESOLVED (operator Resolve today)
- Stop auto-resolve on SUCCESS; visitor shipped mail rides Resolve
- Keep resolveFeedbackForRun for a future merged-PR / live-stamp closer
* style(feedback): prettier close-loop excerpt line
|
||
|
|
e82207fa2f |
fix(kickoff): Make it happen without private-zone PIN (#546)
* fix(kickoff): private PIN must not block Make it happen * fix(kickoff): keep KickoffBlock type for call sites * fix(kickoff): brief without private milestones when PIN locked * fix(kickoff): Unlock tip is optional, Make it happen always available * fix(kickoff): drop unused blocked gate in ProjectKickoff * test(kickoff): locked PIN must not refuse Make it happen * test(kickoff): locked zone briefs from description, does not 409 * style: prettier scripts/test/project-kickoff.ts |
||
|
|
4e7d20cc0a |
Fix bell notification inbox to show feedback alerts (#540)
* Wire bell to show feedback alerts - Add new_feedback alert type to alert registry - Create alert when visitor feedback is filed - Create NotificationPanel component to show active alerts - Add API routes for fetching and dismissing alerts - Replace push-only bell with notification inbox that: - Shows badge count when alerts exist - Opens panel listing alerts with dismiss action - Includes link to feedback inbox for each alert - Add UI classes for notification panel and badge Co-authored-by: Cato <catomean@users.noreply.github.com> * Fix linter errors * Await async getApiUserId * Remove unused import * Show existing feedback in bell panel - Create sync-alerts function to maintain new_feedback alert - Add cron job to run sync every 15 minutes - Update NotificationPanel to fetch and display feedback items directly - Each feedback project gets a row with count and link to its inbox - Fix badge to use explicit white color (matches design system) - Sync runs on panel mount so existing feedback appears immediately - Filter out new_feedback alerts from panel (feedback items shown directly) * Remove unused NextResponse import * Add sync-feedback-alerts to cron schedule and fix logging source * Fix badge count to include feedback + remove browser cron call - Badge now counts feedback items + alerts (was only alerts) - Remove postJson call to cron route from NotificationPanel mount - NotificationsPill fetches /api/feedback/summary directly - Badge count matches what panel shows * Classify /api/alerts as safe for demo sandbox Alerts are user-scoped (only fetches/dismisses caller's own alerts). Fixes demo-sandbox.ts test failure. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Cato <catomean@users.noreply.github.com> |
||
|
|
e7b37710d1 |
fix(identity): the retired pseudonym was still live, and the scaffold signed with it (#533)
* fix(identity): the retired pseudonym was still live, and the scaffold signed with it Caught by a --dry-run, minutes before scaffolding a new public repository. new-site.sh hardcoded the retired pseudonym as the commit author: git -c user.name='<retired>' ... commit -m 'feat: scaffold <Title>' Every site the scaffold has ever created carries that name in its FIRST COMMIT, in a public repo, permanently. Nothing surfaces it: it is one flag on a long line, it never appears in the app, and the dry-run prints it only if you read the command it would run. Sweeping for it found thirteen more, and the shipped ones were not internal: privacy, terms, license, support the operator named on the LEGAL pages PublicFooter the copyright line on every public page config/ecosystem.ts the `owner` field seed.ts the seeded profile name Avatar.tsx, initials.ts doc examples All four legal pages were serving it live on fleetcrown.orangecat.ch, verified by curl before and after. The doc examples are replaced rather than renamed: both demonstrated two words producing two initials, so substituting a one-word name would have broken what they exist to show. They use "Ada Lovelace" now. WHAT THIS DELIBERATELY DOES NOT TOUCH legal/IP_ASSIGNMENT_MEMO.md, legal/PRIVACY_POLICY.md and legal/TERMS_OF_SERVICE.md still carry the retired name, on purpose. An IP assignment memo reading "I, <name>, sole author and copyright holder" and a privacy policy naming a data controller are instruments executed under a name. Renaming a party on a signed document is not a find-and-replace; it is a decision for the person who signed it. The check below excludes legal/ so its contents are not mistaken for a defect, and so nobody "fixes" them mechanically. THE CHECK scripts/hetzner/test-no-retired-name.sh fails if the name returns to src/ or scripts/. docs/ is allowed, because HANDOFF.md has to NAME the retired pseudonym in order to forbid it — a gate that cannot tolerate its own rule being written down forces the rule to be deleted. It assembles the pattern from two literals instead of writing it whole, so the check does not match its own source. That is asserted, not assumed: one case fails if the pattern is ever "tidied" into a single literal, and another checks it assembled to the expected value, because an empty pattern matches everything and a mistyped one matches nothing and passes silently. Mutation-proven against the real defect, not a fixture: the commit-author line was reverted to its pre-fix state, the check failed and named new-site.sh, and the line was restored. Wired into `test:ops`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe * style: prettier Replacing the retired name with a shorter one changed the JSX text reflow on the three legal pages, so prettier wants them rewrapped. verify's first gate is `prettier --check .`, which makes a formatting-only miss a red build with nothing else wrong. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
9b33aec49e |
Fix feedback loop with durable agent sessions (#541)
* fix(feedback): resume durable agent sessions * chore(desktop): release Fleet Runner 0.8.18 * fix(ci): restore complete desktop lockfile |
||
|
|
95e85a511d |
feat(ci): ratchet the client ledger — no new live client work without terms (#534)
apps.conf carries plan/price columns that were added before the numbers existed, on the explicit reasoning that "the gaps are the point — right now 'what am I owed this month' and 'what am I maintaining for free' are unanswerable, which is why these columns exist before the numbers do". That reasoning was right and nothing acted on it. All 15 rows still read plan=- price=-, including four LIVE client engagements: kivvi (RevampIT), aoz-wohnen (AOZ), vitareba (clinic) and sink (S-Ink). The columns made the gap recordable; they did not make it visible, nothing ever read them, and months of '-' looked exactly like having no clients. This is the reader. check-client-ledger.sh — counts LIVE client-app/client-site rows whose plan or price is '-'. Ratcheted at 4: may fall, never rise. Deliberately narrow — a product owes nobody an invoice, and a prospect with no price is honest, so both are excluded and the near-misses are printed rather than silently dropped. new-site.sh — the same rule, enforced earlier: --status live on client work now requires --plan/--price and refuses at argument validation, before the repo, the box and the deploy exist. CI would reject the row anyway, but by then the site is created, pushed and serving. Not wired into the daily fleet-register-check on purpose: a recurring message about a number that does not change is how alerts get muted. It fires at the one moment the answer is cheap — the PR that puts a client app live. Proved by mutation, both directions, on copies (12 cases): a regression goes red, an improvement goes green and prints how to bank it, products are never counted, and a register with nothing to announce still reaches its verdict. The last one exists because the two trailing announcements are `[ -n "$x" ] && echo`, a shape that can end a `set -e` script early on exactly the register that has nothing wrong with it. Also fixes scripts/hetzner/verify.sh, which read 6 variables from a 12-field line, so $db silently carried "-|S-Ink|client-site|live|-|-|-" on every row — harmless only while that loop ignores $db, and the same trap app_lookup() in lib.sh already documents having been bitten by. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
f0ee08c40a |
fix(scaffold): the template every new site is built from was building cold (#532)
scripts/site-template/.github/workflows/ci.yml is the THIRD copy of the golden CI floor. The other two live in fleet/templates/ci/ (ci-npm.yml, ci-pnpm.yml). On 2026-09-07 a fleet sweep measured 14 of 32 repos recompiling Next from scratch on every CI run, fixed all 14, and added the .next/cache step to both fleet templates so new repos would start warm. It missed this one — which is the copy the scaffold ACTUALLY uses. Every site created from new-site.sh in between started cold by construction, and the fix meant to prevent exactly that landed in two files nobody scaffolds from. Fixing it a third time is not the point. scripts/hetzner/test-site-template.sh asserts the floor the scaffold must emit: restores .next/cache via actions/cache keyed on the lockfile, installs with `npm ci`, type-checks, lints, builds, runs on pull_request and not only push, and declares a concurrency group. Wired into `test:ops`. Mutation-proven against the real defect rather than a synthetic one: the cache step was removed to reproduce the pre-fix template exactly, three assertions fired and named what was missing, and the step was restored. The test also checks its own cache predicate against a fixture with no cache, because a checker whose patterns stopped matching passes exactly as quietly as a correct template. It deliberately does NOT strip comments. This file's comments name the very constructs it checks for, so a comment-blind scan would pass on a template whose only mention of .next/cache is prose explaining its absence. Each check looks for the active YAML construct — `path: .next/cache`, `uses: actions/cache@` — not the bare word. Note where this sits relative to fleet's cicd-hygiene-audit.sh: that ratchet measures repos that already exist, so a template defect reaches it once per repo, forever, and only after each repo is created. A template is upstream of the ratchet; this is the upstream half. Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
213217f821 |
fix(orangecat): the build handoff asked "where should this live?" and showed bare names (#531)
The picker listed every FleetCrown project by name and nothing else, so the question it asks is unanswerable: a FleetCrown project is a workspace record that MAY carry a repo, a local checkout and a live site, and the page showed none of the three. Every option read like a repository. None of them is one — "Diplodoctor" is offered while no such repo exists anywhere. - The picker now shows what the selected project actually is (repo / local / site), or says plainly that it is a FleetCrown record only. - "Create a new project" says it attaches no repo or path, because it does not: createUserProject is called with dirPath: null, gitUrl: null. - Linking a project that is already the origin of a DIFFERENT OrangeCat entity silently overwrote user_projects.orangecat_project_id, repointing the funding read path with no warning. Now marked in the list, acknowledged by an explicit checkbox, and enforced server-side so a stale page cannot slip past it. Also fixes the dead-exports ratchet, which skipped every directory NAMED "build" — including src/app/integrations/orangecat/build/, a shipping route. Any export whose only caller lived on that page read as dead. Matched by path now, and asserted against the index rather than the pattern: the first version of that assertion tested the regex alone and stayed green while the call site still matched on the bare name. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
f518a1c566 |
fix(hetzner): sync-infra generated a launch.sh that cannot find server.js (#530)
`/opt/<app>/app` is a symlink into `releases/`, and `find` does not descend a logical symlink path. The generated launch.sh resolved its own directory with plain `pwd`, so the `server.js` search returned nothing and the app crash-looped with "no server.js found and START_CMD unset". This has now cost two outages. vitareba hit it on its first release-deploy (2026-07-17) and the fix went into deploy.sh, which sed-patched the *already generated* file on every deploy. That repaired the output and left the generator emitting the broken version — so the bug was still fully present, just masked by whichever ran last. sbb-fundbuero hit the identical failure on 2026-09-08 the moment sync-infra.sh ran without a deploy behind it. Fixing the output of a generator does not fix the generator. - `scripts/hetzner/launch.sh.tmpl` is now the single definition, with `pwd -P`. - `sync-infra.sh` renders it (`__PORT__` substituted per app) instead of carrying its own heredoc copy. - `deploy.sh` no longer sed-patches launch.sh. One writer. - `test-launch-template.sh` builds the real releases layout — a release dir plus an `app` symlink into it, plus a decoy `server.js` under node_modules — and asserts the template's own discovery resolves the right file through the symlink. It carries a negative control that fails the suite if plain `pwd` ever starts passing, so the test cannot quietly stop testing anything. Proved by mutation on a copy: reverting `pwd -P` to `pwd` makes the suite exit 1 with the exact production error. Wired into `test:ops`, so `pnpm run verify` covers it. All 15 apps on the box currently have the correct `pwd -P` (deploy.sh's sed had been keeping them alive), so removing the patch changes nothing about the running fleet. Claude-Session: https://claude.ai/code/session_01NfPenJdSXVtN8SQ9wHG4Hp Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
ea4af6174d |
chore(register): rename sbb-lost-found to sbb-fundbuero (#529)
The app is now "SBB Fundbüro" and moves to sbbfundbuero.orangecat.ch. This repo owns the register that provisioning reads, so the rename has to land here before the app's next deploy: sync-infra.sh generates the unit and the Caddy vhost from apps.conf, and deploy.sh resolves /opt/<name> from the same line. A rename in the app repo alone would deploy to a directory the Caddy vhost does not serve. Changed only what is operationally load-bearing plus the docs table: apps.conf (name, domain, repo path), the public site list, the URL seed, the runner hardening InaccessiblePaths, and the port/domain table. Historical incident comments that mention sbb-lost-found are left alone — they record what happened under that name, and rewriting them would make them false. Claude-Session: https://claude.ai/code/session_01NfPenJdSXVtN8SQ9wHG4Hp Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
6be463cd3f |
fix(telegram): the self-only allowlist was a caller obligation nobody performed (#519)
sendTelegramMessage's docblock said "the caller is responsible for the self-only
allowlist check BEFORE calling this". Eight call sites, zero checks —
isAllowedTelegramTarget had no caller anywhere in the repo.
Nothing leaked, and that is the uncomfortable part: it held only because every
call site happens to pass selfTelegramTarget(). The blast radius the guard was
written to bound was bounded by coincidence instead. The first flow that lets a
recipient be requested — a Loki action, an operator-typed target — would have
inherited an unguarded send to an arbitrary chat, with a docblock saying someone
else had already checked.
The guard now runs inside the send. An empty chatId resolves to the operator's
own chat, which is what isAllowedTelegramTarget has always meant by "empty =>
default to self", and with no chat id configured every send is refused rather
than guessed at. No behaviour change for the eight existing callers, verified
one by one: all pass selfTelegramTarget().
scripts/test/telegram-allowlist.ts — 15 assertions, in the unit suite by
discovery (139/139). Both configurations run in child processes with their own
env, the shape activity-time-zone-stable.ts already uses and for the same
reason: tsx compiles to CJS and cannot `await import`. TELEGRAM_BOT_TOKEN is
left unset on purpose, so a send that REACHES the transport fails on the missing
token — that is what separates "refused by the allowlist" from "attempted", and
the mutation shows it: removing the guard turns both refusals into
"no TELEGRAM_BOT_TOKEN configured".
TWO THINGS THE TEST CAUGHT IN ITSELF.
The first version silently tested the wrong path. It set TELEGRAM_CHAT_ID, but
the constant is envAlias("TELEGRAM_CHAT_ID"), which reads APP_ / FLEETCROWN_ /
COCKPIT_ prefixed names and never the bare one — so the "configured" probe was
exercising the UNCONFIGURED path. Five assertions failed and that is how it was
found; a test asserting only refusals would have passed while proving nothing.
The module's own comment was wrong for the same reason ("Sourced from
TELEGRAM_CHAT_ID (env, via constants)"). Corrected to name the real keys, since
setting the bare name configures nothing and looks like it worked.
isAllowedTelegramTarget removed from the dead-export ratchet BASELINE. 12 -> 3.
verify green (13 steps, exit 0, 139/139 unit files).
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
63c677718f |
fix(gates): three of my own BASELINE reasons were false — and the check now says so (#518)
#511 recorded seven dead exports with the consequence of each being dead. Three of those consequences were wrong. I found them by going to fix one. getProjectDefinitionOfDone I wrote "the autopilot stop-gate bar is stored and never read, so definition_of_done gates nothing". gate-and-close.ts:88 reads it, through the sibling getProjectGoalConfig — which returns the bar AND the turn cap in one fetch, so this wrapper also threw half the result away. addOrgMember I wrote "nothing adds a member to an org, so an org can only ever contain whoever created it". The team-invite flow inserts the membership (db/queries/invitations.ts:69) and createOrg seeds the owner's. This was a third writer, unused. isOrangeCatPayReady I wrote that a missing ORANGECAT_PAY_URL_* shows the user a dead upgrade path. /pricing resolves per plan via orangeCatPayUrl(plan.key) and falls back to "Start free" — strictly better than this aggregate, which would have gated all three tiers on any one of them. One error, three times: inferring "the capability is missing" from "this symbol is unreferenced". They are different claims and the first does not imply the second. In each case a LIVE SIBLING in the same file already did the job, so the export was redundant rather than evidence of a gap. All three are deleted here and their entries removed. The file's own docblock argues a dead export is misinformation. I put three pieces of misinformation into it. A fourth was imprecise rather than false. enqueueImport said the import queue "has no producer — no surface can start one". Importing works: /api/people/import and the OpenClaw sync both call applyImportedBook and write contacts straight in. What has no producer is the accept/discard REVIEW that config/book.ts calls the point of import — enqueueImport proposes an IMPORT_PERSON draft per unplaceable contact, and execute-action.ts still handles that type, so the reviewing half is live with nothing feeding it. Rewritten to say that, and left as a product call: whether review was dropped deliberately is not for a deletion to decide. THE GATE NOW MAKES THIS HARDER. Every finding prints the exports in the same file that ARE used: isAllowedTelegramTarget src/lib/actions/telegram-send.ts live in the same file: selfTelegramTarget, sendTelegramMessage <- does one already do this job? That is exactly the context whose absence produced all three bad reasons, placed where it gets read. When no export in the file is used it says so, pointing at the file rather than the symbol. Mutation-proved: a fake PROBE_DEAD_EXPORT in oc-pay.ts reports "live in the same file: orangeCatPayUrl". Baseline 12 -> 4, and the remaining four are now verified individually rather than asserted. verify green (13 steps, exit 0, 138/138 unit files). Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
38f6cf4a7c |
fix(people): contact details were text you had to copy, not links (#517)
reachChannels() returned {label, value} and built no hrefs at all, so both
surfaces that show someone's contact details rendered them as inert text — on
rows whose entire purpose is reaching that person. mailtoHref existed with no
caller anywhere; whatsappHref was referenced only by its own test.
It now returns an href per channel, and channelHref(key, value) is exported so
every surface builds links the same way:
email mailto:
phone tel:+<digits> (>= 6 digits)
whatsapp https://wa.me/<digits> (>= 8 digits)
telegram https://t.me/<handle> handles only
in-person, other none
Every href is assembled from a FIXED scheme plus a sanitised fragment, never
the raw attribute. A person attribute is user-entered text, and dropping it
into an href unfiltered is how `javascript:` ends up one click from the
operator. Telegram links handles only on purpose: a t.me link built from a
phone number is an invite, not a profile, and guessing between the two silently
opens the wrong chat.
I FIXED THE INSTANCE BEFORE I FIXED THE CLASS. The first version wired only
CheckinPersonRow (Today) and left PersonChannelsSection (/people detail) still
printing the same emails and numbers as inert spans. Making a dead function
live in one of the two places that needed it is not the fix.
So the test no longer asserts "the row links". It iterates REACH_SURFACES and
asserts each renders the href, carries rel="noopener noreferrer", and imports
from the shared builder — a third surface has a list to join rather than a
habit to rediscover. PersonCard was checked and left alone: it uses the channel
NAME to log an interaction and renders no contact value.
scripts/test/people-reach.ts extended. Its existing deepEqual caught the shape
change immediately, which is how I know it was live and not decorative. Added
per-channel construction, the honest-null cases (3-digit phone, email with no
@, a phone number in the telegram field), and a hostile-input loop asserting
every built href matches tel:+ / wa.me / t.me / mailto: for `javascript:`,
`data:`, and a whitespace-padded variant. Mutation-proved on a copy: raw value
as href fails, telegram trusting its input fails, either surface dropping its
href fails by name.
mailtoHref removed from the dead-export ratchet BASELINE — the ratchet failed
on its own when the function came alive ("mailtoHref is referenced again"),
which is the stale-entry check doing its job. Baseline 8 -> 7.
Not verified in a browser: no dev server was up and both surfaces need a
session, so the markup is covered by tsc, the design-system check and the ui-*
classes being real, not by clicking a link.
verify green (13 steps, exit 0, 138/138 unit files).
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
11a0cc7330 |
fix(prompts): a custom prompt's {{variables}} were dispatched as literal braces (#516)
The `prompts.variables` column, a parser that fills it, and a renderer that
handles defaults have all existed in `src/db/queries/prompts.ts` since the
feature shipped. No UI could reach them: that module imports `db`, so a client
component cannot. Four surfaces each rolled their own substitution instead —
RunModal template.replaceAll("{{project_name}}", name)
ScheduleModal template.replaceAll("{{project_name}}", name)
PromptPicker substituteProjectName()
ProjectPromptLibrary substituteProjectName()
— and all four handle exactly one variable, no defaults, exact spelling only.
That is invisible in the built-in library, whose 37 placeholders are every one
of them `{{project_name}}`. It is wrong for USER-OWNED prompts, which reach the
same two modals through `asTemplate()` in UserPromptsSection and may declare
anything. A body with `{{ticket_id}}` was dispatched to the agent with the
braces intact; through ScheduleModal it was baked into a cron job's stored
message and re-sent, with braces, on every tick.
`src/lib/prompt-vars.ts` now owns the parser and the renderer with no `db`
import; `db/queries/prompts.ts` re-exports them so server import paths are
unchanged, and `substituteProjectName` delegates instead of keeping a second
regex — which also fixes `{{ project_name }}` (spaced), a spelling the parser
has always accepted and that helper's own regex never matched.
Both modals now resolve EVERY declared variable and render an input for each
one that is not project_name, with the declared default as its placeholder.
RunModal shows how many are still unfilled. An unfilled variable with no
default deliberately stays visible as `{{name}}` in the preview rather than
blanking: a half-filled prompt should be obvious before dispatch, not produce a
confident instruction with a hole in it.
scripts/test/prompt-vars.ts — 22 assertions, in the unit suite by discovery
(138/138). Three of them are structural: neither modal may hand-roll a `{{`
substitution again, and `db/queries/prompts.ts` must re-export rather than
define. Proven falsifiable by mutation on a copy: blanking an unfilled variable
fails, giving substituteProjectName its old private regex back fails two, and
restoring RunModal's replaceAll fails the no-private-copy check.
`renderPromptBody` removed from the dead-export ratchet BASELINE — it has a
caller now. The ratchet's own stale-entry check enforces that removal.
Not verified in a browser: no dev server was up and /prompts needs a session,
so the modal markup is covered by tsc, the design-system check, and the class
names being real, not by looking at it.
verify green (13 steps, exit 0).
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
0585ab32c0 |
chore(thoughts): adopt bip-kit 0.2.1 — retire the local mermaid island and shiki workarounds (#515)
bip-kit 0.2.1 upstreamed both reasons the local copies existed:
- MermaidBlock now does canvas color normalization (oklch/lab tokens no
longer blank diagrams) and class-based theme detection (next-themes
attribute="class" works), so src/components/thoughts/MermaidDiagram.tsx
is deleted in favor of bip-kit/react/mermaid. Its orphaned PALETTE
fallback groups go with it; the one value email still used
(darkFallback.textTertiary) moves to the canonical dark mirror group.
- setHighlighterLoader(() => import("shiki")) is the supported seam for
standalone builds: the literal import lives in our code, so the bundler
ships shiki like any other dependency. The serverExternalPackages
"shiki" entry and deploy-local.sh's node_modules/shiki symlink (and the
load-bearing static-import assertion) are all removed; node-pty's
handling stays untouched.
Verified on the assembled standalone locally: code essay serves 56
--shiki-light spans with NO top-level node_modules/shiki present, and the
mermaid essay renders a themed SVG in both dark and light (labels flip
near-white/near-black; per-theme re-render confirmed).
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
||
|
|
a48e7c52dd |
docs(billing): the docs still described a rail that was deleted yesterday (#514)
#508 removed the Stripe rail. Four living docs kept describing it, and one of them is named in CLAUDE.md as an SSOT — so the wrong answer was the documented answer. - `development/cloud-local-workflows.md` listed `Stripe billing | STRIPE_*` in the env-gated feature table. Replaced with the rail that exists: `ORANGECAT_PAY_URL_{PERSONAL,PRO,TEAM}`, names checked against lib/oc-pay.ts. - `sustainability-gates.md` Gate 3 argued from a `quantity: 1` hardcode in `src/app/api/stripe/checkout/route.ts`. The gate did not go stale, it HARDENED: that route is gone and the BTC rail is a static per-plan URL with no quantity concept, so there is no seat number left in the purchase path to correct. Per-seat Team is now a build, not a config change. - `oc-rail-monetization-scope.md` claimed the Stripe webhook "already calls" updateUserBilling and that /pricing has an isStripeReady() seam to reuse. The write survives (via /api/orangecat/entitlement, plus scripts/grant-plan.ts); the seam does not — the BTC CTA is the default case now, not one to add. - `development/user-flow-audit.md` asserted `/api/stripe/portal` returns 503. It returns 404. CH01-CH04 and the CH04 runbook tested four deleted endpoints; retired with a pointer to what replaced them. `scripts/grant-plan.ts` said it performs "the SAME write the Stripe webhook does" — updated to name the entitlement route instead. Two findings that were not about Stripe: `docs/self-improvement-plan.md` enumerated three `insertPromptHistory` call sites. There are four — `api/control/tab-inject` was missing — and all three line numbers had drifted (270→397, 452→514, 80→138). Following that list would have shipped the runId linking with one dispatch path still unlinked. Line numbers dropped in favour of "grep the symbol"; same for `src/auth.ts:234` in the OC scope doc, which now points at line 268's unrelated code. `src/config/demo.ts` still denied `/api/checkout` under its "money" heading long after #508 deleted that route — a deny rule for a route on no disk, which made the billing section of the sandbox policy look staffed. demo-sandbox.ts already had the reverse check for DEMO_SAFE_FAMILIES ("a family listed as safe that no longer exists is dead reassurance"); the denied lists had no equivalent, which is why that entry survived. Added the mirror check — it caught `/api/checkout` on its first run — and mutation-proved it with a fake prefix. 262 assertions. Also measured and did NOT gate: doc path references (314) and `pnpm run` commands (77) both came back clean once false positives were removed, and the dominant pattern is prose naming a file precisely to record its REMOVAL, which grep cannot tell from rot. A gate there would fire on the correct docs and stay silent on the wrong ones. CLAUDE.md's own four flagged paths were all correct, and all 22 routes in its Views table exist. verify green (13 steps, exit 0). Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
084f17c054 |
fix(deploy): link node_modules/shiki into the standalone — the tracer never will (#513)
Second half of the shiki saga (#510 shipped tracing globs that copied nothing; #512 added serverExternalPackages + a static import, which got the .pnpm store files traced but still no highlighting in prod). Hermetic diagnosis (standalone copied OUTSIDE the repo tree, so the dev node_modules can no longer leak into Node's resolution walk — which is exactly how the earlier local verification fooled itself): Turbopack's externalized import of shiki resolves through its own module wrapper, but bip-kit loads the peer via `new Function("s","return import(s)")` — plain Node resolution from the server chunk path. Next emits the .pnpm store entries yet never the top-level node_modules/shiki symlink, so that import finds nothing and ArticleBody silently degrades to the mono fallback. With the link created: bp-codeblock-highlighted spans with dual-theme --shiki-light/--shiki-dark vars. Without: bp-pre fallback. Reproduced both ways before shipping. deploy-local.sh (the postbuild that already supplies what the tracer can't see — static assets, content, node-pty's native binary) now creates the symlink, version-agnostically, from the store entry it finds. The static import also becomes load-bearing (bare `import "shiki"` was tree-shaken: shiki declares sideEffects:false) and asserts at module load, so a missing peer is a loud failure instead of a quiet styling regression. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
96cdfd182f |
feat(thoughts): adopt bip-kit v0.2's reference renderer (#510)
Replace the hand-written block switch + ri() inline re-parser in /thoughts/[slug] with ArticleBody from bip-kit/react, and adopt bip-kit/styles.css with FleetCrown's design tokens mapped onto the --bp-* theming contract (route-scoped CSS, not globals). New capabilities live on every essay: - sticky <Toc /> with scroll-spy (xl right rail, hides under 3 headings) - heading anchor ids (slugified, umlaut-aware) - Shiki syntax highlighting, server-side, dual-theme via --shiki-* vars - <ReadingProgress /> hairline (warm accent) - <Lightbox /> zoom on figures - the full v0.2 vocabulary (callouts, pullquotes, footnotes, charts, stats, math, galleries) for future essays Kept, deliberately local: - MermaidDiagram island (now the components.mermaid override): bip-kit's MermaidBlock keys on data-theme only and passes computed oklch straight to mermaid's color parser, which rejects it — the exact initialize() throw that once blanked every diagram here. Canvas normalization stays. - Inline local-SVG figures (ThoughtArticleBody splits the block stream around them) so repo-authored diagrams keep reading design tokens and flipping with the theme; alt-as-caption is preserved by promoting captioned image blocks to figure blocks. Also: - ThemeProvider now mirrors the theme to data-theme alongside class — the fleet convention bip-kit's dark scopes (shiki token colors) key on. - next.config traces shiki into the standalone build: bip-kit loads it through a bundler-hidden dynamic import the tracer cannot see, so prod would otherwise silently fall back to unhighlighted code. - bip-seam test updated to pin the v0.2 vocabulary. - ThoughtVideoEmbed deleted (bip-kit's allowlisted VideoEmbed renders embed blocks). 68-essay compat diff (v0.1 vs v0.2 parse, histograms): identical except (a) mermaid fences code->mermaid (wanted), (b) 34 bare `---` lines across 10 essays that rendered as literal "---" paragraphs now render as <hr>, (c) one bare `>` separator line in the levelsio essay that rendered as a stray ">" paragraph now merges its two quote paragraphs into one blockquote. All three match authored intent. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
e59f679289 |
chore(gates): a dead export is a lie about what the system does — gate it (#511)
markAgentMessageRead was the only writer of `read: true` and had no caller, so the Control escalation banner was permanent by construction (#507). That was found by hand. This is the check that finds the next one. `scripts/test/dead-exports-ratchet.ts` fails when a NEW export in src/db/queries, src/config or src/lib has no reference anywhere. Existing ones are recorded with the consequence of being dead, so the list is worked down rather than ignored — and a recorded entry that becomes referenced fails too, so it cannot rot into a lie. It joins the 137-file unit suite by discovery. 49 dead exports found. 36 deleted, 1 wired up, 12 recorded. The deletions were mostly aliases and shims whose consumers never existed: PUBLIC_NAV_LINKS ("kept for backwards compatibility"), SITE_NAV_ITEMS ("kept as a named export for any legacy import"), BEACON_SETTINGS_PATH ("kept for runner fallback reads only"), ROBOT_ENTITY_TYPE ("used by tests" — no test used it), BOOK_ACTION_TYPE (a second copy of values ACTION_TYPE owns), and RESERVED_ACTION_PROPOSE_SOLON_CHANGE, reserved "so the name is stable when the flow lands" — a name is stabilised by having consumers. Two carry more weight. isRunnerRequest was a @deprecated legacy env-token auth path that "always maps to the default user and is not multi-tenant safe"; deleting it removes that credential check from the codebase. closeStaleAgentTurns is now called by the hourly reap-stale-runs janitor: its docblock promised agent_sessions "does not accumulate rows that look open forever", a guarantee nothing provided. Two bugs in the gate itself, both caught by mutation: - It indexed its own file, so every name in BASELINE and in the docblock's worked examples looked referenced. It reported "0 dead" over five that were, and closeStaleAgentTurns — an example in its own docblock — was invisible to it. - It counted prose as a reference. Excluding .md surfaced three more, including renderPromptBody, which docs/AUDIT_REPORT_2026-07-13.md had already named as dead two months ago. A report is read once; a gate is read on every push. OUTCOMES_MATCH_DB_SCHEMA is a compile-time drift assertion whose runtime value is inert — no reader is what a working assertion looks like. Ratcheting it would have pressured someone into deleting a real check, so INTENTIONALLY_UNREFERENCED is a separate category from debt, with an assertion that no name sits in both lists. All four assertions proven falsifiable by mutation on a copy: a new dead export fails, a revived BASELINE entry fails, a name in both lists fails, and removing the exemption makes the compile-time assertion surface. Recorded, not fixed — each with its consequence, three worth naming: - isAllowedTelegramTarget: sendTelegramMessage's docblock says the caller must run the self-only allowlist check, and none of the eight call sites does. What bounds the blast radius today is structural — every caller passes selfTelegramTarget(), so no attacker-chosen chat id is reachable. It must be wired the moment any flow lets a recipient be requested. - renderPromptBody: RunModal substitutes one variable via replaceAll("{{project_name}}", …), so every other {{var}} and every declared default reaches the agent as a literal placeholder. Fixing it means moving the function out of db/queries and changing what a run sends — its own change, not a deletion. - mailtoHref: reachChannels() returns {label, value} and builds no hrefs, so the People reach row is not clickable at all. verify green (all 13 steps, exit 0). Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
81bf2041be |
chore(billing): remove the Stripe rail, which was never configured anywhere (#508)
STRIPE_SECRET_KEY and the seven other STRIPE_* vars appear zero times outside
src/ and zero times in .env.example, so isStripeReady() could only ever return
false. Three API routes, a checkout route, a tier grid and a "Manage
subscription" button were all gated on it and permanently unreachable.
Confirmed empty in production before touching the schema:
select count(*) filter (where stripe_customer_id is not null),
count(*) filter (where stripe_subscription_id is not null),
count(*) from users;
→ 0 | 0 | 7
So this removes no data and, more to the point, changes nothing a user sees:
every code path already fell through to the branch below it.
WHAT STAYS. Plans are real and untouched. They are granted through the
OrangeCat/Bitcoin rail (/api/orangecat/entitlement -> recordOcBillingGrant),
with the expiry cron reverting a lapsed pass to free. The pricing CTA cascade
loses only its unreachable middle step: free -> TBA -> [stripe] -> BTC ->
start-free.
WHAT WAS ACTIVELY WRONG. Because isStripeReady() was false, the one part of
Billing that DID render was a notice telling the reader to "add
STRIPE_SECRET_KEY and price IDs" — an environment variable shown to a person
who does not deploy the app and could not act on it. That is the same mistake
NotificationsPill's comment already calls out. Billing now states the plan and
links to /pricing.
Removed: lib/stripe.ts, api/stripe/{checkout,portal,webhook}, api/checkout/
[plan], getUserByStripeCustomerId, two user columns (migration 0063), two
entries from the user-client-view redaction lists, the api/stripe/webhook entry
in proxy.ts's public matcher, the stripe npm dependency, and the smoke/auth
probes for routes that no longer exist.
BillingSettings drops "use client" — with the handlers gone it holds no state,
no effect and no search-param read.
Two mentions deliberately KEPT because they are not the rail: the placeholder
prose describing what a user might build ("Simple dashboard, automated
reminders, Stripe payments…") and the demo project's stack string.
pnpm run verify green. 28 files, 519 deletions.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
b5394c98fb |
fix(widget): a long name in "Name / email" threw the whole report away (#505)
Found by a code-health audit; these are the two findings that were verifiably
BREAKING something rather than merely untidy.
── The widget dropped reports ────────────────────────────────────────────────
/api/feedback validates with zod and, on ANY failure, returns the single string
"Invalid submission" naming no field. The widget renders that and the visitor's
report is gone.
Of the five string fields it sends, three were clamped to exactly the route's
`.max()` and two were not:
url .slice(0, 1000) matches max(1000) ✅
pageTitle .slice(0, 300) matches max(300) ✅
suggestion textarea maxLength = MAX_LEN 2000 ✅
contact (unclamped) server max(200) ✗
page (unclamped) server max(300) ✗
The contact <input> had no `maxLength` either, so a visitor pasting a signature
into "Name / email" — or anyone on a page with a very long pathname — lost
everything they had typed, with no field named and nothing logged. This is the
only surface strangers on other people's sites touch.
The author plainly knew the rule: MAX_SHOT_CHARS carries the comment "ingest
caps the data URL at 600k chars". It was applied 3 times of 5, which is what a
hand-mirrored constant does.
scripts/test/widget-server-caps-mirror.ts now reads the caps out of the zod
schema and asserts the widget clamps to the same numbers, so the two cannot
drift again. Mutation-proven: drop the contact clamp -> 8 passed, 1 failed.
── A tap target 16px under the floor ─────────────────────────────────────────
ProjectProvision's chip carried `ui-btn-chip gap-1.5 px-3 py-1.5 text-xs`.
`ui-btn-chip` is NOT in the coarse-pointer floor list in globals.css — it
reaches 44px through its own `py-3`. Overriding that to `py-1.5 text-xs`
without adding `ui-tap` produced roughly 28px on a phone, visibly shorter than
the seven identical sibling chips (ProjectBriefFill ×4, BusinessPlanSection,
ProjectDocSync) which all carry `ui-tap`.
audit:responsive reports zero undersized targets and is right to: this button
lives on /projects/[id], and the audit's page list has /projects but no detail
page. The gate is not wrong, its coverage is — worth knowing before trusting a
green run on a page it never opens.
pnpm run verify green.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
8f9001c308 |
fix(ops): retry fc-cron through the deploy-restart connection-refused window (#502)
check-runner-stall paged (fc-cron@check-runner-stall.service failed, curl exit 7 on 127.0.0.1:4002) because its *:30 tick landed inside the ~13s window fleetcrown-app.service documents on every deploy restart, where the port sits bound-but-refusing between the old process's SIGKILL and the new one's ready. The app was healthy again by the very next tick. fc-cron.sh now retries only on curl's connection-refused (exit 7) a few times before giving up, so a deploy landing on any *:15/*:30/*:45 cron minute no longer pages for an outage that self-resolves in seconds. Real HTTP failures still fail on the first try. Co-authored-by: Mao Nakamoto <maonakamoto@users.noreply.github.com> |
||
|
|
9017717127 |
feat(mobile): summary stats become one line, and the widget stops covering Loki (#496)
Two things, both measured rather than assumed. ── The stat cards ──────────────────────────────────────────────────────────── StatCard rendered a kicker, a 2xl number and a sub-line inside a padded card — about 130px — and three of them stacked two-up. /goals therefore spent ~280px of an 844px phone on "19 active · 24% avg progress · 23 total" before the first goal, and none of those figures is a decision. You scrolled past all of it to reach the list the page is named after. Below `sm` they are now one horizontally scrollable line of chips, value first. Nothing is dropped — label, value and sub all survive; the layout reorders with flex `order` rather than duplicating markup. From `sm` up, where height is free, it stays the card grid it always was. The chip strip is not a new invention: /today's SummaryBar already answers this exact job, so this borrows an idiom the app has proven instead of adding a second way to show the same thing. Lands on /goals, /money, /habits and /memory from one change. StatCard no longer builds on <Card>: Card hard-codes the padding and radius the chip shape would have to fight. Checked before trusting it, because this repo has a recorded Tailwind 4 trap about variants inside `@layer components`: the LIVE stylesheet already compiles `.ui-card-padding`'s sm:/md: variants to real `@media (min-width:40rem)` and `(min-width:48rem)` rules, so the pattern works in this build. ── The goal row ────────────────────────────────────────────────────────────── Four icon controls per goal — Loki, copy, archive, delete. `ui-hover-reveal` kept them out of the way on desktop, but a phone has no hover, so on the viewport with the least room all four were permanently visible next to the goal's own title. None of them is the action a person repeats (that is editing progress, inline in the card body), so all four move behind one RowActions trigger. The two prompt helpers gain optional `className`/`label` so they can render as words in a menu instead of a lone glyph among sentences. ── The feedback widget on /loki ────────────────────────────────────────────── Measured at 390px: the launcher's centre resolved to `textarea.ui-loki-composer-input`. It covered the box you type into, on the page whose whole purpose is typing into it. NOT a failure of the widget's avoidance logic, which is worth stating because the obvious fix would have been wrong: `INTERACTIVE` already matches `textarea` and the 260px shift cap was never reached. autoAvoid moved the launcher 164px up and correctly found a clear spot — then the composer reflowed under it when the conversation list loaded. The widget re-checks at two fixed moments after paint, not on layout change, so a late reflow wins. Fixing that properly means a ResizeObserver in a bundle that runs on other people's sites. So /loki joins /terminal in FEEDBACK_WIDGET_EXCLUDED_PREFIXES, for the reason already written there: the surface has its own composer. feedback-widget-reach.ts asserted /loki WAS reachable and duly failed. It now asserts the exclusion with the measurement behind it, so the change reads as a decision rather than a typo, plus a /lokis near-miss case. pnpm run verify green. Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
ee52eabfb7 |
refactor(email): move transport to @bitbaum/mail-kit (#495)
Replace the Resend SDK transport in src/lib/email.ts with the fleet's @bitbaum/mail-kit. Templates and the sendEmail/sendEmailFire signatures stay; the transport underneath is now sendMail (never throws — the awaitable sendEmail preserves its old throw-on-failure contract for callers). Sender SSOT moves from EMAIL_FROM to RESEND_FROM (mail-kit's env contract) with conventionalFrom(APP_NAME) as the fleet-default fallback; APP_EMAIL_FROM is gone from brand.ts and the env preflight now warns on missing RESEND_FROM. The email-canary cron probes via mailHealth() instead of a hand-rolled /domains fetch, and the digest cron passes an idempotency key so a retried tick cannot double-send. The resend dependency is removed. 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> |
||
|
|
87bac87e96 |
fix(activity): pin the time formatters, ending the React #418 on /activity (#494)
/activity threw away its hydrated tree on every viewport, in production only.
This was written off earlier as "intermittent, diminishing returns". It was
neither — it was two faults of the same kind, one of them rare enough to look
like noise.
MEASURED, on ONE page load: 1798 words server, 1798 words client, and every
clock differing by exactly two hours.
server Sent 10:18 Sent 09:54 Partial 04:00
client Sent 12:18 Sent 11:54 Partial 06:00
UTC on the box, Europe/Zurich in the browser. Five formatters in
activity-shared.ts called toLocaleTimeString/toLocaleDateString with no
`timeZone`, so they read the RUNTIME's zone — and their callers
(ActivityEventRow, EventStream, NeedsYouCard, ActivityTimeline) are
"use client", so they render in both processes.
Pinned to DEFAULT_TIMEZONE, which already exists as the app's SSOT. Pinning
beats the mounted-gate the greeting uses: these are PAST events, not "now", so
there is no reader-dependent answer to defer to and deferring would only trade
a wrong first paint for an empty one.
formatDayHeading carried the same fault in a two-hour window: it compared
`new Date(y, m-1, d)` against now.getFullYear()/getMonth()/getDate(), all
runtime-zone, so between 00:00 and 02:00 Zurich the box was still on yesterday
while the browser was already on today. THAT is why the failure presented as
intermittent — one run in three. It now compares calendar-date strings in a
fixed zone, and formats the fallback as UTC midnight rendered in UTC, because
a bucket key names a calendar day rather than an instant.
The first hypothesis was WRONG and is worth recording: the pulse's
"busiest: 20 at 09:21" label looked like the culprit, but ActivityPulse is a
server component and the client never re-renders it. Two measurement attempts
were wrong before one worked — a detached DOMParser document has no layout so
innerText collapsed the page to a single line, and rendering with JS disabled
skipped everything because React streams suspended content into `<div hidden>`
that only a script unhides. Both made the page look like it had no server
render at all.
The gate (scripts/test/activity-time-zone-stable.ts) runs the formatters in
three child processes — UTC, Europe/Zurich, Pacific/Honolulu — and compares
their output. Grepping the source for "timeZone" would pass a formatter pinned
to the WRONG zone and would say nothing about date arithmetic. Its fixture is
22:30 UTC deliberately: that is 00:30 the next day in Zurich, so a noon
fixture would pass on the broken code.
Mutation-proven: remove the pins → 4 of 5 fail, reporting 22:30 / 00:30 /
12:30 — the production symptom exactly; restore → 5/5. Picked up automatically
by test-unit's directory glob.
pnpm run verify green.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
a3dc681e0c |
fix(activity): show the ask, not the retrieval block wrapped around it (#492)
/activity exists to answer "what did I ask for?". Every row of the Needs-you
list on production answered:
asked: ## Relevant context from your other projects…
That is retrieval scaffolding, presented as the operator's own question.
The recovery machinery was already right. ENVELOPE_BLOCK_PATTERNS carried
## Background context from your other projects (inject-prompt.ts)
while the RAG block emits
## Relevant context from your other projects (retrieved)
(db/queries/knowledge-embeddings.ts)
Different heading, so the pattern never matched, so the block survived into
the preview. Nothing failed — the list's own comment predicts exactly this:
"a block that changes upstream stops matching". It did, and the degraded
behaviour was invisible because a noisy preview still renders.
A second hand-kept list checking the first would rot the same way, so
scripts/test/dispatch-headings-stripped.ts DISCOVERS the headings from the
pipeline source and tests behaviour: build a dispatch around each one, assert
the heading does not survive and the task does. It is picked up automatically
by test-unit's directory glob (134/134).
Getting that fixture right mattered twice: background blocks run to
end-of-input unless the "Project context & goals" sentinel follows them, and
the exit contract genuinely consumes to the end. The first version failed on
every heading for reasons unrelated to the bug.
Mutation-proven: drop the new pattern → 9 passed, 1 failed, naming that
heading; restore → 10/10.
Also on the pages themselves:
/people printed the name twice. The alias filter excluded an alias equal to
the WHOLE name, so a person stored as ["Manuel", "Riegner"] rendered
"Manuel Riegner" with "Manuel · Riegner" beneath it — the name again, split
up, dressed as extra information, on most of 2,749 rows. An alias whose every
word already appears in the name is now dropped.
Its "+ Details" button did not show details — clicking the card does that.
It opens the log form with channel/direction/summary, so it says "Log details".
/money's burn tile joined currencies with " + ": "50.00 CHF + 329.60 USD",
which wrapped mid-figure at 390px and claimed a sum that cannot exist without
an FX rate this page does not have. One line per currency. StatCard's `value`
widens to ReactNode; every existing caller passes a string and is unaffected.
pnpm run verify green.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
cf3d9ed52e |
fix(deploy): hand the VAPID public key to the build, so push can work at all (#490)
#488 stopped the hydration failure by rendering nothing until past the server render. It could not restore the feature: the browser still received an empty NEXT_PUBLIC_VAPID_PUBLIC_KEY, so subscribe() had no application server key and push notifications were dead in production regardless. The missing half was never in the code. deploy.yml's build step declared no `env:` at all, so every NEXT_PUBLIC_* was inlined empty while the box ran with this one set. Fixed by creating the repo variable and passing it to the build. A variable, not a secret: the value is compiled into the client bundle and handed to every browser that subscribes. Hiding it would be theatre, and a secret's log masking would only obscure the verification. Verified before trusting the value, because a wrong key fails silently at send time and this one gets baked into every future bundle: - decodes to 65 bytes, first byte 0x04 — a valid uncompressed P-256 point - the public key is the MATE of VAPID_PRIVATE_KEY on the box (derived the point from the private scalar and compared; no secret printed) - VAPID_SUBJECT is a valid mailto:/https: scheme One trap on the way: the box stores the value quote-wrapped (len 89 = 87 + 2). dotenv strips those when the server loads them, so runtime was fine — but copying it verbatim into the variable would have inlined literal quotes and produced a broken key that looks correct in every listing. The gate's KNOWN_GAPS entry is deleted rather than edited, so removing either the variable or the env: line now fails the check instead of silently killing push again. Mutation-proven both ways: line removed -> 4 passed, 1 failed naming the var; restored -> 5 passed, 0 failed. Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
bfaf7b67cc |
fix(shell): the React #418 on every authenticated page, and the gate for its class (#488)
A NEXT_PUBLIC_* value has TWO origins and nothing checked they agree: the SERVER reads it at RUNTIME, the BROWSER gets whatever was INLINED at BUILD time. deploy.yml's build step declares no `env:` at all, so the client bundle ships with every NEXT_PUBLIC_* empty while the box runs with NEXT_PUBLIC_VAPID_PUBLIC_KEY set. NotificationsPill returns null when `publicKeyMissing`. So the server said "configured, render the bell" and the client's first render said "not configured, render nothing" — React threw the tree away. Every authenticated page, production only. PROVEN, not inferred: server-rendered HTML 1 notifications button hydrated DOM 0 VAPID key in client chunks 0 of 17 (1.1MB scanned) /opt/fleetcrown/app/.env sets exactly one NEXT_PUBLIC_* — that key Six other hypotheses were tested and DISPROVED first, each by a discriminating test rather than a plausible story: the feedback widget (blocking widget.js leaves the error), the banner's localStorage (flag is null, both sides compute false), ThemeToggle (already mounted-guarded), AppShell (defers to an effect), HTML caching (no-store), and the server's UTC clock vs the browser's — that last one fit the evidence perfectly and was killed by forcing three browser timezones and getting one error in all three. THE FIX. Render nothing until past the server render, so the first render is unconditional whatever the environment says. Via useSyncExternalStore rather than mounted-in-an-effect, because BrandVersion already does it that way and react-hooks/set-state-in-effect bans the other. Verified against a local production build: the SSR HTML went from 1 notifications button to 0. This is defence, not the whole cure. While the key is missing from the bundle, push notifications are genuinely DEAD in prod — the browser sees an empty key, so subscribe() cannot run. Closing that needs a repo secret (none exists: `gh secret list` shows only HETZNER_SSH_KEY and RELEASES_REPO_TOKEN) plus an env: entry on the build step. That is George's to do; it is recorded in the gate rather than in a message that scrolls away. THE GATE. scripts/test/public-env-inlined.ts compares what src/ reads against what actually reaches the bundle — deploy.yml's build env AND next.config.ts's own `env:` block, because a checker that knows one mechanism and not the other cries wolf. It narrows to vars .env.example says a deployment SETS: one absent from both build and runtime cannot diverge, both sides just use the default. Both narrowings came from the check being wrong first — it initially flagged six vars including NEXT_PUBLIC_BUILD_SHA, which visibly renders in the footer. Mutation-proven: remove a recorded gap -> 5 passed, 1 failed, naming the var; restore -> 6/6. pnpm run verify passes (133/133 unit files, `✓ public-env-inlined`). Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
55a3c0e4e0 |
fix(ci): catch an unbumped desktop change on the PR, not on main (#486)
Today a dependabot bump turned main red and stopped the merge queue. The gate was right; its TIMING was racy, and the race is the whole bug. What happened, in order: #482 merges, mints fleet-runner-v0.8.16. #411 (dependabot, touches ONLY desktop/package-lock.json) had already run its CI while v0.8.15 was newest. Against v0.8.15 its base ALREADY read 0.8.16, so "version is ahead of released" held — CI PASSED. #411 merges. Newest tag is now v0.8.16, the only desktop change since it is that lockfile, and the identical check goes RED on main. Both evaluations were correct. The gap is between them, and everyone else pays: the sweep merges nothing onto a red base, so every unrelated PR stalls behind a bot's dependency bump. #483 failed CI on a diff that touched no desktop file. The existing question is cumulative — "has anything changed since the last tag" — and its answer moves when a tag is minted, i.e. for reasons outside the branch. So ask a second question that has no race in it: does the diff of THIS BRANCH touch desktop/, and if so does THIS BRANCH bump desktop/package.json? Decided entirely within the branch, identically before and after any tag appears. It fires on the PR — one blocked bot PR a human can see — instead of after the merge, where it is a red main and a stopped queue. On main itself the branch diff is empty and the rule does not apply; the cumulative check still guards there. Mutation-proven: desktop change, no bump -> exit 1, "this branch changes desktop/ but does not bump desktop/package.json", naming the file + bump, no changelog -> exit 1 on the pre-existing changelog rule (the two compose; a bump alone is still not publishable) neither -> passes, rule correctly silent This is the fix I would rather have than the automation I had offered — opening a bump PR after the fact repairs the outage; this prevents it. pnpm run verify passes. Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
5e4192e4d1 |
fix(control): stop offering back the prompts nobody reuses, and the clamp that never clamped (#482)
Found by using /control in a browser as a user, on a phone-width window, start to finish: pick a project, type a prompt, send it, follow the outcome. 1. "PASTE FROM HISTORY" WAS SHOWING THE OPPOSITE OF WHAT IT PROMISES The card offered back conversational asides — "you do it. open in browser and do it" — as reusable work. Not a rendering bug: those really were dispatches. The selection was wrong. Measured on prod, 30 days: 1859 distinct custom prompts, of which 1823 (98%) were sent exactly ONCE. The query ordered by recency, so it surfaced the three most recent one-offs — by definition the prompts least likely to be wanted again — while the genuinely reused ones sat unoffered: "continue" 115×, a git-diff review prompt 63×, "go ahead" 14×, "keep going" 8×. Requiring two uses cuts the pool from 1859 to 36 and leaves exactly what the feature is named for. Nothing is lost: Activity keeps every dispatch with a re-run control. One-offs just stop competing for space on the card. 2. THE CLAMP I SHIPPED IN #479 WAS INERT, AND I COULD NOT SEE IT `block ... line-clamp-2` computes to `display: block; -webkit-line-clamp: 2`. `-webkit-line-clamp` does nothing without `display: -webkit-box`, and Tailwind's `block` utility overrode it. It LOOKED fixed because an unclamped box just wraps — which reads fine until the sentence is long. Checked live in the browser: a 460-character next_step grew that box from 48px to 96px and pushed the composer, the thing you act with, off the bottom of the viewport. So my "it renders fully now" was measuring the ABSENCE of a clamp. Dropping `block` makes it work; three lines, not two, so a typical next_step (~256 chars) still reads in full and a pathological one is bounded and reachable (clicking loads the whole text into the composer). THE GATE: responsive-audit now flags a line-clamp that is declared but not enforced. It cannot test `display === "-webkit-box"` — Chrome reported `flow-root` for a clamp working correctly — so it tests BEHAVIOUR: an element declaring N lines that renders more than N. Run against live prod it says: "Suggested next (profile)…"[ui-link-subtle-button.block.line-clamp-2] declared 2 lines, renders 4 (display:block) naming the offending class. That is this exact bug, caught in shipped code. 3. A FAILURE MESSAGE THAT NAMED THE WRONG AGENT A real dispatch returned: "launched claude (pty) + injected, but the agent isn't generating yet … Retry, or switch the project agent away from grok if this repeats." One sentence naming the agent that ran and, as advice, one that did not — a literal left over from when grok was the default. `agent` was in scope; the auth branch above it interpolates it correctly. Gated in failure-message-pairing: a failure message that NAMES an agent must interpolate ${agent}. Stated that way rather than "no agent ids", because the auth message legitimately says `~/.claude/.credentials.json` and `claude setup-token` — a real path and a real command — and already names the right agent. The check joins `+` continuations so a message split across two lines is judged whole; per-line it got that one wrong. Mutation-proven: restoring the "grok" literal → 20 passed, 1 failed, naming the line. Restored → 21/21. pnpm run verify passes. Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
1647fe7987 |
fix(sweep): a test that rotted behind a wrong excuse, and a box spec off by 2x (#480)
Three follow-ups from sweeping the earlier findings. Two of the four I had
carried forward did NOT survive checking and are dropped: /api/control/dispatch
is a real route, so the docs referencing it are correct; and
scripts/test/push-notifications.ts exists. Verifying first is why this commit
is smaller than the list that prompted it.
1. THE TEST NOBODY RAN, FOR A REASON THAT WAS NEVER TRUE
scripts/test/push-notifications.ts read scripts/agent-hook-bridge.sh, which was
deleted on 2026-06-11 in
|
||
|
|
65dea6f303 |
chore: pnpm — the fleet has one package manager (#478)
* chore: pnpm — the fleet has one package manager - packageManager pnpm@11.25.0; lockfile via pnpm import, package-lock.json removed; npm "workspaces" replaced by pnpm-workspace.yaml packages (packages/agent), and bridge/ joins the workspace — one install, one lockfile, its own package-lock.json removed - npm "overrides" (fast-uri pin) moved to pnpm-workspace.yaml (pnpm ignores the npm-only field) - allowBuilds: better-sqlite3, node-pty, @sentry/cli, native toolchain, and the two git-hosted deps (@fleet/ai-forms, limitkit — pnpm wants the exact resolved spec, keys move with the pinned tags); temporary minimumReleaseAgeExclude for our own @bitbaum/ai-kit@0.6.2 - phantom deps declared: @auth/core (src/auth.ts augments @auth/core/jwt — TS2664 under pnpm's strict layout), dotenv, sharp (scripts) - CI/audit/deploy workflows: pnpm/action-setup@v6, store-dir pinned outside the action's bin dir, cache: pnpm, frozen-lockfile; deploy's separate `npm --prefix bridge ci` is covered by the workspace install; Next cache key hashes pnpm-lock.yaml; npm audit → pnpm audit - desktop-release: root install → pnpm; desktop/ itself STAYS an npm package (own package-lock.json, electron toolchain untouched) - husky: pre-push staleness gate now compares pnpm-lock.yaml against node_modules/.modules.yaml; hooks + scripts (deploy-hetzner, hetzner/deploy, install-app, doctor, smoke) converted to pnpm - check-deploy-ready fleet gate now recognizes pnpm verify/test lines too Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn * fix: prettier-format pnpm-workspace.yaml — format:check gates verify 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> |
||
|
|
60dac488b1 |
fix(control): a sentence you can read, and the check that noticed it (#479)
/control's "Suggested next" line carried `truncate` — one line, ellipsis. On
prod that rendered "Suggested next (profile): Conduct a 1-month baseline m…":
594 of its 644 pixels hidden at 390px, 432 at 1440. The remainder existed
only in the `title` tooltip, and a phone has no hover.
It is the card's one actionable sentence, and clicking it loads the text into
the composer — so the sentence IS the decision, and a tenth of a sentence is
not one. OutcomeStreak.tsx, in this same directory, documents having already
fixed this exact mistake for its glyph row. /activity has always clamped the
same "what's next" content to two lines (ActivityEventRow). This makes the
three agree: line-clamp-2.
Same class in the composer's status line, worse: it shared a row with four
icons and Send, leaving it 72px — measured at 0% shown at 320px and 14% at
390px. Shorter copy cannot fix that; no sentence fits 72px. It needed the
width, so below `sm` it wraps onto a row of its own (order-last w-full) and
from `sm` up it stays exactly as it was.
THE GATE, and why it is not a lint rule.
responsive-audit already looks for clipped text, and deliberately EXEMPTS
`text-overflow: ellipsis` as "a deliberate design choice". That exemption is
right for what it was written for — a project name in a narrow rail, a
filename, an id — and 76 files under src/components truncate exactly that way.
A rule banning `truncate`, or `truncate` beside a `title`, would fire on ~42
legitimate sites and be turned off within a week.
The distinction is prose, which a static rule cannot judge but a real viewport
can measure. So the check lives where the viewports are: flag an ellipsis only
when the text READS as a sentence (>=60 chars, >=8 spaces — an id has neither)
AND under half of it is visible (a chip losing its tail is fine; a line showing
its first eight words is not).
Proven by mutation, in one environment, with only the classNames differing:
- with `truncate` -> 2 findings ("40% shown, -552px", "22% shown, -402px")
- with the fix -> silent at 320 / 390 / 768 / 1440
and it flags none of the 76 legitimate truncations.
Verified against prod before the fix (2 findings at 320 and at 390, silent at
768/1440 where the line fits) and against a local server after it.
npm run verify passes.
Separately observed and NOT addressed here: /control logs a React #418
hydration mismatch at every viewport.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
1572e993e7 |
fix(control): the second wording of "no zellij", and a remedy nothing rendered (#477)
Two defects, one class, found by sweeping for the neighbours of #476. 1. `no zellij session found` fell through to RETRY. This is how the Fleet Runner desktop app words the condition that the cloud words as "no zellij session is running on the connected computer" — poller.ts:881, three lines from the `tab not found:` string fixed in #476. Only one of the pair had been taught to the classifier, so fixing that one left this one shipping a Retry that can never succeed. 2. FAILURE_REMEDY.START_TERMINAL had ZERO consumers in AttentionBar. So fixing (1) alone would have made things worse, not better: a correctly classified failure would render no action at all, leaving the row with nothing but Dismiss. A remedy nothing renders is a classification that silently does nothing. Also names FOCUS_TIMED_OUT_DESKTOP (`did not gain focus`). That one already reached the right answer — a focus race IS retryable — but by accident, via a default that happened to suit it. An accidental right answer is indistinguishable from a wrong one until the default changes. The gate is the point. scripts/test/failure-message-pairing.ts reads the literals poller.ts actually throws and asserts each is recognised by a NAMED phrase, then asserts every remedy the classifier can return is rendered by AttentionBar. Producer and matcher are two definitions of the same sentence in two independently-released codebases; counting instances was never going to work. Reword either side, or add a remedy with no UI, and this fails first. Proven by mutation, both halves: - drop the NO_TERMINAL_DESKTOP matcher -> 14 passed, 1 failed - drop the START_TERMINAL render branch -> 14 passed, 1 failed npm run verify passes; the test runs inside test:unit by directory glob, so it is live in CI without wiring. Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
0c932c2251 |
fix(control): a Retry button that could never work, reported through the widget (#476)
Filed from /control via the feedback widget — "what is this? can you fix?"
against an element reading:
focus_tab → fleetcrown failed: tab not found: fleetcrown … Retry
focus-failure.ts already exists to prevent exactly this. Its own note says a
Retry beside "tab not found" is a lie, because retrying re-issues an
identical command against a target that is identically absent. It also
predicts how the protection would break:
"a message and a classifier that each spell the same sentence
independently are two definitions that drift the first time someone
rewords the copy — and the drift is silent, since a misclassified
failure still renders a plausible button."
That is what happened, across a boundary the note did not consider. Two
codebases word the SAME condition differently:
cloud "no zellij tab with that name in any active session" → matched
desktop "tab not found: <name>" (desktop/src/main/poller.ts) → NOT matched
So focusing a project through a local Fleet Runner fell through to RETRY and
drew a button that could never succeed.
Fixed in the classifier rather than only in the desktop app, deliberately:
Fleet Runner is versioned and released independently, so every operator on
an older build would keep sending the old wording. A classifier that only
understands the newest client is one that lies about older ones.
Tests use the reported string verbatim — including the trailing "4m agoOpen
on ControlRetry" the element picker captured, since that is what actually
reaches the function — plus casing, precedence against NO_TERMINAL, and two
near-misses ("tab closed by user") that must stay retryable. Proven by
mutation: removing the new match fails the assertion.
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
|
||
|
|
34f6d27ea6 |
fix(ops): the box register follows revampit to evig, and conformance notices a unit that lost its guards (#475)
revampit was renamed to evig on the box on 2026-09-02 (/opt/revampit -> /opt/evig,
revampit-app -> evig-app). The app repo caught up. This repo — which holds the
box register and the tooling that watches it — did not, and two of the stale
references were load-bearing:
- verify.sh ran `systemctl is-active revampit-app` for a unit that no longer
exists (`inactive`, exit 4), so the full-fleet sweep was permanently FAIL
and never once checked the app that replaced it. A sweep that always fails
is a sweep nobody reads.
- uptime-sweep.sh watched revampit.orangecat.ch, which is now a Caddy `redir`
block — a static 308 the sweep counts as up. That entry answers "is Caddy
alive", not "is the app alive", and would have reported up through an evig
outage. Pointed at evig.orangecat.ch, it probes /api/health for real.
The rest is register hygiene with no live consequence: the push-deploy hook
installed a command at /home/g/dev/revampit/scripts/selfhost-deploy-revampit.sh
(neither path exists any more), and three runner sandboxes listed a
/opt/revampit that is gone while omitting the /opt/evig that replaced it.
The automation, because a fix that only repairs today is worth 1x:
runtime-conformance-audit.sh now asks whether an enabled *-app.service still
has its guardrails — a memory cap and an OnFailure. A rename moves the unit
file; it does NOT move the .service.d/ drop-ins beside it. evig-app ran for two
days with MemoryMax=infinity on a shared box and no failure alert because its
drop-ins were still in the old unit's directory, and nothing noticed, because
these drop-ins are box state that no repo describes. Every other app unit on
the box carries both, which is what makes an exception a finding rather than a
preference. The audit already runs every 6h and alerts per finding, so this
class now pages instead of waiting to be stumbled over.
Evidence, on the real box:
# after restoring evig-app's drop-ins by hand
$ sudo bash runtime-conformance-audit.sh
checked 26 app dirs on node 24.20.0
findings=0 unreadable=0
# negative control: move the drop-ins away again
FINDING|evig|unit has no memory cap (MemoryMax=infinity) on a shared box
FINDING|evig|unit has no OnFailure= — it can die without alerting anyone
$ bash scripts/hetzner/verify.sh
OK evig systemd=active local=200 public=200
... 23 checks, exit 0
`npm run verify` green: tsc clean, eslint 0 errors / 3 warnings, 130/130 unit
test files, 150 home tests, 66 uptime-sweep tests, all ops suites.
Claude-Session: https://claude.ai/code/session_01LmyE2aLaXKB2V7WA3XQprm
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
39aae9a651 |
fix(widget): don't offer a mic the site's policy forbids (#474)
Reported: "Microphone permission denied" on both FleetCrown and OrangeCat.
Measured in the browser rather than guessed:
orangecat.ch featurePolicyAllowsMic: false
permissionState: "denied" (not "prompt")
getUserMedia -> NotAllowedError
fleetcrown featurePolicyAllowsMic: true
permissionState: "prompt" (works)
Two different situations behind one error message. OrangeCat sends
`permissions-policy: camera=(), microphone=(), geolocation=()` from
next.config.js. `microphone=()` is an EMPTY allowlist — denied for every
origin including the site itself — so the browser never shows a prompt at
all. There is nothing the visitor can allow.
The bug is ours: navigator.mediaDevices.getUserMedia still EXISTS in that
state, so isVoiceSupported() passed and we drew a "Speak" button that could
only ever fail, then blamed the visitor's permissions for it.
isVoiceSupported now consults document.featurePolicy, so a policy-blocked
site simply never sees the button — the same progressive enhancement the
function already applied to a missing MediaRecorder or an insecure origin.
An unknown answer means ALLOWED, deliberately: featurePolicy is
non-standard and absent in some browsers, and hiding a working mic there
would be a worse failure than a click that fails with a readable message.
This is the half that is centrally fixable — one bundle, every customer
site, including sites we will never see. The other half is not, and cannot
be: Permissions-Policy is the host document's decision by design and no
script can override it. So the customer-facing docs now say plainly that
the mic needs `microphone=(self)`, what the symptom looks like, and that
everything else in the widget works regardless.
Pinned by four assertions in scripts/test/widget-voice.ts covering denied,
allowed, API-absent and API-throwing. Proven by mutation: making the check
always return true turns exactly the "denies the microphone" assertion red.
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
|
||
|
|
d97fd69db1 |
refactor(deps): ai-kit comes from npm — @bitbaum/ai-kit ^0.6.2 (#473)
The package is now published to the npm registry as @bitbaum/ai-kit (npm's typosquat guard blocked the bare name "ai-kit", hence the scope; ai-kit PR #25 documents the rename — content is identical to the github:bitbaum/ai-kit#v0.6.2 tag). The git pin is retired: the lockfile no longer records the writer's ssh transport and npm-major-specific resolution for this dependency, so the whole lockfile-writer trap class dies with it. All imports move from 'ai-kit' / 'ai-kit/grounding' to '@bitbaum/ai-kit' / '@bitbaum/ai-kit/grounding'. 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> |
||
|
|
46c21c22d4 |
feat(feedback): FleetCrown users can finally report bugs in FleetCrown (#472)
Asked directly: where is the feedback widget on FleetCrown itself, and how
does a user give feedback about the site they are using? Measured on the
live app — feedbackWidgetPresent: false, no widget script loaded at all.
The only thing in the corner is the Loki assistant button.
The widget was scoped to eleven public marketing routes by an allowlist
whose comment gave two reasons. Both were checked:
"the FAB would collide with the app shell's mobile nav"
True when written, and fixed earlier today. The widget now measures its
corner and steps aside — rectangle matching for the desktop Loki FAB
(56px at bottom:28, which the feedback FAB overlapped exactly), and an
interactive hit-test below 480px for the mobile nav, which is inset-x-3
and therefore too wide for the rectangle scan to treat as an obstacle.
"in-app feedback already has Loki"
Not true. insertSiteFeedback has exactly one caller — the widget's
ingest route — and the word "feedback" does not appear in loki-core.ts.
Telling the assistant "this button is broken" produces no site_feedback
row, nothing in the triage inbox, nothing dispatchable. A signed-in
user's only option was to tell the operator out of band.
So the rule is inverted: render everywhere EXCEPT a short list, each entry
carrying its reason — /terminal (a FAB over live PTY output covers what you
are reading), the auth routes (you are not in the product yet), and
/docs/feedback-widget (a launcher on the page documenting launchers is an
unanswerable "is this yours or the demo's?").
An allowlist meant every new page shipped with no way to report a bug on
it, and nobody noticed, because a missing feedback channel is invisible
exactly the way the problems it would have caught are.
PublicFeedbackWidget is now DogfoodFeedbackWidget: it is no longer public-
only, and a name that says otherwise is the kind of stale label this page
already had too much of.
Pinned by scripts/test/feedback-widget-reach.ts (42 assertions): every app
surface reachable, public ones still reachable, exclusions excluded
including nested paths, near-misses like /terminals and /settings NOT
swallowed by prefix matching, the widget mounted from the root layout so
new pages inherit it, and loki-core still unable to file feedback — the
premise that justified the old scoping.
Proven by mutation: restoring a public-only allowlist turns 20 assertions
red, including every app surface.
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
|
||
|
|
e654e8baed |
fix(projects): one element per anchor — tab panels own the hash (#471)
Left over from the tab conversion. The sections had ids from when they were
scroll anchors (`id="feedback"`, `id="settings"`, ...), and the new panels
took ids of their own — so both existed for the same concept: a panel
`panel-feedback` wrapping a section still called `feedback`.
That is not cosmetic. Every panel stays mounted, because they hold unsaved
drafts and poll while work is in flight. So loading /projects/<id>#feedback
handed the browser a real element to scroll to that was inside a HIDDEN
panel — native anchor behaviour racing the tab logic over the same name.
ControlInbox and FeedbackItemRow both link exactly that way, so it is the
common path, not an edge case.
The panel is the anchor now: `id={tab.id}`, `aria-controls={tab.id}`,
`scroll-mt-28` to clear the sticky tab bar. The six nested ids are gone.
What the browser scrolls to is what becomes visible.
Pinned by scripts/test/project-tab-anchors.ts rather than left to review:
it reads the tab ids out of ProjectWorkspaceView, asserts the panel uses
them, asserts no component under components/projects re-declares one as an
element id, and asserts ControlInbox still deep-links to #feedback — the
link that makes the invariant matter in the first place.
Proven by mutation: reintroducing id="feedback" on the section turns
exactly that one assertion red.
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
|