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