forked from NousResearch/hermes-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(kanban): enforce native review lifecycle #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
solovision24
merged 2 commits into
dev/hermes-upgrade-t_16bbffad
from
agent/dev-review-conformance-integration
Aug 2, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| """Read-only conformance check for native Review handoff prerequisites. | ||
|
|
||
| The checker deliberately consumes the same human-readable command output a | ||
| user sees. ``hermes profile list`` marks the active profile with ``◆``; | ||
| ``hermes kanban assignees`` is the source of truth for whether a reviewer can | ||
| actually be spawned. No board mutation is performed. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
| import re | ||
| import subprocess | ||
| import sys | ||
| from typing import Optional | ||
|
|
||
|
|
||
| _ACTIVE_PROFILE_RE = re.compile(r"^\s*◆(?P<name>\S+)") | ||
| _ASSIGNEE_RE = re.compile(r"^\s*(?P<name>\S+)\s+(?P<on_disk>yes|no)\s+(?:.*)$") | ||
|
|
||
|
|
||
| def parse_active_profile(profile_list_output: str) -> Optional[str]: | ||
| """Return the profile marked active by ``hermes profile list``.""" | ||
| for line in profile_list_output.splitlines(): | ||
| match = _ACTIVE_PROFILE_RE.match(line) | ||
| if match: | ||
| return match.group("name") | ||
| return None | ||
|
|
||
|
|
||
| def parse_assignees(assignees_output: str) -> dict[str, bool]: | ||
| """Parse ``hermes kanban assignees`` into ``name -> on_disk`` values.""" | ||
| parsed: dict[str, bool] = {} | ||
| for line in assignees_output.splitlines(): | ||
| match = _ASSIGNEE_RE.match(line) | ||
| if match and match.group("name").upper() != "NAME": | ||
| parsed[match.group("name")] = match.group("on_disk") == "yes" | ||
| return parsed | ||
|
|
||
|
|
||
| def check_conformance( | ||
| profile_list_output: str, | ||
| assignees_output: str, | ||
| *, | ||
| reviewer: str = "orion", | ||
| ) -> list[str]: | ||
| """Return actionable conformance errors; an empty list means compliant.""" | ||
| active = parse_active_profile(profile_list_output) | ||
| assignees = parse_assignees(assignees_output) | ||
| errors: list[str] = [] | ||
| if active is None: | ||
| errors.append("active profile marker ◆ was not found in hermes profile list") | ||
| elif not assignees.get(active, False): | ||
| errors.append(f"active profile {active!r} is not on disk in hermes kanban assignees") | ||
| if reviewer not in assignees or not assignees[reviewer]: | ||
| errors.append(f"reviewer {reviewer!r} is not on disk in hermes kanban assignees") | ||
| return errors | ||
|
|
||
|
|
||
| def _run_hermes(hermes: str, *args: str) -> str: | ||
| result = subprocess.run( | ||
| [hermes, *args], | ||
| check=False, | ||
| capture_output=True, | ||
| text=True, | ||
| ) | ||
| if result.returncode: | ||
| detail = (result.stderr or result.stdout).strip() | ||
| raise RuntimeError(f"{' '.join([hermes, *args])} failed: {detail}") | ||
| return result.stdout | ||
|
|
||
|
|
||
| def main(argv: Optional[list[str]] = None) -> int: | ||
| parser = argparse.ArgumentParser(description=__doc__) | ||
| parser.add_argument("--hermes", default="hermes", help="Hermes executable") | ||
| parser.add_argument("--reviewer", default="orion") | ||
| args = parser.parse_args(argv) | ||
| try: | ||
| profile_output = _run_hermes(args.hermes, "profile", "list") | ||
| assignees_output = _run_hermes(args.hermes, "kanban", "assignees") | ||
| except RuntimeError as exc: | ||
| print(f"FAIL: {exc}", file=sys.stderr) | ||
| return 2 | ||
| errors = check_conformance(profile_output, assignees_output, reviewer=args.reviewer) | ||
| if errors: | ||
| for error in errors: | ||
| print(f"FAIL: {error}", file=sys.stderr) | ||
| return 1 | ||
| print(f"PASS: active profile and reviewer {args.reviewer!r} are spawnable") | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| raise SystemExit(main()) |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the caller omits
--reviewerand supplies a normal multiword summary, such assubmit-review <id> ready for review --metadata ...,args.summaryis nonempty and this branch interpretsreadyas the reviewer profile. The advertisedoriondefault therefore works only for a one-word summary; multiword handoffs fail reviewer-profile validation unless users explicitly pass--reviewer orion.Useful? React with 👍 / 👎.