Repository navigation
fix(config): wire the option that did nothing, document the ones that did - #189
Conversation
Review of #189 caught this: wiring `debug` up turned the long-dead "debug": false in config.example.json into a live setting. Anyone copying that file — which is what it is for — would have silently flipped save-session.sh from verbose to quiet, which is precisely the default change this PR argues against making. Removed, and named alongside `timezone` as deliberately documented-but-not- shipped: for both keys, absence is the meaningful state. A test now asserts it stays out, so the next person to "complete" the example file has to read why. Co-Authored-By: Max <noreply>
|
Good catch, and it is the sharper version of the point the PR itself makes.
Removed the key, added On the two non-blocking notes: the ~20ms is real but lands in the backgrounded save path rather than the tool-call critical path, as you measured, so I have left it. The fail-through-to-caller-default for garbage values is deliberate — Full suite 745 passed, 41 skipped. |
Review of #189 caught this: wiring `debug` up turned the long-dead "debug": false in config.example.json into a live setting. Anyone copying that file — which is what it is for — would have silently flipped save-session.sh from verbose to quiet, which is precisely the default change this PR argues against making. Removed, and named alongside `timezone` as deliberately documented-but-not- shipped: for both keys, absence is the meaningful state. A test now asserts it stays out, so the next person to "complete" the example file has to read why. Co-Authored-By: Max <noreply>
d5394d8 to
583ea21
Compare
Review of #189 caught this: wiring `debug` up turned the long-dead "debug": false in config.example.json into a live setting. Anyone copying that file — which is what it is for — would have silently flipped save-session.sh from verbose to quiet, which is precisely the default change this PR argues against making. Removed, and named alongside `timezone` as deliberately documented-but-not- shipped: for both keys, absence is the meaningful state. A test now asserts it stays out, so the next person to "complete" the example file has to read why. Co-Authored-By: Max <noreply>
583ea21 to
a501eba
Compare
… did `debug` was documented in the README, shipped in config.example.json, and passed to config() nowhere — setting it did nothing whatsoever. The real switch was the REMEMBER_DEBUG env var, which someone configuring the plugin through config.json has no obvious way to set. Same class as #159, where documented booleans could not be switched off. It is wired now, via a shared debug_enabled helper. Precedence: the env var, then the config option, then the CALLER'S OWN default. That last part is deliberate — save-session.sh was verbose unless told otherwise and 50-git-backup.sh was quiet unless told otherwise, and the README documented only the first. One shared default would have silently changed log volume for every existing install in one direction or the other, so each keeps its own and the option overrides both, which is what setting it was supposed to do. Also documented: thresholds.consolidate_max_bytes (read, undocumented — and the default is 600000, not the 200000 a first draft of this claimed), plus `model` and `reject_pattern`, which appeared only in the env-var table even though config.json is the source of truth for both. git_backup.remote / branch / gpg_sign were documented but missing from config.example.json. tests/test_config_contract.py compares three sides — README table, example config, and the keys the code actually reads — in both directions, and drives the debug switch rather than asserting the key is merely mentioned. `model` and `reject_pattern` are its finding, not the issue's. `timezone` is named as deliberately documented-but-not-shipped: a `"timezone": ""` people copy is the UTC landmine an earlier fix removed, and the suite already asserts it stays out — which this test tripped over before encoding the reason. Eight of its ten tests go red against pre-fix code. Full suite 744 passed, 41 skipped. Co-Authored-By: Max <noreply>
Review of #189 caught this: wiring `debug` up turned the long-dead "debug": false in config.example.json into a live setting. Anyone copying that file — which is what it is for — would have silently flipped save-session.sh from verbose to quiet, which is precisely the default change this PR argues against making. Removed, and named alongside `timezone` as deliberately documented-but-not- shipped: for both keys, absence is the meaningful state. A test now asserts it stays out, so the next person to "complete" the example file has to read why. Co-Authored-By: Max <noreply>
a501eba to
a7a0933
Compare
Closes #176.
debugdid nothingIt was in the README table, shipped in
config.example.json, and passed toconfig()nowhere. The real switch was theREMEMBER_DEBUGenv var — which someone configuring the plugin throughconfig.jsonhas no obvious way to set. Same class as #159, where documented booleans could not be switched off.Wired now, through a shared
debug_enabledhelper. Precedence: env var, then the config option, then the caller's own default.That last part is the interesting one.
save-session.shwas verbose unless told otherwise;50-git-backup.shwas quiet unless told otherwise; the README documented only the first, so its "default1" had always been contradicted by the git-backup hook. Collapsing them into one shared default would have silently changed log volume for every existing install in one direction or the other — so each keeps its own, and setting the option overrides both. Which is what setting it was supposed to do.Documentation that had drifted the other way
thresholds.consolidate_max_bytes— read byrun-consolidation.sh, in the example config, absent from the README table. Its default is 600000; a first draft of this PR wrote 200000 from the issue text and was wrong until I read the code.modelandreject_pattern— read, shipped, and documented only as env vars, thoughconfig.jsonis the source of truth for both.git_backup.remote/branch/gpg_sign— documented, read, missing fromconfig.example.json.modelandreject_patternare the new test's finding, not the issue's.The test
tests/test_config_contract.pycompares three sides — the README config table,config.example.json, and the keys the code actually passes toconfig()— in both directions, and drives thedebugswitch through bash rather than asserting the key is merely mentioned somewhere.One thing it taught me while being written:
timezoneis documented and read but deliberately not shipped in the example config, because a"timezone": ""people copy is the UTC landmine an earlier fix removed — andtest_log_sh.pyalready asserts it stays out. My first version added it back and broke that test. It is now named as a deliberate exception with the reason attached, which is the point of the exercise: encode the intent, don't relitigate it.Eight of its ten tests go red against pre-fix code. Full suite: 744 passed, 41 skipped.