Files
canina/infra/hermes-editorial/RUNNER.md
T
2026-10-24 16:26:50 +00:00

54 lines
5.2 KiB
Markdown

# One-task research runner
**Current policy:** [FUNCTIONAL_BRINGUP.md](FUNCTIONAL_BRINGUP.md) supersedes historical deadline guidance below. Complete functional orchestration before optimization. All 29 canonical worker/PMO configs are selected through tracked CI model policy, preserving credentials and gates. Close the temporary reviewer after Gate1, then start one supervised worker-credential research run; the reviewer's 600-second recovery/approval window must not enclose research execution.
Installed through `scripts/provision-editorial-runtime.py`'s exact runtime-package allowlist, not a live edit. This adds no activation, scheduler, approval or grant.
After parent deploy/approval verification, run **inside canina-hermes as its configured runtime identity**:
```
python3 -B /opt/data/editorial-v4/runtime-package/runner.py --task-id 565ace1f-8cfc-4447-b978-66c36e7b767b
```
Do not invoke until the original approval is valid and task READY. Runner cannot queue or approve; claim and result independently enforce backend Gate1. No automatic retry (including ambiguous ingestion failure). Inspect authenticated task status before any owner-directed recovery. Expired approvals/reservations are never changed locally.
Limits: one task, four sequential installed canonical profile invocations (market competitor-worker, coverage content-worker, SEO seo-worker, PMO synthesis), unlimited turns and no imposed per-profile or total research deadline, five-second heartbeat interval/HTTP timeout, 1MiB stdout and 256KiB stderr per child; report <=16KiB, final canonical brief <=24KiB. SIGTERM/heartbeat loss/error kills child process group. Profile-local writable cache is cwd/TMPDIR; no root workspace or terminal sandbox. Web toolset is only web_search/web_extract. Model tools cannot access service credential. No filesystem, terminal, browser, image, article, publication, QA, release or production tools.
Hermes CLI installed help/source inspected: `--query-file - --oneshot --format stream-json --toolsets web --model Canina-content --max-turns 0 --run-budget 0`. Parse exactly one successful terminal `result` JSONL envelope; reject unknown tool events, duplicate/error result and invalid JSON. Extract one URL per call with char_limit=2000 to keep CLI's 5000-character tool-output cap parseable. Require worker retrieval events, successful nonempty extraction content, and final source URLs in those worker retrievals. This is transport provenance, not factuality/QA certification. Source/date/scoring truth remains independent QA's job.
Result submits only task/run/lease/brief, expects VERIFYING/PENDING_INDEPENDENT_QA and retained unknown reservation20. It never claims zero spend or a passed QA. No durable local lease token/log is emitted. CLI failures suppress private provider/backend details.
Tests use disposable localhost HTTP and real subprocesses inside disposable network-isolated Python containers. Explicit test-only synthetic CLI events/content prove protocol, cancellation and fencing, **not live research or application QA**. Live model/research acceptance intentionally not run; parent owns promotion and original-approval check.
## Identity failure diagnosed on 2026-10-24
The existing installed package/credential/runner lock were UID0; competitor cache
was UID0 mode0700 while canonical profile belonged to hermes UID10000. The actual
`/opt/hermes/bin/hermes` wrapper drops UID0 to hermes. A read-only UID10000 access
probe returned false for that cache. This is a concrete pre-model process boundary
failure, not evidence of a claim-response mismatch. Deployed compiled claim returns
`{lease:{taskId,runId,attempt,leaseToken,leaseUntil,commitSha,environment,maxCostCents,pilotKind}}`;
heartbeat accepts exactly taskId/runId/leaseToken and returns `{leaseUntil}`. These
match the runner. No failure/report endpoint exists in worker transport; `complete`
is NOT a failure protocol (it attests QA and reconciles cost), and must not be used.
Installer now explicitly uses `docker exec --user hermes` for installation and skill
discovery; existing root-owned state fails closed. Do not run a root runner or set
HERMES_DOCKER_EXEC_AS_ROOT to bypass the privilege boundary. Preflight ownership
checks occur before credential access and claim. Failure JSON contains only local
stage/error-code constants and explicitly requires reading backend status, never
claims task completion or zero spend.
Current task 565ace1f-8cfc-4447-b978-66c36e7b767b remains RUNNING v6, artifact null
(read-only authenticated status). It was not reclaimed, retried, renewed or altered.
Lease expiry alone does not transition state; its unknown 20-cent reservation stays.
Recovery requires owner review: retain reservation and audit failed run; authorize
an explicit backend fenced failure/cancel protocol before changing task state (none
exists currently), and a separately reviewed CI-only ownership migration for the
exact installed package/credential/runner-created cache paths. Do NOT recursively
chown profiles, invent actualCents=0, clear DB rows, or invoke runner to recover.
After that migration, install via reviewed CI under hermes; a new execution still
requires explicit parent/owner authorization and a backend-ready task. This patch
is not installed, deployed, activated or live-model accepted.