/** * AT1 rejected-value tombstone — shared reject/unreject/list flow. * docs/plans/2026-08-15-at1-rejected-value-tombstone.md (T2, plan §4). * * The CLI (`hippo reject`/`rejections`/`unreject`) and the Context-based * `api.reject`/`api.unreject`/`api.listRejections` surfaces both need the * SAME multi-step transaction + post-commit mirror-purge flow. Extracted * here (leaf module) so neither duplicates it. * * Module direction: this file imports from store.ts, rejection.ts, and * raw-archive.ts. Nothing imports FROM this file except cli.ts and api.ts, * so it introduces no cycle. */ import { type RejectedValueRow } from './rejection.js'; export interface RejectFlowOpts { hippoRoot: string; tenantId: string; actor: string; reason: string; /** By-id form: reject the CURRENT content of an existing memory. */ memoryId?: string; /** Pre-emptive form: reject a value not currently stored (or already gone). */ value?: string; } export interface RejectFlowResult { digest: string; /** The rejected content, for the CLI's at-reject-time echo (plan §2: the * tombstone itself stores no content — this is the only place it's seen * again after this call returns). */ content: string; /** Every live row removed this call (all tenant rows whose normalized * digest matched — not just the id passed, per the K1/R7 duplicate * lesson). */ removedIds: string[]; /** Subset of removedIds that were kind='raw' (archived, not deleted). */ removedRawIds: string[]; } /** * `hippo reject` / `api.reject` core flow. ONE connection, one transaction: * insert the tombstone, enumerate + remove every live tenant row whose * normalized digest matches (kind-aware), one aggregate `reject_value` * audit, COMMIT. Then post-commit (mirrors the existing purge+reaper * pattern verbatim from api.archiveRaw, api.ts:1913-1938): best-effort * mirror purge per removed id, `mirror_cleaned_at` stamps for raw ids, one * index mirror rewrite. */ export declare function rejectValue(opts: RejectFlowOpts): RejectFlowResult; export type UnrejectOutcome = { status: 'ok'; digest: string; reason: string | null; } | { status: 'not_found'; } | { status: 'ambiguous'; candidates: RejectedValueRow[]; }; /** * `hippo unreject` / `api.unreject` — resolve a unique tombstone by digest * (or prefix), delete it, audit `unreject_value`. The only v1 escape hatch * (plan §4): no per-write force flag. */ export declare function unrejectValue(hippoRoot: string, tenantId: string, digestOrPrefix: string, actor: string): UnrejectOutcome; /** `hippo rejections` / `api.listRejections` — list tombstones for a tenant. */ export declare function listRejectionsForTenant(hippoRoot: string, tenantId: string): RejectedValueRow[]; //# sourceMappingURL=reject-flow.d.ts.map