Skip to content

fix(drift): explain when violations pass the configured threshold - #418

Merged
stackbilt-admin merged 5 commits into
mainfrom
fix/issue-411-drift-threshold-help
Nov 3, 2026
Merged

stackbilt-admin merged 5 commits into
mainfrom
fix/issue-411-drift-threshold-help

Conversation

@stackbilt-admin

@stackbilt-admin stackbilt-admin commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

drift --ci can 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, strict drift.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 targets main for 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.
  • Final corrected-base 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.

@stackbilt-admin
stackbilt-admin marked this pull request as ready for review November 3, 2026 16:10
@stackbilt-admin
stackbilt-admin merged commit 08f6921 into main Nov 3, 2026
7 checks passed
@stackbilt-admin
stackbilt-admin deleted the fix/issue-411-drift-threshold-help branch November 27, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drift --ci exits 0 with violations at the default threshold

2 participants