Skip to content

fix(scenarios): keep demo fixture tool paths relative (#1843) - #1937

Merged
Sinity merged 1 commit into
masterfrom
feature/test/demo-fixture-parse-1843
Jun 15, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/test/demo-fixture-parse-1843

Conversation

@Sinity

@Sinity Sinity commented Jun 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Keeps the approved demo fixture world free of host-shaped absolute tool paths. The shared synthetic tool-heavy style now emits relative fixtures/generated-*.jsonl paths, and the demo corpus test now materializes and parses the generated demo files while rejecting /tmp path leakage.

Problem

#1843 explicitly requires approved demo fixtures to avoid private data and host-specific absolute paths. The newly-landed demo specs use the existing tool-heavy style for Claude Code and Codex agent-style sessions, but that style emitted /tmp/polylogue/generated-*.jsonl in Read tool inputs.

Solution

Change the synthetic tool-heavy Read path to fixtures/generated-*.jsonl. Extend test_build_demo_corpus_specs_materializes_with_synthetic_generator so it now proves the generated demo files:

  • materialize to ChatGPT, Claude Code, and Codex source files;
  • contain no /tmp/ or /tmp/polylogue raw text;
  • parse back through iter_source_sessions as chatgpt, claude-code, and codex sessions;
  • preserve non-empty provider session IDs/messages;
  • keep tool file_path values relative.

Verification

  • devtools test tests/unit/scenarios/test_corpus.py -> 19 passed
  • devtools verify --quick -> exit_code 0
  • push hook reran devtools verify --quick at 2026-06-15T20:10:13Z -> exit_code 0

Ref #1843

Summary by CodeRabbit

  • Bug Fixes
    • Fixed synthetic data generation to use consistent fixture files instead of temporary paths.
  • Tests
    • Enhanced validation of generated artifacts to ensure they don't contain system-specific temporary paths.

Problem: #1843 requires approved demo fixtures to avoid private data and host-specific absolute paths, but the shared tool-heavy synthetic style emitted /tmp/polylogue/generated-*.jsonl in Read tool inputs.\n\nWhat changed: make synthetic tool-heavy Read paths relative under fixtures/, and extend the demo corpus materialization test to parse the generated files, assert expected source families, and reject /tmp path leakage.\n\nVerification:\n- devtools test tests/unit/scenarios/test_corpus.py: 19 passed\n- devtools verify --quick: exit_code 0\n\nRef #1843
@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 40917355-b72d-4a03-891d-9381c1b28955

📥 Commits

Reviewing files that changed from the base of the PR and between e68993b and 7f598a9.

📒 Files selected for processing (2)
  • polylogue/schemas/synthetic/build_batch.py
  • tests/unit/scenarios/test_corpus.py

📝 Walkthrough

Walkthrough

_tool_use_blocks in build_batch.py is updated to reference a relative fixtures/ path instead of /tmp/polylogue/ for the "Read" tool's file_path. The demo-corpus materialization test gains assertions verifying that generated artifacts contain no absolute /tmp/ paths and that parsed sessions have valid structure.

Changes

Fix absolute /tmp path in synthetic tool-use blocks

Layer / File(s) Summary
Fix tool-use file path and validate no absolute paths
polylogue/schemas/synthetic/build_batch.py, tests/unit/scenarios/test_corpus.py
_tool_use_blocks changes the "Read" tool file_path from /tmp/polylogue/generated-{index:04d}.jsonl to fixtures/generated-{index:04d}.jsonl. The test imports Source, SyntheticCorpus, iter_source_sessions, and BlockType, then asserts raw artifact text contains no /tmp/ strings, that parsed sessions have correct provider names, provider_session_id, and non-empty messages, and that tool-use file_path values are not absolute paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 No more wandering in /tmp/ land,
A fixtures path now close at hand.
The rabbit hops through generated rows,
Checks no absolute path ever shows.
Clean sessions, valid blocks — hooray!
The corpus test has saved the day. 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(scenarios): keep demo fixture tool paths relative' clearly and concisely summarizes the main change in the PR—converting absolute tool paths to relative paths in demo fixtures.
Description check ✅ Passed The PR description follows the template with complete Summary, Problem, Solution, and Verification sections, providing clear context and validation details for the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/test/demo-fixture-parse-1843

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit 716c19c into master Jun 15, 2026
13 checks passed
@Sinity
Sinity deleted the feature/test/demo-fixture-parse-1843 branch June 15, 2026 20:15
Sinity added a commit that referenced this pull request Jun 16, 2026
## Summary
Complete #1843's README-ready demo transcript by adding the missing
`analyze` example alongside the existing demo import, status, stats,
search, and read commands.

## Problem
The #1843 acceptance criteria require the demo archive to support
search/read/analyze examples. The current README and `docs/generate.md`
transcript showed search and read after daemon convergence, but not an
analyze command. Closing the issue without this would leave a literal AC
gap.

## Solution
Add `polylogue find "pytest" then analyze --facets` to both the README
quick transcript and the detailed generate/demo page. Update the async
import caveat so it consistently says search/read/analyze examples
become meaningful after daemon convergence.

### AC matrix

| AC | Current state |
| --- | --- |
| A new user can run demo import from a clean checkout. | Satisfied by
`polylogue import --demo` in `polylogue/cli/commands/import_command.py`;
tested by `tests/unit/cli/test_import.py`; documented in `README.md` and
`docs/generate.md`. |
| Demo archive supports search/read/analyze examples. | Satisfied here:
README/docs now show `polylogue "pytest" list`, `polylogue find "pytest"
then read --view messages`, and `polylogue find "pytest" then analyze
--facets`. The archive-level `pytest` search/read evidence is pinned by
`tests/unit/scenarios/test_demo_archive_convergence.py`; analyze is the
registered aggregate verb over the matched result set. |
| Fixture world is committed and documented. | Satisfied by
`build_demo_corpus_specs()` and docs in `docs/generate.md`; prior PRs
#1934, #1935, #1936, #1937, #1940, #1943, #1950, #1953, and #1975
recorded the fixture, live daemon path, convergence proof, and overlay
evidence. |
| Tests validate demo output without relying on dev machine state. |
Satisfied by isolated archive/config roots in the demo import and
convergence tests; #1975 additionally proves deterministic user overlays
and private-path hygiene. |
| No private data / no host-specific absolute paths. | Satisfied by the
relative fixture-path tests and convergence assertions in
`tests/unit/scenarios/test_corpus.py` and
`tests/unit/scenarios/test_demo_archive_convergence.py`. |
| Known tags/notes/KV once #1883 lands. | Satisfied by #1975:
`seed_demo_user_overlays()` stores the `pytest-triage` tag, mark,
blackboard note, saved query, and typed tag/decision assertions in
`user.db` after convergence. |

### Explicit decisions

`polylogue import --demo` remains asynchronous daemon scheduling. It
does not synchronously seed user overlays because the target sessions
may not exist yet. Overlay seeding stays as deterministic
repository/release evidence after convergence, as documented by #1975.

## Verification
- `nix develop --command devtools verify-doc-commands` -> `99 doc files
scanned, no stale commands`.
- `nix develop --command devtools verify --quick` -> `exit_code 0`.
- Pre-push `devtools verify --quick` -> `exit_code 0`.

Closes #1843
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.

1 participant