feat: add Kanban runtime preflight guardrails - #28828
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the Kanban safety work. The premise still exists on current main: origin/main has no hermes runtime preflight --scope kanban, no runtime_guardrails config, and hermes_cli/kanban_decompose.py:436 still stores child bodies as body.strip().
Problems
hermes_cli/runtime_preflight.py:21only acceptsmodel.default/model.name; existing config compatibility also recognizesmodel.model(hermes_cli/kanban_diagnostics.py:253-263), so valid configs can fail preflight.hermes_cli/runtime_preflight.py:27reads root-levelconfig.providerbeforemodel.provider, but current provider selection usesmodel.provider(hermes_cli/main.py:2677-2686) and the provider setup path writesmodel.provider(hermes_cli/auth.py:6257-6293). A stale root key could produce a false PASS.- The dispatcher adds
HERMES_RUNTIME_PREFLIGHT_SCOPE/HERMES_RUNTIME_PREFLIGHT_REQUIRED, but the new preflight module does not read those env vars, so the worker-launch contract is exposed but not asserted.
Suggested changes
- Reuse or mirror the existing model/provider resolution shape, including
model.modelcompatibility. - Either validate the preflight env contract in
collect_kanban_preflight()or drop the contract vars/comments until they have an enforcement path.
Automated hermes-sweeper review.
| detail: str = "" | ||
|
|
||
|
|
||
| def _configured_model(config: dict[str, Any]) -> str: |
There was a problem hiding this comment.
This should also consider model_cfg.get("model"): existing config compatibility treats model.model as a valid backcompat key, so this preflight can false-fail configs the runtime accepts.
| return str(model_cfg.get("default") or model_cfg.get("name") or "").strip() | ||
| return str(model_cfg or "").strip() | ||
|
|
||
|
|
There was a problem hiding this comment.
Root-level provider is not the current runtime selection source; provider setup writes model.provider, and trusting a stale root key here can turn a missing runtime provider into a false PASS.
| # The dispatcher already resolves the concrete board/db/workspace paths above; | ||
| # these flags let runtime guardrails assert that Kanban work was launched | ||
| # through the checked path instead of an ad-hoc shell. | ||
| env["HERMES_RUNTIME_PREFLIGHT_SCOPE"] = "kanban" |
There was a problem hiding this comment.
If this env var is meant to prove the worker was launched through the dispatcher, collect_kanban_preflight() should read and validate it; otherwise the contract is only informational despite the guardrail wording.
Summary
hermes runtime preflight --scope kanbanfor executable Kanban safety checks.Test Plan
venv/bin/python -m pytest tests/hermes_cli/test_ops_reports.py tests/hermes_cli/test_kanban_db.py::TestSharedBoardPaths::test_dispatcher_spawn_injects_kanban_db_and_workspaces_root tests/hermes_cli/test_runtime_preflight.py tests/hermes_cli/test_kanban_decompose.py -q— 17 passedvenv/bin/python -m pytest tests/hermes_cli/test_ops_reports.py tests/hermes_cli/test_runtime_preflight.py tests/hermes_cli/test_kanban_decompose.py tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_cli.py tests/hermes_cli/test_cmd_update.py -q— 230 passedNotes