docs(os): fix AGENTS.md, rewrite architecture-and-operations, retire capnweb pointers, fix task states#1432
Merged
Merged
Conversation
…capnweb pointers, fix task states
- README.md/AGENTS.md: real Important Files (src/worker.ts, src/config.ts),
real e2e lanes (pnpm e2e, pnpm e2e:itx), correct cf:deploy vs pnpm deploy
semantics, drop nonexistent /org/:organizationSlug route
- CONTEXT.md: fix the /org/:organizationSlug claim in the example dialogue
- architecture-and-operations.md: full rewrite against current code — Iterate
Auth (no Clerk), real route map, canonical MCP endpoint via
APP_CONFIG_MCP__BASE_URL, ProjectMcpServerEntrypoint 410 tombstone, real
redirects, /__durable-objects debug proxy, sync-auth-clients.ts, itx
- headless-local-debugging.md: /projects/new -> /new-project
- iterate-context{,-learnings}.md: tombstones pointing at src/itx/ successors
- capability-system-research / rpc-target-constructor-shape research notes:
historical status headers
- src/itx/README.md + handle.ts comment: replace the nonexistent ProjectCaps
declaration-merging pattern with the real Stubify cast
- itx-spec.md: PR #1407 is merged to main; mark the unbuilt client reconnect
loop (connectItx is one-shot) as a known divergence
- tasks: delete shipped simplify-context-cloudflare-native and
project-egress-secrets-mvp (verified in code); honest status notes on
codemode-session-vertical-slice and codemode-session-night-plan
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- tasks/cf-prd-orphaned-resources-cleanup.md: completed — prd account is down to 14 worker scripts and 6 D1 databases per live 2026-06-10 Cloudflare API check (was 1026 at the 2026-05-18 sweep) - tasks/complete/2026-05-22-os-captun-worker-test-tunnel.md: completed — shipped via merged PR #1361; all described artifacts exist on main and survived the golden-path rebuild (#1411) - tasks/dead-code-and-docs-cleanup-audit.md: completed — all high-confidence items shipped; pnpm-workspace.yaml now uses apps/*/packages/* globs and no longer lists the dead packages - tasks/github-oauth-use-repo-id.md: obsolete — all referenced code (linkExternalIdToGroups / repoId / repository.id) is gone repo-wide - tasks/ignoreme-email-security.md: obsolete — every targeted code path was deleted with the legacy OS1 stack in commit 545854d (#1341) - tasks/os-auth-spurious-logout-refresh.md: completed — commit ad6da76 (#1410, merged 2026-06-10) shipped exactly this work - tasks/os-codemode-router.md: completed — task file was added in the very PR that implemented it (commit 98ee148, #1294) - tasks/os-domain-capability-orpc-refactor-design.md: completed — every major pillar of the design (domains layout, capabilities, oRPC structure) exists on main - tasks/os-domain-capability-orpc-refactor-prd.md: completed — shipped in PR #1305 "Make codemode function calls event-driven" (squash commit 284193e, merged 2026-05-08) - tasks/os-stream-runtime-big-refactors.md: obsolete — os2-era brainstorm list largely superseded or done differently; item 2 shipped via PR #1394 - tasks/realtime-pusher-efficiency.md: obsolete — targets the legacy OS1 realtime pusher, which no longer exists - tasks/semaphore-lease-renewal.md: completed — lease renewal exists on main as resources.renew in apps/semaphore - tasks/signup-slug-uniqueness.md: completed — shipped with the auth worker (PR #1273); packages/shared/src/slug.ts implements resolveUniqueSlug/slugifyWithSuffix - tasks/stream-processor-ergonomics.md: obsolete — targets the legacy hook-style processor API replaced by the class-based StreamProcessor model - apps/os/tasks/codemode-session-night-plan.md: completed — planned outcomes verifiably shipped on main in evolved form (codemode session UI and friends) - apps/os/tasks/codemode-session-vertical-slice.md: completed — all 11 ticked checklist items shipped via PRs #1294/#1305 and follow-ups - apps/os/tasks/refactor-lifecycle-init-params-as-structured-name.md: completed — every acceptance criterion implemented in with-lifecycle-hooks.ts mixin on main - apps/os/tasks/repos-vertical-slice.md: completed — frontmatter says state: done and the described slice exists on main - apps/os/tasks/slack-google-auth-poc-implementation.md: historical log — explicitly an implementation log (state: done); work shipped in merged PR #1317 - apps/os/tasks/slack-processor-unwind.md: completed — all target-shape items exist on main (/integrations/slack stream path, no webhooks refs) - apps/os/tasks/stream-processor-class-design-notes.md: historical log — design notes written alongside the class-based StreamProcessor migration, not a task - apps/os/tasks/workspace-codemode-implementation-log.md: historical log — frontmatter state: done, all 9 checkpoints ticked, work verifiably shipped on main Already deleted by earlier commits on this branch (skipped): apps/os/tasks/project-egress-secrets-mvp.md, apps/os/tasks/simplify-context-cloudflare-native.md Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
8308e10 to
a4f093f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation sweep over
apps/os. Every statement written into a doc was verified against the code on this branch.Changes
apps/os/README.md(=AGENTS.md)src/app.ts/src/entry.workerd.tsdo not exist — replaced withsrc/worker.ts(Worker entrypoint) andsrc/config.ts(AppConfigschema). All other listed files verified to exist.src/capnweb/e2e/vitest.config.ts,src/domains/capability-prototype/e2e.vitest.config.ts) are gone — replaced with the real lanespnpm e2e(e2e/vitest.config.ts) andpnpm e2e:itx(src/itx/e2e/vitest.config.ts), verified againstapps/os/package.json.pnpm cf:deploy # production deploywas wrong and dangerous:cf:deploydeploys to whatever Doppler/Alchemy stage is ambient. Now documents bothcf:deploy(ambient stage) andpnpm deploy(thedoppler --config prdwrapper)./org/:organizationSlugroute; remaining routes verified againstsrc/routes/; added/new-project.apps/os/CONTEXT.md— fixed the example-dialogue claim that organization UI lives under/org/:organizationSlug(no such route; orgs live in the auth worker).apps/os/docs/architecture-and-operations.md— rewritten. The old doc described the pre-migration world: Clerk auth (whole## Clerksection,sync-clerk-apps.ts,APP_CONFIG_CLERK__*),/orgs/:organizationSlugroute maps, inbound MCP viaProjectMcpServerEntrypoint(now a hardcoded 410 tombstone), wrong redirect claims, and an unprefixed/durable-objects/streamdebug route. The new doc describes current reality:src/worker.tsdispatch pipeline, Iterate Auth middleware, real route map and root-redirect behavior (/→/projects/$projectSlugor/projects; project root rendersProjectHomePage), canonical MCP endpoint fromAPP_CONFIG_MCP__BASE_URLwith Iterate Auth protected-resource metadata,/__durable-objects/<kind>/<name>/<path>debug proxy (kinds verified), itx endpoints,scripts/sync-auth-clients.ts, current codemode default/example providers, and current smoke-test env vars (verified in the e2e test files).apps/os/docs/headless-local-debugging.md—/projects/new→ the real route/new-project.apps/os/docs/iterate-context.md,iterate-context-learnings.md— both pointed at the deletedsrc/capnweb/tree as "the current design"; now short tombstones pointing at the successor (src/itx/README + DECISIONS,docs/itx-spec.md).apps/os/docs/capability-system-research-and-design-notes.md,rpc-target-constructor-shape-research.md— added status headers marking them historical research notes superseded by itx; bodies untouched.apps/os/src/itx/README.md+src/itx/handle.ts— the "Typed caps"ProjectCapsdeclaration-merging pattern does not exist in code (noProjectCapsinterface anywhere). Rewrote the README section to the thing that actually works: castingitx.cap("name")through the exportedStubify<T>type. Also fixed the same false claim in theStubifydoc comment inhandle.ts(comment-only change).apps/os/docs/itx-spec.md— status header said "IMPLEMENTED on theitx-implementationbranch"; PR #1407 is merged to main (verified in git history). Marked the one known divergence honestly: the §6.3 client reconnect loop was never built —connectItx(src/itx/client.ts) is one-shot, and there is noitx.cap.disconnectedevent. Corrected §6.3 and the related §4 caveat.apps/os/tasks/simplify-context-cloudflare-native.md(state: todo, but shipped —src/worker.tsimportsenvfromcloudflare:workersdirectly,RequestContextis the narrow request-scoped shape the task specified, auth lives in Start request middleware, the manifest/src/app.tsis gone).project-egress-secrets-mvp.md(state: todo, but shipped —ProjectEgressentrypoint,ProjectDurableObject.egressFetchwithsubstituteProjectEgressSecretHeaders, D1-backedSecretsCapability.getSecret, and the/api/itx/egress-echoecho proof covered bysrc/itx/e2e/itx-egress.e2e.test.ts).docs/tasks-grooming.md) say "Delete when done", so deletion rather than state edits.codemode-session-vertical-slice.md(checked-off "tiny worker" box diverged:CodemodeSessionlives in the main OS worker) andcodemode-session-night-plan.md(plan superseded by itx).Skipped
Flags for reviewers
src/itx/handle.tsgot a comment-only edit (theStubifydoc comment made the same false declaration-merging claim as the README). No runtime change; typecheck/lint/tests pass.Checks
pnpm install,pnpm format(oxfmt),pnpm typecheck,pnpm lint,pnpm test— all pass.Task-file audit
A follow-up commit deletes 22 task files whose work was verified as shipped, obsolete, or purely historical. (Two more from the audit —
apps/os/tasks/project-egress-secrets-mvp.mdandapps/os/tasks/simplify-context-cloudflare-native.md— were already deleted by earlier commits on this branch, see above.)Deleted: completed
tasks/cf-prd-orphaned-resources-cleanup.md— live Cloudflare API check of the prd account (2026-06-10) shows 14 worker scripts (was 1026 at the task's 2026-05-18 sweep) and 6 D1 databases; cleanup is done.tasks/complete/2026-05-22-os-captun-worker-test-tunnel.md— shipped via merged PR codemode++ e2e++ #1361 ("codemode++ e2e++"); all described artifacts exist on main and survived the golden-path rebuild (Golden-path apps/os: TanStack Start + oRPC + Workers, no apps framework #1411).tasks/dead-code-and-docs-cleanup-audit.md— high-confidence items all shipped;pnpm-workspace.yamlno longer lists the dead packages and now usesapps/*/packages/*globs.tasks/os-auth-spurious-logout-refresh.md— commit ad6da76 "Fix 5-min logout, deploy-time JWKS, and stream append skeleton flash (Fix 5-min logout, deploy-time JWKS, and stream append skeleton flash #1410)" (merged 2026-06-10) shipped exactly this work.tasks/os-codemode-router.md— task file was added in the very PR that implemented it (commit 98ee148, Add codemode system: kernel, oRPC endpoints, and MCP run_code tool #1294).tasks/os-domain-capability-orpc-refactor-design.md— every major pillar of the design (domains layout, capabilities, oRPC structure) exists on main.tasks/os-domain-capability-orpc-refactor-prd.md— shipped in PR Make codemode function calls event-driven #1305 "Make codemode function calls event-driven" (squash commit 284193e, merged 2026-05-08).tasks/semaphore-lease-renewal.md— the described lease-renewal feature exists on main asresources.renew(named "renew" rather than the proposed "extend") inapps/semaphore.tasks/signup-slug-uniqueness.md— shipped with the auth worker (PR auth worker #1273);packages/shared/src/slug.tsimplementsresolveUniqueSlug/slugifyWithSuffix.apps/os/tasks/codemode-session-night-plan.md— planned outcomes verifiably shipped on main, in evolved form (codemode session browser UI and follow-ons).apps/os/tasks/codemode-session-vertical-slice.md— all 11 ticked checklist items shipped via PRs Add codemode system: kernel, oRPC endpoints, and MCP run_code tool #1294/Make codemode function calls event-driven #1305 and follow-ups.apps/os/tasks/refactor-lifecycle-init-params-as-structured-name.md— every acceptance criterion implemented in thewith-lifecycle-hooks.tsmixin on main.apps/os/tasks/repos-vertical-slice.md— frontmatter already saysstate: doneand the described slice verifiably exists on main.apps/os/tasks/slack-processor-unwind.md— all target-shape items exist on main (/integrations/slackstream path; no/integrations/slack/webhooksreferences).Deleted: obsolete / nonsense
tasks/github-oauth-use-repo-id.md— all referenced code is gone:linkExternalIdToGroups/repoId/repository.idreturn zero hits repo-wide.tasks/ignoreme-email-security.md— every code path the task targets was deleted with the legacy OS1 stack (commit 545854d, Remove legacy OS1 stack (apps/os, daemon, sandbox) #1341).tasks/os-stream-runtime-big-refactors.md— os2-era brainstorm list largely superseded or done differently; item 2 shipped via PR [codex] remove events app and legacy shared streams #1394.tasks/realtime-pusher-efficiency.md— targets the legacy OS1 realtime pusher, which no longer exists.tasks/stream-processor-ergonomics.md— targets the legacy hook-style processor API, replaced by the class-based StreamProcessor model.Deleted: historical logs
apps/os/tasks/slack-google-auth-poc-implementation.md— explicitly an "Implementation Log" (state: done), not actionable work; shipped in merged PR Add OS2 integrations and Slack stream-agent routing #1317.apps/os/tasks/stream-processor-class-design-notes.md— design notes written alongside the class-based StreamProcessor migration, not a task.apps/os/tasks/workspace-codemode-implementation-log.md—state: done, all 9 checkpoints ticked; the described work verifiably shipped on main.Kept but flagged for maintainer judgment
tasks/cf-prd-orphaned-resources-cleanup.md: Explicit not-in-scope follow-ups (preview account 376ef7ed cleanup, Doppler os-legacy-backup pruning) were never broken out into their own tasks; spin them out only if still wanted.tasks/codemode-capability-policy.md: Still-unshipped, still-wanted design work, but duplicatesapps/os/tasks/codemode-capability-access-policy.mdand overlaps the active itx capability-system design notes — maintainer should consolidate into a single task.tasks/complete/2026-05-22-os-captun-worker-test-tunnel.md: apps/os still depends on the unpublished pkg.pr.new/captun@14 build (the task's stated stopgap); a published captun/worker release would be a separate follow-up, not a reason to keep this file.tasks/dead-code-and-docs-cleanup-audit.md: Residual from this audit: packages/iterate is still excluded from root build/typecheck/test (--filter '!iterate'); if that CI gap matters, open a fresh small task rather than keeping this stale inventory.tasks/doppler-shared-and-os-secrets-audit.md: Audit still unrun and wanted, but needs a rewrite first: replace Clerk-key expectations with iterateAuth, point AppConfig refs atapps/os/src/config.ts(app.tsandpackages/shared/src/apps/config.tswere deleted in PR Golden-path apps/os: TanStack Start + oRPC + Workers, no apps framework #1411), and refresh the 2026-05-18 baseline.tasks/ignoreme-email-security.md: If outbound email via Resend is ever reintroduced in the rebuilt apps/os, recipient allowlisting should be designed fresh against the itx/egress-secret-substitution layer, not this OS1-era plan.tasks/iterate-cli-distribution.md: Live but ~90% of the file is OpenCode architecture research notes, not actionable steps; npm distribution already exists, so the remaining work (bun binary, brew, install script) should be restated as concrete tasks or the research trimmed.tasks/os-auth-spurious-logout-refresh.md: PR Fix 5-min logout, deploy-time JWKS, and stream append skeleton flash #1410 left one open thread: a manual end-to-end "wait 5 minutes in prod" verification was never done, and the claims-staleness force-refresh was consciously skipped (≤30m propagation accepted) — file a new narrow task only if either still matters.tasks/os-deploy-time-jwks-fetch.md: Code shipped in PR Fix 5-min logout, deploy-time JWKS, and stream append skeleton flash #1410; only remaining action is deletingITERATE_AUTH_JWKSfrom Doppler os prd/preview (still present and shadowing the deploy-time fetch) — after that, delete this task.tasks/os-domain-capability-orpc-refactor-prd.md: Sibling taskos-domain-capability-orpc-refactor-design.md(its dependsOn target) is likely also completed and should be audited/deleted together.tasks/os-project-do-projection-reconciliation.md: Scope item "rename IterateMcpServer to ProjectMcpServerConnection" is already done and could be ticked off; the rest is unshipped and still relevant.tasks/os-project-hostname-base-singular.md: Scope file paths are stale post-PR Golden-path apps/os: TanStack Start + oRPC + Workers, no apps framework #1411 (app.ts→src/config.ts,sync-clerk-apps.ts→sync-auth-clients.ts,entry.workerd.tsdeleted, routing files moved tosrc/ingress/); task itself is still valid.tasks/os-project-route-authorization.md: Still-wanted design work (referenced by live project-ingress-architecture task), but needs rewrite: Clerk OAuth andProjectMcpServerEntrypointreferences are dead — MCP moved off project ingress (410 stub) and auth is now apps/auth Principal-based.tasks/os-stream-runtime-big-refactors.md: Only surviving idea: cosmetic no-compat rename ofevents.iterate.com/...event-type names (events app is deleted); re-file as a small standalone task if still wanted.apps/os/tasks/codemode-capability-access-policy.md: Live work, but near-duplicates root-leveltasks/codemode-capability-policy.md(same PR Add codemode system: kernel, oRPC endpoints, and MCP run_code tool #1294); keep this copy and consolidate/delete the root one.apps/os/tasks/codemode-session-night-plan.md: Open capability-scope questions from this plan live on incodemode-capability-access-policy.md; checkboxes are unticked but the work shipped via PRs Add codemode system: kernel, oRPC endpoints, and MCP run_code tool #1294/Make codemode function calls event-driven #1305/Class-model stream processors across apps/os: DO-hosted, callable subscriptions, legacy model deleted #1402.apps/os/tasks/codemode-session-vertical-slice.md: Last unchecked box (generalize self-callable bindings) shipped as the loopback-binding pattern used repo-wide; follow-on work lives incodemode-session-night-plan.md.apps/os/tasks/project-egress-and-secrets-architecture.md: Design doc whose first vertical slice shipped (egress + secret substitution MVP); remaining secret-DO/policy/approval/OAuth design is still live but needs grooming: drop completed PoC sections, update Clerk-scope terminology, and reconcile with itx DECISIONS.md as the newer design-of-record for egress wiring.apps/os/tasks/project-egress-intercept-tunnel-latency.md: Still-relevant latency work, but file refs are stale (entry.workerd.ts→src/worker.ts; vendoredapps/os/src/lib/captunremoved for the published captun package in codemode++ e2e++ #1361) and the benchmark numbers predate the Golden-path apps/os: TanStack Start + oRPC + Workers, no apps framework #1411 worker rebuild — re-benchmark before picking an option.apps/os/tasks/project-ingress-architecture.md: Live, actively-maintained ingress reference (edited today in [codex] Stop provisioning project DNS records #1416), but needs a refresh: Clerk auth sections,Project.checkAccess, and the streams-upstream proxy model are superseded (auth worker, principal claims, bundled project worker), and the 2026-05-05 status checklist is partly outdated.apps/os/tasks/stream-processor-class-migration-log.md: Migration log (merged today via Class-model stream processors across apps/os: DO-hosted, callable subscriptions, legacy model deleted #1402, which links to it as the canonical rationale) — not an actionable task; contains unique I6-I8 forensics not in the PR body, consider moving to docs/ alongsidetasks/migration-notes/rather than deleting.apps/os/tasks/stream-subscriber-delivery-refactor.md: Core design shipped differently via the class-model cutover (Class-based stream processors: crisp batch model, honest contracts, regression tests #1401/Class-model stream processors across apps/os: DO-hosted, callable subscriptions, legacy model deleted #1402/[codex] remove events app and legacy shared streams #1394); only live remainder is migratingcodemode.streamEvents,StreamsCapability.stream(), and project-mcp-server-connection off the OS-internal NDJSON shim innew-stream-runtime.ts— consider replacing this large draft with a small task for that.apps/os/tasks/workspace-codemode-implementation-log.md: Done implementation log; only marginally unique note is the rationale that plain method objects (not class instances) cross DO RPC, which is now embodied in the shipped workspace DO code.apps/os/tasks/migration-notes/: Historical migration logs (not tasks) committed with and cited by merged PR Class-model stream processors across apps/os: DO-hosted, callable subscriptions, legacy model deleted #1402 one day ago; contain unique per-domain decisions plus the legacy-subscriber gap behind the 2026-06-10 prd Slack outage — maintainer should relocate to docs/ or delete deliberately.🤖 Generated with Claude Code
Note
Low Risk
Documentation and task-file deletions only; no application runtime or API behavior changes in the diff.
Overview
Aligns OS documentation with the current worker, auth, routing, and itx reality, and removes a large set of completed or obsolete task files from
apps/os/tasks/andtasks/.The README / AGENTS and
architecture-and-operations.mdrewrites drop Clerk-era and deleted-entrypoint references (src/app.ts,src/entry.workerd.ts,/org/:organizationSlug) in favor ofsrc/worker.ts, Iterate Auth, project-scoped routes (/projects/...,/new-project), canonical MCP (APP_CONFIG_MCP__BASE_URL, auth-worker OAuth), itx endpoints, andsync-auth-clients.ts. Deploy docs now distinguish ambientpnpm cf:deployfrom productionpnpm deploy. E2E docs point atpnpm e2eandpnpm e2e:itxinstead of removed capnweb vitest configs.Cap'n Web tombstones in
iterate-context*.mdredirect readers to itx (src/itx/,itx-spec.md). Research notes get historical headers; itx-spec notes merged status on main and documents thatconnectItxis one-shot (no §6.3 reconnect loop). itx README /Stubifydocs are corrected: typed caps useitx.cap("name") as Stubify<...>, not declaration merging.CONTEXT.md fixes the example that claimed org UI lived under
/org/.... headless-local-debugging uses/new-project.Task grooming deletes many markdown tasks whose work is done, superseded (itx, auth worker), or OS1-dead — including codemode vertical-slice plans, domain oRPC refactor design, egress MVP, Slack processor unwind, and similar inventory items.
Reviewed by Cursor Bugbot for commit a4f093f. 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:
a4f093fPreview: https://os.iterate-preview-5.com
Summary: Preview app released.
Workflow run
Updated: 2026-06-10T12:37:37.303Z