Repository navigation
fix(watcher): accept .zip, .json, .ndjson in inbox watch source - #1692
Conversation
Closes #1683 Problem: POST /api/ingest returns 202 for any staged file, but the live watcher's inbox WatchSource defaulted to suffixes=(".jsonl",). A .zip (GDPR export from ChatGPT/Claude) or .json dropped in inbox was silently ignored forever — the operator saw "202 accepted" but the file was never observed. The pipeline already handles .zip/.json/.ndjson (source_walk.py _SUPPORTED_EXTENSIONS includes all four). The gap was only in the watcher's suffix filter. Fix: inbox WatchSource now accepts .jsonl, .zip, .json, .ndjson. Verification: nix develop -c pytest tests/unit/sources/test_live_watcher.py -k "suffix or inbox" -q -> 3 passed nix develop -c devtools verify --quick -> exit_code: 0 Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughThis PR extends the inbox watch source to accept additional archive and data formats ( ChangesInbox format acceptance for live watcher
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/plans/file-size-budgets.yaml`:
- Line 79: The YAML entry for the exception "reason" contains an issue reference
"(`#1683`)"; update the reason value used in the reason: field to remove any
issue/PR references and leave a plain descriptive message (e.g., keep
"kitchen-sink live-ingest test file (cursor, watcher, batch, debounce,
bootstrap) + inbox suffix coverage; split candidate: per-subject suites under
tests/unit/sources/live/") so the reason string contains no "(#...)" markers and
remains policy-compliant.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 33e4af2d-ea46-4d73-abca-eab4d32219b1
📒 Files selected for processing (3)
docs/plans/file-size-budgets.yamlpolylogue/sources/live/watcher.pytests/unit/sources/test_live_watcher.py
| ceiling: 1600 | ||
| reason: "kitchen-sink live-ingest test file (cursor, watcher, batch, debounce, bootstrap); split candidate: per-subject suites under tests/unit/sources/live/" | ||
| ceiling: 1620 | ||
| reason: "kitchen-sink live-ingest test file (cursor, watcher, batch, debounce, bootstrap) + inbox suffix coverage (#1683); split candidate: per-subject suites under tests/unit/sources/live/" |
There was a problem hiding this comment.
Keep exception reason free of issue references.
This reason now includes (#1683), which conflicts with this file’s policy that exception reasons should not point at closed issues.
Suggested edit
- reason: "kitchen-sink live-ingest test file (cursor, watcher, batch, debounce, bootstrap) + inbox suffix coverage (`#1683`); split candidate: per-subject suites under tests/unit/sources/live/"
+ reason: "kitchen-sink live-ingest test file (cursor, watcher, batch, debounce, bootstrap) + inbox suffix coverage; split candidate: per-subject suites under tests/unit/sources/live/"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| reason: "kitchen-sink live-ingest test file (cursor, watcher, batch, debounce, bootstrap) + inbox suffix coverage (#1683); split candidate: per-subject suites under tests/unit/sources/live/" | |
| reason: "kitchen-sink live-ingest test file (cursor, watcher, batch, debounce, bootstrap) + inbox suffix coverage; split candidate: per-subject suites under tests/unit/sources/live/" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/plans/file-size-budgets.yaml` at line 79, The YAML entry for the
exception "reason" contains an issue reference "(`#1683`)"; update the reason
value used in the reason: field to remove any issue/PR references and leave a
plain descriptive message (e.g., keep "kitchen-sink live-ingest test file
(cursor, watcher, batch, debounce, bootstrap) + inbox suffix coverage; split
candidate: per-subject suites under tests/unit/sources/live/") so the reason
string contains no "(#...)" markers and remains policy-compliant.
Summary
Fix the inbox WatchSource to accept
.zip,.json, and.ndjsonin addition to.jsonl. Without this, GDPR exports dropped in inbox are silently ignored despitePOST /api/ingestreturning 202.Problem
POST /api/ingest(andpolylogue ingestCLI) returns HTTP 202 for any staged file, but the live watcher's inboxWatchSourcedefaulted tosuffixes=(".jsonl",). A.zipdropped ininbox/was silently ignored forever — the operator sees "202 accepted" but the file is never observed. GDPR exports from ChatGPT and claude.ai are typically.ziparchives.The pipeline already handles
.zip/.json/.ndjson—source_walk.pydeclares all four as_SUPPORTED_EXTENSIONS, andsource_parsing.py/source_acquisition.pyhavezipfilehandling. The gap was only in the watcher's suffix filter.Solution
polylogue/sources/live/watcher.py: inboxWatchSourcenow usessuffixes=(".jsonl", ".zip", ".json", ".ndjson").Verification
nix develop -c pytest tests/unit/sources/test_live_watcher.py -k "suffix or inbox" -q→ 3 passednix develop -c devtools verify --quick→ exit_code 0Closes #1683
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
.zip,.json,.jsonl, and.ndjson.Tests