Repository navigation
feat(cli): polylogue ingest truthful or rejects (#1264) - #1383
Conversation
Make 'polylogue ingest PATH' satisfy the three observable outcomes called for by #869 slice C: accepted+observable, rejected (input), or rejected (daemon). Eliminates the case where the daemon returns 202 and the CLI prints success without anything observable. Problem The previous ingest implementation staged the file into archive_root()/inbox, POSTed to /api/ingest, and printed 'Scheduled: ...' as long as ImportOperation.status was not literally 'failed' or 'error'. That meant: * an unrecognized daemon status was silently treated as success; * a daemon HTTP 4xx/5xx (HTTPError) was not caught and surfaced as a raw traceback rather than an actionable message; * the success output did not reveal the staged inbox path or point at 'polylogue status', so the user had no observable handle on the scheduled work. Solution * Catch HTTPError explicitly and report status code + staged path so operators know the file is on disk and which contract failed. * Catch URLError separately so 'connection refused' produces an actionable 'is polylogued running?' message naming the daemon URL. * Treat only an explicit accepted/pending/scheduled/queued status as success; any other status fails loudly instead of fabricating a green line. * Success output now lists the staged path, operation id, daemon URL, and the 'polylogue status' next-step pointer. Verification nix develop -c pytest tests/unit/cli/test_ingest.py -x → 8 passed in 9.22s
Regenerate cli-reference, test-quality-workflows, verification-catalog, and topology-status. These were drifted on master prior to this PR (unrelated content); refreshing so 'devtools verify --quick' passes.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 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 |
Summary
Make
polylogue ingest PATHsatisfy the three observable outcomes called for by #869 slice C (#1264): accepted+observable, rejected (input), or rejected (daemon). Eliminates the case where the daemon returns HTTP 202 and the CLI prints success without anything observable.Problem
The previous ingest implementation staged the file into
archive_root()/inbox, POSTed/api/ingest, and printedScheduled: ...as long asImportOperation.statuswas not literallyfailedorerror. That violated the issue's anti-trap "Do not trustpolylogue ingestjust because the daemon returns 202":mystery_status) was silently treated as success;HTTPError) escaped as a raw traceback rather than an actionable message;polylogue status, so the user had no observable handle on the scheduled work.Solution
polylogue/cli/commands/ingest.py:HTTPErrorexplicitly and report status code + staged path so operators know the file landed on disk and which contract failed.URLErrorseparately so "connection refused" produces an actionable "is polylogued running?" message that names the daemon URL and thepolyloguedbinary.accepted/pending/scheduled/queuedstatus as success; any other status fails loudly instead of fabricating a green line.polylogue statusnext-step pointer so the work is observable.tests/unit/cli/test_ingest.py: extended to cover the AC matrix — accept+observable, missing path, daemon-unreachable, daemon HTTP error, unrecognized status, daemon-reported failure.Inherited baseline cleanup per CLAUDE.md §19a: regenerated
docs/cli-reference.md,docs/test-quality-workflows.md,docs/verification-catalog.md,docs/topology-status.md(drifted on master) and addedtutorialtotest_all_subcommands_registeredplus the help snapshot (the #1263 / PR #1376 merge missed both regenerations and left master with two failing tests).No
polylogue runresurrection. No new daemon endpoints — the CLI consumes the existing/api/ingestcontract from #861/#1247.Verification
Ref #869
Closes #1264