hubkit-cli 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/CHANGELOG.md +6 -0
  2. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/PKG-INFO +1 -1
  3. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/docs/architecture.md +1 -1
  4. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/docs/configuration.md +1 -1
  5. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/pyproject.toml +1 -1
  6. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/routed.py +21 -6
  7. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/run_reverts.py +2 -0
  8. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_review_chain.py +28 -0
  9. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/.gitignore +0 -0
  10. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/CLAUDE.md +0 -0
  11. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/CONTRIBUTING.md +0 -0
  12. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/LICENSE +0 -0
  13. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/README.md +0 -0
  14. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/SECURITY.md +0 -0
  15. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/SKILL.md +0 -0
  16. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/config.example.toml +0 -0
  17. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/docs/commands.md +0 -0
  18. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/docs/troubleshooting.md +0 -0
  19. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/intents.example.toml +0 -0
  20. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/references/design-sources.md +0 -0
  21. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/references/research.md +0 -0
  22. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/__init__.py +0 -0
  23. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/cli.py +0 -0
  24. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/compat.py +0 -0
  25. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/config.py +0 -0
  26. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/gate.py +0 -0
  27. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/hooks.py +0 -0
  28. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/inbound.py +0 -0
  29. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/install.py +0 -0
  30. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/learnings.py +0 -0
  31. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/ledger.py +0 -0
  32. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/lessons.py +0 -0
  33. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/orders.py +0 -0
  34. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/redact.py +0 -0
  35. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/slow.py +0 -0
  36. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/status.py +0 -0
  37. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/store.py +0 -0
  38. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/trust.py +0 -0
  39. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubcore/watcher.py +0 -0
  40. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/hubkit +0 -0
  41. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/scripts/learn.py +0 -0
  42. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/skills/hub-mep/SKILL.md +0 -0
  43. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/skills/hubkit-setup/SKILL.md +0 -0
  44. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/conftest.py +0 -0
  45. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_blockers.py +0 -0
  46. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_compat.py +0 -0
  47. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_guards2.py +0 -0
  48. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_hubkit.py +0 -0
  49. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_inbound.py +0 -0
  50. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_install.py +0 -0
  51. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_learning_rules.py +0 -0
  52. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_ledger.py +0 -0
  53. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_lessons.py +0 -0
  54. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_own_work.py +0 -0
  55. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_peer_reports.py +0 -0
  56. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_slow.py +0 -0
  57. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_state_rules.py +0 -0
  58. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_tool_guards.py +0 -0
  59. {hubkit_cli-0.2.2 → hubkit_cli-0.2.3}/tests/test_watcher.py +0 -0
@@ -4,6 +4,12 @@ All notable changes to this project are recorded here. The format follows [Keep
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.2.3] - 2026-11-06
8
+
9
+ ### Fixed
10
+ - A job whose title leads with a change verb ("Fix #7 review findings") is not a review item, unless one of its sentences naming the PR leads with a review.
11
+ - The review hard limit (`routed.review_overdue_min`) is raised to the item's own stated `Estimate:` when that is longer.
12
+
7
13
  ## [0.2.2] - 2026-11-06
8
14
 
9
15
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: hubkit-cli
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Session supervisor for Claude Code: hooks-based multi-agent orchestration with order clocks, routed-work tracking, a watchdog and a stop gate, standard library only.
5
5
  Project-URL: Repository, https://github.com/ankitkpandey1/hubkit
6
6
  Project-URL: Documentation, https://github.com/ankitkpandey1/hubkit/tree/main/docs
@@ -67,7 +67,7 @@ A routed item is one outcome per (owner, PR number), or per owner when no PR is
67
67
 
68
68
  - **Tracked:** a message naming a PR (URL, `PR 12`, bare `#123` resolved against `routed.repo`) or at least `min_chars` characters, and background `Agent` launches whose brief asks for a result (`Done-when`, `Output`, a PR). **Not tracked:** acknowledgements, short messages without a PR, `skip_owners`, foreground agents, standing watchers (`skip_briefs`), and a reply to a peer who wrote to the hub within `reply_window_min`.
69
69
  - **Asks and chases.** Only a new brief is a new ask. Any later non-acknowledgement message to the same owner is a chase: it is counted, never resets the ask's clock, and clears a moved-head or old-head-verdict flag.
70
- - **Reviews.** A message naming a PR and a `review_words` word ("review #N", "needs a review", "can I get a review on #N") makes a review item, unless it opens with a change verb (fix, address, resolve, apply, ...) and the review word names an existing review ("fix the findings in his review of #N"), on a short clock (`review_stall_min`, hard `OVERDUE` at `review_overdue_min`). It closes itself, PR by PR, when GitHub shows a review by someone other than the author at the PR's current head (on a PR written by `user.github_login`, a COMMENT review with a body counts too, because the reviewer peer posts as that account; an empty-body COMMENT is an inline-thread reply and does not). A review on an older head never closes it. One PR per clock: a message naming several PRs is a queue; "after X's queue" phrasing delays the clock by `queued_wait_min`.
70
+ - **Reviews.** A message naming a PR and a `review_words` word ("review #N", "needs a review", "can I get a review on #N") makes a review item, unless it opens with a change verb (fix, address, resolve, apply, ...) and the review word names an existing review ("fix the findings in his review of #N"), on a short clock (`review_stall_min`, hard `OVERDUE` at `review_overdue_min`, or at the brief's own `Estimate:` when that is longer). A job whose title leads with a change verb is not a review item unless a sentence naming the PR leads with a review. It closes itself, PR by PR, when GitHub shows a review by someone other than the author at the PR's current head (on a PR written by `user.github_login`, a COMMENT review with a body counts too, because the reviewer peer posts as that account; an empty-body COMMENT is an inline-thread reply and does not). A review on an older head never closes it. One PR per clock: a message naming several PRs is a queue; "after X's queue" phrasing delays the clock by `queued_wait_min`.
71
71
  - **Heard-from.** A peer message or task notification in the hub transcript, a review on the PR, or a background agent whose transcript or output file is still growing (`routed.activity_globs`) updates the last-heard time.
72
72
  - **Ladder.** Silence past `stall_min` climbs: step 1 a one-line state ask, step 2 a re-brief to another owner (not while the owner reported within the limit), step 3 tell the user. Every item shows one `NEXT:` action.
73
73
 
@@ -102,7 +102,7 @@ Estimates and the slowness check (hub-internal, see architecture).
102
102
  | `stall_min` | `15` | Silence from the owner this long is STALLED; the ladder steps at multiples of it. |
103
103
  | `review_words` | `["review"]` | A message naming a PR and one of these is a review item. |
104
104
  | `review_stall_min` | `5` | Reviews: chase after this. |
105
- | `review_overdue_min` | `10` | Reviews: hard OVERDUE this long after routing, whatever the owner said. |
105
+ | `review_overdue_min` | `10` | Reviews: hard OVERDUE this long after routing, whatever the owner said. A review brief with its own `Estimate: Nm` line (not a defaulted one) gets the larger of this and N. |
106
106
  | `skip_owners` | `["inbox"]` | Owners that are never tracked. |
107
107
  | `max_agents` | `4` | More distinct agents than this holding live routed work makes the routed hook warn. |
108
108
  | `min_chars` | `200` | A message without a PR is work only from this length. |
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hubkit-cli"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Session supervisor for Claude Code: hooks-based multi-agent orchestration with order clocks, routed-work tracking, a watchdog and a stop gate, standard library only."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.14"
@@ -85,6 +85,11 @@ LEADS_CHANGE = re.compile(
85
85
  )
86
86
 
87
87
 
88
+ REVIEW_LEAD = re.compile(
89
+ r"(?i)^\W*(?:(?:please|then|and|also)\s+)*(?:full\s+|gated\s+|re-?)*review\b"
90
+ )
91
+
92
+
88
93
  def _kinds(cfg: dict, sentence: str) -> set[str]:
89
94
  """What the owner may be asked to do in one sentence. A review word beside a PR is a review ask by default
90
95
  ("review #7", "needs a review", "can I get a review on #7"). The one exception: the sentence opens with a change
@@ -126,7 +131,16 @@ def is_review(cfg: dict, text: str, summary: str = "") -> bool:
126
131
  """A review ask: the owner is asked to review a PR, i.e. a sentence naming a PR leads with a review word (or the
127
132
  summary does). A review word elsewhere (a handover, a status) or as a noun after another action ("fix the
128
133
  findings in his review of #7") does not make it one."""
129
- return "review" in _asks(cfg, strip_examples(text), summary)
134
+ body = strip_examples(text)
135
+ if "review" not in _asks(cfg, body, summary):
136
+ return False
137
+ # a job titled as a change ("Fix #7 review findings") asks for changes, not a verdict, unless a sentence leads with a review
138
+ leads_review = any(
139
+ REVIEW_LEAD.match(x)
140
+ for x in re.split(r"(?<=[.!?])\s+|\n", body)
141
+ if PR_REF.search(x)
142
+ )
143
+ return not (LEADS_CHANGE.match(summary.strip().lower()) and not leads_review)
130
144
 
131
145
 
132
146
  def pushes_to_pr(cfg: dict, text: str, summary: str = "") -> bool:
@@ -793,11 +807,12 @@ def limit(cfg: dict, item: dict) -> float:
793
807
  def overdue(cfg: dict, item: dict, now: float) -> int | None:
794
808
  """Minutes since the ask when a review passes its hard limit (hearing from the owner does not stop it)."""
795
809
  age = int((now - started_at(cfg, item)) / 60)
796
- return (
797
- age
798
- if item.get("review") and age > float(opts(cfg)["review_overdue_min"])
799
- else None
800
- )
810
+ hard = float(opts(cfg)["review_overdue_min"])
811
+ if item.get("estimate_min") is not None and not item.get("estimate_defaulted"):
812
+ hard = max(
813
+ hard, float(item["estimate_min"])
814
+ ) # the job's own stated estimate sets its limit
815
+ return age if item.get("review") and age > hard else None
801
816
 
802
817
 
803
818
  def level(cfg: dict, item: dict, now: float) -> int | None:
@@ -351,6 +351,8 @@ REVERTS = [
351
351
  ('eod lists PRs and peers', 'hubcore/status.py', 'glance(cfg, day) + [""] + ledger.day_lines(cfg, day)', 'glance(cfg, day)', 'tests/test_ledger.py::test_digest_and_eod_list_todays_prs_and_what_each_peer_was_asked'),
352
352
  ('digest lists PRs and peers', 'hubcore/status.py', 'return out + ledger.day_lines(cfg, store.day_of(cfg, since))', 'return out', 'tests/test_ledger.py::test_digest_and_eod_list_todays_prs_and_what_each_peer_was_asked'),
353
353
  ('fix job push is not a stall', 'hubcore/routed.py', ' bool(PR_REF.search(text + " " + summary))\n and bool(PUSH', ' False\n and bool(PUSH', 'tests/test_review_chain.py::test_an_owners_pushes_to_a_fix_job_are_not_a_stalled_head_but_a_reviews_moved_head_still_is'),
354
+ ('fix-titled job is not a review', 'hubcore/routed.py', 'return not (LEADS_CHANGE.match(summary.strip().lower()) and not leads_review)', 'return True', 'tests/test_review_chain.py::test_a_fix_job_titled_with_review_findings_has_no_review_clock_but_a_real_review_does'),
355
+ ('stated estimate sets the hard limit', 'hubcore/routed.py', ' hard = max(\n hard, float(item["estimate_min"])\n )', ' hard = hard', 'tests/test_review_chain.py::test_a_reviews_own_stated_estimate_sets_its_hard_limit'),
354
356
  ]
355
357
 
356
358
 
@@ -54,3 +54,31 @@ def test_an_owners_pushes_to_a_fix_job_are_not_a_stalled_head_but_a_reviews_move
54
54
  items = {i["owner"]: i for i in routed_items(env)}
55
55
  assert items["peer-fix"]["head_moved"] is None and items["peer-fix"]["heads"][PR1] == "bbb2222"
56
56
  assert items["peer-rev"]["head_moved"] and "ALERT" in out
57
+
58
+
59
+ def test_a_fix_job_titled_with_review_findings_has_no_review_clock_but_a_real_review_does(env):
60
+ from test_hubkit import age_routed
61
+
62
+ fake_gh(env, head="aaa1111")
63
+ env.bind()
64
+ fix = f"Fix the findings from the review of {PR1}. Done-when: tests pass. Output: the PR updated, ready for re-review of {PR1}.\nEstimate: 45m"
65
+ send(env, "peer-fix", fix, "Fix #101 review findings")
66
+ assert routed_items(env)[0]["review"] is False
67
+ age_routed(env, 29)
68
+ assert "past the hard limit" not in env.prompt("carry on").stdout
69
+ send(env, "peer-rev", f"Full gated review of {PR2}. Done-when: a verdict. Output: the verdict", "review 102")
70
+ age_routed(env, 29)
71
+ out = env.prompt("carry on").stdout
72
+ assert "peer-rev" in out and "past the hard limit" in out and out.count("past the hard limit") == 1
73
+
74
+
75
+ def test_a_reviews_own_stated_estimate_sets_its_hard_limit(env):
76
+ from test_hubkit import age_routed
77
+
78
+ fake_gh(env, head="aaa1111")
79
+ env.bind()
80
+ send(env, "peer-rev", f"Full gated review of {PR1}. Done-when: a verdict. Output: the verdict.\nEstimate: 60m", "review 101")
81
+ age_routed(env, 29)
82
+ assert "past the hard limit" not in env.prompt("carry on").stdout
83
+ age_routed(env, 40)
84
+ assert "past the hard limit" in env.prompt("carry on").stdout
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes