Repository navigation
chore(discipline): regenerate agent hooks for v0.18.0 - #220
Merged
Merged
Conversation
Regenerate every tracked hook file with `discipline hook install --observe
--upgrade` (local CLI 0.18.0, the same engine the v0.18.0 action runs):
- .claude/settings.json (claude-code): PreToolUse check added on
Edit|Write|MultiEdit|NotebookEdit|Bash, session-start lease entry, and a
PATH guard on every command so a missing binary is reported instead of
silently no-op'ing the hook.
- .github/hooks/discipline.json (copilot): preToolUse and sessionStart
entries added (the v0.15+ hook shape), same PATH guard + observe mode.
- .agents/hooks.json (agy): PreToolUse entry, session-start lease, PATH
guard, and the Stop check timeout raised 120s -> 300s (the agy default
this release writes; a check may legitimately run long).
- .claude/hooks/discipline-bootstrap.sh: version v0.14.4 -> v0.18.0, a
tmpdir trap so a failed download cannot leak the workspace, and a note
that cloud sessions only run on GitHub-hosted repos.
- .opencode/plugins/discipline.js (new, opencode): the v0.17+/v0.18
plugin — takes this worktree's lease on session start, refuses edits
outside the session's worktree before an edit tool, and appends the
failing discipline report to the tool output after one. Observe mode
everywhere, so it never blocks.
Behaviour is unchanged for contributors who install discipline themselves:
observe mode means no hook refuses a tool call. The tracked files now
match what a clean 0.18.0 install writes, so hook-file drift (this release
added PreToolUse + session-start lease entries) stops silently diverging.
allow-agent-instructions: .agents/hooks.json regenerated by discipline hook install --agent agy --upgrade to v0.18.0 hook format (PreToolUse entry, session-start lease, PATH guard, Stop timeout 300s)
allow-agent-instructions: .claude/hooks/discipline-bootstrap.sh regenerated by discipline hook install --agent claude-code --upgrade to v0.18.0 (version v0.14.4 -> v0.18.0, tmpdir trap, cloud-host note)
allow-agent-instructions: .claude/settings.json regenerated by discipline hook install --agent claude-code --upgrade to v0.18.0 hook format (PreToolUse entry, session-start lease, PATH guards)
allow-agent-instructions: .github/hooks/discipline.json regenerated by discipline hook install --agent copilot --upgrade to v0.18.0 hook format (preToolUse + sessionStart entries, PATH guards)
allow-agent-instructions: .opencode/plugins/discipline.js regenerated by discipline hook install --agent opencode --upgrade to v0.18.0; observe-mode OpenCode plugin (session-start lease, pre-tool worktree refusal, post-edit report append) marked as its own instruction source
allow-swallow: .opencode/plugins/discipline.js observe-mode plugin contract: every empty catch is deliberate — a discipline hook must never throw or the agent's tool call is disrupted; catch {} is the tool's generated output
discipline: passedBase Findings lifted by an override:
|
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.
What
Regenerates every tracked discipline hook file with
discipline hook install --observe --upgradeusing the local 0.18.0 CLI — the same engine the v0.18.0 action (landed in #218) runs.Why
The v0.14.4-era hook files had silently drifted from what this release actually writes:
Hooks run observe mode everywhere (the repo's existing convention), so no hook refuses a tool call; the regeneration only changes what the next agent sees after an edit. Tracked files now match a clean 0.18.0 install, so the drift stops silently diverging.
Changes
.claude/settings.json.github/hooks/discipline.json.agents/hooks.json.claude/hooks/discipline-bootstrap.sh.opencode/plugins/discipline.js.github/workflows/copilot-setup-steps.ymlwas left untouched by the installer (already matches the 0.18.0 output; pin landed in #218).Gate notes
The four agent instruction files + the new plugin each lift one
instruction-smugglingfinding, and the plugin's sixcatch {}blocks lifterror-swallowing— all via scoped directives in the commit body (oneallow-agent-instructions:/allow-swallow:line per subject), the same pattern this repo used for the AGENTS.md edit in #217. The empty catches are the plugin's observe-mode contract: a discipline hook must never throw or it would disrupt the agent's tool call.Validation
discipline check --base origin/main: PASS (27 gates, 0 errors, 0 warnings; 11 overrides = 11 directive applications above)discipline hook install0.18.0 output (the plugin is byte-identical to orieg/discipline's own tracked copy)