fix(cli): make --dry-run predict a refused hook-script rewrite (#1387) - #1473
Merged
Conversation
The dry run claimed EVERY hook group as installable because gate_ok / session_ok / subagent_ok were simply set to `true` when dry_run was on. When the on-disk hook script is not ours - user-modified, or written by a manual install pointing at another binary - the real install refuses to rewrite it, so the preview promised what the run could not deliver. That is the second half of #1387: the reporter had no way to see the loss coming, and said so. - New read-only predicate cbm_text_owned_document_status() mirrors text_migrate_owned_document's decision WITHOUT writing: absent / already current / an exact released document => a write would proceed; anything else => it would be refused. - The dry run uses it per script, so the three 'hooks:' lines now reflect what will actually happen, and each refused script is NAMED with the reason. Silence was the original defect: an unmentioned group reads as 'nothing to do', not 'this will be skipped'. Test: cli_dry_run_predicts_refused_hook_script_issue1387 runs the real dry-run path over an unowned gate script, capturing stdout, and asserts the warning names the script. RED before, GREEN after, RED again on revert. cli+agent_profiles+config_text_edit: 292 passed; lint-ci clean. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
DeusData
enabled auto-merge
August 6, 2026 14:42
DeusData
force-pushed
the
fix/dryrun-predicts-hook-refusal
branch
from
August 6, 2026 14:50
a32c0da to
d35589c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second half of #1387 — the part the reporter explicitly flagged: "
--dry-runprints the same three-group summary, so you can't catch it before it bites."Cause
With
dry_runset,gate_ok/session_ok/subagent_okwere assignedtrueunconditionally, so the preview always claimed all three hook groups. When the on-disk script is not ours (user-modified, or a manual install embedding another binary path) the real install refuses the rewrite — so the preview promised what the run could not deliver.Fix
cbm_text_owned_document_status()— a read-only classifier mirroringtext_migrate_owned_document's decision without writing: absent / already current / an exact released document ⇒ the write proceeds; anything else ⇒ refused.Verification
cli_dry_run_predicts_refused_hook_script_issue1387exercises the real dry-run path over an unowned gate script and asserts the warning names it. RED before (three groups promised, no warning), GREEN after, RED again on revert.cli+agent_profiles+config_text_edit: 292 passed,lint-ciclean, suite re-run twice for determinism.