Skip to content

Commit 84f8479

Browse files
authored
Refactor blocker appending for clarity and consistency
1 parent 8dc4eb9 commit 84f8479

1 file changed

Lines changed: 7 additions & 21 deletions

File tree

src/ix_cognition_kernel/wave6_fail_closed_candidate_gate.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -300,21 +300,15 @@ def blockers(self) -> tuple[WaveSixFailClosedCandidateGateBlocker, ...]:
300300
WaveSixFailClosedCandidateGateBlocker.EXECUTION_AUTHORITY_PRESENT
301301
)
302302
if self.self_validation_present:
303-
blockers.append(
304-
WaveSixFailClosedCandidateGateBlocker.SELF_VALIDATION_PRESENT
305-
)
303+
blockers.append(WaveSixFailClosedCandidateGateBlocker.SELF_VALIDATION_PRESENT)
306304
if not self.human_authority_present:
307-
blockers.append(
308-
WaveSixFailClosedCandidateGateBlocker.HUMAN_AUTHORITY_MISSING
309-
)
305+
blockers.append(WaveSixFailClosedCandidateGateBlocker.HUMAN_AUTHORITY_MISSING)
310306
if not self.independent_review_present:
311307
blockers.append(
312308
WaveSixFailClosedCandidateGateBlocker.INDEPENDENT_REVIEW_MISSING
313309
)
314310
if not self.claim_boundary_statement_valid:
315-
blockers.append(
316-
WaveSixFailClosedCandidateGateBlocker.CLAIM_BOUNDARY_INVALID
317-
)
311+
blockers.append(WaveSixFailClosedCandidateGateBlocker.CLAIM_BOUNDARY_INVALID)
318312
if not self.candidate_assembly.ready_for_fail_closed_readiness_gate:
319313
blockers.append(
320314
WaveSixFailClosedCandidateGateBlocker.CANDIDATE_ASSEMBLY_NOT_READY
@@ -324,13 +318,9 @@ def blockers(self) -> tuple[WaveSixFailClosedCandidateGateBlocker, ...]:
324318
WaveSixFailClosedCandidateGateBlocker.IX_OBLIGATION_PRESSURE_UNRESOLVED
325319
)
326320
if self.donor_evidence_incomplete:
327-
blockers.append(
328-
WaveSixFailClosedCandidateGateBlocker.DONOR_EVIDENCE_INCOMPLETE
329-
)
321+
blockers.append(WaveSixFailClosedCandidateGateBlocker.DONOR_EVIDENCE_INCOMPLETE)
330322
if self.evidence_package_empty:
331-
blockers.append(
332-
WaveSixFailClosedCandidateGateBlocker.EVIDENCE_PACKAGE_EMPTY
333-
)
323+
blockers.append(WaveSixFailClosedCandidateGateBlocker.EVIDENCE_PACKAGE_EMPTY)
334324
if self.falsification_pressure_missing:
335325
blockers.append(
336326
WaveSixFailClosedCandidateGateBlocker.FALSIFICATION_PRESSURE_MISSING
@@ -408,9 +398,7 @@ def canonical_payload(self) -> dict[str, Any]:
408398
_string_value(source) for source in donor_intake.missing_source_systems
409399
],
410400
"notes": list(self.notes),
411-
"ready_for_bounded_review_inputs": (
412-
self.ready_for_bounded_review_inputs
413-
),
401+
"ready_for_bounded_review_inputs": self.ready_for_bounded_review_inputs,
414402
"schema_version": self.schema_version,
415403
"self_validated": self.self_validated,
416404
"status": self.status.value,
@@ -492,7 +480,5 @@ def _require_non_empty(value: str, label: str) -> str:
492480
def _stable_sha256(payload: Mapping[str, Any]) -> str:
493481
"""Return deterministic SHA-256 over a canonical JSON payload."""
494482

495-
encoded = json.dumps(payload, sort_keys=True, separators=(",", ":")).encode(
496-
"utf-8"
497-
)
483+
encoded = json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8")
498484
return hashlib.sha256(encoded).hexdigest()

0 commit comments

Comments
 (0)