Skip to content

feat(modules): bridge fingerprint modules into framework detection#359

Open
TBX3D wants to merge 9 commits into
vmfunc:mainfrom
TBX3D:feat/dialect-bridge-core
Open

feat(modules): bridge fingerprint modules into framework detection#359
TBX3D wants to merge 9 commits into
vmfunc:mainfrom
TBX3D:feat/dialect-bridge-core

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

a fingerprint module (feat: add fingerprint module type, this PR's first three commits) and a framework detector can independently identify the same technology, which would surface it twice in a scan's output. this bridges default-confidence, root-scoped fingerprint modules into the framework detector registry, so a fingerprint hit that matches a framework detector's own coverage is deduplicated rather than double-reported, and marks the legacy custom-signature (signatures dir) path as deprecated in favor of fingerprint modules going forward without removing it. covered by tests proving the fingerprint and framework confidence scorers agree on shared inputs, pinning the zero-weight divergence and strict-detection-threshold edge cases, and freezing the legacy signature path's existing load/score behavior so this doesn't quietly change it.

stacked on #355 (shared sifpath/httpx helpers) and #356 (fingerprint module type) - both open. this branch includes their commits so it builds standalone; rebasing after they merge should drop those commits as already-applied.

TBX3D added 8 commits July 9, 2026 15:31
the modules loader and the framework custom-signature loader each
hand-rolled the same ~/.config/sif/<sub> (and %LocalAppData%\sif\<sub>
on windows) path. extract internal/sifpath.UserSubdir and route both
through it so the per-user layout is defined in one place.

no behavior change: the helper reproduces the existing paths exactly.
the frameworks detector and the module executor each defined their own
5 MB body cap and ran the same io.ReadAll(io.LimitReader(...)) read. move
the cap and the read into httpx.MaxBodySize / httpx.ReadCappedBody so both
scanners share one ceiling instead of two consts that can drift.

no behavior change: the cap value and read semantics are unchanged.
a `fingerprint` module identifies a technology by weighted body/header
signatures scored into a confidence, with an optional version regex, rather
than a boolean match. it fires one finding carrying the score once it reaches
the threshold (default 0.5). this is the framework detectors' scoring in the
module format, so a custom tech fingerprint lives alongside other modules.

validated at load (signatures present, non-empty patterns, finite weights,
confidence in [0,1], version regex compiles) and covered by yaml round-trip,
validation, header, version and default-threshold tests. documented in
docs/modules.md. shares the response body cap via httpx.ReadCappedBody.
@TBX3D TBX3D requested a review from vmfunc as a code owner July 9, 2026 22:59
@github-actions github-actions Bot added size/xl 500+ lines changed scan changes to scan engine modules changes to scan modules docs documentation changes tests test changes labels Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

pr summary

18 files changed (+1089 -46)

category files
go source 17
tests 7

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 73.68421% with 40 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7ea1cd2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/modules/bridge.go 60.97% 14 Missing and 2 partials ⚠️
internal/modules/fingerprint.go 86.04% 6 Missing and 6 partials ⚠️
internal/modules/yaml.go 55.55% 3 Missing and 1 partial ⚠️
internal/sifpath/sifpath.go 42.85% 2 Missing and 2 partials ⚠️
internal/httpx/httpx.go 0.00% 2 Missing ⚠️
internal/modules/loader.go 33.33% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #359   +/-   ##
=======================================
  Coverage        ?   55.20%           
=======================================
  Files           ?       84           
  Lines           ?     7009           
  Branches        ?        0           
=======================================
  Hits            ?     3869           
  Misses          ?     2863           
  Partials        ?      277           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TBX3D TBX3D force-pushed the feat/dialect-bridge-core branch from e2ba979 to 76ae304 Compare July 9, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs documentation changes modules changes to scan modules scan changes to scan engine size/xl 500+ lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants