Package com.tnsai.security
Class InvocationContext
java.lang.Object
com.tnsai.security.InvocationContext
Trusted interaction provenance, separate from executing agent and executor principal.
Root factories belong to host ingress, not model arguments or arbitrary request fields.
USER denotes an interaction category, not an authenticated account. This API is not a JVM sandbox.
-
Method Summary
Modifier and TypeMethodDescriptionactor()static InvocationContextautonomous(AccessSubject executingAgent, String executorId, AuthorityScope authority) Use only for the actual agent's own initiative, never for forwarded or human work.<T> Tcallers()static Optional<InvocationContext> current()delegateTo(AccessSubject nextAgent, String nextExecutorId, AuthorityScope nextAuthority) Trusted host transfer to the actual recipient agent.static InvocationContextotherAgent(AccessSubject callerAgent, AccessSubject executingAgent, String executorId, AuthorityScope authority) Trusted peer ingress.voidsubjects()static InvocationContextCarries an unclassified ingress without granting any execution category.static InvocationContextuser(AccessSubject human, AccessSubject executingAgent, String executorId, AuthorityScope authority) Host-owned human interaction boundary; the subject may be a stable anonymous chat identity.static Runnablestatic <T> Callable<T> Captures the current provenance and restores worker state on success, failure or cancellation.
-
Method Details
-
user
public static InvocationContext user(AccessSubject human, AccessSubject executingAgent, String executorId, AuthorityScope authority) Host-owned human interaction boundary; the subject may be a stable anonymous chat identity. Stored@Idempotentresults are shared by everyone presenting the same subjects, roles, origin, agent and executor, so a subject id must name one principal: a single anonymous id shared by many people lets them read each other's cached results. -
autonomous
public static InvocationContext autonomous(AccessSubject executingAgent, String executorId, AuthorityScope authority) Use only for the actual agent's own initiative, never for forwarded or human work. -
otherAgent
public static InvocationContext otherAgent(AccessSubject callerAgent, AccessSubject executingAgent, String executorId, AuthorityScope authority) Trusted peer ingress. For an existing invocation use delegateTo to preserve its origin. -
unknown
Carries an unclassified ingress without granting any execution category. -
cachePartition
-
actor
-
executingAgent
-
onBehalfOf
-
executorId
-
callers
-
authorities
-
subjects
-
current
-
delegateTo
public InvocationContext delegateTo(AccessSubject nextAgent, String nextExecutorId, AuthorityScope nextAuthority) Trusted host transfer to the actual recipient agent. The departing agent is derived from this context, never supplied by the caller. Every prior authority and subject remains. A USER peer hop requires USER and OTHER_AGENT; peer work can never become SELF again. -
call
- Throws:
Exception
-
run
-
wrap
Captures the current provenance and restores worker state on success, failure or cancellation. -
wrap
-