Skip to content

docs-hygiene/audit-noise: detect.sh forks 2+ subshells per markdown line — repo-wide scans time out; fallback lacks a chunking affordance #2741

Description

@kyle-sexton

Measured by the plugin-quality auditor (packet docs-hygiene-audit-noise/20260815T173035Z): 1.47s per 386-line file, 9.8s with a tracked concern file present (per-line parse-concern-value.sh forks), ~700x a grep pass — because shape detection forks 2+ command substitutions per LINE and the convention-root cache is set inside a subshell so it never persists. This is the root cause of the observed >5-minute timeout on the first repo-wide run (1027 files; the session had to hand-chunk 26 ways — PR #2721).

Fix ladder:

  1. Hoist + export the convention-root resolution once per run (one-line class of fix; also repairs AUDIT_NOISE_CONTRACT_ROOT being lost to subshells — auditor F6, which currently makes a configured contract root's bare reviews//handoffs/ child silently exempt against the lib's stated intent, untested in the suite).
  2. Restructure per-line detection to avoid command substitution in the hot loop.
  3. Single-pass awk implementation (structural; ~grep-order runtime).

Related affordance gap (auditor F8): the 0.12.0 clean-tree fallback prescribes a "chunked detect.sh pass" but no script support exists — chunking currently requires shell loops that collide with this fleet's hook-bypass guardrails. Add --chunk N / parallel mode (or make the single pass fast enough that chunking is moot).

Severity: High.

Activity

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions