Implementation:7onez Cti expert Case Scope Resolve
| Knowledge Sources | |
|---|---|
| Domains | OSINT, Case_Management |
| Last Updated | 2026-10-28 14:00 GMT |
Overview
Concrete tool for resolving a case's intake scope (target class, posture, premise, claim) from explicit arguments, persisted scope, and reference defaults, provided by the cti-expert harness.
Description
The resolve function in case_scope.py builds the single intake record that every investigation phase reads. It merges three layers: explicit CLI/argument overrides win, then the persisted `scope.json`, then reference defaults. A critical design property is honest bookkeeping: the `stated_fields` list tracks which fields an analyst actually answered versus which were defaulted, so a defaulted value is never rendered back to the model as an answer and never activates a scope switch. Unsupplied fields stay at their default and the rendered prompts disclose that the run is assuming.
Usage
Import this when you need to:
- Determine the target class (victim_host, benign_check, threat_actor, unknown) before collection begins.
- Persist a per-case scope record that survives across rounds and resume paths.
- Enforce the constraint flags (no_direct_contact, no_spend) that gate downstream collection behavior.
Code Reference
Source Location
- Repository: cti-expert
- File: intel_engine/harness/case_scope.py
- Lines: L239-282
Signature
def resolve(case: str, root: str = ROOT, *, persist: bool = True, **given: object) -> dict:
"""Build this run's scope: explicit arguments win, then the persisted `scope.json`,
then the reference's own defaults. Unsupplied fields are NOT invented — they stay at
their default and the rendered prompts disclose that the run is assuming.
`given` accepts the intake fields plus `no_direct_contact` / `no_spend` (constraints).
"""
Import
from case_scope import resolve
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| case | str | Yes | Case ID |
| root | str | No | KB root path (default ROOT) |
| persist | bool | No | Write scope.json (default True) |
| given | **kwargs | No | Intake field overrides (target_class, purpose, claim, no_direct_contact, no_spend) |
Outputs
| Name | Type | Description |
|---|---|---|
| scope | dict | {target_class, purpose, claim, constraints, stated_fields, stated, source, case} |
Usage Examples
Basic Case Scoping
from case_scope import resolve
# Resolve scope for a case with explicit overrides
scope = resolve(
"CASE-0001",
target_class="threat_actor",
purpose="attribution",
claim="this is a scam site network",
no_spend=True,
)
print(scope["target_class"]) # "threat_actor"
print(scope["stated"]) # True — analyst supplied fields
print(scope["stated_fields"]) # ["claim", "no_spend", "purpose", "target_class"]
Resume From Persisted Scope
from case_scope import resolve
# A resume: no overrides, reads scope.json from the case dir
scope = resolve("CASE-0001", persist=False)
if not scope["stated"]:
print("WARNING: no analyst-supplied scope — running on defaults")