Skip to content
Tracon

SkillScriptGrant

Namespace Tracon · Assembly Tracon.Abstractions.dll

The record carrying permission to execute a skill script.

public sealed record SkillScriptGrant : IEquatable<SkillScriptGrant>
Inheritance
object ← SkillScriptGrant
Implements
IEquatable<SkillScriptGrant>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Script execution is a deliberate exception to Tracon’s “tools are defined only in code” rule. The grant record is this exception’s gate: a script with no grant record does not run, even with a whitelisted interpreter.

If SkillScriptGrant.ScriptName is null, the grant covers all of the skill’s scripts.

A grant for a stored or code-defined skill pins the content it was given for (SkillScriptGrant.ContentHash): a script whose content changes afterwards does not run until it is granted again. A script on disk is not pinned.

public SkillScriptGrant()

The content the grant authorizes: the script’s content hash when a script name is set, the fingerprint of the whole script set when it is not.

public string? ContentHash { get; init; }

string?

The values are AgentSkillScriptDefinition.ContentHash and AgentSkillDefinition.ScriptSetHash.

null means the grant pins nothing, so it authorizes scripts read from disk only: a stored or code-defined script is refused under it. A grant written before content pinning existed carries null and has to be given again. A store implementation must keep this value.

The moment the grant expires. Never expires if null.

public DateTimeOffset? ExpiresAt { get; init; }

DateTimeOffset?

The moment the grant was given (UTC).

public DateTimeOffset GrantedAt { get; init; }

DateTimeOffset

The actor who gave the grant.

public string? GrantedBy { get; init; }

string?

The grant record identifier. A time-ordered UUID (v7).

public Guid Id { get; init; }

Guid

The moment the grant was revoked. Active if null.

public DateTimeOffset? RevokedAt { get; init; }

DateTimeOffset?

The name of the script granted. If null, all of the skill’s scripts are covered.

public string? ScriptName { get; init; }

string?

The name of the skill granted.

public required string SkillName { get; init; }

string

The tenant the grant belongs to.

public required string TenantId { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(SkillScriptGrant? other)

other SkillScriptGrant?

bool

public override int GetHashCode()

int

Reports whether the grant is active at the given moment.

public bool IsActiveAt(DateTimeOffset instant)

instant DateTimeOffset

The evaluation moment.

bool

true if the grant is active.

An expired grant is automatically invalid; the record is not expected to be deleted. Removing the row is retention’s concern.

public override string ToString()

string

operator ==(SkillScriptGrant?, SkillScriptGrant?)

Section titled “ operator ==(SkillScriptGrant?, SkillScriptGrant?)”
public static bool operator ==(SkillScriptGrant? left, SkillScriptGrant? right)

left SkillScriptGrant?

right SkillScriptGrant?

bool

operator !=(SkillScriptGrant?, SkillScriptGrant?)

Section titled “ operator !=(SkillScriptGrant?, SkillScriptGrant?)”
public static bool operator !=(SkillScriptGrant? left, SkillScriptGrant? right)

left SkillScriptGrant?

right SkillScriptGrant?

bool