Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

test(evidence): a too-deep artifact is refused as depth, not as a document that fails to parse

Aashish2ae6c3a6bca2
diff --git a/tests/test_evidence.py b/tests/test_evidence.py
index f7000a01..4cee5a59 100644
--- a/tests/test_evidence.py
+++ b/tests/test_evidence.py
@@ -349,6 +349,18 @@ for _label, _argv, _expect in (
check_true("evidence CLI: %s prints no traceback" % _label, "Traceback" not in _err.getvalue())
check_true("evidence CLI: %s names the path" % _label, _expect in _err.getvalue())
+# The table asserts the path because that is the property all six rows share. For the depth row the
+# *kind* has to be pinned separately: a refusal that reused "is not valid JSON" would still exit 2 and
+# still name the file, and would tell the caller their artifact is malformed when it is only nested
+# deeper than `json` walks -- a different fix. Reusing the decode wording is the mistake this checks.
+_err = io.StringIO()
+with contextlib.redirect_stderr(_err):
+ _rc = evals_cli.main(["evidence", "--checkpoint", ckpt, "--report", _deep_report])
+check("evidence CLI: a too-deep --report is still usage error 2", _rc, 2)
+check_true("evidence CLI: a too-deep --report is refused as depth",
+ "nested deeper than it can be read" in _err.getvalue())
+check_true("and not as a document that fails to parse", "is not valid JSON" not in _err.getvalue())
+
# ... and on the artifact the research harness actually writes: identity at the document's top
# level, no `config` key. Read through `inspect_checkpoint`/`format_summary`, which is the whole of
# what `evidence` prints, so this covers the summary's own shape as well as the verdicts.