Преглед изворни кода

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.
Tianyi Cui пре 1 месец
родитељ
комит
5931afaf87
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      packages/session/session-persistence/src/index.ts

+ 4 - 1
packages/session/session-persistence/src/index.ts

@@ -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
 
   /**