Add a registry of pending decisions for decision_required events #24
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type/documentation
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type/refactor
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-modul-berhtjan-core#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A program that asks a question with a
decision_requiredevent has toremember the event until the answer comes: which event was asked, which
field it declared, and whether it was answered already. Today nothing
does that. A response is matched by
operation_idonly, and berhtjan-cliasks the user before the declared field has been checked completely.
Every host (cli, web, api) needs the same thing, and berhtjan-core
already holds the field check and the response check.
Scope
A registry of pending decisions in its own file in berhtjan-core, held in
memory by the host (signatures to be agreed before implementation):
decision_requiredevent: it is checked completely once (schema,type, declared field with the field-type check, response
sourcerules); a faulty event is an error and is not stored; an
event_idthat is already pending is an error
daw_event_response/v1: the registry finds the event byevent_id, checksoperation_id,sourceand the value against thedeclared field, removes the event and returns event and value; an
unknown
event_id, a mismatchingoperation_id, an invalid value anda second response are different errors
daw_error/v1, oneresource_idper error site; texts asdaw_i18n/v1resources en/deResuming the operation (calling the module again with the response)
stays with the host.
Depends on
receiver rules (the place of the field decides what the registry reads)
build_responseis reused; the defects found inits review are a separate issue and should be fixed first
Out of scope
mainjan, later)Acceptance criteria
value, second response, pending list, faulty event
daw_i18n/v1resources,resource_idper error sitefragjan code .andmake test(Lua 5.1 and 5.4) passRelated
DAW/daw-contracts (companion issue), DAW/daw-modul-berhtjan-core#21,
DAW/daw-modul-berhtjan-cli#15, DAW/daw-module-manager (companion issue)
Implemented on main
Commits:
7a098e2,80e9c2f,f223344Pushed. Follow-up points, if any, are tracked in their own issues.