import type { Board, Job } from "./model.js"; import { type Answer, type Ask } from "./readiness.js"; import { type LedgerClass } from "./ledger.js"; /** * How much of what is on the board came from the person, and how much staves made up. * * readiness.ts answers "how much does the interview still owe". This answers a different question * about the same list: of what is written down, whose is it. The two are independent — a board can * be complete and almost entirely invented, which is exactly the state that a percentage of * completeness would report as finished. * * It matters because staves is allowed to draft. Drafting is how a whole flow appears in two minutes * instead of an hour of questions, and the only thing that makes it honest is that every invented * line is visibly invented. So this is not a score: it is the split that lets the board be drawn in * two materials, and lets the person see at a glance which parts of their own workflow are still * a stranger's guess. * * Nothing new is stored. The provenance already exists — Job.provenance.source says who put the job * there, and Job.confirmedFields says which fields the person has since agreed to — so this reads * the board rather than keeping a second copy of the truth that could drift from it. */ export interface Authorship { /** answers the board actually has; the blanks are neither yours nor mine */ known: number; /** of those, the ones the person said or confirmed */ yours: number; /** 0–100, rounded. yours/known, nothing cleverer. 0 when nothing is known yet. */ percent: number; } /** An answer is the person's when they said it or have since agreed to it. Everything staves * derived stays mine until they do, however confident it was. */ export declare const isYours: (a: Answer) => boolean; /** The whole board, for the readout that sits beside the board's name. */ export declare function authorship(b: Board, ask?: Ask): Authorship; /** One job, for how its card is drawn. */ export declare function jobAuthorship(b: Board, job: Job, ask?: Ask): Authorship; /** * Which jobs are drawn as staves' guess rather than the person's account. * * The test is majority, not purity: a job the person named but never described is still mostly * mine, and drawing it solid because one field is theirs would be the flattering lie this whole * module exists to prevent. A job nothing is known about yet is not a guess — it is a blank, and * hatching blanks would make an empty board look like a fabrication. */ export declare function inferred(b: Board, job: Job, ask?: Ask): boolean; /** Every answer staves supplied and the person has not agreed to, newest board order. What the * person is being invited to correct — never phrased as work they owe. */ export declare function guesses(b: Board, ask?: Ask): Answer[]; /** * The same split, shaped for the board to draw itself with. * * It travels with board.json rather than being recomputed in the client, because the majority rule * above is a judgement — "one confirmed field out of four is still mostly mine" — and a judgement * that exists in two places is a judgement that will eventually disagree with itself. */ export interface JobAuthorship extends Authorship { /** drawn as staves' guess rather than the person's account */ inferred: boolean; /** the fields staves supplied, so a card can offer them back one at a time */ fields: { field: string; question: string; }[]; } export interface BoardAuthorship extends Authorship { jobs: Record; classes: Record; } export declare function classAuthorship(b: Board, ask?: Ask): Record; export declare function boardAuthorship(b: Board, ask?: Ask): BoardAuthorship;