feat(tool): port zero minify, errhint, lockutil, installtxn, testrunner - #250
Merged
Conversation
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
Adopts five self-contained, stdlib-only mechanisms from the Zero terminal coding agent (github.com/gitlawb/zero), each verified against hawk, idiomatic, and fully tested.
1.
internal/minify— token-cheaper read-only file views. Go minified via the realgo/parserAST (guaranteed valid); other languages via a string-aware comment stripper; safe whitespace fallback otherwise. Wired into theReadtool as aminifyflag (never changes disk).2.
internal/errhint— classify provider errors (Auth/RateLimit/Connectivity/ModelNotFound/ContextOverflow) into a one-line fixable hint, gated on provider markers so local errors never draw a bogus hint. Careful standalone status-code matching.3.
internal/lockutil— race-correct atomic stale-lock reclaim (rename-aside → liveness probe → live-restore with no-overwrite fallback), POSIX + Windows.4.
internal/installtxn— cross-process staged install/remove with rollback (plugin/skill install paths), POSIX flock + Windows LockFileEx.5.
internal/testrunner— auto-detect test/verify commands (Go/npm/bun/pnpm/yarn/pytest/cargo) and parse runner output into structured counts + failure locations.All five are boundary-compliant (zero
eyrie/clientimports; inline/portable, no new external deps beyondgolang.org/x/sysalready ingo.mod). README adopted-capabilities table updated.Verification
go build ./...,go vet, full./internal/{minify,errhint,lockutil,installtxn,testrunner,tool}suites green