Land real file source#23
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a concrete FileSource that reads a single on-disk text file (configurable path, encoding, optional format presets and format_keys), updates dispatcher.build_source to validate and construct FileSource with format/format_keys rules, and adds docs and tests covering the new source and config. ChangesFile Source Implementation & Integration
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 `@CHANGELOG.md`:
- Around line 8-23: The Unreleased changelog entry uses raw bullets but should
follow the project's Keep-a-Changelog subsection pattern; insert a "### Added"
header above the existing bullet list in the "## [Unreleased]" section so the
new `file` source details (options like `path`, `encoding`, supported `format` /
`format_keys`, and cursor behavior) appear under an "Added" subsection
consistent with released entries (see other version entries for style).
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b51c4a44-1145-4249-a18a-4f51f60cfab6
📒 Files selected for processing (1)
CHANGELOG.md
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary
filesource becomes a real implementation: reads a single text file from disk and yields its lines, with an optionalencodingknob (default"utf-8", undecodable bytes replaced withU+FFFD).path. Existence is checked at capture time (not config load) so log files that come and go under rotation don't block startup.format/format_keyswith the same conflict rules asflyctl. Pairs naturally with the regex format presets shipped in Wire regex format presets into sources #21.paperbark analyserather than the long-runningpaperbark monitorloop. Format-aware cursor mode added to the v0.2+ shortlist.Second item from the v0.2 shortlist in
docs/ROADMAP.md.Changes
src/paperbark/sources/file.py: realFileSource(was aNotImplementedErrorstub). Constructor:path,encoding,format_keys,line_format. Stateless acrosscapture()calls.src/paperbark/dispatcher.py:build_sourcefilebranch now validatespath(required) +encoding, threadsformat/format_keyswith the conflict check, attachesline_formatto the source instance.fileoption section added indocs/SOURCES.md; matching#### file optionsblock indocs/CONFIG.md; v0.2 roadmap shortlist updated;CHANGELOG.mdUnreleased entry.FileSourcetests (yield, protocol, validation, missing file, encoding, undecodable bytes), 7 new dispatcher tests (path required/empty/non-string, unknown option, encoding threading, format preset attachment, format/format_keys conflict, end-to-endcapture_iteration). Existing stub-test parametrise lists trimmed to dropfile.Test plan
uv run ruff check src/ tests/uv run ruff format --check src/ tests/uv run mypy src/ tests/uv run pytest -q(382 passed, +14 over previous PR)uv run --with pip-audit pip-audit(no vulnerabilities)uv run pre-commit run --files <touched>Need help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit
New Features
Documentation
Tests