Repository navigation
feat(server): persist and reattach execution environments - #514
Conversation
27657c0 to
797930c
Compare
Four call sites still constructed session.EnvironmentRef{Kind:
EnvKindNoFS, ID: ""} by hand instead of calling the single-source
helper the ref-persistence work (ADR 0106) introduced, so the
"collapsed duplicate derivation" claim wasn't quite true. All four
are behind profile == ProfileNoFS with sess in scope, so the value
is unchanged.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
jhrozek
left a comment
There was a problem hiding this comment.
Reviewed the architectural shape with a go-architect (opus) + software-architect panel focused on fit against AGENTS.md's layering rules and ADR 0105/0106: layering, composition ownership of the resolver seam, the fail-loud contract, and package placement all check out. No ship-blockers.
One mechanical finding from that review addressed in 198268f: four call sites in service.go still hand-constructed session.EnvironmentRef{Kind: EnvKindNoFS, ID: ""} instead of going through defaultEnvironmentRef, the single-source helper this PR introduces for exactly that value. All behind profile == ProfileNoFS with sess in scope, so the resulting value is unchanged — routed through the helper for real single-source discipline. Build/lint/test green.
Remaining review note (not blocking, worth a follow-up): both reviewers independently flagged internal/adapter/remoteenv as larger than its contract-proof job needs — it re-implements chunks of memfs (glob/grep/versioning) rather than wrapping it, and the fork/merge conflict-detection logic goes beyond proving reattachment into speculative merge-protocol design. Worth thinning out before a real transport adapter uses it as a reference, but doesn't affect correctness of what's landing here.
…classification) - Track #503/#514 execution-environment seam: Run/ResumeApproval take tool.Environment (agent.EnvForWS), fakeTool exec keeps the Workspace contract (Execute bridges via env.Workspace()); blocking-steer test stubs take tool.Environment. - Track #368 caller separation: Steer/CancelSteer authorize via GetSession before touching the run registry / run-entry funnel (foreign = absence-equivalent), and register both in serviceAccessTable (ADR 0102 decision 2) — closes the cross-caller steer-injection gap the classification invariant surfaced. - gci-format model.go post-merge. Co-Authored-By: mecatl <[email protected]>
…classification) - Track #503/#514 execution-environment seam: Run/ResumeApproval take tool.Environment (agent.EnvForWS), fakeTool exec keeps the Workspace contract (Execute bridges via env.Workspace()); blocking-steer test stubs take tool.Environment. - Track #368 caller separation: Steer/CancelSteer authorize via GetSession before touching the run registry / run-entry funnel (foreign = absence-equivalent), and register both in serviceAccessTable (ADR 0102 decision 2) — closes the cross-caller steer-injection gap the classification invariant surfaced. - gci-format model.go post-merge. Co-Authored-By: mecatl <[email protected]>
Summary
Final implementation phase of #462:
session.EnvironmentRefin session snapshots with legacy compatibilityserver.Config.EnvironmentResolverfor non-in-tree environment kindsinternal/adapter/remoteenvreference backend proving shared file/runner namespaces, cross-handle CAS, complete isolated forks, ref-addressed merge/conflict behavior, and restart reattachmentNo production remote transport, credentials, flags, proto changes, network calls, or external dependencies are introduced. The remote adapter is an in-process contract proof only.
Verification
task buildtask linttask testtask api:checktask docstask site:buildgo run ./cmd/mecademogit diff --checkCloses #462