Skip to content

docs: post-v2.6.1 sweep + a finding from reviewing what the bot didn't read - #186

Merged
bejranonda merged 2 commits into
mainfrom
docs/post-v261-sweep
Aug 1, 2026
Merged

docs: post-v2.6.1 sweep + a finding from reviewing what the bot didn't read#186
bejranonda merged 2 commits into
mainfrom
docs/post-v261-sweep

Conversation

@bejranonda

@bejranonda bejranonda commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Independent review of this arc's PRs, prompted by the repo's own rule: a green CodeRabbit check with zero inline comments means a rate-limited bot, not a clean bill of health.

PR CodeRabbit Inline comments
#180, #181, #183, #185 green 0 — never actually reviewed
#182, #184 green 3, 3 (addressed at the time)

Reading the four unreviewed ones by hand found one real issue.

New open finding: the exported rules ≠ the served rules

buildKnowledgeWhere (V1) is still live at 7 call sites — the dashboard, the graph, and exporter.buildRulesBundle. It resolves visibility on ownerProjectId alone and never consults scope, so a scope: 'user' rule taught from inside another project is invisible to it. Retrieval (kra.ts/oracle.ts, V2 + opt-in) does see those rows.

Concrete symptom: buildRulesBundle defaults to dataScope: "project", so "Download rules bundle" omits rules the Brain is actively injecting into your sessions.

Nothing in CI would ever have flagged this, because nothing in CI knows the two sets should agree.

Left open deliberately. It changes what three user-facing surfaces show — a product call, not a correctness one — and it's the unfinished half of a deliberate Phase-4 migration (scope-filter.ts: V2 "replaces buildRawProjectFilter for callers that have been migrated"). Options recorded in the row: migrate the three call sites to V2 with the opt-in, or add the same opt-in to V1.

Also documented

  • KNOWN_ISSUES — coherence gate exists (v2.6.0); the v2.6.1 follow-up where that gate's own script tripped prod-drift.
  • GUIDELINES — two generations of scope helper exist and the migration is unfinished; check which one a surface uses. Plus a rule for writing CI gates: gate on values, not files, and let the negative test drive the design.
  • KNOWLEDGE — names the three narrower surfaces beside the retrieval-vs-listing note.
  • APPROACH — cries-wolf gate design; exclusion lists as a liability that accrues; why independent review isn't optional when the bot didn't read the diff.

README verified current — no edits made.

Test plan

  • Audited CodeRabbit coverage per-PR rather than trusting the green checks.
  • Independent read of the merged scope-filter.ts: confirmed all four V2 branches are mutually consistent and pinned by the cross-helper tests.
  • Traced the V1 finding to a concrete user-visible symptom (buildRulesBundle default scope) rather than reporting it as an abstract inconsistency.
  • check-doc-refs.sh against the live ceiling (fix(ci): exclude root scripts/ from prod-drift's app-served set #185).
  • Docs only — relying on CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rqj5y9fT3XPUqnqKyustp9

Summary by CodeRabbit

  • Documentation
    • Added guidance on validating benchmark coherence checks, including negative cases and semantic changes.
    • Clarified scope-helper differences and documented remaining migration limitations.
    • Documented visibility gaps affecting exports, dashboard, and graph views for cross-project rules.
    • Added known-issue tracking for scope visibility and CI benchmark coherence validation.

…idn't

Independent review of this arc's PRs, prompted by the repo's own rule
that a green CodeRabbit check with zero inline comments means a
rate-limited bot, not a clean review. Four of six PRs were in that
state. Reading them by hand found one real issue.

NEW OPEN FINDING — the V1 scope helpers never got #174's cross-project
reach, and three surfaces still call them. buildKnowledgeWhere (V1) is
live at 7 call sites: dashboard, graph, and exporter.buildRulesBundle.
It resolves visibility on ownerProjectId alone and never consults
`scope`, so a scope:'user' rule taught in another project is invisible
to it — while retrieval (V2 + opt-in) sees it.

Concrete symptom: buildRulesBundle defaults to dataScope "project", so
"Download rules bundle" omits rules the Brain is actively injecting
into sessions. The exported set disagrees with the served set. Nothing
in CI would ever say so, because nothing in CI knows the two should
agree.

Left OPEN deliberately: it changes what three user-facing surfaces
show, which is a product call rather than a correctness one, and it is
the unfinished half of a deliberate Phase-4 migration. Options recorded
in the row.

Also documented:
- KNOWN_ISSUES: the coherence gate now exists (v2.6.0), plus the
  v2.6.1 follow-up where the gate's own script tripped prod-drift.
- GUIDELINES: there are TWO generations of scope helper and the
  migration is unfinished — check which one a surface uses before
  reasoning about its visibility. Plus a rule for writing CI gates:
  gate on values not files, and let the NEGATIVE test drive the design,
  because a gate that cries wolf gets switched off.
- KNOWLEDGE: names the three narrower surfaces explicitly next to the
  retrieval-vs-listing note.
- APPROACH: the cries-wolf design lesson; exclusion lists as a
  liability that accrues with every new top-level path; and why
  independent review is not optional when the bot didn't read the diff.

README verified current — no edits needed.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqj5y9fT3XPUqnqKyustp9
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@bejranonda, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dcae13bc-e0a7-47f4-b9f8-1dd5fec9f4cf

📥 Commits

Reviewing files that changed from the base of the PR and between a03139f and 57b72e5.

📒 Files selected for processing (4)
  • docs/APPROACH.md
  • docs/GUIDELINES.md
  • docs/KNOWLEDGE.md
  • docs/KNOWN_ISSUES.md
📝 Walkthrough

Walkthrough

The pull request adds documentation for V1/V2 scope-helper limitations, benchmark coherence gates, deployment exclusion validation, and independent review when automated checks produce no substantive findings.

Changes

Documentation guidance

Layer / File(s) Summary
Scope-helper visibility documentation
docs/GUIDELINES.md, docs/KNOWLEDGE.md, docs/KNOWN_ISSUES.md
Documents V1 helper limitations and mismatches between retrieval, exports, dashboard, and graph views.
Benchmark coherence and deployment validation
docs/APPROACH.md, docs/GUIDELINES.md, docs/KNOWN_ISSUES.md
Defines value-based benchmark checks, historical negative tests, merge-base validation, and runtime validation for deployment exclusions.
Independent review guidance
docs/APPROACH.md
Requires manual review when automated checks are green but produce no substantive findings.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation sweep and the review finding about missed bot coverage.
Description check ✅ Passed The description explains the change, records the finding, documents the test plan, and states that remaining checks rely on CI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/post-v261-sweep

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/APPROACH.md`:
- Line 1760: Update the text at the Markdown heading line beginning with “#174”
to “issue `#174`”, ensuring the hash is no longer parsed as an invalid heading and
the existing sentence remains intact.
- Around line 1762-1765: Update the benchmark-gate guidance in the surrounding
documentation to require tests for both outcomes: a KRA value change must fail
when VALIDATION.md is absent, while refactor-only changes must pass. Keep the
existing historical negative-case guidance and explicitly document these as
complementary regression scenarios.

In `@docs/GUIDELINES.md`:
- Around line 45-46: Correct the V1 scope terminology across all specified
documentation sites: in docs/GUIDELINES.md lines 45-46, limit “no cross-project
reach” to project-scoped V1 calls and distinguish persisted scope from request
dataScope; in docs/KNOWLEDGE.md lines 528-533, remove the claim of no
cross-project reach at all and direct new Knowledge listing paths to V2 helpers;
in docs/KNOWN_ISSUES.md line 384, describe the persisted scope-column limitation
instead of saying V1 never consults scope, and label the divergence as a
deferred decision with a known consistency gap.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ccac113-8b8f-426b-8183-67154ad88432

📥 Commits

Reviewing files that changed from the base of the PR and between a84061a and a03139f.

📒 Files selected for processing (4)
  • docs/APPROACH.md
  • docs/GUIDELINES.md
  • docs/KNOWLEDGE.md
  • docs/KNOWN_ISSUES.md

Comment thread docs/APPROACH.md Outdated
first.** The benchmark-doc coherence gate exists to stop a `kra.ts` retune
landing with stale published numbers. The obvious implementation — fail if
`kra.ts` changed without `VALIDATION.md` — would have blocked this very arc's
#174 work, which edited that file without moving a single weight. It compares

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the Markdown heading syntax.

Line 1760 starts with #174 without a space. Replace it with issue #174`` to satisfy markdownlint rule MD018.

🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 1760-1760: No space after hash on atx style heading

(MD018, no-missing-space-atx)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/APPROACH.md` at line 1760, Update the text at the Markdown heading line
beginning with “#174” to “issue `#174`”, ensuring the hash is no longer parsed as
an invalid heading and the existing sentence remains intact.

Source: Linters/SAST tools

Comment thread docs/APPROACH.md Outdated
Comment thread docs/GUIDELINES.md Outdated
Three findings on #186, all valid.

1. My V1 claim was overstated — the fourth time this session. I wrote
   that V1 has "no cross-project reach at all". It does: under
   DataScope "all" buildKnowledgeWhere returns everything the caller
   owns, across projects. The real gap is narrower and more precise:
   under DataScope "project" it consults only ownerProjectId and never
   Knowledge.scope, so it cannot filter to a project WHILE admitting
   the caller's user-scoped rows from elsewhere — which is exactly what
   V2's opt-in adds.

   Review also caught that I was conflating two different things both
   called "scope": persisted Knowledge.scope (user/project/global) and
   request DataScope (project/all). Both now named explicitly wherever
   this is described.

   The symptom is correspondingly narrower: buildRulesBundle defaults
   to DataScope "project" and the route only sends "all" for
   ?scope=all, so the DEFAULT download omits those rules while
   ?scope=all returns them. That is a confusing inconsistency rather
   than an absence, which is a fairer description.

2. Documented BOTH benchmark-gate outcomes. The text emphasised the
   negative test; the positive one exists too (simulated 0.7 -> 0.65
   retune must fail without VALIDATION.md) and is now stated.

3. MD018: "#174" at line start parsed as a markdown heading.

Also records the pattern behind all four overclaims of this session —
unbounded / zero coverage / wrong mechanism / "at all" — since naming
it as a habit is more useful than four separate corrections. The tell
is consistent: the absolute arrives before the verification, because it
is the version that makes a finding sound worth reporting. Review
caught all four, which argues for review rather than for trying harder.

Corrected in KNOWN_ISSUES, GUIDELINES and KNOWLEDGE together — a
retraction in one of three is not a retraction.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rqj5y9fT3XPUqnqKyustp9
@bejranonda
bejranonda merged commit 0b5ea96 into main Aug 1, 2026
7 checks passed
@bejranonda
bejranonda deleted the docs/post-v261-sweep branch August 1, 2026 10:15
bejranonda added a commit that referenced this pull request Aug 1, 2026
…187)

Closes the open finding from #186: "Download rules bundle" shipped a
strictly narrower set than kra.ts injects.

Two things are called "scope" and the distinction is the fix. Under
DataScope "all" the V1 helper already returns everything the caller
owns. The gap was DataScope "project" — buildRulesBundle's default —
where it resolved on ownerProjectId alone and never consulted
Knowledge.scope, so it could not filter to a project WHILE admitting
the caller's user-scoped rows from elsewhere.

Fixed with an owner-anchored includeUserScopeAcrossProjects opt-in on
V1, always enabled by the exporter. Not exposed as a parameter: there
is no reading of "export my rules" that wants less than you are served.

Deliberately NOT the V1->V2 migration I originally suggested. Checking
before executing showed V2's `visibility: 'project'` arm carries no
ownerUserId predicate — that absence is what makes Phase-4 org sharing
work — so migrating a personal surface to it would ALSO start
returning teammates' rules. That is a product decision about team
sharing, not this defect, and it would have shipped inside a change
labelled "finish the migration".

Dashboard and graph keep the project-scoped view on purpose. They are
browsing surfaces where project focus is the point, consistent with
KNOWLEDGE §12.19's retrieval-is-wider-than-listing rule. A rules bundle
is different in kind — it is the agent's configuration.

Tests pin all four properties: closed by default, opened when opted in,
no-op under DataScope "all", and the ownerUserId anchor present both on
the outer AND and inside the new disjunct so it is safe read alone.

GUIDELINES now records the general rule this produced: migrate a
surface to V2 when you want org visibility there; add an owner-anchored
opt-in to V1 when you only want the caller's own rows to reach further.


Claude-Session: https://claude.ai/code/session_01Rqj5y9fT3XPUqnqKyustp9

Co-authored-by: Claude <noreply@anthropic.com>
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.

1 participant