Files
gcp_solution_architecture_a…/.agents/plans/iter-04-learning-and-skills/steps/step-16.md
Jonathan Boniface e9246828b3 feat: establish the Target architecture as a graph before code
Design is now approved before any infrastructure code is written (ADR-0005).
A new target-architect Specialist produces one graph of Elements,
Relationships and Checks; the diagram is rendered from it, deployment
guidance must account for every Check, and validation gives a verdict per
Check. Requirements, components, products and recommendations carry ids in
data files, and a submission with a gap in the Requirements chain is refused.

Also in this commit:
- Customer cases group Executions, with an intent history per case
- lesson candidates are captured when an Execution ends
- evaluation gains chain, verdict, judged and interactive checks, and
  per-case thresholds
- Terraform providers are cached between checks
- the requirements analyst proposes defaults instead of asking
- the legacy-baseline case and the checks that only read it are removed
- ADR-0006 (Change requests) accepted; ADR-0004 and ADR-0007 proposed
- plans for iterations 4 to 7 under .agents/plans/

Unproven with a real model: no evaluation run has completed on this design.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 13:59:09 +01:00

1.8 KiB

Step 16 — Implementation Detail

  1. TF_PLUGIN_CACHE_DIR defaults to .cache/terraform-plugins under the repository root (already gitignored and kept out of the image build context). Set it empty to disable. Settings.terraform_plugin_cache() resolves it to an absolute path, since checks run in scratch directories.
  2. TerraformRunner creates the directory on first use and passes it to Terraform.
  3. It also sets TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE=true. A scratch directory has no dependency lock file, and without this Terraform downloads a cached provider again to verify it, which defeats the cache.
  4. terraform init calls are serialised by a lock when the cache is in use, because Terraform's plugin cache is not safe for concurrent installs.

Measured on 2026-10-07 with a one-resource configuration on the Google provider (~> 6.0), on this machine:

Seconds per terraform validate
No cache 7.3 to 7.8
Cache, first use (downloads once) 7.3
Cache, later uses 1.6 to 2.0

So each check after the first saves about 5.5 seconds. The stopped run of 2026-10-06 made 7 validate calls in 16 minutes and more through its Revisions; at 12 to 15 calls a case, with the scoring's own check, that is roughly 1 to 1.5 minutes a case. The saving is real but small against a 35 minute run; it grows on a slower network.

Costs: the cache holds each provider version once (117 MB for one Google provider version; the existing folder holds 600 MB across versions). In the container it is created under /app/.cache at run time and is lost with the container; pre-loading it into the image, or mounting a volume, would carry the saving across restarts and is not done.

Tests: tests/tools/test_local.py, "the provider cache", using a stand-in terraform binary.