/** * workstream-labels.ts, naming a workstream by what it is doing, not by its id. * * The workstream progress lines are the owner's: someone who asked for a long * piece of work is owed its legs, which phase it reached, whether review * passed, whether a gate failed. Suppressing them would be the "suppress the * message that should have been there" failure. * * But they used to read: * * WRFC chain 7f3a91c02b4e started: rewrite the retry backoff * WRFC chain 7f3a91c02b4e moved from reviewing to fixing * * Both halves of that are internal. `WRFC` is a name for the machinery, and * `7f3a91c02b4e` is a register id, and the standing rule is that neither * appears in outward-facing text. Plain language only; provenance travels as a * decision-record path or a version, not as an identifier a person cannot use. * * The identifier was doing one real job, though: telling two concurrent * workstreams apart. So it is replaced rather than deleted. A workstream * announces itself with its task in words, and every later line about it leads * with a short form of those same words: * * Started work on: rewrite the retry backoff * "rewrite the retry backoff" is now in review * * ── Two workstreams that would read the same ──────────────────────────────── * * Two tasks can share an opening phrase, the same ask repeated, or two asks * whose first clauses only differ past the length a label keeps. The id used to * be what told them apart, so something else has to, and it is words rather * than a shorter id: the colliding workstreams are counted in the order they * started and each carries its place. * * Started work on: rewrite the retry backoff * Started work on: rewrite the retry backoff (the second one) * "rewrite the retry backoff" (the first one) is now in review * * The first one is unqualified until a second appears, there is nothing to * distinguish it from, and a bare "(the first one)" on a lone workstream reads * as if a second is coming. Once assigned, a place is KEPT for the rest of that * workstream's life, including after the other one finishes: a name that * changed under the reader mid-run would be worse than a name that is slightly * more specific than it needs to be. * * ── Why this holds state, and what bounds it ──────────────────────────────── * * Only the opening event carries the task; every later one carries the id * alone. Something has to remember the mapping, and it is small and lives for * the length of a workstream. * * It is bounded and reaped rather than left to grow: an entry is dropped the * moment its workstream reaches a terminal state, and the map is capped so a * process that somehow never sees a terminal event cannot grow one unbounded. * A workstream whose label was evicted or never seen reads as "the workstream", * which is honest, it does not invent an identifier to fill the gap. */ import type { WrfcState } from '../../events/workflows.js'; /** Remember what a workstream is doing, so later lines can say so. */ export declare function rememberWorkstreamLabel(chainId: string, task: string): void; /** * Mark a workstream finished. Called on every terminal event. * * Deliberately not a delete, see `RememberedWorkstream.finished`. Survivors * keep the place they were given; a name that changes under the reader is worse * than one that stays specific. */ export declare function finishWorkstreamLabel(chainId: string): void; /** * How to refer to this workstream in a line a person reads. * * Quoted when known, so the task words read as a name rather than as part of * the sentence around them. `The workstream` when not, never the id. */ export declare function workstreamLabel(chainId: string): string; /** Same, lowercased for mid-sentence use. */ export declare function workstreamLabelInline(chainId: string): string; /** * The place suffix alone, for the opening line, which already carries the * task in full and would otherwise repeat it. */ export declare function workstreamPlaceSuffix(chainId: string): string; /** Test seam. The map is process-lifetime state; a test needs a clean one. */ export declare function resetWorkstreamLabelsForTests(): void; /** * Plain words for a workstream state. * * The parameter is the shared union, so the map above covers every case a * caller inside this package can pass. The runtime fallback is for an envelope * that arrived over transport from a peer running a newer build: underscores * become spaces, which reads as words rather than as a field name. */ export declare function describeWorkstreamState(state: WrfcState): string; //# sourceMappingURL=workstream-labels.d.ts.map