Dashboard › institutional-transition-lab › Distillation
a319050b-a95d-4654-9bf3-bd7e5946f3c8["lore_tm_v1_-ysiOszfWIfP85B076cNAxfFxOcj9SicmD18wz6PRDg"]
/home/byk/Code/institutional-transition-lab/tests/test_governance_adjudication.py is 1,024 lines long; the displayed excerpt covers lines 1–185 and imports DECISIONS, FROZEN_INPUT_PINS, REQUIRED_INPUT_PINS, REVIEWER_ROLES, REVIEWER_TYPES, canonical_sha256, file_sha256, validate_adjudication, validate_adjudication_fragment, validate_against_schema, and verify_input_manifest from institution_lab.governance_adjudication.BODY_PATCH_RELATIONS, CHANGE_STATUSES, DIRECTIONS, EVENT_KINDS, RECORD_CLASSES, and RIGHT_KINDS from institution_lab.governance_coding; ROOT = Path(__file__).parents[1] and MAX_TEST_ARCHIVE_MEMBERS = 256._write_pinned_cli_inputs(tmp_path, monkeypatch) creates paths for adjudication.json, inputs.json, documents.json, coding-package.json, artifact.zip, protocol.md, coding-schema.json, adjudication-schema.json, summary.json, and summary.md; initial values are empty documents, an empty coding package (records: [], summary: {}), and adjudication schema {"type": "object"}._write_pinned_cli_inputs() builds artifact.zip with members documents.json and v1.2-adjudication-package.json, then constructs a manifest containing workflow/artifact IDs plus hashes computed by file_sha256() or canonical_sha256() and monkeypatches governance_adjudication.FROZEN_INPUT_PINS to that manifest._run_cli(monkeypatch, paths) sets sys.argv for institution-lab-governance-adjudication, passing --adjudication, --input-manifest, --documents, --coding-package, --artifact, --protocol, --coding-schema, --adjudication-schema, --summary-json, and --summary-markdown, then invokes governance_adjudication.main()._stub_cli_validation(monkeypatch) replaces validate_against_schema with an empty-error result, replaces validate_adjudication with ([], {"canonicalization_gate": "open"}), and replaces render_markdown with gate: open\n.test_adjudication_schema_matches_validator_ontology() checks that schema/governance-adjudication-v1.schema.json enum sets exactly match runtime constants: record decisions→DECISIONS, reviewer types→REVIEWER_TYPES, reviewer roles→REVIEWER_ROLES, coding classes→RECORD_CLASSES, event kinds→EVENT_KINDS | {None}, body/patch relations→BODY_PATCH_RELATIONS, right kinds→RIGHT_KINDS, directions→DIRECTIONS, and change statuses→CHANGE_STATUSES.test_schema_enforces_uri_and_date_formats() is parameterized over invalid source_url: "not a URI" and invalid announced_on: "2024-02-30"; validate_against_schema() must report an error containing records.0.source_url for the former and records.0.final_coding for the latter._coding(record_class="no_event") returns a coding with event_kind, title, announced_on, effective_on, affected_scope, and ambiguity set to None; body_patch_relation: "not_applicable", power_changes: [], and confidence: 1.0._documents() defines schema_version: 1, coding_id: "oss-governance-enriched-coding-v1", coding_schema_sha256: "coding-schema-hash", design_status: "performance_blinded_model_informed_development", transition_dates_excluded: True, outcome_data_used: False, model_input_fields: [], and starts a document with record_id: "example-1" and source URL https://github.com/acme/example/issues/1.