Milestone 2.2: result and input protocol between module, host adapter and berhtjan #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
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
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-module-manager#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?
Goal
Installing a module works end to end: the module returns results and
questions as data, the host program intercepts them, decides how to handle
errors, hands them to berhtjan for display and input, and calls the module
again with the answer.
Background
berhtjan-cli passes the return value of a handler through unchanged and does
not present it. Only the host knows how errors are to be handled, so the
host adapter is where results are intercepted. The contracts for questions
and answers exist already (daw_event/v1 with decision_required,
daw_event_response/v1).
Scope
opts.decision) with daw_event/v1 and daw_event_response/v1
update_index) as a contract in the README
berhtjan and asks through berhtjan (cross-repo issue in DAW/fragjan)
configuration table
exists (see DAW/daw-module-manager#22)
Acceptance criteria
berhtjan and continues with the answer
berhtjan, decided by the host
Status after v2.0.0. Done: every function returns a result as data, documented in the README; progress and warnings are daw_event/v1 events through the interim sink opts.emit (see DAW/daw-module-manager#22); the host (fragjan) intercepts the results, shows them through berhtjan and asks through berhtjan-cli; the host gives the module only the fields it asks for. Changed: install without a version no longer asks, it takes the newest compatible version ('opts.decision' with install-select stays for a choice the caller makes itself). Open: the questions of the module (upgrade_required, confirmation_required, dependents_present) are returned as statuses, and the host answers by calling again with a flag (upgrade, confirmed, with_dependents). This is a stopgap, and the host has to know these statuses. The contract describes a question as a decision_required event during the operation, answered by a daw_event_response/v1. The way events leave a module and answers come back is the host-wide event delivery, which does not exist yet (DAW/daw-module-manager#22 is its interim twin for the progress events). The questions are to be asked as decision_required events once it does.
The questions of this module and the questions of the fragjan catalog (DAW/fragjan#137) are the same kind of thing: a question that reaches the user through whatever UI there is, and an answer that comes back. They are meant to use one mechanism, so that the same question works in a CLI, web, API or desktop UI. The stopgap of this module (statuses answered by a second call with a flag) is to be replaced by decision_required events once the host-wide event delivery exists. A first validation of that path with one question of this module (the confirmation of a removal) is planned. This comment changes nothing in the scope above.