Skip to content

test(daemon): cover demo import scheduling (#1843) - #1950

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

Sinity merged 1 commit into
masterfrom
feature/test/demo-daemon-convergence-1843

Conversation

@Sinity

@Sinity Sinity commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

Adds an integration harness for the live daemon scheduling boundary exercised by polylogue import --demo.

Problem

#1843 needs a demo path that proves the public command can drive real archive behavior. A full daemon convergence proof was attempted, but the live daemon currently materializes only 2 of the 3 generated demo sessions from the staged demo directory. Claiming end-to-end convergence would be false.

Solution

tests/integration/test_demo_daemon_convergence.py starts polylogued on a private port, invokes the real polylogue import --demo command, verifies daemon acceptance and operation output, and confirms the generated demo fixture is staged in the archive inbox. The test records the current spec mismatch at the top of the file so the remaining worker-handoff bug is explicit and durable.

Verification

  • devtools test tests/integration/test_demo_daemon_convergence.py -> 1 passed
  • devtools verify --quick -> exit_code 0

Ref #1843

Problem: #1843 still lacked a real daemon-backed check for the demo import scheduling path after the in-process archive convergence proof and README transcript slices landed.

What changed: add an integration harness that starts polylogued on a private port, invokes the real polylogue import --demo CLI entrypoint, verifies daemon /api/ingest acceptance, and asserts the generated demo fixture is staged in the archive inbox. The test records the current SPEC_MISMATCH: full daemon convergence currently reaches only 2 of the 3 demo sessions through filesystem watch events, so this slice stops at the accepted-operation boundary instead of claiming complete convergence.

Verification: timeout 90 devtools test tests/integration/test_demo_daemon_convergence.py; devtools verify --quick.
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 44 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1a36aa62-f4c9-481f-ad67-2a8d2bfb18d2

📥 Commits

Reviewing files that changed from the base of the PR and between ab060be and d47dd4a.

📒 Files selected for processing (1)
  • tests/integration/test_demo_daemon_convergence.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/test/demo-daemon-convergence-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 403c35d into master Jun 15, 2026
11 checks passed
@Sinity
Sinity deleted the feature/test/demo-daemon-convergence-1843 branch June 15, 2026 20:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d47dd4a698

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sinity added a commit that referenced this pull request Jun 15, 2026
## Summary

Fixes the live-daemon demo convergence gap by preserving the inbox
import suffix set for explicit archive inbox roots.

## Problem

The #1950 harness proved `polylogue import --demo` could schedule
through the live daemon, but full convergence stopped at 2 of 3 demo
sessions. The daemon was watching the explicit inbox root with the
default `WatchSource` suffix set of only `.jsonl`, so the staged ChatGPT
`demo-00.json` fixture was ignored while the two `.jsonl` demo fixtures
converged.

## Solution

`polylogue/sources/live/watcher.py` now exposes the inbox import suffix
tuple, and `polylogue/daemon/cli.py` uses it when an explicit root
resolves to the active archive inbox. The demo daemon integration test
is promoted to assert all 3 sessions, 19 messages, and searchable demo
content. A daemon CLI unit test pins the explicit-inbox suffix behavior.

## Verification

- `devtools test tests/integration/test_demo_daemon_convergence.py` -> 1
passed
- `devtools test tests/unit/daemon/test_daemon_cli.py -k
'explicit_archive_inbox_root or
polylogued_watch_builds_sources_from_roots'` -> 2 passed, 31 deselected
- `devtools verify --quick` -> exit_code 0

Closes the live daemon convergence gap in #1843.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Improved daemon file watching configuration to more efficiently handle
multiple file formats (.jsonl, .zip, .json, .ndjson)

* **Tests**
* Enhanced integration tests to verify complete end-to-end daemon
convergence and archive searchability
* Expanded unit test coverage for daemon configuration and source
handling

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 79.F029 / P2: fixed-already at the checked revision: The daemon subprocess at tests/integration/test_demo_daemon_convergence.py:226-235 now runs without --root, retaining its normal configured watch sources instead of constructing the JSONL-only generic override. The separate incremental-census gap remains explicitly marked on this test and is not the reviewed suffix mismatch.

Only the rows listed above are dispositioned. Held findings remain open.

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