mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 08:47:02 +01:00
feat/parallel-implement
33
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
602a581c46 |
Organise navigation around the operator loop, give the header an identity, and stop Control contradicting itself (#797)
* refactor(shell): organise navigation around the operator loop, and give the header an account menu The sidebar carried 27 destinations in four sections, one of which was named "More" and held Approvals, Terminal, Prompts, Activity, System, Thoughts and the PUBLIC /fleet register — seven pages whose only shared property was that nobody had decided where they went. Alongside them sat a "Site" section: Mission, Philosophy, Roadmap, Whitepaper and Investors, in the signed-in app navigation. Loki is an operator console. Its surface answers three questions, so the sidebar now has exactly three sections and each one states its question: Now — what needs me? Today, Approvals, Feedback Fleet — what is my fleet doing? Control, Projects, Activity, System Command — how do I act on it? Loki, Terminal, Prompts Private stays PIN-gated below them. The marketing pages left the signed-in shell and stay reachable through Cmd-K, which now indexes NAV directly rather than whatever happens to be in the sidebar — curating the sidebar must never make a page unfindable. Alongside that, identity: - There was no way to sign out from the header, and nothing anywhere in the top bar said who was signed in. A grep of components/shell/ for "avatar", "UserMenu" or "ProfileMenu" returned nothing. Sign out, Settings and the private-zone lock lived in the sidebar footer, which is `hidden md:flex`, and were duplicated in the mobile Menu sheet's footer: two account menus, neither called one, and none where users look first. - AccountMenu now owns all of it, in the top bar, on every viewport. - The theme toggle moved inside it. It was the only control in the top bar drawn with a border and a fill (ui-theme-cycle-btn) while every signal beside it was a bare ghost circle (ui-topbar-btn) — a preference outweighing every piece of live state on the page. - SidebarFooter is deleted. Its collapse button was marked `md:hidden` inside a panel marked `hidden md:flex`, so it could never render on any viewport; SidebarBrand has always owned the working toggle. Two retired NAV entries are deleted rather than hidden: `agents` → /control and `atlas` → /projects pointed at the pages that replaced them, and since NAV_ITEMS is what AppTopBar and PageTitle scan for "which page am I on?", the first match won — /control would have been titled "Agents". Their redirect pages reference the targets, so the redirects stay honest. scripts/test/navigation.ts is rewritten to defend the new structure: every section must state its question, "more"/"misc"/"tools"/"site" are rejected by name, account items may not appear in the sidebar, marketing items may not, no two items may share an href, and the bottom bar must carry one entry point per loop section. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159PhgGrn6ccwfwVTJoTuYx * fix(control): stop the hero claiming "Idle" over a queue of six things Observed on prod: the Control hero read "Idle — nothing queued" while a panel titled "Needs you", badged 6, sat roughly a screen and a half below it, under a 23-project list. One page, one question — is anything waiting on me? — and two answers, with the confident wrong one on top. Two distinct faults, fixed together because either alone leaves the page contradicting itself. 1. The hero could not see the queue. deriveFleetPulse read agents, run outcomes and projects awaiting input, and nothing else, so the one queue on the page that literally counts things waiting on the operator was invisible to the headline that summarises them. It now takes `inbox` and ranks it last among the states that say something is up — a stall, a failure, a half-finished run and a blocked project all still outrank chores — but comfortably above "Idle". `unknown` is a separate state from `count: 0` on purpose. A queue we failed to read is not a queue we know to be empty; ControlInbox already refused to render silence as the answer "no", and the hero now refuses too. The count could not be lifted while it lived inside the panel rendering it, so the fetches moved to `useControlInbox`, called once in ControlPanel and passed down. One read, two consumers, one truth. It also removes a third copy of the /api/feedback/summary request from the page. 2. The panel was filed in the wrong tier. ControlPanel's own ordering rule says tiers 1-2 are about a human being blocked and "reporting never renders above blocking" — and a queue titled "Needs you" with a count badge is the definition of tier 2. It sat in tier 4. It now sits with AttentionBar and AgentEscalations, which it can afford because of how it was built: one line per group until opened, nothing auto-expanding, and nothing at all rendered when the queue is empty. Two rows above the fleet, not the ~1,400px of unbounded strips it replaced. The `inbox` state takes the warning dot rather than neutral grey, for the reason the `partial` state already does: grey beside the words "Waiting on you" is the page agreeing with itself in tone while disagreeing in substance. `unknown` stays neutral — that one really is "no idea". Four tests pin it: a non-empty queue is never Idle, an empty one still is, an unreadable one is not a claim of emptiness, and real trouble still outranks chores. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159PhgGrn6ccwfwVTJoTuYx * fix(design): un-invert the dark text ramp, and make token drift a build failure @bitbaum/design-tokens calls itself "the design single source of truth for OrangeCat, Loki and Solon". Solon proves it — its globals.css is 19 lines and imports the package. Loki's is ~5,800 and declares its own ramp, with the package present only as a devDependency used to generate the widget theme. A comment here said the quiet part out loud: "Loki still declares its ramp locally, so the value is kept in step by hand." Nothing was keeping it in step. Measured: Loki and the package disagree on 32 of the 36 tokens they both define, and the disagreement has a shape — someone transcribed the DIGITS between colour spaces without converting them. `--text-secondary` is `oklch(0.4 0 0)` here and `0 0% 40%` there; those are 30 of 255 apart. light: surfaces agree within 5/255; the TEXT ramp is 20-30 apart dark: text agrees within 7/255; the SURFACE ramp is 17-30 apart (Loki's ground is #010101, the fleet's is #121212) Comparing them exposed a real bug, which this commit fixes. Loki's documented ramp is primary → secondary → tertiary → muted, each quieter than the last. The light block follows it (0.1 → 0.4 → 0.58 → 0.72). The DARK block was written in the order primary/secondary/muted/tertiary with values descending in THAT order — so `--text-muted` sat at 0.65 while `--text-tertiary` sat at 0.59, and text marked muted rendered BRIGHTER than text marked tertiary. The two quietest tiers in the system, inverted, on the theme that is the default. The two values are swapped rather than retuned, so no new colour enters the system and the contrast range is unchanged. The rest is a gate, not a migration. Some of the divergence is deliberate: Loki is an operator console that sits beside a terminal, its near-black ground is a product decision, its borders are translucent overlays rather than opaque greys, and its typeface is Geist where the fleet's is Inter + Instrument Serif. Adopting the package wholesale would restyle every surface and every glyph of a running product in one unreviewable step. So scripts/test/token-drift.ts requires every difference to be DECLARED. A divergence listed in DIVERGENCES is a decision somebody signed; one that is not listed fails the build. Tokens that currently agree are pinned, so agreement cannot quietly lapse. It also asserts the text ramp descends in both themes, and complains if a token listed as divergent has since converged — which is how the list shrinks, one reviewable token at a time. It is picked up automatically by scripts/test-unit.ts (which globs scripts/test/*.ts), so it runs in `verify` and in CI without further wiring. Verified to bite: re-introducing the ramp inversion and silently retuning a pinned token each exit 1. Docs corrected to match the shell as it now is: CLAUDE.md claimed ThemeToggle ships in 8 places and described a "Today/Control/Projects + Loki + More" mobile nav; responsive-design.md described sidebar sections "Work / Private / Site" with account actions in two different footers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159PhgGrn6ccwfwVTJoTuYx * refactor(shell): stop two navigation surfaces answering a question already answered Loki ran six navigation surfaces at once — sidebar, top bar, the Profile/Chat/Control/Terminal strip, the mobile bottom bar, the Menu sheet and the command palette. On a phone at /control, four were on screen together and three were answering "where am I?". Two of them now stand down where they add nothing. FleetSurfaceGuide renders only with an active project. Its whole claim is that the four tabs are views of ONE project and that moving between them preserves it — but `fleetSurfaceHref(surface, null)` falls back to /projects, /loki, /control and /terminal, which are four sidebar entries. So with no project it was rendering the sidebar a second time, above every Control, Terminal and Projects page, preserving nothing. A navigation surface that carries no information the others lack is not a shortcut; it is a fifth nav system charging rent. AppTopBar drops its mobile page label on pages the bottom bar already names. Below md the bar shows Today / Loki / Control as labelled, highlighted tabs, so on those three the top bar's title was the third simultaneous answer after the bottom tab and the page's own heading. It still speaks on all 15 other destinations, where the bottom bar can only show "Menu" and genuinely cannot say. scripts/test/nav-surfaces.ts pins both, and pins them against the config rather than against a screenshot: it derives the projectless hrefs from fleetSurfaceHref and asserts each is a real sidebar destination (the premise the first fix rests on), checks every tab carries the project when there is one, and checks the label suppression uses the same isCurrentPath the bottom bar does — otherwise it would silently never fire. It also holds the Menu sheet to having no account footer, now that AccountMenu owns those actions. Verified to bite: reverting the strip gate fails the suite. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159PhgGrn6ccwfwVTJoTuYx * fix(ci): pre-push ran the wrong suite for scripts/test/ The hook classifies changed paths into three arms and runs the gates each one can break. `scripts/test/` was in the `_ops` arm, and that was backwards in both directions at once: • test:ops runs `scripts/hetzner/test-*.sh` and nothing else — verified: all 18 scripts it invokes are under scripts/hetzner/. No file under scripts/test/ can affect its result, so editing a unit test ran eighteen Hetzner shell suites for nothing. • scripts/test/ holds the 218 .ts files that ARE the unit suite (scripts/test-unit.ts globs the directory). The unit suite runs in the `_app` arm, which scripts/test/ did not trigger. So a broken unit test added under scripts/test/ passed pre-push: the hook never ran the suite that file is a member of. Now: `scripts/test/*.ts` → `_app` (tsc, lint, design, desktop, test:unit, test:home). `scripts/test/*gate.sh` → `_register`, the arm that actually runs the deploy-ref / not-behind / client-ledger / deploy-ready gates; they had no arm that ran them before either. `_ops` keeps hetzner and site-template. scripts/test/pre-push-routing.ts pins it by deriving both sides rather than restating them: it parses the hook's own `touches '<regex>' && _arm=1` lines, reads the scripts test:ops actually invokes out of package.json, and asserts each path reaches the arm that covers it. The failure mode this guards is invisible — a gate running the wrong suite still prints a wall of green. Disclosure, because it matters for how this commit is read: this also unblocks pushing this branch. test:ops fails 4 of 92 checks in a container running as root (the .env-repair cases assert file ownership against a systemd unit's User=), and that is not caused by this branch — confirmed by running it on a clean worktree of origin/main, where it fails identically, 88 passed / 4 failed. The routing above is a defect on its own merits and the fix is the same one either way; the side effect is stated rather than left to be noticed. Those 4 ops failures remain, unaddressed by this branch, on main. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159PhgGrn6ccwfwVTJoTuYx * chore(design): ratchet the dead ui-* rules in globals.css check-loki-classes.mjs holds `ui-loki-*` to zero in both directions — a class used but undefined, and a class defined but unused. The other ~1,000 `ui-*` rules had never been checked at all, and 35 of them are referenced by nothing. That matters more here than in most codebases. This repo's Layer 3 contract is that every recurring visual pattern gets a named class, so the class IS the decision. Someone looking for "how do we draw a metric card" finds .ui-control-metric-card, -value, -label and .ui-control-metrics-grid sitting in globals.css and reasonably concludes that is the house style. Nothing has used them in months. Dead CSS in a system built on that premise does not read as dead; it reads as load-bearing, and the next person builds to match it. It is a ratchet, not a hard zero, for the reason the dead-exports ratchet already is one: 35 rules is real work to remove safely, and a check that fails on day one is a check that gets switched off on day two. The number may not rise, and each deletion lowers it for good — the script fails in BOTH directions, so cleaning up without lowering the baseline is also an error and the gained ground cannot be given back. Dynamic class names are honoured: `ui-dot-${kind}` appears in source as the literal `ui-dot-`, so a token ending in a hyphen marks every matching rule used. Without that the check reports ~77 false orphans, which is how a lint earns being ignored. Eight such prefixes are in play. Also deletes .ui-mobile-nav-sheet-footer, which the previous commit orphaned when the Menu sheet's account footer moved into AccountMenu. Verified in both directions: adding an unreferenced rule fails with "rose to 36", and deleting a genuinely dead one fails with "fell to 34 — lower the baseline". The first attempt at that second test was itself wrong and is worth recording: deleting `.ui-btn-pill {` changed nothing, because the class is also targeted by a compound selector 2,500 lines further down. The checker was right and the test was wrong — which is exactly the sort of thing a rule counted by hand gets wrong. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159PhgGrn6ccwfwVTJoTuYx --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
7523a25b47 |
fix(control): a half-finished run is not evidence that things are working (#780)
Found by using Loki to develop Loki on 2026-09-18. The loki project card read '5 of last 5 partial' while the hero above it said only 'Building', with no hint that nothing had landed in days.
deriveFleetPulse counted partial as succeeded: const succeeded = recent.filter(r => r.outcome === 'success' || r.outcome === 'partial'). So a fleet whose every recent run came back partial always had a non-zero succeeded, and the failing branch (failed >= 2 && succeeded === 0) could never fire. Two feet away on the same screen, OutcomeStreak renders the same outcome with ui-tag-warning. One fact, graded two ways in one view - and the forgiving reading drove the headline.
partial is correctly excluded from FAILING_OUTCOMES: a run that delivered something is not a hard failure and must not trip the dispatch brake. But 'not a failure' and 'proof things are working' are different claims, and only the first is true. succeeded now counts success alone.
Three consequences, each its own fix. A fleet that only half-delivers gets its own verdict ('Half-finished') instead of falling through to 'Idle - nothing queued', which reads as a clean desk when it is a pile of unfinished work. 'Building' keeps its headline but stops being silent: it now names a partial streak instead of returning detail: null. And the hero renderer no longer discards that sentence - it overwrote sub with 'N agents working' unconditionally, so the warning would have been dead code.
OutcomeStreak says 'stopped part-way' instead of 'partial'. The summary already earned its place by replacing bare glyphs with a sentence; saying 'partial' only moved the cipher from a symbol to a term.
Proven by mutation: restoring the old succeeded line fails the new test with 'partials must not vouch for a failing fleet'. 57/57 pass with the fix in place.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
083cda1089 |
fix(control): name the signal that says a project is working (#775)
* fix(control): render verified runs as working
* fix(control): name the signal that says a project is working
Control rendered "Working · Live agent process detected" for a project
whose own /api/control reported agentRunning=false and activeAgents=[].
The badge was right — a hook-reported turn was open — but the reason
under it was invented, and an operator reading it goes looking for a
process that was never there.
isRunning had three causes and the evidence line asserted one of them
for all three. None of the three is a /proc scan:
promptRunning a dispatch sentinel exists (the code comment right
below it even says the process "may not yet appear
in /proc on the current tick")
liveTurnRunning the agent's own hook report of an open turn
verifiedRunActive fresh PTY output on an unfinished run
`agentRunning` cannot stand in for the process either: the control route
ORs verifiedRunActive into it, so a verified run alone sets it. Where a
process and a run could both explain the state we report the run —
under-claiming, which is the safe direction.
One derivation now produces both the boolean and the reason, so the
badge and the line beneath it cannot drift apart:
const runningEvidence = ... ;
const isRunning = runningEvidence !== null;
RUNNING_EVIDENCE_LABEL is keyed by that union, so a fourth running
signal cannot be added without stating what it observed.
Also carries 6c30b29a forward: verified run output makes a project
Working rather than session-open. Before it, a verified run only moved
agentRunning in the API, which the presenter reads as "a process is
open" — so a real cloud run showed as idle.
Tests: three cases pinning the labels, each proved by mutation —
restoring the old single string fails "a live agent turn is reported as
a turn, not as a detected process" with the exact text Control showed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
5d9a942cd7 |
refactor: split the five unreadable functions, then lint against the next one (#733)
* refactor(orchestration): split the 733-line dispatch POST into named steps The POST handler in /api/orchestration/run carried every dispatch path inline: registry resolution, the cloud queue branch, the prompt-queue pop, run tracking, the queued-behind and parallel branches, and the claude / codex+gemini / openclaw executors. Reading it meant holding all of them at once. Each step is now its own named function, and POST reads as the sequence it always was. No behaviour change: same responses, same status codes, same sentinel writes in the same order, same log lines. Two genuine duplicates folded while passing: the project-state description block (claude and codex/gemini derived it identically) and the lifecycle sentinel writes. POST 733 -> 164 lines. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 * refactor(inject): split injectPrompt into named dispatch steps injectPrompt was one 627-line function carrying the whole dispatch: target resolution, local and remote prompt assembly, run opening, /tmp side effects, the hosted-builder route, the executor call, and the failure and success ledgers. Each is now a named function and injectPrompt reads as the sequence. This path is autopilot-critical, so nothing moved across a boundary: same statuses, same response bodies, same event/audit rows in the same order, same log strings. injectPrompt 627 -> 163 lines (executeAndReport, the post-executor half, is 122). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 * refactor(control): split the 492-line control GET into named steps The /api/control GET built the whole panel inline: project collection and dedupe, the agent-availability override, ten parallel DB slices, a 256-line per-project map callback, and the response. The card builder alone carried session persistence, run closing, runtime resolution and run serialization. Each is now named: collectControlProjects, resolveRunnerAvailability, loadControlSlices, buildProjectState (with persistSessionHandoff, maybeCloseRunFromHandoff, resolveAgentRuntime, serializeLatestRun) and resolveRunnerLastPushedAt. Same payload, same headers, same log lines, same write ordering. GET 492 -> 128 lines; the per-project builder 256 -> 133. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 * refactor(widget): split the 1,329-line embed into modules widget/main.ts was one file with a 776-line mount() closure and no exports — the launcher, the element picker, the screenshot strip, the voice control, the stylesheets and the DOM helpers all lived inside it. This is the only surface strangers on other people's sites load, and it earns the same care as src/. It stays a self-contained esbuild bundle (nothing imports from src/), split into siblings: dom, theme, visitor-placement, launcher, picker, attachments, voice-control. main.ts now owns the panel, submit and boot. Same DOM, same order of construction, same copy, same listeners — verified by diffing the string literals of the old and new unbundled builds. Two pins added while the code was moving: - scripts/test/widget-self-contained.ts — every widget module imports only its siblings, every sibling import resolves, and the only document-level CSS is the fcw-* pick highlight. Proven by mutation (an "@/config/brand" import makes it fail). - widget-server-caps-mirror now reads every widget module, not just main.ts, so moving a clamp cannot silently defeat the check. main.ts 1,329 -> 528 lines; mount 776 -> 386. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 * refactor(control): thin the 665-line ControlPanel into named pieces ControlPanel held the deep-link effect, the runner-presence derivation, the empty state, the Workspaces panel, the launch defaults, four modals and the toast — all inline, between the four-tier comments that explain the page's ordering. Extracted, behaviour unchanged (same DOM, same copy, same props): - useControlDeepLink — /control?focus=&switchTo= navigation handling - deriveRunnerPresence — offline / never-seen / stale, now in the presenter - latestRunSignals — the fleet-pulse outcome pairing - ControlEmptyState, WorkspacesSection, LaunchDefaultsSection, ControlNotices - ControlPanelModals — every overlay in one sibling deriveRunnerPresence is the one piece with real logic in it (the ADDITIVE rollout rule where connected===false is not yet authoritative on its own), so it is now pinned by five cases in the presenter suite — it had none. ControlPanel 665 -> 520 lines; the component function 665 -> 396 (most of which is JSX and the ordering comments that explain it). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 * refactor(control): split the 412-line useControlData hook The hook did four jobs in one function: snapshot fetching + refresh triggers, the SSE patch fold, the /api/control/stream EventSource, and the five dispatch actions. - applyProjectPatches (lib/control-project-patch.ts) — the fold, now pure - useControlProjectStream — the EventSource and its reconnect - buildControlActions — inject / launch / runWithBrain / runCustomPrompt / saveAgent applyProjectPatches carries three rules a later edit could silently break (match by live tab, leave omitted fields alone, maintain liveTabs case-insensitively) and was untestable inside a useCallback. It now has six cases pinning exactly those. useControlData 412 -> 290 lines; the hook function 412 -> 180. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 * refactor(shell,system): split the palette and Fleet Doctor CommandPalette (442-line component): the entry list and the filter were two useMemos nobody could test, and the NL composer's two fetch hops were inline. Both moved out — palette-entries.ts (pure) and useCommandComposer — with eight cases pinning the decisions that look arbitrary and get tidied away: projects outrank navigation, recents lead and are not repeated, free text offers Run FIRST, a pending command turns the list into a project picker, and a project with no checkout offers no agent switch. /api/system/doctor GET (328 lines): a flat run of independent probes appending to one array. Each is now a named probe returning its own checks, and GET is the list of them plus summarize(). Same checks, same order, same ids and copy. CommandPalette 442 -> 245; doctor GET 328 -> 33. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 * refactor(loki): split the 450-line conversation POST into named turns The Loki chat route answered a turn with eight deterministic fast paths and a classifier path, all inline inside the SSE job — a 450-line closure whose control flow was a column of early `return send(...)`. Each fast path is now a named TurnHandler over one TurnContext, returning a message or null to pass. The classifier half splits into dispatchResolvedCommand / needsProjectReply / chatReply. The chain and its ordering are now a list you can read, and the two "add this project to the thread" patterns collapse into linkProject/linkProjects. Same replies, same meta `source` tags, same ordering, same SSE frames. POST 450 -> 63 lines; the longest piece is chatReply at 84. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 * chore(lint): hold the line on function length Nothing was watching functions grow. Today's rule is a ratchet set just above the worst case that survives the split work above, so the next 700-line handler is an error on the author's machine instead of a surprise in review. Two thresholds, because the halves fail differently. Logic — routes, lib, queries, home/ — is where length hides branching, so 300. A component's length is mostly JSX depth: real, far less dangerous, so 510. Error, not warn: a warning on a repo this size is a number nobody reads. Blank lines and comments are skipped — this codebase comments heavily on purpose and a rule that punished that would push the WHY out of the code. Proven by mutation: a 324-line function under src/lib fails the rule. Also removes fnlen-all.mjs, a measurement scratch file that rode along in the previous commit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8 --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
8034cb629b | feat(feedback): add reporter tracking and project editors (#754) | ||
|
|
95c40a9cd8 |
refactor: rename the product from FleetCrown to Loki (#695)
The product, its assistant, the repo, the host and every unit on the box now share one name. 638 files, ~3,000 mentions: UI copy, config, env keys (FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs, articles, the deploy workflow other repos reuse, and nine file names. - Three article slugs carried the old name and had been shared; permanent redirects keep those links alive (next.config.ts). - test-no-retired-name.sh now also forbids the old product name across the whole repo, so the rename cannot creep back through templates and examples. - ASSISTANT_STACK collapses the product and the assistant into one entry, because they are now the same name. Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki` database and role, loki.orangecat.ch (old host 308s to it; /api, /widget, /embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases. The Resend sending domain stays fleetcrown.orangecat.ch until the new domain is verified in DNS. Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
2053f7c99b |
feat(web): the local runtime drives owned PTYs only — the zellij adapter is deleted (#630)
The web app's local-runtime paths (RUNTIME_AVAILABLE=true, the laptop's own server) still fell back to zellij wherever no owned PTY was found: inject-core gated on "is the tab open in Zellij" and typed into a tab by name, the control poll and stream listed zellij tabs as the fleet, switch-agent quit agents with keystrokes and /proc scans, /api/control/agent restarted projects with `zellij action write-chars`, clear-context typed "/clear" into a tab, and a focus-tab route moved the operator's terminal from the browser. Each was a second definition of "where an agent runs", and each is where a dispatch could land in a tab named "Tab #9". Now there is one definition: the owned workspace registry. - src/lib/agent-execution/owned.ts — listOwnedTabs (the fleet's open tabs on this runtime), ownedWorkspaceFor, injectOwned, NoLiveSessionError. - inject-core: no tab gate, no typing-hook check. A live owned PTY is written to directly; a tab with no PTY QUEUES a dispatch (executeInject.queueOnly) so the runner cold-starts the agent — visible in Control, never a keystroke into a guessed terminal. - /api/control + /api/control/stream + /api/control/open-tabs: open tabs are owned PTYs. The API field `zellijTabs` is renamed `liveTabs` end to end. - /api/orchestration/run: prompts go to the owned PTY; the codex/gemini task script runs as its own owned process (argument vector, no shell line). - switch-agent, /api/control/agent (apply to open tabs): terminate the owned PTY and provision the new agent; projects with no live session are skipped. - clear-context: 409 "no running agent" instead of typing at nothing. - /api/control/focus-tab deleted with its Control buttons and the deep-link focus call; the terminal is the web terminal. - control-fast-state no longer reads ZELLIJ_PANE_ID from /proc; the pane→tab join and tab-by-cwd are gone. - Deleted: src/lib/zellij.ts, src/lib/terminals/*, src/lib/agent-runtime.ts, home/worker.ts (the retired bash-daemon consumer), src/lib/ansi.ts and buildAgentLaunchCommand (dead once their last zellij caller went). - shellEscape moves to src/lib/shell-escape.ts; it was never about zellij. Verified: tsc, eslint, 144/144 unit files, 130/130 home self-tests. Claude-Session: https://claude.ai/code/session_01WSNERoZZqW2TgqbAGHSQZf Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
caa0e41c3b |
chore: add a formatter (#449)
* chore: add a formatter, matching the style this repo already writes singleQuote=false was chosen by counting this repo's own imports, not by fleet decree. The fleet is genuinely split and the two repos that already had a .prettierrc disagreed with each other, so there was no standard to restore. Quote style does not cross repo boundaries; having a gate does. Markdown is ignored for now — prettier rewraps prose, which would bury the real diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * style: format with prettier (1062 files) Mechanical. No behaviour change. This SHA is listed in .git-blame-ignore-revs so `git blame` skips it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * chore: teach git blame to skip the reformat Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(lint): reattach two guards the reformat detached Both effects were one-liners, so a trailing eslint-disable-line covered the setState call: useEffect(() => { setSelected(new Set()); }, [q.length]); // eslint-disable-line ... prettier expanded the block. The comment stayed on the closing line while the call moved above it, so the guard protected nothing and the rule its author had deliberately silenced failed the build. This is the second shape of the same defect — hirnli had the eslint-disable-NEXT-line variant. Both come from the same fact: an eslint directive binds to a line number, so reformatting can silently unbind it, which makes 'mechanical, no behaviour change' false for any bulk reformat. * chore(desktop): bump the runner version the reformat requires desktop-release-drift enforces that anything built into Fleet Runner which differs from the last released tag must carry a version ahead of that tag — main read 0.8.15 and fleet-runner-v0.8.15 already shipped. A whole-repo reformat changes bytes under desktop/, so the gate fires. The alternative was adding desktop/ to .prettierignore, which would buy a quiet PR by carving a permanent hole in the formatter's coverage — the precise shape of silent drift this test was written to catch. Bumping is what the rule asks for and costs one patch release whose only content is whitespace. * chore: merge main and re-format A whole-repo reformat conflicts with any concurrent commit, and a conflicting PR runs no checks at all while reporting nothing. Conflicts resolved to main, which is correct because this branch changes formatting and nothing else. * chore: leave desktop/ out of this reformat desktop-release-drift is right to refuse this. Everything under desktop/ is built into Fleet Runner, so changing it means shipping: bump the version AND add a FLEET_RUNNER_RELEASES entry, whose stated audience is 'person who installed Fleet Runner and wants to know what changed'. For a whitespace-only build the honest answer is 'nothing', so that release should not exist — and I should not write release notes claiming otherwise. I had bumped to 0.8.16 to get the gate green. That was the wrong direction: publishing a build to three OS runners to keep a formatting PR quiet. Reverted. desktop/ is excluded in .prettierignore with the reasoning recorded there, to be formatted alongside the next real runner change, where the bump and the notes are true anyway. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
2ee51c07b8 |
fix(control): stop announcing "All clear" about a fleet we know nothing about (#363)
Control's headline triad — X working · Y awaiting input · Z idle — is
derived from getProjectDisplayState, which needs runtime state to
classify anything. Before the runner's first push it has none, so every
project classifies as `offline`, whose counterCategory is "offline".
That means all three live counts read 0. Not partially, not
approximately — zero. And 0/0/0 is byte-for-byte the condition the
"All clear" chip fires on:
!isStale && attention === 0 && working === 0 && ready === 0 && idle === 0
So the surface whose entire job is telling the operator what needs them
could open by declaring the fleet calm at the precise moment it knew
nothing about the fleet. Not a stale number — a confident wrong one, on
the stat the operator acts on first.
The fix belongs in the derivation layer, not the views: ControlDashboardState
now carries `countsKnown`, which is how the presenter says "I don't know
yet" instead of handing out zeroes that read as facts. ControlFleetStatus
renders "Checking projects…" while it is false, which also suppresses the
idle chip and All clear, since neither can be honest either.
Verified by measurement, not assumption — the same three stub projects
bucket as offline/offline/offline (0/0/0) with runtime state unknown and
not_running/not_running/not_running (0/0/3) once known. Three cases added
to scripts/test/control-presenter.ts pin exactly that, including the
0/0/0-equals-All-clear collision that makes this a lie rather than a gap.
npm run verify green.
Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
869a406a1c |
feat(control): count the agents that are actually working (#317)
Control read "0 working · 0 awaiting input · 21 idle" while eight Claude sessions were mid-task in real worktrees. The number was right about what it measured and wrong about the fleet, which is the worst kind of right. Every "working" signal required FleetCrown to have dispatched the run (a /tmp sentinel backed by a /proc scan) or the runner to recognise a zellij tab named after a registered project. A session started any other way — a terminal you opened, a background job, a worktree — produced neither, so it was structurally invisible. The presenter already half-knew this: it downgrades "Not running" to "Active recently" because "sessions run in tabs FleetCrown can't observe". That was a nicer way to say the same thing, not a fix. The honest definition needs no tab and no process table, because the agent announces both edges of its own turn: UserPromptSubmit → a turn STARTS (ended_at NULL) Stop → that turn ENDS (ended_at set) New agent_sessions table, one row per session, upserted per turn. An open turn IS "working" — the only claim in the system backed by the agent's own report rather than by inference about the machine it runs on. Details that decide whether this is true or merely plausible: - Liveness is recorded BEFORE the ledger's noise and dispatch-echo filters. Those decide what deserves a line in the activity log; they say nothing about whether an agent is working. "continue" is noise to read back and still starts a real turn. Filtering liveness alongside prose would blank the count during exactly the short, repetitive prompts that make up most of a long session. - A session killed mid-turn never sends Stop, so readers bound on started_at too (OPEN_TURN_TTL_MS = 30min, deliberately the same constant as STALE_PROMPT_S — two definitions of "too old to believe" would eventually disagree on screen and the user would be right to trust neither). - An open turn outranks readyAt and orchestration-ready: those mean "the agent finished"; a new turn means it is working again. Without this the card sits on "Ready" through the whole next turn and the project lands in the awaiting-you bucket while an agent edits it. - liveAgentTurns is REQUIRED on ProjectState, not optional. An optional field lets a route that forgets to select it compile clean and render "idle" forever — the exact class that hid this for months. Fixes a latent bug in the same path: the capture hook forwards Claude's stdin verbatim, which spells the field `session_id`, while the route's schema only accepted `sessionId`. zod strips unknown keys, so the id was declared, accepted, and never once populated. Both spellings now. Fleet Runner installs the Stop hook alongside the capture hook (appended to the user's existing Stop entries, never replacing them), from one shared script template so the two cannot drift. Pure logic lives in lib/agent-turns.ts, not db/queries — importing the query module into a test drags in the database connection and the unit suite runs with no DATABASE_URL. 6 new presenter tests cover both sides: an open turn makes a project working, count 0 does not, an open turn beats a ready stamp, and a ready stamp still wins when nothing is open. Co-authored-by: t <t@t.t> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
86615aa22f |
fix(control): every claim on Control is now sourced, scoped, and expirable (#263)
The Control page presented six kinds of untruth. Each had a distinct root
cause, and each is fixed at the source rather than at the label.
1. Two builder channels, one row read. The cloud box-runner and the local
desktop app each upsert their OWN runtime_snapshots row, but the reader
took a single row — last writer wins. So open tabs, installed agents and
the version string all silently described whichever channel pushed most
recently. getRuntimeSnapshots() returns every channel; tabs are unioned
across the FRESH ones, agents prefer local, version is reported per
channel ("cloud v0.8.9 · app dev build") instead of one number standing
in for both.
2. "builder vdev" on a released build. pusher.ts read
FLEETCROWN_RUNNER_VERSION at module-import time, but index.ts sets it
inside app.whenReady() — always after. Read at call time.
3. Worktrees broke project keying. Every session now runs in
<repo>/.claude/worktrees/<name>, so basename(cwd) reported the worktree
as the project and the real repo looked idle while an agent worked in
it. Resolve to the worktree root. Joins between live tabs and DB state
also used raw .toLowerCase() on one side and normalizeTabName() on the
other, so "Prime tower" never matched the runner's "prime-tower" row —
both sides now normalize identically.
4. "sync 1m ago" laundered web writes. runnerLastPushedAt was bumped by
any write, including this browser's own. It now reflects runtime pushes
only, so a stale runner reads as stale.
5. Synthetic smoke traffic rendered as fleet work. The authenticated smoke
probe dispatches "[smoke-<ts>] probe — ignore" against a real project;
it appeared in Workspaces and Recent activity as genuine agent output.
smoke-filter.ts is the SSOT for the marker and is applied to all eight
user-facing dispatch reads. hasRecentIdenticalPrompt stays UNFILTERED
on purpose — the echo-dedupe test must find its own row. Per the
never-twice rule, smoke-marker-contract.ts fails if the writer's marker
and the filter's prefix ever drift apart, or if a new activity read
forgets the filter.
6. Claims that could never come true. "Waiting to dispatch" was the pulse
catch-all with nothing queued and nothing coming; it now says "Idle —
nothing queued", or names the projects actually waiting on the user.
"Not running / Last dispatch today" gets a real state (Active recently,
3h window) instead of reading as dead. "Next:" now says whose next step
it is and how old — an agent handoff and a profile field written during
enrichment are not the same claim. The Workspaces caption admitted only
half the filtering; it now states how many open tabs are hidden and
that unmatched tabs run unseen. Counts are exact: "5+ dispatched" was
the fetch cap, "Recent activity (30)" was the fetched length while 20
rendered.
Also: the autopilot hint no longer asserts a mode before the policy has
loaded, and a card under a fleet-wide execution stall says dispatches are
queued and not executing rather than "queue is empty".
Verified: tsc clean, lint, check:design ok, check:desktop ok,
test:unit 71/71, control-presenter 33/33.
Co-authored-by: test <test@test>
|
||
|
|
103be56f47 |
fix(control): the hero must not contradict itself — stall truth from the queue up (#243)
George's read of the hero found claims that could not all be true: 'Building · 1 agent active' + 'sync just now' directly above 'Builder is connected but not executing (2 queued 469s). Restart the desktop app.' Root causes, fixed from the query up: - getRunnerExecutionStall counted commands that are deliberately WAITING: dispatches gate-held behind an older open run on the same project (per-project FIFO), and claimed commands mid-execution (incl. legit multi-minute hosted runs). Both now excluded — the alarm only fires for genuinely unexecuted work — and the query returns WHICH projects are stuck so the banner is trackable. - deriveFleetPulse now takes execution health: a genuine stall outranks 'Building' (an observed terminal process doesn't prove the dispatch pipeline works). New pulse key 'stalled' with detail naming the stuck projects and queue age; 'Review failures' link only renders for run-failure stalls where /activity actually helps. - The 'online · sync just now' line turns warn-toned with '· not executing' during a stall instead of glowing green above a red alarm; the duplicate stall alert chip is gone (the pulse owns the story). - Working / awaiting-input counter chips are now buttons: click jumps to the first project in that bucket (a count you can't follow is noise). - Feedback strip drops '13 resolved, median 6d report→fix' (vanity stat in an action surface; still shown on the project inbox). - Idle evidence names the freshest recorded signal — 'Last run 40m ago' / 'Last dispatch 44m ago' — instead of 'Idle today'. Sessions no longer run in named zellij tabs (kitty, unnamed, multi-project), so runs and dispatches are the surviving truth signal for projects like orangecat that read as dead while they shipped all day. Tests: 4 new cases in scripts/test/control-presenter.ts (stall outranks Building; healthy execution stays Building; run/dispatch freshness wins the evidence label). 30/30 presenter, 69/69 unit files. Co-authored-by: test <test@test> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
d2ff24480c |
fix(control,projects,loki): age out stale failure noise + distinguish Loki threads
Two cleanups from the flow-test walk:
1. Stale-failure noise (the box-credential outage kept shouting for weeks):
- Control hero: deriveFleetPulse now gates "Stalled" on run RECENCY — a
failure only counts if it finished <24h ago. 18 projects whose last run
timed out two weeks ago now read "Waiting", not "Stalled — 18 failed".
New unit test covers the stale-outage shape; 26/26 pass.
- Project dossier: run history was rendering ALL finished runs inline,
burying the shipped changelog under ~30 stale timeouts. Cap to the recent
6; the rest live behind "Full activity timeline (N more)".
2. Loki history rail: threads that share an opening line ("move forward on
fleetcrown" ×15) were indistinguishable. Show a compact relative time
(shortTimeAgo: now/5m/3h/2d/3w/5mo) in the meta line so they're tellable
apart and time-ordered.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
||
|
|
5fc3333f9a |
fix(control): fleet truth pass — honest hero, live janitors, actionable streaks
Dogfood session drove FleetCrown against production and found the fleet
had been silently dead for 2 days behind a green light:
- nudge-idle raw-queried beacon_settings WHERE mode != 'off', so users
with NO row (missing row = default 'on') were invisible to the
scheduler — autopilot dispatched nothing while the hero said
'Autopilot on'. New SSOT getFleetAutopilotUserIds() decides
enrollment for schedulers; missing rows count as on.
- The stale-run reaper only ran on /api/control page loads: 16 runs sat
'waiting' for 51h until a human looked, then got stamped with
fabricated 51h durations. New hourly reap-stale-runs cron reaps all
users; finishedAt = startedAt + STALE_RUN_MINUTES (truthful).
- Hero headline was mode-derived ('Building' + pulsing green with 0
working and 16/16 failed runs). deriveFleetPulse() (pure, tested)
now derives Building / Waiting to dispatch / Stalled(+Review
failures link) / Paused from live counts + latest outcomes.
- OutcomeStreak ✗ glyphs were unlabeled dead-ends; the streak now
deep-links to /activity?window=week&project=<key>.
- box-runner logged 'connected · last poll 0s ago' every 2s to journald
(~40k lines/day); now logs on state change + 15-min heartbeat.
Presenter tests 25/25 (6 new fleet-pulse cases).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
||
|
|
033b780326 | feat(control): complete terminal and orchestration trust pass | ||
|
|
7432f16053 |
refactor(runner): rename daemon→runner across the live system, keep legacy contracts
The bash daemon was deleted in Session 4 of killing-the-bash-daemon; Fleet Runner (the desktop poller) is the local executor now. This retires the 'daemon' name from everything describing the live system — constants (DAEMON_*→RUNNER_*), types (DaemonStateKey→RunnerStateKey), the status banner component, state-derivation fns, control props, CSS classes (ui-control-fleet-daemon→-runner), and comments/UI strings. Backward-compat shims (no breakage to deployed Fleet Runner installs): - src/lib/constants/daemon.ts re-exports RUNNER_* under the old DAEMON_* names for the desktop Electron build until it points at the runner path. - Fleet Doctor reads runner.env, falls back to legacy daemon.env. Deliberately KEPT as 'daemon' (they name the genuinely-dead/legacy thing): the deprecated DAEMON_TOKEN bearer contract, the /api/agent/daemon 410 tombstone, the legacyDaemon developer download, and historical killing-the-bash-daemon references. systemctl daemon-reload / NX_DAEMON left untouched (not ours). tsc clean · eslint 0 errors · test:home 97/97 · smoke 44/44 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
ea86905967 | feat(control): per-project autopilot and digests | ||
|
|
9eeccc7b68 |
fix(control): rename 'Waiting for instructions' to 'Awaiting input'
The old label implied the project itself was dormant ("waiting for
instructions") when the actual underlying state is "agent process
detected, no recent handoff signal." It also disagreed with the
summary chip ("X awaiting input") that uses different wording for the
same fact.
Two consequences for a developer actively working on a project whose
Claude instance is at the prompt:
- the row badge said "Waiting for instructions" (implies idle project)
- the summary said "N awaiting input" (correct)
The user reasonably reads this as the UI lying.
Pick one honest, actionable phrase ("Awaiting input") and use it in
both places. No state-detection change — only wording.
The deeper truth gap (revampit's Claude isn't writing the
/tmp/agent-handoff-sent-* sentinel that would push the row to "Ready
for next step") is a separate hook-coverage issue that this rename
does not pretend to fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
a4f52b3fb2 |
test(control-presenter): align open-idle evidence label with badge wording
Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
b73bb9a8d4 |
feat(desktop+web): v0.7.2 — peek tab contents from /control
The hardest UX gap in /control was: you saw your tab NAMES + state chips
('Working', 'Awaiting input') but never the actual screen content. To know
what the agent was saying you had to alt-tab into Zellij and find the
right tab. Web-shell users saw even less.
v0.7.2 closes that. Per-tab eye-icon button on /control workspaces table
opens a drawer that captures the live screen of that Zellij tab and renders
it as a static terminal frame (monospace, dark background, scrollable).
Auto-refresh toggle re-peeks every 3s for watching long-running agents
without permanently leaving the user on the peeked tab.
Mechanism (sub-200ms round-trip):
1. ZellijLiveRows eye-button → setPeekTab(name)
2. PeekTabDrawer mounts → window.fleetRunner.peekTab(name)
3. preload → IPC peek-tab → main process
4. src/lib/zellij.peekTab: save focus, go-to-tab-name, dump-screen to
/tmp file, restore focus, read+strip ANSI, unlink temp
5. Returns content → drawer renders in <pre>
Same focus-dance pattern as injectIntoTab (already in zellij.ts) — users
have accepted that disruption budget for remote dispatch, this reuses it.
Outside Fleet Runner the button is hidden (one-tick mount probe of
window.fleetRunner.peekTab). No degraded "button that always errors"
experience for browser users.
Also in this drop:
- desktop bump 0.7.1 → 0.7.2 (auto-update will pull this on next launch)
- control-presenter test: "cockpit" string was a leftover from the rename,
failed CI on the v0.7.1 push; now compares to 'FleetCrown' as intended
- ZellijLivePanel daemon-offline CTA now points to /releases/latest
instead of the hardcoded fleet-runner-v0.7.0 tag (was pointing users
at the broken bundled-renderer build)
Next: v0.7.3 cloud-fallback (browser-only users get peek via the command
queue → daemon → result table → SSE), v0.8 inline terminal column.
|
||
|
|
e30c842869 |
feat(desktop) + fix(design,lint): project selection + auto-sync + Sync to Web (ck_* token); canonical injectIntoTab + real appendEvent bridge.dispatch/worker.started in Fleet Runner runtime (replaces fake in-memory); hardened zellij.ts (session resolution + -- write-chars); ui-public-download-* + --public-accent (zero design violations); full cockpit->fleetcrown rebrand in desktop/scripts/docs/thoughts/marketing/home; update desktop README + docs/desktop-app.md with capabilities + gaps (in-memory vs real log)
- desktop build clean, tsc clean, lint 0, home/ 89/89
- advances desktop-2/3: dispatches now produce durable events in ~/.fleetcrown/events.jsonl with proper runId/sentinel so stop-hooks and web control plane treat them as first-class
- still no embedded watcher (idle via co-running home/watcher.ts for now)
Refs: desktop-app.md phases, Cockpit.roadmap T1/T2, prior landing
|
||
|
|
b08ac4da14 | feat(desktop): project selection + auto-sync on connect + Sync to Web (agent token to /runtime-state); switch to canonical injectIntoTab; ui-public-download-* classes (zero design violations); forward custom prompts as queueHead; clean lint; broad docs/marketing/scripts updates for FleetCrown desktop runtime | ||
|
|
8866ca5e51 |
fix(control): replace "Saved agent context" jargon with "Idle"
Browser dogfood 2026-05-31: user typed into the /control textarea
"Fix the 'Saved agent context Xw ago' wording — it sounds like a
security leak. Use 'Idle · last active Xw ago' instead." Caught
that the label was opaque jargon — it describes the INTERNAL
data state ("we have a saved handoff blob") rather than the
OBSERVABLE state for the human reader ("the agent is idle").
control-presenter.ts:563 — handoff-present-but-no-live-observation
case now reads "Idle" instead of "Saved agent context". The row's
timestamp column already shows recency (Xw ago) so the prefix
doesn't need to duplicate it.
Test updated to match the new wording. 19/19 stays green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
60732f9ac4 |
fix(control): kill three info-leaks in the /control project rows
User audit 2026-05-31 surfaced three loud noise sources in the project rows that were diluting every other signal on the page: 1. Saved-handoff dumps leaking into row activity text. Lines like "Saved handoff: Wait for user to (a) resolve the OAuth blocker by signing in with a fresh GitHub account..." were the agent's own internal notes being pasted verbatim into the user-facing table. getTabActivityText() now returns short lifecycle states only — "Ready — pick the next task", "Agent open · idle", "Closed", "Tab open · no agent process". Handoff content belongs in a per-project expand/tooltip, not the always-visible row. 2. "Last sync 6h ago" prefix repeated on every one of 21 project rows when the daemon was offline globally. staleEvidenceLabel() dropped the prefix in the common case — the global offline banner already owns the "system is stale" signal; rows should just describe last-known state. Preserve the prefix ONLY when there's no other evidence to show (rare). 3. "Tab #1 Unlinked" dangling scratch tabs surfacing in the workspace table. buildLiveTabRows now filters tabs that map to no registered project — they're visible noise that the user's actual zellij window already shows. The control surface is for fleet ops, not a generic tab list. Test updated to assert the filter behavior (Mystery tab dropped, registered tabs kept). All three were silent UX papercuts that the SSOT and gate work couldn't surface — the user had to point at the screenshot. control-presenter tests stayed 19/19 after the test rewrite. Items 2, 3, 4 of the 7-item Elon-team-pass plan. Items 5 (hierarchy) + 6 (header/rail vocab reconciliation) coming next. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
31b01ff44e |
fix(control): show Working state and mobile fleet summary
Runtime presenter no longer requires agentRunning for Working; handoff status:working does not stale an active prompt; fleet status bar for mobile. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
e4cc0d9a8c | Fix control runtime tabs and autopilot handoff | ||
|
|
7d7c40a0cd |
fix(control): detect direct-typed Claude prompts as working
Adds a claude case to _agent_direct_activity that reads the most recent ~/.claude/projects/<dashed-cwd>/*.jsonl mtime. The daemon already consumes this signal for grok; with claude wired in, prompts typed straight into the TUI (no Cockpit dispatch sentinel) surface as Working instead of falling through to Agent shell open. Gates direct-terminal evidence on readyAt so a just-finished agent stays Ready: a Stop hook fires after the last transcript write, and without the gate the next daemon tick would re-promote the stale mtime back to Working and overwrite the legitimate ready badge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
6da8d7ea1e | fix(control): clarify live agent runtime states | ||
|
|
7c28ab15f8 | refactor(control): create trustworthy agent operations workspace | ||
|
|
4dd97e05b2 | fix(control): label saved handoffs as historical | ||
|
|
b869bedd4c | feat(control): make local agent runtime self-healing | ||
|
|
3e948b43e9 | fix(control): report disconnected daemon truthfully | ||
|
|
ec6f423b0f |
feat(infra): Postgres portability, Oracle cutover scripts, and DB kill-switch essay
Vendor-neutral DATABASE_URL helpers, dump/restore/sync tooling, and one-command Oracle migration after a single console VM step. Publishes the studio-stack thoughts article and hardens build (dynamic layout, resilient sitemap). Co-authored-by: Cursor <cursoragent@cursor.com> |