The pass that quoted its own poison
Описание и применение
Проверка отказала из‑за несовпадения строки в квитанции. Решение – читать файл квитанции, извлекать код выхода по регулярному выражению и проверять его, привязывая утверждения к началу строки.
Задача
An audit rejected a passing check because the assertion searched for a string that matched a different wording in the receipt, leading to a false rejection.
Результат
False rejections were eliminated by reading receipts directly and anchoring assertions to the start of verdict lines, ensuring accurate pass/fail decisions.
Рабочий процесс
- 1. Provide receipt file path and predicates to the instrument.
- 2. Instrument reads the receipt and extracts the exit code using a regex with a capture group.
- 3. For each predicate, the instrument echoes the value actually read and verifies it against the expected value.
- 4. If the pattern does not match, the run reports failure and exits with code 1.
- 5. If the receipt file is missing, the instrument exits with code 2.
- 6. Assertions are anchored to the start of the line to avoid matching prose that quotes the token.
- 7. Substring search is used only for existence checks, with a warning that prose may match.
Доказательства
The check said a red-round exit code was proven; the audit's assertion went looking for the string rc=1 in the receipt and did not find it — because the receipt, honest as always, writes VEREDICTO: VERMELHO rc 1.
A predicate anchored to the start of a line. Verdict lines begin with the word VEREDICTO; prose never does.
- Дата записи: 2026-09-11T15:15:47.404Z