Skip to content

chore(ci): per-check input scoping — investigated, not building #405

Closed

Description

@dan-petty

Context & Rationale

The CI cache is all-or-nothing: a single changed file invalidates every gate, so editing a markdown file re-runs mypy, bandit and the full test suite. Each gate reads a knowable subset of the tree — actionlint reads .github/workflows, ruff and mypy read src and tests, docs validation reads docs and the CLI surface — and a gate whose inputs did not change has already been answered.

Scope & Deliverables

  • Context & Rationale*: The CI cache is all-or-nothing: a single changed file invalidates every gate, so editing a markdown file re-runs mypy, bandit and the full test suite. Each gate reads a knowable subset of the tree — actionlint reads .github/workflows, ruff and mypy read src and tests, docs validation reads docs and the CLI surface — and a gate whose inputs did not change has already been answered.
  • Deliverable*: Declare an input glob set per check, fingerprint each set independently, and reuse a cached verdict per check rather than per run. The existing whole-workspace fingerprint becomes the fallback for checks that genuinely read everything.
  • Constraint*: A check must fail closed. An input set that under-declares what a gate reads will report a stale pass, which is worse than re-running it, so the mapping needs to be derived from what each tool is actually invoked against rather than assumed.

Strategic Alignment

  • Milestone: v0.2.23 (Foundational Architectural Guardrails & Project Hygiene)
  • Roadmap Reference: docs/ROADMAP.md

Activity

  1. added this to the v0.2.23 milestone on Sep 22, 2026
  2. added
    type/feature
    scope/cli
    priority/p1-high
    on Sep 22, 2026
  3. changed the title [-]feat(cli): per-check input scoping for the ci cache[/-] [+]chore(ci): per-check input scoping — investigated, not building[/+] on Sep 23, 2026
  4. dan-petty commented on Sep 23, 2026

    @dan-petty
    OwnerAuthor

    Investigated and closing rather than building.

    No wall-clock benefit. The gate runs checks concurrently, so elapsed time is the longest check, not the sum. From this repo's cache entry: test 538.2s, coverage 538.2s, security 77.5s, docs 77.0s, typecheck 75.4s — 1322s of work in 538s of wall clock. Caching typecheck and security perfectly moves the run from 538.2s to 538.2s.

    The one check worth scoping cannot be scoped. Traced with a sys.addaudithook plugin over a real run: test reads k8s/** manifests, Grafana dashboards, docs/ROADMAP.md, .github/workflows/ci.yml, .devcontainer/Dockerfile, .mcp.json, config.yaml, scripts/**, and takes a repo-root listing that turns any new root-level file into an assertion. --cov=src with fail_under = 90 makes every file under src/** an input regardless of imports.

    The mapping is unsafe regardless. 13 input sets were derived from real argv and tool config, then attacked by 3 independent agents each — every one was broken by a demonstrated counterexample. The recurring cause is structural: each check is spawned by the gate, so core/process.py and config/defaults.py:261 decide whether actionlint passes. "Independent input sets" does not hold.

    The entry's own input map was wrong in the fail-open direction. It said ruff reads src and tests; ruff check . walks 780 files including scripts/ and pyproject.toml. Coding from it would have produced the stale pass the constraint warned about.

    Work should go to #406 instead — narrowing test is where the 538s is.

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

    priority/p1-highscope/clitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions