Skip to content

fix(guard): a role process may open a card from the terminal - #27

Merged
macd2 merged 1 commit into
macd2:mainfrom
keyz182:fix/open-guard-role-process
Nov 1, 2026
Merged

macd2 merged 1 commit into
macd2:mainfrom
keyz182:fix/open-guard-role-process

Conversation

@keyz182

@keyz182 keyz182 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

What and why

A role process (HERMES_KANBAN_TASK set) may open cards through crew_plan (_open_guard) and through kanban_create (_create_guard). It may not open one with crew_card.py open from the terminal. That branch of _open_guard checks only for a /crew turn, so the call is refused with "Answer the owner normally; … type /crew". That makes no sense inside a card.

This hurts a card whose job is to open one follow-up card. An example is a triage card that decides an issue needs code, then opens the code card. crew_plan does not fit there: it always opens a parent, children and a close-out. crew_card.py open is the single-card tool.

The terminal branch now takes the same check as the crew_plan branch above it. The owner's chat session has no HERMES_KANBAN_TASK, so the gate there is as strict as before.

Related issue

None.

Type of change

  • Bug fix
  • Cross-platform (Windows / WSL / macOS)
  • Security hardening (not an undisclosed vulnerability: those go to private reporting, see SECURITY.md)
  • Robustness / board
  • New feature
  • Docs or tests only

How to test

  1. python -m pytest tests -q. The new test in tests/test_crew_tools_guard.py checks that a terminal crew_card.py open passes with HERMES_KANBAN_TASK set. The existing test next to it still checks that the same command is refused outside a /crew turn. The new test fails without the change.
  2. On a real install, have a worker card run crew_card.py open --title X ... --json. The card opens and is not refused.

Platform tested on

Linux (Python 3.12 for the suite). Not run on Windows or macOS; the change is one condition in a guard.

Checklist

  • One logical change, no unrelated commits
  • Commits follow Conventional Commits (fix(scope):, feat(scope):)
  • python -m pytest tests -q passes (895 passed, 3 skipped)
  • I added tests, or said above why not
  • Works on Windows, macOS and Linux, or I said above what I could not check
  • No machine-specific strings (home paths, hostnames, emails) in the diff

The terminal branch of _open_guard now takes the same check as its crew_plan branch: a role process (HERMES_KANBAN_TASK set) may open a card, as it already may through crew_plan and kanban_create. The owner's chat session is gated as before.
@keyz182

keyz182 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

FYI: this change has now run on a live install.

A worker triage card ran crew_card.py open from its terminal to open its follow-up code card. The card opened (created event with creator_task_id set to the triage card), was claimed and spawned, and the worker log has no "crew cards open only from the owner's /crew command" refusal. Before this change, that call was refused.

@macd2
macd2 merged commit 2303ce3 into macd2:main Nov 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants