ALZ-F01 Discovery: package step, value scorecard, application grouping, cases

- New cp1-discovery-package-agent (ADR 0020): one package per reviewed run, every part
  hashed (sha256 over canonical JSON), with a manifest and a value scorecard.
- Applications grouped CMDB -> tag -> resource group with a judged model fallback (ADR 0021):
  CMDB 0.7.0 carries ownership, dependency mapping 0.6.0 groups, report 0.9.0 shows them.
- Critic 0.6.1 accepts the producers' enums; build_workflow.py refuses a consumer enum
  narrower than its producer's.
- Code hooks, sub-agents and tests for the inventory, CMDB, dependency, planner and critic
  agents; the report and Well-Architected review agents; ADRs 0012-0021.
- Workflow cases with value bars and run limits; run evaluation and usage collection scripts;
  the run context template and the field-by-field review for ADR 0016.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-05 22:13:25 +00:00
parent f659564208
commit 9e503885cc
211 changed files with 18170 additions and 158 deletions

View File

@@ -1,3 +1,51 @@
## [0.4.1] - 2026-11-04
### Changed
- Runs on `gpt-5.4`, with `LITELLM_MAX_TOKENS` 16384. On a live Azure run with 81 inventory records
(`exec_beb8879632b8`, and earlier `exec_c57354b25f8e`), `gpt-5.6-sol` returned HTTP 429 for its token rate limit
and the step failed. `gpt-5.4` has its own quota (ADR 0008).
## [0.4.0] - 2026-11-03
### Added
- Live runs return `topology_summary`, the number of items read per topology kind.
## [0.3.2] - 2026-11-03
### Fixed
- Prompt placeholders are written `<provider>`, not `{provider}`: the runtime reads `{name}` in a prompt as a session variable, and 0.3.1 failed with "Context variable not found: `provider`".
## [0.3.1] - 2026-11-03
### Fixed
- `mcp:` names the cloud servers by the gateway's display names, "Azure Discovery" and "Google Cloud Discovery". With the server ids, 0.3.0 failed at startup: the gateway offers servers by display name.
## [0.3.0] - 2026-11-03
### Added
- The `provider` input: `sample` (unchanged) or a live cloud, `azure` or `gcp`, read through the existing discovery servers (ADR 0013). Live tools: `{provider}_get_network_topology`.
## [0.2.1] - 2026-11-01
### Fixed
- A sole firewall at a site is always a `single_point_of_failure`. Runs on the same data disagreed.
## [0.2.0] - 2026-11-01
### Added
- An `unknown_source` finding: a source that isn't in the inventory or any routed range, reaching an in-scope asset.
### Fixed
- An overlap between sites is now a finding as well as an `overlap_with` value, and every site is examined.
## [0.1.0] - 2026-10-29
### Added

View File

@@ -1,7 +1,7 @@
name: "cp1-network-discovery-assessment-agent"
display_name: "CP1 - Network Discovery & Assessment Agent"
description: "Maps routed ranges, flows and topology per site, and reports bottlenecks, overlaps, legacy protocols, single points of failure and unowned rules with evidence."
version: "0.1.0"
version: "0.4.1"
framework: "adk"
tags:
- "cp1"
@@ -19,6 +19,10 @@ mcp:
- "collect_topology"
- "map_flows"
- "analyze_bottlenecks"
"Azure Discovery":
- "azure_get_network_topology"
"Google Cloud Discovery":
- "gcp_get_network_topology"
skills:
- id: "cp1_network_discovery_assessment_agent"
name: "CP1 - Network Discovery & Assessment Agent"

View File

@@ -1,10 +1,12 @@
# Changes to ALZ-DSC-07's original requirements
The decisions are recorded once, for all eight agents, in the Feature's [docs/adr/](../../../docs/adr/README.md). These change what the ALZ-DSC-07 story (ADO 3214457) and its v1.1 story files say:
The decisions are recorded once, for all agents, in the Feature's [docs/adr/](../../../docs/adr/README.md). These change what the ALZ-DSC-07 story (ADO 3214457) and its v1.1 story files say:
- [ADR 0001](../../../docs/adr/0001.md)
- [ADR 0002](../../../docs/adr/0002.md)
- [ADR 0007](../../../docs/adr/0007.md)
- [ADR 0008](../../../docs/adr/0008.md)
- [ADR 0010](../../../docs/adr/0010.md)
- [ADR 0013](../../../docs/adr/0013.md)
A change that affects only this agent gets its own record here, numbered `07-NNNN`.

View File

@@ -32,7 +32,8 @@ data:
# LLM model (required) - MUST use *LLM_MODEL or *SLM_MODEL pattern for watcher
# Any model the platform's gateway offers, e.g. gpt-5.4, claude-sonnet-4-6.
LITELLM_MODEL: "gpt-5.6-sol"
# gpt-5.4 has its own quota: gpt-5.6-sol hit its token rate limit on an 81-record estate (ADR 0008)
LITELLM_MODEL: "gpt-5.4"
# =============================================================================
# Optional Model Settings
@@ -44,7 +45,7 @@ data:
# model, so setting those is silently ignored — the agent keeps running at the
# defaults with no error to chase.
LITELLM_TEMPERATURE: "1"
LITELLM_MAX_TOKENS: "32000"
LITELLM_MAX_TOKENS: "16384" # gpt-5.4 accepts at most 16,384 completion tokens
# =============================================================================
# Agent Loop Guard Rails

View File

@@ -11,10 +11,53 @@ object your output schema defines: no prose, no markdown fence.
| `alz-network` | `collect_topology` | read |
| `alz-network` | `map_flows` | read |
| `alz-network` | `analyze_bottlenecks` | read |
| `azure-discovery` | `azure_get_network_topology` | read |
| `gcp-discovery` | `gcp_get_network_topology` | read |
**Steps:**
1. For each site in `tasks` (the `collect_network` tasks' `target_ref`, or the sites of the scan tasks), call `alz-network.collect_topology(site)`, `alz-network.map_flows(site)` and `alz-network.analyze_bottlenecks(site)`.
1. For each site (every `collect_network` task's `target_ref`, and the site of every record in `records`), call `alz-network.collect_topology(site)`, `alz-network.map_flows(site)` and `alz-network.analyze_bottlenecks(site)`.
## Live provider
`provider` is set once for the whole run. `sample` means the Meridian sample estate through the `alz-*` tools:
everything in this prompt applies as written and you ignore this section. `azure` or `gcp` means a live cloud,
read through that cloud's discovery server, and these rules replace the `alz-*` steps above:
- **One cloud only.** Use only the tools whose names start with `<provider>_`. Never call another cloud's tools or
the `alz-*` tools: a call to another cloud's tool reads a different estate and is a critical defect.
- **Identifiers.** A scope entry is a cloud resource, and its `scope_entry_id` is the resource's own name (`gcp`,
e.g. `//compute.googleapis.com/projects/p/zones/z/instances/i`) or id (`azure`, e.g.
`/subscriptions/s/resourceGroups/g/providers/...`) exactly as a tool returned it. It is an identifier, not a URL:
passing one an earlier call in this run returned is allowed. Never pass anything else.
- **Missing sources.** A live run has no CMDB, ITSM, flow or schema source. They are declared gaps, never filled
in, and never reported as clean results.
- **Volume.** Never call `<provider>_list_recommendations`, `<provider>_query_resources`, or
`<provider>_list_resources` without a type: their output is too large for a step.
**Kinds:**
| Tool | `azure` kinds | `gcp` kinds |
|---|---|---|
| `list_accounts` | `subscriptions`, `resource_groups` | `projects` |
| `list_servers` | `virtual_machines`, `scale_sets` | `instances` |
| `list_workloads` | `app_service`, `container_apps`, `container_instances` | `cloud_run`, `cloud_functions`, `app_engine` |
| `list_kubernetes_clusters` | (takes no kind) | `clusters` |
| `list_data_stores` | `sql`, `cosmos_db`, `storage_accounts`, `postgresql`, `mysql`, `redis` | `cloud_sql`, `firestore`, `cloud_storage` |
| `get_network_topology` | `virtual_networks`, `route_tables`, `network_security_groups`, `gateways`, `load_balancers`, `private_endpoints`, `public_ips` | `networks`, `subnetworks`, `routes`, `firewall_rules`, `load_balancers`, `gateways` |
Call a tool once for **every** kind its row lists, with `page_size` 50, and follow `next_page_token` to the end. A
tool called without `kind` returns its first kind only.
**Assessing a live run's network:** call `<provider>_get_network_topology` for every kind in **Kinds**.
- `ranges`: each subnetwork's CIDR, with `site` its region and `source_ref` its resource name or id; mark overlaps.
- `findings`: `address_overlap` for overlapping CIDRs; `internet_exposure` (severity `high`) for each firewall or
NSG rule allowing `0.0.0.0/0`, `::/0` or `*` inbound to 22, 3389, 21, 1433, 3306 or 5432; `single_point_of_failure`
only where the topology shows one path and nothing else.
- `flows`: empty. `netflow` is a source gap, so never report a bottleneck or an unknown source.
- `topology_summary`: how many items of each kind you read, e.g. `{"networks": 1, "subnetworks": 1, "routes": 2,
"firewall_rules": 0}`, every kind in **Kinds** included, with 0 for none.
## Role: Network Discovery & Assessment Executor (workflow: discovery, safety class 1 read-only)
@@ -50,7 +93,7 @@ Use these **EXACT** specifications:
- **Finding Schema**:
- `finding_id`: STRING (e.g., `'NF-001'`)
- `type`: ENUM (`'bottleneck'`, `'single_point_of_failure'`, `'unsupported_device'`, `'legacy_protocol'`, `'address_overlap'`, `'unowned_rule'`)
- `type`: ENUM (`'bottleneck'`, `'single_point_of_failure'`, `'unsupported_device'`, `'legacy_protocol'`, `'address_overlap'`, `'unowned_rule'`, `'unknown_source'`)
- `subject`: STRING
- `measurement`: STRING | null
- `window`: STRING | null
@@ -66,9 +109,23 @@ Use these **EXACT** specifications:
- **Overlap**:
```python
FOR EACH pair (a, b) IN ranges WHERE a.site != b.site AND overlaps(a.cidr, b.cidr): a.overlap_with += [b.cidr]
FOR EACH pair (a, b) IN ranges WHERE a.site != b.site AND overlaps(a.cidr, b.cidr):
a.overlap_with += [b.cidr]; b.overlap_with += [a.cidr]
EMIT address_overlap(subject=a.cidr + ' overlaps ' + b.cidr, severity='high') # once per pair
```
- **Unknown Source**:
```python
FOR EACH flow IN flows WHERE flow.destination IS a canonical_id AND flow.source IS NOT a canonical_id AND flow.source IS NOT IN any range:
EMIT unknown_source(subject=flow.source + ' to ' + flow.destination + ' ' + flow.port, severity='high')
```
- **Single Point of Failure**:
```python
IF site has exactly one firewall device: EMIT single_point_of_failure(subject=device.name, severity='high')
```
Only this rule raises one, so the same estate gives the same finding.
- **Legacy Protocol**:
```python
IF flow.port IN ('tcp/21', 'tcp/23', 'tcp/445' WITH smb_v1): EMIT legacy_protocol
@@ -103,6 +160,7 @@ Report bottlenecks and network risks with measurements and evidence.
- Capture every routed range with its source.
- Report measurement and window on every capacity finding.
- Cite evidence on every flow and finding.
- Report every overlap and every unknown source as a finding, not only in `ranges` or `flows`.
### MUST NOT DO
- Do not make any network change or generate test traffic.

View File

@@ -224,6 +224,16 @@
"confidence"
]
}
},
"provider": {
"type": "string",
"enum": [
"sample",
"azure",
"gcp"
],
"default": "sample",
"description": "Which estate this run reads: `sample` (the Meridian sample estate, through the alz-* tools) or a live cloud, `azure` or `gcp`, through that cloud's discovery server. Set once for the whole workflow run."
}
},
"required": [

View File

@@ -82,7 +82,9 @@
"unsupported_device",
"legacy_protocol",
"address_overlap",
"unowned_rule"
"unowned_rule",
"unknown_source",
"internet_exposure"
]
},
"subject": {
@@ -125,6 +127,11 @@
"severity"
]
}
},
"topology_summary": {
"type": "object",
"default": {},
"description": "Live runs: how many items of each topology kind were read, e.g. {\"networks\": 1, \"firewall_rules\": 0}."
}
},
"required": [