feat(graphql-server): record refusals as their error code via events record_error - #1810
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Review complete. No issues found — approved ✅. This PR introduces error-event recording for the GraphQL server. It adds
No findings met the confidence threshold; the only adjudicated candidate (confidence 75) concerns generated CLI code outside this PR's diff and is excluded. Reviewed commit: 07f6a74 |
Summary
A refused authenticated mutation is now recorded under the error code
errors.raise_errorraised as the event name, instead of a generic transport-shapedgraphql.error {code, operation}event. The server carries no ladder policy: it forwards the code and the operation, and the tenant's generatedrecord_errorregisters theevent_typesrow (category = 'error',feeds_levels = false) so a trust ladder'srevoked_bynames the code directly, e.g.PRINCIPAL_CHILD_WIDENS.EventsConfiggainsrecordError: string | null(loaded from the newevents_module.record_errorcolumn, keepingrecordEventfor other callers). A tenant whose events module predates the column still loads —recordErrorSqlthrows and the plugin logsfailed to record refusal <code> for <actor>, rather than silently skipping the refusal.Fixture pin bumped to
@pgpm/metaschema-modules@0.44.1, which carries theevents_module.record_errorcolumn (constructive-io/pgpm-modules#126, upstreamed from constructive-io/constructive-db#3683). Both error-events integration suites and the plugin unit tests pass locally.Design: constructive-io/constructive-planning#1986
Link to Devin session: https://app.devin.ai/sessions/835118130e99423c9344bb04415a7398
Open in Devin Desktop: https://app.devin.ai/desktop/session/835118130e99423c9344bb04415a7398?variant=devin
Requested by: @pyramation