Skip to content

tune: the friction report counts ambient-monitor rows as decisions #703

Description

@fu351

doberman tune reads rows with read_decisions and hands them to build_friction_report and generate_proposals in src/doberman/policy/friction.py. Since #699 the ambient monitor writes rows too, tagged source_context = "ambient:<collector_id>". Those rows were observed, never enforced, so nobody was interrupted by them.

friction.py has no filter, so ambient AUTH and BLOCK rows inflate the weekly rates and can push a proposal past min_occurrences on their own. The device-metrics rollup in storage/log.py already skips rows whose source_context starts with ambient:; the friction report should do the same.

Done when:

  • rows whose source_context starts with ambient: are dropped in one place in friction.py, so both the report and the proposals see the filter
  • a test feeds five ambient AUTH rows with the same action type and path class and asserts no proposal comes out, and the rates ignore them
  • a changelog.d/<PR>.fix.md fragment

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerslevel-3Write a self-contained test, or add a flag following an existing sibling pattern.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions