Repository navigation
fix(guard): a role process may open a card from the terminal - #27
Merged
Merged
Conversation
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.
Contributor
Author
|
FYI: this change has now run on a live install. A worker triage card ran |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A role process (
HERMES_KANBAN_TASKset) may open cards throughcrew_plan(_open_guard) and throughkanban_create(_create_guard). It may not open one withcrew_card.py openfrom the terminal. That branch of_open_guardchecks only for a/crewturn, 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_plandoes not fit there: it always opens a parent, children and a close-out.crew_card.py openis the single-card tool.The terminal branch now takes the same check as the
crew_planbranch above it. The owner's chat session has noHERMES_KANBAN_TASK, so the gate there is as strict as before.Related issue
None.
Type of change
How to test
python -m pytest tests -q. The new test intests/test_crew_tools_guard.pychecks that a terminalcrew_card.py openpasses withHERMES_KANBAN_TASKset. The existing test next to it still checks that the same command is refused outside a/crewturn. The new test fails without the change.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
fix(scope):,feat(scope):)python -m pytest tests -qpasses (895 passed, 3 skipped)