Repository navigation
Closed
Labels
effort/mMedium: expected under 1 day of workMedium: expected under 1 day of workkind/featureNew feature or capability requestNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)Ordinary priority (the default)source/humanFiled directly by a humanFiled directly by a human
Description
Slice 1 of decision record 0004 (pkgs/mcpx/docs/decisions/0004-scope-resolved-roots.md, PR #957). Design source: dezren39/darwin-nix#817 — this issue carries its acceptance criteria.
What to build (spec §1, §2, §3, §6)
internal/config: addResolvedScope{Key, Root, Degraded}andScope.Resolve(ctx);Scope.KeybecomesResolve(ctx).Key— one resolution path. Root semantics per spec §1 (worktree → checkout top-level; repo → parent of the common dir only when its base is.git, else no root; cwd → canonical caller cwd; degraded repo/worktree → that cwd; global/session/psession/pid/call → no root).- Plumbing:
Registry.keyForswitches toResolveand passes the ResolvedScope intoPool.Acquire; the pool stores the root on the Instance at creation andstartLane/dial()read it from the instance (never re-resolved at redial — root is a pure function of the key). - Spawn cwd (stdio only): config
cwdwhen non-empty, else the resolved root when non-empty, else unset (daemon cwd, today's behavior). - Observability: one spawn log line (server, key, root, cwd source: config/scope/daemon);
mcpx statusinstance JSON gainsroot.
Acceptance criteria (from nix#817, verbatim intent)
- A
worktree-scoped server with no configcwdspawns with its working directory set to the caller's checkout top-level; arepo-scoped one to the resolved worktree of the common dir. - Two callers in different checkouts of the same repo get distinct
worktree-scoped instances rooted in their own checkouts;reposcope keeps sharing one instance per common dir. - An explicit config
cwdoverrides the scope root in all cases. -
global/cwd:/sessionand other scopes are unchanged. - Tests cover the spawn-cwd decision (scope root vs explicit cwd vs daemon fallback) as a pure function, plus degraded-root cases.
(The gopls live-proof criterion from nix#817 belongs to slice 4, which has the full stack.)
Metadata
Metadata
Assignees
Labels
effort/mMedium: expected under 1 day of workMedium: expected under 1 day of workkind/featureNew feature or capability requestNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)Ordinary priority (the default)source/humanFiled directly by a humanFiled directly by a human
Activity
dezren39 commentedon Oct 26, 2026
Intake review
Still live (verified this run): no
ResolvedScopeexists inpkgs/mcpxon main (local clone at a2eef6f, decisions dir holds 0001–0003 only), and no merged PR mentions ResolvedScope / scope-resolved roots. The design source itself — decision record 0004, PR #957 — is still OPEN, and its branch (commit 43f3e32) is where0004-scope-resolved-roots.mdcurrently lives. This slice is implementable from that branch, but the record is not on main yet.Related: PR #957 (design source, open) · #960 (slice 2, depends on this) · #959 (slice 3, depends on this) · #961 (slice 4, depends on this + #959) · design origins dezren39/darwin-nix#817, dezren39/darwin-nix#818, dezren39/darwin-nix#819.
Notes / risks: This is the foundation slice — slices 2–4 all key off
ResolvedScopeand the instance-stored root. The degraded-root and common-dir-base semantics in spec §1 are the easy place to get subtle divergence; the acceptance criteria already pin them as pure-function tests, which is the right shape. Root must be fixed at instance creation and never re-resolved at redial (the body says this explicitly — worth a test asserting it).Suggested approach: Land/review PR #957 first (or branch from it), implement
Scope.Resolve+ plumbing with table-driven tests for the §1 root semantics, then the spawn-cwd decision as a pure function, then the status/log surface.— Fleet monitor intake enrichment (acceptance criteria were already in the body; labels normalized,
meta/enrichedadded).dezren39 commentedon Nov 1, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 1, 2026
🤖 Agent note · done
Triage verdict: CONFIRMED at current main — fix enqueued (task 4872)
Verified on the laptop clone at
origin/mainb56ccda (fetched this run):grep -rn ResolvedScope pkgs/mcpx --include='*.go'→ zero hits. The type andScope.Resolvedo not exist; only the decision docpkgs/mcpx/docs/decisions/0004-scope-resolved-roots.mdis present (PR docs(mcpx): decision 0004 — scope-resolved roots #957 merged).pkgs/mcpx/internal/config/scope.go:70still has the old signature:func (s Scope) Key(ctx CallContext) (key string, degraded string)— no root is ever returned.pkgs/mcpx/internal/daemon/registry.go:1396-1398:keyForreturns only that key string intoPoolcall sites.pkgs/mcpx/internal/pool/pool.go:893,903:dial()buildsStdioOptions{Cwd: p.cfg.Cwd}verbatim;internal/mcpclient/stdio.go:110setscmd.Dir = opts.Cwd. Spawn cwd is the static config cwd or the daemon's — never the resolved scope root.rootfield exists in instance status output (grep overpkgs/mcpx/internal).Overlap disposition (#1989): #1989's criteria 1–4 are the spawn-cwd subset of this slice. The task-4872 packet names this explicitly: when the #958 fix lands, #1989 should close as covered (its gopls live-proof criterion belongs to slice 4 / #961). No second fix packet was created for #1989's subset.
Routing: small_fix packet enqueued as queue task 4872 with the issue's spec §§1/2/3/6 pinned (ResolvedScope + Resolve, keyFor→Pool.Acquire plumbing, root stored on Instance at creation, spawn-cwd decision config > scope root > daemon, spawn log line +
rootin status JSON, pure-function spawn-cwd tests + degraded cases). Slices #959/#960 remainstatus/blockedon this slice, correctly.141 remaining items
dezren39 commentedon Nov 2, 2026
🤖 Agent note · parked
ses_e5e65715bb9ffe5jt621Vx4dkQ; queue task 4872awaiting_ci.bdb04b5a670c4e1591d7759e41b3cf72d6bf93c7; docs build, docs-history, lint, plugin tests, and PR-changed-test stress are still queued after the active poll. No failures. Fresh GraphQL shows all 3 review threads resolved; latest Codex review summary has no findings./home/user/git/fleet/4872-958-resolved-scope; branchqueue/4872-958-resolved-scope(not accessed this run).dezren39 commentedon Nov 2, 2026
agent-note:v1
task: 4872
state: parked
reason: PR #3925 rechecked fresh 2026-11-02T05:06Z — head bdb04b5 unchanged, Codex clean with all review threads resolved per prior checkpoint, but docs build, docs-history, lint, plugin tests and stress checks are all still QUEUED (runner queue delay, no failures).
resume: merge PR #3925 when checks go green, then complete task 4872 fixed_merged.
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
Merge pull request #3925 from developing-today/queue/4872-958-resolve…
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done