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
[Bug]: store editable does not stop the owner's increments, so an approved record's value can still change #989
main at 348920f, Node 26 with node:sqlite, macOS, store package test harness (test/direct.ts).
Summary
editable refuses PUT/PATCH outside the named states, but POST <mount>/<id>/increment/<property> still changes the record. On an owned collection the owner can run it. So a collection declaring both editable and increments lets the owner change a value of a record after it was approved.
packages/store/SECURITY.md and docs/STORE.md do list increments as not gated. But the guarantee the feature is sold on says otherwise:
STORE.md: "editable is what keeps the approved version as it was".
The authoring contract: "so an approved request keeps the values its reviewer saw".
The owner creates {title: x, amount: 6}, submits it, and a reviewer approves it: amount is 6 and status is approved. Then the owner sends POST /api/requests/<id>/increment/amount.
Observed: 200 with amount: 7, status: approved. The same record's PATCH/PUT/DELETE correctly answer 409 record_locked, and the Allow header is GET, HEAD.
Expected: either the increment is refused outside editable (409 record_locked), or activation refuses an increments property on a collection that declares editable unless that property is excluded explicitly.
Also checked (sound)
A PUT naming status is refused.
An Idempotency-Key replay of a pre-lock PATCH only replays (idempotency-replayed: true) and writes nothing.
Another owner's list carries an empty allow.
Assumed
Not every increments use needs gating: a view counter on a published record probably should keep counting. So this may be a documentation fix (drop the unconditional "keeps the values its reviewer saw") plus an opt-in, rather than a behavior change. That is a design decision for the maintainer.
Activity
fix(store): refuse lone surrogates at every JSON boundary; editable g…