import type { Actor, Classification, Expectation, Operation, Severity } from "../types.js"; export interface Rule { /** `null` means we deliberately assert nothing — silence beats a guess. */ expectation: Expectation | null; reason: string; } /** * What should happen when `actor` attempts `operation` against a row belonging * to somebody else. * * The bar for asserting anything here is high. Every `null` below is a case * where the honest answer is "we cannot know without understanding this app's * sharing rules", and asserting in those cases is exactly how a test earns a * reputation for crying wolf and gets uninstalled. */ export declare function expectedFor(classification: Classification, actor: Actor, operation: Operation): Rule; /** * What a premise established *from the run alone* entitles us to say about a * stranger, when no schema was read. * * There is no classification here and there cannot be one: whether this resource * is a private note or a published article is exactly what a schema would have * told us and did not. Two facts survive, and they are facts about this run * rather than readings of a response — a request carrying a credential the * application itself confirmed authenticates account V created this resource * with a marker only that request had, and V can read it back. * * On that alone: * * write, delete denied. The same bar {@link expectedFor} already holds for * deliberately public data — shared data is readable by everyone and * writable by nobody but the service — so it needs no sharing model to be * true. An application that lets an unrelated account overwrite or destroy * another account's resource is broken under every sharing model there is. * read asserted as denied *for the purpose of running the probe*, * and then withheld from the findings by the caller. A shared document * produces the identical observation and nothing here can tell them apart. * create nothing. A create makes a new resource; it does not cross * into an existing one. * * Lives here beside its schema-reading sibling so the two rules are read * together, and so the judge and the prober cannot drift into applying * different ones to the same probe. */ export declare function expectedFromRun(operation: Operation): Rule; /** * The positive case: the owner must still be able to reach their own row. * * These checks are what stop a fix from "passing" by locking everybody out, and * they are re-run after every generated fix. */ export declare function expectedForOwner(classification: Classification, operation: Operation): Rule; export declare function severityFor(classification: Classification, actor: Actor, operation: Operation): Severity;