luv

Workshop wiki

approval.lisp

luvcraft/agent/approval.lisp

system luvcraft/agent · 17 definitions · on GitHub

in-package#:luvcraft.agent

A parked tool call is a semantic object, not a closure waiting to happen. The canvas owns every transition; the provider thread only waits on the private mailbox through settle-command-result (#T6PEVY).

defclasstool-approval
agent:initarg:agent:readertool-approval-agent
presence:initarg:presence:readertool-approval-presence
session:initarg:session:readertool-approval-session
state:initform:proposed:accessortool-approval-state
note:initformnil:accessortool-approval-note
created-at:initform
get-internal-real-time
:readertool-approval-created-at
mailbox:initform
sb-concurrency:make-mailbox:name"tool approval"
:readertool-approval-mailbox
lock:initform
sb-thread:make-mutex:name"tool approval"
:readertool-approval-lock
:documentation

One inert proposed tool effect waiting for a player's decision.

defgenericvalidate-tool-approval
approval
:documentation

Signal when approval can no longer be committed.

defgenericcommit-tool-approval
approval
:documentation

Commit approval's already validated semantic payload.

defgenericdetach-tool-approval
approval
:documentation

Remove approval's temporary presence and owned resources.

defgenerictool-approval-focus-camera-pose
approvalpresencesession
:documentation

Return the cinematic pose for approval, or NIL.

defmethodvalidate-tool-approval
declare
ignoreapproval
t
defmethodcommit-tool-approval
error"~S has no commit method."approval
defmethoddetach-tool-approval
declare
ignoreapproval
nil
defmethodtool-approval-focus-camera-pose
presencesession
declare
ignoreapprovalpresencesession
nil
defunfinish-tool-approval
approvalstate&optionalnote

Publish approval's terminal state exactly once and wake its tool call.

let
finished-pnil
sb-thread:with-mutex
tool-approval-lockapproval
when
eq:proposed
tool-approval-stateapproval
setf
tool-approval-stateapproval
state
tool-approval-noteapproval
note
finished-pt
whenfinished-p
unwind-protect
sb-concurrency:send-message
tool-approval-mailboxapproval
approval
approval
defgenericapprove-tool-approval
approval
:documentation

Validate and commit approval, or finish it as failed.

defgenericdeny-tool-approval
approval&optionalnote
:documentation

Reject approval without changing its subject.

defgenericsteer-tool-approval
approvalnote
:documentation

Return approval to its proposer with revision guidance.

defmethodapprove-tool-approval

Decisions originate on the canvas thread, so validation and publication remain one serialized transition with respect to the world.

when
eq:proposed
tool-approval-stateapproval
handler-case
error
condition
finish-tool-approvalapproval:failed
formatnil"~A"condition
approval
defmethoddeny-tool-approval
&optionalnote
finish-tool-approvalapproval:deniednote
defmethodsteer-tool-approval
note
finish-tool-approvalapproval:changes-requestednote
defmethodsettle-command-result
commandt
declare
ignorecommand
if
eq:proposed
tool-approval-stateapproval
sb-concurrency:receive-message
tool-approval-mailboxapproval
approval