import type { SessionPaths } from '../../session/paths.js'; import type { SessionId } from '../../types/ids/index.js'; import type { MessageExistenceCheck } from './memory.js'; import { type MessageFeedback, type MessageFeedbackStore, type PutMessageFeedbackInput } from './types.js'; /** * Feedback on disk, one immutable commit per accepted owner version. * * A rating is a RECORD — readers want its current value — but replacing one * mutable file cannot make the preceding version comparison atomic. The * revision directory elects exactly one writer for N+1; the former single * file remains only a checked, best-effort compatibility projection. */ export interface DiskMessageFeedbackStoreConfig { /** * The project's layout. Feedback on a session lives in * `/feedback/` (one `.json` plus `.revisions/`), * beside the session's log — the log is what a rating is checked against, * so the two are kept and removed together. */ readonly paths: Pick; } /** * `hasMessage`, answered by the session's log: does it hold a `message` * record with this id? * * The log is the only record of what a session actually said. A `messageId` * that appears nowhere in it is either a typo or a fabrication, and both are * worth refusing — a feedback row pointing at a message nobody can find is * unreviewable and indistinguishable from a real one. The walk verifies the * hash chain as it goes, so a log that was edited by hand refuses the rating * rather than vouching for it. A host with a `SessionIndex` at hand can pass * its own check instead; the answer must be the same. */ export declare function sessionLogMessageCheck(paths: Pick): MessageExistenceCheck; export declare class DiskMessageFeedbackStore implements MessageFeedbackStore { private readonly now; private readonly paths; private readonly messageExists; constructor(config: DiskMessageFeedbackStoreConfig, messageExists?: MessageExistenceCheck, now?: () => number); private feedbackDir; private revisionsDir; private location; private assertKey; putMessageFeedback(input: PutMessageFeedbackInput): Promise; listMessageFeedback(query: { sessionId: SessionId; }): Promise; } //# sourceMappingURL=disk.d.ts.map