Skip to content

feat: add Kanban runtime preflight guardrails - #28828

Open
fcampogni2012 wants to merge 3 commits into
NousResearch:mainfrom
fcampogni2012:feat/kanban-runtime-preflight
Open

feat: add Kanban runtime preflight guardrails#28828
fcampogni2012 wants to merge 3 commits into
NousResearch:mainfrom
fcampogni2012:feat/kanban-runtime-preflight

Conversation

@fcampogni2012

Copy link
Copy Markdown

Summary

  • Add default runtime guardrails to Kanban decomposed child tasks.
  • Add hermes runtime preflight --scope kanban for executable Kanban safety checks.
  • Expose the Kanban runtime preflight contract to dispatched worker environments.

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 passed
  • venv/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 passed

Notes

  • This PR intentionally excludes local/private ops-report dogfood work.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:21 only accepts model.default / model.name; existing config compatibility also recognizes model.model (hermes_cli/kanban_diagnostics.py:253-263), so valid configs can fail preflight.
  • hermes_cli/runtime_preflight.py:27 reads root-level config.provider before model.provider, but current provider selection uses model.provider (hermes_cli/main.py:2677-2686) and the provider setup path writes model.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.model compatibility.
  • 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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread hermes_cli/kanban_db.py
# 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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cron Cron scheduler and job management comp/cli CLI entry point, hermes_cli/, setup wizard labels Jun 15, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #28642 (dispatcher preflight guards), #33747 (preflight kanban skills before spawning). This PR adds a new hermes runtime preflight --scope kanban CLI surface + runtime_preflight.py module that the other cluster PRs lack — different mechanism, not a duplicate.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-automation Sweeper risk: may affect CI, automerge, label sync, or maintainer automation sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-automation Sweeper risk: may affect CI, automerge, label sync, or maintainer automation sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants