Dashboard › institutional-transition-lab › Distillation
1de9a056-6634-4612-aa9d-c30581453d6f["lore_tm_v1_KaDOrYDRyiW1ydQjk_xtVKvnE6vH5K4txZnO1Ww7Jms","lore_tm_v1_wqdz4fKgnpYDhV4TgUvcdC_LypRWkEyZ2e-KriwXsdw","lore_tm_v1_i30QVitO77bwF2tbDJxMPdXgzvr0ts6l3X-KrOGeckI","lore_tm_v1_UjJiAre84h9A5Y_x6OikXGtqMIpIqBrEQBgsOlZuACY","lore_tm_v1_yLwNO231zQyeYRTa-oIUyqHSj3j-YdYz3gbBOH9V5OU","lore_tm_v1_jWWsjOViFstZIs75S-mTMitISCdYQSkIei037wZ0W_k","lore_tm_v1_gZ8767uoyxhxqITkoLbbJuxpYx7bALBziG9zCRowYhI","lore_tm_v1_J8Xuu9WaPz-oSHLQP-VcHRA607rwAPcLH3dAoJxvwX0","lore_tm_v1_n2jR-5B7zV_c-Y_HZj0Fh_VAe_TAfXn7mwIPfXVFyqU","lore_tm_v1_VxSzgdyV_H_cxAi--aGTDgZoGI340XmhydIImgrTfIc","lore_tm_v1_XuF84f-pvMhyO-pgevTcXAOAO_FV3SQKuhJUcv4cqKM","lore_tm_v1_5MboNID9-ci4DIO_4lxkLQ1_91eJfuziqCG399AhguI","lore_tm_v1_1xDQRVmBuaRc6qNO2lsmXtsyhhu-L8zMjynm0FDimUM","lore_tm_v1_r8mNe3tEytkeksNJtxiB2LlEp86yM1cGYczNssDY860","lore_tm_v1_-Hux0Gtmczy45smfcmLTgfcvhGCf6-tqtFElFkD1aWk","lore_tm_v1_XZw4RYsuk3dvKJIwCjRMDVEjBG2rG1AQyY9zRHAexRs","lore_tm_v1_-IySyhKtkGZRle_lB9BxP-X-SotLXKMgRqe5KZucAtg","lore_tm_v1_mFdx4_et-iixQsU50M1GLVADWj1nKey9q4gY_fllVW0","lore_tm_v1_5IhlXEKiSEQIWDPtqYcWQ9JPDsFG-RuifNd5q5WUKaI","lore_tm_v1_b_WboPmmyhVKz9MZtNx1_jaJoIytFSH553zarcyywtM","lore_tm_v1_OfkeoFs8M2UVRegaAgVCIW11aGi4HmR0aGP3PsUNR-w","lore_tm_v1_Cs4rL__XED9TJBQAf0x_wWzXCDd_GFo6zpT2dl67ysA","lore_tm_v1_Fe3PA9qT9xigvc8Hn_HPPhyJ8nJj3MKlRwiuWq-KS38","lore_tm_v1__9rz-SK6UjVH5uQ6uzOF1Ie2H5lyqdiWRMve05zA6Ds","lore_tm_v1_OukrhXTgYsRk9-x_jWnAg4rfQpT8YEmMvhIOfwtDoCE","lore_tm_v1_bww5Rcg0vRA0_T_0TSYup41HM8dCZi_HBCvnXjYqfkI","lore_tm_v1_jKfePMveadzl4saPu9yCPQOGRbHGGywnrpVpsLyozLk","lore_tm_v1_wG3mMs0RuThYEvdV01mVf7PwJmuYu96o6Zj8_U76W_g","lore_tm_v1_eR6th0blWWRoA2_mQNSas5b-I7AL9qHKxQ2X35ar-IA","lore_tm_v1_DtKCNpFByK1TEdBck031bKxyUTjwrT2UVsU8EeOXwXo","lore_tm_v1_H5mn8UNHbUL7LHyt0qt4OaxwoFc8Czib-2G0Hh7Ejto","lore_tm_v1_Sp0NQ-m8HZyXmCuyxLEqWzbS2UaqBJyLLi7WxnYIOes","lore_tm_v1_YUFcH4rSQ9-J_NYgqPH727fO1evcY-DFL5zay3OA9hA","lore_tm_v1_cKO4zUlVWIYFjNJT6MiuoQ3Q0IaK2okcJnxa0TCSaKA","lore_tm_v1_NgwMTvgeUdwJRbespThQqRnLRK0W88GdPcGyJqqMjNQ","lore_tm_v1_AacX5_dqqGbSiBihPlLltoz7ziWLYVNoM-k7MmG5jwE","lore_tm_v1_kRd3QTYD6gMgp2lTA_s7Xw8-K8KoUlaoTM2J8TImUaw"]
Date: Sep 9, 2026
/home/byk/Code/institutional-transition-lab, replacing a reviewer that returned empty twice and remaining disjoint from the immutable-input/archive reviewer.src/institution_lab/governance_adjudication.py main/output helpers and CLI/output-focused tests in tests/test_governance_adjudication.py.PASS, CONCERN, MUST-FIX, or BLOCKED and exact current file:line references.PASS with relied-upon tests/probes and residual risks if no defect exists.MERGE or DO-NOT-MERGE; if tools prevent review, report BLOCKED first with the exact tool/error and end DO-NOT-MERGE.src/institution_lab/governance_adjudication.py: render_markdown() at lines 779-825; _paths_alias() at 828-832; _validate_output_paths() at 835-841; _atomic_write() at 844-856; _write_failure_reports() at 859-879; and main() at 882-946._paths_alias(first, second) uses Path.samefile() and falls back on Path.resolve(strict=False) after FileNotFoundError; _validate_output_paths() compares every output against every input and then compares the two outputs._atomic_write(path, payload) creates parent directories, uses tempfile.mkstemp(prefix=f".{path.name}.", dir=path.parent), writes and flushes, calls os.fsync(destination.fileno()), then os.replace(temporary_name, path); on failure it removes the temporary file._write_failure_reports() sets schema_version=1, canonicalization_gate="closed", and validation_errors=[str(error)], then sequentially writes JSON and Markdown via _atomic_write().main() validates output aliases at line 906 before entering the try at line 907; catches only Exception at line 932; sequentially writes normal JSON and Markdown at lines 939-940 outside that handler; and raises ValueError after writing if collected validation errors exist.tests/test_governance_adjudication.py: _run_cli() at lines 87-103 constructs all CLI arguments and invokes governance_adjudication.main(); _stub_cli_validation() at lines 106-117 stubs schema validation, adjudication validation, and Markdown rendering.test_cli_validates_the_same_bytes_it_verifies() at lines 776-797 swaps document bytes before verification and expects ValueError: input manifest mismatch: documents_file_sha256.test_cli_rejects_output_aliases_to_frozen_inputs() at lines 800-833 covers all eight inputsβadjudication, input_manifest, documents, coding_package, artifact, protocol, coding_schema, adjudication_schemaβusing direct, symlink, and hardlink aliases, expecting output path aliases an input and unchanged input bytes.test_cli_rejects_aliased_outputs() at lines 836-845 covers only a direct output/output alias.test_cli_rejects_duplicate_manifest_keys() at lines 848-867 seeds an open JSON summary, triggers duplicate key artifact_sha256, expects a ValueError, and verifies the resulting JSON gate is closed.pytest execution was initially blocked because /usr/bin/bash reported pytest: command not found; repository contained uv.lock and pyproject.toml, permitting tests through uv.uv collected 78 tests, deselected 51, selected 27, and passed all 27 in 0.23s using Python 3.13.11, pytest 8.4.2, pluggy 1.6.0, and anyio 4.14.2.input_clobbered_after_parent_swap=True.forced second-output failure while JSON remained gate open and Markdown remained open.forced failure-report write failure; JSON was closed but Markdown remained open.output paths alias each other left a prior output gate open.KeyboardInterrupt left both pre-existing JSON and Markdown summaries open.output paths alias each other._atomic_write() failure probe confirmed destination remained unchanged and no temporary files remained.forced malformed input, set JSON gate closed, rendered Markdown closed, and removed open Markdown state.src/institution_lab/governance_adjudication.py and tests/test_governance_adjudication.py as untracked in the reviewed working copy.src/institution_lab/governance_adjudication.py = c686c4878409e68b958dd61850a59e9234416d817fc2fa3246fc728d51ebe0a5; tests/test_governance_adjudication.py = abf64b5e78a616d53b703dee5291ce7bf23fa9156fe59263a702e01cb8667bc5.validation_errors=["forced schema error"] and closed Markdown, but Markdown did not contain the error.1, emitted the alias error on stderr, and retained a prior open gate.1; JSON and Markdown were both closed and Markdown was no longer open.main_returned_success=True and input_replaced_by_open_summary=True.main_returned_success=True, the outputs aliased after the swap, and the nominal JSON output was not valid JSON._atomic_write() observed only fsync:file followed by replace, with no parent-directory fsync.src/institution_lab/governance_adjudication.py:828-841, :844-852, and :906 can overwrite an input and still exit successfully because path identity is checked once and mutable parents are resolved again during mkdir, mkstemp, and os.replace. Evidence: a retargeted output-parent symlink caused successful replacement of --adjudication with an open summary; another probe made both outputs alias and returned successfully with Markdown in --summary-json. Proposed deterministic regression: retarget a parent symlink during the first input callback and after temporary-file creation; require nonzero exit, unchanged input bytes, distinct outputs, and valid closed summaries._validate_output_paths is outside the protected block at src/institution_lab/governance_adjudication.py:906-907, only Exception is caught at :932, and prior summaries are not invalidated before fallible work. Evidence: aliased-output subprocess exited 1 but retained open JSON; forced KeyboardInterrupt left both summaries open; existing tests at tests/test_governance_adjudication.py:813-845 do not assert stale-output handling. Proposed deterministic regression: seed both outputs open, parameterize path-validation failures, OSError, KeyboardInterrupt, and SystemExit, and require every nonzero invocation to leave each output absent or unambiguously closed without modifying aliased inputs.src/institution_lab/governance_adjudication.py:938-940 and failure writes at :878-879 are sequential, normal writes are outside the handler, and there is no lock, transaction, generation identifier, or rollback. Evidence: forced second-write failure left JSON and old Markdown open; malformed input plus forced Markdown failure left JSON closed and Markdown open while masking the original error; concurrent invocations can interleave generations. Proposed deterministic regressions: force failures at JSON serialization, Markdown rendering, and each atomic write in success and failure paths; require no open artifact and preservation of the original exception; add a barrier-driven two-invocation test requiring one coherent generation._write_failure_reports() interpolates unescaped str(error) at src/institution_lab/governance_adjudication.py:859-875. Evidence: a multiline exception injected Canonicalization gate: **open** and a forged heading alongside the genuine closed declaration. Proposed deterministic regression: raise an exception containing newlines, Markdown syntax, HTML, and an open-gate declaration; require exactly one closed gate declaration and escaped literal rendering._atomic_write() is not crash-durable because it fsyncs the temporary file at src/institution_lab/governance_adjudication.py:850-851 and renames at :852 without fsyncing the parent directory, so a crash can restore an old directory entry including an old open summary. Instrumentation observed fsync:file then replace. Proposed deterministic regression: require filesystem-call order of file fsync, replacement through a bound directory descriptor, then parent-directory fsync.render_markdown() at src/institution_lab/governance_adjudication.py:779 accepts no validation errors and main() adds errors only to JSON at :935-940. Evidence: JSON contained forced schema error while closed Markdown omitted it. Proposed deterministic regression: force a collected validation error and require both summaries to render the same escaped error while returning nonzero.src/institution_lab/governance_adjudication.py:828-841; existing tests cover all eight inputs at tests/test_governance_adjudication.py:800-833.tests/test_governance_adjudication.py:836-845 covers only the direct case._atomic_write() provides process-level old-or-new replacement and removes its temporary file when os.replace fails.1 and replaced both prior open summaries with closed reports.uv run pytest -p no:cacheprovider tests/test_governance_adjudication.py -k 'cli' passed all 27 selected tests.DO-NOT-MERGE.