fix: preserve VM agent releases and explain placement - #1808
Draft
simple-agent-manager[bot] wants to merge 18 commits into
Draft
fix: preserve VM agent releases and explain placement#1808simple-agent-manager[bot] wants to merge 18 commits into
simple-agent-manager[bot] wants to merge 18 commits into
Conversation
Contributor
|
30 tasks
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.



Summary
packages/vm-agent/**+ compatibility-marker fingerprint. Unchanged inputs carry the prior exact required SHA and skip the reusable-VM R2 build/upload; changed, first-install, or unproven inputs publish the target SHA before Worker enforcement and fail closed whenskip_agentwould bypass that transition.01KZR2JAP92AK3SKW951E4H21M(2/5 workspaces, low load) reported23e7adc...; deploy run31492102025advanced enforcement tofc1e394...despite identical VM-agent fingerprints, forced task01KZRHQ4PVD1V55YP18H3BWKBFonto a new node, and left placement evidence null.Validation
pnpm lintpnpm typecheckpnpm test.claude/rules/47-control-loop-io-budget.md)Additional local evidence:
ff0b7cd69; no open findings.Staging Verification (REQUIRED for all code changes — merge-blocking)
Staging Verification Evidence
not deployed to staging. No staging, production, or other environment deployment was performed or triggered. Local tests, static analysis, specialist reviews, and normal PR CI are the authorized verification surfaces.
do not merge. This PR must remain draft/open and unmerged for human review unless Raphaël explicitly changes that instruction.
UI Compliance Checklist (Required for UI changes)
.codex/tmp/playwright-screenshots/End-to-End Verification (Required for multi-component changes)
Data Flow Trace
.github/workflows/deploy-reusable.ymlcallsscripts/deploy/resolve-vm-agent-release.ts, which delegates deterministic Git-tree/marker resolution toscripts/deploy/vm-agent-release.ts; the resulting exact release/fingerprint drives conditional binary publication and everysync-wrangler-config.tsWorker sync before API deployment.handleNodeSelection()inapps/api/src/durable-objects/task-runner/node-steps.tscallsselectNodeWithExplanation()inapps/api/src/services/node-selector.ts, thenpersistTaskPlacement()writes the task record before step advance. Provisioning/readiness append typed outcomes, andhandleWorkspaceCreation()copies the finalized explanation before workspace dispatch.WorkspaceSidebarInfrastructure.tsxrenders the mapped explanation in the default-collapsed placement section.Untested Gaps
The live Cloudflare settings/R2/Worker and VM provisioning boundaries were not exercised because this task explicitly prohibits every environment deployment. Those boundaries are covered by resolver/workflow contract tests, real Git-backed fingerprint tests, schema-backed SQLite vertical slices, and specialist review. Human staging verification remains required before any future merge authorization.
Post-Mortem (Required for bug fix PRs)
What broke
An unrelated application deploy changed the required VM-agent version to the deploy SHA even though VM-agent build inputs were unchanged. Healthy existing nodes then failed exact compatibility, forcing unnecessary provisioning, while null placement evidence hid the reason.
Root cause
The legacy
Resolve and Verify Deployment SHAbehavior in.github/workflows/deploy-reusable.ymlused the application deployment SHA as the reusable-VM release identity on every normal deploy and emitted an empty requirement forskip_agent; placement logic was duplicated and did not durably explain rejections.Class of bug
Release-identity coupling plus missing cross-boundary observability.
Why it wasn't caught
Workflow tests did not model unchanged VM-agent inputs across distinct application SHAs, and placement tests did not previously carry a real TaskRunner decision through task persistence into workspace creation.
Process fix included in this PR
.claude/rules/54-vm-agent-rollout-compatibility.mdnow documents deterministic carry-forward, explicit compatibility bumps, publication ordering, and fail-closed behavior.Post-mortem file
tasks/active/2026-08-11-vm-agent-release-placement-explanation.mdSpecialist Review Evidence (Required for agent-authored PRs)
ff0b7cd69; no remaining implementation gap.Exceptions (If any)
/dostaging phase for this draft handoff.Agent Preflight (Required)
Classification
External References
N/A: the source material was the SAM production idea/diagnosis, production run evidence, repository rules, and current implementation; no third-party API contract was introduced.
Codebase Impact Analysis
Affected paths include the reusable deploy workflow/scripts, API TaskRunner/trial/manual placement and D1 schema, shared placement types/parser, REST/OpenAPI/MCP exposure, workspace sidebar UI, tests, environment references, and rollout/public documentation.
packages/vm-agentsource is intentionally unchanged.Documentation & Specs
Updated rollout compatibility rules, environment references, architecture overview, agents/self-hosting guides, API reference, configuration reference, generated OpenAPI, and the active task record.
Constitution & Risk Check
Checked Principle XI and repository rollout/security rules. Critical risks were accidental compatibility weakening, unpublished-version enforcement, leaking node/provider/version data, and stale cross-boundary placement evidence. The implementation retains exact compatibility, publishes before enforcement, fails closed, aliases unselected identifiers, allowlists evidence, and verifies task-to-workspace ordering behaviorally.