f779415b2bd0dcefb1fd36e9481308f514947e21
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f779415b2b |
fix(forge): consume a decided account notification
ci / checks (push) Canceled after 0s
ci / test (push) Canceled after 0s
ci / chart (push) Canceled after 0s
ci / docker (push) Canceled after 0s
ci / web (push) Canceled after 0s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Canceled after 0s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Canceled after 0s
ci / publish-edge-chart (push) Canceled after 0s
android / debug (push) Canceled after 0s
android / release (push) Canceled after 0s
The account feed is at-least-once in a way the dedup ids do not cover.
`since` is inclusive at the boundary and `NotificationPage::finish`
advances its cursor only to the newest row seen, so a row the poll cannot
get past — anything at or before the cursor, which is every poll — comes
back for as long as the forge still considers it unread. Nothing marked
it read, and the daemon's cursor map is in memory, so a restart asked for
the whole unread feed again.
The result is a re-dispatch loop: the same notification id re-triaged
every pass, a fresh turn for a thread that already has one, and a second
comment on that thread if the first turn ever finished inside its lease.
Observed live on `vhaudiquet/orcaslicer-snap#10`: key revision 1 → 2 at
the 00:35 poll, `inbox_depth: 0`, no outcome — a re-dispatch of a turn
that was already running.
So consume what the poll decides:
- `Forge::mark_read` — a new default no-op on the trait, implemented for
GitHub as `PUT /notifications/threads/{id}`;
- `Notification::read_key` carries what that route keys on (GitHub keys
on the notification id, which the dedup id embeds only as text), and
defaults on deserialize so a payload already in an inbox still decodes;
- `poll_account` marks each row read once it is triaged — dispatched,
surfaced, or ignored; best-effort, since an unread row costs a repeat
and never a lost event.
Gitea and GitLab keep the no-op: neither has an account watch here yet.
|
||
|
|
d74b1c40df |
feat(claw): answer a thread only when somebody addresses the daemon
android / release (pull_request) Skipped
android / debug (pull_request) Successful in 4m7s
ci / checks (pull_request) Successful in 1m12s
ci / docker (pull_request) Successful in 1m22s
ci / web (pull_request) Successful in 13s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (pull_request) Skipped
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (pull_request) Skipped
ci / publish-edge-chart (pull_request) Skipped
ci / test (pull_request) Successful in 39s
ci / chart (pull_request) Successful in 5s
android / release (push) Successful in 2m2s
ci / checks (push) Successful in 59s
ci / test (push) Successful in 37s
ci / chart (push) Successful in 6s
ci / docker (push) Successful in 1m22s
android / debug (push) Successful in 3m51s
ci / web (push) Successful in 13s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 1m29s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 9s
ci / publish-edge-chart (push) Successful in 4s
A repo watch saw *every* issue, pull request, review and comment on the repository, and the handler treated each dispatch as work to do: a snapshot fetch, a coding-agent turn, and a comment posted back. On a repository with any traffic at all that is the wrong end of the question — watching a repo is not volunteering to answer it — and it is also how a daemon ends up talking to itself, since its own replies are news too. The dispatch now starts with a mention gate. A thread runs when: - it delivered a triaged notification — assigned, review requested, @-mentioned: the notifications feed already adjudicated that one; or - one of its plain events names the handle the daemon speaks as (`@kosmos`), written by anybody *but* the daemon. Everything else is drained and dropped: no snapshot, no model call, no comment. The outcome is `Superseded` — RSD's vocabulary has no "nothing was asked", and the closest is that the work the event names is not this daemon's. Recognizing its own name took a little plumbing. The credential a watch resolves carries a login only when an account identity supplied the token; a token pasted into a watch row, or a forge environment variable, names nobody — and that is the deployment the gate must not go inert on. So `Forge::viewer_login` is the backend's own answer to "who am I", from its `/user` (Gitea and GitHub spell it `login`, GitLab `username`), with a `None` default for backends that cannot say; the handler asks at most once per credential and keeps the answer beside the cached client. A forge that will not name the credential leaves the gate *open*, with a warning in the log: a filter that silently mutes a watch is worse than one that occasionally over-answers. The actor check is load-bearing for the same reason the gate exists: a reply quotes the mention it answers, so "addressed by name" alone would have the daemon answer itself, forever. Tests: unit tests for the gate (name in any case, own comment, no body, notification, unnamed credential), one end-to-end test per behaviour — a mention runs one turn and posts one reply; a thread's own chatter runs nothing and posts nothing; the daemon's own reply does not reopen the gate — plus `viewer_login` against all three backends. |
||
|
|
2f6c369e02 |
fix(forge): a gitea comment names its thread without issue_url
`comment_event` read the thread number from `issue_url` alone and failed
the whole poll when it could not. The instance behind git.vhaudiquet.fr
sends `issue_url: ""` on every row of the repo-wide `/issues/comments`
feed, so the first comment row failed the pass with
malformed forge response: comment issue_url without a thread number:
and kept failing on every poll since the watch was created — 5296
consecutive failures, no event ever reported, no comment, no pull
request, nothing. The feed being broken was invisible: a watch that has
never polled once looks exactly like a quiet repository.
The number now comes from the first URL that carries one
(`issue_url`, then `pull_request_url`, then `html_url`), and a fragment is
dropped first: a comment's `html_url` points at the comment
(`…/pulls/1#issuecomment-164`), not at its thread. `is_pr` reads the same
three URLs, so a PR comment whose `issue_url` is blank still lands on the
pull request's sequence.
A row with no number anywhere is still a loud parse error — the
fallbacks must not degrade into a silently skipped event.
|
||
|
|
d31dfeae27 |
fix(forge): a gitea 401 retries once as basic auth
A self-hosted Gitea answers 401 to `Authorization: token <password>` and 200 to the same value as `user:password`, and the account store's `secret_kind` cannot tell the two apart — it is a label the human typed at `identity_save`, so a login password saved as a token is indistinguishable from a real PAT until the forge answers. `GiteaForge` had one auth path: the token header, on every call. A watch whose credential resolved to a password therefore 401'd on every poll, forever, while the same secret worked for `git push` over https (the credential helper sends it as a password). The watch looked quiet instead of broken. `GiteaForge::with_login` names the login that owns the secret, and `send` tries the token header first, then — on a 401 only — the same value as Basic auth. The retry is cloned before the token header lands, so the fallback request carries one `Authorization` header and not two. No login (a pasted watch token names none) or an unclonable body leaves the 401 to surface exactly as it did before. The login reaches the client in the next commit; this one is the adapter half, tested against a mock that refuses the token header and accepts the Basic one. |
||
|
|
00adf092ff |
fix(forge,claw): forge keys separate the issue from the pull
The watch key encoded source, repo, and number but not the thread
kind, and on GitLab an issue and a merge request share one number
space: iid 7 twice produced one key, one snapshot, and comments on
the merge request landing in the issue (or a 404 fallback that
misrouted the other way). The key carries the kind now —
{source}:{kind}:{owner}/{name}#{number}, with GitLab spelling the
pull variant mr — comment and snapshot route outright by kind, and a
kind-less payload parses to the unparsable key instead of guessing
issue. The claw's callers thread the kind from the payload and strip
the segment where the bare repo is wanted; pre-kind stored keys parse
as None rather than misroute. Four route-pinning wiremock tests cover
the GitLab split, and the GitHub/Gitea clients take the kind without
using it (their issues and PRs share the same REST space).
|
||
|
|
81da26b955 |
feat(rhema-code): add the colors setting with four palettes
The stored `colors` key names a palette — rhema (the default, Jadeite), aquamarine, black-and-white, or dracula — and the Appearance page of /settings cycles it live, like the theme and icon toggles beside it. Each palette carries a dark and a light appearance under the existing `theme` key; dracula's light side is derived, the official palette ships only dark. The appearance decision moves off token comparison: Theme now answers is_dark() from the ground/text luminance, so palettes beyond the original two get the right per-profile fallback tones. |