8OI-531 regression coverage — the ``"optional"`` tier in
9:data:`oct.git.policy.PROFILE_MATRIX` must be truly non-blocking:
10the check runs and its failures are reported, but the CLI exit code
11stays at 0 for that tier alone.
13Before OI-531 the policy layer treated ``"optional"`` identically to
14``"blocking"`` at [oct/oct/git/policy.py:381](oct/oct/git/policy.py#L381),
15which meant ``oct git commit`` under the compact profile would exit 4
16on any test failure. The user confirmed the intended semantics: compact
17should flag test failures but let the commit through.
21- ``compact`` profile + test failures → exit code 0.
22- ``strict`` profile + test failures → exit code 4 (still blocking).
23- :data:`PROFILE_MATRIX` docstring documents all three tier values.
30 L3 — assertion details
35- Tests use in-memory mock objects; no subprocess or filesystem writes.
38from __future__
import annotations
40from types
import SimpleNamespace
53 defaults.update(overrides)
54 return SimpleNamespace(**defaults)
58 assert PROFILE_MATRIX[
"compact"][
"tests"] ==
"optional"
61 assert apply_profile_policy(
"compact", result) == 0
65 assert PROFILE_MATRIX[
"strict"][
"tests"] ==
"blocking"
68 assert apply_profile_policy(
"strict", result) == 4
75 src = policy.__doc__
or ""
76 source_text = __import__(
"inspect").getsource(policy)
77 for tier
in (
"blocking",
"optional",
"skip"):
78 assert tier
in source_text
test_profile_matrix_docstring_documents_three_tiers()
test_compact_tests_optional_does_not_block_exit()
SimpleNamespace _gate_result(**overrides)
test_strict_tests_blocking_still_exits_four()