Goal
Refactor the pre-push hook to align its operator experience with the new pre-commit behavior:
concise output by default, verbose streaming on demand, and structured JSON output for automation.
Background
Issue #1769 introduced a stronger CLI and reporting contract for pre-commit, including:
--format=<text|json>
--verbosity=<concise|verbose> and --verbose alias
- concise per-step summaries with log-path and failure tail
- optional workspace-local log directory via environment variable
contrib/dev-tools/git/hooks/pre-push.sh still uses legacy output behavior. This creates an
inconsistent local workflow and weaker automation ergonomics in the heavier validation gate.
Because pre-push includes nightly checks and E2E, this refactor should keep the check set intact
while improving clarity, observability, and parity with pre-commit.
Scope
In Scope
- Add
--format=<text|json> to pre-push with text as default.
- Add
--verbosity=<concise|verbose> with concise as default.
- Keep
--verbose as alias for --verbosity=verbose.
- Add concise failure summaries (step, status, elapsed, log path, failure tail).
- Add JSON output mode with one structured payload to stdout.
- Add configurable per-step log directory env var (follow pre-commit contract).
- Preserve existing pre-push validation steps, including E2E.
- Update docs/skills so pre-commit and pre-push behavior is consistent.
Out of Scope
- Changing which checks run in pre-push.
- Moving E2E out of pre-push.
- CI workflow redesign.
- Broader hook framework rewrite into Rust CLI (future option only).
Implementation Plan
Status values: TODO, IN_PROGRESS, BLOCKED, DONE.
| ID |
Status |
Task |
Notes / Expected Output |
| T1 |
TODO |
Define pre-push CLI/output contract |
Final behavior matrix and error handling documented |
| T2 |
TODO |
Implement hook refactor |
pre-push.sh supports format/verbosity/log-dir parity |
| T3 |
TODO |
Validate behavior in pass and fail paths |
Text concise/verbose + JSON tested with exit-code verification |
| T4 |
TODO |
Update docs and skills |
Workflow docs aligned with pre-push capabilities |
| T5 |
TODO |
Run quality checks and finalize evidence |
linter all and targeted checks pass |
Acceptance Criteria
References
Goal
Refactor the pre-push hook to align its operator experience with the new pre-commit behavior:
concise output by default, verbose streaming on demand, and structured JSON output for automation.
Background
Issue #1769 introduced a stronger CLI and reporting contract for pre-commit, including:
--format=<text|json>--verbosity=<concise|verbose>and--verbosealiascontrib/dev-tools/git/hooks/pre-push.shstill uses legacy output behavior. This creates aninconsistent local workflow and weaker automation ergonomics in the heavier validation gate.
Because pre-push includes nightly checks and E2E, this refactor should keep the check set intact
while improving clarity, observability, and parity with pre-commit.
Scope
In Scope
--format=<text|json>to pre-push withtextas default.--verbosity=<concise|verbose>withconciseas default.--verboseas alias for--verbosity=verbose.Out of Scope
Implementation Plan
Status values:
TODO,IN_PROGRESS,BLOCKED,DONE.pre-push.shsupports format/verbosity/log-dir paritylinter alland targeted checks passAcceptance Criteria
pre-push.shsupports--format=<text|json>and--verbosity=<concise|verbose>with--verbosealias.--format=text --verbosity=conciseprints high-signal per-step summary; failures include log path and short tail.--format=jsonemits one valid JSON document to stdout with step-level status and timing.2, usage hint, and stderr diagnostics.linter allexits with code0References
contrib/dev-tools/git/hooks/pre-commit.sh,contrib/dev-tools/git/hooks/pre-push.shdocs/issues/open/1780-refactor-pre-push-checks-performance-and-verbosity.md