mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 12:27:28 +01:00
fix/queue-blocker-date
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4735397aa0 |
fix(feedback): the reporter page was the counter-example to its own top report (#806)
* fix(feedback): the reporter page was the counter-example to its own top report /my-feedback rendered a report asking for a three-line clamp at full eight lines, under a chip reading "Being implemented". The clamp WAS implemented — FeedbackReportText, #783, written in answer to that very report — but only in FeedbackItemRow, the operator's inbox. The reporter page kept its own row markup, so the fix never reached the person who asked for it. The missing import is the symptom. The defect is that a third feedback surface existed with its own renderer and nobody knew, so this fixes the page and closes the gap that let it drift. The page now: - renders bodies through the shared FeedbackReportText, so one dictated report stops owning the list; - derives status instead of dictionary-mapping the DB word. `dispatched` meant queued, running, crashed days ago, or shipped-but-unconfirmed, and all four read "Being implemented"; work-phase.ts opens by saying DB status cannot answer that question, and this page was the last one still asking it; - gives the reporter a next action — "Check the live page" once a fix is actually deployed, never while its pull request is open; - colours the chip. Every state used .ui-badge, the same neutral pill as a duplicate count, so the one thing a reporter comes here to learn carried the weight of a footnote; - formats dates in the READER's locale and time zone. toLocaleString() ran in a server component, so a Swiss reporter was shown a US date on the box's clock. The operator row never had this; it is already a client component; - labels the project name, which sat unlabelled exactly where a person's name would and read as one. What a reporter may see is decided in one place. reporter-view.ts writes every reporter-facing sentence rather than forwarding FeedbackWorkView's, because that view is written for whoever owns the machine: `detail` carries builder asks, `diagnostic` the agent's raw error, `stepSummary` run-hop narration, plus run and command ids. A pass-through would have been shorter and would have put an engineer's note on a stranger's screen. attachReporterView is likewise a narrow read, never attachFeedbackWork — that one refreshes GitHub ledgers, sends the owner's notifications and scopes to the owner, none of which belongs on a reporter's page load. Reporter run lookup is deliberately not owner-scoped, and authorization comes from the report instead: the caller has proved reporter_user_id, and passes only the dispatched_run_id values off those rows. Guards, so the next clamp-class fix cannot land on one surface only: - feedback-reporter-view.ts pins that the page renders through the shared clamp, formats no date server-side, maps every phase, and leaks no operator-only string for any phase; - CLAUDE.md names /my-feedback in Views — it listed /feedback and ControlInbox and not this one; - /feedback and /my-feedback join audit:responsive, which would have caught an eight-line row at 390px. Dropped the subtitle's "Tracking a report never grants permission to edit its project." It answered a question no reporter asked and spent the line that now says what the page is for; the boundary it described is enforced in code and pinned by tests, not by that sentence. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FuaeWPc8gT5sbS7G8BjnrK * fix(feedback): read the reader's clock without setState in an effect `react-hooks/set-state-in-effect` rejected the first cut, and correctly: a useEffect that immediately setStates is a cascading render, and the rule does not care that the second render is the point. The constraint that produced it is real, though. Only the browser knows the reader's time zone, so the localized string cannot exist during SSR — and server and client must still emit identical markup or React throws the tree away. useSyncExternalStore with a server snapshot answers both, and is the shape this repo already reaches for: BrandVersion says "client-only, with a null server snapshot so SSR/hydration match (no setState-in-effect)" in as many words, and NotificationsPill uses the same mounted gate after a React #418 on every authenticated page. Also drops the now-redundant `title`: after hydration the visible text IS the full localized string, and `dateTime` carries the exact instant for machines at every stage. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FuaeWPc8gT5sbS7G8BjnrK --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
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> |
||
|
|
0d0e91657b |
feat(crew): assign work to humans, and pay them in bitcoin (#391)
* feat(crew): assign work to humans, not just agents FleetCrown dispatches intents to agents. Some work is not an agent's to do — calling twelve suppliers on the company's behalf, signing something, walking into a room. That half of the fleet had nowhere to live, so it lived in the operator's head. This adds it as a surface: /crew, the humans in the loop and the work handed to them. Three laws, each because the alternative is worse: A person is not a queue. `assigned` only ever means you ASKED. The answer is theirs — accept, decline, or deliver — and OPERATOR_MOVES cannot reach `accepted` or `declined`, so FleetCrown can never record consent nobody gave. Declining is a first-class button on the share page, not small print: an ask you cannot refuse is an order. Nothing reaches a human by accident. An assignment is born a DRAFT, and a draft has told nobody anything. Handing it over mints the share link, and that is the only act in the feature that reaches a person — which is what makes it safe to let Loki propose one (propose_human_task writes a draft, exactly as propose_action does). Money is OrangeCat's. A task states its fee so both sides see the terms; a paid one mirrors to OrangeCat as a service and keeps the pointer. FleetCrown decides WHO does the work; OrangeCat settles what it costs. That seam is the missing link between the two products. The roster is not a new table. A crew member is a person already in the operator's book (`entities`, type person) carrying `crew:member`, so enrolling someone you know adds no row, un-enrolling keeps every note and assignment, and the book can never disagree with the roster. The actor kernel gains a DELEGATE capability opposite MARKET: a robot physically cannot join the crew, and a person still cannot be listed, booked or sold — assertAttrAllowed enforces both directions. The assignee never signs in. They open a link and answer; the token is their credential, looked up with revoked links excluded, and it can only ever answer for its own assignment. Revoking an unanswered ask pulls it back to draft, because a board that says "asked" over a dead link lies to you every morning. Verified against real Postgres, not just types: the whole query layer end to end (enrol → draft → hand over → accept → deliver → accept the work → revoke → re-share), and the public surface over HTTP — page renders, accept succeeds, a replayed accept is 409, an invented action is rejected, unknown tokens 404, and /api/crew plus /crew stay gated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YKERdritcwNRuPW72zv8c3 * feat(crew): pay in bitcoin, to the person who did the work Three corrections, all of them about the same thing: a fee is a promise to a human, and every part of it has to be true. BTC is now an assignable currency. The list is exactly the enum OrangeCat's services API accepts (USD, EUR, CHF, GBP, BTC) — a currency FleetCrown offers but OrangeCat rejects is a fee that cannot be mirrored. fee_amount becomes NUMERIC(20,8), not real. float4 carries ~7 significant digits, so it cannot represent a satoshi: 0.00050001 BTC would have been silently rounded on the way to disk, and the amount someone is owed is the last field in this system allowed to drift. Verified against Postgres — that exact figure now round-trips to the last satoshi. Two-decimal formatting had the same bug on screen, printing "BTC 0.00" for 50,000 sats, on the page where a person decides whether to say yes. And the payment goes to THEM. `publishTaskToOrangeCat` creates a service under the studio's integration key, so paying that listing pays the studio — the SDK's actor_id is documented as ignored for integration keys, and OrangeCat has no endpoint that creates an actor, because a profile carries a wallet and a wallet belongs to whoever holds its keys. So the roles are split honestly: the listing is the record of the engagement, and `crew:orangecat_profile` — their own OrangeCat page, Lightning wallet and all — is the destination. It rides on the task as `assigneePayUrl`, gives the operator a "Pay Jana BTC 0.0005" button, and tells the assignee where the money lands before they accept. A paid assignment with no destination on file says so out loud on both sides rather than looking complete. Profile links are stored canonical (a handle and a pasted URL are one wallet, not two) and anything that is not a profile is refused rather than half-saved. The migration is regenerated rather than stacked: 0060 was never applied anywhere, so the column is born numeric instead of being altered later. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YKERdritcwNRuPW72zv8c3 --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
033b780326 | feat(control): complete terminal and orchestration trust pass | ||
|
|
cdc042a131 | feat: ship activity runtime parity fixes |