Skip to content

Say in the app's log when a local mode overrides the dashboard's - #522

Merged
mariojgt merged 1 commit into
mainfrom
guard-say-local-mode-override
Nov 26, 2026
Merged

mariojgt merged 1 commit into
mainfrom
guard-say-local-mode-override

Conversation

@mariojgt

Copy link
Copy Markdown
Contributor

PATCHSTACK_MODE in the app's environment wins over the mode chosen in the Patchstack dashboard. That is documented, but nothing said so when it happened: switching the dashboard from monitoring to protection looked like it worked while the app kept observing.

What changed

When PATCHSTACK_MODE is set and differs from the mode the platform delivers, the guard writes one line to the app's log:

[patchstack] PATCHSTACK_MODE=dry-run is set in this environment, so the guard runs in dry-run. The mode chosen in the Patchstack dashboard (block) is not applied. Remove PATCHSTACK_MODE to follow the dashboard.

It is written once per pairing, again if the dashboard's mode later changes, and not during a Next.js production build. The precedence itself is unchanged.

Not in this change

The dashboard still does not show the override. That needs the guard to tell the platform which mode it is running in, which is a change to what the package sends and has to be disclosed in the docs first.

Checked

  • Three new tests in tests/protect/local-mode-override-is-said.test.ts.
  • npm test passes except tests/field-test-cli-log.test.ts (a temp-path difference on my machine). capabilities:check passes.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderbuds

coderbuds Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

🎯 Elite quality (96%) — Small, well-scoped change that surfaces a silent env-over-dashboard mode override with deduplicated logging and tests.

📦 Small

🤖 Written by Claude Code — going by its own attribution. Unknown whether a person read it; agents can report that with the report-ai-usage-tool tool.

🟢 Low risk — 18 lines of code, and nothing that needs a person.

🔎 AI review passed — Coderbuds triage found nothing that should stop this merge.

See how your team is trending →

@mariojgt
mariojgt merged commit 89424c2 into main Nov 26, 2026
28 checks passed
@mariojgt
mariojgt deleted the guard-say-local-mode-override branch November 26, 2026 08:59
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.

1 participant