docs(session-persistence): bind raw capability to its reader

The abstract capability flag forces every backend to state whether it owns per-session raw artifacts, but TypeScript cannot express that a true flag requires replacing the concrete unsupported default. Without an implementer-facing obligation, a backend could advertise support and then fail with a contradictory unsupported diagnostic on first use.\n\nDocument the required pairing at the capability declaration. Keep readRaw concrete so backends that correctly report false inherit one fail-loud implementation instead of duplicating rejection code.
This commit is contained in:
Tianyi Cui
2026-08-11 18:10:28 +08:00
parent b52ddb2887
commit 5931afaf87
@@ -95,7 +95,10 @@ export abstract class SessionPersistence extends Service {
*/
abstract locate(meta: SessionHeader): SessionLocation | undefined
/** Whether this backend exposes one verbatim raw artifact per session. */
/**
* Whether this backend exposes one verbatim raw artifact per session.
* A backend that declares `true` must override {@link readRaw}.
*/
abstract readonly supportsRawArtifacts: boolean
/**