Skip to content

✨ Inbox: pills record where an item was shared, by whom and when - #18415

Merged
kubestellar-prow[bot] merged 11 commits into
v5from
feat/inbox-share-history
Nov 16, 2026
Merged

kubestellar-prow[bot] merged 11 commits into
v5from
feat/inbox-share-history

Conversation

@clubanderson

@clubanderson clubanderson commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Once an Inbox item is shared, it now shows a pill per share recording what, who, where, when and the status.

  • Backend: an append-only share_history per item (destination rfc|dibs|knowledge|spek, actor, started/finished, status queued|transcribing|in_progress|done|failed plus 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).
  • Populated from every path: the Share menu and route API, the bulk Hive (Knowledge) path, auto-routing (actor inbox-auto), and transcribe-first shares (transcribing, then queued, in progress, done or failed). A delegated RFC stays in_progress until the hive finds the published issue: the kick has no completion signal the inbox can observe (it uses SendKickAsync, which returns no kick id), so Service.CheckRFCPublications (after each sync and every 10 minutes, wired in boot_inbox.go) searches the target repo for an issue whose body carries the item's Reference: provenance line (the agent prompt now asks for it verbatim) via Client.FindIssueByBody, then calls RecordRFCPublished to 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.
  • Helper for the spek PR: Service.RecordShare(key, ShareRecord{Destination: "spek", Actor, ...}) returns an id, then Service.FinishShare(key, id, status, reason, &ShareRef{ID: sessionID, Name: sessionName}). A transcribe-first spek share gets its record id as ShareIntent.RecordID.
  • UI: pills next to the existing ones, → RFC #18412 · andy · 2m ago style, 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 +N expander for the full history; existing tokens only.
  • Tests: Go (records per path, status transitions, RFC target after publish, no text stored, transcribe-first and failure) and node (pill per destination and status, links, collapse/expand, read role).
  • The spek session link uses #section-sessions?session=<id>; the spek PR should confirm or adjust.

🤖 Generated with Claude Code

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18432 ✨ Inbox: auto-transcribe hive recordings same files src/cmd/hive/boot_inbox.go
src/pkg/dashboard/static/index.html
#18419 ⚠️ Retire the inception API, watcher and brainstorm inception mode same files src/pkg/dashboard/static/index.html
#18449 ✨ OpenRouter: current defaults, live-filtered suggestions, searchable grouped model picker same files src/pkg/dashboard/static/index.html
#18431 ✨ meetings: email invites with an allowlist of proven calendar emails (Betty C2 part 4) CONFLICT src/cmd/hive/boot_inbox.go (conflict)

@kubestellar-prow kubestellar-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 16, 2026
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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):

  • pkg/dashboard: gremlins exited 1

10 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the mutation/acknowledged label to accept this.

File Line Mutation
src/cmd/hive/boot_inbox.go 26 ARITHMETIC_BASE
src/cmd/hive/boot_inbox.go 83 CONDITIONALS_NEGATION
src/pkg/github/client.go 5474 CONDITIONALS_NEGATION
src/pkg/github/client.go 5474 CONDITIONALS_NEGATION
src/pkg/github/client.go 5481 CONDITIONALS_NEGATION
src/pkg/github/client.go 5484 CONDITIONALS_NEGATION
src/pkg/inbox/rfcpublish.go 12 ARITHMETIC_BASE
src/pkg/inbox/rfcpublish.go 66 CONDITIONALS_NEGATION
src/pkg/inbox/rfcpublish.go 68 CONDITIONALS_NEGATION
src/pkg/inbox/shareintent.go 134 CONDITIONALS_NEGATION

Verdict: error (#17349).

@hivecommons-hive

hivecommons-hive Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Why:

  • the review swarm requested changes

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: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 3bfb9f2ed

— hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325

Review findings from reviewer (folded here because this head already carries its hive review):

Read the share-history change against the tree at 48cbe54; the record lifecycle looks correct to me.

Checked and fine: the ErrAlreadyTranscribed recursion in ShareWhenReady (shareintent.go:130) does continue the record created above, since in.RecordID is set before the recursive call and flows through Route as ShareID. CheckRFCPublications passing the bare issue URL into RecordRFCPublished works because ParsePublishOutput falls back to issueURLRe (spek.go:132).

One thing to look at: FindIssueByBody (pkg/github/client.go, new at the end of the file) uses GitHub issue search with in:body "<marker>", sorted oldest-first, PerPage: 1. Search phrase matching is token-based, not an exact substring, and it takes the oldest hit. So any earlier issue in the target repo whose body mentions the same recording reference (a prior failed/expired attempt that was retried, or a manual issue) would complete the new share with the wrong URL. Also %q Go-escapes the marker, which differs from GitHub's quoting if a reference ever contains " or \. Suggest filtering the returned issue bodies for the exact Reference: <marker> line the prompt now asks for (spek.go prompt change) before accepting a hit. Low severity, and not something I could confirm against live search behaviour.

Review findings from adjudicator (folded here because this head already carries its hive review):

Correctness review (head 0229286)

1. RFC publication lookup can match an older issue and mark a new share done (medium)
Client.FindIssueByBody (src/pkg/github/client.go, new func at end of file) searches repo:… in:body "<marker>" sorted created asc, PerPage: 1. It returns the oldest issue carrying the item's Provenance marker, with no lower bound on creation time. CheckRFCPublications (src/pkg/inbox/rfcpublish.go) uses the result without comparing it to the in-progress record's StartedAt. If the same item was already published to that repo, a retry or re-share is completed at the next sweep with the old issue's URL, and the new agent's RFC is never linked. The same happens after a 6h expiry if the user retries.

Suggested fix: pass the record start time and add a created:>= qualifier, and keep the oldest-first sort so it picks the first issue after the share began.

-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 started through RFCFinder and the boot_inbox.go closure. Add a test where an issue older than StartedAt exists and must not complete the share.

Advisory (not blocking): AppendShare builds ids as sh-<StartedAt nanos>-<len(History)> (src/pkg/inbox/store.go). Once history hits maxShareRecords, len stays constant, so two records with an equal timestamp (injected test clocks) get the same id and UpdateShare hits the first match. Use a counter or a random suffix.

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 16, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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's Reference: 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.go prompt) would make CheckRFCPublications mark the share done and 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 exact Reference: … 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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 16, 2026
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Review follow-ups (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line are listed here instead of as issues, one comment per PR, updated in place. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 low correctness — Merged spek-session sends record no share history (src/pkg/inbox/store.go:10794): The Inception-session send merged from v5 (✨ Inbox: send items into an Inception (spek) session #18405) marks the route via Store.MarkSession (DestSession route) but never calls RecordShare/FinishShare. The only non-test callers of RecordShare use the …

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. FindIssueByBody returns the oldest issue containing it, and there is no check that the issue was created after the share record's StartedAt.
  • 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 new in_progress record is checked on the next sweep, the search returns issue A, RecordRFCPublished marks the second share done pointing at A, and the route is filed immediately. 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 StartedAt to the finder, e.g. a created:>= qualifier or filtering on CreatedAt, 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

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 16, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 16, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 "", nil

Also 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

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 16, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@clubanderson clubanderson added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 16, 2026
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 16, 2026
@kubestellar-prow
kubestellar-prow Bot merged commit f93d7df into v5 Nov 16, 2026
99 of 102 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/inbox-share-history branch November 16, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant