Meshpocalypse Semantic
    Preparing search index...

    Class TrustReviewManager

    TrustReviewManager — review gate for ATF demotions.

    When an agent's trust would drop below TrustReviewConfig.reviewThreshold:

    1. The agent is suspended (mesh:TrustReviewRequired triple written to graph).
    2. A NATS event is emitted on mesh.trust.review.<agentId>.
    3. A guardian agent or human reviews via approveDemotion / reinstateAgent.
    4. If no review occurs within the TTL, processExpiredReviews auto-demotes.
    Index

    Constructors

    Methods

    • A guardian approves the pending demotion. The agent is permanently demoted to the level proposed at suspension time. Writes mesh:reviewOutcome = "mesh:PermanentlyDemoted" plus a PROV-O activity triple to the graph.

      Parameters

      • agentId: string

        The agent being demoted.

      • reviewedBy: string

        DID or identifier of the approving guardian / human.

      Returns Promise<void>

      If no pending review exists for agentId.

    • Scan all pending reviews for expired TTLs and auto-demote those agents. Call this periodically (e.g. every 60 seconds via setInterval).

      Returns Promise<string[]>

      An array of agentIds that were auto-demoted in this pass.

    • A guardian reinstates the agent at the given trust level. Writes mesh:reviewOutcome = "mesh:Reinstated" plus a PROV-O activity triple to the graph.

      Parameters

      • agentId: string

        The agent being reinstated.

      • reviewedBy: string

        DID or identifier of the reviewing guardian / human.

      • reason: string

        Human-readable justification for reinstatement.

      Returns Promise<void>

      If no pending review exists for agentId.

    • Called by the ATF system when a demotion would take an agent below the review threshold. Suspends the agent and emits a NATS event instead of applying the demotion immediately.

      Parameters

      • agentId: string

        The agent's DID or identifier.

      • reason: string

        Human-readable explanation of why demotion is pending.

      • proposedLevel: number

        The trust level the agent would be demoted to.

      Returns Promise<boolean>

      true when a suspension was triggered (caller must skip immediate demotion); false when no review is needed (apply demotion normally).