Skip to content

fix(brainbar): pass contentIntegrity at the storedChunk lookup call site — main does not compile - #649

Closed
EtanHey wants to merge 1 commit into
mainfrom
fix/swift-build-contentintegrity
Closed

fix(brainbar): pass contentIntegrity at the storedChunk lookup call site — main does not compile#649
EtanHey wants to merge 1 commit into
mainfrom
fix/swift-build-contentintegrity

Conversation

@EtanHey

@EtanHey EtanHey commented Aug 4, 2026

Copy link
Copy Markdown
Owner

main does not build. swift build fails with 22 errors across BrainBar and BrainBarDaemon.

Cause

#645 added contentIntegrity to StoredChunk and updated the write-with-readback path (BrainDatabase.swift:1406) but not the lookup path at :4701:

BrainDatabase.swift:4701:86: error: missing argument for parameter 'contentIntegrity' in call

It landed because the seven --admin merges of 2026-08-04 bypassed CI — the same root cause as the ruff drift fixed in #648. --admin doesn't skip one gate; it lets a red build become the base for every branch cut afterward. This is the third repair PR for that one decision.

Fix

One argument at one call site. storedChunk() is a lookup of an existing row, not a write-with-readback — no integrity comparison happens there, so nil is the truthful value rather than a fabricated measurement.

Note: Sources/BrainBarDaemon/BrainDatabase.swift is a symlink to the BrainBar copy, so the 22 errors are 11 real ones seen through two targets and a single edit fixes both. Worth knowing before anyone "de-duplicates" the file.

Verification

swift build                → 0 errors   (was 22)
hook-backed pre-push gate  → 3710 passed, 9 skipped, 61 deselected, 1 xfailed in 1129.38s
                             BrainLayer test gate passed.

What this unblocks


Note

Low Risk
Single-call-site compile fix with no behavior change beyond satisfying the updated initializer; lookup paths still do not perform integrity checks.

Overview
Restores swift build by updating the storedChunk lookup path to construct StoredChunk with the new contentIntegrity argument.

The lookup only resolves an existing row ID and does not run write-time integrity verification, so contentIntegrity: nil is passed instead of fabricating metrics.

Reviewed by Cursor Bugbot for commit 9a1a39a. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix StoredChunk initializer call in BrainDatabase to pass contentIntegrity

The StoredChunk initializer in BrainDatabase.swift was missing a contentIntegrity argument, causing a compile error on main. The call site now passes contentIntegrity: nil explicitly as the third argument.

Macroscope summarized 9a1a39a.

#645 added `contentIntegrity` to `StoredChunk` and updated the write-with-readback
path (BrainDatabase.swift:1406) but not the lookup path at :4701, so `swift build`
fails with 22 errors across BrainBar and BrainBarDaemon. main does not compile.

It landed because the 7 admin merges of 2026-08-04 bypassed CI — the same cause as
the ruff drift fixed in #648. `--admin` skips the check that would have caught this.

`storedChunk()` is a LOOKUP of an existing row, not a write-with-readback: no
integrity comparison is performed there, so `nil` is the correct value rather than a
fabricated measurement. Verified: swift build → 0 errors.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 23 minutes

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 @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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 12266da9-688e-453f-b648-984e815b8705

📥 Commits

Reviewing files that changed from the base of the PR and between f9e28a5 and 9a1a39a.

📒 Files selected for processing (1)
  • brain-bar/Sources/BrainBar/BrainDatabase.swift

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.

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_6f6d4b4d-d7bf-4698-b19a-4e307734d3b5)

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@EtanHey

EtanHey commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Closing as obsolete — superseded by #646, and NOT merging it as a no-op.

Verified on current origin/main: both StoredChunk( construction sites already pass the parameter —
:1418 (contentIntegrity: contentIntegrity) and :4722 (contentIntegrity: nil). The Swift build is green: swift build0 errors on merged main.

⚠️ Merging this would NOT be a no-op — it would be a regression. Its diff against current main is 6 insertions, 73 deletions, because it was branched from a pre-#646 main. Merging it would revert #646's work, including its MCPRouterTests changes. So 'merge-as-noop' is not available here; close is the only correct disposition.

Why it existed at all — my error, recorded: I diagnosed main's broken Swift build and wrote this fix without first checking whether an open PR already addressed it. #646 already contained the identical contentIntegrity: nil change at the same call site. Check open PRs touching a file before writing a fix for that file.

Nothing is lost: the fix shipped in #646 (431ed831).

@EtanHey EtanHey closed this Aug 5, 2026
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