Skip to main content

Layer 1 · principals

delegation

blocks/1-principals/delegation.yaml

layer 1principals
1entity
5commands
5events
2views
23refusals
5KPIs

One principal acts for another. A delegation names who is acted for, who acts, the one decision the delegate may take (answer a question, approve, merge, publish, control a session, commit, push) and when it expires. Each act under a delegation names what it acted on. A chain of delegations must end at a human: the first link is granted by a human, every later link is granted by the delegate of a link that is still active. A delegation that would not end at a human, that closes a cycle, or that a delegate uses outside its scope is refused. An operator agent acting for its owner is the common case.

Depends on​

Used by​

Entities​

Delegation​

The delegate may take one kind of decision for the delegator, within the chain that ends at the root human. Active until revoked or expired; revoking a link ends the links granted from it.

Identified by delegation_id (DelegationId).

fieldtypemeaning
delegatorPrincipalIdThe principal acted for.
delegatePrincipalIdThe principal that acts.
actionDelegatedAction
rootPrincipalIdThe human the chain ends at; the delegator itself on the first link.
parent_delegation_idoptional DelegationIdThe link the delegator acts by; absent on the first link, whose delegator is the human.
granted_attimestamp
expires_atoptional timestampAbsent means no expiry; the delegation then ends only by revocation.
last_acted_atoptional timestampThe instant of the last decision taken under this delegation; absent until one is.
excludeslist of NameThe rules the delegate cannot lift although the delegator could order around them: a permission block, a rule of an organization. A later link carries the excludes of its parent.

Relations:

  • delegator_principal references Principal of principal (one, by delegator)
  • delegate_principal references Principal of principal (one, by delegate)
  • root_principal references Principal of principal (one, by root)
  • parent references Delegation (one, by parent_delegation_id)

Lifecycle of Delegation

ActiveExpiredRevokedrevokeexpireActiveExpiredRevokedrevokeexpire
Ends in Expired, Revoked.

Commands​

ActUnderDelegation​

Act under a delegation. The delegate takes one decision for the delegator and names the delegation it relies on. Default deny: no active link that carries this action for this principal, no decision. The event names the delegation, so the decision traces to the root human of its chain, and the subject it acted on.

fieldtype
delegation_idDelegationId
principal_idPrincipalId
actionDelegatedAction
subjectSubject
attimestamp
outcomewhenresult
no-such-delegation refusedno such DelegationUnknownDelegation: No delegation of this identity was granted.
not-active refusedthe Delegation is Expired or RevokedDelegationStateConflict: The delegation is not in a state this command acts from.
not-the-delegate refuseddelegate != input.principal_idNotTheDelegate: The principal is not the delegate of the link: it cannot grant onward from it or act by it.
outside-scope refusedaction != input.actionActionOutsideScope: The delegation does not carry the requested action.
past-expiry refusedexpires_at <= input.atDelegationExpired: The delegation's expiry has passed.
actedotherwiseupdates the Delegation; emits DelegatedActionTaken

DelegateOnward​

Delegate onward from a link. A later link of a chain. The delegator is the delegate of an active link and passes on the same action; the new link keeps the root human of its parent, so every chain still ends at a human.

fieldtype
delegation_idDelegationId
parent_delegation_idDelegationId
delegatorPrincipalId
delegatePrincipalId
actionDelegatedAction
expires_atoptional timestamp
attimestamp
outcomewhenresult
expiry-not-after-grant refuseddefined(expires_at) and expires_at <= atInvalidExpiry: The expiry is not after the instant the delegation is granted.
self-delegation refuseddelegator == delegateDelegationCycle: The delegate is the delegator, is the root human, or already holds this action under an active delegation; granting it would close a cycle.
no-such-parent refusedno Delegation for parent_delegation_idUnknownDelegation: No delegation of this identity was granted.
parent-not-active refusedthe Delegation of parent_delegation_id has state != ActiveDelegationStateConflict: The delegation is not in a state this command acts from.
delegator-not-parent-delegate refusedthe Delegation of parent_delegation_id has delegate != input.delegatorNotTheDelegate: The principal is not the delegate of the link: it cannot grant onward from it or act by it.
action-outside-parent-scope refusedthe Delegation of parent_delegation_id has action != input.actionActionOutsideScope: The delegation does not carry the requested action.
delegatedotherwisecreates a Delegation in Active; emits DelegationPassedOn

ExpireDelegation​

Record that a delegation expired.

fieldtype
delegation_idDelegationId
attimestamp
outcomewhenresult
no-such-delegation refusedno such DelegationUnknownDelegation: No delegation of this identity was granted.
no-expiry refusednot (defined(expires_at))NotYetExpired: The delegation has no expiry or its expiry has not passed, so it is not recorded as expired.
not-yet-expired refusedexpires_at > input.atNotYetExpired: The delegation has no expiry or its expiry has not passed, so it is not recorded as expired.
expiredotherwisemoves the Delegation Active → Expired; emits DelegationExpiredRecorded
wrong-state refusedthe Delegation is in a state that does not allow itDelegationStateConflict: The delegation is not in a state this command acts from.

GrantDelegation​

Grant a delegation from a human. The first link of a chain. The delegator must be a human; a delegator that is not a human has no chain that ends at one.

fieldtype
delegation_idDelegationId
delegatorPrincipalId
delegatePrincipalId
actionDelegatedAction
expires_atoptional timestamp
excludeslist of Name
attimestamp
outcomewhenresult
expiry-not-after-grant refuseddefined(expires_at) and expires_at <= atInvalidExpiry: The expiry is not after the instant the delegation is granted.
self-delegation refuseddelegator == delegateDelegationCycle: The delegate is the delegator, is the root human, or already holds this action under an active delegation; granting it would close a cycle.
no-such-delegator refusedno Principal for delegatorUnknownPrincipal: No principal of this identity is registered.
delegator-not-human refusedthe Principal of delegator has kind != HumanChainDoesNotEndAtHuman: The delegation would not end at a human: a delegation with no parent link has a delegator that is not a human.
delegator-retired refusedthe Principal of delegator has state == RetiredPrincipalRetired: A retired principal neither grants nor receives a delegation.
grantedotherwisecreates a Delegation in Active; emits DelegationGranted

RevokeDelegation​

Revoke a delegation. The delegator of a link ends it. The links granted directly from it end with it.

fieldtype
delegation_idDelegationId
principal_idPrincipalId
attimestamp
outcomewhenresult
no-such-delegation refusedno such DelegationUnknownDelegation: No delegation of this identity was granted.
not-the-delegator refuseddelegator != input.principal_idNotTheDelegator: The acting principal is not the delegator of this delegation.
revokedotherwisemoves the Delegation Active → Revoked; moves each Delegation with parent_delegation_id == subject.delegation_id to Revoked; emits DelegationRevoked
wrong-state refusedthe Delegation is in a state that does not allow itDelegationStateConflict: The delegation is not in a state this command acts from.

Events​

eventfieldsemitted by
DelegatedActionTakendelegation_id DelegationId, delegate PrincipalId, action DelegatedAction, subject Subject, at timestampActUnderDelegation
DelegationExpiredRecordeddelegation_id DelegationId, at timestampExpireDelegation
DelegationGranteddelegation_id DelegationId, delegator PrincipalId, delegate PrincipalId, action DelegatedAction, expires_at optional timestamp, excludes list of Name, at timestampGrantDelegation
DelegationPassedOndelegation_id DelegationId, parent_delegation_id DelegationId, delegate PrincipalId, action DelegatedAction, expires_at optional timestamp, at timestampDelegateOnward
DelegationRevokeddelegation_id DelegationId, at timestampRevokeDelegation

Views​

viewrowsfields
ActiveDelegations
Active delegations
each Delegation with state == Activedelegation_id DelegationId, delegate PrincipalId, root PrincipalId, action DelegatedAction
Delegations
Delegations
each Delegationdelegation_id DelegationId, delegator PrincipalId, delegate PrincipalId, action DelegatedAction, root PrincipalId, parent_delegation_id optional DelegationId, granted_at timestamp, expires_at optional timestamp, last_acted_at optional timestamp, excludes list of Name, state State

Types​

typeisvalues or fields
DelegatedAction
What a delegate may decide in the delegator's place. ControlSession stops, restarts, briefs or types into a session of the delegator; Commit and Push record and send changes in the delegator's name. One delegation carries one action; acting for an owner in several ways is several delegations, each revoked on its own.
one ofAnswerQuestions, Approve, Merge, Publish, ControlSession, Commit, Push
Subject
What a delegated act acted on: the kind of thing, such as harness_session, and its identifier. The identifier is a plain Uuid beside the kind, because this block sits below the blocks whose entities a delegate acts on and names none of their identifiers.
a recordkind Name, id uuid

KPIs​

5 KPIs from the KPI catalogue. A gate must be zero for a variant of an architecture to count.

Correctness​

KPIunitbettergatestatus
delegation_chain_broken
Delegated actions whose chain does not end at a human.
How: DelegatedActionTaken events whose chain of DelegationGranted and DelegationPassedOn does not reach a human principal. Must be 0.
countlowergateplanned
source: design
action_after_revocation
Delegated actions taken after the delegation was revoked or expired.
How: DelegatedActionTaken events timestamped after a DelegationRevoked or DelegationExpiredRecorded of the same delegation. Must be 0.
countlowergateplanned
source: design

Quality​

KPIunitbettergatestatus
delegate_forward_share
Share of questions a delegate received that it forwarded to the owner.
How: Questions forwarded divided by questions received, per delegate part. A delegate that forwards everything saves the owner nothing.
By work mode: autonomous: lower, pairing: ignore, review: ignore
sharelower–simulated
source: design
operator_decided_owner_questions
Questions meant for the owner that the delegate decided itself.
How: Count of questions addressed to an owner part that were answered by a delegate acting for that owner. A count is a measure, not a fault, so it is not a gate.
countlower–simulated
source: design
operator_wait_share
Share of agent time spent waiting on an operator agent.
How: Seconds agents wait for an operator's answer to a question, divided by instance time. The simulator divides operator wait by instance time, as it does owner wait.
sharelower–simulated
source: design

Settings​

The settings a part of this block carries in an architecture document. agenticspec sim check refuses any other setting (setting_unknown) and a value outside its type (setting_invalid), and a part that lacks a setting marked required in the default column; the contract copies a setting into the ports it narrows. The last rows of each table are the settings every part takes. What no setting here types (a file, a path, an audience, the use of a model) goes into the part's notes, a map with free keys and values that the check takes as written and nothing reads.

A part delegation:

settingtypeunitdefaultcontractwhat
countinteger of at least 11How many copies of the part run.
perpartOne copy of the part for each copy of the named part.
notesnotesFree notes on the part, a map with keys and values of any kind: what no setting of its block types. The check takes any map; the simulator, the search and the contract never read it.