seam: add polaris worker CLI subcommand (cli/worker.py) #52
Labels
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
patrick/Polaris#52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
infra/compose/docker-compose.yml(PH0.1) already wires theworkerservice to runcommand: ["polaris", "worker"], andbackend/Dockerfile(PH0.2)'s own header comment says the same image "also runs the worker (polaris worker, PH0.3)". Butbackend/src/polaris/cli/**is owned/sealed to PH0.2's branch, and PH0.3 (#6, worker skeleton)'s brief explicitly says not to touch anything underbackend/src/polaris/{core,api,db,cli}. So right now there is nocli/worker.py, andpolaris workeris not a valid subcommand —docker compose upwould fail to start theworkerservice, even though #6 ships a working worker process atpolaris.worker.main:main()(also runnable directly aspython -m polaris.worker).What's needed
One small new file, following the exact shape of the existing
cli/api.py:This is a new file under a discovery seam (
polaris/cli/<command>.py, auto-discovered bypolaris.cli'spkgutil.iter_moduleswalk per docs/12-implementation-plan.md) — it doesn't edit any existing file, so it shouldn't conflict with anything else in flight. It is not in the "Sealed after PH1" list indocs/12-implementation-plan.md(onlyapi/main.pyis named there for theapi/clifamily).Blocks
#6 (PH0.3 worker skeleton) for its first acceptance criterion ("Worker starts against the compose stack and logs a heartbeat on schedule") to be true end-to-end against the real compose stack. #6's own unit tests and the rest of its acceptance criteria do not depend on this — they exercise
polaris.worker.main.main()/run_claim_loop/discovery directly.Flagged per
CLAUDE.md: "If a ticket turns out to need a change outside its scope, open a seam request issue that blocks it, instead of widening the ticket."Fix drafted on
feature/cli-worker-command(local, not pushed yet):backend/src/polaris/cli/worker.pyexactly as specified above, plusworkeradded totest_known_commands_are_discovered. Holding off on pushing/opening the PR:mypy --strictcorrectly fails right now becausepolaris.workerdoes not exist onmainyet (PR #53 is still open, not merged) — the lazyfrom polaris.worker.main import maininsiderun()cannot be typechecked against a module that is not there. I will rebase this branch and open the PR once #53 merges, then verify AC1 end-to-end against the real compose stack.