Summary
GlobalSyncStrategy.makeConfigContext was updated in #339 to thread priorValues through, but no integration test runs the full prompt-reuse flow in global scope (mcs sync --global). Strategy symmetry with ProjectSyncStrategy gives high confidence the behavior is correct, but explicit coverage is worth having.
Why this matters
Two things interact that are both tested individually but not in combination:
- Global scope reads/writes
~/.claude/.mcs-global via ProjectState(stateFile:) — different path, same model.
- Global scope filters out
fileDetect prompts in ExternalPackAdapter.declaredPrompts via context.isGlobalScope.
The partition logic already excludes fileDetect from answerable types, so the two filters compose correctly — but a regression in either filter could silently corrupt reuse in global scope without any test failing.
Proposed fix
Add one case to PromptValueReuseLifecycleTests (Tests/MCSTests/LifecycleIntegrationTests.swift) using LifecycleTestBed.makeGlobalSyncConfigurator() (already exists in TestHelpers.swift):
- Seed
~/.claude/.mcs-global's resolvedValues with a few input prompts.
- Run sync with a
MockPromptTechPack in global scope.
- Verify the stored values are reused (not overwritten by the mock's
defaultAnswer).
Bonus: assert that a fileDetect prompt declared by the same pack is correctly filtered out in global scope (not asked, not partitioned).
Scope
Tests/MCSTests/LifecycleIntegrationTests.swift — one new test, ~30 lines mirroring the existing project-scope cases
Related
Summary
GlobalSyncStrategy.makeConfigContextwas updated in #339 to threadpriorValuesthrough, but no integration test runs the full prompt-reuse flow in global scope (mcs sync --global). Strategy symmetry withProjectSyncStrategygives high confidence the behavior is correct, but explicit coverage is worth having.Why this matters
Two things interact that are both tested individually but not in combination:
~/.claude/.mcs-globalviaProjectState(stateFile:)— different path, same model.fileDetectprompts inExternalPackAdapter.declaredPromptsviacontext.isGlobalScope.The partition logic already excludes
fileDetectfrom answerable types, so the two filters compose correctly — but a regression in either filter could silently corrupt reuse in global scope without any test failing.Proposed fix
Add one case to
PromptValueReuseLifecycleTests(Tests/MCSTests/LifecycleIntegrationTests.swift) usingLifecycleTestBed.makeGlobalSyncConfigurator()(already exists inTestHelpers.swift):~/.claude/.mcs-global'sresolvedValueswith a few input prompts.MockPromptTechPackin global scope.defaultAnswer).Bonus: assert that a
fileDetectprompt declared by the same pack is correctly filtered out in global scope (not asked, not partitioned).Scope
Tests/MCSTests/LifecycleIntegrationTests.swift— one new test, ~30 lines mirroring the existing project-scope casesRelated