reshape ensure seam + hardened lifecycle body (#376) #390
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman#390
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#388 (spec), #376. Spec AD-2, AD-6, AD-8, AD-9.
What to build
Wire the
ocruntime.Runtimeinto the host lifecycle and reshape the ensure seam so all callers get a reachable endpoint + opaque instance instead of a discovered port + tmux name. Registry persistence is a later ticket — this ticket may keep an in-memory map so it can land green.EnsureProjectOpencodeResultto{Endpoint (full URL), RepoRoot, Runtime (ocruntime.Instance), Launched}. tmux session becomesRuntime.IDobservability. Provide aPort()accessor for callers that still need the raw port.local.Hostholds an injectedocruntime.Runtime(default native) + asingleflight.Group.EnsureProjectOpencodebody: allocate free port →singleflight(repoRoot)→ check current instance +Probe→ healthy: return it, launch nothing → unhealthy/absent:Runtime.Launch(spec)→ wait-for-Probe(reuse existing portWait budget) → return endpoint + instance.HostCaps.OpencodeLaunchdistinct fromTmux; surface via/api/capabilities.ProjectOpencodeEnsurer, tmux-UI launch, remote host + stubs) to the reshaped result. They stay behaviorally green.Acceptance criteria
Endpoint+ opaqueInstance; managed path no longer depends onlsof.Probe), not listener presence.HostCaps.OpencodeLaunchis reported independently ofTmux.Blocked by