Skip to content

itx grand cleanup: §8+§9 graduate — egress is a capability, captun intercept dies, kernel shrinks, auth mints, legacy afterAppend deleted#1485

Merged
jonastemplestein merged 11 commits into
mainfrom
itx-grand-cleanup
Jun 11, 2026
Merged

itx grand cleanup: §8+§9 graduate — egress is a capability, captun intercept dies, kernel shrinks, auth mints, legacy afterAppend deleted#1485
jonastemplestein merged 11 commits into
mainfrom
itx-grand-cleanup

Conversation

@jonastemplestein

@jonastemplestein jonastemplestein commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

The remaining grand-cleanup workstreams in one deliberately breaking PR (prd gets redeployed). DECISIONS D23 is the canonical record. Three main-side PRs landed mid-flight and overlap this work — all adopted wholesale in the merges: #1482 (repos/workspace/worker as platform defaults with origin-carrying delegation), #1487 (fetch is a shadowable cap, define absorbs provide, shared registry host), and #1490 (intercept tunnel deleted, streams is a cap, best-effort onRpcBroken). This PR contributes the layers below on top of them.

§9 finished: the egress pipe is stateless

Worker-loading unification

ProjectCapability dissolved

The hand-wired forwarder entrypoint is deleted; nothing called it.

Auth is the ONLY project-id minter

New auth internal route POST /internal/project/mint-project-id (service-authed); OS operator/recovery creates (project directory + itx.projects.create) round-trip through it. mintProjectId is deleted from OS — the prj_ id space has exactly one source.

Legacy afterAppend/runner-state deleted

The agent, slack-agent, slack-integration, and repo DOs lose their afterAppend RPCs and fake runner shapes (delivery has been on the host model for a while). Agent runtime state is now the honest { agentPath, processors: { [slug]: snapshot } }; slack ensureReady returns a plain snapshot; the agent-stream benchmark updated.

Deferred to main's posture (from the original plan)

⚠️ Merge order

#1489 must merge (and auth deploy) first — this PR's create paths round-trip id minting through auth's new /internal/project/mint-project-id, and previews point at production auth. The preview e2e here 404s until that endpoint is live.

Breaking changes (intended)

  • Agent runtimeState shape changed (consumers were shape-agnostic or updated).
  • egressFetch is gone from every surface; use itx.fetch / the egress cap.

Testing

  • Full repo gates green (typecheck, lint, 35/35 apps/os test files).
  • Workers suites: project-ingress 6/6 (incl. live-shadow + revoke-restores-default), itx-stream-subscribe 13/13.
  • project-mcp-server-connection fails 2/3 identically on the branch base (verified in a clean worktree) — pre-existing.
  • Preview e2e exercises: the egress capability over capnweb (explicit + implicit doors), the new live-shadow helper, and auth-routed minting.

Out of scope

  • Egress policy-as-data / hold-for-approval (the §9 follow-on).
  • Stream processors taking a synchronous SQL client (jam).

🤖 Generated with Claude Code


Note

High Risk
Breaking egress and secret-handling semantics (DO no longer substitutes secrets; interceptors see raw placeholders), new auth dependency for id minting, and changed agent runtimeState shape affect security-sensitive paths and deploy ordering.

Overview
Completes itx D23: project egress is a shadowable fetch capability whose default terminal is the stateless EgressPipe (secret substitution + outbound fetch in a plain isolate), while the Project DO only supervises registry dispatch. fetch / egressFetch are removed from the Project DO; ProjectCapability is deleted.

Adds itx/isolate.ts so project workers, source caps, and the run harness share one ITERATE + ProjectEgress globalOutbound wiring path.

Auth is the sole prj_ minter: OS drops local mintProjectId; operator/admin and itx.projects.create call auth’s mintProjectId internal route.

Removes legacy afterAppend / runner-shaped RPCs on agent, slack, and repo DOs; agent runtimeState is { agentPath, processors } (benchmark updated). Docs mark §8/§9 shipped; live fetch shadows see raw getSecret(...) placeholders (withheld-text mode removed).

Reviewed by Cursor Bugbot for commit df5965b. Bugbot is set up for automated code reviews on this repo. Configure here.

Environment Config Lease

No active environment config lease.

OS

Status: released
Commit: df5965b
Preview: https://os.iterate-preview-6.com
Summary: Preview app released.
Workflow run
Updated: 2026-06-11T10:34:00.682Z

…faults, shadow tests)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ty dissolved

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…po DOs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6502e43. Configure here.

Comment thread apps/os/src/itx/registry.ts Outdated
Main independently shipped repos/workspace/worker as platform defaults with
origin-carrying chain delegation (the correct fix for inherited
context-scoped caps) and config-gated durable-object refs — that
implementation wins wholesale. Re-applied this branch's unique layers on
top: the egress capability (EgressPipe default + dialable, registry-
dispatching itx.fetch), the isolate-wiring unification in the registry's
loadWorker, the workers-RPC-safe onRpcBroken guard in provide, and
auth-routed id minting in ItxProjects.create. Dropped from this branch in
deference to main's choices: project-as-default (project stays a hardwired
built-in) and the PROJECT entry in DIALABLE_DURABLE_OBJECTS (allowlist
stays empty by default, config-gated).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… pipe

Main's consolidation shipped egress-as-a-capability under the name `fetch`
with define absorbing provide and one shared registry host — all adopted.
This branch's layers re-applied on top of that design: the default `fetch`
target is the stateless EgressPipe (secret substitution + real fetch, no
Durable Object in the egress path) instead of ProjectEgress.call dialing
the DO's egressFetch, which this branch deletes along with the captun
intercept tunnel; ProjectEgress is now purely the registry-first
dispatcher and leaves DIALABLE_LOOPBACKS. Also re-applied: wireIsolateEnv
in the registry's loadWorker, the workers-RPC-safe onRpcBroken guard,
auth-routed id minting in ItxProjects.create, and the live-shadow test
support rewritten to caps.define({ invoke: "path-call", name: "fetch" }).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jonastemplestein added a commit that referenced this pull request Jun 11, 2026
## What

Adds `POST /internal/project/mint-project-id` (service middleware) to
the auth worker + contract: mints a canonical `prj_` id without creating
an auth-side project record.

## Why

#1485 makes auth the ONLY minter of the `prj_` id space — OS's
operator/recovery create path round-trips through this endpoint instead
of minting locally. Previews point at production auth, so this must
deploy from main BEFORE #1485 can pass preview e2e (its preview run
currently 404s on this route).

Purely additive — extracted verbatim from #1485; nothing calls it until
that PR lands.

## Testing

- `apps/auth` + `apps/auth-contract` typecheck green.
- Exercised end-to-end by #1485's preview e2e once this deploys.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Additive internal route behind existing service auth; no DB writes and
no production callers until a dependent PR lands.
> 
> **Overview**
> Adds a **service-only** internal API so auth can hand out canonical
`prj_*` ids **without** creating an auth project row—intended for OS
operator/recovery creates that have no owning organization.
> 
> The **auth-contract** defines `POST /internal/project/mint-project-id`
(no input; `{ id: string }` output). The **auth worker** implements it
behind `serviceMiddleware`, returning `generateId("prj")` and registers
`mintProjectId` on the internal project router. Nothing in this PR calls
the route yet; follow-up work will route OS minting through auth instead
of local id generation.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
211c08a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- CLOUDFLARE_PREVIEW -->
## Environment Config Lease
<!-- CLOUDFLARE_PREVIEW_STATE -->
<!--
{
  "apps": {
    "os": {
      "appDisplayName": "OS",
      "appSlug": "os",
      "status": "deployed",
      "updatedAt": "2026-06-11T06:25:18.097Z",
      "headSha": "211c08a5d8212f4ae82f5999318ad76f9dfe1a59",
      "message": null,
      "publicUrl": "https://os.iterate-preview-2.com",
"runUrl": "https://github.com/iterate/iterate/actions/runs/27328011383",
      "shortSha": "211c08a"
    }
  },
  "environmentConfigLease": {
    "dopplerConfig": "preview_2",
    "leasedUntil": 1781162485637,
    "leaseId": "762efb9d-f616-4d21-aa38-f2ecd2d43f0e",
    "slug": "preview-2",
    "type": "environment-config-lease"
  }
}
-->
<!-- /CLOUDFLARE_PREVIEW_STATE -->
Lease: `preview-2`
Doppler config: `preview_2`
Type: `environment-config-lease`
Leased until: 2026-06-11T07:21:25.637Z

### OS
Status: deployed
Commit: `211c08a`
Preview: https://os.iterate-preview-2.com
[Workflow
run](https://github.com/iterate/iterate/actions/runs/27328011383)
Updated: 2026-06-11T06:25:18.097Z
<!-- /CLOUDFLARE_PREVIEW -->

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
jonastemplestein and others added 3 commits June 11, 2026 07:34
…ateless

Precision fix: "no DO in the egress path" overstated it. The Project DO is
still every dispatch's supervisor (live fetch shadows resolve in its
registry); what EgressPipe changes is that secrets are D1 rows scoped by
the dial-time projectId, so substitution and the outbound fetch run in a
plain isolate and secret material never enters the DO.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types)

Main's follow-ups PR independently shipped this branch's tunnel deletion —
its versions win wholesale where they overlap: the e2e fixture's
defineLiveEgressFetchCap, the one-shot define→fetch→revoke workerd shadow
test, the registry's best-effort onRpcBroken wiring, and the withheld-text
removal. Re-applied this branch's remaining unique layers on top: the DO
keeps NO egress surface (main still had fetch/egressFetch as the terminal
pipe; here the default `fetch` target is the stateless EgressPipe),
wireIsolateEnv in the registry's loadWorker, auth-routed id minting in
ItxProjects.create, and the ProjectCapability deletion (main's test entry
still exported it).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jonastemplestein jonastemplestein merged commit 24c49e4 into main Jun 11, 2026
7 checks passed
@jonastemplestein jonastemplestein deleted the itx-grand-cleanup branch June 11, 2026 10:32
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