You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
audit: plugin rules that read a discovery probe keep it under --rule-exclude ax (once the CLI loads plugins) #1375
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.
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.
Activity
fix(audit): pass plugin rule namespaces to the runner and discovery p…
nc9 commentedon Nov 4, 2026
Acceptance check against main 8d22fa2 (fix shipped in v0.0.163):
selectDiscoveryProbesapps/cli/src/controllers/audit.ts:RunAuditOptions.pluginNamespaces, passed asadditionalNamespacestoselectDiscoveryProbesand to the runner scope;packages/rules/src/runner.tsmovesadditionalNamespacesintoRunnerScopesocreateRunnercarries it.--rule-exclude ax, asserted through the controllerapps/cli/tests/audit/plugin-discovery-probes-1375.test.tsdrivesrunAuditwithruleExclude: ["ax/*"]: with a plugin namespace declaring/openapi.jsonthe request log contains/openapi.jsonand/security.txt, not/swagger.jsonor/AGENTS.md, and the plugin rule ran once; the control without the plugin has no/openapi.json.pluginNamespacesundefined both call sites passundefined(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.tsinapps/cli(2 pass) andbun test tests/discovery-probes.test.tsinpackages/rules(10 pass).Not verifiable from here: nothing in the CLI builds
pluginNamespacesyet (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