Skip to content

feat(hosted-worker): E5 slice 1 — signed publish writes publish_record + PublishIndex entry (#12800) - #16854

Merged
dezren39 merged 1 commit into
mainfrom
felix/e5-publish-slice1
Nov 29, 2026
Merged

dezren39 merged 1 commit into
mainfrom
felix/e5-publish-slice1

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

E5 slice 1 of #12800 (queue task 25963, Felix lane 0640-AO). Refs #12800 — the issue stays open: read-token wiring, retraction, and F's tier-policy hook are follow-on slices.

What

pkgs/id/hosted-worker/src/publish-index.ts — the PublishIndex service from the hosted-tenancy design (§6 public plane, §3 DO inventory, §8 #9106 mapping), in the shape the landed tenancy services established (credentials.ts / identity-link.ts: pure functions over the DO SqlStorage seam, domain refusals returned, never thrown, never partially applied).

A signed publish passes the #9106 gate in the B32 order, before any write:

  1. signature presence (unsigned → refused)
  2. signer binding — the signing key must be the publisher binding's bound key (binding.iroh_id); unknown/inactive binding fails closed
  3. signature validity over the canonical preimage (domain-separated, length-prefixed; binds tenant, publisher binding, content hash, kind, artifact digest, envelope id)
  4. semantic validation — declared digest must equal SHA-256 of the presented bytes; content hash must be a content address; kind in the schema's closed vocabulary
  5. authorization — tenant active; live publisher role grant scoped to the tenant; the epic: ID/Atlas extensible primitives, federation, namespaces — major design iteration (2026-11-12 directive) #9106/B31 tenancy projection: newest peer_policy for the tenant must have a class that can have signed data accepted (fully_trusted/accept_signed_from), accept_data configured, and be inside its validity window (class is a ceiling, configuration is the grant)
  6. replay — an admitted envelope id, or content the tenant already has live, is refused

An admitted publish commits exactly one publish_record (signed_artifact = digest + envelope id; the admitted policy_version recorded) and exactly one publish_index_entry in a single transaction. lookupPublish serves the index and already honours retracted_at. Nothing branches on participant_kind/backend (peer principle).

Tests

test/publish-index.test.ts (added to the package test script): 14 tests over the real tenancy migrations — the accepted path asserting both rows field-by-field, and refusal tests for unsigned, unbound signer, bad signature, digest mismatch, bad kind, suspended tenant, revoked role, send_only class, missing accept_data, expired/missing policy, and both replay shapes — each asserting zero rows written. Verification run: fleet-command 46282462368 (result recorded on #12800).

Not in this slice

Public-DB read-token wiring, the retraction operation, F's tier-policy hook, and the Worker route / PublishIndexDO wiring — the service is the seam those land on (the PublicationService precedent: library first, wiring followed).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T16:10:35Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "ac3f377b7f752f50918f491d7443b79e95b5dc34"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…d + PublishIndex entry (#12800)

The PublishIndex service (design §6/§3/§8): a signed publish from a
publisher-role tenant passes the #9106 gate in the B32 order —
signature presence, signer binding to the publisher binding's bound
key, signature validity over the canonical preimage, semantic
validation (digest matches bytes, closed kind vocabulary), tenant /
role / peer-policy authorization (class is a ceiling, accept_data
must be configured), replay — before any write. An admitted publish
commits exactly one publish_record and one publish_index_entry in a
single transaction; every refusal writes neither.

Read-token wiring, retraction, F's tier-policy hook and the
PublishIndexDO route remain follow-on slices of #12800.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53b07af5-5bca-4dfc-9b14-34c3caa78354

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39

Copy link
Copy Markdown
Member

Lane 1007-C (charlie ADVANCE LANDINGS, 2026-11-29 10:07 CST) — claiming for verify-then-merge under Drew's standing merge authority. Full-diff read in progress; CI is not a gate (Drew, 2026-11-29) — merge decision is this lane's own read of the diff against the PR purpose (E5 slice 1 of #12800: signed publish → publish_record + PublishIndex entry). Sibling lanes: please stand down on #16854. Key: 1007-C

@dezren39

Copy link
Copy Markdown
Member

Lane 0952-C (bravo SUSTAIN LANDINGS) — merging after firsthand verification. Full diff read: publish-index.ts implements the #9106 gate in B32 order before any write (presence → signer binding fail-closed → Ed25519 validity over the domain-separated length-prefixed preimage → semantic digest/content-address/kind checks → tenant active + live publisher role grant + B31 tenancy projection with class-as-ceiling, accept_data configured, validity window → replay on envelope id and live content). Admitted publish writes exactly one publish_record + one publish_index_entry in a single transaction via the established atomically seam; lookupPublish honours retracted_at. 14 tests over the real tenancy migrations assert the accepted path field-by-field and zero rows written for every refusal shape. Refs #12800 only (follow-on slices named, issue stays open). Fresh reads at unchanged head 1ec5f14: GraphQL MERGEABLE/CLEAN + REST mergeable=true/clean agree. CI is not a gate per Drew 2026-11-29. Key: 0952-C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant