flawed 0.7.2__tar.gz → 0.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flawed-0.7.2 → flawed-0.7.3}/.gitignore +1 -10
- {flawed-0.7.2 → flawed-0.7.3}/CHANGELOG.md +51 -1
- {flawed-0.7.2 → flawed-0.7.3}/PKG-INFO +8 -2
- {flawed-0.7.2 → flawed-0.7.3}/README.md +4 -0
- {flawed-0.7.2 → flawed-0.7.3}/pyproject.toml +7 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/__init__.py +33 -6
- flawed-0.7.3/src/flawed/_cli/_code_signature.py +114 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/_observability.py +33 -3
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/app.py +256 -10
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/explore.py +78 -12
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/output.py +156 -10
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/pipeline.py +147 -57
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/provider_engine_cache.py +93 -13
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/result_cache.py +142 -26
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/ribrarian_bridge.py +1 -3
- flawed-0.7.3/src/flawed/_cli/routes.py +207 -0
- flawed-0.7.3/src/flawed/_cli/rules.py +1163 -0
- flawed-0.7.3/src/flawed/_cli/scaffold.py +112 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/scan_record.py +6 -0
- flawed-0.7.3/src/flawed/_cli/shell.py +721 -0
- flawed-0.7.3/src/flawed/_config/lock.py +121 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/__init__.py +6 -10
- flawed-0.7.3/src/flawed/_index/_bindings.py +362 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_pipeline.py +28 -6
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_resolution.py +174 -4
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_schema_lock.json +2 -2
- flawed-0.7.3/src/flawed/_index/_source.py +58 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_structural.py +155 -4
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_type_enrichment.py +34 -3
- flawed-0.7.3/src/flawed/_index/_valueflow.py +983 -0
- flawed-0.7.3/src/flawed/_rules/__init__.py +23 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_rules/endpoints.py +2 -2
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_rules/request_inputs.py +2 -2
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_rules/route_guards.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_rules/type_disagreements.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_rules/value_flow.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_rules_smoke/__init__.py +6 -6
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/__init__.py +240 -52
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_alias_resolution.py +92 -11
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_auth_inference.py +189 -8
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_branch.py +118 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_budget.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_cfgview.py +19 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_check_conversion.py +6 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_collections.py +97 -16
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_condition_conversion.py +8 -3
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_container_argument_inputs.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_conversion.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_dependency_conversion.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_dispatch_conversion.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_effect_conversion.py +5 -4
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_enriched.py +16 -1
- flawed-0.7.3/src/flawed/_semantic/_entity_writes.py +326 -0
- flawed-0.7.3/src/flawed/_semantic/_flag_branches.py +437 -0
- flawed-0.7.3/src/flawed/_semantic/_flow_edge_cache.py +141 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_flow_engine.py +154 -12
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_flow_index.py +70 -18
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_flow_tracer.py +584 -68
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_input_conversion.py +257 -58
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_lifecycle_conversion.py +165 -17
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_matching.py +625 -9
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_membership_inputs.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_method_dispatch.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_property_setter_dispatch.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_provider_engine.py +14 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_route_conversion.py +338 -16
- flawed-0.7.3/src/flawed/_semantic/_router_groups.py +589 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_safe_generated_url_conversion.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_scope.py +2 -2
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_sink_conversion.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_structural_url_guard.py +2 -2
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_table_dispatch.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_type_disagreement_conversion.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_validation_guard_conversion.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/_base.py +64 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_core.py +30 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_httpauth.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_login.py +3 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_restx.py +40 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_sqlalchemy.py +16 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_wtf.py +3 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/itsdangerous_.py +18 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/marshmallow_.py +11 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/pydantic_.py +12 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/pymongo_.py +11 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/pyotp_.py +13 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/requests_.py +13 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/sqlalchemy_orm.py +14 -4
- flawed-0.7.3/src/flawed/_session.py +407 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/calls.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/collections.py +36 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/conditions.py +86 -3
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/core.py +8 -7
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/effects.py +10 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/findings.py +135 -4
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/flow.py +10 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/inputs.py +1 -1
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/route.py +25 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/scopes.py +5 -1
- flawed-0.7.2/src/flawed/_cli/_code_signature.py +0 -62
- flawed-0.7.2/src/flawed/_cli/rules.py +0 -621
- flawed-0.7.2/src/flawed/_config/lock.py +0 -81
- flawed-0.7.2/src/flawed/_index/_valueflow.py +0 -518
- flawed-0.7.2/src/flawed/_rules/__init__.py +0 -23
- flawed-0.7.2/src/flawed/_semantic/_router_groups.py +0 -360
- {flawed-0.7.2 → flawed-0.7.3}/LICENSE +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/__init__.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/_common.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/_profile_metrics.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/_profile_phases.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/_profile_summaries.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/inspect.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/inspect_commands.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/profile.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/provider_coverage.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/suppression.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_cli/target.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_config/__init__.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_config/loader.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_config/match.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_config/merge.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_config/paths.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_config/schema.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_brains/__init__.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_brains/brain_flask.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_brains/brain_flask_login.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_brains/brain_flask_restful.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_brains/brain_flask_restx.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_brains/brain_sqlalchemy.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_brains/brain_wtforms.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_callgraph.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_cfg.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_collections.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_dominance.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_graphs.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_invariants.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_mypy_batch_oracle.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_parsing.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_spans.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_types.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_vendor/__init__.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_index/_vendor/numba_controlflow.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_process.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_callee_graph.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_conversion_utils.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_expr_cache.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_flow_propagation.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_predicate_eval.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_proxy_flow.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/_value_definition.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/__init__.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/argon2_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/authlib_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/bcrypt_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/bleach_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/bottle_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/cryptography_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/defusedxml_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/django_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/django_allauth.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/django_cors.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/djangorestframework_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/falcon_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/fastapi_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_allows.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_caching.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_cors.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_jwt_extended.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_limiter.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_mail.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_restful.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_session.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/flask_talisman.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/httpx_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/jsonschema_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/litestar_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/oauthlib_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/passlib_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/peewee_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/psycopg2_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/pycasbin_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/pyjwt.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/pymysql_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/pyramid_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/python_jose.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/python_stdlib.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/quart_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/redis_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/sanic_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/secure_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/sqlmodel_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/starlette_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/_semantic/providers/tornado_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/blueprint.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/checks.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/class_.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/correlation.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/detector.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/disagreement.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/evidence.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/function.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/generated.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/py.typed +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/repo.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/severity.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/sinks.py +0 -0
- {flawed-0.7.2 → flawed-0.7.3}/src/flawed/validation.py +0 -0
|
@@ -30,15 +30,6 @@ venv/
|
|
|
30
30
|
# OS
|
|
31
31
|
.DS_Store
|
|
32
32
|
|
|
33
|
-
#
|
|
34
|
-
CLAUDE.local.md
|
|
35
|
-
AGENTS.override.md
|
|
36
|
-
.claude/worktrees/
|
|
37
|
-
.claude/scheduled_tasks.json
|
|
38
|
-
.claude/scheduled_tasks.lock
|
|
39
|
-
|
|
40
|
-
# Agent scratch, caches, results
|
|
33
|
+
# Scratch, caches, results
|
|
41
34
|
local/
|
|
42
35
|
|
|
43
|
-
# Task backlog
|
|
44
|
-
plan/
|
|
@@ -4,6 +4,54 @@ All notable changes to flawed are documented here. The format is based on
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
|
|
5
5
|
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.7.3] - 2026-12-02
|
|
10
|
+
|
|
11
|
+
### Upgrading
|
|
12
|
+
|
|
13
|
+
- The cache format changed. The first run on each repository rebuilds it.
|
|
14
|
+
- `Provenance.interpreter` is renamed to `Provenance.origin_phase`.
|
|
15
|
+
- Some `flows_to` results change from `True` to `False`, because local variables
|
|
16
|
+
no longer leak between functions. Check `FlowTrace.gaps` when a result is `False`.
|
|
17
|
+
- `request.authorization` and similar Flask attributes are now `Header(...)` inputs.
|
|
18
|
+
- `--json` output lists ambient gaps once, in `gap_summary`, instead of on every
|
|
19
|
+
finding.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- `flawed shell`: an IPython session with the repo, rules and findings loaded.
|
|
24
|
+
`%rerun` reruns the rules you edited. Requires `pip install "flawed[shell]"`.
|
|
25
|
+
- `flawed new-rule` creates a rule template. `flawed routes` lists routes and
|
|
26
|
+
their gaps.
|
|
27
|
+
- `flawed explore` options: `--severity`, `--min-severity`, `--path`, `-C N`.
|
|
28
|
+
- `--rules-dir` can be a package, so rules can import shared helpers.
|
|
29
|
+
- `open_repo()` saves its index to disk and reuses it.
|
|
30
|
+
- Flask-RESTX routes: `@ns.route`, `api.add_resource`, namespace prefixes.
|
|
31
|
+
- ORM attribute writes followed by a commit are `DB_WRITE` effects.
|
|
32
|
+
- Provisional API for CSRF-style exemptions: `Condition.relaxes()`,
|
|
33
|
+
`Condition.continues_after()`, `Route.protected_by()`, `Effect.exempts`. These
|
|
34
|
+
may change.
|
|
35
|
+
- `FlowTrace.ruled_out_by`, `TaintSinkCollection.gaps`,
|
|
36
|
+
`FindingCollection.gap_summary`.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- Several reads from the same request container (`request.form["a"]`,
|
|
41
|
+
`request.form["b"]`) are tracked separately. Before, earlier reads were lost.
|
|
42
|
+
- Subscript keys are tracked: `USERS[request.args["id"]]` depends on `id`.
|
|
43
|
+
- Hooks such as `before_request` and error handlers registered inside app-factory
|
|
44
|
+
helpers now apply to the app's routes.
|
|
45
|
+
- An incremental rebuild gives the same result as a full build.
|
|
46
|
+
- `scope.sinks()` reports gaps instead of dropping sinks it could not decide.
|
|
47
|
+
- More code that cannot be analyzed is reported as a gap instead of skipped.
|
|
48
|
+
|
|
49
|
+
### Known issues
|
|
50
|
+
|
|
51
|
+
- A variable assigned twice in a function carries both values at every use.
|
|
52
|
+
- A call to a project function is treated as depending on its arguments, even when
|
|
53
|
+
it returns a constant.
|
|
54
|
+
|
|
7
55
|
## [0.7.2] - 2026-06-07
|
|
8
56
|
|
|
9
57
|
### Added
|
|
@@ -45,7 +93,7 @@ PyPI publishing via GitHub Actions trusted publishing.
|
|
|
45
93
|
- Always-on local scan record (`runs.jsonl` plus a per-repo `scan_metrics.jsonl`),
|
|
46
94
|
written locally with no network or telemetry; opt out with
|
|
47
95
|
`observability_enabled: false`.
|
|
48
|
-
- Additional framework providers
|
|
96
|
+
- Additional framework providers.
|
|
49
97
|
|
|
50
98
|
### Changed
|
|
51
99
|
|
|
@@ -78,6 +126,8 @@ Initial public release — flawed as a Python library.
|
|
|
78
126
|
conservative (a negative means "not proven", never "provably safe").
|
|
79
127
|
- Per-repository Layer 1 index caching, so repeat runs skip extraction.
|
|
80
128
|
|
|
129
|
+
[Unreleased]: https://github.com/execveat/flawed/compare/v0.7.3...HEAD
|
|
130
|
+
[0.7.3]: https://github.com/execveat/flawed/releases/tag/v0.7.3
|
|
81
131
|
[0.7.2]: https://github.com/execveat/flawed/releases/tag/v0.7.2
|
|
82
132
|
[0.7.1]: https://github.com/execveat/flawed/releases/tag/v0.7.1
|
|
83
133
|
[0.7.0]: https://github.com/execveat/flawed/releases/tag/v0.7.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: flawed
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.3
|
|
4
4
|
Summary: Static analysis engine for Python web applications
|
|
5
5
|
Project-URL: Homepage, https://github.com/execveat/flawed
|
|
6
6
|
Project-URL: Repository, https://github.com/execveat/flawed
|
|
@@ -29,6 +29,8 @@ Requires-Dist: libcst>=1.0
|
|
|
29
29
|
Requires-Dist: pathspec>=0.12
|
|
30
30
|
Requires-Dist: pyyaml>=6.0
|
|
31
31
|
Requires-Dist: rich>=13.0
|
|
32
|
+
Provides-Extra: shell
|
|
33
|
+
Requires-Dist: ipython>=8.0; extra == 'shell'
|
|
32
34
|
Description-Content-Type: text/markdown
|
|
33
35
|
|
|
34
36
|
# flawed
|
|
@@ -129,6 +131,10 @@ install-hooks` copies it into the repository's git hooks directory (idempotent,
|
|
|
129
131
|
and worktree-aware). Edit the tracked file and reinstall — never edit the copy
|
|
130
132
|
under `.git/hooks/` directly.
|
|
131
133
|
|
|
134
|
+
Run tests through `mise run test` (or `mise run check`) rather than invoking
|
|
135
|
+
`pytest` directly: `tools/quality.py` owns the pytest flags, the testmon
|
|
136
|
+
selection and the slow-test deselection.
|
|
137
|
+
|
|
132
138
|
## Configuration
|
|
133
139
|
|
|
134
140
|
Global config: `~/.config/flawed/config.yaml`
|
|
@@ -96,6 +96,10 @@ install-hooks` copies it into the repository's git hooks directory (idempotent,
|
|
|
96
96
|
and worktree-aware). Edit the tracked file and reinstall — never edit the copy
|
|
97
97
|
under `.git/hooks/` directly.
|
|
98
98
|
|
|
99
|
+
Run tests through `mise run test` (or `mise run check`) rather than invoking
|
|
100
|
+
`pytest` directly: `tools/quality.py` owns the pytest flags, the testmon
|
|
101
|
+
selection and the slow-test deselection.
|
|
102
|
+
|
|
99
103
|
## Configuration
|
|
100
104
|
|
|
101
105
|
Global config: `~/.config/flawed/config.yaml`
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "flawed"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.3"
|
|
8
8
|
description = "Static analysis engine for Python web applications"
|
|
9
9
|
requires-python = ">=3.12"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -35,6 +35,9 @@ dependencies = [
|
|
|
35
35
|
"rich>=13.0",
|
|
36
36
|
]
|
|
37
37
|
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
shell = ["ipython>=8.0"]
|
|
40
|
+
|
|
38
41
|
# ribrarian: optional private integration, reached via the guarded import in
|
|
39
42
|
# src/flawed/_cli/ribrarian_bridge.py (not published).
|
|
40
43
|
|
|
@@ -47,6 +50,9 @@ dev = [
|
|
|
47
50
|
"ruff>=0.8",
|
|
48
51
|
"import-linter>=2.1",
|
|
49
52
|
"types-PyYAML>=6.0",
|
|
53
|
+
# Runtime-optional (the `shell` extra), but dev/CI needs it installed to
|
|
54
|
+
# type-check and test the IPython path in src/flawed/_cli/shell.py.
|
|
55
|
+
"ipython>=8.0",
|
|
50
56
|
]
|
|
51
57
|
|
|
52
58
|
[project.scripts]
|
|
@@ -20,14 +20,17 @@ import warnings
|
|
|
20
20
|
from importlib.metadata import version as _pkg_version
|
|
21
21
|
from typing import TYPE_CHECKING
|
|
22
22
|
|
|
23
|
-
from flawed._semantic import repo_view_from_artifacts
|
|
23
|
+
from flawed._semantic import repo_view_from_artifacts
|
|
24
|
+
from flawed._session import CachePersistenceWarning
|
|
25
|
+
from flawed._session import open_repo_view as _open_repo_view
|
|
24
26
|
from flawed.calls import Argument, CallSite, Fn
|
|
25
27
|
from flawed.conditions import Check
|
|
26
28
|
from flawed.detector import detector
|
|
27
29
|
from flawed.effects import Effect
|
|
28
|
-
from flawed.findings import FindingCollection, load_findings
|
|
30
|
+
from flawed.findings import AmbientGap, FindingCollection, GapSummary, load_findings
|
|
29
31
|
from flawed.inputs import InputRead, InputSource
|
|
30
32
|
from flawed.repo import RepoView
|
|
33
|
+
from flawed.route import HttpMethod
|
|
31
34
|
from flawed.severity import Severity
|
|
32
35
|
|
|
33
36
|
if TYPE_CHECKING:
|
|
@@ -76,7 +79,7 @@ def open_repo(path: str, *, artifact_root: str | Path | None = None) -> RepoView
|
|
|
76
79
|
"""Load an analyzed repository and return the top-level navigation object.
|
|
77
80
|
|
|
78
81
|
Constructs a Code Index (Layer 1), runs the Semantic Layer
|
|
79
|
-
|
|
82
|
+
providers (Layer 2), and returns a :class:`RepoView` -- the
|
|
80
83
|
single entry point for all navigation and detection.
|
|
81
84
|
|
|
82
85
|
Args:
|
|
@@ -94,16 +97,36 @@ def open_repo(path: str, *, artifact_root: str | Path | None = None) -> RepoView
|
|
|
94
97
|
Warns:
|
|
95
98
|
RoutelessRepoWarning: if the repo has functions but zero detected
|
|
96
99
|
routes (likely a wrong target path or unsupported framework).
|
|
100
|
+
CachePersistenceWarning: if the open had to build in memory without
|
|
101
|
+
using or writing the on-disk cache (see Note). Filter it like any
|
|
102
|
+
warning: ``warnings.simplefilter("ignore", flawed.CachePersistenceWarning)``.
|
|
97
103
|
|
|
98
104
|
Note:
|
|
99
105
|
Repeated calls for the same unchanged tree reuse an in-process cache
|
|
100
|
-
(FLAW-132)
|
|
101
|
-
|
|
106
|
+
(FLAW-132). A fresh process loads the on-disk L1/L2 caches the CLI
|
|
107
|
+
writes (FLAW-378) when the L1 cache key matches the current source --
|
|
108
|
+
roughly CLI-warm time. When the L1 cache is stale or missing, the open
|
|
109
|
+
builds the model **and persists it** (FLAW-402), so the next process
|
|
110
|
+
hits; a cold first open still pays the full build once.
|
|
111
|
+
|
|
112
|
+
Cache access follows the CLI's locking: a per-repo lock, shared for a
|
|
113
|
+
warm read and exclusive for a rebuild, so a concurrent ``flawed scan``
|
|
114
|
+
or another ``open_repo`` never sees a half-written cache. If another
|
|
115
|
+
process holds the lock, the open **waits** (up to 600 seconds, logging
|
|
116
|
+
that it is waiting). If the wait runs out, or the cache directory is not
|
|
117
|
+
writable, it builds the model in memory instead, persists nothing and
|
|
118
|
+
says so loudly -- a ``CachePersistenceWarning`` and a ``WARNING`` log
|
|
119
|
+
record; the returned view is complete either way. While an open holds
|
|
120
|
+
the exclusive lock to rebuild, a concurrent cold ``flawed scan`` of the
|
|
121
|
+
same repo fails fast with a lock-held error.
|
|
122
|
+
|
|
123
|
+
The ``artifact_root`` path bypasses all of this (loading committed
|
|
124
|
+
artifacts is already cheap).
|
|
102
125
|
"""
|
|
103
126
|
if artifact_root is not None:
|
|
104
127
|
view: RepoView = repo_view_from_artifacts(path, artifact_root)
|
|
105
128
|
else:
|
|
106
|
-
view =
|
|
129
|
+
view = _open_repo_view(path)
|
|
107
130
|
message = _routeless_warning(len(view.functions), len(view.routes), path)
|
|
108
131
|
if message is not None:
|
|
109
132
|
warnings.warn(message, RoutelessRepoWarning, stacklevel=2)
|
|
@@ -111,12 +134,16 @@ def open_repo(path: str, *, artifact_root: str | Path | None = None) -> RepoView
|
|
|
111
134
|
|
|
112
135
|
|
|
113
136
|
__all__ = [
|
|
137
|
+
"AmbientGap",
|
|
114
138
|
"Argument",
|
|
139
|
+
"CachePersistenceWarning",
|
|
115
140
|
"CallSite",
|
|
116
141
|
"Check",
|
|
117
142
|
"Effect",
|
|
118
143
|
"FindingCollection",
|
|
119
144
|
"Fn",
|
|
145
|
+
"GapSummary",
|
|
146
|
+
"HttpMethod",
|
|
120
147
|
"InputRead",
|
|
121
148
|
"InputSource",
|
|
122
149
|
"RepoView",
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"""Shared analysis-code signature for the disk caches (FLAW-189, FLAW-198).
|
|
2
|
+
|
|
3
|
+
Both disk caches that persist analysis output — the Layer-2 provider-engine
|
|
4
|
+
cache (:mod:`flawed._cli.provider_engine_cache`) and the per-detector results
|
|
5
|
+
cache (:mod:`flawed._cli.result_cache`) — must invalidate when the *analysis
|
|
6
|
+
source that determines their stored value* changes. ``_PIPELINE_VERSION`` only
|
|
7
|
+
tracks Layer 1 and is bumped by hand; ``flawed.__version__`` only moves on a
|
|
8
|
+
release. Neither catches a mid-development edit to ``_semantic`` matching, a
|
|
9
|
+
provider, or an L3 rule-API module — exactly the edits that change findings.
|
|
10
|
+
|
|
11
|
+
This module is the **single source of truth** for "hash this analysis source",
|
|
12
|
+
so the two caches cannot drift into two subtly-different notions of "did the
|
|
13
|
+
engine change". Each cache calls :func:`code_signature` with the set of source
|
|
14
|
+
roots whose contents affect *its* stored value:
|
|
15
|
+
|
|
16
|
+
* the provider-engine cache (an L2 artifact) hashes ``_index`` + ``_semantic`` +
|
|
17
|
+
``core`` — the layers whose types appear in its pickled graph;
|
|
18
|
+
* the results cache (final per-detector findings) hashes a broader set, adding
|
|
19
|
+
the Layer 3 rule-API core and the shared ``_rules`` helpers, because a finding
|
|
20
|
+
depends on all of those.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
import functools
|
|
26
|
+
import hashlib
|
|
27
|
+
from pathlib import Path
|
|
28
|
+
from typing import TYPE_CHECKING
|
|
29
|
+
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from flawed._config.schema import ResolvedConfig
|
|
32
|
+
|
|
33
|
+
#: Glob (relative to the ``flawed`` package root) over the Layer 1 extraction
|
|
34
|
+
#: source. Its content hash (``extraction_code_signature``) was the L1 cache's
|
|
35
|
+
#: identity gate (FLAW-207); under FLAW-344 (scheme C) it is **demoted to recorded
|
|
36
|
+
#: provenance** — the gate is now ``L1_SCHEMA_VERSION`` + the record-schema
|
|
37
|
+
#: fingerprint, so a behaviour-preserving ``_index`` refactor no longer
|
|
38
|
+
#: invalidates the corpus. The byte-hash is still computed and written for
|
|
39
|
+
#: auditing, and ``tools.check_l1_schema`` uses it at commit time to enforce that
|
|
40
|
+
#: any ``_index`` change is declared (preserving the anti-silent-FN guarantee).
|
|
41
|
+
#: Lives here (not in the CLI pipeline) so every surface that opens a repo —
|
|
42
|
+
#: CLI scan and the Python-API warm session (FLAW-378) — keys L1 artifacts
|
|
43
|
+
#: identically.
|
|
44
|
+
L1_EXTRACTION_SIGNATURE_PATTERNS: tuple[str, ...] = ("_index/**/*.py",)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _package_root() -> Path:
|
|
48
|
+
"""Filesystem root of the installed ``flawed`` package."""
|
|
49
|
+
import flawed
|
|
50
|
+
|
|
51
|
+
return Path(flawed.__file__).resolve().parent
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@functools.cache
|
|
55
|
+
def code_signature(patterns: tuple[str, ...]) -> str:
|
|
56
|
+
"""SHA-256 over the ``.py`` files matched by glob *patterns*.
|
|
57
|
+
|
|
58
|
+
*patterns* are :class:`pathlib.Path` globs evaluated against the ``flawed``
|
|
59
|
+
package root: ``"_semantic/**/*.py"`` (a tree, recursively — ``**`` matches
|
|
60
|
+
zero or more intermediate directories, so files directly under the root dir
|
|
61
|
+
are included too), ``"*.py"`` (top-level files only), ``"core.py"`` (one
|
|
62
|
+
file). Each matched file contributes its package-relative POSIX path *and*
|
|
63
|
+
its bytes to the digest, processed in sorted order so the result is
|
|
64
|
+
deterministic and independent of filesystem iteration order.
|
|
65
|
+
|
|
66
|
+
Memoized for the process: analysis source does not change mid-run, and both
|
|
67
|
+
caches query the same constant pattern sets repeatedly.
|
|
68
|
+
"""
|
|
69
|
+
root = _package_root()
|
|
70
|
+
files: set[Path] = set()
|
|
71
|
+
for pattern in patterns:
|
|
72
|
+
files.update(p for p in root.glob(pattern) if p.is_file())
|
|
73
|
+
hasher = hashlib.sha256()
|
|
74
|
+
for path in sorted(files):
|
|
75
|
+
hasher.update(path.relative_to(root).as_posix().encode())
|
|
76
|
+
hasher.update(b"\0")
|
|
77
|
+
hasher.update(path.read_bytes())
|
|
78
|
+
hasher.update(b"\0")
|
|
79
|
+
return hasher.hexdigest()
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def config_type_enrichment_signature(config: ResolvedConfig) -> str:
|
|
83
|
+
"""Map a resolved config's type-enrichment settings to the canonical signature.
|
|
84
|
+
|
|
85
|
+
Type enrichment (the basedpyright/mypy oracle versions + gating caps) determines
|
|
86
|
+
which type facts Layer 1 attaches, and those facts flow downstream into the
|
|
87
|
+
provider-engine match set and the final findings — so two scans of the same
|
|
88
|
+
source under different type-enrichment config must not share a cache entry.
|
|
89
|
+
|
|
90
|
+
This is the **single owner** of the ``config.type_enrichment.* ->
|
|
91
|
+
type_enrichment_signature(...)`` mapping. Every cache-identity site routes
|
|
92
|
+
through it — the L1 scan pipeline, the Python-API warm session, and the L2
|
|
93
|
+
provider-engine cache — so adding an enrichment field that affects the
|
|
94
|
+
signature is a one-line change *here*, not a three-place edit (FLAW-393).
|
|
95
|
+
Delegates to the canonical
|
|
96
|
+
:func:`flawed._index._pipeline.type_enrichment_signature` the L1 cache itself
|
|
97
|
+
keys on, so all tiers agree on "did type enrichment change".
|
|
98
|
+
|
|
99
|
+
Imported lazily to keep this module (loaded early in cache setup) free of a
|
|
100
|
+
Layer 1 import at module scope.
|
|
101
|
+
"""
|
|
102
|
+
from flawed._index._pipeline import type_enrichment_signature
|
|
103
|
+
|
|
104
|
+
te = config.type_enrichment
|
|
105
|
+
return type_enrichment_signature(
|
|
106
|
+
enable_mypy_batch=te.enable_mypy_batch,
|
|
107
|
+
basedpyright_max_queries=te.basedpyright_max_queries,
|
|
108
|
+
basedpyright_max_probe_files=te.basedpyright_max_probe_files,
|
|
109
|
+
basedpyright_max_source_files=te.basedpyright_max_source_files,
|
|
110
|
+
basedpyright_max_workspace_bytes=te.basedpyright_max_workspace_bytes,
|
|
111
|
+
basedpyright_timeout_seconds=te.basedpyright_timeout_seconds,
|
|
112
|
+
mypy_batch_timeout_seconds=te.mypy_batch_timeout_seconds,
|
|
113
|
+
mypy_batch_max_files=te.mypy_batch_max_files,
|
|
114
|
+
)
|
|
@@ -112,7 +112,24 @@ def sample_rss_bytes() -> tuple[int, str]:
|
|
|
112
112
|
# ── Timeout exceptions ──────────────────────────────────────────
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
class
|
|
115
|
+
class DeadlineExceededError(Exception):
|
|
116
|
+
"""Base for any wall-clock deadline breach (overall / layer / rule).
|
|
117
|
+
|
|
118
|
+
A deadline is raised asynchronously by the ``SIGALRM`` handler, so it can
|
|
119
|
+
surface *inside* arbitrary code — including a detector's finding iterator.
|
|
120
|
+
Boundary code that broadly catches ``Exception`` to attribute rule *errors*
|
|
121
|
+
(e.g. :func:`flawed._cli.rules.iter_detector_findings`) MUST let a
|
|
122
|
+
``DeadlineExceededError`` propagate unchanged, or the pipeline's timeout arm is
|
|
123
|
+
bypassed and the breach is silently mis-reported as a generic rule error
|
|
124
|
+
(fail-open telemetry: ``timed_out_rules=[]``, ``incomplete=false``, and the
|
|
125
|
+
rule re-runs to the cap on every warm scan because nothing marks it timed
|
|
126
|
+
out). Making the three timeout errors a distinct exception *type* — rather
|
|
127
|
+
than relying on ``except Exception`` ordering alone — is what keeps that
|
|
128
|
+
guarantee robust as new catch sites are added (FLAW-379).
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class LayerTimeoutError(DeadlineExceededError):
|
|
116
133
|
"""Raised when a layer exceeds its time budget."""
|
|
117
134
|
|
|
118
135
|
def __init__(self, layer: str, limit_seconds: int | float) -> None:
|
|
@@ -121,7 +138,7 @@ class LayerTimeoutError(Exception):
|
|
|
121
138
|
super().__init__(f"Layer {layer!r} exceeded {_format_seconds(limit_seconds)}s timeout")
|
|
122
139
|
|
|
123
140
|
|
|
124
|
-
class RuleTimeoutError(
|
|
141
|
+
class RuleTimeoutError(DeadlineExceededError):
|
|
125
142
|
"""Raised when a single rule exceeds its time budget."""
|
|
126
143
|
|
|
127
144
|
def __init__(self, rule_id: str, limit_seconds: int | float) -> None:
|
|
@@ -130,7 +147,7 @@ class RuleTimeoutError(Exception):
|
|
|
130
147
|
super().__init__(f"Rule {rule_id!r} exceeded {_format_seconds(limit_seconds)}s timeout")
|
|
131
148
|
|
|
132
149
|
|
|
133
|
-
class OverallTimeoutError(
|
|
150
|
+
class OverallTimeoutError(DeadlineExceededError):
|
|
134
151
|
"""Raised when the whole scan exceeds its time budget."""
|
|
135
152
|
|
|
136
153
|
def __init__(self, limit_seconds: int | float) -> None:
|
|
@@ -337,7 +354,18 @@ class ScanMetrics:
|
|
|
337
354
|
flawed_version: str = ""
|
|
338
355
|
rules_loaded: int = 0
|
|
339
356
|
rules_executed: int = 0
|
|
357
|
+
#: Detectors served from the L3 results cache (FLAW-379). Surfacing this closes
|
|
358
|
+
#: the telemetry gap where a warm scan showed ``rules_executed=0`` with no
|
|
359
|
+
#: visible reason: executed + cache-hit + skipped account for every detector,
|
|
360
|
+
#: so a 0-executed run reads as "all cached", not "nothing ran".
|
|
361
|
+
rules_cache_hit: int = 0
|
|
340
362
|
rules_skipped: int = 0
|
|
363
|
+
#: True when the user configured a ``--rules-dir`` but rules were NOT loaded
|
|
364
|
+
#: because ``--no-semantic`` was passed (L3 rule execution needs the L2 model,
|
|
365
|
+
#: so rule discovery is gated on ``--semantic``). Without this, the summary read
|
|
366
|
+
#: "Rules: 0 loaded ... COMPLETE" with no hint the rules were skipped by the
|
|
367
|
+
#: flag rather than genuinely absent (FLAW-397).
|
|
368
|
+
rules_skipped_no_semantic: bool = False
|
|
341
369
|
finding_count: int = 0
|
|
342
370
|
retained_finding_count: int = 0
|
|
343
371
|
findings_truncated: bool = False
|
|
@@ -391,6 +419,8 @@ class ScanMetrics:
|
|
|
391
419
|
"target": self.target,
|
|
392
420
|
"rules_loaded": self.rules_loaded,
|
|
393
421
|
"rules_executed": self.rules_executed,
|
|
422
|
+
"rules_cache_hit": self.rules_cache_hit,
|
|
423
|
+
"rules_skipped": self.rules_skipped,
|
|
394
424
|
"incomplete": self.incomplete,
|
|
395
425
|
"overall_timed_out": self.overall_timed_out,
|
|
396
426
|
"timed_out_layers": self.timed_out_layers,
|