O3: task sources and result sinks #11

Merged
hermes merged 1 commits from o3-sources-sinks into main 2026-11-12 23:25:09 +00:00
Collaborator

Closes #4

Host-agnostic task sources and result sinks. The core knows no git host.

  • Source (list, claim, report) and Sink (publish) traits in src/adapter.rs, selected per profile via [source] / [sink].
  • Built-ins: source dir (*.md files; claim = atomic rename into .running/, report moves to .done/ or .failed/), sink local-branch (default).
  • cmd adapter for both: COMMAND OP, JSON on stdin, JSON on stdout, exit 0, 120 s timeout. Contract in docs/cmd-protocol.md, JSON schema in docs/cmd-protocol.schema.json. Task fields the core does not know are echoed back verbatim, so adapters stay stateless.
  • orch pull --profile NAME [--limit N]: list, claim, run, publish (only for done), report. Sequential until O4. Profile repo is the default for tasks without one.
  • Failure handling: a failing publish/report never fails or loses the run (error on stderr, published = "publish-failed: ..."); a broken list is a hard error; claim=false tasks are skipped.
  • examples/gitea_adapter.py: issues labeled orch are tasks; claim/report move labels (orch-running, orch-done, orch-failed) and comment; publish pushes the branch and opens a PR with Closes #N.

Verification: sh tests/all.sh exit 0 (fmt, clippy -D warnings, 5 unit tests, e2e, spike check). New e2e: dir source with one ok and one failing task, second pull is a no-op; cmd source+sink via tests/fake_adapter.py checking the exact call sequence (taken task skipped, failed task not published, adapter-private field echoed), broken publish output, broken list output, unknown kind. The Gitea example is only exercised for list against git.jokresner.de (works with credentials from git credential fill); claim/report/publish are not run against a live host.

Notes: Gitea ignores an unknown label filter and returns all issues, so create the orch* labels first (documented). Claim is not atomic across hosts; locking comes with O4 (ponytail comment in the example). orch run FILE still works and uses the same pipeline with the dir task format.

Closes #4 Host-agnostic task sources and result sinks. The core knows no git host. - `Source` (list, claim, report) and `Sink` (publish) traits in `src/adapter.rs`, selected per profile via `[source]` / `[sink]`. - Built-ins: source `dir` (`*.md` files; claim = atomic rename into `.running/`, report moves to `.done/` or `.failed/`), sink `local-branch` (default). - `cmd` adapter for both: `COMMAND OP`, JSON on stdin, JSON on stdout, exit 0, 120 s timeout. Contract in `docs/cmd-protocol.md`, JSON schema in `docs/cmd-protocol.schema.json`. Task fields the core does not know are echoed back verbatim, so adapters stay stateless. - `orch pull --profile NAME [--limit N]`: list, claim, run, publish (only for `done`), report. Sequential until O4. Profile `repo` is the default for tasks without one. - Failure handling: a failing publish/report never fails or loses the run (error on stderr, `published = "publish-failed: ..."`); a broken `list` is a hard error; claim=false tasks are skipped. - `examples/gitea_adapter.py`: issues labeled `orch` are tasks; claim/report move labels (`orch-running`, `orch-done`, `orch-failed`) and comment; publish pushes the branch and opens a PR with `Closes #N`. Verification: `sh tests/all.sh` exit 0 (fmt, clippy -D warnings, 5 unit tests, e2e, spike check). New e2e: `dir` source with one ok and one failing task, second pull is a no-op; `cmd` source+sink via `tests/fake_adapter.py` checking the exact call sequence (taken task skipped, failed task not published, adapter-private field echoed), broken publish output, broken list output, unknown kind. The Gitea example is only exercised for `list` against git.jokresner.de (works with credentials from `git credential fill`); claim/report/publish are not run against a live host. Notes: Gitea ignores an unknown label filter and returns all issues, so create the `orch*` labels first (documented). Claim is not atomic across hosts; locking comes with O4 (ponytail comment in the example). `orch run FILE` still works and uses the same pipeline with the `dir` task format.
hermes added 1 commit 2026-11-12 23:24:57 +00:00
hermes merged commit afafc41376 into main 2026-11-12 23:25:09 +00:00
hermes deleted branch o3-sources-sinks 2026-11-12 23:25:09 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/orch#11