From 639d13979967c71177e5dcf152819e9252ff1991 Mon Sep 17 00:00:00 2001 From: Rootiest Date: Mon, 7 Sep 2026 20:09:26 -0400 Subject: [PATCH] test(guards): pin C5 logging as opt-in, including that the master cannot enable it 8 cases on the real __fish_config_op_logging name. AGENTS.md records this as a deliberate special case agents keep trying to 'fix' out; three of these cases exist specifically to turn that into a test failure. Includes the three subcategory cases proving the opt-in is inherited through chain[-1] rather than special-cased per subcategory. --- tests/test-guards.fish | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/test-guards.fish b/tests/test-guards.fish index d984e1f..ee02581 100644 --- a/tests/test-guards.fish +++ b/tests/test-guards.fish @@ -138,4 +138,53 @@ __fish_config_op_cascade __probe_cat check "master unrecognized, category unset -> enabled" 0 $status set -e __fish_config_opinionated +section "cascade: C5 logging is opt-in" + +# Uses the REAL __fish_config_op_logging name because the opt-in list lives +# inside the cascade keyed on it. AGENTS.md: "C5 is opt-in (do not 'fix' this)" +# -- unset or unrecognized means off, and the master switch cannot enable it. +# If any of these three fail, that is a real defect: record it in +# JOB-BRIEF-FINDINGS.md, do not repair the guard. +set -e __fish_config_op_logging __fish_config_opinionated + +__fish_config_op_cascade __fish_config_op_logging +check "C5 unset -> disabled" 1 $status + +set -g __fish_config_opinionated 1 +__fish_config_op_cascade __fish_config_op_logging +check "C5 unset + master truthy -> still disabled" 1 $status +set -e __fish_config_opinionated + +set -g __fish_config_op_logging garbage +__fish_config_op_cascade __fish_config_op_logging +check "C5 unrecognized is not consent -> disabled" 1 $status + +set -g __fish_config_op_logging on +__fish_config_op_cascade __fish_config_op_logging +check "C5 explicit truthy -> enabled" 0 $status + +set -g __fish_config_op_logging off +__fish_config_op_cascade __fish_config_op_logging +check "C5 explicit falsy -> disabled" 1 $status +set -e __fish_config_op_logging + +section "cascade: C5 subcategories inherit opt-in" + +# The opt-in check reads chain[-1], which is always the CATEGORY variable, so +# nesting inherits "off unless explicit" with no per-subcategory special case. +set -e __fish_config_op_logging_terminal_capture + +__fish_config_op_cascade __fish_config_op_logging __fish_config_op_logging_terminal_capture +check "C5 sub unset, C5 unset -> disabled" 1 $status + +set -g __fish_config_op_logging_terminal_capture 1 +__fish_config_op_cascade __fish_config_op_logging __fish_config_op_logging_terminal_capture +check "C5 sub explicit truthy -> enabled" 0 $status + +set -g __fish_config_op_logging_terminal_capture 0 +set -g __fish_config_op_logging on +__fish_config_op_cascade __fish_config_op_logging __fish_config_op_logging_terminal_capture +check "C5 sub falsy, C5 truthy -> disabled" 1 $status +set -e __fish_config_op_logging_terminal_capture __fish_config_op_logging + report