Skip to content

[ENG-4600] Say where the guard's rules come from - #506

Open
terdelyi wants to merge 3 commits into
mainfrom
tamase/eng-4600-users-cannot-make-sense-of-the-rule-counts
Open

terdelyi wants to merge 3 commits into
mainfrom
tamase/eng-4600-users-cannot-make-sense-of-the-rule-counts

Conversation

@terdelyi

@terdelyi terdelyi commented Nov 19, 2026 •

Copy link
Copy Markdown

Closes ENG-4600 (the Connect part; the widget change is patchstack/sass-webvdp-widget#198)

Setup said 17 rules and the runtime check said 26. Both were right, but they counted different things, and nothing said so. 17 is what Patchstack delivered. 26 also includes the guard's own response rules, and left out outgoing rules.

  • The guard's synchronization.rules now has delivered (from Patchstack, or the bundled rules file when the lookup failed) and local (the guard's own response and outgoing rules, including any the host configures). request, response and egress count both, so they add up to the two.
  • The runtime check prints "17 rules from Patchstack + 11 of the guard's own (6 request / 20 response / 2 outgoing)". When the rules did not come from a lookup it says "from its bundled rules file". A guard on an older version still gets the old "6 request / 20 response rules".
  • "map-scoped rules in blocking mode" is now "rules for this app's own routes in blocking mode".
  • Setup and its summary say "17 protection rules from Patchstack" instead of "available". Setup's lookup line adds "on top of the guard's own" only when the app has a server.
  • One rule reads "1 rule", not "1 rules".

AGENT-INSTALL.md shows the summary line, so its example changes too. That file is audited from the published tarball, so the hostile field run (node field-test/run.mjs --persona hostile --rounds 3) is still outstanding and has to run after the release that carries this.

Tests: npm test passes (4753). New tests check that the counts add up, the wording for fetched and bundled rules, the singular, and the older-guard fallback.

…in rules

- the guard's status reports delivered and built-in rule counts
- the runtime check prints them as 'N rules from Patchstack + M built into the guard'
- 'map-scoped rules' is now 'rules for this app's own routes'
- setup's rule lookup line says the delivered rules sit on top of the built-in ones
@coderbuds

coderbuds Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🎯 Elite quality (96%) — Clarifies rule-count wording by splitting delivered and local rules, with matching runtime, CLI and report updates.

📦 Small

🟠 Elevated risk — the author's first change to this repository.

✅ Reviewed — approved by @daniloradovic.

See how your team is trending →

…e from

- the runtime check's split includes outgoing rules, so it adds up to the two totals
- rules are 'from Patchstack' only when fetched; otherwise 'from its bundled rules file'
- the guard's own rules count is 'local', which also covers rules the host configures
- setup and the summary say 'protection rules from Patchstack' instead of 'available'
- setup does not mention the guard for an app with no server
- one rule is 'rule', not 'rules'
@terdelyi

Copy link
Copy Markdown
Author

/review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants