Ask the field of a decision_required event and return the response #15

Closed
opened 2026-11-15 19:41:01 +01:00 by michael · 2 comments
Owner

Problem

A module asks a question with a daw_event/v1 (decision_required) that
carries a field declared with daw_field_type/v1. berhtjan-cli cannot
answer it yet: prompt() reads every field as free text and ignores the
field type, confirm() is a fixed yes/no with fixed texts and knows no
event. The adapter must show the question, read the answer and hand back a
daw_event_response/v1, without knowing any module.

First use case: yes/no confirmation before a module is removed
(DAW/daw-module-manager), declared as a selection / static / single
field with two answers.

Scope

  • one public function: event, catalogs, languages -> daw_event_response/v1
    | daw_error/v1
  • the question text is resolved from the event's resource_id
    (daw_i18n/v1)
  • the declared field is asked through the closed vocabulary only
    (acquisition[].kind, cardinality, collection.source), with the
    input functions from #14; first step: selection / static as a
    choice by number. The adapter works with positions internally and
    returns the declared value, never an entered text
  • each answer is shown as its resource_id resolved from the catalogs,
    falling back to its canonical message (same pattern as daw_error/v1)
  • the CLI never switches on or lists value.kind, in code or in a table
  • the value goes to the response function in berhtjan-core (companion
    issue in DAW/daw-modul-berhtjan-core); the response is returned to the
    caller, no transport here
  • combinations the CLI cannot present return a daw_error/v1
  • EOF is input_ended, as in prompt() and confirm()

Provisional (marked as such until validated)

  • placement of the field (data.answer) and of the value (data.value)
  • the form of collection.values entries (object with value, message,
    resource_id), see the companion issue in DAW/daw-contracts

Out of scope

  • transport of events and responses (host)
  • removing confirm(): it stays until DAW/fragjan no longer uses it,
    then a separate issue

Acceptance criteria

  • depends on #14 and on the companion issue in berhtjan-core
  • signatures agreed before implementation
  • own texts as daw_i18n/v1 resources, resource_id per error site
  • fragjan code . and make test (Lua 5.1 and 5.4) pass

DAW/daw-modul-berhtjan-cli#14, DAW/daw-contracts (daw_event/v1,
daw_event_response/v1, daw_field_type/v1), DAW/fragjan#137

## Problem A module asks a question with a `daw_event/v1` (`decision_required`) that carries a field declared with `daw_field_type/v1`. berhtjan-cli cannot answer it yet: `prompt()` reads every field as free text and ignores the field type, `confirm()` is a fixed yes/no with fixed texts and knows no event. The adapter must show the question, read the answer and hand back a `daw_event_response/v1`, without knowing any module. First use case: yes/no confirmation before a module is removed (DAW/daw-module-manager), declared as a `selection` / `static` / `single` field with two answers. ## Scope - one public function: event, catalogs, languages -> `daw_event_response/v1` | `daw_error/v1` - the question text is resolved from the event's `resource_id` (`daw_i18n/v1`) - the declared field is asked through the closed vocabulary only (`acquisition[].kind`, `cardinality`, `collection.source`), with the input functions from #14; first step: `selection` / `static` as a choice by number. The adapter works with positions internally and returns the declared `value`, never an entered text - each answer is shown as its `resource_id` resolved from the catalogs, falling back to its canonical `message` (same pattern as `daw_error/v1`) - the CLI never switches on or lists `value.kind`, in code or in a table - the value goes to the response function in berhtjan-core (companion issue in DAW/daw-modul-berhtjan-core); the response is returned to the caller, no transport here - combinations the CLI cannot present return a `daw_error/v1` - EOF is `input_ended`, as in `prompt()` and `confirm()` ## Provisional (marked as such until validated) - placement of the field (`data.answer`) and of the value (`data.value`) - the form of `collection.values` entries (object with `value`, `message`, `resource_id`), see the companion issue in DAW/daw-contracts ## Out of scope - transport of events and responses (host) - removing `confirm()`: it stays until DAW/fragjan no longer uses it, then a separate issue ## Acceptance criteria - [ ] depends on #14 and on the companion issue in berhtjan-core - [ ] signatures agreed before implementation - [ ] own texts as `daw_i18n/v1` resources, `resource_id` per error site - [ ] `fragjan code .` and `make test` (Lua 5.1 and 5.4) pass ## Related DAW/daw-modul-berhtjan-cli#14, DAW/daw-contracts (`daw_event/v1`, `daw_event_response/v1`, `daw_field_type/v1`), DAW/fragjan#137
Author
Owner

Cross references

## Cross references - Depends on DAW/daw-modul-berhtjan-cli#14 (input functions) and DAW/daw-modul-berhtjan-core#21 (build and check the response) - Contract question: DAW/daw-contracts#17 (form of `collection.values` entries); the object form used here is provisional until it is decided
Author
Owner

Implemented on develop

Commits: a67221f, 64f03d0, d7a196d

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

## Implemented on develop Commits: a67221f, 64f03d0, d7a196d Pushed. Follow-up points, if any, are tracked in their own issues.
michael 2026-11-18 11:58:20 +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-modul-berhtjan-cli#15
No description provided.