Skip to content

✨ inbox: mail-in files as email items with an owner approval queue (Betty C2 part 5) - #18471

Merged
kubestellar-prow[bot] merged 3 commits into
v5from
feat/18395-inbox-email
Nov 16, 2026
Merged

kubestellar-prow[bot] merged 3 commits into
v5from
feat/18395-inbox-email

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Part 5 of #18395 (Betty C2, email in; plan #18391 "Mail-in files", design src/docs/design/email-inbox.md). Builds on #18431 (allowlist, relay-signed endpoints).

What

  • POST /api/inbox/email (relay-signed, already in isPublicPath): hive-mx's Markdown, audio and image attachments become items of a new built-in Inbox source email (pkg/inbox/email_source.go), spooled under connector-state/email/items/<id>/ (0700 dirs, 0600 files, 256 MiB quota, 507 when full). Item ids are stable per message, recipient and file, so a retried delivery dedupes.
  • Allowlist: a sender whose From passed DMARC alignment and is a proven calendar email of a user with access gets normal items. Anyone else's items carry awaiting_approval: Route (except Knowledge only), auto-routing rules (Sweep, not marked seen so rules apply after approval) and transcription (Transcribable) skip them. POST /api/inbox/email/{id}/approve / decline (owner) approve or delete; unapproved items expire after 14 days. 409 when meetings.email.files_enabled is off.
  • Markdown is the item text wrapped as untrusted (WrapUntrusted), audio goes through the existing transcription path through a new AudioOpener seam (the transcriber reads the spooled file; no link is minted), images are stored attachments. GET /api/inbox/email/{id}/file (owner/read-write) serves the sniffed type (Markdown as text/plain), inline only for images, nosniff and Content-Security-Policy: default-src 'none'; sandbox.
  • Inbox UI: ✉️ source, sender and received time, an awaiting approval pill with ✓ Approve / ✕ Decline for the owner (no Share until approved), 📎 Open file, image thumbnails. static/index.html regenerated.
  • Docs: inbox-voice-sources.md ("Files mailed to hive@"), openapi.json, api-reference.

Tests: spool add/list/fetch/dedupe/approve/decline/expiry/quota/open, the service gates (route, sweep, dismiss still allowed, rules after approval), audio transcribed from the spool with the fake transcriber, and the dashboard endpoints (allowlisted vs outsider, owner-only approval, file headers by kind, quota/off/no-source/blocked-spool errors).

🤖 Generated with Claude Code

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ 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

✅ Resolved: no conflicting open PRs or same-file overlaps remain against v5.

@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
@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 branch conflicts with the base and needs a rebase

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: rebased onto v5 (one conflict in transcription.go, resolved by taking v5's localTranscribeAudio path for AudioOpener); CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

5 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/pkg/dashboard/api_inbox_email.go 57 CONDITIONALS_NEGATION
src/pkg/inbox/email_source.go 39 ARITHMETIC_BASE
src/pkg/inbox/email_source.go 39 ARITHMETIC_BASE
src/pkg/inbox/email_source.go 198 CONDITIONALS_NEGATION
src/pkg/inbox/email_source.go 309 CONDITIONALS_NEGATION

Verdict: uncovered (#17349).

@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

@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
@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2026
…etty C2, part 5)

POST /api/inbox/email takes the Markdown, audio and image attachments
hive-mx received for hive@<host>, relayed and signed by the hub, and
spools them as items of a new built-in email source under
connector-state/email/items (0700/0600, 256 MiB, ids stable per message
and file so a retried delivery dedupes). A DMARC-aligned sender on the
calendar email allowlist gets normal items; anyone else's carry
AwaitingApproval: Route (except Knowledge only), auto-routing rules and
transcription skip them until the owner approves
(POST /api/inbox/email/{id}/approve); decline deletes, and unapproved
items expire after 14 days.

Markdown is the item text wrapped as untrusted; audio goes through the
same transcription path as voice items via a new AudioOpener (read from
the spool, no link); images are stored attachments served by
GET /api/inbox/email/{id}/file with the sniffed type, nosniff and a
sandbox CSP. The Inbox shows the sender, an awaiting-approval pill with
Approve/Decline, Open file and image thumbnails (static/index.html
regenerated). openapi.json, api-reference and inbox-voice-sources.md.

Part of #18391, #18395.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive
hivecommons-hive Bot force-pushed the feat/18395-inbox-email branch from de39e82 to 61aaff5 Compare November 16, 2026 20:12
@kubestellar-prow kubestellar-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 16, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2026
@clubanderson clubanderson added the lgtm Indicates that a PR is ready to be merged. label Nov 16, 2026
@kubestellar-prow
kubestellar-prow Bot merged commit fca811e into v5 Nov 16, 2026
96 of 100 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/18395-inbox-email branch November 16, 2026 20:30
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. 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