Skip to content

fix(score): give Upload and WebPage explicit source weights - #181

Merged
senamakel merged 1 commit into
mainfrom
fix-source-weight-test
Oct 1, 2026
Merged

senamakel merged 1 commit into
mainfrom
fix-source-weight-test

Conversation

@senamakel

@senamakel senamakel commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Root cause: DataSource gained Upload and WebPage in the contract crate with no entry in weight_for_explicit, so the guard test every_data_source_has_an_explicit_weight failed on main (it reported upload, web_page).

Fix: add explicit weights (Upload 0.7, matching the Document default; WebPage 0.6, alongside mixed-provenance Drive docs). The guard test is unchanged.

Verified locally: fmt, clippy -D warnings, cargo test --all-features, the feature matrix (no-default, tokio, git-diff, sync, persona, all), and rustdoc -D warnings.

Note: the single commit's subject was written by the auto-commit hook; the change is only the two match arms in source_weight.rs.

Co-authored-by: Medulla medulla@tinyhumans.ai

Summary by CodeRabbit

  • Bug Fixes
    • Memory scoring now applies explicit weights to uploaded content and web pages.

The source weight calculation was incorrectly handling negative signal values, causing the weight to be computed as zero when it should have been proportional to the signal magnitude. This fix ensures that the absolute value of the signal is used in the weight calculation, preserving the intended behavior where stronger signals, regardless of direction, contribute more to the source weight.

Auto-committed-on: dragonfly
@tinysweeper

tinysweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Incomplete
Priority: none
Reviewed head: 2624ee727fd9
Updated: 1790879942 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 1 Active findings 0
Tests 0 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 5

Completeness: Incomplete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

  • Unreviewed: tinysweeper/tests

Findings

No active actionable findings.

Could not review: src/memory/score/signals/source_weight.rs, tinysweeper/description, tinysweeper/e2e, tinysweeper/tests

Before merge

  • Complete the critique review for src/memory/score/signals/source_weight.rs.
  • Complete the security review for src/memory/score/signals/source_weight.rs.
  • Complete the tests review for tinysweeper/tests.
  • Complete the description review for tinysweeper/description.
  • Complete the e2e review for tinysweeper/e2e.

How this fits together

flowchart LR
  n0["weight_for_explicit<br/>changed"]:::changed
  n1["weight_for"]:::impacted
  n2["kind_default"]:::impacted
  n3["score"]:::impacted
  n4["every_data_source_has_an_explicit_weight"]:::impacted
  n5["infer_data_source"]:::impacted
  n1 -->|calls| n0
  n1 -->|calls| n2
  n3 -->|calls| n1
  n3 -->|calls| n2
  n3 -->|calls| n5
  n4 -->|calls| n0
  n4 -->|tests| n0
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: src/memory/score/signals/source_weight.rs
  • Lane summary: Reviewed 0 files; 0 findings. 1 file could not be reviewed: src/memory/score/signals/source_weight.rs.

security

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: src/memory/score/signals/source_weight.rs
  • Lane summary: Reviewed 0 files; 0 findings. 1 file could not be reviewed: src/memory/score/signals/source_weight.rs.

tests

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: tinysweeper/tests
  • Lane summary: No reviewer could be consulted.

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: tinysweeper/description
  • Lane summary: No reviewer could be consulted.

e2e

  • Conclusion: Success
  • Scope reviewed: incomplete; unanswered: tinysweeper/e2e
  • Lane summary: No reviewer could be consulted; only the job states below are reported. _The code index is behind this pull request (indexed at `239a360f28b2`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._
Evidence and run details
  • Models: ladder/vectors
  • Spend: $0.000001
  • Tokens: 0 input · 0 output · 0 cached · 91 embedding
Head State Pass summary
2624ee727fd9 incomplete 0 active finding(s), 0 resolved finding(s) (at 1790879942)

tinysweeper 0.1.0

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T18:40:11.198141Z 2624ee7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c478b42a-019d-4039-8ca2-696467dd865c

📥 Commits

Reviewing files that changed from the base of the PR and between 2ffca27 and 2624ee7.

📒 Files selected for processing (1)
  • src/memory/score/signals/source_weight.rs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The explicit source weight mapping now assigns weights of 0.7 to uploads and 0.6 to web pages.

Changes

Explicit source weights

Layer / File(s) Summary
Add explicit source weights
src/memory/score/signals/source_weight.rs
weight_for_explicit now assigns a weight of 0.7 to uploads and 0.6 to web pages.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 2624e

Uploads retain their prior score, and web pages receive an explicit 0.6 weight. The available evidence does not show that this intended scoring change violates a repository contract, so no actionable merge risk is established.

Architecture Summary

Architecture risk: 🔵 Low · up to 2624e

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/memory/score/signals/source_weight.rs: weight_for_explicit now gives uploads a weight of 0.7 and web pages 0.6; the added comments describe their provenance relative to existing source weights.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding explicit source weights for Upload and WebPage.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
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 docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


A rabbit checks the source weights with care
Uploads get 0.7 in their share
Web pages get 0.6
The mapping keeps its ticks
Then hops away with carrots to spare

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

@tinysweeper tinysweeper 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.

tinysweeper found nothing blocking, but could not review everything, so this is not an approval: src/memory/score/signals/source_weight.rs, tinysweeper/description, tinysweeper/e2e, tinysweeper/tests.

$0.0000 · 0 in / 0 out · 91 embedded · ladder/vectors

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 1, 2026
@senamakel
senamakel merged commit 9bbabd7 into main Oct 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant