/** * The review verdict store of the interactive-review seam (DES-artifact-editor-plugins §7.6, EP-C2). * * "There is no crew review ledger" (rev 2, review S6): every verdict on a document is a wicked-ledger * row stamped with the crew run that produced it (E16). A review's rows live in the DOCUMENT'S * REVIEW ROOT — `/_reviews///` — as a wicked-ledger store (`.wicked-qe/`, canonical * JSON: `projects/`, `scenarios/`, `runs/`, `verdicts/`, one file per record), read back through the * same canonical reader the acceptance gate uses (`qe/ledger.ts` `readDocReviewVerdicts`). * * WHO WRITES. The spec has the review phase write its own rows; the engine does not allow it: the * review phase is read-only (core `write_posture.rs`: an Evaluator or Neutral unit gets no write * tools), which is the point of a review. So the phase REPORTS (its engine-captured output, which no * seat can reach afterwards) and crew is the scribe: one verdict row per requested reviewer, written * here, then read back before anything is announced. * * WHY NOT `DomainStore`. wicked-ledger's `DomainStore.create` spawns the `wicked-bus` CLI against the * machine's default bus on every write — a blocking child process inside the daemon, emitting onto a * bus that is not this daemon's. Canonical JSON is the ledger's authoritative form (the SQLite index * is a derived cache it rebuilds), so the rows are written in that form directly: complete records * with their parent project / scenario / run, atomically (tmp + rename), with deterministic ids so a * replayed finalize rewrites the same files. * * `_reviews` and `_review-runs` can never be a sibling seam's handoff directory: a handoff key * starts with a document id, and a document id cannot start with `_` (interactive's DOC_NAME grammar). */ /** The directory, under the seams' handoff root, that holds every document's review root. */ export declare const REVIEWS_DIRNAME = "_reviews"; /** The directory, under the same root, that holds each review RUN's handoff (`/`: the saved version and the handoff file). */ export declare const REVIEW_RUNS_DIRNAME = "_review-runs"; export type ReviewVerdict = 'pass' | 'changes' | 'error'; export type ReviewSeverity = 'low' | 'medium' | 'high'; export interface ReviewFinding { /** The `data-wid` the finding is about; absent = unanchored. */ wid?: string; severity: ReviewSeverity; sentence: string; } /** One reviewer's result, as recorded. */ export interface ReviewVerdictWrite { runId: string; doc: string; version: number; /** The reviewer's schema id (`match` | `a11y` | `copy` | `qe`). */ reviewer: string; verdict: ReviewVerdict; findings: ReviewFinding[]; /** One plain sentence: why this verdict. */ reason: string; /** The seat that ran the review; `null` when the run named none. */ seat: string | null; excludedSeats: string[]; authorKnown: boolean; /** The skill the reviewer loaded; `null` when it worked from the built-in rubric. */ skill: string | null; projectId?: string | undefined; } /** The partition of the reviews dir a project's documents live under (docs roots are per project too). */ export declare function reviewPartitionOf(projectId: string | undefined): string; /** * A document's review root: `//` (its ledger is * `/.wicked-qe/`). Throws for anything that is not a document name: the id reaches here from * bus payloads too (`doc.retired`), and `../..` must never become a path (codex r2). */ export declare function reviewRootOf(reviewsDir: string, projectId: string | undefined, documentId: string): string; /** `pass` → PASS, `changes` → FAIL, `error` → INCONCLUSIVE: the ledger's own verdict enum. */ export declare function ledgerVerdictOf(verdict: ReviewVerdict): 'PASS' | 'FAIL' | 'INCONCLUSIVE'; /** * Record one review run's verdicts — one `verdicts` row per reviewer, with its `runs` row and the * document's `projects` / per-reviewer `scenarios` rows — in the document's review root. Throws on * a write failure (the caller announces nothing it could not record). Returns the verdict ids. */ export declare function writeReviewVerdicts(reviewRoot: string, rows: ReviewVerdictWrite[], now?: () => Date): string[]; /** * Drop a deleted document's recorded reviews, so a later document of the same name does not inherit * them — in ITS project's partition only (`projectId` absent = Unfiled): the same name in another * project is another document. Idempotent; a name that is not a document name removes nothing. */ export declare function removeDocReviews(reviewsDir: string, documentId: string, projectId: string | undefined): void; //# sourceMappingURL=review-ledger.d.ts.map