You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,11 +149,13 @@ Uses `.clang-format` with LLVM base style:
149
149
150
150
## Test Integrity
151
151
Never modify, delete, skip, or weaken tests to make them pass.
152
-
Never hardcode expected values, mock results, or otherwise contrive a passing test result.
152
+
Never fabricate, adjust, or derive expected values from the code under test just to force a pass; fixed expected values are acceptable when they come from an independent oracle, such as committed test vectors or other externally verified results.
153
153
A passing test suite achieved by changing the tests (not the implementation) is not a passing result.
154
154
Fix the code. If the code cannot be fixed within scope, escalate.
155
155
156
-
Never write a test that uses the code under test as its own oracle. Tests must have an independent oracle: known test vectors from an external source, cross-validation between two independent implementations, or bit-exact comparison against a reference path. A test that encrypts with function A and decrypts with function A proves nothing.
156
+
Do not use the code under test as its only oracle where an independent oracle is required, especially for crypto, KDFs, canonical encodings, and other security-sensitive transformations. In those cases, tests should use known external test vectors, cross-validation against an independent implementation, or bit-exact comparison against a trusted reference path. For example, a test that only encrypts with function A and decrypts with function A is insufficient to validate the correctness of the cryptographic primitive.
157
+
158
+
Roundtrip/property tests are still acceptable where they match the behavior being validated, such as encode/decode or serialize/parse flows already used elsewhere in this repository, but they should not be the sole oracle when stronger independent validation is needed.
157
159
158
160
## No Fabrication
159
161
Never report status, results, or completion that does not reflect work actually performed.
0 commit comments