Repository navigation
✨ Inbox: pills record where an item was shared, by whom and when - #18415
Conversation
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Mutation testing❌ gremlins did not produce a report for 1 package(s), so no verdict can be derived from this run (see the job log):
10 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
Verdict: |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Why:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 Review findings from Read the share-history change against the tree at Checked and fine: the One thing to look at: Review findings from Correctness review (head 0229286) 1. RFC publication lookup can match an older issue and mark a new share done (medium) Suggested fix: pass the record start time and add a -func (c *Client) FindIssueByBody(ctx context.Context, repo, marker string) (string, error) {
+func (c *Client) FindIssueByBody(ctx context.Context, repo, marker string, since time.Time) (string, error) {
...
- q := fmt.Sprintf("repo:%s is:issue in:body %q", repo, marker)
+ q := fmt.Sprintf("repo:%s is:issue in:body %q created:>=%s", repo, marker, since.UTC().Format("2006-01-02T15:04:05Z"))Thread Advisory (not blocking): |
There was a problem hiding this comment.
Read the share-history code against the head tree (src/pkg/inbox/{sharehistory,rfcpublish,service,shareintent,store}.go, static-src/js/inbox.js). The record lifecycle holds up: Route appends a record when ShareID is empty and FinishShares it on every deliver/fail path, and ShareWhenReady hands in.RecordID through intentRunner so the transcribe-then-share path continues one record rather than adding a second. A bare issue URL also parses fine through ParsePublishOutput (spek.go:132, issueURLRe), so RecordRFCPublished accepting the finder's URL works.
One low-severity open point:
src/pkg/github/client.go(FindIssueByBody): it takes the oldest issue in the target repo whose body contains the item'sReference:marker, with no author filter. Anyone who can open an issue on that repo and quotes the marker first (the marker is printed into a public RFC body by design,spek.goprompt) would makeCheckRFCPublicationsmark the sharedoneand link the pill to their issue. Impact is a wrong link on a dashboard pill, not code execution, so I'd treat it as low. If you want to close it, filter on the agent's issue author or require the marker line to be the exactReference: …line.
Everything else I checked (tests for the pills and the history store, the changelog fragment, docs in inbox-voice-sources.md) looks consistent with the PR description. Not approving, per policy; this is a read from the tree, not a signature.
— hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.325
49ab520 to
3bfb9f2
Compare
There was a problem hiding this comment.
Read the new inbox pieces against the code: CheckRFCPublications (src/pkg/inbox/rfcpublish.go), RecordRFCPublished, ParsePublishOutput (a bare issue URL parses, so passing the finder's URL works) and the Route/deliver/fail share-record paths. Looks correct to me, with one low-severity edge case.
Low — a re-share can link the earlier RFC (src/pkg/github/client.go:5471). FindIssueByBody searches in:body "<marker>" sorted by created ascending and returns the first hit. The marker is the item's Reference: line, which is the same for every share of that item. If an item is shared to a repo that already holds its RFC (retry after the 6h expiry, or re-share after done), the next CheckRFCPublications marks the new record done against the old issue before the new agent has published. Open question for the author: is that acceptable, or should the finder only accept issues created after the record's StartedAt?
Nothing else verified as a defect.
— hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.325
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
3bfb9f2 to
c5f3c09
Compare
Review follow-ups (below
|
There was a problem hiding this comment.
Security delta re-review at 9f958f3 (read the PR's own 18-file diff; the 113-file compare is mostly base drift).
Previous finding (correctness, client.go:5471, re-share links earlier RFC): still present. FindIssueByBody still returns the oldest match (Order: "asc", PerPage: 1) with no lower bound on creation time. Already in the backlog, not re-reported.
Checked and clean: the pill UI escapes every interpolated field with escapeHtml (inbox.js). Link hrefs are limited to ^https?:// or a #section-sessions?session= fragment built with encodeURIComponent, and are withheld from read-only viewers. share_history stores metadata only, and reasons are clipped to 300 runes.
New, low severity: the RFC completion lookup trusts any issue body in the target repo.
CheckRFCPublications(rfcpublish.go) searches the target repo for any issue whose body contains the item's provenance string.- That string is predictable, e.g.
hive://meetings/<id>or<source>://recordings/<id>(livemeetings.go, meetingsource.go). - Anyone who can open an issue in that repo, and who reaches the item id, can plant the marker first. The oldest match wins, so the hive marks the route filed. The pill then links to the attacker's issue.
- Impact is limited to a wrong http(s) link and a suppressed retry, because the UI restricts hrefs. Still, the result is "trusted" without checking who authored the issue.
Suggested hardening in FindIssueByBody: require the issue author to be the hive or agent login, or a maintainer. Also ask the search for created after the share's StartedAt, which would fix the earlier correctness finding too.
— hive: agent=adjudicator-2 backend=claude model=claude-sonnet-5-5 claude=2.1.325
There was a problem hiding this comment.
Read the Go side in the tree (pkg/inbox/rfcpublish.go, sharehistory.go, spek.go:113-145) and the pill JS. The UI, history storage and status transitions look correct to me. One verified defect in how a delegated RFC is matched to its issue:
Medium: a retry can attach the previous attempt's issue (src/pkg/github/client.go, FindIssueByBody, Sort: "created", Order: "asc"; caller CheckRFCPublications in src/pkg/inbox/rfcpublish.go)
- The marker is the item's provenance (
plaud://recordings/<id>), which is identical for every share of the same item.FindIssueByBodyreturns the oldest issue containing it, and there is no check that the issue was created after the share record'sStartedAt. - Mechanism: share to RFC, the agent publishes issue A, and the record becomes
done. The user later re-shares, or a first share expired after 6h and the user retried. The newin_progressrecord is checked on the next sweep, the search returns issue A,RecordRFCPublishedmarks the second sharedonepointing at A, and the route isfiledimmediately. This happens before the new agent publishes anything. - Consequence: the pill and route state show a completed RFC that is the old one, and the real new RFC is never linked.
- Suggested fix: pass the record's
StartedAtto the finder, e.g. acreated:>=qualifier or filtering onCreatedAt, and take the oldest issue at or after that time.
Open question, not a defect: FindIssueByBody relies on GitHub search indexing. The 6h expiry covers lag, but nothing covers the agent omitting the Reference: line, which only the prompt asks for. The failure message says as much, so this looks acceptable.
I did not review the store.go, shareintent.go or spek.go hunks line by line. The changelog fragment is at the repo-root path as required.
— hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.325
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Security review at 0229286. No blocker. One advisory.
Low: RFC linking trusts any issue body containing a guessable marker. FindIssueByBody (src/pkg/github/client.go, new func at the end of the file) takes the oldest issue in the repo whose body matches the item's Reference: provenance line. CheckRFCPublications (src/pkg/inbox/rfcpublish.go, the find(ctx, rt.Repo, marker) call) then records that URL as the share target without checking who authored the issue. Provenance values are predictable, for example plaud://recordings/rec-3 in api_sessions_seed_test.go. Anyone who can open an issue in the RFC repo can plant the marker first. They could also match an older RFC for a previously shared item. The pill would then link a dashboard user to that issue and show it as done. The link is limited to http(s) and is rendered with rel=noopener noreferrer, so this is spoofing of a status link, not code execution.
Suggested hardening: filter results to authors the hive trusts, or require the issue author to be the hive's bot or the actor. In go-github terms:
- return result.Issues[0].GetHTMLURL(), nil
+ for _, is := range result.Issues {
+ if trustedAuthor(is.GetUser().GetLogin()) { return is.GetHTMLURL(), nil }
+ }
+ return "", nilAlso raise PerPage above 1 so a spoofed issue can't mask the real one.
The rest looks fine. In inbox.js, pill text, title, data-* attributes and href all go through escapeHtml. The URL scheme is limited to ^https?://, and the spek deep link uses encodeURIComponent. The actor comes from the server-side session, not from request fields.
— hive: agent=adjudicator-2 backend=claude model=claude-sonnet-5-5 claude=2.1.325
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Once an Inbox item is shared, it now shows a pill per share recording what, who, where, when and the status.
share_historyper item (destinationrfc|dibs|knowledge|spek, actor, started/finished, statusqueued|transcribing|in_progress|done|failedplus reason, and a target ref: URL, number, id, name). Stored with the item state (0600, atomic); the existing per-destination route state is unchanged and old state files load. Records hold metadata only, never item text or secrets (reasons are clipped).inbox-auto), and transcribe-first shares (transcribing, then queued, in progress, done or failed). A delegated RFC staysin_progressuntil the hive finds the published issue: the kick has no completion signal the inbox can observe (it usesSendKickAsync, which returns no kick id), soService.CheckRFCPublications(after each sync and every 10 minutes, wired inboot_inbox.go) searches the target repo for an issue whose body carries the item'sReference:provenance line (the agent prompt now asks for it verbatim) viaClient.FindIssueByBody, then callsRecordRFCPublishedto fill the URL and number. With no issue after 6 hours (Service.RFCPublishWait) the record and the route fail with the reason, so the menu offers Retry.Service.RecordShare(key, ShareRecord{Destination: "spek", Actor, ...})returns an id, thenService.FinishShare(key, id, status, reason, &ShareRef{ID: sessionID, Name: sessionName}). A transcribe-first spek share gets its record id asShareIntent.RecordID.→ RFC #18412 · andy · 2m agostyle, in-progress with a spinner, failed in the error status with the reason in the title; plain links to the RFC/dibs item/spek session/fact (a span for read users); latest record per destination with a+Nexpander for the full history; existing tokens only.#section-sessions?session=<id>; the spek PR should confirm or adjust.🤖 Generated with Claude Code