feat: vendor upstream Skills and add the GCP provider bundle

Increment 2 of .scratch/solution-architect-agent/spec.md.

- Vendor google-cloud-solution-architecture and the six
  google-cloud-waf-* Skills from google/skills@81a31a6, unmodified,
  with LICENSE, SHA256SUMS and VENDOR.md; add
  scripts/sync-vendored-skills.sh to re-sync at a pinned sha.
- app/agent_skills.py: discover Skills and validate SKILL.md
  frontmatter against the Agent Skills specification.
- app/providers.py + providers/gcp.yaml: load and validate a Cloud
  provider bundle (Skills, output template, per-role models, tool
  tiers, remote MCP servers). MCP allowlists stay empty until the
  read-only review in increment 6.
- Settings CLOUD_PROVIDER and MCP_ENABLE_PREVIEW.
- 35 new tests; full suite 65 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 18:20:17 +01:00
parent 69012b2656
commit 2976dfab21
24 changed files with 3308 additions and 0 deletions

View File

@@ -504,3 +504,29 @@ Slowest tests: eval benchmark 7.3 s, then 3–4.5 s each for the orchestrator, e
**Side effects found (fix in increment 9 or earlier if they get in the way)**
- **New Execution folders.** Each suite run creates 6 new untracked `deliverables/executions/<uuid>/` directories. The shared-path copies are byte-identical because the templates don't vary. I removed the 12 from two runs with `git clean -fd deliverables/executions/`.
- **Tracked bytecode.** 30 `__pycache__/*.pyc` files are tracked despite `.gitignore`, so every run dirties the tree (for example `eval/__pycache__/*.pyc`). Candidate fix: `git rm -r --cached '*/__pycache__'`.
### 2026-09-15 · Increment 2: vendored Skills and provider bundle
**Done**
- `scripts/sync-vendored-skills.sh [<sha>]` downloads `google/skills` at a full commit sha. It replaces `skills/vendor/google/` wholesale with the 7 Skills plus the upstream `LICENSE` (there's no `NOTICE` upstream), then writes `SHA256SUMS` and `VENDOR.md`. I ran it at `81a31a6e4300425598a69fd96c8e843c947ae308` and diffed the result against the upstream tarball: identical.
- `app/agent_skills.py`:
- `read_skill` checks one Skill against the Agent Skills specification, and `discover_skills` indexes a set of directories.
- It enforces the name rules (1–64 characters, lowercase, single hyphens, matches the directory) and the description rules (1–1024 characters). It also checks `compatibility` (≤ 500 characters), `metadata` (string → string), and that `license`/`allowed-tools` are strings.
- It rejects unknown fields, rejects duplicate names across directories, and only looks at immediate child directories.
- `app/providers.py`: `load_provider(name, root)` returns a `ProviderBundle` (skills index, output template, `ModelConfig.for_role`, tool tiers, `mcp_auth`, `McpServerSpec`s, `role_mcp_servers`, `mcp_servers_for_role(role, include_preview)`). It validates tiers, https URLs, the `allow` list and role → server references.
- `providers/gcp.yaml` holds the bundle from the spec, with **every MCP `allow` list empty** (so no tools are exposed) until the increment 6 review.
- Settings: `CLOUD_PROVIDER=gcp` and `MCP_ENABLE_PREVIEW=true` in `app/config.py` and `.env.example`.
- Tests:
- `tests/test_agent_skills.py`: 17 tests.
- `tests/test_vendored_skills.py`: 3 tests. A test run with a vendored file edited showed the checksum test failing, as intended.
- `tests/test_providers.py`: 15 tests.
- Full suite: **65 passed** (30 baseline + 35 new), same single warning. `ruff check`, `ruff format` and `mypy` are clean on the new modules.
**Deviations from the spec text**
- **Checksums file.** Checksums live in `skills/vendor/google/SHA256SUMS`, which `VENDOR.md` references, not inside `VENDOR.md` itself. It's easier to diff and works with `sha256sum -c`.
- **Where `McpServerSpec` lives.** It's in `app/providers.py`, because it's bundle configuration. `app/tools/mcp.py` (increment 6) will import it and add the runtime behaviour: `readOnlyHint` checks, auth and the ADK mapping.
- **Test file name.** The spec named a `tests/test_provider_bundle.py`; this increment uses `tests/test_providers.py`. Increment 6 adds its assertions there, including non-empty `allow` lists once they're reviewed.
- **Strict frontmatter.** The validator rejects unknown fields. As a result the 5 legacy `app/skills/*/SKILL.md` fail (the custom `phase:` key), which confirms ADR-0002's consequence. They're out of the bundle's `skills_dirs` and get deleted in increment 9.
**Still to check**
- The default model ids (`gemini/gemini-2.5-pro`, `gemini/gemini-2.5-flash`) come from the spec and haven't been checked against models currently available. Confirm them in increment 5, when LiteLLM is wired.