Skip to content

Extract denied action history helper#145

Open
scottscott wants to merge 1 commit intonomoticai:mainfrom
scottscott:feat/runtime-record-verdict-slice-5
Open

Extract denied action history helper#145
scottscott wants to merge 1 commit intonomoticai:mainfrom
scottscott:feat/runtime-record-verdict-slice-5

Conversation

@scottscott
Copy link
Collaborator

Summary

Fifth runtime decomposition implementation slice: extract denied-action history mutation from _record_verdict.

Key Changes

  • Added GovernanceRuntime._record_denied_action_history(action, context, verdict) in src/nomotic/runtime.py.
  • Replaced inline denied-history mutation in _record_verdict(...) with a helper call.
  • Preserved existing behavior for how DENY verdicts update runtime history and context history.

Test Updates

  • Added focused unit tests in tests/test_runtime.py:
    • test_record_denied_action_history_appends_record
    • test_record_denied_action_history_ignores_allow_verdict

Validation

  • pytest -q tests/test_runtime.py -> 15 passed

Scope

  • Internal refactor only
  • No API/config changes
  • No CI/workflow changes

Refactor GovernanceRuntime._record_verdict by extracting denied-action history mutation into _record_denied_action_history.

Adds focused runtime tests for DENY append behavior and ALLOW no-op behavior.

assisted-by: GitHub Copilot
@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant