remove: require event_id and source in the response, set source on the event #28

Closed
opened 2026-11-16 16:27:52 +01:00 by michael · 1 comment
Owner

Problem

The removal confirmation (remove returns waiting, the host calls again
with the same operation_id and opts.response) has gaps found in a
code review:

  1. A response is accepted if only schema and operation_id match.
    event_id and source, both required by daw_event_response/v1, are
    never read. A response without them, with a foreign event_id, or
    with an operation_id that was never asked, removes the module.
  2. The event is handed to the sink without source (required by
    daw_event/v1); the sink is expected to add it, which would change a
    finished event.
  3. The answer field is placed in data.answer (see the companion issue
    in DAW/daw-contracts).

Matching a response to the event that was asked is the job of the holder
of the pending event (the host, with the registry planned in
DAW/daw-modul-berhtjan-core); the module does not remember events.

Scope

  • the module sets source on the event it builds
  • read_answer requires event_id and source as non-empty strings
    (completeness, as the contract demands); the correlation itself stays
    with the host
  • the answer field moves to the place the contract decides
  • tests: response without event_id, without source, with a wrong
    operation_id, missing data
  • README: who matches the response to the event

Acceptance criteria

  • depends on the companion issue in DAW/daw-contracts
  • tests first, fragjan code . and make test (Lua 5.1 and 5.4) pass

DAW/daw-contracts (companion issue), DAW/daw-modul-berhtjan-core
(pending decisions registry), DAW/daw-modul-berhtjan-cli#15

## Problem The removal confirmation (`remove` returns `waiting`, the host calls again with the same `operation_id` and `opts.response`) has gaps found in a code review: 1. A response is accepted if only `schema` and `operation_id` match. `event_id` and `source`, both required by `daw_event_response/v1`, are never read. A response without them, with a foreign `event_id`, or with an `operation_id` that was never asked, removes the module. 2. The event is handed to the sink without `source` (required by `daw_event/v1`); the sink is expected to add it, which would change a finished event. 3. The answer field is placed in `data.answer` (see the companion issue in DAW/daw-contracts). Matching a response to the event that was asked is the job of the holder of the pending event (the host, with the registry planned in DAW/daw-modul-berhtjan-core); the module does not remember events. ## Scope - the module sets `source` on the event it builds - `read_answer` requires `event_id` and `source` as non-empty strings (completeness, as the contract demands); the correlation itself stays with the host - the answer field moves to the place the contract decides - tests: response without `event_id`, without `source`, with a wrong `operation_id`, missing `data` - README: who matches the response to the event ## Acceptance criteria - [ ] depends on the companion issue in DAW/daw-contracts - [ ] tests first, `fragjan code .` and `make test` (Lua 5.1 and 5.4) pass ## Related DAW/daw-contracts (companion issue), DAW/daw-modul-berhtjan-core (pending decisions registry), DAW/daw-modul-berhtjan-cli#15
Author
Owner

Implemented on develop

Commits: e7c68da

Pushed. Follow-up points, if any, are tracked in their own issues.

## Implemented on develop Commits: e7c68da Pushed. Follow-up points, if any, are tracked in their own issues.
michael 2026-11-18 11:56:58 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-module-manager#28
No description provided.