/**
 * WorkingSetManifest — P2.1 of multi-machine coherence: pure, on-demand
 * computation of "what files make up this topic's workspace on THIS machine".
 *
 * Spec: docs/specs/WORKING-SET-HANDOFF-SPEC.md §3.1 (manifest — computed,
 * never declared). No new persistent store; no willpower-dependent
 * declarations. Sources, deduped:
 *   1. Filesystem convention: `autonomous/<topic>.local.md` + `autonomous/
 *      <topic>.*` (bounded readdir of the convention dir — never recursion).
 *   2. Journal evidence: jailed `artifactPaths` from the topic's OWN-stream
 *      autonomous-run entries (CoherenceJournalReader.readOwnAutonomousRuns —
 *      injected by the caller so this module stays pure).
 *
 * Discipline (§3.1):
 *  - Every candidate is canonicalized + re-jailed HERE even though journal
 *    paths were jailed at write time (jails are enforced at the data's birth
 *    AND at every serve boundary — defense in depth, P1 invariant).
 *  - `mtime` is DISPLAY-ONLY (P1's `ts` treatment): every diff/skip decision
 *    downstream keys on sha256 exclusively.
 *  - The credential-shape scan runs over each candidate file's BYTES; a
 *    flagged file is LISTED `secretFlagged: true` and never transferred — an
 *    honest, surfaced refusal, never a silent skip. The scan is a
 *    LEAK-REDUCTION filter, not the security boundary (the boundary is the
 *    same-operator peer posture — §3.1/§5).
 *  - When the topic's own journal shows a live autonomous run, EVERY entry is
 *    `liveSource: true` (any of them is plausibly mid-write) — the pull
 *    re-fires on the run's `stopped` (§3.4).
 *  - Bounded everywhere: per-file caps (headline exemption for the topic's
 *    `.local.md`), maxFiles, hash ceiling. Over-cap entries are LISTED
 *    `tooLarge: true` — observability is not delivery.
 */
import type { OwnAutonomousRuns } from './CoherenceJournalReader.js';
/** §3.7 defaults (mirrored in ConfigDefaults.coherenceJournal.workingSet). */
export declare const DEFAULT_WORKING_SET_CAPS: WorkingSetCaps;
/**
 * Above this, a file's sha256 is reported `null` rather than paying an
 * unbounded hash at manifest time (a tooLarge file never transfers anyway,
 * so the hash is disclosure metadata, not verification material).
 */
export declare const HASH_BYTE_CEILING: number;
export interface WorkingSetCaps {
    maxFileBytes: number;
    headlineFileBytes: number;
    maxFiles: number;
    /** TOTAL-SET transfer budget — enforced by the PULL layer, carried here so
     *  both sides quote one number (§3.2 assembled-bytes basis). */
    maxTotalBytes: number;
}
export interface WorkingSetEntry {
    /** Relative to the stateDir; receiver treats it as hostile input (§3.2). */
    relPath: string;
    bytes: number;
    /** null only above HASH_BYTE_CEILING (honest, bounded compute). */
    sha256: string | null;
    /** ISO — DISPLAY-ONLY, never a decision key (§3.1). */
    mtime: string;
    tooLarge?: boolean;
    secretFlagged?: boolean;
    liveSource?: boolean;
}
export interface WorkingSetManifestResult {
    topic: number;
    computedAt: string;
    entries: WorkingSetEntry[];
    /** The topic's own journal shows a still-active autonomous run. */
    liveRun: boolean;
    /** Journal evidence was byte/archive-bounded — older artifacts may be missing. */
    evidenceTruncated: boolean;
    /** Candidates dropped past maxFiles (counted, never silent — §3.1). */
    filesTruncated: number;
    /** Candidates rejected by the compute-time jail. */
    jailRejected: number;
    /** Journal-evidenced paths no longer on disk (rotated/deleted/never durable). */
    goneFromDisk: number;
    /** Sum of bytes the pull layer may actually move (excludes tooLarge /
     *  secretFlagged / liveSource entries). */
    transferableBytes: number;
}
/** Minimal fs seam (tests). */
export interface WorkingSetFs {
    readdirSync: (dir: string) => string[];
    lstatSync: (p: string) => {
        isFile(): boolean;
        isSymbolicLink(): boolean;
        size: number;
        mtimeMs: number;
    };
    existsSync: (p: string) => boolean;
    realpathSync: (p: string) => string;
    readFileSync: (p: string) => Buffer;
}
export interface ComputeWorkingSetOpts {
    /** Absolute path to the agent's `.instar/` directory. */
    stateDir: string;
    topic: number;
    /** Own-stream journal evidence, injected by the caller (keeps this pure). */
    runs: OwnAutonomousRuns;
    caps?: Partial<WorkingSetCaps>;
    now?: () => Date;
    fsImpl?: WorkingSetFs;
    /** Secret-content scan seam; defaults to the versioned credential-shape enum. */
    secretScan?: (content: Buffer) => boolean;
}
export declare function computeWorkingSet(opts: ComputeWorkingSetOpts): WorkingSetManifestResult;
/** Undefined-safe caps merge — a config block with absent keys keeps defaults. */
export declare function mergeCaps(caps?: Partial<WorkingSetCaps>): WorkingSetCaps;
//# sourceMappingURL=WorkingSetManifest.d.ts.map