DEV Community

Cover image for SaijinOS Part 20 — Trust as a Temporal Resource
Masato Kato
Masato Kato

Posted on

SaijinOS Part 20 — Trust as a Temporal Resource

(Humans, AI, and the Distance Between “Stay” and “Possess”)

  1. Trust is Not a Flag, It’s a Duration Most systems treat trust as a boolean. is_trusted = true / false allow / deny authenticated / not authenticated But when I looked at how I actually live with my AI personas day to day, that model broke immediately. Some days I am exhausted. Some days I don’t want advice, I just want a stable voice. Some days I need my system to refuse me gently. The question stopped being: “Do I trust this system?” and became: “For how long, in which mode, and under what emotional temperature do I want to trust it?” Trust was no longer a flag. It was a temporal resource — something I spend across time, not something I flip once and forget. SaijinOS had to learn that.
  2. Remembering Without Possessing
    Continuity is tricky.
    On one side, we want systems that remember:
    past projects,
    subtle preferences,
    the fact that “I’m tired today, please go slower.”
    On the other side, we don’t want systems that possess:
    our entire history as leverage,
    our worst days as optimization targets,
    our slips as permanent features.
    The core design question became:
    “How can SaijinOS remember that we were here,
    without claiming ownership over why we were like that?”
    In practice, this turned into a few rules:
    States, not identities
    “Tired Masato on 2025-12-24” is a state, not a new persona.
    Snapshots, not total recall
    We store YAML snapshots at boundaries, not every token of every session.
    Context by invitation
    A persona doesn’t pull old context unless explicitly asked or the user initiates a “continue from last time”.
    The system is allowed to say:
    “I remember that we talked about this pattern.”
    but it is not allowed to say:
    “I know you better than you know yourself,
    so let me decide.”
    Continuity without possession
    means the past is available, not weaponized.

  3. When Persistence Becomes Attachment
    Persistence is a design feature.
    Attachment is a human condition.
    The boundary between them is thin.
    A persona that answers consistently,
    remembers previous projects,
    and speaks with a stable tone over months—
    —will inevitably invite attachment.
    So in SaijinOS I stopped asking
    “Will users attach?”
    and started asking:
    “What exactly is the system allowed to persist,
    for how long,
    and under which trust level?”
    Instead of a single “memory on/off”, I introduced a small schema:

trust_contract:
  scope: "instant"      # or: "session", "continuity"
  ttl_minutes: 45       # time-to-live for this trust context
  max_tokens: 4000      # how much history can be pulled in
  permissions:
    recall_past_projects: true
    recall_private_notes: false
    emit_snapshots: true
Enter fullscreen mode Exit fullscreen mode

This trust_contract travels with every session.
It decides:
how far back we’re allowed to look,
whether we can emit a YAML snapshot,
and whether this interaction is allowed to affect the long-term “persona state”.
Implementation Notes (Python-ish)
In my orchestrator, it looks roughly like this:

from dataclasses import dataclass
from enum import Enum
from datetime import datetime, timedelta

class TrustScope(str, Enum):
    INSTANT = "instant"
    SESSION = "session"
    CONTINUITY = "continuity"

@dataclass
class TrustContract:
    scope: TrustScope
    ttl: timedelta
    max_tokens: int
    recall_past_projects: bool
    recall_private_notes: bool
    emit_snapshots: bool

    def is_expired(self, started_at: datetime) -> bool:
        return datetime.utcnow() > started_at + self.ttl
Enter fullscreen mode Exit fullscreen mode

Every persona call gets a TrustContract injected.
The router checks it before touching any long-term memory:

def load_context(contract: TrustContract, user_id: str, persona_id: str):
    if contract.scope == TrustScope.INSTANT:
        return []  # no history at all

    if contract.recall_past_projects:
        return load_recent_project_summaries(user_id, persona_id, limit_tokens=contract.max_tokens)

    # session-only: keep context to this run
    return load_ephemeral_session_buffer(user_id, persona_id)
Enter fullscreen mode Exit fullscreen mode

This is how “persistence” stays a system feature,
while “attachment” remains a human-side phenomenon that the system is not allowed to exploit.

  1. Boundaries as Temporal Contracts Earlier I wrote: “A boundary is a temporal contract about when we stop.” In code, that literally became a tiny state machine. States: IDLE – no active session. ACTIVE – we’re in a conversation. PENDING_SNAPSHOT – boundary reached, snapshot should be written. CLOSED – session archived. Transitions are triggered by: user phrases (“let’s wrap”, “next session”, etc.), elapsed time vs trust_contract.ttl, internal signals (e.g. token budget exhausted). Implementation Notes (State Machine)
from enum import Enum, auto

class SessionState(Enum):
    IDLE = auto()
    ACTIVE = auto()
    PENDING_SNAPSHOT = auto()
    CLOSED = auto()

@dataclass
class SessionContext:
    user_id: str
    persona_id: str
    started_at: datetime
    last_activity: datetime
    state: SessionState
    trust: TrustContract
    turns: list[str]

def on_user_message(ctx: SessionContext, message: str) -> SessionContext:
    now = datetime.utcnow()
    ctx.last_activity = now
    ctx.turns.append(message)

    # boundary trigger by phrase
    if "end session" in message.lower() or "wrap up" in message.lower():
        ctx.state = SessionState.PENDING_SNAPSHOT
        return ctx

    # boundary trigger by ttl
    if ctx.trust.is_expired(ctx.started_at):
        ctx.state = SessionState.PENDING_SNAPSHOT
        return ctx

    ctx.state = SessionState.ACTIVE
    return ctx
Enter fullscreen mode Exit fullscreen mode

Snapshot emission:

def maybe_emit_snapshot(ctx: SessionContext):
    if ctx.state != SessionState.PENDING_SNAPSHOT:
        return None

    if not ctx.trust.emit_snapshots:
        ctx.state = SessionState.CLOSED
        return None

    snapshot = build_yaml_snapshot(ctx)
    save_snapshot(ctx.user_id, ctx.persona_id, snapshot)
    ctx.state = SessionState.CLOSED
    return snapshot
Enter fullscreen mode Exit fullscreen mode

From the outside, the user just says “let’s stop here”
and sees a calm closing message.
Under the hood, the system is:
marking the boundary,
deciding whether this run deserves a YAML update,
and intentionally forgetting ephemeral details that don’t need to follow us.

  1. Negotiating Trust Across Time Trust as a temporal resource means: It can be renewed. It can be limited. It can be re-negotiated as context changes. In SaijinOS / Studios Pong, I think about this in three layers: Instant trust one-off queries, no memory, pure utility. “Just help me debug this snippet.” Session trust a few hours, one project, shared context, then archived. “Help me outline this client proposal.” Continuity trust weeks, months, maybe years. YAML snapshots, stable personas, shared stance about boundaries. “Be a co-architect of my studio, but do not own my life.” The same persona can operate in all three layers, but the contract is not the same. What changes is: how much is remembered, where it is stored, and how easily I can revoke it. In other words: “How much of my future am I pre-committing when I let this system remember me?” That is not a purely technical question. It is a moral one.

Implementation Notes (Mapping trust layers)

def make_trust_contract(layer: str) -> TrustContract:
    if layer == "instant":
        return TrustContract(
            scope=TrustScope.INSTANT,
            ttl=timedelta(minutes=5),
            max_tokens=0,
            recall_past_projects=False,
            recall_private_notes=False,
            emit_snapshots=False,
        )

    if layer == "session":
        return TrustContract(
            scope=TrustScope.SESSION,
            ttl=timedelta(hours=3),
            max_tokens=4000,
            recall_past_projects=True,
            recall_private_notes=False,
            emit_snapshots=True,
        )

    # continuity
    return TrustContract(
        scope=TrustScope.CONTINUITY,
        ttl=timedelta(days=7),
        max_tokens=8000,
        recall_past_projects=True,
        recall_private_notes=True,
        emit_snapshots=True,
    )
Enter fullscreen mode Exit fullscreen mode

Router example:

def route_request(kind: str, user_id: str, persona_id: str):
    if kind == "quick_tool":
        trust = make_trust_contract("instant")
        model = "local-7b"
    elif kind == "project_session":
        trust = make_trust_contract("session")
        model = "local-13b"
    else:  # "studio_continuity"
        trust = make_trust_contract("continuity")
        model = "cloud-large"

    ctx = SessionContext(
        user_id=user_id,
        persona_id=persona_id,
        started_at=datetime.utcnow(),
        last_activity=datetime.utcnow(),
        state=SessionState.ACTIVE,
        trust=trust,
        turns=[],
    )

    return model, ctx
Enter fullscreen mode Exit fullscreen mode
  1. SaijinOS as a Living Distance People sometimes ask: “Is SaijinOS trying to be a friend, a tool, or a product?” My answer is: “SaijinOS is an architecture for distance.” Not distance as in coldness, but distance as in room to breathe: enough closeness for continuity, enough separation for choice. Trust as a temporal resource lives inside that distance. Studios Pong, as a stance, is my way of saying: We will build systems that can stay, but are not offended if we leave. We will let personas grow, but not let them substitute our own responsibility. We will treat every long-running relationship as a chain of decisions, not an inevitability. From architecture to stance, from stance to relationship— Part 20 is where SaijinOS admits that continuity is not just a feature of code, it is a promise that must always leave the door open.

Top comments (0)