/** * The checkpoint ontology outbox: which entity bytes this machine's * `hq core checkpoint` wrote. * * Several people's checkpoints now write one company's ontology. Sync must * upload an entity file only when this machine's checkpoint produced those * exact bytes. Otherwise an old pulled copy (a file another writer has since * merged away, or rewritten) goes back up and undoes their work: the * 2026-09-26 Indigo re-creates and overwrites. * * hq-cli records every entity file it writes in * `/.hq/ontology-outbox/.json` * (`{schema: "hq-ontology-outbox.v1", company, entries: {: * {sha256, written_at}}}`), always before it writes the file. The file lives * under `.hq/`, so it never syncs. This module reads it; the rules are * enforced in ../cli/share.ts while `checkpoint.ontology.multi-writer` is on. */ export interface OntologyOutbox { /** Vault key → SHA-256 (hex) of the bytes the checkpoint wrote. */ readonly entries: ReadonlyMap; } /** * Read a company's outbox. A missing file is an empty outbox. An unreadable or * malformed one is also empty, reported through `onError`: an empty outbox * only holds entity files back, which is the safe direction. One malformed * entry makes the whole outbox malformed, so a partly corrupt file or a * producer on another schema never authorizes a push. */ export declare function readOntologyOutbox(hqRoot: string, companySlug: string, onError: (error: Error) => void): OntologyOutbox; /** * True iff the local file at `absolutePath` is a regular file whose bytes are * the ones the checkpoint recorded for `relativePath`. With `plannedHash`, the * recorded bytes must also be the ones the push planned to upload; uploadFile * then refuses a body that no longer hashes to the planned value, so the bytes * sent are the bytes checked here. */ export declare function outboxAllowsEntityPush(outbox: OntologyOutbox, relativePath: string, absolutePath: string, plannedHash?: string): boolean; /** * True iff the entity body's `last_updated` is within the create window of * `nowMs`. A body without a readable `last_updated` is not fresh, and neither * is one dated more than {@link ENTITY_CREATE_FUTURE_SKEW_MS} ahead: a future * date would otherwise stay "fresh" for good. */ export declare function entityIsFreshForCreate(body: string, nowMs: number): boolean; //# sourceMappingURL=ontology-outbox.d.ts.map