feat(core-dsr): Payload impls, recording doubles, DI binders, contract tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 20:05:06 +00:00
parent 8068d1bf98
commit 6606b59d1e
35 changed files with 2375 additions and 24 deletions

View File

@@ -0,0 +1,25 @@
import type { IProcessingRestriction } from "./processing-restriction.interface";
/**
* Volatile in-memory IProcessingRestriction. Tracks restriction state in
* memory; state is lost on process restart.
*
* Used in dev-seed and storybook contexts where Payload is unavailable.
* Not a recording double — use RecordingProcessingRestriction from
* @repo/core-testing for call-assertion in unit tests.
*/
export class InMemoryProcessingRestriction implements IProcessingRestriction {
private readonly restricted = new Set<string>();
async setRestriction(subjectId: string, granted: boolean): Promise<void> {
if (granted) {
this.restricted.add(subjectId);
} else {
this.restricted.delete(subjectId);
}
}
async isRestricted(subjectId: string): Promise<boolean> {
return this.restricted.has(subjectId);
}
}