Skip to main content

Module operator_session

Module operator_session 

Source
Expand description

OperatorSessionStore — persistence for Operator login-flow sessions.

One row per minted POST /v1/operators session: the sid / bearer token / capability manifest / mint time / 記名. This is the record that lets a single-server restart keep every logged-in Operator logged in — the sibling stores (task / run / replay / trace / …) already persist, and RunRecord.operator_sid persists a pointer into this session space, so leaving the sessions themselves process-volatile stranded every restored run pin on a 404 unknown sid after restart.

Deliberately not persisted: the WS adapter state (tx sender, pending oneshot map). Both are process-lifetime objects with no meaningful serialized form — an empty rebuild on the client’s next WS connect (the existing reconnect path) is the correct restoration.

Current scope:

Re-exports§

pub use inmemory::InMemoryOperatorSessionStore;
pub use sqlite::SqliteOperatorSessionStore;

Modules§

inmemory
InMemoryOperatorSessionStore — a process-volatile OperatorSessionStore used as the default when no store path is configured. Byte-for-byte the pre-persistence behaviour: sessions die with the process.
sqlite
SqliteOperatorSessionStore — SQLite-backed OperatorSessionStore using [rusqlite-isle].

Structs§

ObservedAssignment
One Assign as the assigned Operator session observed it — the per-entry shape of the 記名’s observed part (model §4.2’s second row: 担当した Run と goal / project_root / work_dir / task_metadata / 最終活動時刻).
OperatorSessionRecord
One persisted Operator login-flow session.

Enums§

OperatorSessionStoreError
Errors surfaced by an OperatorSessionStore implementation.

Constants§

OBSERVED_CAP
How many ObservedAssignment entries one session retains.
OBSERVED_TEXT_MAX_BYTES
Byte ceiling for each of the three caller-supplied strings on an ObservedAssignmentgoal, project_root and work_dir.
OPERATOR_SESSION_MAX_IDLE_SECS
How long a session may go unaccessed before it expires — the second exit from Registered in model §4.1’s state diagram (Registered ── 最終アクセスから 24h ──▶ ╳ 削除), in seconds.
TASK_METADATA_MAX_BYTES
Serialized-size ceiling for a recorded ObservedAssignment::task_metadata.

Traits§

OperatorSessionStore
Persistence interface for Operator login-flow sessions.