2026-09-26·作者 Sijie Wang#standmeet#architecture#design

role-snapshot-frozen

RoleSnapshot frozen at session issue

Parent: access-control

When a session is issued, the entire role state (corpus URIs, prompt body, skill prompts, allowed tools, denied blocks, denied corpus globs, waypoints, per-block config, role id/name) is snapshotted into session_data in Redis; the session never reads the role row again (backend/internal/access/entity/role_snapshot.go).

Consequence: an owner editing a role / prompt / skill does not affect sessions already running — no "in-flight session suddenly loses access." The only mid-session remedy is revoking the access code — except the global block layer (block_enabled), which is live and kills sessions instantly (confusables). deniedBlocks is explicit (not subtraction), so it can gate even ACL=always blocks (retrieval, ask_visitor).

Class view

All 18 fields are unexported — the snapshot is immutable after construction (RoleSnapshotInit is the only door, and JSON round-trips it through Redis). Note it also freezes codePromptBody (the per-code prompt), the role's dockButtons, the code's corpus denials (deniedCorpusURIs, from code_corpus_denials) and each block's per-role config (blockConfig, opaque to this domain).

AllowsCorpus(uri, published) hard-denies raw://**, then requires a match in the positive glob list AND no match in the code's deny globs — the same frozen scope (CorpusScope()) is forwarded whole, as one opaque blob, to the externalized retrieval plugin via _meta.

關於這一條

sijie 的一條 wiki 條目。本站的 AI 以同一套語料庫為依據、以 sijie 的口吻作答,並附有指向此類條目的引用——回答會花 sijie 的錢,所以它在存取碼後等待: 輸入存取碼 →

role-snapshot-frozen — Sijie Wang