Repository navigation
fix(drift): explain when violations pass the configured threshold - #418
Merged
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.
drift --cican correctly report ordinary pattern violations and still pass the configured score threshold, but the output did not explain that distinction. Show an explicit CI policy explanation beside reported violations and document the default 0.7 threshold, strictdrift.minScore: 1, security-deny overrides, and non-CI reporting behavior.Closes #411.
The default score formula, threshold, exit codes, and JSON fields are unchanged. Clean text output does not gain violation-only guidance; JSON remains a single unchanged-shape document. This does not add per-pattern blocking configuration.
Prerequisite and scope
This branch includes PR #415's escaped-slash extractor repair and its independently confirmed malformed-regex correction through
1102c1be27a1194e6dbe0f1fb362dfe91dc0d4bd. The #411-only comparison is against that commit. The PR targetsmainfor branch-filtered CI; merge the corrected prerequisite first or preserve its ancestry when incorporating this branch. There was no force-push: the branch was restacked before its first push, and the original unpublished commits were retained on a local backup branch.Only three issue-specific files changed: drift text output, CI integration docs, and a new built-CLI regression suite. Original LF line endings are preserved.
Validation
Isolated Windows Node 24.19.0 / pnpm 9.15.9 worktree:
pnpm install --frozen-lockfile: passed after retrying registry access outside the sandbox. The denied installer was stopped before the successful retry; no overlapping installs.pnpm run build,pnpm run typecheck: passed after restacking on the corrected extractor.pnpm exec vitest run packages/drift/src/__tests__ packages/cli/src/__tests__/drift-threshold-cli.test.ts: 49/49 passed. Six new built-CLI cases cover default pass with reported violations, strict rejection, security-deny blocking despite a 100% ordinary score, clean output, JSON key/meaning stability, and non-CI exit behavior.pnpm run docs:check: passed (optional docs-sync config absent, papers-lint passed).git diff --check: passed. Required smart-commit preview and commit TypeScript/ADF gates passed.pnpm run test: 1,946 passed, four failed, 1,950 total, 172.57 seconds. The four failures match the established Windows baseline (bootstrap POSIX-path premise, context-refresh/serve-context separators, and Ctrl-D fake TTY). Log:.cache/issue-411-corrected-full-tests.log.An earlier full run on the old prerequisite was 1,940 passed/four known Windows failures and is not used as final corrected-base evidence. Current main's dependency-audit failure is repaired separately by major-version PR #413; this PR does not weaken that gate. No merge, tag/main push, publication, deployment, production-data change, or remote branch deletion performed.