Implementation:7onez Cti expert Orchestrator Judge
| Knowledge Sources | |
|---|---|
| Domains | OSINT, Assessment, LLM_Orchestration |
| Last Updated | 2026-10-28 14:00 GMT |
Overview
Concrete tool for judging cluster members against the assessment schema via an LLM phase forced to structured output, provided by the cti-expert orchestrator.
Description
The _judge function in orchestrator.py runs an LLM phase per cluster (or per case with members_only=False) that judges the cluster's domains against the Assessment Pydantic schema. The phase receives the KB facts/edges, cluster partitions, and the temporal timeline from the Correlate phase, and must return a validated Assessment object with attribution level, confidence, alternatives, gaps, and the premise verdict.
The _persist_assessment function writes the validated assessment to cases/<case>/assessment.{md,json} — the assessment is persisted as both human-readable markdown and machine-readable JSON for downstream report rendering.
Usage
Import this when you need to:
- Run the Assess phase for a cluster (per-cluster parallel judgment).
- Persist the validated assessment to the case directory.
- Bridge the Correlate phase output to the Verify/Report phase input.
Code Reference
Source Location
- Repository: cti-expert
- File: intel_engine/harness/orchestrator.py
- Lines: L438-520 (_judge), L2151-2196 (_persist_assessment)
Signature
async def _judge(domains: list[str], case: str, members_only: bool) -> tuple[Assessment | None, dict]:
"""Judge cluster domains against the Assessment schema. Returns the validated
Assessment object (or None on failure) and a metadata dict."""
def _persist_assessment(assessment: Assessment, case: str, table_md: str) -> dict:
"""Write assessment to cases/<case>/assessment.{md,json}."""
Import
# Internal to orchestrator.py
from orchestrator import _judge, _persist_assessment
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| domains | list[str] | Yes | Cluster member domains to judge |
| case | str | Yes | Case ID |
| members_only | bool | Yes /// Per-cluster parallel judgment flag |
Outputs
| Name | Type | Description | |
|---|---|---|---|
| assessment | Assessment | None | Validated Assessment object (None on failure) |
| meta | dict | Judgment metadata (cost, timing, raw result) |
Usage Examples
Per-Cluster Parallel Judgment
import asyncio
from orchestrator import _judge
# Judge each cluster in parallel
async def judge_all(clusters, case_id):
tasks = [_judge(c["domains"], case_id, members_only=True) for c in clusters]
results = await asyncio.gather(*tasks)
for c, (assessment, meta) in zip(clusters, results):
if assessment:
_persist_assessment(assessment, case_id, table_md="")
Related Pages
Implements Principle
- Principle:7onez_Cti_expert_Schema_Forced_Assessment
- Principle:7onez_Cti_expert_LLM_Phased_Investigation