Harden Tailtest hook runtime contract - #12
Open
BananaAccurate wants to merge 6 commits into
Open
Conversation
This was referenced Jul 30, 2026
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.
Summary
This is a stacked hook-runtime contract branch built on PR #11's validation-gates line.
It includes earlier stack commits from PR #8, PR #10, and PR #11 because upstream
maindoes not yet contain those prerequisites. The new commits in this branch are:7e0aee8— harden hook runtime contract10c80d0— validate restored hook stateRoot cause
Tailtest's Codex hook runtime needed explicit hardening around plugin-root command resolution, SessionStart context injection, restored session-state trust boundaries, direct-clone hook installation, and shell-script line endings. Without these repairs, hooks could rely on brittle hard-coded paths, restore malformed project-local state, or fail under WSL because
scripts/init.shwas not guaranteed LF.Changes
hooks/hooks.jsonnow uses plugin-root based commands with Windows overrides and scoped matchers forSessionStart,PostToolUse, andStop.SessionStartinjects compact trusted runtime context fromRUNTIME.md, never writes a projectAGENTS.md, and keeps stdout valid JSON..tailtest/session.jsonis empty or fully invalid..gitattributespolicy soscripts/*.shstays LF;scripts/init.shis LF in the worktree.Validation
Run from
C:\Users\enhal\.codex\worktrees\tailtest-hook-runtime-contractat10c80d0:python -m pytest -q→ exit 0,423 passed in 47.23spython -m ruff check .→ exit 0,All checks passed!python -m ruff format --check .→ exit 0,28 files already formattedgit diff --check→ exit 0python3 -m pytest -q && python3 -m ruff check . && python3 -m ruff format --check .→ exit 0,422 passed, 1 skipped, Ruff check passed,28 files already formattedReview loop evidence:
9 failed, 2 passed11 passed2 failed, 12 passed15 passedSecurity notes
contents: read, nopull_request_target).Remaining limitation
This PR is stacked because upstream
maindoes not yet contain the validation-gates and stale-queue prerequisites. Maintainer review/merge is still required, and GitHub may not run the newly added workflow until it exists on the base branch.