[P1] Define dual synchronous/asynchronous API contract across RLM libraries #425
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#425
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
Make blocking-capable
prolog-rlmlibrary operations available through both synchronous and asynchronous APIs, following one asynchronous execution path plus a synchronous bridge for callers that want blocking behavior.This is a cross-library contract, not an
agentProlog/-only feature.Current state — 2026-08-18
Canonical
maininspected for this reconciliation:abfc30ebb9f335d5841c1f7910bd474da905ebcf.The core migration is substantially complete:
The old status sentence saying “#52 remains open” and treating #53 as an unfinished dependency was stale. Both #52 and #53 are closed on canonical
main.This issue remains open for the parts of the cross-library contract that do not yet exist end to end: concrete process/test/network tool surfaces under #49/#50, equivalence coverage for those future blocking-capable surfaces, and downstream
agentProlog/approval/TUI responsiveness. The existence of non-blocking pending approval in core does not prove a TUI that has not been built.Design principle
Do not build two independent implementations of every operation.
Prefer:
Code already running inside a bounded async worker calls the trusted execute ABI directly rather than nesting another Future wait.
Required task/future semantics
The reusable asynchronous result abstraction must support at least:
Cross-library coverage
The dual API contract applies where blocking or latency is meaningful, including provider/model requests, streaming, retries, tool/process/network work, MCP lifecycle and invocation, supervised agent work, graph run/resume, approval resolution, and downstream interactive clients.
Immediate/pure operations do not need decorative async twins.
Sync/async equivalence
For the same operation and inputs:
Avoid nested blocking
The async implementation must never internally call the synchronous wrapper for an async operation. The sync wrapper may wait on the async implementation.
Streaming
Streaming model/tool operations should be naturally asynchronous, with a synchronous convenience consumer allowed to collect/iterate the same stream rather than creating a second provider implementation.
Acceptance criteria
agentProlog/can remain interactive while one or more operations are active.Non-goals
References
docs/async-runtime.mddocs/authority-runtime.mdDuplicate of #54 (pre-existing Forgejo mirror with GitHub number parity). Closing this accidental duplicate created by today's open-state sync; #54 stays canonical on Forgejo.