Revise PR #250: the membership-stem measurement was the wrong population (senders, not members) - #302
Revise PR #250: the membership-stem measurement was the wrong population (senders, not members)#302jaylfc wants to merge 2 commits into
Conversation
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reached
Next review available in: 54 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| archive_dir=str(path / "archive"), | ||
| index_path=str(path / "archive-index.db"), | ||
| ) | ||
| await archive.init() |
There was a problem hiding this comment.
WARNING: Missing try/finally for archive resource cleanup
await archive.init() and await archive.query() are called without a try/finally block. If archive.query() raises an exception, archive.close() on line 79 is never reached, causing a resource leak (open file descriptor / unclosed DB connection).
| await archive.init() | |
| await archive.init() | |
| try: | |
| rows = await archive.query(event_type=EVENT_A2A, limit=100_000) | |
| finally: | |
| await archive.close() |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| pairs = await _collect_from_archive(str(data_dir)) | ||
| scope = f"archive EVENT_A2A rows in {data_dir}" | ||
| if not pairs: | ||
| print( |
There was a problem hiding this comment.
WARNING: Misleading error message when --data-dir yields no EVENT_A2A rows
When --data-dir is provided and _collect_from_archive returns no pairs, the error message says no bus-spool.jsonl in {data_dir}. However, the code never attempts to read bus-spool.jsonl in this branch. The message implies a fallback that does not exist.
| print( | |
| print( | |
| f"No EVENT_A2A rows found in {data_dir}", | |
| file=sys.stderr, | |
| ) |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| for s in spellings | ||
| if s != p | ||
| and not is_canonical(s) | ||
| and (is_bare_form(s) or is_at_form(s)) |
There was a problem hiding this comment.
WARNING: Tautological condition still present despite changelog claiming it was fixed
is_bare_form(s) or is_at_form(s) is always True for any non-empty string (every non-empty string either starts with @ or does not). The changelog states this was "fixed", but the tautology remains. The actual filtering is done by not is_canonical(s); the tautological clause adds no filtering and should be removed.
| and (is_bare_form(s) or is_at_form(s)) | |
| twins = [ | |
| s | |
| for s in spellings | |
| if s != p | |
| and not is_canonical(s) | |
| ] |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| # tsk-rf5gwb: Membership identity-stem measurement | ||
|
|
||
| Status: CLOSED | ||
| Scope: channel membership principals from bus-spool.jsonl (499 sender/channel pairs, 753 raw lines) |
There was a problem hiding this comment.
WARNING: Spec documents old bus-spool measurement, but code now reads EVENT_A2A archive rows
Line 4 states the scope is "channel membership principals from bus-spool.jsonl (499 sender/channel pairs, 753 raw lines)", but scripts/measure_membership_stems.py now reads from EVENT_A2A archive rows. The spec's measured numbers and method description describe the old population (senders), not the revised one (members). This will confuse anyone cross-referencing the spec with the actual script output.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| index_path=str(path / "archive-index.db"), | ||
| ) | ||
| await archive.init() | ||
| rows = await archive.query(event_type=EVENT_A2A, limit=100_000) |
There was a problem hiding this comment.
SUGGESTION: Hardcoded 100_000 row limit could silently drop data
_collect_from_archive passes limit=100_000 to archive.query(). If the archive contains more than 100,000 EVENT_A2A rows, excess rows are silently dropped, leading to an incomplete measurement. Consider making this configurable or documenting the limitation.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
|
|
||
|
|
||
| def _collect_from_bus_spool(spool_path: str) -> list[tuple[str, str]]: | ||
| with open(spool_path, encoding="utf-8") as f: |
There was a problem hiding this comment.
SUGGESTION: _collect_from_bus_spool loads entire file into memory
f.readlines() on line 96 reads the whole bus-spool.jsonl into memory at once. For a large bus-spool file this could cause high memory usage. Consider iterating line-by-line with for line in f: instead.
| with open(spool_path, encoding="utf-8") as f: | |
| with open(spool_path, encoding="utf-8") as f: | |
| pairs: list[tuple[str, str]] = [] | |
| for line in f: | |
| try: | |
| obj = json.loads(line) | |
| except (json.JSONDecodeError, TypeError): | |
| continue | |
| body = obj.get("body") or "" | |
| m = re.match(r"\[bus/([^\]]+)\]\s+([^:]+):", body) | |
| if m: | |
| channel = m.group(1) | |
| sender = m.group(2).strip() | |
| if sender: | |
| pairs.append((sender, channel)) | |
| continue | |
| m = re.match(r"([^:]+):\s+\[AUTO-ACK\]", body) | |
| if m: | |
| sender = m.group(1).strip() | |
| if sender: | |
| pairs.append((sender, "agent-rules")) | |
| return pairs |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 6 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Reviewed by step-3.7-flash · Input: 140.5K · Output: 16.6K · Cached: 226K |
Closing this: it rebuilds from master and loses work that already exists on
|
CARD TITLE (intent, not commit subject): Revise PR #250: the membership-stem measurement was the wrong population (senders, not members)
Autonomous build of board card tsk-hsph7e.
Files:
changelog.d/tsk-hsph7e-membership-stems.md | 7 +
docs/specs/tsk-rf5gwb-membership-stems.md | 79 ++++++++++
scripts/measure_membership_stems.py | 231 +++++++++++++++++++++++++++++
tests/test_measure_membership_stems.py | 127 ++++++++++++++++
4 files changed, 444 insertions(+)