Add real stdin source#27
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request implements a real stdin source that replaces the previous stub implementation. The StdinSource class now reads lines from sys.stdin with test injection support, validates configuration options (format and format_keys) through the dispatcher, and includes comprehensive documentation and test coverage for the feature. ChangesReal stdin Source Implementation
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 |
Release Previewpatch: ChangelogAdded
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/CONFIG.md`:
- Around line 292-294: Add a shell language tag to the stdin usage code fence
that currently contains "cat my.log | paperbark analyse --run latest" so the
fenced block is marked as shell/sh; locate the fenced block with that exact
command in CONFIG.md and change the opening triple backticks to include the
language identifier (e.g., ```sh) to satisfy markdown linting.
In `@docs/ROADMAP.md`:
- Line 8: Update the "**Last verified:**" entry in docs/ROADMAP.md from
2026-05-10 to 2026-05-09 so the recorded verification date is not in the future;
locate the bold "Last verified:" text and replace the date accordingly.
In `@docs/SOURCES.md`:
- Around line 159-161: The Markdown fenced code block containing the pipeline
command "cat app.log | paperbark monitor --iterations 1" is missing a language
tag; update that fence to include a shell language identifier (e.g., change the
opening "```" to "```sh") so the block becomes a shell snippet and satisfies
markdownlint MD040.
In `@README.md`:
- Around line 69-70: Update the README Quickstart section to include a short
non-Fly example using the newly-implemented stdin (or file) source so the docs
match the source table change; locate the "Quickstart" heading in README.md and
add one concise snippet demonstrating how to run the project with stdin (or a
file) as the data source (showing the minimal install/run commands and the
stdin/file invocation), and keep it parallel to the existing Fly quickstart
wording so both Fly and a non-Fly path are present.
🪄 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: 1574135b-a4fb-47fe-b88f-a73f5f2443eb
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (9)
CHANGELOG.mdREADME.mddocs/CONFIG.mddocs/ROADMAP.mddocs/SOURCES.mdsrc/paperbark/dispatcher.pysrc/paperbark/sources/stdin.pytests/test_dispatcher.pytests/test_sources.py
| ## Current state | ||
|
|
||
| - **Last verified:** 2026-05-05 | ||
| - **Last verified:** 2026-05-10 |
There was a problem hiding this comment.
Last verified is set to a future date.
Line 8 says 2026-05-10, but today is 2026-05-09. Please set it to 2026-05-09 now, or only update to 2026-05-10 after that date is actually verified.
🤖 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/ROADMAP.md` at line 8, Update the "**Last verified:**" entry in
docs/ROADMAP.md from 2026-05-10 to 2026-05-09 so the recorded verification date
is not in the future; locate the bold "Last verified:" text and replace the date
accordingly.
|
Pushed
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/CONFIG.md`:
- Around line 292-294: The example pipes stdin into the wrong CLI command:
`paperbark analyse` does not consume source input, so replace the piped command
usage with the capture flow using `paperbark monitor` (e.g., change `cat my.log
| paperbark analyse --run latest` to use `cat my.log | paperbark monitor
--iterations 1`) so stdin is actually captured; update the example in CONFIG.md
to reference `paperbark monitor` and the `--iterations` flag accordingly.
In `@docs/SOURCES.md`:
- Around line 155-157: Update the documentation text that currently states
"Reads lines from `sys.stdin` and yields them" to limit stdin usage to the
capture step: clarify that `sys.stdin` input is consumed only by `paperbark
monitor` (or the monitor capture mode) for one-shot piping of pre-captured logs,
and that `analyse` and `search` operate on existing run artifacts rather than
reading from `sys.stdin`; keep references to `paperbark monitor`, `analyse`,
`search`, and `sys.stdin` so readers can locate the relevant sentences to edit.
🪄 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: 12900ad1-1838-4238-a0f7-9b35173e4b5b
📒 Files selected for processing (3)
README.mddocs/CONFIG.mddocs/SOURCES.md
|
Pushed
|
Summary
stdinsource stub with a real implementation that yields lines fromsys.stdin(or an injected test stream). Supportsformat/format_keyswith the same JSON-only conflict rule asflyctlandfile. Intended for piping pre-captured logs into a one-shotpaperbark monitor/analyse/searchrun.encodingknob in v0.2 — use thefilesource if byte-level robustness is needed.wrangler/kubectl/cloudwatchstill pending).Drive-by
Plain filesrow was still labelled "stub (interface only, post-v1)" despite landing in v0.1.4 — fixed in the same source table.docs/ROADMAP.md"Last verified" bumped to today.uv.lockhadpaperbark 0.1.3pinned despite three subsequent releases;uv syncreconciled it. The auto-release workflow doesn't refreshuv.lockwhen bumpingpyproject.toml— worth a follow-up to fix at source rather than carrying the drift.CHANGELOG.mdcarries anAddedentry under[Unreleased]so the changelog-check gate is satisfied; this is a patch bump.Test plan
uv run pytest -q— 419 passed (was 407, +12).uv run ruff check .anduv run ruff format --check .— clean.uv run mypy src/paperbark tests— clean.printf '<JSON line with leading TS>\n' | paperbark monitor --iterations 1writes a canonical run dir, captures the line, rendersanalysis.mdwith the severity rollup, exits 0.format = "apache-combined"and Apache combined log lines: both lines captured via the format-aware cursor; HTTP status probe correctly identified the 200 / 500.Need help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit
New Features
Documentation
Tests