SUBTASK #63: Assign identification level (2.2.4.4)
Maintainers usually reply within 1 day
@javi120467 is already working on this.
Since Oct 30, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
Research direction
Start with backend/services/scan/evidence.py and the existing IdentificationLevel, ScoreBreakdown, and resolution definitions referenced in the issue; then review the rules in issue #63. Implement the pure function in backend/services/scan/assign_level.py and cover the listed cases in tests/services/scan/test_assign_level.py. Done means all listed unit tests pass without a database or network, and every result has a level, type, and vendor.
Written by the indexing model from the issue text.
Description
What to do
A pure function that takes the outcome of conflict resolution, the score and the OUI vendor, and decides how well the device is identified (identified, partially identified or unidentified), along with the name, type, model and vendor to show. A device with no known type gets the "unknown" type.
Background
- System design 2.2.4.4: "Classify as identified, partially identified, or unidentified and set name, type, model, and vendor (type defaults to 'unknown')."
- Spec 7.2: identified shows name, type and model where known; partially identified (generic) shows type and vendor only; unidentified shows "Unknown".
- Spec FR-05, FR-08 (classify as unknown when information is insufficient) and DI-03 (type defaults to unknown).
IdentificationLevelis inbackend/records/enums.py(#39). The identified thresholdIDENTIFIED_MIN_SCOREis inevidence.py(#64).- The level is never stored. It's worked out again from the evidence each time, and SH-4.1 (
evaluate_flag) uses it to set the flag. - Rules are in #63.
Steps
-
UNKNOWN_TYPE_ID = 1andUNKNOWN_VENDOR_ID = 1inevidence.py, matching the seeded "unknown" rows andUNKNOWN_IDin reference data (#16) -
Identificationrecord inassign_level.py:level,device_type_id,vendor_id,device_name,model,score(theScoreBreakdownfrom #67) -
assign_level(resolution, score, vendor_id) -> Identification, pure, using the levels agreed on #63:- Identified: a type won, one of its matches gives a device name, and the score is at least
IDENTIFIED_MIN_SCORE - Partially identified: not identified, but the type or the vendor is known
- Unidentified: neither the type nor the vendor is known
- No winning type:
device_type_idisUNKNOWN_TYPE_ID. No OUI vendor:vendor_idisUNKNOWN_VENDOR_ID. - Name and model come from the winning matches: the match with the highest weight that has a name; on a tie, the lowest signature id. The model comes from the same match when it has one, otherwise from the next match in that order that does.
- The vendor only ever comes from the OUI match; signatures don't set it
- Identified: a type won, one of its matches gives a device name, and the score is at least
- Unit tests, with hand-made resolutions and scores:
- No evidence at all: unidentified, unknown type and vendor, no name
- OUI vendor only: partially identified, unknown type (M2's provisional rule, now real)
- A type but no name: partially identified
- A type and name with a score at the threshold: identified
- A type and name with a score one point below the threshold: partially identified
- Tied types (no winner) with an OUI vendor: partially identified, unknown type
- Two winning matches with different names: the choice follows the rule above and doesn't depend on input order
- A model taken from the next match when the named match has none
-
UNKNOWN_TYPE_IDandUNKNOWN_VENDOR_IDequalUNKNOWN_IDin reference data
Where
backend/services/scan/assign_level.pybackend/services/scan/evidence.py(add the two unknown ids)tests/services/scan/test_assign_level.py
Done when
- All the tests above pass without a database or network
- Every device gets a level, a type and a vendor; "unknown" is used, never
None
Depends on
- Evidence weights and the shared evidence record (#64)
- Resolve conflicting evidence (#66) and Calculate confidence score (#67)
- Evaluate Flag SH-4.1 (#39), for
IdentificationLevel: done
- 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
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Documentation#2838 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · 1 comment ·
-
`SubAgents` returns a child run's `DeferredToolRequests` to the parent as a successful tool resultOpenbug pkg:harness
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pydantic/pydantic-ai#12405 ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 82/100