Reconcile FAAS authority and Hermes governed-worker contract#9
Reconcile FAAS authority and Hermes governed-worker contract#9erikhinla wants to merge 11 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request refactors the documentation and configuration files to establish a clear architectural boundary between the FLOW Agent Architected Schemas (FAAS) control plane and the planned standalone Hermes execution worker. It introduces a formal worker contract, runtime rules, and an audit amendment to correct prior deployment claims. The review feedback highlights three key areas for improvement: clarifying the construction of isolated workspace paths relative to base memory paths, resolving a validation mismatch where the existing EnvelopeValidationService does not yet support the newly introduced low and medium risk tiers, and specifying the exact API response or adapter behavior when a replay request is received for an actively claimed task.
| - A completed task returns its recorded artifacts on replay. | ||
| - A failed task is retried only under FAAS policy and with an incremented | ||
| attempt number. | ||
| - Each Hermes task uses an isolated workspace keyed by `task_id` and attempt. |
There was a problem hiding this comment.
To prevent different adapter or worker implementations from using conflicting directory structures, please clarify how the isolated workspace path is constructed relative to the base memory_paths defined in config/hermes.yaml (e.g., whether they should append /<task_id>/attempt_<attempt>/ to the base paths).
| - Each Hermes task uses an isolated workspace keyed by `task_id` and attempt. | |
| - Each Hermes task uses an isolated workspace keyed by task_id and attempt (e.g., appending /task_id/attempt_attempt/ to the base memory_paths defined in config/hermes.yaml). |
| Existing `reputation`, `time_loss`, and `downtime_security_money` routing terms | ||
| must be translated or retired deliberately; they are not interchangeable with | ||
| the API risk tiers without a mapping decision. |
There was a problem hiding this comment.
Note that the current EnvelopeValidationService in services/bizbrain_lite/app/services/envelope_validation_service.py strictly validates risk_tier against ['reputation', 'time_loss', 'downtime_security_money'] (lines 73, 130). If a client submits a task envelope with the new low or medium risk tiers, validation will fail immediately. When implementing the reconciliation in Step 3 of the gates, ensure the validation service is updated to support or map these new tiers.
| Every adapter-mediated Hermes task uses `task_id` as its idempotency key. An | ||
| adapter must atomically claim a queued task before invoking Hermes. A completed | ||
| task returns its existing artifact on replay; an actively claimed task is not | ||
| executed twice. |
There was a problem hiding this comment.
For the idempotency rule, please specify the expected adapter behavior or API response when a replay request is received for an actively claimed/in-progress task (e.g., returning a 409 Conflict, a specific status payload, or blocking/polling). This ensures consistent client handling during concurrent or duplicate submissions.
| Every adapter-mediated Hermes task uses `task_id` as its idempotency key. An | |
| adapter must atomically claim a queued task before invoking Hermes. A completed | |
| task returns its existing artifact on replay; an actively claimed task is not | |
| executed twice. | |
| Every adapter-mediated Hermes task uses task_id as its idempotency key. An | |
| adapter must atomically claim a queued task before invoking Hermes. A completed | |
| task returns its existing artifact on replay; an actively claimed task is not | |
| executed twice and returns an in-progress status or conflict error. |
Purpose
Lock the architecture decision before implementing a Hermes worker adapter: FAAS owns governed execution and proof; Hermes is a standalone FAAS-governed canon-and-learning execution worker, not the runtime governor.
Locked Host Roles
Changes
config/hermes.yamlto encode FAAS/Hermes/operator authority boundaries and planned adapter guardrails.DEPLOYMENT.mdwith the services actually present in currentdocker-compose.ymland adds the Hetzner-to-Hostinger promotion gate.docs/architecture/FAAS_HERMES_WORKER_CONTRACT.md, covering API boundary, lifecycle, atomic claim/idempotency, risk/review separation, security boundary, host roles, and first TBTX proving task.Ground Truth Correction
Current
docker-compose.ymldefines the FAAS control-plane stack (flow-gateway,bizbrain-lite,notion-flow-bridge, dashboard, optional Discord bot, Redis, Postgres). It does not yet define Hermes, OpenClaw, or Agent Zero worker services. This PR intentionally makes no claim that those workers are presently deployed.Next Implementation PR
After review, implement/reconcile the Postgres-backed job API contract and atomic claim lifecycle required by the Hermes adapter. Do not add the Hermes worker container until the state/routing/write-back contract is executable.
Verification
Documentation/config reconciliation only; no runtime code changed and no deployment was performed. The branch contains seven changed files against
main.Follow-Up Before Merge
docs/HERMES_SUPER_PROMPT_EXECUTION_AUDIT.mdremains a historical document containing stale language; this PR adds a superseding amendment. An inline rewrite or explicit historical banner should be decided before treating the old audit as current authority.