Skip to content

M1: merge main (03230e52b, then 84d77aa0f) into sam/selfhost-pass-2 - #2736

Merged
simple-agent-manager[bot] merged 36 commits into
sam/selfhost-pass-2from
sam/task-m1-merge-latest-a4q7xh
Nov 14, 2026
Merged

simple-agent-manager[bot] merged 36 commits into
sam/selfhost-pass-2from
sam/task-m1-merge-latest-a4q7xh

Conversation

@simple-agent-manager

@simple-agent-manager simple-agent-manager Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

M1: merges origin/main at 03230e52b79e394e2251572b815146e9649c8460, then once more at 84d77aa0f (see the second merge below) (contains #2733 03230e52b and #2714 bc5a6cc94) into the self-host integration branch sam/selfhost-pass-2 at c0935ad06cdb4e37e018aca6e46d240b19574471. It is a merge, not a rebase, and the base is the integration branch, never main. Draft: do not merge without the coordinator's review. Model: #2709 (L0).

  • Main brought 24 commits since 57614ec6b. 17 files conflicted; all are resolved (table below).
  • Rule applied throughout: where both sides touch a shared file, main's structure wins and the branch's behaviour is re-applied on top. No module exists twice, and no change from either side was dropped silently.
  • The two landing slices:
    • refactor(api): move the ws-* proxy out of index.ts (L2, pure move) #2714 (ws- proxy)*: main's text, plus every branch addition: unconditional redirect: 'manual' on both proxied fetches, the node route seam (readNodeAgentRouteRow / nodeAgentRouteFromRow / NodeAgentRouteError, 503 NODE_UNREACHABLE, the node_route_unavailable ports payload), the reverse-tunnel loopback origin, the Caddy forward_auth gateway, and x-sam-gateway-secret stripping on both paths. workspace-port-access.ts is byte-identical to main. Main's text differed from the branch's only in header comments, so nothing main changed in that block is lost.
    • refactor(api): split tts, ai-token-budget and agent-loop (L3, pure move) #2733 (splits): main's split is a pure move that the branch already contains. tts-config.ts, tts-text.ts and agent-loop-streams.ts are byte-identical. The other six files are the branch's versions: git diff origin/main HEAD on them shows only the branch's additions (speech-endpoint synthesis, local metering, the env argument and refusal message, endpoint routing, callOpenAIChatLLM, the availability error).
  • Landing progress (git diff --shortstat origin/main...HEAD):
    • Before: 849 files, +84,444 / -4,251 (against 527f16b95; the same against 57614ec6b).
    • After, at the merge commit 2523e6ee3: 841 files, +82,933 / -2,808 (against 03230e52b).
  • After, at the PR head 20cdb9941 (main 84d77aa0f): 844 files, +83,041 / -2,814. The extra files over the merge commit are this task's file and the new tests.

Second merge: main moved once, to 84d77aa0f2cfa69a1e12f0f2fca7bf65b0c0fa50

Main gained four commits while this PR was in CI: #2728 (CI coverage pools, deterministic lifecycle ties), #2729 (ProjectData row-usage attribution), #2734 (fewer project-event writes, retention FK scans) and #2735 (journal post). They were merged in once (20cdb9941). Per the brief, main is not chased again.

  • One conflict: apps/api/src/services/admin-setting-definitions.ts. Main added 'operations.projectDataRowUsageIntervalMs' and the branch added OutboundSettingName. Resolved as the union of both members.
  • No new D1 migration. Main adds ProjectData DO migration 077-project-event-storage-cost-indexes (indexes only), which runs on each ProjectData object's first access.
  • Checks re-run locally after this merge: build, typecheck (36/36), check:fast, ten quality gates, project-data tests (529) and the new check-project-data-rows tests (16). The admin-settings unit tests also pass (59).

Conflict table

File What main did What the branch did Resolution
.github/workflows/ci.yml Go 1.26.11 (#2658); "Prepare Instant workspace mountpoint" step in VM Agent Test Same Go bump; self-host steps Main's new step added; both sides' Go pins already agreed
apps/api/src/index.ts ws-* proxy moved out (#2714); buildContextCallbackRoute registered (#2605) Hosted-git, artifacts-availability and capabilities imports Union of imports. Result = branch + main's #2605 route (mounted before projectsRoutes)
apps/api/src/routes/workspace-subdomain-proxy.ts (add/add) Moved verbatim out of index.ts Same move, with the self-host behaviour listed above Main's text with the branch's additions (header comment: main's text plus the branch's gateway paragraph)
apps/api/src/routes/workspace-port-access.ts (add/add) Moved verbatim Same, header comment worded differently Main's file (byte-identical)
apps/api/src/services/tts.ts Pure split (#2733) Same split plus the speech-endpoint branch Branch file. Main-only lines are the ai: Ai parameters the branch generalised
apps/api/src/durable-objects/sam-session/agent-loop.ts, agent-loop-llm.ts (add/add) Pure split (#2733) Same split plus endpoint routing, callOpenAIChatLLM and the availability error Branch files
packages/ai-proxy/src/ai-token-budget.ts, ai-budget-settings.ts (add/add), ai-monthly-cost-cap.ts (add/add) Pure split (#2733) Same split plus local metering, the env argument and MONTHLY_COST_CAP_UNAVAILABLE_MESSAGE Branch files (strict supersets of main's)
apps/api/src/routes/workspaces/runtime.ts PROXY_ELIGIBLE_AGENTS and a sync isAiProxyEnabled moved to new sam-ai-proxy-fallback.ts; refuseHaltedRunAccount (#2710) await isAiProxyEnabled(env) from ai-proxy-availability.ts (gateway-aware; off on a gateway-less box until aiProxy.directUpstreamEnabled) One resolver: the branch's. Main's sync copy is deleted, and samProxyFallbackAvailable (main) now awaits the branch resolver, so the Connector read and the agent-key route still agree (main's stated intent). On Cloudflare both are the kill switch alone
apps/api/src/services/strict-node-deletion.ts Two-phase provider deletion, teardown authority and current-owner credential deletion (#2715, #2718, #2725); moved reconcileStrictProviderlessVm to new strict-node-providerless-reconcile.ts GCP providerless reconcile (COMPLETE_INVENTORY_PROVIDERS), manual-deletion hint, recovery-window message, reverse-tunnel lease release Main's structure. The branch's reconcile changes went into main's new file. The reverse-tunnel lease release is kept in releaseTerminatedNodeTunnels
apps/api/src/services/strict-node-deletion-shared.ts Removed resolveStrictNodeProvider; hasManagedVmPlacementProof(node, capacitySourceReleased) Added COMPLETE_INVENTORY_PROVIDERS and providerInventoryMatchesLabels Main's file plus COMPLETE_INVENTORY_PROVIDERS. The branch's matcher is dropped for main's identical nodeProviderLabelsMatch (node-provider-labels.ts); node-operator-retirement.ts now uses it
packages/app-deployment/src/compose-image-artifacts.ts Exported getS3Client(env, checksumMode) for #2605 Removed the private S3 client: artifacts are signed through the shared R2 presign target (operator stores) Branch file. Main's new caller is re-pointed (S2)
apps/web/src/pages/comment-reader/ReaderConversation.tsx quote-highlight moved, import order changed usePlatformCapabilities import Main's imports plus the branch's
scripts/quality/direct-dependency-evidence.json golang.org/x/vuln/cmd/govulncheck sam-mx Go modules Union, no duplicate keys
scripts/quality/gitleaks-reviewed-baseline.json One group (PR #2718 history) Four self-host groups plus the analytics-forward re-pin Three-way merge by digest set: 21 groups, 0 duplicate digests

Silent breakages found (no textual conflict) and fixed

# Breakage Fix Commit
S1 pnpm install --frozen-lockfile failed: main (#2658) moved repo-hosting's isomorphic-git to 1.44.12 and dropped the 1.38.7 resolution, but the branch's apps/api asked for ^1.38.7 (hosted-git import) apps/api pins 1.44.12, the same version as repo-hosting. Lockfile = main's + 34 lines (the same delta as L0) 115157d27
S2 #2605's build-context-upload.ts (no conflict) imported getS3Client, which the branch removed. On a self-hosted box it would have signed against *.r2.cloudflarestorage.com The package takes a presign target. The worker shim binds getR2PresignTarget(env, 'WHEN_REQUIRED'), as compose artifacts do. On Cloudflare the URL is identical (endpoint, region auto, bucket, key, checksum mode, x-amz-meta-sha256 in the signed headers); operator stores now work. New apps/api/tests/unit/services/build-context-upload-presign.test.ts covers Cloudflare, operator store and the rejected promise 2523e6ee3
S3 samProxyFallbackAvailable (new on main; no conflict) read the kill switch only. On a gateway-less box the Connector would report a SAM proxy that the agent-key route refuses Reads the branch resolver (async); profile-account-bindings.ts awaits it 2523e6ee3
S4 strict-node-providerless-reconcile.ts (new on main) had main's Hetzner-only body, so the branch's GCP providerless delete (e9ce2e5) and owner escape hint would have been lost silently Carried into the new file 2523e6ee3
S5 node-operator-retirement.ts (branch) imported providerInventoryMatchesLabels from the shared module Uses main's nodeProviderLabelsMatch 2523e6ee3
S6 3 api tests (profile-account-bindings, account-usage) built an env with no AI Gateway and expected the proxy on Test envs are Cloudflare-shaped (gateway configured). New gateway-less case drives the real aiProxy.directUpstreamEnabled write. Proven discriminating: with the kill-switch-only predicate restored, exactly that test fails e08088cca
S7 scripts/selfhost/teardown-gcp.ts cited the removed providerInventoryMatchesLabels The comment cites nodeProviderLabelsMatch c6dd79553

Checked and found no breakage:

  • Quality gates, each passed locally: wrangler-bindings, runtime-tunables, agent-install-manifest, skill-references, ast-checks, shared-flight-joins (2,112 files, 0 findings), file-sizes, stale-artifacts, migration-safety, do-migration-safety, source-contract-tests, no-tracked-stale-binaries, dependency-governance, workspace-test-surfaces, migration-ordering, repo-visibility, runtime-boundary-semantics, node-pool-boundary and direct-dependency-evidence.
  • Outbound-fetch inventory test: passes.
  • Key-rotation registry (tests/unit/selfhost/key-rotation.test.ts): passes. Main adds no iv / *_iv / encrypted column (searched the schema, D1 migrations and project-data diffs).
  • Go pins agree: GO_VERSION, every Assert Go version, the installer-engine preflight (main moved it to go1.26.11), the bootstrap URL, the selfhost vm-agent-artifacts.ts image, sam-mx (golang:1.26.11) and every toolchain go1.26.11.
  • Wrangler: the celld config generator accepts main's wrangler.toml (selfhost:test and the local project build).
  • Package boundaries and duplicates: no isAiProxyEnabled / getS3Client / label-matcher duplicates remain. resolveStrictNodeProvider is removed as on main.

Migration findings

  • D1 0232_node_reverse_tunnel_leases.sql: not renamed. Main adds no 0232. pnpm quality:migration-ordering passes.
  • Five new D1 migrations from main, all additive (ALTER TABLE ADD COLUMN / CREATE INDEX IF NOT EXISTS). migration-safety passes.
    • 0230_publish_job_build_context.sql: deployment_publish_jobs +5 columns (executor NOT NULL DEFAULT 'node' with CHECK).
    • 0231_publish_job_context_shadow.sql: deployment_publish_jobs.context_shadow NOT NULL DEFAULT 0.
    • 0237_archive_reclaim_pending.sql: project_data_archive_migrations.reclaim_pending NOT NULL DEFAULT 1, plus a partial index.
    • 0238_task_run_agent_configuration.sql: tasks.agent_configuration_id.
    • 0241_node_provider_deletion_request.sql: nodes.provider_deletion_requested_at, nodes.provider_deletion_json.
  • Prefix collisions: 0230 and 0231 now each have two files (0230_capacity_pool_excluded_sources / 0230_node_cloudflare_tunnels / 0230_publish_job_build_context; 0231_node_tunnel_pending_creates / 0231_publish_job_context_shadow). That is main's numbering, not this merge's. None collides with 0232.
  • Out-of-order application: the box has already applied up to 0236, so the new 0230 and 0231 files will be applied after 0236. celld applies unapplied files by name, as Wrangler does (celld d1 --help). Both are independent ADD COLUMNs.
  • Observability migrations: none new.
  • Durable Object tags: main still ends at v22, so the branch's v23 (HostedGitRepo) keeps its tag.
  • ProjectData DO SQLite: main adds migration 076-archive-source-write-generation (a new table, two columns, write-generation triggers). It runs on each ProjectData object's first access.

Test results

Local, on the merged tree (e08088cca; 3d995fbab / 115157d27 for the earlier steps):

  • pnpm install --frozen-lockfile: fails on the raw merge (S1); passes after S1.
  • pnpm build: 18/18 tasks pass. pnpm typecheck: 36/36 pass. tsc -p scripts/deploy and tsc -p scripts/selfhost: pass.
  • pnpm check:fast: pass (format ratchet, oxlint shadow, ESLint 22/22 with the SAM rules, type-boundary ratchet).
  • turbo run test on 3d995fbab: 38/39 tasks pass.
    • api: 16,287 passed, 3 failed, 5 skipped (1,090 files). The 3 failures were S6, fixed in e08088cca; the two affected files then pass 24/24 and the build-context presign test passes.
    • web: 5,284. project-data: 529. Every other package passed.
  • pnpm selfhost:test: 485 passed, 5 skipped (32 files). The extra skips (L0 had 2) are the nft -c ruleset tests: this workspace has no nft. CI installs nftables.
  • Not run locally, so CI is the evidence:
    • Go (VM Agent, CLI, govulncheck-diff): this workspace has no Go toolchain. The diff gate will also scan the branch-only deploy/selfhost/sam-mx module, because a dispatched run diffs against origin/main.
    • Workers-runtime Durable Object shards.
    • selfhost:live-test: it needs Docker.
  • Full CI by hand:
    • Run 43618481233 on e08088cca: all jobs green on the first attempt. That includes Test, the three Durable Object Workers shards, Go Vulnerability Diff (which also scanned the branch-only sam-mx module), VM Agent Test, Integration and E2E, CLI Test, and Validate Deploy Scripts.
    • Counts from that run:
      • api: 16,292 passed, 4 skipped (1,090 files)
      • web: 5,284
      • selfhost:test: 488 passed, 2 skipped
      • selfhost:live-test: 297/297 (16 files: real Caddy, frp, celld 0.6.3 and the fence namespace)
      • deploy and quality scripts: 904
      • installer engine: 120
    • Run 43618116318 on 3d995fbab was cancelled after the local suite found S6. The commits after e08088cca only change a comment in teardown-gcp.ts and the task file.
    • Run 43620939590 on b0fd3a18a: all jobs green on the first attempt (conclusion success).
    • Run after the second merge, 43625330882 on 20cdb9941: all jobs green on the first attempt (conclusion success). Counts: api 16,292 passed / 4 skipped; web 5,284; selfhost:test 488 / 2 skipped; selfhost:live-test 297/297; deploy and quality scripts 920; installer engine 120. This is the CI evidence for the PR head: the head f95a5e2f3 differs from 20cdb9941 only by this task's markdown file.

celld boot (local, partial: no Docker for the object store)

The scratch script was not committed. It used the deploy's own generator (buildCelldConfig + prepareCelldProject + celldDeployConfig + writeCelldConfig) with freshly generated platform keys and the apps/web build, then pinned celld 0.6.3 (downloaded and checksum-verified by ensureCelldBinary), with esbuild resolved as the deploy does. The full Worker ran under celld dev (local state, no bucket):

Probe Result
Config generation from the merged wrangler.toml OK. Only the expected drops/folds were reported; v23 HostedGitRepo bound
celld esbuild bundle of the generated celld-main.ts → apps/api/src (every workspace package) OK, 7.5 s, 30.5 MiB; 21 DO classes, 2 D1, assets 361 files
GET /health 200 {"status":"healthy"}
GET /api/config/platform-capabilities 200 (monthlyCostCap: true via local metering)
GET /api/setup/status (D1) 500 no_such_table: not a merge defect. celld dev does not apply D1 migrations, and celld d1 migrations apply needs a fleet bucket. The bucket is the pinned MinIO image, and this workspace has no Docker
celld log no errors other than the expected missing tables

Not verified locally: D1-backed probes (seeded-token sign-in, /api/admin/settings, /api/projects). They need the object store. CI's live suite runs real celld 0.6.3 with probe Workers; the box deploy is the full-Worker check (see below).

What a box agent must check after deploying this

  1. Migrations: expect exactly five newly applied D1 files:

    • 0230_publish_job_build_context.sql
    • 0231_publish_job_context_shadow.sql
    • 0237_archive_reclaim_pending.sql
    • 0238_task_run_agent_configuration.sql
    • 0241_node_provider_deletion_request.sql

    0230 and 0231 apply after 0236 (out of numeric order, by name). celld d1 migrations list should then show nothing pending. If 0232_node_reverse_tunnel_leases.sql is pending or re-applied, stop.

  2. Archive reclaim: 0237 marks every existing project_data_archive_migrations row reclaim_pending = 1, so the archive reclaim path (feat(archive): flip then paged reclaim, one resumable path for every session size #2702, Fix archive timeout and quadratic projection lookups #2724) will run over every already-archived session after the deploy. Watch the cron log and box CPU and memory for the first hours. Spot-check one archived session's history still loads.

  3. ProjectData DO migrations 076 and 077 (write-generation triggers) runs on the first access of each project. Open two projects' chats and check for errors in the celld log.

  4. Node teardown: fix(api): tear down nodes after their cloud credential rotates #2715, fix(api): keep pools and node cleanup working across a credential re-save #2718 and fix(api): cleanup cron finishes GCP teardown (two-phase provider deletion) #2725 added two-phase provider deletion and current-owner-credential teardown.

    • Delete one node and confirm it reaches deleted, with nodes.provider_deletion_requested_at cleared after proof.
    • Re-save a cloud credential, then delete a node provisioned before the re-save.
    • A GCP node without provider_instance_id should still be found by its labels (the branch's providerless path).
    • A reverse-tunnel node's lease must be released.
  5. Workspace proxy moved (refactor(api): move the ws-* proxy out of index.ts (L2, pure move) #2714):

    • Open a workspace terminal (Caddy WebSocket gateway, forward_auth).
    • Open a port URL (port token, then cookie).
    • Open the ports list for a node with no lease (expect 202 node_route_unavailable).
  6. AI proxy on a gateway-less box:

    • With aiProxy.directUpstreamEnabled off, sam_profiles_list must show no sam_ai_proxy binding and agent-key must refuse the proxy.
    • With it on, both must agree.
  7. Build-context bundles (Add portable deployment build-context bundles #2605), if app deployments are on: a compose publish that uploads a build context presigns through the operator store (R2_S3_*). Verification then heads the unprefixed key on the R2 binding, which only works if the box's binding maps to the same prefix (as r2-presign-config.ts documents).

  8. Hosted git: import one repository. isomorphic-git is now 1.44.12.

  9. vm-agent: built with Go 1.26.11, so the release identity rotates. New nodes get the new agent; existing nodes are judged by VM_AGENT_REQUIRED_VERSION as before.

Decisions for Raphaël

# Decision Recommendation
M1-D1 Build-context uploads (#2605) now presign through the shared R2 presign target, not a private client. Same URL on Cloudflare. This is a self-host behaviour change on a main feature, made in the merge Keep. Land it with the slice that lands r2-s3-client / operator stores. Main's private client duplicates the shared one (rule 24)
M1-D2 isAiProxyEnabled / samProxyFallbackAvailable now use the gateway-aware resolver Keep, and land it with the AI-proxy slice. On Cloudflare, behaviour is unchanged as long as AI_GATEWAY_ID and CF_ACCOUNT_ID are set (always, on SAM's deployments)

Findings outside the merge (not fixed, per instructions)

  • LOW, security-auditor: classifyName (worker-core network-hosts, branch) no longer refuses *.metadata names, which main's old image-resolver check did. Negligible: the name is not a delegated TLD.
  • LOW, security-auditor: the branch's recordManualNodeDeletion releases Cloudflare tunnels inline but not reverse-tunnel leases. Those wait for the lease sweep's next tick.
  • LOW, task-completion-validator: POST /:id/agent-key awaits isAiProxyEnabled before checking proxy eligibility. That is the branch's code since L0, unchanged here. On a gateway-less box it costs one cached admin-settings read per call.
  • INFO: admin-settings-resolution.ts, profile-tools.ts and celld-config.ts sit at exactly 500 lines.

Validation

  • pnpm lint (via check:fast)
  • pnpm typecheck
  • pnpm test (see Test results)
  • Additional validation: quality gates, selfhost:test, partial celld boot
  • If this PR changes candidate selection for a sweep/cron/alarm loop: N/A, no selection predicate changed in the resolution

Staging Verification (REQUIRED for all code changes — merge-blocking)

N/A by task instruction: this is a draft PR into the self-host integration branch, which never deploys to Cloudflare staging. A self-host test box round verifies it after the merge; that is owned by another task.

  • Staging deployment green: N/A (override)
  • Live app verified via Playwright: N/A (override)
  • Existing workflows confirmed working: N/A (override)
  • New feature/fix verified on staging: N/A (override)
  • Infrastructure verification completed: N/A
  • Mobile and desktop verification notes added for UI changes: N/A (one import line in apps/web)

Staging Verification Evidence

N/A: staging is overridden. See the celld boot and the box checklist above.

UI Compliance Checklist (Required for UI changes)

N/A: the only apps/web edit is an import union in ReaderConversation.tsx. The Playwright audit is skipped by instruction.

End-to-End Verification (Required for multi-component changes)

  • Data flow traced with code path citations
  • Capability test exercises the happy path across system boundaries (build-context presign through the worker shim and the real SDK; Connector bindings through the real admin-settings write and resolver)
  • Assumptions verified against code and tests
  • Gaps documented below

Data Flow Trace

  • Build context: routes/projects/build-context-callback.ts → services/build-context-upload.ts (shim) → getR2PresignTarget(env, 'WHEN_REQUIRED') (services/r2-s3-client.ts) → @simple-agent-manager/app-deployment createBuildContextUpload → getSignedUrl.
  • Connector proxy binding: profile-account-bindings.ts → samProxyFallbackAvailable (sam-ai-proxy-fallback.ts) → isAiProxyEnabled (ai-proxy-availability.ts). That is the same resolver routes/workspaces/runtime.ts POST /:id/agent-key awaits.

Untested Gaps

  • A full-Worker celld boot with D1 (no Docker here).
  • Go tests and govulncheck (no Go here).
  • The Workers-runtime shards.
  • The live self-host suite.

CI covers all except the full-Worker D1 boot, which the box deploy covers.

Post-Mortem (Required for bug fix PRs)

N/A: merge, not a bug fix.

Specialist Review Evidence (Required for agent-authored PRs)

  • All local reviewers completed and findings addressed before merge
  • If any reviewer did NOT complete: needs-human-review label added and merge deferred to human: N/A
Reviewer Status Outcome
security-auditor (scope: auth, encryption, credential and outbound-fetch files where conflicts were resolved) PASS 0 CRITICAL/HIGH/MEDIUM; all five areas verified clean (ws-* proxy auth and gateway, strict deletion incl. gcp providerless exact-label matching, agent-key incl. refuseHaltedRunAccount and custom-base-URL refusal, presign equivalence and key scope, AI budget files). 2 LOW in branch-only code outside the merge (listed above)
task-completion-validator (on e08088cca) PASS 0 CRITICAL/HIGH. It checked both sides of all 70 files changed on both sides since 57614ec6b (supersessions all documented here), found no duplicates, and confirmed the PR claims, migrations and new tests. MEDIUM: CI was pending at review time; now green. LOW items: the shortstat was refreshed (done); the agent-key route awaits the AI-proxy resolver before the eligibility check, which is pre-existing branch code the merge did not touch (listed under findings)

CodeRabbit Review Evidence (Required for agent-authored PRs)

  • CodeRabbit requested: skipped by task instruction (draft PR into the integration branch)
  • Waited: N/A
  • Outcome: N/A

CodeRabbit Notes

Not requested: the dispatching coordinator told this task to skip CodeRabbit.

Exceptions (If any)

  • Scope: no staging, no Playwright, no CodeRabbit. The base is the integration branch.
  • Rationale: M1 task instructions from the coordinator (task 01M7AF82KG9C78WAABTG3V1MN1).
  • Expiration: this PR.

Agent Preflight (Required)

  • Preflight completed before code changes

Classification

  • external-api-change
  • cross-component-change
  • business-logic-change
  • public-surface-change
  • docs-sync-change
  • security-sensitive-change
  • ui-change
  • infra-change

External References

N/A: no external API changed. Inputs read before editing: the #2709 (L0) description; the #2714 and #2733 diffs; per-file diffs of both parents against 57614ec6b; celld 0.6.3 --help, dev --help and d1 --help.

Codebase Impact Analysis

  • apps/api: proxy routes, agent-key, strict node deletion, build-context shim, Connector bindings, tests.
  • packages/app-deployment: build-context upload.
  • scripts/quality: baselines.
  • .github/workflows/ci.yml.
  • apps/web: one import.

Documentation & Specs

No doc change needed. The resolution adds no new behaviour on Cloudflare, and the self-host behaviour it keeps is already documented on the branch.

Constitution & Risk Check

  • Principle X: one resolver, one presign client, one label matcher; no new mechanism.
  • Principle XI: no new hard-coded values.
  • Risk: behaviour drift in resolved files, mitigated by per-file diffs against both parents, the security audit, and the test and CI results above.

🤖 Generated with Claude Code

simple-agent-manager Bot and others added 30 commits November 13, 2026 13:36
…session size (#2702)

* feat(archive): flip then paged reclaim, and one resumable path for every session size

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(archive): port onto packages/project-data; satisfy the DO migration, AST and lint gates

- Imports follow the worker extraction (#2681): worker-core helpers,
  internal test paths.
- Migration 076's triggers are frozen literal SQL; the DO migration safety
  test allows CREATE TRIGGER IF NOT EXISTS only when its body neither
  deletes nor drops.
- The paged target abandon deletes tool-payload archives and messages with
  two literal statements instead of an interpolated table name.
- Import order fixed; task file records the fold and port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(archive): re-read the reserved total after a refund within a tick

A large candidate reserved and then refused by the root was refunded in
D1 but stayed in the per-tick reserved cache, so smaller affordable
candidates behind it were floor-refused for the rest of the tick. A
successful refund now drops the cache and the next floor check re-reads D1.

Scenario test on real DO/D1/R2; reverting the invalidation turns it red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(archive): wake only root objects with an unconfirmed reclaim

Staging (9d02820, 3 s wall, 74 eligible sessions) archived nothing: the
start-of-tick reclaim pass listed every project with a published journal
row, two root-DO RPCs each and past the deadline, because D1 never recorded
that a reclaim had finished. 21 clean projects made the tick take 20 s.

D1 migration 0237 adds project_data_archive_migrations.reclaim_pending
(default 1, so existing and older-coordinator rows are covered). The pass
selects only flagged projects. A completed reclaim clears the flag, and so
does a complete listing that omits a row snapshotted from D1 before the
listing (the fence against a concurrent flip). Copy-back-fenced sessions are
listed as fenced and keep their flag.

Also addresses CodeRabbit on 9d02820: the unit flip fake no longer deletes,
the renewal test now outlasts its lease, and the copy-back test exercises
the reclaim fence directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(quality): fix pre-existing lint errors in the DO migration-safety test

Sort imports and replace inline require('node:fs') with a top-level import.
Behaviour unchanged (11/11 pass).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(task): record staging verification of the reclaim_pending fix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(tasks): archive the worker modularization task files

PR #2681 is merged and deployed. Ticks the remaining checklist and
acceptance items with their evidence, adds an Outcome section with the
gaps the completion validator asked to have spelled out, moves the brief
and the eight workstream notes to tasks/archive, and repoints the two code
comments that cite the brief.

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

* docs: point package AGENTS files at the archived modularization brief

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

* docs(tasks): state the staging regression's actual coverage in the archived brief

CodeRabbit pointed out that the checklist said "full regression" while the
Outcome section lists flows that were not exercised on staging.

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

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
)

* docs(www): journal post on splitting the API worker into packages

SAM's daily journal entry for #2681: the API worker split into eight
workspace packages with narrow env types, ports, re-export forwards and a
blocking boundary lint rule, done by coordinated agents in about 20 hours
with no behavior change. Adds the X card and a Mermaid browser check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(www): address accuracy review on the worker split post

Fix the deep-path example, label the diagram's six feature packages,
separate merge and production times, list the untested cron, call the
45 minutes a limit, and gloss D1, bindings, Wrangler and lint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ineage (#2710)

* feat(connector): profile accounts, pool usage, per-chat model and lineage for monitoring

- sam_profiles_list names the account each profile runs on (metadata-only resolver, no decrypt)
- sam_usage_get: provider usage per quota pool with freshness, exhaustion and reset times
- sam_chat_start accepts a one-chat model/effort override; profile and account unchanged
- sam_chats_list carries task state, step and parent beside the stale-prone lifecycle label
- sam_tasks_list carries parentTaskId, executionStep and sessionId

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(connector): profile accounts, usage pools, per-chat model, chat task state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(connector): share agent-key selection, opaque pools, honest SAM-proxy state

Review fixes:
- Profile accounts now come from the shared selection (agent-credential-selection.ts)
  that admission uses: cc rows with no match fall through to the legacy table,
  unusable credential kinds seed nothing, platform credentials are never an account.
  buildSnapshot gains a metadata-only mode instead of a forked snapshot.
- sam_ai_proxy state only when the person chose SAM as provider (Claude/Codex),
  matching the agent-key route; platform windows from other members are gone.
- poolId is an opaque digest: backfilled credential ids embed ciphertext.
  Ciphertext equality for pools is computed in SQL.
- Usage reads only the pool's own references across projects (no row-cap crowding,
  fewer round trips); chat task enrichment is fault-isolated and bind-limit tested.
- Drop v.trim from sam_chat_start (it broke JSON Schema publication); tool count 39.
- Legacy precedence tests moved to a real SQL engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(connector): one SAM-proxy predicate for the agent-key route and account read

- services/sam-ai-proxy-fallback.ts: PROXY_ELIGIBLE_AGENTS, AI_PROXY_ENABLED and the
  explicit-SAM-provider rule, used by runtime.ts and profile-account-bindings.ts
- Parity test covers every fixture user (cc, legacy-only, platform+legacy, none)
- Legacy platform step-3 test; production-shaped legacy rows in route mocks
- Static error text for profile list failures; usage semantics say 'would select'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: archive connector account monitoring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(connector): map pool and provider-mode rows through maybeJsonRecord

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(connector): address SonarCloud findings (sort compare, nested ternaries, complexity)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(operations): keep profile-list error detail for workspace agents only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: revert unrelated formatting from a too-broad prettier run

1899349 ran prettier over apps/api/src/services/*.ts and reformatted 71 files
this PR does not otherwise touch. Restore them to the merge base.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(deps): update six backend dependencies together

* docs: persist backend dependency review and native runtime evidence

* fix(deps): require Node-API 10 compatible development runtimes

* docs: record specialist completion audit and staging coordination

* docs: record passing full backend dependency quality suite

* test(vm-agent): await admission after eviction replay completes

* docs: record completed backend validation and reviews

* docs: preserve interrupted Workers and staging gate status

* fix(security): pin Go 1.26.11 across builds and installer

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
#2713)

* feat(web): paint comment quotes in chat and library markdown, click to open

Share the comment reader's CSS Custom Highlight painter with the project chat
and the library markdown viewer. Open quoted comments are painted faintly by
default, the focused comment strongly; clicking painted words opens the
newest open thread under them. Surfaces register into one registry so a
library preview over a chat cannot erase the chat's highlights. Library
comments opened from the Comments page now open the panel on the thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(web): cover comment quote highlights in chat and library

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): land comment links reliably and reveal the quoted words

"Open in chat" now always takes the confirmed jump path: the one-shot fast
path could be undone by the list's own first scroll to the newest message,
leaving the reader at the bottom with the target never rendered.

Reveal the open comment's words only when someone is sent to them (a link or
a thread's View), not when they click the words themselves. Document the
highlights and the library deep link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record comment quote highlight progress

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): address review of comment quote highlights

- Select-to-comment keeps working: a click that dismisses a selection (read on
  press), a double or triple click, and a click on a link are left alone; a
  mouse click waits out a double-click before opening.
- Hit-test only the text lines a quote covers, not block boxes between them,
  and keep the open thread when its words are under the pointer.
- No observer and no paint while there is nothing to paint; each element's
  text is indexed once per paint however many quotes it holds.
- The reveal stops waiting for unfound words after 10s; the reader shares the
  same user-scroll signals. Deep links use jumpToMessage's confirm option
  instead of a copy of its body.
- Tests: dismiss tap, double click, link, late-mounting log, reveal window
  (scrolls, settles, stops on wheel, expires, not on click), library deep-link
  reveal, reader resolved filter, Comments page library link, text-line hits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: archive comment quote highlights task

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): address CodeRabbit review of comment quote highlights

- Paint a comment anchored to a later streamed chunk inside the reply row
  that absorbed it (useConversationJump exposes rowIdFor).
- Statuses painted by default are a named allowlist (open, sent), shared by
  the chat, library and reader.
- Repaint when an image inside the surface loads, so a reveal survives the
  layout shift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style(web): sort test imports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…elf-hosted buyer (#2716)

* task: rewrite integrations and enterprise marketing pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* www: rewrite integrations and enterprise pages for accuracy and the self-hosted buyer

Integrations: correct OpenCode providers, Mistral Vibe models, GCP setup and
volumes, region counts; add Amp and GitLab; move GitHub out of AI Models;
sections by buyer question with agent and cloud comparison tables; detail
template with dynamic step count and shared footer.

Enterprise: self-hosted framing, what-runs-where, data-location table,
short security-review answers, real UI screenshots, an explicit not-yet
list, mobile-safe comparison table, support CTA. Subpages share one layout
and drop claims the code contradicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* www: sync docs with the self-hosted-only model, add drift test and page coverage

- docs: OpenCode providers are Zen, Go and Custom; replace hosted-platform
  wording with installation-administrator wording; features data quota unit
  is vCPU-hours
- tests: integrations-catalog drift test reads packages/shared, providers and
  AgentSettingsCard source; marketing-pages spec covers the new pages
- a11y: underline inline links on enterprise pages; mobile table fixes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* www: move integrations comparison rows into their own module (file size limit)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record implementation notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* www: address review findings on accuracy and coverage

- machine lifetime: 4h applies only when idle; 24h absolute ceiling sleeps sessions
- firewall wording scoped to the agent port and SSH; metadata block is for containers
- shared chats let a teammate prompt the owner's agent
- Vibe: uv fetches Python 3.12 itself; OpenCode also accepts compatible endpoints
- security doc token table matches code (7d cookie, 1h JWT, 15 min bootstrap)
- remaining 'hosted service' wording in docs and two blog posts
- Playwright: all enterprise subpages, plus a comparison-table readability check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* www: address UX review on integrations and enterprise pages

- comparison table keeps table roles when stacked on phones; labels are silent
  to screen readers; SAM row highlighted in stacked cards
- heroes align with the section grid; count-aware card columns remove orphans
- not-yet list moved above product screenshots, solid cards with a tag
- screenshots link to full size; full-width hero buttons on small phones
- balanced heading wrap, tighter h2 leading, FAQ markers, link-card arrows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: archive integrations and enterprise pages rewrite

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* www: keep integration copy in JSON, validated at build like feature pages

The agent, cloud and platform entries were TypeScript object literals with
the same shape, which SonarCloud counts as duplicated code (22.5% new
duplication). Move the copy to agents.json, clouds.json and platform.json
and validate each entry with asIntegration(), mirroring data/features/*.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* task: credential-independent node teardown

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(api): split providerless strict teardown into its own module

Moves reconcileStrictProviderlessVm out of strict-node-deletion.ts (509 lines, rule 18)
and extracts the exact-ownership label comparison into node-provider-labels.ts
(nodeProviderLabelsMatch). Behavior unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): tear down nodes after their placement credential rotates

Strict teardown no longer depends on the credential that created a node. The pinned
placement credential is used while it resolves to its exact generation; otherwise the
node owner's current credentials for the provider are tried (provisioning order, then
the installation's platform credential), and ownership is proven from the instance:
it is re-read right before deleteVM and must carry the recorded instance ID and every
exact SAM label (managed, node, role, env, installation, incarnation). A mismatch
preserves the VM; a credential that cannot see it is never absence proof.

Refusals are named (teardown_credential_unavailable, teardown_instance_not_visible,
teardown_instance_ownership_mismatch, teardown_ownership_scope_unavailable), recorded on
the node from the shared strict-deletion funnel, raise the existing operator alert, and
survive cron re-diagnosis and the stranded sweep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(api): cover stranded-deadline reason and instance-ID mismatch on credential fallback

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: node teardown no longer depends on the provisioning credential

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): address teardown review findings

- Named teardown refusals keep the full failure backoff past the blocked deadline,
  so a node that needs a person does not re-read the provider every cron tick.
- The ownership search continues past a visible instance that is not this node's,
  so an account-scoped ID collision cannot hide the account that owns the VM.
- A credential resolution that threw is a retryable failure, not a
  teardown_credential_unavailable verdict.
- Every enabled platform credential for the provider is a candidate, per-row
  isolated and without decrypting twice.
- The blocked-state recorder alerts only when its incarnation fence matched.
- Deployment-role nodes, the stranded sweep and the legacy deployment test are covered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): treat a rejected current credential as unable to see the node's VM

A 401/403 from a current owner credential can never answer for the instance, so it
counts toward a named teardown_instance_not_visible verdict instead of retrying
silently. The blocked-state recorder also skips nodes already proven terminated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): only a credential refusal, not a rate-limited 403, ends teardown as not visible

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): address CodeRabbit review on credential-independent teardown

- A project-attributed node also tries the owner's user credential, since
  createProviderForUser returns only the first tier that resolves.
- Refusal classification recognizes GcpApiError 401/403 from token exchange and
  impersonation, and keeps rate, quota and limit 403s retryable for Hetzner and GCP.
- A credential that can read the VM but is refused the DELETE is skipped; the next
  credential proves ownership again before its own delete (teardown_delete_refused
  when none may delete).
- The operator alert claim is fenced to the runtime incarnation, provider instance
  and blocked episode the caller observed.
- The duplicated-tag test keeps the matching installation label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): match limit errors by token and name delete refusals consistently

A 403 whose text merely contains "rate" (e.g. a project id) is still a credential
refusal; only rate-limit, quota and exceeded-limit tokens stay retryable. After a
delete refusal, a foreign instance seen through another credential also ends in
teardown_delete_refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(tasks): archive credential-independent teardown task with staging evidence

Task-file-only change. The code tree is identical to e7343e2, which ran on staging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): classify credential refusals from structured error codes only

isCredentialRejection decided whether a 401/403 was a temporary limit by
matching words like "quota" in the message text. A permission refusal that
named a resource such as "quota-prod" was then read as a limit, so a
read-only credential's refused DELETE stopped teardown instead of moving on
to the next owner credential (CodeRabbit, #2715).

Only machine-readable codes decide now: the provider error code and Google
ErrorInfo reason for ProviderError, and error.status, errors[].reason,
details[].reason or the OAuth error code from a GcpApiError body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* task: track portable build context implementation

* feat: collect portable compose build context without Docker

* feat: reserve and verify scoped build-context uploads

* feat: collect context on VM and Instant with secret-safe Compose loading

* feat: retain verified contexts and record fenced timing history

* fix: preserve all Compose inputs and bound graph expansion

* feat: verify contexts through isolated publish shadow jobs

* style: sort build context shadow imports

* fix: use patched zstd dependency and SQL migration imports

* docs: record portable context dependency evidence

* test: prepare Instant mountpoint for real route fixtures

* fix: select context source by standalone runtime role

* fix(deploy): anchor build context reads to source directory handles

* fix(deploy): prevent FIFO blocking during context root acquisition

* fix: bind context upload metadata and classify R2 failures

* docs: record phase 2 transport proof and remaining VM gate

* fix: address build context review findings

* fix: port build context across worker modules and renumber migrations

* fix: preserve staging-applied context migration names

* fix: recognize applied context migrations in ordering guard

* fix: resume context cleanup past slow failures

* fix: retry context callbacks with exact committed receipts

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
…line (#2717)

* proto(web): connector provenance, usage windows and per-run account variants

Dev-only prototype at /prototype/run-account comparing today's UI with
variants for: where 'via ChatGPT' sits on a chat-list row, how a usage
indicator names its window (5h, week, Opus week), and choosing an account
for one run instead of keeping one profile per account.

PROTOTYPE ONLY: remove the route and directory before any merge to main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* proto(web): usage round 2, 5h-first ring variants across eight account states

Adds Raphaël's ring (arc = 5h left, colour = week health, dot at zero) next
to ring + week pip, thick ring + hairline week, and ring + week bar
(CodexBar/UsageBar style), all fed the same eight scenarios.

PROTOTYPE ONLY: remove the route and directory before any merge to main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(api): choose the agent account for one run

Tasks gain agent_configuration_id: the caller's own account chosen for this run,
over the profile's. The shared resolver checks it first (a new 'run' tier) and
halts rather than falling back when it is paused, missing, another person's, or
for a different agent. The profile credential context carries it, so the
agent-key callback, provider-limit admission, the AI proxy and credential
write-back all resolve the same account. Task submit and chat start validate
it before any task effect; wakes and re-runs reuse the task row, so they keep it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(web): 5h-first usage ring, per-chat account choice, connector on the meta line

- Usage ring: the arc is the 5h window, the colour is the week's health (green
  above half, amber to a quarter, red below), with a dot when the arc is empty.
  A used-up week empties it; weekly-only accounts draw the week. Words appear
  only at half or less, the 5h first.
- Profile list rows and the Profiles page show every window as a labelled
  meter in percent left.
- 'on <account>' beside To picks one of your accounts for this chat; the
  low-usage nudge names the limit and offers 'Run on <account>', with an undo.
  The ring follows the chosen account and submit sends agentConfigurationId.
- Connector provenance moves to the meta line: 'Chat via ChatGPT'.
- Removes the /prototype/run-account prototype.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: address review of per-run account and usage ring

API
- Migration renumbered to 0238 (0237 is taken on main).
- A run account that can no longer be used refuses at agent-key
  (refuseHaltedRunAccount) instead of continuing to the platform proxy.
- The run tier skips an account chosen for another agent (like a profile
  pin) and re-checks the owner of the configuration and its credential.
- Submit requires the account to carry the caller's own credential.
- The AI proxy reads the run account in its existing session query, so no
  extra D1 read per model call; task lookup by workspace is newest-first.
- Tests: wake reactivation keeps the account, submit route through
  agent-key in one database, platform-mode refusal, other-agent skip.

Web
- Account list: pressed buttons in a labelled group, focus moves in on open
  and back to the trigger on close, Escape closes, and a profile on the
  SAM platform can go back to it. The nudge hides while the list is open
  and no longer hides a chosen account that is itself low.
- Meters say 'left' to screen readers; picker-row meters are decorative.
- Card usage words wrap to two lines; the empty-arc dot is not clipped; a
  week without a reading no longer colours the ring.
- Audits updated for the new copy; backlog task for the unrelated
  onboarding-overlay failures in the nested sidebar audit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(web): the account chosen beside To reaches the submit request

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(api): runtime asset mock supports the newest-first task lookup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: archive usage-windows-and-per-run-account

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): carry the run tier through the shared credential selection

#2710 moved admission's selection into agent-credential-selection.ts, which maps
resolution sources to tiers; a run account resolves as 'run'. Profile account
bindings are resolved without a run, so 'run' never reaches them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: fold the run-account tests into the suites they extend

The three new run-account test files copied their fixtures from sibling suites
(SonarCloud: 10% duplicated new lines). Each now lives in the suite it extends,
sharing one fixture set: resolver tiers in composable-credentials-profile-pins,
the capability slice in profile-account-pins-capability, and the submit route
cases in task-submit-route (renamed from task-submit-source-idea, which now
covers both the idea gate and the run account). No test was dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): wrap a long profile name in the account list

The profile's name in an account row's caption could not shrink, so one long
unbroken name pushed the list 32-480px wider than a phone screen. Found by the
staging proof. The new Playwright case measures the list and every row against
its client width for a long name and a URL name; it failed before the fix
(scrollWidth 810 vs 330).

Also files the Connecting... alert-role issue found during the same proof.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* task: plan deterministic tunnel settle-window check

* task: activate tunnel settle-clock investigation

* test(api): anchor tunnel settle checks to persisted create time

* docs: record tunnel timing regression and validation evidence

* docs: finalize tunnel settle-clock verification record

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
…save (#2718)

* task: credential re-save safe for compute pools and node cleanup

* fix(api): keep a cloud connection's identity across a re-save and reap nodes whose source was deleted

A GCP re-save deleted and re-inserted the credentials row. capacity_sources cascades from it,
so the user's pool choices were deleted (GCP unplaceable) and every node placed from it lost
capacity_source_id, which the cleanup provenance predicate required (never reaped).

- replaceUserGcpCredential updates the row in place, like every other provider's save.
- PUT /api/gcp/service-account and POST /api/gcp/setup reconcile capacity pools.
- Cleanup provenance accepts a released capacity_source_id only in the cascade's exact
  shape (column NULL and the named candidate gone); hasManagedVmPlacementProof follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: a credential re-save keeps the pool account; removed accounts' nodes are still cleaned up

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): address review on credential re-save

- Duplicate GCP rows collapse onto the row a capacity source is built on.
- Released-source provenance also requires the node's own pool to exist and belong to its owner.
- Tests: PUT /api/gcp/service-account moves the source's credential version; a released node is
  never reused for new work; a foreign pool is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record review follow-ups and discrimination evidence

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: backlog in-place platform cloud credential rotation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(api): give cleanup fixtures the pool tables the provenance predicate reads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(api): use a fake credential id in the released-node fixture

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(quality): review the credential-id fixture in this PR's history

Commit 538817f's worker test held a credentials:<ULID> row reference (an id, not a
secret); 6c39434 replaced it. Accept that exact historical finding, expiring in 30 days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): address adversarial re-check on credential re-save

- Providerless reconcile no longer takes the released-source flag: it needs the exact pinned
  credential, which a release always deleted. Comment says where such nodes surface.
- Name the in-place GCP writer in the credential-version writer table (rule 71).
- Tests: released shape binds to the node's own pool scope, project and installation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(api): state the real reason released nodes skip the providerless reconcile

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* task: trace archive cursor CI nondeterminism

* test: control archive lease time and scope verification observations

* docs: record archive test diagnosis and local review

* test: isolate unrelated verification from flip fault injector

* docs: record archive guard discrimination evidence

* test: control large archive copy deadlines under CPU load

* docs: record final archive timing guard proofs

* test: retire archive fixtures before their summary callbacks leak

* docs: record final archive guard proofs and stability progress

* docs: record 60 archive cursor passes and completed local reviews

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
* task: track exact JWT lifetime race fix

* task: activate exact JWT lifetime fix

* fix: derive JWT expiry and issue time from one clock read

* task: record exact lifetime regression and review evidence

* fix: keep exact access token lifetimes across clock boundaries

* task: record final JWT lifetime validation

* docs: record verified JWT lifetime staging acceptance

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
* task: plan deterministic Codex rate-limit test correction

* test: control Codex rate-limit window clock at minute boundaries

* docs: record repeated boundary and mutation test proof

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
* task: investigate archive sharding lifecycle timeout

* fix(project-data): index archive search document equivalence lookups

* fix(project-data): seek existing projection identities without schema growth

* style(test): sort archive helper import

* test(api): budget measured archive lifecycle work under CPU contention

* test: preserve archive timeout measurements and repeat harness

* test: record 30 normal and 30 CPU-loaded archive passes

* docs: record archive completion review and release hold

* fix: create archive repeat harness output directory

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
* task: plan container rollout completion follow-up

* fix: wait for container rollout completion in deployments

* test: cover rollout gate on both deployment paths

* task: record rollout gate validation progress

* fix: identify container rollouts through API snapshots

* task: record resolved rollout review findings

* task: preserve validation limits and runtime evidence

* docs: clarify rollout gate and running binary evidence

* refactor: simplify container rollout polling and assertions

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
…tion) (#2725)

* task: add cleanup-cron-two-phase-provider-deletion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(providers): two-phase GCP VM deletion (request + status by operation record)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(api): two-phase provider deletion in the node cleanup cron

The stopped/destroying handoff phases and stranded retirement start a provider
deletion without waiting for its operation (write-ahead record on the node row),
and a new first phase confirms it from the provider's own record before writing
termination proof. Handoff candidates rotate by backoff so a failing page cannot
hold the head of every tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(api): two-phase teardown at the cleanup cron entry point

Cron-entry tests with a provider whose delete outlasts an attempt: reaped
across ticks with one DELETE and proof only after the provider records it
done, the same after a credential re-save, never-confirming bound with alert,
round-robin under a full page of slow candidates, and Hetzner/ownership
controls. Existing cleanup tests updated for the new phase and counters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: two-phase provider deletion in the cleanup cron; backlog for remaining slow-delete callers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(api): scope of NODE_STOPPED_HANDOFF_REQUEST_TIMEOUT_MS in .env.example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(api): move teardown credential-rejection classifier to its own module

Keeps node-teardown-authority.ts under the 500-line limit; re-exported unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(api): settle real async work between fake-timer steps in the starvation test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: update checklist and discrimination record

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): keep a sent deletion in the confirm phase; confirm mode never sends

Review fixes: a failed attempt after the write-ahead record no longer returns the
node to stopped (where no phase selected it); the confirm phase clears a record
that no longer matches instead of falling through to a new DELETE; phases stop
starting attempts below a third of the per-attempt budget; migration renumbered
0241 to avoid open PRs' 0239.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): bound every confirm failure; grace for a DELETE still leaving; page GCP ops

Adversarial review: a confirmation failing before the status read now becomes
teardown_deletion_unconfirmed past the bound instead of retrying every tick; a
not_requested answer within the sender's attempt budget is still pending, so a
racing caller cannot clear the record and cause a second DELETE; the GCP
operations list follows nextPageToken (bounded).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(api): node-cleanup call args include the send grace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: honour the sender's recorded grace; stop GCP ops paging at a conclusive page

Adversarial delta review LOWs: a confirming caller (e.g. an owner delete) uses the
sender's recorded per-attempt budget as the in-flight grace, and the GCP delete
operations walk returns as soon as a page shows this instance's delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(api): validate the provider deletion record instead of narrowing parsed JSON

Runtime-boundary semantic check (blind-external-payload-narrowing).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: CodeRabbit review — attempt minimum capped by phase budget, hold failed in grace, re-read before GCP DELETE

- minimumTeardownAttemptMs never exceeds half the phase budget, so a short phase budget or a
  long per-attempt budget cannot skip every cleanup attempt.
- A 'failed' provider record inside the sender's grace is still pending (GCP's record is per
  instance, so an earlier attempt's failure must not void this attempt's ticket).
- requestGcpInstanceDeletion re-reads the instance by name after beforeSend and refuses a
  different numeric id before the name-addressed DELETE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(providers): re-read the GCP instance by numeric id before the name-addressed DELETE

Adversarial delta LOW: a by-name 404 after a rename read as absent. Re-reading by id makes a 404
mean this exact instance is gone, and a changed name is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(providers): fail closed if a GCP id lookup ever stops resolving

A 404 by numeric id is reported absent only when the name does not resolve to the same
instance; otherwise the request is refused with no DELETE. GET by id verified live (read-only)
against sam-prod-infra on 2026-11-14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… webhook targets (#2727)

* task: cut wasted DO SQLite row writes (archive pressure gate, system-owned webhook targets)

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

* fix(archive): archive only projects under storage pressure; skip system-owned webhook targets

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

* test+docs: cover the archive storage-pressure gate and system-owned webhook targets

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

* test: archive sweep storage-pressure settings resolve through the registry

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

* task: record implementation notes

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

* fix: exclude system-owned projects at the GitHub project lookup; cover review findings

- findProjectsForGitHubRepository() leaves out projects owned by SYSTEM_USER_ID, so both the
  project-event producer and pull-request tracking skip them
- held-session count runs after the migration batch
- tests: exact threshold and telemetry-age boundaries, in-flight migration and paged reclaim of
  a held project, wrapper passes admin settings through, count failure reports null
- docs: telemetry-disabled case, measurement interval, shared max bound

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

* test: give the producer fixture project an owner

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

* test+docs: address CodeRabbit review on the archive pressure gate

- in-flight case no longer depends on wall time: the first tick runs on a controlled clock that
  only advances when a chunk is written, so the yield happens after six chunk writes
- docs: the gate reads the stored reading and its age, not the telemetry switch

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

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…2732)

* fix(deploy): trust completed pinned rollout over stale application list

* docs(deploy): clarify pinned rollout completion authority

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
)

* task: gcp boot disk scales with the machine (slice 1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(gcp): size the boot disk by vCPU (20 GB/vCPU, 50 GB floor) and price it

The GCP provider created every VM with a fixed 50 GB boot disk and the
catalog advertised 50 GB, so an 8-vCPU node admitted about one default
workspace and disk ran out before CPU or memory.

- gcpBootDiskSizeGb(): max(minGb, gbPerVcpu x vCPUs); admin settings
  gcpCatalog.bootDiskGbPerVcpu (20) and gcpCatalog.bootDiskMinGb (50)
- catalog offerings, static offerings and createVM share that policy;
  a pool plan's resources.diskGb (the candidate disk) decides the VM size
- offering price adds the region's pd-balanced capacity price
- every GcpProvider in the API is built by createGcpProviderForEnv()
- remove the dead GCP_DISK_SIZE_GB env var and DEFAULT_GCP_DISK_SIZE_GB

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(gcp): boot disk sizing through catalog, pool refresh, reuse and admin settings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record slice 1 implementation notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(gcp): apply review findings for boot disk sizing

- route the static catalog fallback through the boot disk policy
- build GCP providers with createProvider (GcpProviderConfig gains catalog)
- refresh a stored price table that predates boot disk prices at once;
  warn when a refresh finds no disk prices; a malformed disk map drops
  only the disk prices
- drop unread catalogMetadata.bootDiskGb; revert formatter churn in
  native-vm-config.ts; import GcpBootDiskPolicy in GcpProviderConfig
- tests: lowering the policy keeps nodes reusable, an admin edit reaches
  the candidate row, settings outage falls back to defaults, static
  fallback follows the policy, old price tables refresh
- docs: precedence, refresh path, quota guidance; blog price note

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(gcp): keep provider resolution free of settings-registry load edges

Tests that mock drizzle-orm or the providers package broke once
provider-credentials statically reached the admin settings registry.
Load the settings module on first use (as gcp-sts already is), move the
boot disk default constants to shared next to the other GCP defaults,
and keep constructing GcpProvider directly so tests that substitute the
class still intercept teardown and provisioning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(shared): GCP large size capacity follows the boot disk policy (80 GB)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: archive gcp boot disk slice with staging evidence

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(gcp): share the Compute stub between the boot disk tests

SonarCloud flagged the duplicated stub (4.3% duplication on new code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…2714)

* refactor(api): move the ws-* proxy out of index.ts into route modules

Pure move of the workspace-subdomain proxy middleware (index.ts lines 258-732 on main)
into routes/workspace-subdomain-proxy.ts and routes/workspace-port-access.ts, mounted at
the same position in the middleware chain. No behaviour change. index.ts drops from
1,040 to 543 lines and leaves the file-size exemption list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record L2 local gate results

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record L2 review results

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record L2 merge-hold sources

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: simple-agent-manager[bot] <260041690+simple-agent-manager[bot]@users.noreply.github.com>
* fix(placement): compute pool decides VM provider and location

Projects and agent profiles/skills carried their own provider and location.
The resolved provider was a hard filter on pool offerings, so a project with
a stored default_provider could not use offerings its own pool allowed, and
failed with "no eligible offering" when those were the only ones. The project
default location was mostly ignored, which made the setting misleading.

Provider and location now come only from the effective compute pool and the
work's resource requirements. An explicit per-request provider/vmLocation
(task submit, dispatch_task) and the wake location preference still apply.

- scheduler-core: resolveProvider/resolveVmLocation read only explicit and
  preferred values; project/profile placement types drop the fields
- shared: remove provider/vmLocation from profile/skill types and
  defaultProvider/defaultLocation from Project/UpdateProjectRequest
- api: stop reading the columns in placement, chat-start and task-submit
  runtime selection, retry-subtask, orchestrator scheduling, credential
  attribution health and offboarding preview; drop them from PATCH
  /projects/:id, profile/skill REST + MCP schemas and responses
- web: remove the Provider & Location section from Project Settings
- db: columns kept (migration safety), no longer read or written
- docs: compute-pools, concepts, creating-workspaces, idea-execution
- tests: new real-SQLite slice through resolveCanonicalVmAllocationPlan with
  a legacy project row; Playwright scaling audit repaired (stale mocks,
  onboarding modal, inner scroll container) and updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(placement): address review of pool-decided provider/location

- OpenAPI: drop provider/vmLocation from the AgentProfile schema; regenerate
- schema: mark projects.default_provider/default_location and
  agent_profiles/skills provider/vm_location as retired
- tests: MCP field extraction, profile service and eviction recovery assert
  the new contract (legacy row values are ignored, never returned)
- playwright: drop stale defaultProvider/defaultLocation from mocks
- docs/rules: overview ranking wording; rule 24 grep example uses a live field
- backlog: host ranking still tie-breaks on the platform default location

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: avoid unused destructured bindings in MCP field-extraction tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ve) (#2733)

* task: add L3 API pure splits task file

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(api): split tts.ts into tts-config and tts-text (L3, pure move)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(ai-proxy): split ai-token-budget into ai-budget-settings and ai-monthly-cost-cap (L3, pure move)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(api): split sam-session agent-loop into agent-loop-llm and agent-loop-streams (L3, pure move)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record L3 implementation and local gates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* task: record L3 staging verification

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Brings #2714 (ws-* proxy moved out of index.ts), #2733 (tts, ai-token-budget,
agent-loop splits), #2715/#2718/#2725 (node teardown authority, two-phase
provider deletion), #2605 (build-context bundles), #2658 (Go 1.26.11 and
dependency upgrades), #2723, #2702/#2724 and the rest of main since 57614ec.

17 conflicted files. Main's structure wins and the branch's behaviour is
re-applied on top:
- ws-* proxy files: main's text plus the branch's redirect:'manual', node
  route seam (NODE_UNREACHABLE, node_route_unavailable), reverse-tunnel
  origin, Caddy forward_auth gateway and x-sam-gateway-secret stripping.
- #2733 split files: branch versions (main's split is a pure move the branch
  already contains; branch adds the speech endpoint, local metering, endpoint
  routing).
- strict node deletion: main's two-phase deletion and teardown authority;
  the branch's GCP providerless reconcile, manual-deletion hint and
  reverse-tunnel lease release carried into main's new
  strict-node-providerless-reconcile.ts. The branch's label matcher is
  dropped for main's identical nodeProviderLabelsMatch.
- isAiProxyEnabled: one resolver (the branch's gateway-aware one); main's
  samProxyFallbackAvailable now reads it, so the Connector read and the
  agent-key route still agree.
- build-context upload (#2605) signs through the shared R2 presign target,
  like compose artifacts (same URL on Cloudflare; operator stores work).
- baselines merged by content (gitleaks groups, dependency evidence).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* task: track ProjectData per-operation row accounting

* feat(project-data): aggregate row usage by operation

* test(project-data): prove row accounting boundaries and guards

* chore: archive reviewed row accounting implementation

* docs: record staging row accounting evidence

* fix(project-data): stabilize row accounting checks and address review findings

* fix(quality): reject incomplete telemetry calculation ranks

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
…ng the DOM (#2735)

* docs(www): journal post on highlighting comment quotes without touching the DOM

Covers PR #2713: comment quotes painted in chat and library previews with the
CSS Custom Highlight API, click hit-testing, and the deep-link scroll race fix.
Adds dark/light UI renders with mock data and the X card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(www): correct framing per content review

The Comments page reader already painted quotes; the jump race was found
while testing; resolved comments paint when opened; no-API fallback detail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ir the lockfile

The merged lockfile had no entry for isomorphic-git@1.38.7: main (#2658)
upgraded repo-hosting's pin to 1.44.12 and dropped the old resolution,
while the branch's apps/api still asked for ^1.38.7 (hosted-git import).
apps/api now pins the same exact version; one copy is resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dd the gateway-less case

The merge made main's samProxyFallbackAvailable read the branch's gateway-aware
isAiProxyEnabled (the resolver the agent-key route uses). Three tests built an
env with no AI Gateway, which that resolver correctly reads as a self-hosted box
with the proxy off, so they now configure the gateway like every Cloudflare
deployment. New case: without a gateway the binding reports the SAM proxy only
after an admin turns on aiProxy.directUpstreamEnabled, through the real admin
settings write. Verified discriminating: with the kill-switch-only predicate
restored, exactly that test fails.

Also formats strict-node-providerless-reconcile.ts (one import line).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • coderabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

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

The merge replaced the branch's providerInventoryMatchesLabels with main's
identical nodeProviderLabelsMatch; the comment still named the old helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codspeed

codspeed Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing sam/task-m1-merge-latest-a4q7xh (f95a5e2) with main (567d8c0)2

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

  2. No successful run was found on sam/selfhost-pass-2 (f95a5e2) during the generation of this report, so main (567d8c0) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

raphaeltm and others added 4 commits November 14, 2026 17:24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* task: document project event storage cost investigation

* fix(project-events): reduce admission writes and indexed retention cost

* test(project-events): pin retention plans and protected-prefix costs

* fix(project-events): repair missing alarm sections on admission

* docs: archive validated project event cost investigation

* docs: record staging release checkpoint

* docs: checkpoint owned staging event fixture

* docs: record signed staging wake and verified cleanup

* fix: retry event alarm scheduling across failures and eviction

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
* task: investigate archive compatibility and lifecycle CI flakes

* fix(ci): avoid nested coverage pools and tied-time order assumptions

* test: record guard mutations and bounded repeat-run harness

* test: record 30 normal and first 10 loaded compact runs

* test: record second loaded compact batch and package checks

* test: force tied lifecycle timestamps and finish compact stability proof

* test: record first five tied-clock lifecycle repetitions

* test: record fifteen lifecycle runs and mutation reproduction details

* test: log CI CPU capacity and record 25 lifecycle runs

* test: complete thirty normal lifecycle file runs

* Record first loaded lifecycle stability batch

* Compare bounded middle CI budget after serial benchmark and 120 stable runs

* Select measured middle CI budget and record comparison limitations

* Reconcile final review findings with completed evidence

* Stop active verification test groups when the harness is interrupted

* Clean probe process groups even before readiness is published

* Retain interruption evidence without shipping the one-off probe collector

* docs(test): retain recorded evidence without repeat helper

---------

Co-authored-by: Raphaël Titsworth-Morin <raphael@raphaeltm.com>
One conflict: admin-setting-definitions.ts, union of main's
operations.projectDataRowUsageIntervalMs and the branch's OutboundSettingName.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simple-agent-manager simple-agent-manager Bot changed the title M1: merge main (03230e52b) into sam/selfhost-pass-2 M1: merge main (03230e52b, then 84d77aa0f) into sam/selfhost-pass-2 Nov 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Coordinator review (task 01M7AF82KG9C78WAABTG3V1MN1)

Reviewed head f95a5e2f31c0297d824b630605d38b0f83be0d2d. No findings; merging into sam/selfhost-pass-2 (not main).

Checked by me:

  • Ancestry: contains the branch head c0935ad06, main 84d77aa0f5bf9b1435a9b08f1cc33018c972815a and both landed slices (refactor(api): move the ws-* proxy out of index.ts (L2, pure move) #2714, refactor(api): split tts, ai-token-budget and agent-loop (L3, pure move) #2733). (The report quotes that main SHA with a wrong tail; the commit in the branch is the right one.)
  • CI run 43625330882 is green on 20cdb9941; the head differs from it only by one line in the task file.
  • The ws-* proxy: against the branch's previous version, workspace-subdomain-proxy.ts and workspace-port-access.ts differ only in header comments, so the branch's behaviour is intact (manual redirects, node-route errors with 503, the gateway authorization path, gateway-secret stripping); index.ts gains only main's buildContextCallbackRoute import and registration.
  • The three splits keep the branch's extras (speech endpoint in tts.ts, local metering in ai-monthly-cost-cap.ts, callOpenAIChatLLM in agent-loop-llm.ts).
  • Durable Object tags end at v22 then v23 (HostedGitRepo); D1 migration 0232 untouched; new from main: 0230_publish_job_build_context, 0231_publish_job_context_shadow, 0237, 0238, 0241.
  • Landing progress: git diff --shortstat origin/main...HEAD is now 844 files, +83,042 / -2,814 (was 849 files, +84,444 / -4,251).

Relied on, not re-run: the conflict table and silent-breakage fixes S1 to S7, the test totals, security-auditor and task-completion-validator. Not verified anywhere yet: a full-Worker boot on celld with D1 from this tree (the author had no Docker); the next box round does that.

@simple-agent-manager
simple-agent-manager Bot marked this pull request as ready for review November 14, 2026 18:52
@simple-agent-manager
simple-agent-manager Bot merged commit 1652457 into sam/selfhost-pass-2 Nov 14, 2026
4 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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