Deepen cryptotrace 4x: edge/error tests, 20 demos, value-coercion hardening#6
Open
cognis-digital wants to merge 1 commit into
Open
Deepen cryptotrace 4x: edge/error tests, 20 demos, value-coercion hardening#6cognis-digital wants to merge 1 commit into
cognis-digital wants to merge 1 commit into
Conversation
…labeler v5 Tests: 73 -> 290 (edge cases + error paths for parsing, clustering, common-input, change-address, peel chains, taint propagation, hop analysis, sanctions inheritance, SARIF export, CLI exit codes, connect emit). Demos: 5 -> 20 runnable scenarios (SARIF pipeline, offline feed enrichment, taint dilution, destination screening, false-positive audit, multi-source attribution, cluster risk scoring, JSONL + explorer ingest, malformed-input resilience, negative-export hardening, triple export, peel-chain forensics, single-address check, connect/emit) + 5 new fixtures + SCENARIO.md docs. Bug fixes / hardening (public API stable): - parse_txs + propagate_taint: a negative or non-finite (NaN/inf) value field silently became a neutral 1.0 weight, understating dirty-value totals. Now normalised to a finite, non-negative magnitude via _coerce_value; propagate_taint guards direct-API callers too. - analyze(): validates taint_threshold in [0,1] (clear ValueError) and clamps negative max_hops to 0; CLI surfaces these as exit-code-2 errors. Ops: migrate .github/labeler.yml v4 -> v5 (changed-files/any-glob-to-any-file); re-ignore demos/**/__pycache__ that the !demos/** negation was re-including; bump version 3.0.0 -> 3.1.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deepens the repo ~4x with real work across tests, demos, and hardening — public API unchanged.
Tests: 73 → 290
New edge-case and error-path coverage across five files:
test_edge_parsing.py— empty/garbage/JSONL/scalar inputs, field aliases (from/to/vin/vout/hash), explorer-object coercion, and the new value-coercion (negative/NaN/inf/string/null).test_edge_analysis.py— clustering corners (common-input, duplicate inputs, self-loops, change-address ambiguity, sort/ids/tx-count), sanctions inheritance + risk cap, hop-distance BFS bounds, taint haircut dilution and[0,1]invariants, peel-chain min-length/cycle/reuse.test_edge_sarif_cli.py— SARIF rule dedupe/index/levels/fingerprints/empty-run, and CLI exit codes + error paths (missing files → 2, bad--min-taint→ 2, flagged → 1).test_edge_model_feeds.py—Transaction/Finding/Cluster/TraceResultserialization, SDN-table integrity, all bundled fixtures parse+analyze, feeds-parser corners.test_edge_render_connect.py/test_edge_severity_sdn.py— table rendering, connect/emit mapping, determinism/no-mutation, severity-grading boundaries, per-entity SDN coverage.python -m pytest -q→ 290 passed.Demos: 5 → 20
15 new runnable scenarios (each exits 0, offline,
PYTHONUTF8=1-safe): SARIF pipeline, offline feed enrichment, taint dilution, destination screening, false-positive audit, multi-source attribution, cluster risk scoring, JSONL + explorer ingest, malformed-input resilience, negative-export hardening, triple export, peel-chain forensics, single-address check, connect/emit. Adds 5 new fixtures (+SCENARIO.md), updatesrun_all.pyanddocs/DEMOS.md.Bug fixes / hardening (API stable)
parse_txsandpropagate_taintsilently turned a negative orNaN/infvalue field into a neutral1.0weight, understating dirty-value totals. Now normalised to a finite, non-negative magnitude via_coerce_value;propagate_taintguards direct-API callers too.analyze()validation: rejects out-of-rangetaint_thresholdwith a clearValueError, clamps negativemax_hopsto 0; CLI surfaces these as exit-code-2 errors.Ops
.github/labeler.ymlv4 → v5 schema (also committed tomainso the label check is green), add ademoslabel.demos/**/__pycache__that the!demos/**negation was re-including.