From the poka-yoke audit of 2026-09-04. Lens: fixed-value. Today: rung 0. Device reaches: rung 1 (Control). Silent.
The mistake available
Add a wsPolicy constant and miss one switch.
internal/api/ws_policy.go:120:
default:
return ev, true // pass the event through, unredacted
What happens
A read-scoped token receives the admin shape of an event — the redaction
that the policy exists to apply is skipped entirely. Silent: the socket works,
the event arrives, and it carries more than it should.
This is the same shape as requireScope treating an unrecognised scope string
as read-only, which the code gets right and documents:
A value that arrived from a newer schema or a hand-edited row should narrow
what a credential can do, never widen it.
The policy switch does the opposite.
Today
Rung 0. There is no .golangci.yml, so none of the 62 switch-without-default
sites has a linter behind it.
Device → rung 1, Control here
default: drops the event — fail closed. One arm, and it makes the
widening impossible rather than conventional.
Repo-wide, exhaustive in golangci-lint is the Warning that catches the
next one at the moment it is written.
From the poka-yoke audit of 2026-09-04. Lens: fixed-value. Today: rung 0. Device reaches: rung 1 (Control). Silent.
The mistake available
Add a
wsPolicyconstant and miss one switch.internal/api/ws_policy.go:120:default: return ev, true // pass the event through, unredactedWhat happens
A read-scoped token receives the admin shape of an event — the redaction
that the policy exists to apply is skipped entirely. Silent: the socket works,
the event arrives, and it carries more than it should.
This is the same shape as
requireScopetreating an unrecognised scope stringas read-only, which the code gets right and documents:
The policy switch does the opposite.
Today
Rung 0. There is no
.golangci.yml, so none of the 62 switch-without-defaultsites has a linter behind it.
Device → rung 1, Control here
default:drops the event — fail closed. One arm, and it makes thewidening impossible rather than conventional.
Repo-wide,
exhaustivein golangci-lint is the Warning that catches thenext one at the moment it is written.