Skip to content

audit: plugin rules that read a discovery probe keep it under --rule-exclude ax (once the CLI loads plugins) #1375

Closed

Description

@nc9

Split from #422. selectDiscoveryProbes (packages/rules/src/discovery-probes.ts) already accepts plugin rule namespaces and keeps a probe a plugin rule declares in its meta.discoveryProbes, and rules/tests/discovery-probes.test.ts pins that. But the CLI never loads plugins: nothing in apps/cli builds additionalNamespaces, so controllers/audit.ts has none to pass, and the rule runner gets none either.

When the CLI loads plugin rule namespaces, the same list must reach both the rule runner and selectDiscoveryProbes, or a plugin rule that reads a probe loses it under --rule-exclude ax.

Acceptance Criteria

  • The audit controller passes the plugin rule namespaces it loads to both the rule runner and selectDiscoveryProbes.
  • A plugin rule that declares a discovery probe keeps that probe when --rule-exclude ax is set, asserted through the controller (a test with a plugin namespace and the request log or the selected probe list).
  • With no plugins loaded nothing changes: the default probe set is the same as today.

Activity

  1. added
    size: S
    rules
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
  3. nc9 commented on Nov 4, 2026

    @nc9
    ContributorAuthor

    Acceptance check against main 8d22fa2 (fix shipped in v0.0.163):

    # Criterion Result Evidence
    1 The audit controller passes the plugin rule namespaces it loads to both the rule runner and selectDiscoveryProbes PASS apps/cli/src/controllers/audit.ts: RunAuditOptions.pluginNamespaces, passed as additionalNamespaces to selectDiscoveryProbes and to the runner scope; packages/rules/src/runner.ts moves additionalNamespaces into RunnerScope so createRunner carries it.
    2 A plugin rule that declares a discovery probe keeps it under --rule-exclude ax, asserted through the controller PASS apps/cli/tests/audit/plugin-discovery-probes-1375.test.ts drives runAudit with ruleExclude: ["ax/*"]: with a plugin namespace declaring /openapi.json the request log contains /openapi.json and /security.txt, not /swagger.json or /AGENTS.md, and the plugin rule ran once; the control without the plugin has no /openapi.json.
    3 With no plugins loaded nothing changes: the default probe set is the same PASS With pluginNamespaces undefined both call sites pass undefined (the runner spread is conditional). packages/rules/tests/discovery-probes.test.ts "every probe has a reader, so a default audit still sends all of them" and the control case above pass.

    Ran: bun test tests/audit/plugin-discovery-probes-1375.test.ts in apps/cli (2 pass) and bun test tests/discovery-probes.test.ts in packages/rules (10 pass).

    Not verifiable from here: nothing in the CLI builds pluginNamespaces yet (the issue is explicitly "once the CLI loads plugins"), so the end-to-end plugin loading path is out of scope of this issue.

    nik

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

    clirulessize: S

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions