* fix(system): box capacity specs must not wrap under the status word
Caught rendering prod /system at 320px: the upgrade-target row was a single
baseline-aligned flex row, so the spec text wrapped beneath the "blocked"
badge — "…160" on one line, "GB disk" orphaned on the next, reading as two
unrelated fragments.
Narrow screens now put the spec line on its own full-width row (order-3 +
w-full) with the status pushed right beside the type name; sm+ keeps the
original single-line layout. Layout utilities only — no new tokens.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(cd): auto-merged PRs must actually reach the box
Three PRs merged onto a green main today and none of them deployed. The
re-arm looked healthy because CI itself ran — but GitHub does not emit a
`workflow_run` event for a run that GITHUB_TOKEN started, so Deploy never
chained off the dispatched CI. Every auto-merged commit was landing
merged-but-not-live, silently. Only #164 shipped, because a human token
pushed it.
A chain cannot fix this, because the link GitHub refuses to create is the
chain itself. So deployment becomes a reconciler: each sweep compares main's
tip against the last successful Deploy and dispatches deploy.yml directly
when they differ. Self-healing by construction — a deploy that never fired,
or fired and failed, is retried next sweep instead of needing a human to
notice. It only ever runs against a tip whose own CI is green, which the
guard above it already established, and it stands down while a deploy is in
flight.
deploy.yml gains workflow_dispatch (and an if/checkout that handle both
entry points — `ref:` must not fall through to an empty string, which would
silently ship the default branch).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Found by opening HamsterCheek on prod. The page said "No goals are linked
to this project" and the kickoff hero offered to plan the milestones —
for a project that has had five milestones in the database since 15:05
on 2026-08-04.
getProjectDetail substitutes `linkedGoals: []` whenever the private zone
is PIN-locked. Nothing downstream can tell that apart from a project that
genuinely has no roadmap, so:
- the Plan section stated a falsehood,
- missingKickoffSetup planned the "milestones" step, and one press of
"Make it happen" would have generated a SECOND roadmap on top of the
first, and
- a kickoff dispatch would have briefed the agent with no roadmap and
aimed it at "first working, runnable state" — rebuilding milestone one
for a project that is two milestones in.
Empty and withheld are different facts, so they get different values:
getProjectDetail now returns `goalsLocked` alongside `linkedGoals`. The
plan step is only planned when goals are genuinely absent, the Plan
section says they are hidden and links to /unlock, and a kickoff dispatch
refuses rather than briefing an agent from a roadmap it cannot see.
Every other consumer of isPrivateZoneLocked in this repo already renders
an explicit locked state (LockedZoneBanner, PrivateZoneDataGate, the
Today cards). This was the one place that silently faked the data.
npm run verify green: project-kickoff 63/63, project-dispatch-prompt
32/32, 150 home tests, tsc clean, 0 lint errors.
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Forms were the worst part of the app: every field typed by hand, and no
way to say "call it Sentinel instead" once something was filled in.
Adopts @fleet/ai-forms (new shared package, headless so this repo keeps
its own ui-* styling) and wires it through the pieces that already exist:
- src/config/ai-forms.ts is the SSOT for what the assistant may touch.
Option lists derive from the constants that already define them; ids
and ownership columns are aiExcluded, so the model never sees or
writes them. The registry lives server-side, so a client names a form
and never its fields.
- One route, /api/ai/form-assist, serves every form and never changes
when a form is added. It passes this repo's own callGroqText, so the
package owns no keys, models, or fallback policy.
- ModalForm gained one optional `assist` prop, so goal / project /
person / habit / subscription each got assistance by passing a value.
Those forms got shorter: a useState per field collapses into one store
that the user and the assistant both write to, which is what makes a
follow-up edit possible at all.
- Every AI edit is reversible (Undo) and visible (an AI marker on the
fields it wrote).
The floating Loki assistant now fills the open form instead of narrating
which fields to type in, and receives a rendered-page excerpt with an
explicit rule to admit when something is not in it. It also renders
above modals — the one moment it can fill a form was the one moment it
sat behind one.
Verified in the browser against the live model: filled a project from a
sentence, then "call it Sentinel instead, and mention it runs every
morning at 7" renamed it and amended the description; Undo restored the
prior values exactly; the corner chat filled the same form; pageContext
carried 1646 chars of real page text.
Co-authored-by: Mao Nakamoto <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nobody is in the merge loop. The owner does not review PRs, and background-job
agent sessions are barred from merging by hand — so a verified, ready change
had no way to reach main without a manual step that nobody wants to take.
Move the policy into the repo, where it is visible, revocable, and applies
uniformly to every PR: a non-draft PR with every check green and no hold label
gets squash-merged, then CI is dispatched on main so Deploy ships it.
Two design points that are load-bearing, ported from OrangeCat's live run:
- One PR per sweep, only onto a green main. A PR's checks prove it against the
main it branched from, not against the other queued PRs — batching would put
an untested combination on main.
- Explicit `gh workflow run ci.yml --ref main` after a merge. A push made with
the default GITHUB_TOKEN does not trigger workflows, and Deploy chains off CI
via workflow_run, so without it every automated merge lands and silently
never deploys. ci.yml gains workflow_dispatch for exactly this.
Mergeability is polled rather than read once: GitHub computes it lazily and
invalidates it whenever the base moves, so the fast path always sees UNKNOWN
on its first look. Cancelled checks are re-run rather than read as failures —
ci.yml uses cancel-in-progress, so an unrelated push can strand a PR forever.
Hold work back with a draft PR or a hold label. Corollary, now documented in
CLAUDE.md: never open a non-draft PR you would not want deployed.
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Four fixes to the box's self-monitoring, all root-caused rather than papered over.
**The 40-alert storm** was a shell return-code trap, not an incident: `alert_transition`
ended with `[ test ] && cmd`, exporting the test's result as the function's return
code, so `cmd && A || B` ran the recovery branch after a *successful* alert. Every
tick emitted DISK + RECOVERED and the state file never advanced. Now returns 0
unconditionally, with hysteresis (bad >85%, ok <80%) so the disk can't flap.
**The memory check could never fire** — `read` binds all trailing fields to the last
variable, so the parsed values were garbage. Dead since it was written. Rewritten with
awk against the real `free -m` field layout.
**The disk keeps filling** because of dev checkouts, not apps: ~13 repos under
`/home/ubuntu/dev` × ~1GB node_modules ≈ 12GB, growing ~1GB per repo added. All
deployed apps together are 190MB. New hourly `disk-gc` no-ops below 80% and reclaims
to 70% in cost order (caches → npm → releases beyond 2 → node_modules of repos idle
≥14d, coldest first), skipping anything with a live process and refusing paths outside
its root. Freed 3.8GB on first run; box 86% → 76%.
**Hetzner upgrade capacity is now visible.** The poller was already alerting on
Telegram but wrote nothing anyone could see; it now emits state that `/system` renders
as a Box capacity card. Every spec comes from the Hetzner API — bitbaum is a cx33
(4/8/80); cx43 doubles the disk to 160GB and is the real fix for the disk problem.
33 shell tests cover the logic that ships in the heredocs (extracted from the payload,
not a drifting copy), wired into `verify` via `npm run test:ops`.
Two failures found by watching the "Make it happen" button actually run on
HamsterCheek, both repeats of classes already fixed once.
1. The agent built the whole first milestone — schema, migration, map
picker, photo upload, tests, `npm run verify` green — and left every
line of it uncommitted. Its session ended and the work sat in
`git status` for 13 hours; from FleetCrown the project looked untouched.
The prompt did say "and commit it", but only inside an "if the
repository is empty" clause, and no dispatch kind ever said *push*.
`dispatchClosing()` now appends "commit on a branch, push it, and open
a PR" to every kind, and a test asserts it across PROJECT_DISPATCH_KINDS
so a new kind cannot skip it.
2. `attrs.x?.trim()` reads as "the value, if any" but returns "Unknown".
PR #160 fixed the four sites it found; there were 17. Swept all of them
through hasAnswer() / the new answer(), including the one that briefed
agents with "STACK: Unknown".
Prompt composition moved out of route.ts into lib/project-dispatch-prompt:
a route file cannot export anything but its handlers, which is why the
prompts — the actual product of a dispatch — had no tests. The route is
now thin, per the repo's own API-layer rule.
The gate, so this is the last time: an eslint no-restricted-syntax rule
bans `.trim()` on a project attribute in all three shapes (attrs.x,
attrs["x"], dossier.detail.attrs.x), verified against a canary file.
npm run verify green: 49 unit files (project-dispatch-prompt 30/30,
project-kickoff 58/58), 150 home tests, tsc clean, 0 lint errors.
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The kickoff hero rendered its editor only when the description was under 10
characters. HamsterCheek's was one sentence — over the bar — so the editor was
hidden and that sentence silently became the entire brief, with no way to
improve it on the page whose whole job is to run on it. Its real brief had to
be written straight to the database, which is the opposite of the cognitive
load this card was built to remove.
Everything the button produces is a function of this text: the profile, the
milestones, and the agent's first prompt. A one-sentence brief is exactly why
the extractor had no stack to infer and wrote "Unknown" (#160). So the text
belongs in front of the person, seeded with the current description and
editable, not behind a length check.
Adds an advisory — not a gate — when the brief clears the floor but is under
~2 sentences: it still runs, it just says the results can only be as specific
as the input. isThinBrief lives in the same SSOT module as the rest of the
plan, and a test pins that a thin brief is flagged and still startable.
Verified: 47/47 project-kickoff, 48/48 unit files, 150 home tests, tsc + lint
clean.
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The run-grader reads a handoff against the project's definition_of_done and
downgrades to `partial` when the bar is not evidenced. It sees only what the
agent wrote — so a bar phrased as a property of the FINISHED PRODUCT can never
be met by one turn, no matter how good the work was.
On 2026-08-04 that was 10 of 19 projects ("outcomes are tracked to improve
future recommendations", "money is not a float", one that literally began "Not
explicitly defined"). The fleet closed 26 partial / 10 timeout / 3 success over
seven days and it read like an agent-quality problem. It was a bar problem.
The bars themselves are rewritten in the DB, delegating to each repo's own
`verify`. This is the part that stops them coming back:
- the brief-extraction prompt taught the vague phrasing — its example was
"tsc + lint clean, tests pass, deploys green" with no rule against describing
the product. It now demands one-turn, handoff-checkable actions and names the
three real bars that failed as counter-examples.
- `isCheckableDoneBar` — present is no longer the same as usable. The health
check fails a bar with no runnable action in it and says why, so an
ungradeable bar shows up on the project card instead of silently costing
every run.
- the GoalEditor placeholder and label match the same standard.
Deliberately a keyword heuristic, not an LLM call: it renders on every project
card, and catching "money is not a float" cheaply beats a perfect judgment
nobody can afford to run.
Covered in scripts/test/dod-gate.ts with the five real ungradeable bars and the
four real replacements, plus a case through computeProjectHealth.
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Found while checking why HamsterCheek still looked cold after the kickoff
button shipped. Its profile held `stack: "Unknown"` and `competitors:
"Unknown"` — written by the extractor, which is asked for 17 named fields but
only told "omit if unknown" on three of them. So it answers the rest, and a
non-answer becomes a stored value.
That string is truthy, and four separate places asked "is this filled?" with a
truthiness check, so all four were wrong at once:
- health scored a point for a field that says nothing;
- the context header claimed a core field complete;
- the kickoff planner SKIPPED the profile step for a project whose profile
was not filled in — the one project the button exists for;
- and the kickoff prompt would have briefed the agent with "STACK: Unknown".
The repo already names this class one layer up (PLACEHOLDER_DESCRIPTIONS /
cleanDescription, for the import stub). This is the second instance, so it gets
the shared predicate rather than a fourth ad-hoc check: `hasAnswer()` beside it,
now used by every presence test. Also dropped at the source in clampFields, so
the data stays honest without trusting any prompt wording — and the two rows
already in prod are deleted.
Verified: 40/40 project-kickoff (incl. the live HamsterCheek case), 48/48 unit
files, 150 home tests, tsc + lint clean.
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* feat(projects): one "Make it happen" button that starts a project
Starting a project meant finding four controls and knowing their order:
AI profile fill (a chip in Context), milestone generation (a second chip
inside that chip's drawer), repo provisioning (inside a collapsed
"Project settings" details), and dispatch (a link to another page). Every
piece already worked. Only the composition was missing, so a person with
an idea and a paragraph describing it faced eight empty fields, a "Set
the next action", an unset completion contract, and a "dispatch one from
Control" dead end.
ProjectKickoff runs those four in order from the description already
written, reporting each step as it lands so a partial failure still says
exactly what got done. lib/project-kickoff is the SSOT for the plan and
is what decides whether the hero renders, so the button can never do more
or less than the page claims.
- kickoff dispatch kind: briefs the agent with the profile + roadmap and
targets milestone 1, scoped to one run
- provision accepts template "auto", inferred from the project's stack —
a cold start that stops to ask "which starter?" has already lost
- linked goals break progress ties by creation, so a fresh roadmap's
"milestone 1" is reproducibly milestone 1
- template list existed three times (zod enum, picker, registry); light
metadata now lives in config/project-templates and the seeded registry
derives from it
- 30 assertions covering the plan, the render contract, and inference
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(test): pin autopilot-eligibility to its frozen clock
The `blocked` case called evaluateScheduledDispatch without `nowMs`, so its
one-minute-old fixture was aged against the real wall clock instead of the
NOW the whole file is written against. It went green on 2026-08-02 and started
failing for everyone 24h later, when that fixture crossed
BLOCKED_RECHECK_TTL_MS and the block correctly decayed to dispatchable — a
time bomb in the test, not a regression in the gate.
Default nowMs in one wrapper every case now goes through, so no future case
can forget it, and give the SSOT property check a single shared opts object:
"identical facts" has to include the clock, or it compares two different
questions.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(projects): kickoff reports what the dispatch actually did
Self-review catch. injectPrompt answers 200 with `ok: true` in two cases where
no agent is working: it REFUSED because the user was mid-keystroke in the target
tab (`blocked: user-typing`), and it queued a command with no runner connected
to collect it (`warning: runner-offline`). Both are flagged deliberately —
inject-core's own comment says it fails loud "so the UI can warn instead of
pretending it's running" — and the card reported both as "agent working".
A card whose entire justification is honest per-step reporting must not be the
thing that launders those. Refused now shows as failed, which also swaps the
useless "Watch it work" for the "Try again" that would fix it; queued says it is
queued.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(desktop): publish every platform again, and ship a usable Linux icon
Three defects, one shared cause: a release step that could fail or be
skipped without anyone noticing.
1. Releases stopped shipping macOS and Windows after v0.8.6.
1d16150 pointed electron-builder's `publish` at fleetcrown-releases while
CI still handed it the default GITHUB_TOKEN, which has no write access
there — so `--publish always` 403'd and the tagged matrix died. 0.8.7,
0.8.8 and 0.8.9 were cut by hand from a Linux box instead, leaving
macOS and Windows users three versions behind with no way forward.
The build job now never publishes; it only uploads artifacts. A new
`mirror` job assembles the release from those artifacts and pushes it to
fleetcrown-releases with RELEASES_REPO_TOKEN, under the fleet-runner-v*
tag the marketing URLs already resolve to. `needs: build` means a partial
matrix can never ship, and if-no-files-found is now `error`, so a silently
empty macOS or Windows artifact fails the run instead of quietly
producing another Linux-only release.
It reuses scripts/mirror-desktop-release.sh — the step that was supposed
to be run by hand after every release, and wasn't. One implementation of
"how a release is assembled", now actually executed.
2. The Linux launcher icon was blank on KDE.
`linux.icon` pointed at a single 1024x1024 png, which electron-builder
hands to fpm verbatim: it installed exactly one file, into
hicolor/1024x1024 — a bucket no panel looks in at 32px. Now a directory
of nine sizes, rasterized from the SVG SSOT at each size rather than
downscaled, so the 16px glyph stays legible.
Verified: the .deb goes from 1 icon entry to 9 (16 through 1024).
3. That class of bug can no longer ship.
generate-tray-icon.mjs already guarded the three committed brand PNGs;
it now guards every icon size too, and fails with the exact fix command.
Deleting one size fails the build instead of silently producing a
blank-icon installer.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(test): pin the clock in autopilot-eligibility so it stops grading itself against today
The suite defines `NOW = 2026-08-02T12:00:00Z` and builds every fixture
relative to it, but `nowMs` was an optional per-call argument and 8 of the 14
calls omitted it — those read `Date.now()` instead. So a fixture written as
"one minute old" was one minute old only while the wall clock sat near NOW.
Two days later it is two days old, the staleness paths
(WORKING_CLAIM_TTL_MS / BLOCKED_RECHECK_TTL_MS) fire, and assertions that
have nothing to do with time start failing. It went red on 2026-08-04 with no
code change behind it, blocking every push via the pre-push hook.
The parity check had the same flaw in sharper form: it asserts the scheduler
and the Control page "reach identical verdicts from identical facts" while
pinning the scheduler's clock and letting Control read the real one. The
clock IS one of those facts, so it was manufacturing a divergence that said
nothing about the SSOT property under test.
Both paths now go through helpers that inject `nowMs: NOW` by default —
`dispatchAt()` and `gatesAt()` — with an explicit `nowMs` still overriding
for the cases that are genuinely about elapsed time. Fixing the 8 call sites
individually would have left the next added test free to forget again; making
the pinned clock the default removes the option.
Verified by moving NOW to 2020-01-15: all 14 cases still pass, so the suite
no longer depends on when it runs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The gate excluded only the CURRENT deploy run. A retry lands on the same
SHA as the failure it is retrying, so the earlier deploy run was still
counted — the gate read its own past failure as a red CI and the second
attempt could never pass. solon was permanently unreachable this way.
Exclude the deploy workflow by path, so every run of it is ignored, and
derive the path from GITHUB_WORKFLOW_REF rather than hardcoding a name.
Verified against solon's blocked SHA: CI FAILED (2) -> CI green (1).
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
solon and reparaturbonus-zh both refused to deploy commits whose verify
was green, because Dependabot's dependency-graph updater had failed on the
same SHA and the gate counted it as CI. A failed dependency update is not
a statement about whether the code works.
Filtering by app slug does not separate them — Dependabot runs under
github-actions too. The discriminator is the workflow path: real CI lives
in .github/workflows/, Dependabot's updater reports as
dynamic/dependabot/dependabot-updates. So count workflow runs, filtered to
repo workflows, instead of every check run on the commit. Third-party
check apps (Snyk) that sit pending forever stop deadlocking the gate too.
Self-exclusion moves from check_suite_id to the run id, which is what the
workflow-runs API keys on.
Verified against solon's blocked SHA: CI FAILED (3) -> CI green (1).
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Token accounting (#133) shipped, ran a full day, and wrote ZERO rows — no
usage_detail, no tokens, no cost, across 15 runs.
A dispatch carries the founder's LAPTOP path (`/home/g/dev/solon`). On the box
that path does not exist, so `launchAgentPty` resolves a box-local clone via
ensureBoxWorkspace — but it resolved it PRIVATELY: the effective directory never
escaped the function. Everything else in the runner kept using the unresolved
path, including the two places that look up `~/.claude/projects/<slug-of-dir>`:
- the usage reporter tracked `-home-g-dev-solon`, a transcript directory that
cannot exist on the box, so `collectClaudeUsage` returned null and every
tick skipped it — silently, forever;
- `detectAuthFailure` read the same missing directory, so dead box
credentials were undetectable on the very runner whose two silent outages
(2026-07-02/03) motivated writing that canary.
The fix is to stop having two answers to "where does this project live":
box-workspace-path.ts derives it once, box-workspace.ts uses it for cloning,
and the poller uses it for both transcript lookups. Pure (fs/os/path only) so
the poller can import it statically without pulling @/db into the desktop
bundle — the reason box-workspace.ts is dynamically imported in the first place.
On the laptop it is the identity function.
Also: the no-transcript branch now warns ONCE per run. Its silence is the whole
reason this went a day unnoticed — a metering path that fails quietly is
indistinguishable from a fleet that spent nothing.
7 tests, incl. the real production dispatch shape. Unblocks #136, whose start
gate waits on metered runs that could never arrive.
Closes#145
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Deploys only ever ran from a local pre-push hook, so anything merged on
GitHub never reached the box — aoz-housing served a five-month-old build
with green CI and correct main the whole time.
selfhost-deploy.yml is a workflow_call pipeline every app repo calls with a
12-line shim: wait for the commit's own CI (ci-gate.sh), pull the runtime
env from the box, then run the existing deploy.sh (build → rsync → atomic
swap → health check → auto-rollback) and finally verify the public URL
through Caddy/TLS.
- deploy.sh: REPO_OVERRIDE re-points the checkout path only; apps.conf
stays SSOT for port/domain/app_dir/db.
- ci-gate.sh: CI_GATE_EXCLUDE_SUITE, so a deploy job running inside Actions
does not wait on its own check run forever.
- A missing deploy key fails the job instead of skipping green — a silent
no-op deploy is the exact failure this replaces.
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Regression exposed by #142, which asked agents to write down checks they could
not run instead of staying silent. They did — and the honesty was punished.
solon's handoff read:
tests: no suite — manually verified end-to-end with a headless browser …
the vote POST still 500s because no Postgres is provisioned here, and
that failure occurs before signature verification runs
`hasFailedTests` sniffed the WHOLE field for a bare "fail", matched "failure"
inside the explanation, and demoted a healthy run to `partial`. Worse, it did so
BEFORE the definition-of-done gate, which only ever grades a SUCCESS close — so
the cross-model judge never ran at all and the run carried no verdict. Rewarding
a truthful handoff with a misread teaches agents to write less, which is exactly
backwards for a system whose verifier can only see what they wrote.
- The bare-word sniff now reads only the VERDICT clause (before the first
em-dash or sentence break), never the reasoning that follows.
- "no suite" / "no tests" is an absence, not a failure — whether an absent suite
clears the project's bar is the DoD judge's call, not a regex's.
- Explicit counts ("3/5 pass", "3 failed") still win from anywhere in the field,
because a number is unambiguous evidence wherever it sits.
4 tests, one of them the verbatim handoff that produced the misread.
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
When a project declares a definition_of_done, a DIFFERENT model reads the
handoff against that bar and downgrades the run to `partial` when it isn't
evidenced. The worker was never told this.
The bar reached the agent only as one line of background in the project-context
block — among Mission, Vision, Stack, Conventions — so agents did real work,
wrote `status: ready`, and were graded against a contract they had never been
shown. Two clean verification runs closed `partial` on literally "No evidence
that tests were run and passed".
The judge sees ONLY the handoff, so an unevidenced claim is indistinguishable
from work not done — which is precisely the Ralph-Wiggum property the gate
exists to defend. The answer is therefore to state the contract to the worker,
never to soften the judge: softening it would make every run "succeed" and
`success` would stop meaning anything.
- HANDOFF_CLOSE_CONTRACT, interpolated into both loops that close runs
(next_best, test_and_fix): run the checks the bar names, record the real
result in tests:/tsc:/lint:/health:/commit:.
- An impossible check must be written down verbatim ("no suite", "deploy not
configured") rather than omitted. Silence reads as skipped; a stated
impossibility is information — it names the next piece of work.
- 5 tests pin the contract into the prompts an autopilot loop actually fires,
so a future prompt edit can't silently re-open the gap.
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Gating `blocked` projects (#137) was right, but incomplete: a blocked project is
gated, and a gated agent can never notice that the world moved. Left alone that
is a deadlock — the project waits forever on something that may already have
happened.
It already had. BOTH blockers in the fleet on 2026-08-02 were stale:
- truthseeker: "GROQ_API_KEY expired — core feature 100% down". The key had
been rotated; only the runner's copy was stale. Three consecutive nightly
cycles did nothing but re-surface a dead blocker.
- surf-your-life: "autopilot stays off until a human merges PR #7". PR #7 was
merged, and nothing was ever going to tell the project.
Two stale blockers in one day is a class, not a coincidence, so this encodes the
rule rather than clearing the instances: a block is trusted for a day, then the
project earns ONE dispatch whose job is to re-check it. Still blocked? The agent
writes `blocked` again with a fresh timestamp and the clock restarts —
self-limiting at one run per day, a cheap price for never again spending weeks
waiting on something that already resolved.
`working` keeps its much shorter clock: it claims a live process, not a fact
about the world. A genuinely running agent is never interrupted on either path,
however old its claim.
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
`check:design` is part of `npm run verify`, so CI has been calling it on every
push since it landed. It has never scanned anything. ripgrep is not installed
on the GitHub runner, so each `if rg ...` exited 127, bash read that as "no
match", and the script printed "design-system check: ok". Confirmed in the run
log: six `rg: command not found` lines followed by ok.
A gate that cannot distinguish "tool missing" from "clean" is worse than no
gate — it manufactures confidence. Three changes so it cannot happen again:
1. Hard-fail up front when rg is absent, with a message saying the gate
scanned nothing.
2. Treat rg's exit status honestly: 0 = violations, 1 = clean, anything else
(bad glob, unreadable path) = ERROR, not a pass. The old `if rg` collapsed
all non-zero exits into "clean".
3. Report the number of checks actually run, so "0 checks run" is visibly
different from "0 violations found".
CI installs ripgrep so the gate can do its job.
Good news from finally running it: the codebase is clean — 6 checks, 0
violations. Nothing accumulated while the gate was blind; it just could not
have caught anything. Verified both directions locally: passes with rg present
("ok (6 checks run)"), exits 1 with the command stubbed out.
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
The DoD stop-gate supports a turn cap (`goal_max_turns`) that stops re-looping
an unmet goal and escalates. No project has ever set it, and unset meant "loop
until met" — so every goal-mode project looped forever.
That is worse than it sounds. `partial` is not a failing outcome, so an endless
partial streak is invisible to BOTH the failure brake and the escalation ladder.
datacat re-closed `partial` a dozen times against the same gap ("client-side Zod
validation still missing") and nothing ever told a human. An unbounded goal loop
is indistinguishable from a stuck one.
- DEFAULT_GOAL_MAX_TURNS, SSOT'd to the ladder's human rung: a project gets the
same number of tries here as anywhere else before a human is brought in.
Explicit `goal_max_turns=0` remains the opt-in escape hatch for a genuinely
unbounded goal — deliberate, rather than what you get by saying nothing.
- The cap now REPORTS. applyDoDGate deliberately keeps the success outcome so
the continue-loop halts, which means the ledger alone would show a success and
nobody would learn the goal had been abandoned short of its bar. A cap that
only writes itself into `next` is a silent cap; it now raises an alert and a
push naming the remaining gap, exactly like the ladder's human rung.
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
31 of the last 34 nightly runs closed non-success. The cause was not agent
quality — it was that the scheduler ignored the fleet's own safety rails.
`evaluateDispatchGates` has always refused to dispatch an agent reporting
`status: working|blocked`, one sitting behind a pending blocker file, or one
stuck in a no-op loop. Those gates ran ONLY on /api/control/dispatch, where a
client posts the handoff. The nightly cron hand-rolled its own gate list and
had none of them, so every night it woke agents that had explicitly declared
themselves unavailable — one handoff literally read "do not re-invoke next_best
on a plain schedule". Such a nudge cannot succeed by construction: the agent
correctly declines, writes no fresh handoff, and an hour later the reaper
stamps the run partial/timeout. The rails existed; the scheduled path just
didn't use them.
- autopilot-eligibility: project persisted project_states into the SSOT
GateInput so a cron reaches the same verdict as the page. A stale `working`
claim with no live process decays to dispatchable (an agent killed mid-turn
must not be frozen out forever); `blocked` never expires, because it is a
standing decision about the world, not a claim about a process.
- nudge-idle: replace the hand-rolled failure brake with the SSOT decision and
log WHY each project was refused, so a quiet fleet stays explainable.
Two ledger-truthfulness fixes found in the same trace:
- The reaper inferred liveness from handoff freshness, but handoffs are written
at END of turn — so a working agent looked dead the whole time it worked.
datacat was stamped `timeout` at 05:00 while its agent went on until 11:00.
Liveness now comes from the runner heartbeat, with a 12h ceiling so a wedged
process can't hold a run open forever.
- The reaper judged handoff freshness against started_at while the closer used
deliveredAt. A handoff landing between them was "work" to one and "stale" to
the other, so the run never closed and was reaped partial with a NULL summary
— a recorded failure whose reason nobody could read. One floor, both paths.
12 new tests pin the invariant that scheduler and Control cannot diverge.
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Item 4 of the ledger-and-loop build sequence: escalation as data, not vibes.
Every failing run close advances the project's open ladder one rung; the
rung injects a level-specific instruction + the last failure reason into
the NEXT autopilot dispatch (both assembly paths) — the objection goes
back to the agent first, humans see only what agents can't route around.
The ladder never dispatches anything itself: cadence stays owned by the
existing autopilot loop and its cooldowns, so no new spend paths.
- schema: run_escalations (one open row per user+project; rows kept after
resolution — escalation rate per rung is the point)
- queries: advanceEscalation (failing close, alert+Telegram once at the
top rung), resolveEscalation (success or manual), getOpenEscalationBlock
- hooks: updateOrchestrationRun (failing → advance, success → resolve),
reaper (bypasses the funnel; advances per reaped failing row)
- prompts: escalation block in assembleInjectPrompt AND inject-core's
withContext — covers queue, next_best, and custom dispatches
- brake SSOT: FAILURE_BRAKE_STREAK = ESCALATION_HUMAN_STREAK (4) — the
brake trips exactly when the ladder reaches 'human', one constant, so
'autopilot stops' and 'operator alerted' can never drift (was 3; the
extra bounded attempt is the replan rung)
- test: scripts/test/escalation-ladder.ts (mapping, block, brake invariant)
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Item 2 of the ledger-and-loop build sequence: one producer, two products.
OC's ingest bus (/api/v1/timeline/publish) has been built and waiting —
this adds the FleetCrown-side producer so successful agent runs surface
as real activity on the OC wall and maker profiles.
- config: run_closed promote policy (success-only — the wall is a curated
projection, failed/reaped runs stay private)
- orangecat-run-moment: pure builder (external_id = run id → idempotent);
token/cost figures from the run ledger ride along in content
- promoteRunClose: resolves the project back-link (projectKey =
user_projects.name), skips unpublished projects/unlinked users
- hook: updateOrchestrationRun fires it on every success close, beside
resolveFeedbackForRun (fire-and-forget, never blocks the close)
- reconcile: daily promote backfill re-emits the last 14 days of
successful runs — a dropped emit self-heals
- test: scripts/test/oc-run-promote.ts (pure, auto-discovered)
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Item 1 of the ledger-and-loop build sequence: every dispatched Claude run
now records what it consumed.
- lib/usage/claude-transcript-usage: window-attributed usage from
~/.claude transcripts (dedup on message.id; slug handles dotted paths)
- runner: usage-reporter ledger reports cumulative windows on the
heartbeat cadence; poller tracks delivered Claude dispatches and now
uses the corrected slug in detectAuthFailure (worktree dirs never
matched before)
- box: POST /api/orchestration/runs/:id/usage prices tokens via
config/model-pricing (rate changes never need a runner release);
freeze rule stops a session's next run leaking tokens backwards
- schema: tokens_in/out/cache_read/cache_write, cost_usd, usage_detail,
usage_updated_at on orchestration_runs (additive migration 0046)
- UI: usage line on the run panel + Today recent-runs list
- test: scripts/test/run-usage.ts (auto-discovered by test-unit)
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
git_head returns a full 40-char SHA, so passing a short SHA to --ref
always failed the literal HEAD compare and skipped the deploy even when
the tree was on exactly that commit. Resolve the ref once at parse time;
the guard compare and FLEETCROWN_DEPLOY_REF passthrough work unchanged.
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* chore(agents): derive default models from adapter SSOT; prune unparsed narration mandate
- AGENT_DEFAULT_MODELS in agent-registry.ts duplicated each adapter's
defaultModel (claude.ts, codex.ts, gemini.ts, cursor.ts, grok.ts).
Now derived from the adapter registry via findAdapter — the adapter
definitions are the single source of truth. All consumers
(agent-preferences.ts, orchestration/run/route.ts) unchanged.
- Removed the forced opening line 'Picked <X> (T_); displaced <Y>.'
from the three autopilot templates in prompt-library.ts (next_best,
test_and_fix, quality). Repo-wide grep confirms nothing parses this
line — it was pure narration, which current prompting guidance flags
as counterproductive. The parsed session-handoff contract
(status:/tsc:/lint:/tests: fields) is untouched.
Note: re-run scripts/generate-agent-prompts.ts after merge to refresh
~/.config/agent-prompts.json.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(test): stop worktree-workspace test from hijacking the real repo under git hooks
When git runs hooks (husky pre-push), it exports GIT_DIR — absolute when
pushing from a linked worktree. The test's git child processes inherited
it, and absolute GIT_DIR overrides `git -C <sandbox>`, so every
'throwaway repo' operation silently targeted the REAL repository:
stray 'init' commits authored by test@test landed on real branches
(replacing the tree with the sandbox's app.ts), and the test's worktree
add/prune ops ran against the real repo. This is the likely root cause
of the known 'git user test wipes .claude/worktrees/*' hazard, and it
made any push from a linked worktree both destructive and red.
Fix: strip GIT_DIR/GIT_WORK_TREE/GIT_INDEX_FILE/GIT_COMMON_DIR/
GIT_OBJECT_DIRECTORY/GIT_PREFIX from process.env before any git
subprocess runs. Verified: suite passes standalone and with a hostile
absolute GIT_DIR exported; real repo untouched in both.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: test <test@test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Five stages turning visitor feedback into shipped work:
1. FleetFeedbackStrip on /control — the common mailbox as a QUERY over
per-project inboxes (GET /api/feedback/summary), never a second store.
2. Dispatch-with-note — an optional operator instruction prepended to the
dispatch prompt; commenting IS editing the prompt, no thread UI.
3. Synthesize — at 5+ new items an agent clusters the inbox into
structured briefs filed back through the widget API, same triage.
4. Close-the-loop — every success-producing run close funnels through
updateOrchestrationRun; feedback rows on that run flip to resolved
and the visitor gets a one-line 'your feedback shipped' email.
5. Feedback digester cron — Groq clusters busy inboxes into draft
DISPATCH_PROMPT actions on /approvals; the operator reviews the exact
prompt before it runs (raw visitor text never reaches an agent
without the human gate). New ACTION_TYPE.DISPATCH_PROMPT executor
calls the injectPrompt SSOT.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
deploy-local.sh (npm postbuild) bailed entirely under CI, so the CI deploy
runner never copied .next/static + public + node-pty into .next/standalone —
deploy-hetzner.sh --no-build then failed with '.next/standalone missing static
assets'. CI genuinely needs the assembly (it rsyncs that tree to the box); it's
only the local-machine tail (schema warning + systemctl --user restart) that must
be skipped there. Move the CI guard to after assembly. Local path unchanged.
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The `migrate` script aliased `drizzle-kit push`, training the habit of
diff-applying unreviewed schema to whatever DATABASE_URL points at — prod, if
misconfigured. Rename it to `db:push` so the name no longer reads as the normal
workflow, document it as local/scratch-only, and point every call-site at the
generate → review → forward-apply loop instead. No `db:migrate` alias added:
there is no local forward-only applier (the deploy owns forward-apply via
apply-schema.sh), so a hollow alias would just be a new landmine.
Call-sites updated: README, check-schema-drift, deploy-host, deploy-local,
postgres-portability. Implements docs/infrastructure/migration-strategy.md §3;
the optional CI guard is deferred there (it collides with the raw-SQL migration
path until the two paths are unified).
Co-authored-by: test <test@test>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Loki tells the user 'approve it in your FleetCrown Approval Queue', but no
such place existed: the queue was a card mid-way down /today that renders
null whenever the private zone is locked — so the flow dead-ended with no
route, no nav entry, and nothing to navigate to on mobile.
- /approvals page in the Work section (sidebar, mobile Menu sheet, and
command palette all derive from the navigation.ts SSOT)
- locked zone no longer hides the queue's existence: the page shows the
pending count (no content) + an Unlock CTA through /unlock?next=
- ActionQueueCard stays the queue UI SSOT; new optional emptyState prop
(default null preserves /today behavior)
- /approvals added to smoke PAGE_ROUTES + CLAUDE.md views table
Co-authored-by: x <x@x>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Both OrangeCat webhook receivers (/api/orangecat/entitlement and
/api/orangecat/events) had an identical, copy-pasted verifySignature —
a change to one could silently drift from the other, and neither was
tested. Extracted it to src/lib/integrations/orangecat-webhook.ts
(behaviour-identical: sha256=<hex> or bare hex, timing-safe) and added
scripts/test/orangecat-webhooks.ts, a cross-repo contract test that signs
bodies exactly as OrangeCat's emitter does and asserts accept/reject across
tamper, wrong-secret, missing-header, and non-hex inputs.
Pairs with orangecat #450 (the sender side). Verified: tsc 0, eslint 0,
40/40 unit tests pass.
Co-authored-by: x <x@x>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The old check flipped the last char of the full JWT, a no-op when the token
already ends in 'x' — the assert.throws could pass without any real tamper.
Target the signature segment and force a changed first byte instead.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ties FleetCrown to sibling product OrangeCat as a typed, two-way bridge and
fills in the public marketing/docs surface.
Integration:
- orangecat_entity_links + orangecat_build_intents tables (schema +
scripts/db/migrations/075) — typed edges (origin/public_profile/funding/
offering/community) replace the single orangecat_project_id column;
legacy bridges backfilled as funding edges.
- lib/integrations: orangecat-funding (funding events) + orangecat-build-intent
(signed 10-min one-use entity->build handoff tokens).
- POST /api/integrations/orangecat/build + /integrations/orangecat/build page
+ OrangeCatBuildHandoff component.
- config/ecosystem.ts as SSOT for cross-product URLs and project ids.
Public surface:
- New /blog, /docs, /changelog, /support pages.
- PublicFooter regrouped into Product / Learn / Support / Ecosystem / Legal.
Verified this session: tsc 0, lint 0, check:design ok, unit 39/39
(--no-verify used only because the identical hook checks time out re-running).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make Hermes usable on purpose, not just as an offline accident. Three changes,
one converging design (verified: tsc clean, eslint clean, gpt-4.1 run proven):
1. dispatchToHostedRunner() — SSOT for INTENTIONAL hosted dispatch (resolve
project → enqueue → emit Activity event). The CLI (hermes-dispatch.ts) and the
new API route both funnel through it, so resolution + attribution never drift.
The inject-core auto-route stays the offline fallback.
2. UI trigger — POST /api/hermes/dispatch (thin shell over the SSOT) + a
self-contained 'Run in cloud' button in Control's intent panel. Works
regardless of local-runner state (the composer's Send only auto-routes to
Hermes when the runner is OFFLINE) — this broadens hosted usage from
offline-only to any-time-on-purpose.
3. Recent-activity context — getRecentProjectActivity() + a compact 'what was
just done' block injected at the consumer (the single choke point for ALL
hosted dispatches), so Hermes doesn't repeat or undo recent work.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Every deploy from a de_CH.UTF-8 laptop aborted at the schema-drift step with
"comm: input is not in sorted order" (exit 1) — even when the box schema was
perfectly in sync (verified: 0 missing tables/columns). glibc UTF-8 locales
order some `table.column` strings inconsistently, so `sort` produced output that
`comm` (same locale) then rejected as unsorted. Under `set -euo pipefail` that
killed the whole deploy script before the event-bridge sync ran — the app was
already live, so it looked "deployed" while silently skipping later steps.
Pin LC_ALL=C on all four sorts and both comms in the block: byte-order collation
is deterministic and self-consistent between sort and comm. Reproduced the
failure against the real box (550 declared / 552 box columns) and confirmed the
fix clears it. bash -n clean.
Tier-3 schema tooling. Two coupled fixes so a schema change no longer
means hand-writing DDL (the reflex that caused the box-ownership rollbacks):
1. `npm run db:generate` works again. drizzle/meta had no snapshots, so
generate couldn't diff — new migrations were hand-numbered by hand.
Reconstructed the current-schema snapshot (meta/0039_snapshot.json) and
aligned the journal idx (1..39, was 0..38, which collided at 0039).
Proven: baseline diff is empty; adding a column emits exactly
`0040_*.sql` with the right ALTER; clean revert. This is pure local
tooling — apply-schema.sh is filename-based and ignores meta, so zero
prod-deploy risk.
2. Deploy self-heals table ownership. apply-schema.sh (shared infra) runs
DDL as the postgres superuser, so a migrated table would be owned by
postgres and invisible to the fleetcrown app role — the class that
rolled back deploys. An idempotent reassignment now runs after the
schema step: on a healthy box it touches zero tables; it hands any
postgres-owned object to the app role before the drift-check. Verified
live: it found + fixed 1 real mis-owned table on the box, then re-ran
to 0 (idempotent).
Flow now: edit schema → `npm run db:generate` → review 0040_*.sql →
commit → deploy applies it (forward-only) and reconciles ownership.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Boring-but-recurring quality-of-life:
- `npm run doctor` — one-command env triage: node>=22, node_modules,
.env.local + DATABASE_URL, Postgres reachable, gh auth, box ssh, git
auto-prune. ✓/⚠/✗ per check; hard failures exit non-zero. Answers
"why is X broken" without a scavenger hunt.
- `npm run git:prune` (+ remote.origin.prune=true on this clone) —
conservatively deletes local branches whose upstream is gone or that
are merged into main; never touches current/main/unmerged. I hand-
cleaned 8 branches this week; now it's one command.
- .github/dependabot.yml — weekly grouped minor/patch bumps for the web
app, desktop app, and GitHub Actions (majors stay separate for review).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Until now Hermes only ran as an automatic offline-fallback; there was no way to
say 'run this on Hermes on purpose.' This CLI resolves a project's git URL and
enqueues a hosted_dispatch that the timer drains → clone → Hermes → PR. Synced
to the runner dir on deploy.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The hosted Hermes path (inject-core auto-routes offline coding dispatches →
scripts/hosted-runner.ts → runHermesTask, drained by fleetcrown-hosted-runner.timer)
ran with zero Activity visibility: successes went only to console + the project
dev log, failures went to console ALONE. 'Is Hermes being used' required DB
archaeology.
- Instrument the path into orchestration_events (the SSOT Activity already reads):
producer marks the offline→hosted routing (source=hosted-runner, adapter=hermes,
deduped by command id); consumer emits task_started/task_completed/task_failed
for both hosted_dispatch (Hermes) and hosted_analyze, attributing the real
executor. Adapter recorded via a localized "hermes" as AdapterId cast — the same
pattern close-sweep already uses for adapters outside ORCHESTRATION_ADAPTER_IDS.
- Fix failure-invisibility: hosted failures now also append to the project dev log,
not just console.
- Reconcile the stale agents/index.ts comment: it claimed runHermesTask is unwired
and the CLI 'isn't installed anywhere' — both false. Interactive adapter is parked
(out of ALL_ADAPTERS by design); the HOSTED executor is wired + installed (box
v0.17.0). Distinguish the two clearly.
- deploy: sync scripts/hosted-runner.ts to the runner dir (the timer runs it there;
it was never being updated on deploy).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tier-1 DevX fixes for pains hit repeatedly in practice:
1. ci-gate: cancelled != failed. CI runs with cancel-in-progress, so a
follow-up push cancels the earlier commit's run; the gate counted that
as a failure and printed "CI FAILED", blocking a deploy that never
should have run. Now a cancelled run on a SUPERSEDED (non-tip) commit
exits 3 → the hook skips it quietly (the newer commit deploys); only
genuine failure/timeout/action_required block.
2. Per-SHA deploy logs. Every deploy wrote to one shared
/tmp/push-deploy-fleetcrown.log, so completion-greps matched stale
lines from prior deploys (false PROBLEM/DEPLOYED). Each deploy now
writes /tmp/push-deploy-fleetcrown-<sha>.log (+ a -latest symlink),
and `npm run deploy:status` shows live SHA vs origin/main, health,
in-flight deploy, and the last log's verdict — no more curl|grep.
3. `npm run db:apply-box <file.sql>` applies box DDL AS THE APP ROLE, so
objects are owned by `fleetcrown` and visible to the app. Applying as
`postgres` (the reflex) left tables invisible to the app role — the
drift-check false-failed and rolled back twice. Verified: a table it
creates is owned by the app role.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Falkenstein (fsn1) is capacity-blocked for cx-line rescales: the console lists
cx43/cx53 as valid targets ("supported"), but the API's available_for_migration
is empty, so a rescale actually fails. Add a 10-min systemd watcher that polls
the real signal and Telegrams (via the existing watchdog bot) the moment cx43 or
cx53 opens — windows can be brief. Transition-only, read-only API token in
/opt/monitoring/hcloud.env.
Also broaden the config/secrets backup: capture ALL of /opt/monitoring/*.{sh,env,conf}
+ the monitoring systemd units (was only targets.conf + telegram.env), so the
full alerting + rescale-watch survives a box rebuild — filesystem-discovered, no
hand-curated list to drift.
Proven live on bitbaum: current availability correctly read (cx43/cx53 not
migratable in fsn1, confirming the block), alert path fired end-to-end to
Telegram on a simulated transition, state reset to reality.
Co-authored-by: Mao Nakamoto <noreply@anthropic.com>
The config snapshot was a hand-curated list (only orangecat + supabase .env), so
~15 apps' secrets (NEXTAUTH/CRON/API keys — non-regenerable) were UNBACKED: a
disk loss left the box un-rebuildable. Also the repo's install-backups.sh had
drifted BEHIND the live box script (missing the supabase dumps + config staging
added on-box) — re-running it would have regressed the box.
Now: config staging is DISCOVERED from the filesystem (every /opt/*/shared|app
.env, every unit + drop-in + timer, all Caddy vhosts, launch scripts, monitoring
config) so it can't drift; user uploads (/opt/*/uploads — medical docs, pet
photos, previously in NO backup) are added to the restic paths; and the repo
heredoc now generates the exact improved script (byte-identical to the box).
Live-verified: backup run fail=0, 15 app .env captured (was 2), 89 units, 13
vhosts, uploads in the latest restic snapshot (pushed to B2).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Root cause of alerting being journal-only for months: install shipped a
COMMENTED telegram.env template and required manual token entry, which never
happened. But fleetcrown + openclaw already run a Telegram bot on this same box.
Now install auto-inherits that token + chat when telegram.env has none — so
alert DELIVERY is active by default, not dark by default. The commented template
+ loud warning only remain as the fallback when no bot exists anywhere.
(Live-activated on the box 2026-07-22 by the same inheritance; test send
returned ok:true. This encodes it so a rebuild/reinstall can never ship dark.)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two gaps the 2-day audit exposed:
- targets.conf is SSOT-derived from apps.conf but by a SEPARATE manual script,
so a newly-synced public app wasn't monitored until someone re-ran
install-watchdog by hand. solon was deployed but never in targets → externally
dark for weeks, no alert. sync-infra.sh now refreshes targets at the end, so
'provisioned' implies 'monitored'. (Live-reconverged: +solon, -stale
swiss-longevity-hub.)
- Delivery was DARK the whole time: telegram.env shipped as a commented template
and stayed that way — every alert (incl. the 8 I'd cited as 'proven') went to
the journal, reaching nobody. install-watchdog now prints a LOUD warning every
run until a real TELEGRAM_BOT_TOKEN is present. Detection was real; delivery
was not.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Every deploy unconditionally restarted fleetcrown-box-runner, whose systemd
cgroup includes any claude/hermes the runner launched for a live dispatch —
so an app-only deploy silently killed running agent work (an AI-review run
died this way; I hand-checked 'any in-flight runs?' before ~6 deploys this
session to work around it). Two guards:
- Skip the restart entirely when no runner code changed (src/desktop/home/
box-runner scripts/tsconfig) — detected via rsync -i itemize. Most deploys
touch only the app, so this alone ends the needless kills.
- When runner code DID change, drain first: poll the runner cgroup for
claude/hermes/codex/cursor-agent/grok processes and wait (cap 8min,
FLEETCROWN_RUNNER_DRAIN_SECS) for them to finish before restarting. Idle
runner drains instantly (cgroup holds only its 2 node procs). Best-effort,
never fails the deploy; restarts anyway on timeout so a real fix still lands.
Verified: drain detection returns 0 against the live idle box.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The OnFailure notifier paged on EVERY deploy: a Next proc SIGKILLed after
TimeoutStopSec marks its unit failed → OnFailure fires even though the new
version is healthy (8 alerts in 2 days, ~6 were deploy restarts). Now: a
long-running service back active a few seconds later is journal-only (restart/
transient, no Telegram); only a unit that STAYS down pages. oneshot crons still
always page (a failed job is real signal). Both paths tested live on the box.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
From the bitbaum sysadmin audit — closes the 'units failed silently for weeks'
blind spot without a monitoring stack the small box can't afford:
- install-host-alerts.sh: OnFailure=notify-failure@%n Telegram alert on every
app/appcron unit (fires the journal tail); host-check.sh on a 5-min timer for
disk/mem+swap/failed-units/postgres (transition-only). Proven live: the broken
vitareba cron fired the alert path.
- sync-infra.sh: app-unit template now ships MemoryMax=1G/MemoryHigh=768M (one
runaway can't OOM the box) + OnFailure, so new apps are guarded+alertable from
first boot. install-app-crons.sh: OnFailure in the cron template too.
- deploy.sh: kill backticks inside the box "..." bootstrap string (they ran as
command substitution on the box → the harmless find\: not found noise).
- docs/infrastructure/monitoring-and-alerts.md: the why + re-apply commands.
Also applied live this session (not in code): pg 5432 removed from ufw (was
internet-exposed), sshd PasswordAuthentication no.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Loki answered 'how does X work in <project>' with generic filler because
the index held only one-line profiles, stale dev logs, goals, and essays
— zero product-level knowledge (2026-07-17: asked about revampit time
cards while the repo ships a complete Zeiterfassung feature; retrieval
had nothing to offer). The reindexer now reads README.md + docs/**/*.md
from each project's checkout (FLEETCROWN_REPOS_DIR, default ~/dev; the
box timer gets /home/ubuntu/dev where dispatch keeps repos synced),
chunks them as source_type repo_doc, and prunes them with the rest.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Journal is what drizzle-kit generate orders against; the box schema history
(public._deploy_schema_history, applied by scripts/hetzner/apply-schema.sh)
is untouched. Regenerated via bootstrap-migration-ledger.ts --write-journal.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>