--- name: discovery-analyse description: Analyse collected discovery data -- inventory, CMDB reconciliation, data classification, network and dependencies -- through the specialist sub-agents. Use when the request's phase is analyse. metadata: agent.tools: fetch workspace_get workspace_list delegate agent.tags: discovery analysis --- Run the analyse phase in these steps, in order. Each step's sub-agent needs the records the steps before it stored. Call `workspace_list()` first to see the refs, and pass only refs it lists: a source the run didn't use, such as ITSM, has no record. 1. Inventory. `fetch` `list_apps` as `inventory-app-list`, and read it. Then `fetch` `get_app` for each application as `inventory-sources`, with `key="app_id"`. Then `delegate("dsc_03_inventory", ..., input_refs=[every collect/findings-* ref, "collect/cmdb-records", "collect/itsm-records", "analyse/inventory-sources", ])`. 2. Reconciliation. If `source_gaps` in `plan/task-graph` lists `cmdb`, skip these calls, but still delegate. Otherwise read `analyse/inventory`, `fetch` `cmdb_query` for each record as `cmdb-candidates` with `key="hostname"`, read it, and `fetch` `diff_records` for each candidate as `cmdb-matches` (if there are no candidates, leave `cmdb-matches` out of the refs). Then `delegate("dsc_04_cmdb_reconciliation", ..., input_refs=["analyse/inventory", "analyse/cmdb-matches", "collect/cmdb-records", "collect/itsm-records", "plan/task-graph", ])`. 3. Data classification. `fetch` `scan_schema` for each record in `analyse/inventory` whose `asset_class` is `database` or `storage_array`, as `schemas`, with `key="scope_entry_id"`. Then `delegate("dsc_05_data_classification", ..., input_refs=["analyse/inventory", "analyse/schemas", "plan/task-graph"])`. 4. Network. One `fetch`, as `network-sources`, with `collect_topology`, `map_flows` and `analyze_bottlenecks` for each site in the plan's `collect_network` tasks, with `{"site": }`. Then `delegate("dsc_07_network", ..., input_refs=["analyse/network-sources", "analyse/inventory"])`. 5. Dependencies. One `fetch`, as `dependency-sources`, with `get_dependencies` and `trace_calls` for each canonical record that has a `scope_entry_id`, and `trace` for the set. Then `delegate("dsc_06_dependency_mapping", ..., input_refs=["analyse/inventory", "analyse/drift-report", "analyse/network", "analyse/dependency-sources"])`. Never read row data and never pass a tool anything but ids. If a step's tool calls are refused, still delegate with what you stored, and report the refusal. Reply with the phase outcome: - `summary`: canonical records, drift items, classified stores, edges, network findings. - `issues`: refused calls, failed hand-offs, records queued for SME review. - `next_phase`: `critique`. `verdict`: null.