Repository navigation
test(session): keep tests out of the home session store - #116
Merged
Merged
Conversation
Settle ADR-004's self-contradiction in favour of its algorithm and the code: .dmon/config.yaml marks a project root. Replace the session-storage discovery requirement, and isolate the two tests measured writing into ~/.dmon/sessions (LiveToolCallE2ETest and CoreProcessFixture's IntegrationSmokeTest), each with a regression assertion. Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
Add paired SessionDirectoryResolver tests: a .dmon/ holding only config.local.yaml resolves to the global store, and adding config.yaml makes the same tree resolve locally. A precondition guard stops the negative case passing vacuously under a real .dmon/config.yaml. Add an ADR-004 amendment note resolving its prose/algorithm contradiction in favour of its own discovery step 1. No decision change. Tasks: 1.1, 1.2 Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
The ADR-004 note claimed the code implements all of discovery step 1, but sessionStore is read from the working directory's layered config, not the discovered root's, so a root's setting is ignored from a subdirectory. Per the Product Owner, state only what is true and decided: narrow the note to the marker, limit the spec's redirect and project-local scenarios to what holds, leave the subdirectory case explicitly unspecified, and tighten the bootstrap scenario to match BootstrapService. Correct the design's claim that the test marker is inert. Register three new notes (subdirectory sessionStore, $HOME as a root, untested BootstrapService) and mark the Terminal hang intermittent. Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
CoreProcessFixture launched its core in a temp directory with no .dmon/config.yaml, so session discovery fell back to the developer's real ~/.dmon/sessions and IntegrationSmokeTest left an empty session there on every make test. Write a sessionStore: local marker (explicit, so a global sessionStore: global cannot win) and assert the created session lands under the fixture's root. Tasks: 2.1 Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
LiveToolCallE2ETest pinned its provider in config.local.yaml, which does not mark a project root, so every run wrote a session into the developer's real ~/.dmon/sessions. Add a sessionStore: local config.yaml marker, assert the session persisted under the temp content root before cleanup, and tag the class Category=Live so plain make test no longer makes a paid API call; make test-live runs it. Tasks: 2.2 Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
CoreProcessManagerRestartTests wrote a .dmon/config.yaml with providers but no sessionStore, so a developer whose global config says sessionStore: global had its session.create land in their real home store. Add an explicit sessionStore: local. Found by the section-2 supervisor; the earlier measurement could not see it because the measuring machine's global config sets no sessionStore. Tasks: 2.3 Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
D8 excluded LegacyExtensionsListIgnoredIntegrationTest because it is already a project root, the reasoning D9 disproved; it is out of scope because it never creates a session. Point the measurement risk at D9. Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
Fold the precedence clause into the redirect scenario and record which test covers each scenario, including the ones only unit-tested or untested. Tasks: 3.1 Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XE8kvUxRFyFRL54gWWkBED
3.2: two full passes (real stores, then a canary sessionStore) with every assembly complete. Neither the home nor the repo session store gained a directory, and the canary was never created. The Terminal hang is named and forced: the three InitCommandTests block in InitFeedFixture on stdout EOF while a reusable MSBuild node spawned by pack-core.sh holds the pipe. MSBUILDDISABLENODEREUSE=1 makes them pass in 7 s; the control hangs. Registered, not fixed here. 3.3: live-e2e writer note resolved (three writers); new notes for the MekoLiveSmokeTests silent pass and the repo's unpinned config.yaml; path-form correction and nested wizard roots; the Terminal hang cause. Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CJu5CxqY5B6o3GfMVAfsu
B1: the hang notes now name ComposedCoreFeedFixture, the Core twin of InitFeedFixture, in the fix list and as the leading Core-hang suspect; the intermittency explanation is labelled inferred and the "whenever no nodes" claim is dropped; only one Core run counts as a fair non-reproduction. B2: the repo-marker note explains why a root pin is not read from a subdirectory working directory and leads with a test-side guard. R1/R2: the canary premise (no global sessionStore) and the scope of the pinning rule (tests that create a session) are stated. Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CJu5CxqY5B6o3GfMVAfsu
Adds CompositionRootTests.RunDotnetAsync to the hang note's fix list, per the supervisor's re-review. Every section is now closed. Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CJu5CxqY5B6o3GfMVAfsu
The proposal said CoreProcessFixture was the only other writer and that bootstrap creates an empty sessions/. Section 2 found a third writer (CoreProcessManagerRestartTests, design D9) and section 1 corrected the bootstrap text. Also records the deliberately unspecified subdirectory case and lists the restart test under Impact. Change: session-root-resolution Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CJu5CxqY5B6o3GfMVAfsu
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
Stops the test suite writing sessions into the developer's real
~/.dmon/sessions, and settles what marks a dmon project root..dmon/config.yaml, the ruleSessionDirectoryResolveralready implements. The alternative, a bare.dmon/directory, was rejected:ActiveModelStorewritesconfig.local.yamlon a model switch, which would quietly relocate sessions.session-storagediscovery requirement is replaced. It uses.dmonnaming instead of the stale.daemon, the config-file marker, and the bootstrap the code actually performs (~/.dmon/, not CWD). It states only what is true and decided. A root'ssessionStoreis ignored from a subdirectory; that case is deliberately unspecified and parked intech-debt/session-store-setting-ignored-from-subdirectory.md. ADR-004 gets an amendment note only.config.yamlmarker now explicitly pinssessionStore: local:LiveToolCallE2ETest: a session on every live run. It now asserts the session lands in its temp root, and it is taggedCategory=Live, so plainmake testno longer makes a paid call.CoreProcessFixture/IntegrationSmokeTest: the empty "twin" session on everymake test. It now asserts the session lands in the fixture's root (this runs in CI).CoreProcessManagerRestartTests: writes to~only when the global config setssessionStore: globalor a path, so a store diff couldn't see it (design D9).SessionDirectoryResolverTests: a.dmon/holding onlyconfig.local.yamlis not a root (mutation-checked).No production code changes. No user sessions move.
Verification
Whole-suite check (task 3.2): no dmon host process and nothing on port 8666. Both session stores were counted with
find -type d, before and after.LiveToolCallE2ETestPassed (not Skipped) with a real Gemini callsessionStore=<scratch>/canary-storeThe canary proves the point only because
~/.dmon/config.yamlsets nosessionStore; I confirmed that (the environment is the lowest configuration layer).openspec validate session-root-resolution --strictpasses. All three sections were approved by the section supervisor.Found along the way (registered, not fixed here)
tech-debt/terminal-tests-hang.md, cause verified: the threeInitCommandTestshang becauseInitFeedFixtureawaitspack-core.shstdout EOF with no timeout, while a reusable MSBuild node spawned bydotnet packholds the pipe open until it idles out (~15 min). WithMSBUILDDISABLENODEREUSE=1they pass in 7 s; the control hangs. Core'sComposedCoreFeedFixtureis a line-for-line twin and the leading suspect for the intermittent Core hang. Workaround until fixed: exportMSBUILDDISABLENODEREUSE=1for suite runs.meko-live-smoke-passes-without-key.md(make test-livereports Passed having tested nothing) andrepo-dmon-config-unpinned.md(a latent hazard, tied to the subdirectory question).After merge
tech-debt/live-e2e-test-writes-into-home-session-store.md's status line with the merge commit./opsx:archive session-root-resolution.~/.dmon/sessionsis left to the owner.Change:
session-root-resolution🤖 Generated with Claude Code
https://claude.ai/code/session_015CJu5CxqY5B6o3GfMVAfsu