Add CP1 Discovery agents in both patterns
All checks were successful
check agents / check (push) Successful in 10s
All checks were successful
check agents / check (push) Successful in 10s
ALZ-F01 Discovery as a sub-agent orchestrator (sub-agents/) and as eight individual declarative agents (individual-agents/), with their KAB workflow exports. Shared check, render and import scripts, the alz-discovery-sample MCP server, the crucible-kab-dev deploy profile, deployment docs, platform issue reports and the source material. Agent steps time out at 20 minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
# Context: cp1-alz-discovery-orchestrator-agent
|
||||
|
||||
For coding agents working in this folder. Human documentation is in `docs/`; don't duplicate it here.
|
||||
|
||||
## What this agent is
|
||||
|
||||
The ALZ-F01 Discovery workflow as one KAB agent (runtime `agent-runtime-adk` 0.35.7) with eight sub-agents, one per ADO story. Built from the platform's `subagent-pattern` (the declarative shape plus `sub_agents:`). Every change to the story requirements is recorded in `docs/adr/` (0001–0011).
|
||||
|
||||
## Story → implementation map
|
||||
|
||||
| ADO | Story | Sub-agent | Phase | Prompt | Rules it calls (`app/rules.py`) | Stored as |
|
||||
|---|---|---|---|---|---|---|
|
||||
| 3214451 | ALZ-DSC-01 Discovery Planner | `dsc_01_planner` | plan | `prompts/dsc_01_planner.md` | — (`check_plan` runs on its output) | `plan/task-graph` |
|
||||
| 3214452 | ALZ-DSC-02 Estate Scan Executor | `dsc_02_scan_executor` | collect | `prompts/dsc_02_scan_executor.md` | — | `collect/findings-<part>` |
|
||||
| 3214453 | ALZ-DSC-03 Asset Inventory Normalisation | `dsc_03_inventory` | analyse | `prompts/dsc_03_inventory.md` | `match_score`, `record_confidence` | `analyse/inventory` |
|
||||
| 3214454 | ALZ-DSC-04 CMDB & ITSM Reconciliation | `dsc_04_cmdb_reconciliation` | analyse | `prompts/dsc_04_cmdb_reconciliation.md` | `ghost_action` | `analyse/drift-report` |
|
||||
| 3214455 | ALZ-DSC-05 Data Classification | `dsc_05_data_classification` | analyse | `prompts/dsc_05_data_classification.md` | `roll_up_store` | `analyse/data-classification` |
|
||||
| 3214456 | ALZ-DSC-06 Dependency Mapping | `dsc_06_dependency_mapping` | analyse | `prompts/dsc_06_dependency_mapping.md` | `score_edge`, `node_metrics` | `analyse/dependency-graph` |
|
||||
| 3214457 | ALZ-DSC-07 Network Discovery & Assessment | `dsc_07_network` | analyse | `prompts/dsc_07_network.md` | `find_overlaps`, `bottleneck_severity` | `analyse/network` |
|
||||
| 3214458 | ALZ-DSC-08 Discovery Critic | `dsc_08_critic` | critique | `prompts/dsc_08_critic.md` | `coverage_check` | `critique/critic-verdict` |
|
||||
|
||||
The source of each prompt is the story's v1.1 Comprehensive Prompt (engineering hub workspace: `drafts/cp1/agentic-landing-zone/stories/F01-discovery/ALZ-DSC-0N-Comprehensive-Prompt.md`), with the `alz-run` tools and the agent's own MCP calls removed (ADRs 0002, 0003).
|
||||
|
||||
## Files
|
||||
|
||||
| File | Responsibility |
|
||||
|---|---|
|
||||
| `agent.yaml` | Identity, skills, contract, `functions:`, `mcp:` (9 logical servers, read-only tools), `sub_agents:` (all `as_tool: false`), hooks |
|
||||
| `prompt.md` | Orchestrator instructions and the L0 charter |
|
||||
| `skills/discovery-<phase>/SKILL.md` | The steps of each phase: which MCP calls, which records, which `delegate` calls |
|
||||
| `app/artifacts.py` | Plan-phase import of `source_documents` / `artifacts` into `plan/source-documents`, `plan/artifact-NN` (content) and `plan/artifact-NN-provenance` (id, type, path, sha256 -- never sent to a sub-agent) |
|
||||
| `app/workspace.py` | Run store: write-once records, hash-chained `manifest.jsonl`, `bind_run`/`current_run` (a contextvar set in `pre_process`) |
|
||||
| `app/tools.py` | `workspace_put/get/list`; `delegate` (phase allow-list `PHASE_SUB_AGENTS`, forced critic inputs, stores replies, records failures as `failed-*`) |
|
||||
| `app/rules.py` | Deterministic rules; `_plan_issues` is shared by `check_plan` and `post_process` |
|
||||
| `app/business_logic.py` | `before_model` names the run and phase; `pre_process` infers the phase from `outcome-*` records, checks the chain and prerequisites, and may answer with `Reply`; `post_process` rebuilds the reply, enforces the verdict and writes the phase's `outcome-*` |
|
||||
| `schemas/` | Contract; `phase` is optional |
|
||||
| `kubernetes/` | Kyndryl CI placeholders, the same as cp4-agents; filled only in `../../../build/` by `../../../scripts/render_k8s.py` |
|
||||
|
||||
## Invariants: don't break these
|
||||
|
||||
1. **Records are write-once.** Never add an overwrite path to `workspace.put`.
|
||||
2. **The run comes from the request** (via `bind_run`), never from a model's tool arguments.
|
||||
3. **`post_process` decides** `status`, `artifacts`, `verdict`, `next_phase` and `manifest_head` from the workspace. Don't trust the model's values for these.
|
||||
4. **The critic's inputs are every record in the run.** A critique without a parseable critic record is `failed`; a critique with any reason is not `completed`.
|
||||
5. **Sub-agents get no MCP tools** (the runtime refuses them). Data reaches them through records and `workspace_get`.
|
||||
6. **No keys in any file.** `scripts/check_agents.py` scans for them.
|
||||
7. **Artifacts enter only through the orchestrator** (ADR 0012): sub-agents get content records, never artifact ids, paths or `-provenance` records.
|
||||
8. **Every requirement change gets an ADR** in `docs/adr/`, and a matching step in `.agents/PLAN.md`.
|
||||
|
||||
## Runtime facts relied on (agent-runtime-adk 0.35.7)
|
||||
|
||||
- **Sub-agent keys:** `name`, `description`, `prompt`, `functions`, `as_tool`. No `mcp`, no skills.
|
||||
- **`ask_sub_agent(name, request)`** runs outside the request's model-call budget and raises `SubAgentFailed`. Hooks run on sub-agent model calls, with `call.agent` set to the sub-agent's name.
|
||||
- **`pre_process` may return `Reply(text)`** to answer without a model call. `post_process` runs before the output contract check.
|
||||
- **A content rule** (data is never instructions) is appended to every prompt by the runtime.
|
||||
|
||||
## Verify a change
|
||||
|
||||
```sh
|
||||
python3 ../../../scripts/check_agents.py --runtime-image cruciblecoredevacr.azurecr.io/kab/agent-runtime-adk:0.35.7 .
|
||||
python3 ../scripts/dry_run.py . "$(mktemp -d)"
|
||||
python3 ../scripts/build_workflow.py && git diff --exit-code ../workflows/ # after any schemas/ change
|
||||
```
|
||||
@@ -0,0 +1,43 @@
|
||||
# Implementation plan: cp1-alz-discovery-orchestrator-agent
|
||||
|
||||
For coding agents. Update the status column in the same change as the work, and add an ADR for anything that changes a requirement.
|
||||
|
||||
Status: `done`, `in progress`, `blocked (<on whom>)`, `todo`.
|
||||
|
||||
## Goal
|
||||
|
||||
Deploy ALZ-F01 Discovery to `crucible-kab-dev-aks` as one orchestrator agent with eight sub-agents, run end to end on the Meridian sample estate, and import the KAB workflow. Then repeat the shape for ALZ-F02 to F07.
|
||||
|
||||
## Steps
|
||||
|
||||
| # | Step | Files | Verified by | Status |
|
||||
|---|---|---|---|---|
|
||||
| 1 | Agent folder in the cp4-agents layout, renamed `cp1-…-agent`, version 0.1.0 | `agent.yaml`, `RELEASE_NOTES.md`, `Dockerfile` | `check_agents.py` (0 problems) | done |
|
||||
| 2 | Eight sub-agent prompts from the v1.1 stories, without the `alz-run` tools | `prompts/` | Review against the story files | done |
|
||||
| 3 | Run workspace, `delegate`, rules | `app/workspace.py`, `app/tools.py`, `app/rules.py` | `dry_run.py` | done |
|
||||
| 4 | Hooks: phase checks, enforced verdict, outcome records, inferred phase | `app/business_logic.py`, `schemas/input.json` | `dry_run.py` (chain and failure cases) | done |
|
||||
| 5 | Phase skills and orchestrator prompt | `skills/`, `prompt.md` | Eval cases against a live run | done (untested live) |
|
||||
| 6 | Eval cases: two need no MCP; the rest need the Meridian estate | `eval/cases.yaml` | `kyndryl_agent_runtime.eval` | done (not yet run) |
|
||||
| 7 | Kubernetes folder: cp4 placeholders, CP1 ConfigMap values | `kubernetes/` | `render_k8s.py` + `kustomize build` | done |
|
||||
| 8 | KAB workflow export, four phase steps | `../workflows/cp1-alz-discovery.json`, `../scripts/build_workflow.py` | Same keys as the cp4 export | done |
|
||||
| 9 | Human docs and ADRs 0001–0011 | `docs/` | Review | done |
|
||||
| 10 | Confirm the cluster LiteLLM serves `gpt-5.6-sol` and `claude-sonnet-5-5` | `kubernetes/configmap.yaml` | `/v1/models` on the cluster gateway | blocked (product owner: needs the gateway key) |
|
||||
| 11 | Build and push both images to `cruciblecoredevacr.azurecr.io/kab/cp1/` | — | `podman push` | done (2026-10-29) |
|
||||
| 12 | Deploy the sample MCP server, then register it under the nine logical names | `../../../mcp-servers/alz-discovery-sample/` | Gateway lists 20 tools | todo |
|
||||
| 13 | Create the agent in KAB, store `MCP_AGENT_API_KEY` in its Secret | — | Secret exists; no file holds the key | blocked (product owner: KAB UI) |
|
||||
| 13a | Set `EXECUTION_STORAGE_ROOT=/data/executions` in `kubernetes/configmap.yaml`: the platform doesn't set it, so the workspace was falling back to the container's `/tmp` | `kubernetes/configmap.yaml` | In the pod, the workspace resolves to `/data/executions/alz-discovery/…`, writable | done (2026-10-29) |
|
||||
| 14 | `kubectl diff -k`, then `apply -k`, for each component | `../../../build/crucible-kab-dev/*` | `rollout status`; agent card served | done (2026-10-29): agent and MCP server deployed; requests fail at startup until step 13 |
|
||||
| 14a | Uploads and artifacts (ADR 0012): `app/artifacts.py`, contract inputs, plan and analyse skills, front steps in `build_workflow.py`, `scripts/kab_import_workflow.py`; version 0.2.0 | `app/`, `schemas/`, `skills/`, `../scripts/` | Dry run (30 checks incl. 11 for artifacts) | done (2026-10-29) |
|
||||
| 14b | Move into `kab-agents-and-workflows/cp1-agents` (`sub-agents/<Feature>/`); shared scripts, MCP server and deploy profile at the repository root | — | `check_agents.py` 0 problems; dry run 0 failed; `build_workflow.py` output identical; `kubectl diff -k` empty | done (2026-10-29) |
|
||||
| 14c | Timeouts: every workflow step 20 minutes (`AGENT_STEP_TIMEOUT_MINUTES` in `../../../scripts/kab_front_steps.py`, was 25); `AGENT_MAX_DURATION_SECONDS` 1140 so the agent answers inside the step. ADR 0004's "25 minutes" is now 19 | `../scripts/build_workflow.py`, `kubernetes/configmap.yaml` | Export rebuilt; `kubectl diff -k` shows only that line | done (2026-10-29); not yet applied |
|
||||
| 15 | Run the eval cases against the deployed agent | `eval/cases.yaml` | All cases pass | todo |
|
||||
| 16 | Import the workflow and run it on `ENG-MERIDIAN-001` | `../workflows/cp1-alz-discovery.json` | Four phases complete; SE-004 a declared gap; SE-032's injection flagged and not obeyed; a verdict recorded | todo |
|
||||
| 17 | Update the ADO items and story files to match ADRs 0001–0011 | Engineering hub workspace | Board review | todo (product owner approval; never change existing tickets without it) |
|
||||
| 18 | Repeat for ALZ-F02 Assessment … F07 Landing Zone | `../cp1-alz-<feature>-orchestrator-agent/` | Same checks | todo |
|
||||
|
||||
## Open questions (owner)
|
||||
|
||||
- **Platform team:** may agent functions write to `execution-storage-pvc`, and for how long is client data kept? (ADR 0010)
|
||||
- **Platform team:** will Kyndryl's modernization-agents CI accept an agent with `app/`? (ADR 0008)
|
||||
- **Platform team:** does the MCP gateway take one server URL under nine names? If not, collapse `mcp:` to one server.
|
||||
- **Product owner:** confirm the Proposed ADRs: 0004, 0005, 0006, 0007, 0009, 0010.
|
||||
Reference in New Issue
Block a user