Skip to main content

Module bug

Module bug 

Source
Expand description

Bug fixes, the L2 rung: a person’s triad — what happens (Current), what should (Expected), what must stay as it is (Unchanged) — one reproduction per Expected statement that fails on the untouched code by an assertion, shown to the person once and then frozen, and a fix judged like any task plus three bug rules: every reproduction goes from red to green, the pass-to-pass set stays green, and undoing the fix (the revert) is rejected by at least one reproduction.

The rules live here, where they are property-tested; running tests and model calls is the runtime’s.

Structs§

AcceptanceRef
What the fix’s visible acceptance set came from.
BugHome
The bug’s home, as the format adapter chose it.
BugReport
A bug: where it lives, the person’s triad, the reproductions and how far it got. The bug payload, and what speccoder keeps of it.
Candidate
Someone else’s fix, judged as the attempt.
CandidateRefusal
Why a candidate was refused before it was applied.
Claim
The author’s own words, kept only as a labelled claim.
Confirmation
The person’s one confirmation, bound to what they saw.
Discrimination
Everything that shows the reproductions tell a fixed tree from a buggy one.
Handoff
The hand-off of a stopped bug, composed by the engine from the journal (never written by a model).
HeldOutVariant
A held-out variant, as the payload shows it: never its content or path.
IssueRef
The issue a bug was recorded from.
Member
One test that must stay green.
PassToPass
The tests that passed before the fix and must pass after it.
PreFrozenRef
Where the confirmed reproductions are kept, as recorded with the fix.
Rejection
The person rejected the reproductions shown; the reason goes to the author’s next try.
ReproduceTry
One try of the reproduction author.
Reproduction
One reproduction test.
RevertResult
The revert candidate’s result.
SpecialCase
One special-case candidate: a fix that recognises a reproduction’s literal inputs.
Statement
One statement of the triad, in the person’s words.
Statements
Statements, by what the tries showed.
Triad
The person’s three statements about a bug.
TryStatement
One statement’s class in one try.

Enums§

Basis
How the person decided the reproductions.
CandidateOrigin
Where a foreign fix came from.
Final
A reproduction on the final tree.
HomeKind
Where the format keeps the bug.
MemberFinal
A pass-to-pass member on the final tree.
Outcome
The bug’s outcome; distinct from a task’s verdict.
PassToPassState
Whether anything was selected for pass-to-pass.
Reproduce
What reproduce decided.
Revert
A reproduction against the revert candidate (the fix undone).
Source
Who wrote a reproduction.
Stage
Where the bug is.
TriadError
Why words are not a triad.

Constants§

DEFAULT_TRIES
Reproduce tries when [bug] reproduce_tries is not set.
MAX_SLUG
The most a bug slug may be long.
MAX_TRIES
The most [bug] reproduce_tries allows.

Functions§

bug_class
The class a reproduction counts as from its two baseline runs: red only by an assertion in both; red once, then not, is flaky; an absent symbol is not a bug’s red.
bug_verdict
The verdict on a bug task: base (the ordinary rules, held-out included) stands only if every reproduction passed on the final tree, the revert was rejected by an assertion, every reproducing statement has a special case and each was rejected (or ruled), the pass-to-pass set passed by name and the held-out variants passed. Reasons name statements, never a held-out test.
decide_reproduce
What the tries so far decide, for the Expected statements expected and at most max tries. Pure; never reads the author’s words.
normalise
text with every run of whitespace one space, trimmed: how statements are compared and hashed.
rejected_try
Why a try was discarded when the person rejected what it reproduced.
valid_slug
Whether slug names a bug directory: lowercase ASCII letters, digits and -, starting with a letter or digit, at most MAX_SLUG long — never a path (.., a separator) whatever its source (a flag, an interface, a commit trailer of an untrusted pull request).