export interface ArtifactReviewSourceIndexDatabase { exec(sql: string): void; prepare(sql: string): { get(...args: unknown[]): unknown; all(...args: unknown[]): unknown[]; run(...args: unknown[]): { changes: number; lastInsertRowid: number | bigint; }; }; } export interface ArtifactReviewSourceIndexOwner { scopeId: string; runId: string; taskEpoch: number; } export interface ArtifactReviewSourceIndexSnapshot { sequence: number; } export interface ArtifactReviewSourceIssuerReference { owner: ArtifactReviewSourceIndexOwner; sourceId: string; sequence: number; payloadSha256: string; } export interface ArtifactReviewSourceContinuationAdoptionReference { schema: "omnius.artifact-review-source-adoption.v1"; issuer: ArtifactReviewSourceIssuerReference; authoritySha256: string; } export interface ArtifactReviewSourceDelegationReference { schema: "omnius.artifact-review-source-delegation.v1"; issuer: ArtifactReviewSourceIssuerReference; authoritySha256: string; delegationId: string; claimId: string; } export type ArtifactReviewSourceAdoptionReference = ArtifactReviewSourceContinuationAdoptionReference | ArtifactReviewSourceDelegationReference; export interface ArtifactReviewSourceIndexObservation extends ArtifactReviewSourceIndexOwner { schema: "omnius.durable-tool-source-observation.v1" | "omnius.durable-corpus-page-source.v1" | "omnius.durable-corpus-native-read-source.v1"; toolCallId: string; /** Original host call when one invocation issues multiple page handles. */ originToolCallId?: string; toolName: string; documentId: string; chunkIds: string[]; bodyHash: string; bodyBytes: number; documentExtraction?: unknown; } export interface ArtifactReviewSourceIndexInput { owner: ArtifactReviewSourceIndexOwner; sourceId: string; observation: T; artifactUri: string; verifiedSourcePath: string; /** Recipient-owned reference; the original observation remains issuer-owned. */ adoption?: ArtifactReviewSourceAdoptionReference; } export interface ArtifactReviewSourceIndexEntry extends ArtifactReviewSourceIndexInput { sequence: number; } export interface ArtifactReviewSourceIndexPageRequest { owner: ArtifactReviewSourceIndexOwner; cursor?: string; pageSize?: number; snapshot?: ArtifactReviewSourceIndexSnapshot; sourceIds?: string[]; toolCallIds?: string[]; } export interface ArtifactReviewSourceIndexPage { items: ArtifactReviewSourceIndexEntry[]; nextCursor: string | null; snapshot: ArtifactReviewSourceIndexSnapshot; } /** Private, host-issued source handles. This index is provenance lookup only: * a reader must revalidate raw evidence, chunks, archive and original bytes. * No summary, model call, or merely logged tool result can register a source. */ export declare class ArtifactReviewSourceIndex { private readonly db; constructor(db: ArtifactReviewSourceIndexDatabase); /** Serialize a synchronous host claim transition with existing SQLite * writers. The callback must never await or perform model/tool execution. */ withWriteTransaction(operation: () => R): R; /** Barrier metadata only: records an exact successful host model handoff. * This does not mint native/visual grounding, semantic or delivery authority. */ recordObservedChannel(input: { owner: ArtifactReviewSourceIndexOwner; channel: "ocr_text"; callId: string; corpusId: string; inputId: string; charStart: number; charEnd: number; textSha256: string; requestSha256: string; }): void; observedChannels(owner: ArtifactReviewSourceIndexOwner): Array<"ocr_text">; /** Called only after the production native source guard has verified its * durable raw stores. Replays are exact and conflicting rebindings fail. */ append(input: ArtifactReviewSourceIndexInput): ArtifactReviewSourceIndexEntry; /** Reopen an exact original row; summaries and newly asserted observations * cannot create this reference. References always point to the first issuer. */ originalReference(entry: ArtifactReviewSourceIndexEntry): ArtifactReviewSourceIssuerReference; /** Called only after a host has admitted the exact same-task continuation * and revalidated current source bytes. This is a reference, not a new read. */ adopt(input: { owner: ArtifactReviewSourceIndexOwner; issuer: ArtifactReviewSourceIssuerReference; authoritySha256: string; }): ArtifactReviewSourceIndexEntry; /** A fresh child has a separate session/storage identity. This row remains * provenance only; the parent must validate its canonical delegation receipt * and reopen native stores before making the source available to reviewers. */ adoptDelegated(input: { owner: ArtifactReviewSourceIndexOwner; issuer: ArtifactReviewSourceIssuerReference; authoritySha256: string; delegationId: string; claimId: string; }): ArtifactReviewSourceIndexEntry; reopenIssuer(reference: ArtifactReviewSourceIssuerReference): ArtifactReviewSourceIndexEntry; private insert; /** Filters are applied in SQL before keyset pagination. The snapshot fixes * the selected owner population while later native sources are appended. */ list(input: ArtifactReviewSourceIndexPageRequest): ArtifactReviewSourceIndexPage; private ids; private owner; private snapshot; private validateInput; private issuer; private entry; }