Skip to content

#1908 S6: Site leak-check hook point #1932

Open

Description

@gerchowl

Implementation sub-issue S6 of #1908, from the accepted ADR-site-agnostic-projects (section Implementation; amended by #1923: every lane defaults to SMALL). The ADR is the design; this text is copied from it verbatim.

Merge order for release N: S1 → S1d → S1b → S2 → S3. S4, S5 and S6 are independent. S7/S7b follow S1–S6, S8 gates release N, and S9 is release N+2. See the ADR's file-overlap table.

  • Scope: §10 leak check.
  • Files: packages/vig-utils/src/vig_utils/site_leak_check.py,
    packages/vig-utils/pyproject.toml (the site-leak-check console-script
    line), nix/hooks.nix (a separate entry from S5), and tests.
  • Acceptance:
    • no pattern file: exit 0 and silent;
    • the DEVKIT_LEAK_PATTERNS and .site/ lookup order;
    • a staged match fails, with redacted output;
    • a tracked or in-tree pattern file is an error;
    • --all-files mode scans the tree.

Refs #1908

Activity

  1. added this to the 1.19.0 milestone on Oct 27, 2026
  2. added
    feature
    on Oct 27, 2026
  3. gerchowl commented on Oct 27, 2026

    @gerchowl
    ContributorAuthor

    S4 coordination for #1930 / PR #1938: .site/leak-patterns.toml keeps its ADR §10 name and location. S4 will validate TOML parsing and the optional [[rules]] array shape (each rule has string id and regex) only. It will not apply site-binding credential-key or URI-userinfo restrictions to gitleaks configs; secretGroup, userinfo-matching regexes, and allowlists remain supported. Gitleaks retains semantic validation. The module docstring will record this boundary.

  4. gerchowl commented on Oct 27, 2026

    @gerchowl
    ContributorAuthor

    Implemented point-of-use validation: a present leak-patterns.toml must contain at least one [[rules]] entry with nonempty string id and regex, otherwise site-leak-check exits 2 and names the file without printing patterns; a missing file remains a silent no-op.

  5. gerchowl commented on Oct 27, 2026

    @gerchowl
    ContributorAuthor

    S6 now calls vig_utils.site_config.validate_patterns(Path) from merged S4 (#1938); the local pattern_error() implementation is deleted. The single pattern-file rule is S4's pattern-file clarification (shared with S6) in the ADR Amendments.

    S6 preserves the shared validator's safe filename/key message and returns exit 2 for validation errors. A missing selected pattern file remains a silent no-check; an explicit missing path does not fall back to local patterns. Site-binding credential restrictions are not applied to pattern values.

  6. 100 remaining items

  7. added a commit that references this issue on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions