SUBTASK #63: Calculate confidence score (2.2.4.3)
Maintainers usually reply within 1 day
@Edgeless6 is already working on this.
Since Oct 30, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
Research direction
Start with the evidence weights and shared evidence record from #64, then read conflict resolution in #66 for Resolution.kept and count_points. Implement backend/services/scan/calculate_score.py and cover the listed cases in tests/services/scan/test_calculate_score.py. Done means the breakdown traces points to retained evidence, contributions use a fixed order, and the score stays between 0 and 100.
Written by the indexing model from the issue text.
Description
What to do
A pure function that turns the evidence kept by conflict resolution into a 0–100 confidence score, together with a breakdown showing exactly which evidence earned which points, so every part of the score traces to stored evidence (spec 7.1).
Background
- Spec 7.1: the score comes from the evidence stored for the device, runs from 0% to 100%, and "every part of a score shall trace to stored evidence."
- System design 2.2.4.3: "Sum the weights of retained evidence into 0% to 100%."
- Spec FR-10, OUT-02 (a score per device, with the evidence that produced it) and DI-08 (0 to 100).
- The input is
Resolution.keptfrom #66, so dropped (conflicting) evidence is never scored. - The counting rule (
count_points, each evidence type once) andMAX_SCOREare inevidence.py(#64, #66). - Rules are in #63.
Steps
-
ScoreBreakdownrecord incalculate_score.py:-
score: the final 0–100 whole number -
contributions: one entry per evidence type, with the points it added and the evidence behind it -
capped:Truewhen the points added up to more thanMAX_SCORE
-
-
calculate_score(kept) -> ScoreBreakdown, pure:- Points come from
count_points, the same function conflict resolution uses - The score is those points, capped at
MAX_SCORE - No evidence gives a score of 0, not an error
- Contributions come back in a fixed order (by evidence type), so the device detail page always lists them the same way
- Points come from
- Unit tests:
- No evidence: 0
- OUI evidence only: the OUI weight (20 with the agreed weights)
- Different evidence types add up
- Several pieces of one evidence type count once, and the breakdown lists all of them under that type
- More than 100 points: the score is 100 and
cappedisTrue - The contributions always add up to the uncapped points: nothing in the score comes from nowhere
- Built from a
Resolution, dropped evidence adds nothing - Over many generated evidence sets, the score is always a whole number from 0 to 100
Where
backend/services/scan/calculate_score.pytests/services/scan/test_calculate_score.py
Done when
- All the tests above pass without a database or network
- The score can't go outside 0 to 100, whatever evidence comes in
Depends on
- Evidence weights and the shared evidence record (#64)
- Resolve conflicting evidence (#66), for
count_pointsandResolution
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- Avg merge
- 9h 31m
- Merged PRs (30d)
- 36
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Bearkat-Professionals/Software-Engineering-Project
-
SUBTASK #86: Password hashing (BB-5)Possibly taken @Edgeless6 claimed this 1 day ago. Openbackend Low Priority subtask
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Bearkat-Professionals/Software-Engineering-Project#87 · 1 assignee ·
Maintainers usually reply within 1 day
-
Enhancement: Regression tests for Validate Input crash fixes (SH-1)Possibly taken @yoshi301 claimed this today. Openbackend Low Priority
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Bearkat-Professionals/Software-Engineering-Project#59 · 1 assignee ·
Maintainers usually reply within 1 day
-
SUBTASK #86: Manage user accounts (admin)Possibly taken @Edgeless6 claimed this 1 day ago. Openbackend Low Priority subtask
Difficulty 4/5 Over a week Newbie friendliness 20/100
Bearkat-Professionals/Software-Engineering-Project#92 · 1 assignee ·
Maintainers usually reply within 1 day
-
SUBTASK #86: Login screen and signed-in layoutPossibly taken @Solo-Her0 claimed this 1 day ago. Openfrontend Low Priority subtask
Difficulty 4/5 3-5 days Newbie friendliness 28/100
Bearkat-Professionals/Software-Engineering-Project#91 · 1 assignee ·
Maintainers usually reply within 1 day
-
SUBTASK #86: Sessions and route protection in the Application Controller (2.0)Possibly taken @javi120467 claimed this 1 day ago. Openbackend Low Priority security subtask
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Bearkat-Professionals/Software-Engineering-Project#90 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in Bearkat-Professionals/Software-Engineering-Project
Similar issues
-
Backend issue lists report in-patch warnings and out-of-patch errors as not publishablePossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mozilla/code-review#3794 ·
Maintainers usually reply within 1 day
-
[oblt-aw][autodoc] Update docs that still describe the security registry as emptyPossibly taken @github-actions claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
[Bug] adb backup script reports "Done" & exits 0 when the backup failsPossibly taken @bhattmanthan claimed this today. Openrequest-issue-assignment
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OWASP/mastg#4034 · 5 comments ·
Maintainers usually reply within 1 day
-
agent-ui bug p2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 72/100
acl-org/acl-anthology#10768 · 1 comment ·
Maintainers usually reply within 1 day