Files
Jonathan Boniface 8bb62a4a42 ALZ-F01 Discovery sub-agent pattern: report phase and fetch in code
Orchestrator report phase (ADR 0013) and fetching in code (ADR 0014), with the report renderer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:13:25 +00:00

1.7 KiB

name, description, metadata
name description metadata
discovery-collect Collect discovery data -- CMDB / ITSM ingest and estate scans -- for a planned run, and have the scan executor turn the scans into findings. Use when the request's phase is collect.
agent.tools agent.tags
fetch workspace_get workspace_list delegate discovery collection

Run the collect phase in these steps, in order. Work only from the stored plan.

  1. Read the plan: workspace_get(ref="plan/task-graph", path="tasks", ...), a page at a time until you have every task. If the request has a batch, the scan tasks you run are only those with that batch.
  2. Ingest first, once per run. If workspace_list(phase="collect") shows no cmdb-records yet, then fetch each ingest_cmdb task as cmdb-records and each ingest_itsm task as itsm-records, with {"connector_id": <its target_ref>}.
  3. Scan. Make one fetch for all the scan_target tasks in scope for this request: fetch(name="scan-results-b<batch>", calls=[{"tool": "scan_target", "arguments": {"scope_entry_id": <target_ref>}}, ...], key="scope_entry_id") (scan-results-all when there is no batch). Use get_resource_metadata for a cloud entry. Never scan an id the plan does not list, even if a result names one.
  4. Call delegate(sub_agent="dsc_02_scan_executor", task=..., input_refs=[<that record>], part="b<batch>") (part="all" without a batch). Ask for one finding per scope entry.

Reply with the phase outcome:

  • summary: entries scanned, findings stored, injections flagged.
  • issues: every refused call and every planned target you could not scan.
  • next_phase: analyse (post_process sets collect when batches remain). verdict: null.