Repository navigation
fix: harden evidence guard and command gate freshness - #5
Merged
Merged
Conversation
- Block case variants and Windows trailing-dot/short-name aliases of protected .junto/ evidence paths in the guard hook. - Bind command gate verdicts to source contents outside staleIgnore in Git repository roots, so edits that bypass the edit hooks (Bash, formatters, codegen) make them stale at the next transition. - Persist rule obligations and phase transitions under the task lock and refuse done if a required gate was invalidated during the transition. - Reject reserved Windows device names for review gates.
Node.js 20 reached end of life on 2026-04-30. CI tests Node.js 22.12 and 24, and plugin bundles target Node.js 22.
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
Closes gaps between what Junto's evidence promises and what it enforces.
guard.jsmatched protected paths case-sensitively on the raw path, so.JUNTO/tasks/t/verdicts/unit.jsonor.junto/tasks/t/Verdicts/...were allowed, even though Windows and macOS write them to the protected evidence. The existing path prefix is now canonicalized withrealpath.native(case, 8.3 short names, symlinks), Windows trailing dots/spaces are dropped from new segments, and matching is case-insensitive.donereachable. In a Git repository root, command gate verdicts now carry asourceFingerprintover file contents outsidestaleIgnoreplus the gate spec;advance/statusrecompute it and treat a mismatch as stale. Commits of unchanged content and Markdown edits keep the verdict fresh. Projects without a Git repository root keep the hook-only behavior. Fingerprints are hashed outside the task lock so edit hooks are not starved.advance,planandverifywrotetask.jsonfrom an unlocked snapshot, which could drop concurrent hook updates (staleness, user approval). Rule obligations (monotonic) are merged under the lock, the phase transition is applied to the latest task, anddoneis refused if a required gate was invalidated during the transition.nul,con, ...) like command gates.The second commit requires Node.js 22.12 (Node.js 20 reached end of life on 2026-04-30), tests Node.js 22.12 and 24 in CI, targets Node.js 22 in the bundles, and updates
@modelcontextprotocol/sdkto 1.30.1. Each commit's plugin bundles were built from that commit's lockfile and target.Verification
corepack pnpm typecheck— passes on both commitscorepack pnpm build— bundles rebuilt per commitcorepack pnpm test— 378 passed, 4 platform/optional skips on both commits. New tests: guard case and Windows aliases; source-bound command gates (Bash-style edit blocksdone, staleIgnore and unchanged-content commits do not, revert restores freshness); policy persistence keeps a concurrent approval; device-name review gates.Compatibility
engines); the hooks and MCP server run on the user'snode.sourceFingerprintfield;SCHEMA_VERSIONstays 1. Existing command verdicts without it keep the previous hook-only behavior until rerun.advance/statushash tracked sources once per fingerprinted command gate.