Skip to content

Give the cat-mode flag three settings and retire CAT_MODE_AUTO_INVOKE - #744

Merged
mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/flags/cat-mode-flag/give-catstack-cat-mode-default-three-settings--afccb934
Sep 17, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/flags/cat-mode-flag/give-catstack-cat-mode-default-three-settings--afccb934

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

The work style guide can now be off, left for the agent to decide, or always on. One setting controls all three.

Before, two separate settings did overlapping jobs, and they could say different things at once.

Now the one setting takes three words. The old second setting is ignored, and the installer prints a warning when it sees it.

Review Claim

One setting picks between off, let the agent decide, and always on, and the old second setting is retired with a warning.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

An old 1 or 0 behaves exactly as before; only decide changes what gets installed.

Slice Rationale

Bottom of a three-PR stack. This slice holds the installer, the flag reader, the hook text and their tests. The cat-mode skill line and the root README follow as their own review units.

  • CATSTACK_CAT_MODE_DEFAULT=off|decide|on (1/true/yes = on; unset/0 = off).
  • decide replaces CAT_MODE_AUTO_INVOKE=true: install.sh writes the auto-invoking cat-mode copy only for decide, and removes a generated copy when switched away.
  • install.sh reads the flag through engine/hooks/_flags/flags.py, which gains --value. So the value now also comes from ~/.catstack.env, not only this checkout's .env.
  • Unknown values and a leftover CAT_MODE_AUTO_INVOKE print a warning instead of being dropped silently.

Non-goals

  • No change to which prompts the hook fires on.
  • The cat-mode skill text and root README are updated in the next two PRs.

Test Plan

Test Plan
  • python3 -m unittest tests.test_install.TestCatModeDefaultInstall with the fix stashed (new tests fail first):
    Ran 9 tests in 135.578s
    FAILED (failures=6)
    
    and with the fix:
    Ran 9 tests in 130.342s
    OK
    
  • python3 -m unittest tests.test_install_worktree_repo_dir: failed on the first push because install.sh --help ran the flag lookup in a copy with no flag reader (FAILED (failures=3)). The lookup now runs after argument parsing:
    OK
    
  • python3 -m unittest tests.test_install_worktree_repo_dir tests.test_install.TestCatModeDefaultInstall tests.test_cat_modeRan 92 tests ... OK; shellcheck install.sh → exit 0
  • python3 -m unittest discover -s engine/hooks/_flags/testsOK (37 tests)
  • python3 -m unittest discover -s engine/hooks/cat-mode-default/testsOK (39 tests)
  • python3 engine/skills/make-pr/scripts/preflight.py --base origin/mainunit engine-runtime: 9 file(s), all gates ok

Revert Plan

Revert Plan
  • Safe to revert? Yes, after reverting the two PRs stacked on it.
  • Revert command: git revert <sha>
  • Post-revert steps: re-run ./install.sh; set CAT_MODE_AUTO_INVOKE=true again if decide was in use.
  • Data migration? No

🤖 Generated with Claude Code

@EdbertChan

EdbertChan commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 Give the cat-mode flag three settings and retire CAT_MODE_AUTO_INVOKE #744 👈
2 cat-mode: name the on setting of its default flag #745
3 README: document the three cat-mode flag settings #746

@EdbertChan EdbertChan changed the title Give CATSTACK_CAT_MODE_DEFAULT three settings and retire CAT_MODE_AUTO_INVOKE Give the cat-mode flag three settings and retire CAT_MODE_AUTO_INVOKE Sep 17, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fb4dcca. Configure here.

Comment thread install.sh Outdated
…O_INVOKE

CATSTACK_CAT_MODE_DEFAULT now takes off, decide, or on (1 and 0 still
work). decide replaces CAT_MODE_AUTO_INVOKE=true: install.sh reads the
flag through the shared flag lookup and materializes the auto-invoking
cat-mode copy only for decide, removing a generated copy when switched
away. install.sh warns when it still sees CAT_MODE_AUTO_INVOKE, and when
the flag holds an unknown value. flags.py gains --value for flags with
more than two settings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Change-Id: Iafccb934fe56639b4366e1bcf3668fef29fa6e5c
@EdbertChan EdbertChan changed the title Give the cat-mode flag three settings and retire CAT_MODE_AUTO_INVOKE Give CATSTACK_CAT_MODE_DEFAULT three settings and retire CAT_MODE_AUTO_INVOKE Sep 17, 2026
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/flags/cat-mode-flag/give-catstack-cat-mode-default-three-settings--afccb934 branch from fb4dcca to c571574 Compare September 17, 2026 01:50
@EdbertChan

Copy link
Copy Markdown
Owner Author

Revision history

# Type Changes Reason Date
1 initial fb4dcca 2026-09-17 01:50 UTC
2 content fb4dcca → c571574 2026-09-17 01:50 UTC

@EdbertChan EdbertChan changed the title Give CATSTACK_CAT_MODE_DEFAULT three settings and retire CAT_MODE_AUTO_INVOKE Give the cat-mode flag three settings and retire CAT_MODE_AUTO_INVOKE Sep 17, 2026
@mergify

mergify Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue admin-bypass

@mergify

mergify Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 7 minutes 31 seconds in the queue, including 6 minutes 44 seconds running CI.

Required conditions to merge
  • check-success = lint
  • check-success = test
  • check-success = validate

@mergify mergify Bot added the queued label Sep 17, 2026
@mergify
mergify Bot merged commit 3ef9394 into main Sep 17, 2026
7 of 12 checks passed
@mergify mergify Bot removed the queued label Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant