[Debt] Refactor privacy policy scope update complexity #7

Closed
opened 2026-07-11 12:51:26 +02:00 by zemion · 1 comment
Owner

Xenon/Radon identify privacy policy scope updates as D-ranked.

Classification: structural maintainability work.

Report evidence:

  • govoplan-policy/src/govoplan_policy/backend/retention.py:517 set_privacy_policy_for_scope rank D.

Suggested next steps:

  • Split scope resolution, policy validation, inheritance checks, and persistence.
  • Add tests for system/tenant/group/user scope precedence.
  • Keep retention behavior stable.

Baseline report directory: audit-reports/govoplan-full-20260711-1238

<!-- codex-audit-full-2026-07-11:policy-complexity-baseline --> Xenon/Radon identify privacy policy scope updates as D-ranked. Classification: **structural maintainability work**. Report evidence: - `govoplan-policy/src/govoplan_policy/backend/retention.py:517 set_privacy_policy_for_scope` rank D. Suggested next steps: - Split scope resolution, policy validation, inheritance checks, and persistence. - Add tests for system/tenant/group/user scope precedence. - Keep retention behavior stable. Baseline report directory: `audit-reports/govoplan-full-20260711-1238`
zemion added the
type
debt
priority
p3
status
ready
module/policy
codex/ready
labels 2026-07-11 12:51:26 +02:00
zemion added the
audit/complexity
audit/structural
source/security-audit
labels 2026-07-11 16:12:13 +02:00
Author
Owner

Codex State: done

Summary

  • Split privacy retention policy writes into system/scoped persistence helpers and explicit parent-scope validation helpers.
  • Added scope precedence, patch normalization, and missing scope-id tests; updated stale core-version contract assertion.

Changed Files

  • src/govoplan_policy/backend/retention.py
  • tests/test_policy_hierarchy.py
  • tests/test_policy_module_contract.py

Verification

  • PYTHONPATH=... /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_policy_hierarchy tests.test_policy_module_contract
## Codex State: done ### Summary - Split privacy retention policy writes into system/scoped persistence helpers and explicit parent-scope validation helpers. - Added scope precedence, patch normalization, and missing scope-id tests; updated stale core-version contract assertion. ### Changed Files - `src/govoplan_policy/backend/retention.py` - `tests/test_policy_hierarchy.py` - `tests/test_policy_module_contract.py` ### Verification - `PYTHONPATH=... /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_policy_hierarchy tests.test_policy_module_contract`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: add-ideas/govoplan-policy#7
No description provided.