Skip to content

test: cover list_sessions cwd privacy boundary#583

Draft
DeluxeRaph wants to merge 1 commit into
eric-tramel:mainfrom
DeluxeRaph:codex/issue-580-cwd-privacy-test
Draft

test: cover list_sessions cwd privacy boundary#583
DeluxeRaph wants to merge 1 commit into
eric-tramel:mainfrom
DeluxeRaph:codex/issue-580-cwd-privacy-test

Conversation

@DeluxeRaph

Copy link
Copy Markdown
Contributor

What changed

  • Adds a public AppState::list_sessions_v1 regression test that verifies list_sessions omits cwd-derived project metadata from both structured MCP output and rendered text.
  • Adds an ignored live ClickHouse regression that seeds canonical events rows with cwd = /work/acme-secret-merger, builds a real ClickHouseConversationRepository, then calls the public MCP handler.
  • Removes the previous weak repository DTO sentinel check that relied on extra mocked ClickHouse fields being ignored during deserialization.

Why

Fixes #580. The earlier coverage added originator, origin_cwd, and project to the mocked repository response, but those fields are not part of McpSessionListItem, so the test could pass before the public MCP response path was meaningfully exercised.

Validation

Passed locally:

cargo fmt --all -- --check
cargo test -p moraine-mcp-core list_sessions_v1 --locked
cargo test -p moraine-conversations list_mcp_sessions --locked

Results:

  • moraine-mcp-core list_sessions_v1: 12 passed, 1 ignored
  • moraine-conversations list_mcp_sessions: 4 passed

Not run successfully yet:

MORAINE_ALLOW_DESTRUCTIVE_TESTS=1 \
MORAINE_BENCH_CLICKHOUSE_URL=http://clickhouse:8123 \
cargo test -p moraine-mcp-core live_public_list_sessions_omits_cwd_derived_metadata_from_structured_and_text_output --locked -- --ignored --exact

I attempted to boot the Moraine sandbox after Docker was enabled, but the sandbox runtime image build hung during the npm install -g @anthropic-ai/claude-code && claude --version Dockerfile layer before a sandbox container was created. No sandbox containers were left running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(mcp): cover cwd privacy boundary in list_sessions

1 participant