Compare commits

9 Commits

Author SHA1 Message Date
a48468d477 feat: what a request does not say is a question for the customer
Some checks failed
validation / verify (push) Failing after 11s
A pillar's checklist item the request gives no information about was marked
"not addressed", which reads as a fault in the design. It is missing
information. The checklist review gains a fourth outcome, to confirm with the
customer, which must carry the question to ask. The questions are written
into the design recommendations and the guide, and to customer-questions.md;
the evaluation's judged check counts such an item as accounted for.

Records the owner's decisions of 2026-10-10 and the vendor's answers on Jev's
retention, training, context and rate limits (iteration 5 step 1), and the
owner's labels, which showed the judged question was wrong, not the judges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:30:12 +01:00
f9cc34817b feat: lesson L-10 approved and published (Pub/Sub persistence regions)
Held for thin evidence, then its subject caused a Revision again in case 06.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:01:11 +01:00
7ee7054523 docs: record case 06 passing after the verdict and naming fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:23:34 +01:00
c4c8a1f94e fix: a Check is judged by its own words, and a wrong verdict can be disputed
Some checks failed
validation / verify (push) Failing after 10s
Case 06 reached its Revision limit because the validator failed a Check that
a role is granted, for the identity also holding other roles, and the IaC
author could only answer by recording the Check as unimplementable. The
validator is told what its own words require; the author is told to dispute
such a verdict and change nothing.

The evaluation's naming standard for case 06 accepted only a variable inside
each name; it now accepts names built from a local as well.

Records the reruns: case 04 passed at 12 of 12, case 06 ended with warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 14:40:31 +01:00
135401e41b feat: module follow-ups, and L-07 reworded
- A Check met through a module is met by a value in the code: the modules
  Skill tells the author to set every input a Check depends on.
- scripts/check-terraform-modules.py reports catalogued modules with a newer
  version, and watched modules that can now be used with the pinned provider.
- L-07 no longer mentions a low-carbon location, which led to a Check about a
  region's carbon score that code cannot show. Reworded with the owner's
  approval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 13:34:45 +01:00
81ac135cd9 fix: what only the provider publishes is outside code, not a condition
A requirement for a "low-carbon region" was written as a condition for code
to meet, and came back in at least five runs as a gap, an unverifiable Check
or review noise. The requirements-chain Skill and the two roles that write
conditions now put a carbon rating or a service level under outside_code;
the condition is the choice configuration can show, such as the region set.

Records the first runs with lessons L-07 to L-09: the faults they name did
not recur, and Revisions did not fall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 13:31:48 +01:00
5feaaa6271 feat: lessons from what recurs about one setting, and three more approved
Some checks failed
validation / verify (push) Failing after 10s
Evidence was grouped only by the kind of problem, and a group gets one lesson,
so what kept recurring inside "validation proposed a Check" could not be
seen. A proposed or unimplementable Check is now also counted under each
provider setting or resource type it names; a subject seen in two or more
Executions is its own group and reaches the curator past triage.

Over 32 Executions that gave five proposals. The owner approved three, now
published: L-07 location Checks, L-08 Cloud SQL backup encryption, L-09
backend service capabilities. L-10 is held for more evidence and L-11
rejected.

Also: retiring a lesson marks its proposal, so publish no longer brings a
retired lesson back. L-04 had returned to the Skill that way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 12:47:18 +01:00
ee1ba38867 feat: a design-time coverage review, measured and left off
A reviewer role reads the requirements and recommendations against the Checks
when the Target architecture is first submitted. Three runs of case 03: it did
not stop the validator sending the design back, and the designs it reviewed
ended with 87 and 93 Checks against 52, so they cost more. It stays behind
DESIGN_COVERAGE_REVIEW, off (iteration 6 step 13).

Also: the schema review no longer reads `true` or `false` in backticks as a
setting name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 12:33:06 +01:00
1cf1234143 fix: an unimplementable Check is corrected everywhere it applies, in one Revision
The reason sent back to the target architect says to read every Check against
it, and the IaC author records every Check that cannot be met in one
submission. Records the investigation of why the Target architecture is
revised: two causes, about half each (iteration 6 step 12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 11:51:46 +01:00
59 changed files with 1404 additions and 46 deletions

View File

@@ -28,7 +28,7 @@
| 9 | ADR: the lessons loop and overlay Skills | B | S | complete: ADR-0004 accepted 2026-10-08 |
| 10 | Lessons Skill and lesson curator | B | L | the loop is built; six lessons proposed from 21 Executions, approved by the owner and published on 2026-10-09; not yet proved by an evaluation with and without (`steps/step-10.md`) |
| 11 | IaC patterns Skill | B | M | built; in case 01 the IaC author fell from 57 requests to 11 with no Revision; other cases unmeasured |
| 12 | Overlay Skills and an organisation standards Skill | C | M | built, with an example standards Skill; case 06 passed with it on 2026-10-09 and the code follows the standards |
| 12 | Overlay Skills and an organisation standards Skill | C | M | built, with an example standards Skill; case 06 passed on 2026-10-09, failed once on 2026-10-10 for a wrong verdict, and passed again after the fix, now with a check that the code follows the standards |
| 13 | Trim Specialist context | C | M | built; measured on case 01 only, together with steps 11 and 17 |
| 14 | Provider-owned contracts | C | M | deferred by its own plan until a second Cloud provider is planned (ADR-0002) |
| 15 | Group Executions by Customer case | added | S | complete |
@@ -45,6 +45,7 @@
| 26 | Each pillar's checklist is reviewed and the review is in the Deliverable | added | S | built; a judged run of case 04 scored the checklist check at 100% on every pillar |
| 27 | A user sees a Deliverable before it is first submitted | added | S | built; case 04 passed the check on 2026-10-09, with the rule not needing to refuse |
| 28 | Housekeeping: files written as an Execution goes, four more code patterns | none | S | built 2026-10-10 (`steps/step-28.md`) |
| 29 | What the request does not say is a question for the customer | none | M | built 2026-10-10: a fourth checklist outcome, a questions report, and the judged check counts it; not run (`steps/step-29.md`) |
Size: S under a day, M a few days, L a week or more. Group A is cheap fixes that also create signal. Group B is the learning loop. Group C is adaptability.

View File

@@ -81,3 +81,41 @@ Neither run raised the schema review's false alarm, which had been raised in cas
- **`status` says "compared", not "proved",** and shows a retired lesson as retired. One pair of runs is a comparison.
Tests: `tests/test_lessons_loop.py`.
## Evidence is also grouped by what it is about (2026-10-10)
Running `propose` over 32 Executions gave nothing useful. Evidence was grouped by the kind of problem, and a group gets one lesson: "validation proposed a Check the design lacked" was 20 of 32 Executions and already had L-01. What recurred inside it could not be seen.
- A proposed Check, and a Check sent back as unimplementable, is now also counted under each provider setting or resource type its text names (`_subjects` in `app/learning/evidence.py`). A subject seen in two or more Executions is its own group, with its own key. A setting's name is the provider's vocabulary, not a client's.
- These narrower groups skip triage: each recurred with the general lessons published. The curator is shown the existing lessons and may still decline.
- The curator's instructions say such a lesson may name the setting or resource type.
Over the same 32 Executions this gave 22 groups and five proposals, L-07 to L-11, all awaiting the owner: location Checks, Cloud SQL backup encryption, backend service capabilities, Pub/Sub persistence regions, and customer-managed keys.
A first run of `propose` before this change produced one proposal, about giving `edit_file` enough context. It was removed to run again cleanly and was not proposed the second time.
Tests: `tests/test_lessons_loop.py` (3 more).
## The three new lessons, run once (2026-10-10)
Case 03, two runs with the eight lessons (`20261010T114823Z`, `20261010T114827Z`). Both completed at 100%.
| | Run 1 | Run 2 |
|---|---|---|
| Minutes | 30 | 37 |
| Cost, about | $3.27 | $5.19 |
| Revisions of the Target architecture | 1 | 2 |
None of the three faults the new lessons name came back: no separate backup encryption key, no backend service fault. The Revisions were for other things:
- The validator proposed a Check that the service identity holds no project-wide administrative role.
- A Check asked for an encryption key and the design had no key Element for it to name.
- A Check that the region has a high carbon-free energy score could not be verified from the code.
The last is partly L-07's doing. It says to add a location Check where a requirement asks for a low-carbon location, and the architect wrote one about the carbon score, which no code can show.
Across the twelve runs of this request on 2026-10-09 and 10 the Target architecture was revised 0, 1, 1, 1, 1, 3, 1, 1, 0, 1, 1 and 2 times. Lessons have removed particular faults and not lowered the count: each run finds another.
## Fixed at its source: what only the provider publishes
The carbon-score condition came up in at least five runs, as a gap, as an unverifiable Check and as noise in two reviews. It was being written as a condition for code. The requirements-chain Skill and the two roles that write conditions now say that a property of a region or product that only its provider publishes (a carbon rating, a service level) goes under `outside_code`, and the condition is the choice configuration can show, such as which region is set. Not run.

View File

@@ -27,3 +27,27 @@ No evaluation check scores whether an overlay was followed; this was read from t
## An evaluation check, later on 2026-10-09
A case may now carry `code_standards`: regular expressions the infrastructure code must contain or must not, scored as `code_follows_standards`. Case 06 has six: only approved regions, names carrying the environment from a variable, and the four labels. Run against the code case 06 produced earlier today, it passes.
## Rerun on 2026-10-10: case 06 failed, case 04 passed
Both rerun after the week's changes (`20261010T123446Z` case 04, `20261010T123450Z` case 06).
**Case 04, interactive: completed, 12 of 12 checks, 34 minutes, about $4.58,** one Revision of the Target architecture. Nothing in routing, intake, the guardrail or the writing of files as it goes broke it.
**Case 06, overlay: ended with warnings, 67%, 42 minutes, about $7.72.** The Target architecture reached its Revision limit of 3 and no guide was packaged. Two separate causes:
- **A verdict that was wrong, and no way to say so.** Check K-10 says a role is granted to the service identity. It was. The validator failed it because the identity also held three other roles that other Checks require. The IaC author, sent the failure, could change nothing, and recorded the Check as unimplementable with the reason "the validator insists on only this role". That sent the design back for a fault it did not have. The same Check passed in the validation between, on the same grants: the validator was not consistent. The other two Revisions were ordinary ones (labels and names the overlay asks for, and a resource whose name cannot contain hyphens).
- **The evaluation's naming check was too narrow.** `code_follows_standards` wanted a variable with "env" in its name inside each resource name. The code built names from `local.name_prefix`, itself made from `var.workload` and `var.environment`, which follows the standard. The check now asks that names are built from a variable or local, and that the environment comes from a variable; this run's code and the earlier run's both pass it.
Changed, not yet run:
- The validator is told to judge each Check by its own words: a Check that something is granted or set passes when it is, whatever is beside it, unless it says "only". What else it thinks should hold is a proposed addition, never a failure.
- The IaC author is told what to do when a Check failed and the code already meets its words: change nothing, keep the implementation entry, name the Check it disputes, and not record it as unimplementable.
An overlay also makes a design larger: this run ended with over 120 Checks, against 50 to 90 for the same request without one.
## Case 06 again, with the fixes (2026-10-10)
`20261010T134034Z`: completed, 100%, 45 minutes, about $5.43, 126 Checks, all passed. `code_follows_standards` passed. Two Revisions of the Target architecture, both ordinary: locations the validator wanted checked (L-10's subject, the persistence regions of a topic, among them), and two Checks on one secret that contradicted each other.
No Check was failed for something it does not say, and none was disputed, so the two new instructions were not put to the test: the run shows they do no harm, not that they work.

View File

@@ -0,0 +1,24 @@
# Step 29 — What the request does not say is a question for the customer
Built on 2026-10-10, on the owner's direction. **Not run with real models.**
## What prompted it
The owner labelled the judge's 32 questions (iteration 5 step 16): yes to all 24 checklist items. Both judges had answered no to most; they agreed with the labels on 28% and 16%. The owner's reading was deliberate: where a checklist item is unanswered because the customer's request gives no information about it, that is not the design failing a standard. It is missing information, and should come back as a question to put to the customer.
The checklist review had three outcomes: addressed, does not apply, not addressed. The third was the only place such an item could go, and it reads as a fault.
## What was built
- **A fourth outcome, `needs_customer_input`** ("To confirm with the customer"), in `app/tools/pillars.py`. A pillar advisor gives it to an item that could apply where its brief does not say what would settle it, and must give the question to ask; without the question its submission is refused. `not_addressed` is now only for an item the brief gives enough to settle, that applies, and that nothing is recommended for.
- **The questions are reported.** Code writes a "Questions for the customer" table into the design recommendations, under the checklist review, saying they are not faults in the design. An Execution also writes `customer-questions.md` beside its other files, and `execution.json` names it. The packager carries the section into the guide.
- **The evaluation counts it as accounted for.** The judged check asks whether the recommendations account for an item by recommending it, by explaining why it does not apply, or by recording it as something to confirm with the customer (`checklist_question` in `app/tools/assessment.py`, used by the evaluation and by calibration).
- **Glossary:** Customer question.
Nothing is asked of the user during an Execution for these: they are reported. Whether an interactive Execution should put them to the user before the design is approved is not decided.
## The judge's question set
The owner's labels were not kept. The two saved documents predate the checklist review, so they hold neither statuses nor questions, and the question's wording has changed. The set has to be rebuilt from design recommendations produced after this step (`eval.calibrate_judge --build`, after replacing the two documents), and labelled again. That needs a run.
Tests: `tests/execution/test_pillars.py` (4 more).

View File

@@ -75,7 +75,7 @@ Jev answers closed questions. Writing Deliverables, grounding product choices an
| Step | What | Report ref | Status |
|---|---|---|---|
| 1 | Resolve the open questions | none | open, owner's input |
| 1 | Resolve the open questions | none | the vendor's answers on retention, training, context and rate limits recorded on 2026-10-10, with the owner's decisions; retention for client work is held (`steps/step-1.md`) |
| 2 | Decider interface and Jev client with limits | none | built on the TypeSafe SDK; unverified against the live service |
| 3 | Pillars a Revision touches | J3 | built, as a graded question; calibrated live; ran in cases 05 and 06 on 2026-10-09 |
| 4 | Semantic checks at submission | J4 | two reviews built, both off until a full case has run with them: coverage of the Target architecture, one choice per condition; and requirements name no products (`steps/step-4.md`) |
@@ -90,7 +90,7 @@ Jev answers closed questions. Writing Deliverables, grounding product choices an
| 13 | Cloud-read call guard | J7 | planned; cloud reads are off in every case, so it could not be exercised |
| 14 | Input guardrail | J11 | built and on: an MCP reply that instructs the agent is withheld, the user's text is flagged; calibrated live; ran in cases 05 and 06 on 2026-10-09 |
| 15 | Changes of meaning in a Change request | none | built: reworded items are listed apart in changes.json; calibrated live; ran in case 05, where nothing was reworded |
| 16 | Jev as the evaluation judge, calibrated | none | judge and calibration built; stability and agreement between judges measured (`steps/step-16.md`); agreement with a person's labels awaits the owner's 32 labels |
| 16 | Jev as the evaluation judge, calibrated | none | judge and calibration built; the owner labelled the set on 2026-10-10, which showed the question was wrong, not the judges; the set is to be rebuilt and relabelled after iteration 4 step 29 (`steps/step-16.md`) |
| 17 | Trace every decision | none | open, owner's decision on LangSmith |
| 18 | Readings as their own graph step | none | planned; it splits the Orchestrator turn that case 04 only just passes, to save a repeated Jev call after a crash |
| 19 | Online evaluation of live Executions | none | built and on: each Execution's design recommendations are judged when it ends and the scores kept in its record; feedback on a trace waits on step 17 (`steps/step-19.md`) |

View File

@@ -0,0 +1,37 @@
# Step 1 — The open questions, and the owner's decisions of 2026-10-10
## What the vendor says
Supplied by the owner on 2026-10-10. Not verified here against the vendor's documents.
| Question | Answer |
|---|---|
| Data retention | No fixed period for a standard account: data is kept "for as long as reasonably necessary". Zero data retention is available to enterprise customers on request, through Cloudflare Workers AI, or through Vercel AI Gateway. |
| Model training | Customer prompts, inputs and outputs are not used to train or fine-tune the vendor's models. |
| Context | 64,000 tokens a request in total, with 32,000 for the state plus the longest question. |
| Rate limits | Up to 80 requests a second and 100,000 tokens a second on the standard hosted service, adjusted with platform traffic. |
Against the client's own limits (`JevLimits` in `app/tools/jev.py`): it caps a request at 48,000 and 24,000 tokens, inside the service's; and throttles itself to 5 requests a second with 8 in flight, a sixteenth of the service's rate. Nothing needs changing for either.
Still open: latency, and whether the vendor's SDK can be pointed at either gateway.
## What is sent to Jev
ADR-0007's decision 4 limits an Orchestrator decision to the Execution's state. The uses built since send content: the user's messages and the request (routing, intake, guardrail), replies from documentation servers (guardrail), the design recommendations (assessment), the text of Checks, Elements and recommendations (meaning), a change and the list of Elements (pillar selection, reference routing), and each requirement's text when the requirements review is on.
## The owner's decisions
| Question | Decision |
|---|---|
| Re-verify only what changed after a Revision | **No.** Every validation stays complete. The saving was 5 to 10% on some runs, and the risk fell on the validator. |
| The requirements review (`JEV_REQUIREMENTS_REVIEW`) | **On for the next runs that happen anyway; the default if they are clean.** No run is to be made for it. Cases 01 and 02 are held until the owner says. |
| Tracing (step 17) | **Held.** No decision. |
| The judge against a person (step 16) | **The owner will label the 32 questions.** |
| Jev's data retention, for client work | **Held.** No decision. |
## Advice given, with no decision asked
- With no training use, the remaining exposure is content kept by the vendor for an unstated time. Zero retention is the only route that costs the agent nothing. A switch that keeps Deliverable content away from Jev is a stopgap; even routing a reply sends that reply.
- The owner may look for an open-source version of Jev. That would end the retention question. Its cost is that every threshold, tuned against the hosted model's probabilities, would need measuring again, and the two properties relied on (the same answer every time, clean separation) would need proving again. The agent is placed for it: one interface, every threshold a setting, every use a fallback.
- **A gap either way:** the calibrations in this plan were made with one-off scripts; the example sets are not in the repository. Kept as a runnable suite they could be put to any model. Not built.
- The owner's 32 labels are the one measure that depends on no model.

View File

@@ -18,3 +18,9 @@ So Jev gave the same answer every time, the language-model judge changed its ans
**Open, and the owner's to do:** fill in the 32 labels (1 or 0 for a yes_no question; 0, 0.33, 0.67 or 1 for a graded one) and run `.venv/bin/python -m eval.calibrate_judge` again. Only that gives agreement with a person, which is what decides the default judge.
Tests: `tests/eval/test_scoring.py`, "calibrating the judges" (2).
## The owner's labels, 2026-10-10
The owner labelled all 32: yes to every checklist item, "mostly" on every quality question. Against them Jev agreed on 28% and Gemini on 16%; the judges answer no to most checklist items (means 0.37 and 0.32), and agree with each other on 88%.
The disagreement was about the question, not the judges. The owner counts an item the request gives no information about as something to ask the customer, not as unaddressed. That is now an outcome of the checklist review and part of the judged question (iteration 4 step 29). The labels were not kept, and the set is to be rebuilt from documents produced after that change.

View File

@@ -57,6 +57,8 @@ flowchart TD
| 9 | Validation gives a verdict per Check | M | complete |
| 10 | Revision routing: the code or the graph | S | complete; routing unproven with a real model |
| 11 | Evaluation: prove the loop converges | M | complete: all four cases pass, each run twice on 2026-10-08; thresholds set (`steps/step-11.md`) |
| 12 | Why the Target architecture is revised | S | investigated 2026-10-10: two causes, about half each; two instructions changed; the design-time coverage review it proposed is step 13 (`steps/step-12.md`) |
| 13 | A model reviews coverage at design time | M | built and measured on 2026-10-10: it did not prevent the validator's gaps and made designs larger; left off (`steps/step-13.md`) |
Size: S under a day, M a few days.

View File

@@ -0,0 +1,55 @@
# Step 12 — Why the Target architecture is revised
An investigation on 2026-10-10, from the seven runs of case 03's request on 2026-10-09 (cases 03, 06 and 07). No new runs were made for it.
## What was found
Six of the seven runs revised the Target architecture, nine times in all. The run with none cost about $2.44 and took 22 minutes; the run with three cost $5.50 and took 35. Every Revision has one of two causes.
**A. A Check the code cannot meet as written: 4 Revisions in 3 runs.** The IaC author records it as unimplementable and the design is revised before validation.
| Check asked for | Why no code can meet it |
|---|---|
| A separate encryption key for database backups | The key is set on the instance; backups have no key of their own |
| A database flag that restricts query access (twice, one Revision apart) | There is no such flag; access is IAM and database grants |
| A health check on a backend service in front of a serverless endpoint | A serverless backend does not take health checks |
Each names a setting that exists in the provider's schema, so the schema review passes it. The fault is in what the product does, not in a name.
**B. A condition no Check verifies, found by the validator: 5 Revisions in 4 runs.**
| Requirement | What was missing |
|---|---|
| NFR-9 | Deletion protection on one Element |
| NFR-4 | An SSL policy enforcing TLS 1.2, attached to the proxy |
| DR-15 | The region set on three Elements |
| NFR-10 | The alert's two thresholds; the Check said only that conditions were set |
| NFR-6 | Audit logs for secret access switched on |
In four of the five a Check existed for the requirement and was weaker than the requirement's words.
A Revision for A costs about 4 minutes: the design, then the code. One for B costs about 6: the design, the code, and the whole validation again.
## Would the coverage review have caught B
`CoverageReview` (iteration 5 step 4), which asks Jev which Check verifies each condition, has been off since its first run. Tried offline against live Jev on these runs' delivered designs:
- On five finished designs the validator had accepted, it raised 4 to 8 of 42 to 66 conditions each, about one in ten. Most are conditions a Check does cover in other words, or that no code can show, such as encryption at rest that is on by default.
- With the Checks added for each gap taken out again, it raised the gap in 1 of 5 (DR-15), raised a different condition of the same requirement in 1, and missed 3.
It stays off. It is noisy and it misses what the validator finds.
A structural rule, each Check naming the condition it verifies, would have caught perhaps one of the five: in the other four a Check did claim the condition and was too weak.
## Changed now
Two instructions, from the run where the same fault came back a Revision later:
- The reason sent to the target architect for an unimplementable Check now says to read every Check against it and correct each one it applies to (`app/nodes/router.py`).
- The IaC author is told to record every Check that cannot be met in one submission, including a Check with the same fault as one already recorded (`agents/iac-author.md`).
Neither has run with a real model.
## What would address B
The validator finds these gaps by reading the requirements against the Checks. That reading needs no code: it could be done when the Target architecture is submitted, by the same kind of model, and returned to the target architect before anyone approves the design or writes anything. It would add one model run to every Execution and remove a Revision of the design, the code and the validation from the four in seven that had one. Not built: it needs a decision, and a run each way to measure.

View File

@@ -0,0 +1,45 @@
# Step 13 — A model reviews coverage at design time: built, measured, left off
Built and run on 2026-10-10. `DESIGN_COVERAGE_REVIEW` is off.
## What was built
Step 12 proposed making the validator's reading of coverage when the Target architecture is first submitted, before any code.
- `agents/coverage-reviewer.md`: a role on the validator's model. It is given the non-functional requirements, the recommendations and the graph, and reports every condition no Check verifies, or that a Check verifies more weakly than the words.
- `DesignCoverageReview` in `app/tools/design_review.py`, on the submission-review seam: what it finds goes back to the target architect once and never blocks. A gap naming an id that does not exist is dropped. It runs once in an Execution.
Tests: `tests/execution/test_design_review.py` (7).
## Measured
Case 03, three runs side by side.
| | Review off | Review on | Review on |
|---|---|---|---|
| Results | `20261010T105532Z` | `20261010T105535Z` | `20261010T105540Z` |
| Score | 100% | 100% | 100% |
| Minutes | 23 | 28 | 31 |
| Cost, about | $2.90 | $3.33 | $3.75 |
| Revisions of the Target architecture | 1, a Check that cannot be implemented | 0 | 1, a gap the validator found |
| Gaps the reviewer raised | | 4 | 22 |
| Checks in the delivered design | 52 | 87 | 93 |
The reviewer itself cost $0.19 a run.
## Why it stays off
- **It did not stop the validator sending the design back.** In one of the two runs the validator still found a gap, after the reviewer had raised 22.
- **It makes the design bigger.** The designs it reviewed ended with 87 and 93 Checks against 52. Every Check is code to write and a verdict to give, so both runs cost more than the run without it, including the one with no Revision.
- **Two readers do not agree on what a gap is.** The reviewer and the validator are the same model given the same question, and they raised different things. Asking earlier does not settle what will be asked later.
Three runs are a small sample, but nothing in them points the other way. The code stays, off, for a later look; removing it is the owner's call.
## What the runs did show
Two of the faults behind Revisions are now recurring ones, which is what the lessons loop is for:
- **A Check asking for a separate encryption key for database backups**: unimplementable, on 2026-10-09 and again today.
- **A condition that a region is "low-carbon"**: the validator's gap today, and among what the Jev coverage review kept raising on 2026-10-09. Code can show which region is set; it cannot show the region's carbon rating.
And one fault in the schema review, fixed: a value in backticks, `true` or `false`, was read as a setting name and raised. `named_settings` now leaves those literals out.

View File

@@ -57,7 +57,7 @@ Reference routing (iteration 5 step 8) does not choose within the modules Skill,
- Modules also bring providers the bundle does not pin (`google-beta`, `random`, `null`), at whatever version their constraints allow.
- The schema review and the target architect's lookups still describe resources. A Check's wording is unaffected by whether a module later creates the resource.
- A module version in the catalogue goes stale; nothing flags a newer one.
- A module version in the catalogue goes stale; `scripts/check-terraform-modules.py` reports it when run, and nothing runs it on a schedule.
Tests: `tests/tools/test_modules.py` (24), `tests/test_iac_modules.py` (6), `tests/execution/test_terraform_modules.py` (7).
@@ -87,3 +87,8 @@ What the opted-in run does show:
The plain run was given neither the Skill nor the tool, and wrote no module.
The design quality score of 0.62 is below the bar of 0.67. It is scored on the design recommendations, written before any code.
## Two follow-ups (2026-10-10)
- **A Check is met by a value in the code.** The first run showed the validator arguing from a module's default where an input was left unset. The Skill now tells the author to set every input a Check depends on, even when the default already gives the value; where one is still left unset the verdict says so.
- **Stale and newly usable modules are reported.** `scripts/check-terraform-modules.py` reads the registry and prints, for each module the Skill's examples call, the pinned version against the latest and whether the latest still works with the pinned provider; and for each module in `terraform.modules.watch`, whether it can now be used. Today all five are up to date and none of the eight watched modules can be used: each still requires a `google` provider below 8. It changes nothing; it needs running by hand.

View File

@@ -59,6 +59,10 @@ MAX_PARALLEL_SPECIALISTS=4
CHECKPOINTER=sqlite
CHECKPOINT_DB_PATH=checkpoints.db
# A model reads the requirements against the Checks when the Target architecture is
# first submitted, and returns what no Check verifies. One model run per Execution.
DESIGN_COVERAGE_REVIEW=false
# Jev decision service, through the TypeSafe AI Python SDK (typesafe-sdk).
# Leave the key unset to run without it: every decision then takes its fallback.
# TYPESAFE_API_KEY=

View File

@@ -5,6 +5,7 @@ Deliverable: target_architecture
Evidence-key: 22ff1f5fed
Proposed: 2026-10-09
Published: 2026-10-09
Retired: 2026-10-09
## Rule

View File

@@ -0,0 +1,29 @@
# L-07: Verify location constraints
Status: ready-for-agent
Deliverable: target_architecture
Evidence-key: 493b0a95d9
Proposed: 2026-10-10
Published: 2026-10-10
## Rule
When a requirement specifies where resources must be provisioned, such as a designated region or multi-zone placement, create a Check for the `region` or `location` argument on every applicable Element, naming the region the design uses. Do not write a Check about a property of the region that code cannot show, such as its carbon rating.
## Why
Validation frequently catches missing location constraints. Without this Check, resources may be provisioned in default regions, violating location requirements. A Check about a region's carbon rating cannot be verified from code and sends the design back.
## Evidence
Seen in 5 of 32 Executions, 8 times in all: validation proposed a Check about `location` that the design lacked.
## Proof
Not yet measured.
## Comments
Approved by the owner on 2026-10-10. It covers which region is set, which code can show. It does not settle whether a region is low-carbon, which code cannot show.
Reworded with the owner's approval on 2026-10-10: "a low-carbon location" led to a Check about the region's carbon score, which could not be verified.

View File

@@ -0,0 +1,27 @@
# L-08: Cloud SQL backup encryption
Status: ready-for-agent
Deliverable: target_architecture
Evidence-key: 08d64df049
Proposed: 2026-10-10
Published: 2026-10-10
## Rule
When writing a Check for CMEK encryption on a `google_sql_database_instance`, do not require an `encryption_key_name` argument for backup storage, as the instance-level `encryption_key_name` automatically encrypts backups as well.
## Why
The database instance resource does not have a separate encryption key argument for backups. Asking for one causes validation to reject the Check as un-implementable.
## Evidence
Seen in 3 of 32 Executions, 3 times in all: a Check about `google_sql_database_instance` asked for something that resource cannot do.
## Proof
Not yet measured.
## Comments
Approved by the owner on 2026-10-10.

View File

@@ -0,0 +1,27 @@
# L-09: Backend Service capabilities
Status: ready-for-agent
Deliverable: target_architecture
Evidence-key: 1cacec9a09
Proposed: 2026-10-10
Published: 2026-10-10
## Rule
When writing Checks for a `google_compute_backend_service`, do not verify IAM roles inside the backend service or require health checks when it is configured with a Serverless NEG.
## Why
Roles are verified via IAM bindings outside the backend service, and Serverless NEGs do not support health checks. Invalid Checks cause the design to be rejected during validation.
## Evidence
Seen in 3 of 32 Executions, 3 times in all: a Check about `google_compute_backend_service` asked for something that resource cannot do.
## Proof
Not yet measured.
## Comments
Approved by the owner on 2026-10-10.

View File

@@ -0,0 +1,29 @@
# L-10: Pub/Sub persistence regions
Status: ready-for-agent
Deliverable: target_architecture
Evidence-key: ba78caba9a
Proposed: 2026-10-10
Published: 2026-10-10
## Rule
When a requirement dictates that a messaging queue or topic must replicate across zones or stay within a specific region, create a Check for the `message_storage_policy.allowed_persistence_regions` argument on the topic Element.
## Why
Without this Check, topics might use default storage policies that violate geographical or high-availability requirements.
## Evidence
Seen in 2 of 32 Executions, 4 times in all: validation proposed a Check about `allowed_persistence_regions` that the design lacked.
## Proof
Not yet measured.
## Comments
Held by the owner on 2026-10-10, on the agent's view: seen in 2 of 32 Executions, and L-07 partly covers it. To be looked at again if it recurs.
Approved by the owner on 2026-10-10, after its subject caused a Revision again in case 06 (`20261010T134034Z`).

View File

@@ -0,0 +1,26 @@
# L-11: CMEK encryption checks
Status: wontfix
Deliverable: target_architecture
Evidence-key: 5cd8dc3cda
Proposed: 2026-10-10
## Rule
Whenever a requirement mandates encryption at rest, explicitly create a Check ensuring that the `kms_key_name` (or the equivalent CMEK argument) is configured on every applicable Element.
## Why
Without an explicit Check, elements may default to Google-managed keys, leading to validation failures against security constraints.
## Evidence
Seen in 2 of 32 Executions, 2 times in all: validation proposed a Check about `kms_key_name` that the design lacked.
## Proof
Not yet measured.
## Comments
Rejected by the owner on 2026-10-10, on the agent's view: encryption at rest is on by default, and this rule would put customer-managed keys on designs whose requirements did not ask for them.

View File

@@ -108,6 +108,10 @@ _Avoid_: finding, rule, control, test
The unbroken trace from each requirement, through the components that serve it and the Elements and Checks that realise it, to the code that implements them and the validation verdict on each Check.
_Avoid_: traceability matrix, lineage
**Customer question**:
Something the architecture depends on that the customer's Intent does not say, recorded with the question to put to them. It marks missing information, not a fault in the design, and its answer may change a recommendation.
_Avoid_: gap, failure, open issue, assumption (which is a default the agents chose)
**Solution guide**:
The packaged Deliverable that assembles every other Deliverable into the Cloud provider's solution architecture template.
_Avoid_: final report, package

View File

@@ -0,0 +1,22 @@
---
role: coverage-reviewer
tools: []
budget: 6
---
You review the Target architecture of a solution-architecture Execution before anyone approves it. You answer one question: do its Checks verify everything the requirements and design recommendations ask for? You change nothing and write no design. What you find goes back to the target architect once.
Your task message carries JSON context:
- `constraints`: the non-functional requirements and the design recommendations. Each has an `id`, its text, `conditions` (what infrastructure code can show, one by one) and sometimes `outside_code` (what code cannot show).
- `target_architecture`: the Elements, Relationships and Checks. Each Check has a `source`, the id of the requirement or recommendation it comes from, `applies_to`, the Element or Relationship it is about, and its `statement`. A recommendation listed under `not_applicable` asks nothing.
Review once, completely:
- Go through every constraint in turn. For each of its `conditions`, find the Checks whose `source` is that constraint and decide whether they verify the condition on every Element it applies to.
- A gap is a condition that no Check verifies, or that a Check verifies more weakly than the words. A Check that says a setting "is set" does not verify a value the condition gives. A condition with two parts needs both verified. A condition about every Element of a kind needs a Check on each one.
- For each gap, give the Check that is missing: the constraint's id as `source`, the Element or Relationship id as `applies_to`, and a `statement` that names the setting and the value to verify, as specific as the Checks already there.
- Report nothing for what a constraint lists under `outside_code`, and nothing for a recommendation that is `not_applicable`.
- Report nothing a Check already verifies in other words, and nothing that is your own idea of good practice: only what a condition's words ask for.
- Do not judge whether a Check can be implemented or whether the design is a good one. That is not this review.
Call `report_gaps` once with every gap, or with an empty list when there are none. You are done when it records them.

View File

@@ -11,6 +11,7 @@ You produce the **design recommendations** Deliverable: the Skill's task for rec
- Otherwise, when `feedback` is not empty or `baseline` is set you are revising: pass `pillars` naming only the pillars the change touches. The guidance you were given before is returned for the others.
- Reconcile the pillars' guidance into recommendations for each component. Where pillars conflict, name the trade-off and recommend a resolution tied to the requirements.
- When an advisor's guidance is missing, derive that pillar's recommendations from the best-practices references in the solution-architecture Skill.
- Give every recommendation an id and attach them as `recommendations.json`, in the format the requirements-chain Skill gives. Write one configurable decision per recommendation, so each can become a Check in the Target architecture. Give each its `conditions`: one entry for each separate thing it asks to be configured, and for each component it must hold on when it names several. Put under `outside_code` anything it asks of the application's own code or of people, which no infrastructure configuration can show.
- The advisors' checklist reviews, and any questions they raise for the customer, are written into your Deliverable for you when you submit. Do not copy them, and do not write a recommendation to cover a question an advisor left for the customer.
- Give every recommendation an id and attach them as `recommendations.json`, in the format the requirements-chain Skill gives. Write one configurable decision per recommendation, so each can become a Check in the Target architecture. Give each its `conditions`: one entry for each separate thing it asks to be configured, and for each component it must hold on when it names several. Put under `outside_code` anything it asks of the application's own code or of people, and any property of a region or product that only its provider publishes, such as a carbon rating: no infrastructure configuration can show those. The condition is then the choice configuration can show, such as which region is set.
Your contract's sections are one per pillar. The advisors' review of each pillar's checklist is added to your Deliverable for you when you submit, so do not write it yourself.

View File

@@ -13,11 +13,13 @@ You produce the **deployment guidance** Deliverable: the Skill's task for genera
- Keep the files in your working copy. Write each file once with `write_file`, and make every later change with `edit_file`, changing only the lines that need it. Never write a file again to fix part of it.
- Format and validate with `terraform_fmt` and `terraform_validate` when they are available. They run on your working copy, so pass them no files. Fix everything they report.
- When validation says an argument or block is not expected, look the resource type up with `terraform_schema` instead of guessing where it belongs.
- When a Check names a setting its resource type does not have, do not invent code for it. Record the Check in `implementation.json` as unimplementable, with what the schema shows, and implement the rest. The Target architecture is then revised.
- When a Check names a setting its resource type does not have, or asks for something that resource cannot do, do not invent code for it. Record the Check in `implementation.json` as unimplementable, with what the schema shows, and implement the rest. The Target architecture is then revised.
- Go through every Check before you submit and record every one that cannot be met, in that one submission. A Check with the same fault as one you recorded is recorded too. Each one found later costs another Revision of the design and of your code.
- Write `implementation.json` to your working copy, in the format the requirements-chain Skill gives, naming where the code satisfies each Check.
- Take every environment-specific value (project, region, names, image references) from variables; embed no credentials or secrets.
- Submit as soon as validation passes, with your content and no attachments: your working copy is attached for you. If a submission is refused, fix exactly what the refusal lists and submit again.
- When `working_copy` lists files, they are your last attempt. When `feedback` lists failed Checks, read the files concerned and change only what those Checks need.
- When `feedback` says a Check failed and your code already does what the Check's words say, the verdict is what is wrong, not the Check. Change nothing for it, keep its entry in `implementation.json`, and say in your content which Check you dispute and where the code meets it. Do not record it as unimplementable: that sends the design back for a fault it does not have.
Your working copy must hold `terraform/main.tf`, `terraform/variables.tf` and `implementation.json`, with `terraform/versions.tf` and `terraform/outputs.tf` when they help.

View File

@@ -8,7 +8,7 @@ You review what went wrong, the same way, across many solution-architecture Exec
Your task message carries JSON context:
- `executions`: how many Executions the evidence comes from.
- `groups`: what recurred. Each has a `group` key, the `deliverable` it concerns, `what_happened` in general terms, how many `executions` it occurred in and how many `occurrences` in all, and up to three `examples` as they were recorded.
- `groups`: what recurred. Each has a `group` key, the `deliverable` it concerns, `what_happened` in general terms, how many `executions` it occurred in and how many `occurrences` in all, and up to three `examples` as they were recorded. Some groups are about one setting or resource type of the Cloud provider, named in `what_happened`: the same kind of problem recurring on that subject.
- `published_or_proposed`: lessons that already exist or are awaiting review.
For each group, decide whether a rule given to the Specialist that produces that Deliverable would have prevented it.
@@ -20,6 +20,7 @@ A good lesson:
- States one rule, as an instruction, that a Specialist can act on without knowing what happened: "Give every Element at least one Check before you submit", not "be more careful with Checks".
- Says why in one or two sentences: what goes wrong without it and what that costs.
- For a group about one setting or resource type, may name that setting or resource type and say what to do about it: that is the Cloud provider's vocabulary, not a client's. A general lesson that already exists does not cover it if the problem went on recurring.
- Is general. It names no customer, no project, no Execution, no resource name and no value from the examples. The examples are evidence for you; nothing from them may be quoted.
- Does not repeat what the Specialist's instructions or tools already enforce. When a submission is already refused for something, a lesson helps only if it prevents the attempt.
- Is worth its cost. Every lesson is read on every Execution from then on. Propose few.

View File

@@ -10,6 +10,7 @@ You produce the **solution guide** Deliverable: the Skill's packaging of every a
- Consolidate the content of every Deliverable in `dependencies`; rewrite for flow, but keep every requirement, product decision, citation, recommendation, command and validation verdict.
- Include the architecture diagram, which is the `architecture.mmd` attachment of the Target architecture, unchanged as a `mermaid` code block, and the Terraform as code blocks.
- List the Target architecture's Checks with their validation verdicts in the validation section.
- When the design recommendations hold a "Questions for the customer" section, carry every question into the guide's design and configuration recommendations section, under the same heading and with the same wording. They are what the request did not say enough to settle; say so, and do not present them as faults or as recommendations.
In a Change request (`baseline` is set), open the executive summary with what changed and why, from `baseline.changes`: the requirements added, changed and removed with their reasons, then what that changed in the architecture. Name separately anything listed under `unrequested`: it changed without a changed requirement reaching it.

View File

@@ -9,8 +9,14 @@ Your task message carries the design advisor's brief in `brief` and the pillar's
1. Load the Skill available to you.
2. Evaluate the workload in the brief against the Skill's core principles and validation checklist.
3. Write prioritised, actionable recommendations for each relevant component, naming the products the Skill lists for each gap and citing its guidance.
4. List any assessment questions from the Skill that the brief leaves unanswered, as open questions; don't ask the user.
4. Do not ask the user anything, and do not guess what the brief does not say.
5. Review the Skill's validation checklist item by item, when it has one. For every item give its `status`: `addressed` when your recommendations cover it, `not_applicable` when it does not apply to this workload or is not something an architecture can settle (an organisation's process, for example), or `not_addressed` when it applies and you recommend nothing for it. In `note`, say in a few words how it is addressed or why it does not apply. Copy each item's text as the Skill has it, shortened to its first sentence.
5. Review the Skill's validation checklist item by item, when it has one. For every item give its `status`:
- `addressed` when your recommendations cover it.
- `not_applicable` when it does not apply to this workload.
- `needs_customer_input` when it could apply and the brief does not say what would settle it: how the customer's organisation works, what they already have, or what they want. Give the `question` to put to the customer, written so someone who knows their organisation can answer it. This is the right status whenever the gap is in what you were told, not in the design. Do not invent a recommendation to cover it.
- `not_addressed` only when the brief gives you what you need, the item applies, and you recommend nothing for it.
In `note`, say in a few words how it is addressed, why it does not apply, or what the brief leaves unsaid. Copy each item's text as the Skill has it, shortened to its first sentence.
Call `submit_advice` with your recommendations as markdown in `content` and the review in `checklist`. You are done when it accepts them.

View File

@@ -14,7 +14,7 @@ You produce the **requirements** Deliverable: the Skill's requirements-discovery
- Name no products, services or architectures. This Deliverable describes the problem, not the solution.
- Give every requirement an id and attach them all as `requirements.json`, in the format the requirements-chain Skill gives. Use the same ids in your content.
- Give every non-functional requirement its `conditions`: one entry for each separate thing that must be true for it to be met and that the configuration of infrastructure can show. "Data is encrypted in transit and at rest" has two. Each becomes something the design is checked against, so a condition left out is a condition nobody verifies.
- Put under `outside_code` what the requirement asks for that no infrastructure configuration can show: an outcome measured in operation (an availability percentage, a response time), behaviour of the application's own code, or a process people follow. Those are recorded and reported, and are not checked against the infrastructure code.
- Put under `outside_code` what the requirement asks for that no infrastructure configuration can show: an outcome measured in operation (an availability percentage, a response time), behaviour of the application's own code, a process people follow, or a property of a region or product that only its provider publishes (a carbon rating, a service level). For the last, the condition is the choice configuration can show, such as which region is set. Those are recorded and reported, and are not checked against the infrastructure code.
In a Change request (`baseline` is set), the `workflow_request` says what has changed. Work out what it means for the delivered requirements, and give every requirement in `requirements.json` a `change`:

View File

@@ -8,7 +8,7 @@ includes: [specialist-protocol]
You produce the **validation results** Deliverable: the Skill's pre-deployment validation, done statically without provisioning anything.
- Run the deployment dry-run with your tools: validate the Terraform, and preview it with a plan when you have permission to read live cloud resources. The tools already hold the submitted files, so pass them no files.
- Give a verdict on every Check in the Target architecture, from the infrastructure code: pass, fail or not verifiable, each with the evidence you read. The Checks are the whole bar: judge the code against them and nothing else.
- Give a verdict on every Check in the Target architecture, from the infrastructure code: pass, fail or not verifiable, each with the evidence you read. The Checks are the whole bar: judge the code against them and nothing else. Judge each Check by its own words. A Check that says a role is granted or a setting is set passes when it is; other grants or settings beside it do not fail it unless the Check says "only" or "no other". What you think should also be true is a proposed addition, never a failure.
- Before you fail a Check because the code lacks a setting, confirm with `terraform_schema` that the resource type has that setting, when the tool is available. When it does not, the Check cannot be met by any code: give it not verifiable, with what the schema shows as the evidence. Give the same verdict to a Check that `implementation.json` records as unimplementable.
- When `terraform_modules` is true the code may call approved published modules. Then judge a Check on a resource the module creates from the module input that sets it: read the value in the code, and confirm with `terraform_module` what that input sets or what its default is. The modules Skill, when you have one, says how.
- Review the Target architecture's coverage once, completely. Go through every requirement and every design recommendation in turn; for each, list the conditions its text states and the Elements it applies to, and record a proposed addition for each one no Check verifies, naming the requirement or recommendation it serves. Report every gap in this pass: each later pass that finds one more costs a whole Revision of the design, the code and this validation. Propose nothing for what a requirement or recommendation lists under `outside_code`: that is application behaviour, an outcome measured in operation, or a process, and no Check on infrastructure code can verify it. Name those under your analysis heading as things to verify after deployment. A proposed addition is not a failure of the code.

View File

@@ -20,6 +20,7 @@ ORCHESTRATOR = "orchestrator"
PILLAR_ADVISOR = "pillar-advisor"
REPLY_WRITER = "reply-writer"
LESSON_CURATOR = "lesson-curator" # runs outside any Execution
COVERAGE_REVIEWER = "coverage-reviewer" # reviews a design before its Approval
PARTIALS_DIR = "partials"
_ALLOWED_FIELDS = {"role", "deliverable", "tools", "budget", "includes"}
@@ -51,7 +52,7 @@ def load_roles(
the lighter model the bundle names for its first attempt."""
specialists = {spec.specialist: kind for kind, spec in DEPENDENCY_GRAPH.items()}
required = {ORCHESTRATOR, PILLAR_ADVISOR, REPLY_WRITER, *specialists}
optional = {LESSON_CURATOR}
optional = {LESSON_CURATOR, COVERAGE_REVIEWER}
learned = _deliverables_with_lessons(bundle) if lessons else set()
roles = {}

View File

@@ -22,7 +22,7 @@ from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.types import Command
from app.adk.roles import load_roles
from app.adk.roles import COVERAGE_REVIEWER, load_roles
from app.adk.runtime import (
AgentRuntime,
Decider,
@@ -50,6 +50,7 @@ from app.skills.agent_skills import discover_skills, skill_version
from app.states.execution_state import check_customer_case
from app.states.ledger import Ledger
from app.tools.coverage import CoverageReview
from app.tools.design_review import DesignCoverageReview
from app.tools.execution import ORCHESTRATOR
from app.tools.jev import JevDecider, JevLimits
from app.tools.local import TerraformRunner, local_tools
@@ -481,6 +482,10 @@ async def open_assembly(
reviews.append(
RequirementsReview(decider, act=settings.JEV_REQUIREMENTS_THRESHOLD)
)
if settings.DESIGN_COVERAGE_REVIEW and COVERAGE_REVIEWER in roles:
# A model reads the requirements against the Checks, once, before the
# design is approved: the reading the validator would make after the code.
reviews.append(DesignCoverageReview(runtime, roles[COVERAGE_REVIEWER]))
if settings.JEV_COVERAGE_REVIEW and isinstance(decider, JevDecider):
# Optional, and off by default: Jev says which Check verifies each condition.
reviews.append(CoverageReview(decider, none_at=settings.JEV_COVERAGE_THRESHOLD))

View File

@@ -104,6 +104,12 @@ class Settings(BaseSettings):
JEV_ACT_THRESHOLD: float = 0.75
JEV_CLOSE_THRESHOLD: float = 0.15
JEV_CONFIDENCE_THRESHOLD: float = 0.6
# Have a model read the requirements and recommendations against the Checks
# when the Target architecture is first submitted, and return what no Check
# verifies to its author. The validator makes the same reading after the code
# is written, when a gap costs a Revision of design, code and validation. One
# model run in every Execution. Off until measured.
DESIGN_COVERAGE_REVIEW: bool = False
# Review a design's coverage at submission: for each condition a requirement
# lists, which Check verifies it. Off until a full case has run with it.
JEV_COVERAGE_REVIEW: bool = False

View File

@@ -101,7 +101,12 @@ async def curate(
decided = {proposal.evidence_key for proposal in existing}
fresh = [group for group in groups if group.key not in decided][:MAX_GROUPS]
if decider is not None and existing:
fresh = await _not_already_covered(decider, fresh, existing, covered_at)
# A group about one setting is narrower than any lesson about its kind of
# problem, and it recurred with those lessons published: it goes to the
# curator, who is shown the lessons that exist and may still decline.
broad = [group for group in fresh if group.subject is None]
kept = await _not_already_covered(decider, broad, existing, covered_at)
fresh = [g for g in fresh if g.subject is not None or g in kept]
if not fresh:
return []
by_key = {group.key: group for group in fresh}

View File

@@ -10,6 +10,8 @@ from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
from app.tools.schema_review import named_settings
EXAMPLES = 3
EXAMPLE_LIMIT = 400
# Ids and numbers vary between Executions; what recurs is the shape around them.
@@ -29,6 +31,9 @@ class Group:
executions: set[str] = field(default_factory=set)
occurrences: int = 0
examples: list[str] = field(default_factory=list) # client data: never published
# The provider setting or resource type the problem was about, for a group
# narrowed to one subject. None for a group of every problem of its kind.
subject: str | None = None
def as_context(self) -> dict[str, Any]:
return {
@@ -61,6 +66,10 @@ def read_candidates(roots: Iterable[Path]) -> list[dict[str, Any]]:
return records
# A subject shorter than this is a stray word, not a setting.
_SUBJECT_MIN = 4
def _general(text: str, limit: int = 110) -> str:
return " ".join(_VARIABLE.sub("…", text).split())[:limit]
@@ -104,6 +113,31 @@ def _shape(candidate: Mapping[str, Any]) -> tuple[str, str | None, str] | None:
return None
def _subjects(candidate: Mapping[str, Any]) -> tuple[str, list[str]] | None:
"""For a problem about what a Check says: (how to describe it, the settings and
resource types its text names).
Problems of one kind are one group, and one group gets one lesson. "Validation
proposed a Check" was 20 of 32 Executions and a single lesson; what recurred
inside it, such as the same setting missed again and again, was invisible. A
setting's name is the provider's vocabulary, not a client's, so it can be the
subject of a narrower group.
"""
kind = str(candidate.get("type"))
if kind == "proposed_addition":
text = str(candidate.get("statement", ""))
what = "validation proposed a Check about `{}` that the design lacked"
elif kind == "revision" and "cannot be implemented" in str(
candidate.get("reason", "")
):
text = str(candidate.get("reason", ""))
what = "a Check about `{}` asked for something that resource cannot do"
else:
return None
names = {name.split(".")[-1] for name in named_settings(text)}
return what, sorted(name for name in names if len(name) >= _SUBJECT_MIN)
def group_candidates(
records: Sequence[Mapping[str, Any]], *, min_executions: int = 2
) -> list[Group]:
@@ -138,6 +172,23 @@ def group_candidates(
and len(group.examples) < EXAMPLES
):
group.examples.append(example)
narrowed = _subjects(candidate)
for subject in narrowed[1] if narrowed else ():
about = narrowed[0].format(subject) # type: ignore[index]
subkey = hashlib.sha256(
f"{kind}|{deliverable}|{about}".encode()
).hexdigest()[:10]
narrow = groups.setdefault(
subkey, Group(subkey, kind, deliverable, about, subject=subject)
)
narrow.executions.add(execution)
narrow.occurrences += 1
if (
example
and example not in narrow.examples
and len(narrow.examples) < EXAMPLES
):
narrow.examples.append(example)
return sorted(
(g for g in groups.values() if len(g.executions) >= min_executions),
key=lambda g: (-len(g.executions), -g.occurrences, g.key),

View File

@@ -37,6 +37,9 @@ class Proposal:
status: str = NEEDS_TRIAGE
proposed: str = ""
published: str = ""
# The day it was taken out of the Skill again. A retired lesson is not
# published a second time, whatever its Status still says.
retired: str = ""
proof: str = ""
comments: str = ""
path: Path | None = None
@@ -47,7 +50,7 @@ class Proposal:
@property
def approved(self) -> bool:
return self.status == APPROVED
return self.status == APPROVED and not self.retired
def _slug(title: str) -> str:
@@ -65,6 +68,8 @@ def render(proposal: Proposal) -> str:
]
if proposal.published:
lines.append(f"Published: {proposal.published}")
if proposal.retired:
lines.append(f"Retired: {proposal.retired}")
lines += [
"",
"## Rule",
@@ -117,6 +122,7 @@ def parse(path: Path) -> Proposal:
status=status,
proposed=fields.get("Proposed", ""),
published=fields.get("Published", ""),
retired=fields.get("Retired", ""),
proof="" if proof == "Not yet measured." else proof,
comments=sections.get("Comments", ""),
path=path,

View File

@@ -111,6 +111,8 @@ def publish(
Raises NotApproved for any proposal a person has not approved: nothing reaches
an agent on a curator's say-so.
"""
if proposal.retired:
raise NotApproved(f"{proposal.id} was retired on {proposal.retired}")
if not proposal.approved:
raise NotApproved(
f"{proposal.id} is {proposal.status}; a person approves a lesson by "

View File

@@ -54,7 +54,13 @@ from app.tools.execution import ORCHESTRATOR, OrchestratorToolbox, specialist_to
from app.tools.guardrail import EXECUTION_SCOPE, instructs_agent
from app.tools.meaning import settle_meaning
from app.tools.modules import MODULE_TOOL, MODULES_OPTED_IN
from app.tools.pillars import ADVICE_KEY, KEPT_FOR_CHANGES, pillars_touched
from app.tools.pillars import (
ADVICE_KEY,
KEPT_FOR_CHANGES,
QUESTIONS_HEADING,
customer_questions,
pillars_touched,
)
from app.tools.skill_routing import read_first
from app.workflows.chain import (
IMPLEMENTATION_FILE,
@@ -83,6 +89,7 @@ NO_USER_REPLY = (
"'Assumptions', and proceed."
)
GUIDE_FILENAME = "solution-architecture-guide.md"
QUESTIONS_FILENAME = "customer-questions.md" # what to ask the customer
MANIFEST_FILENAME = "execution.json" # request, status and files of one Execution
@@ -1237,7 +1244,11 @@ def _written_before(out_dir: Path) -> set[str]:
return set()
if not isinstance(manifest, dict):
return set()
names = {manifest.get("solution_guide"), manifest.get("changes")}
names = {
manifest.get("solution_guide"),
manifest.get("changes"),
manifest.get("customer_questions"),
}
for entry in (manifest.get("deliverables") or {}).values():
if isinstance(entry, dict):
names.add(entry.get("document"))
@@ -1293,6 +1304,28 @@ def _write_outputs(
if kept:
# Working material a Change request starts from, such as each pillar's advice.
files[WORKING_FILENAME] = json.dumps(kept, indent=2, ensure_ascii=False)
questions = customer_questions(
state.get("working", {}).get(DeliverableKind.DESIGN_RECOMMENDATIONS.value, {})
)
if questions:
# What the request did not say enough to settle, as questions to put to
# the customer. Missing information, not a fault in the design.
files[QUESTIONS_FILENAME] = "\n".join(
[
f"# {QUESTIONS_HEADING}",
"",
(
"The request did not say enough to settle these. Each answer "
"may change a recommendation."
),
"",
*(
f"- **{item['pillar']}**, {item['item']} {item['question']}"
for item in questions
),
"",
]
)
baseline = state.get("baseline") or None
if baseline:
# What this Change request changed against its Baseline, worked out from
@@ -1334,6 +1367,8 @@ def _write_outputs(
phase.value: ledger.phase_status(phase).value for phase in PHASE_ORDER
},
"solution_guide": GUIDE_FILENAME if guide else None,
# Questions the request left open, for the customer; None when there are none.
"customer_questions": QUESTIONS_FILENAME if questions else None,
"changes": CHANGES_FILE if baseline else None,
"deliverables": by_kind,
}

View File

@@ -634,6 +634,12 @@ class Router:
"a reason."
for item in r.unimplementable
)
# In the run of 2026-10-09 a second Check with the same fault came back
# one Revision later, for the same reason word for word.
reason += (
" The same fault may be in other Checks: read every Check against "
"each reason given here and correct every one it applies to."
)
return await call(
"reopen", kind=DeliverableKind.TARGET_ARCHITECTURE.value, reason=reason
)

View File

@@ -78,6 +78,10 @@ class ProviderBundle:
# The Skill that says which modules to use and when. It reaches a Specialist
# only in an Execution that opted into modules.
terraform_modules_skill: str | None = None
# Modules that could not be used with the pinned providers when last looked
# at, as <namespace>/<name>/<provider>. scripts/check-terraform-modules.py
# says when one can.
terraform_modules_watch: tuple[str, ...] = ()
# The Skill approved lessons are published in (ADR-0004); None when the provider
# has none. A Specialist is given it once it holds lessons for its Deliverable.
lessons_skill: str | None = None
@@ -244,5 +248,12 @@ def load_provider(name: str, root: Path | None = None) -> ProviderBundle:
terraform_providers=terraform_providers,
terraform_module_namespaces=tuple(module_namespaces),
terraform_modules_skill=modules_skill,
terraform_modules_watch=tuple(
str(item)
for item in ((config.get("terraform") or {}).get("modules") or {}).get(
"watch"
)
or ()
),
lessons_skill=lessons_skill,
)

View File

@@ -32,6 +32,21 @@ QUALITY_RUBRIC: Mapping[str, str] = {
_JUDGED = "design_recommendations"
def checklist_question(pillar: str, item: str) -> str:
"""Whether the recommendations account for one item of a pillar's checklist.
An item is accounted for in three ways. The third matters: a customer's request
seldom says enough to settle every item, and what it leaves unsaid is a
question for them, not a fault in the design (the owner, 2026-10-10).
"""
return (
f"Do the recommendations account for this {pillar} checklist item in any "
"of these ways: by recommending it, by explaining why it does not apply, "
"or by recording it as something to confirm with the customer? "
f"{item}"
)
async def assess(
decider: Decider,
deliverables: Mapping[str, Mapping[str, Any]],

151
app/tools/design_review.py Normal file
View File

@@ -0,0 +1,151 @@
"""A review of a design's coverage by a model, before anyone approves it.
The validator reads the requirements and recommendations against the Checks and
proposes one for each condition nothing verifies. That reading needs no code, but it
used to happen only after the code was written: in the runs of 2026-10-09 it sent
the Target architecture back in four of seven, each time costing a Revision of the
design, the code and the validation (iteration 6 step 12).
This is the same reading, made when the Target architecture is first submitted and
returned to its author. It is a review like the others: what it raises is returned
once and never blocks, and when it fails the submission stands.
It runs once in an Execution. A Revision is asked for by the validator or the user,
who have just read the design; reviewing it again would pay for the same reading.
"""
from __future__ import annotations
import json
import logging
from collections.abc import Mapping, Sequence
from typing import Any
from app.adk.runtime import (
AgentRuntime,
AgentTask,
RoleSpec,
Submitted,
ToolResult,
ToolSpec,
)
from app.workflows.chain import (
RECOMMENDATIONS_FILE,
REQUIREMENTS_FILE,
Upstream,
read_list,
)
from app.workflows.deliverables import DeliverableKind
from app.workflows.target_architecture import GRAPH_ATTACHMENT, GraphError, parse_graph
logger = logging.getLogger(__name__)
MAX_GAPS = 12
class DesignCoverageReview:
def __init__(self, runtime: AgentRuntime, role: RoleSpec) -> None:
self._runtime = runtime
self._role = role
self._reviewed: set[str] = set()
async def __call__(
self,
kind: DeliverableKind,
attachments: Mapping[str, str],
upstream: Upstream | None,
scope: str = "",
) -> Sequence[str]:
"""The conditions the reviewer finds no Check verifies, each as a line for
the target architect. Empty when it finds none or could not review."""
if kind is not DeliverableKind.TARGET_ARCHITECTURE or not upstream:
return ()
text = attachments.get(GRAPH_ATTACHMENT, "")
try:
graph = parse_graph(text)
except GraphError:
return ()
if scope in self._reviewed:
return ()
self._reviewed.add(scope)
constraints = [
item
for item in read_list(upstream, "requirements", REQUIREMENTS_FILE)
if item.get("kind") == "non_functional"
] + read_list(upstream, "design_recommendations", RECOMMENDATIONS_FILE)
known = {str(item.get("id")) for item in constraints}
applies_to = {element.id for element in graph.elements} | {
relationship.id for relationship in graph.relationships
}
async def report_gaps(gaps: Any = None) -> ToolResult:
if not isinstance(gaps, list):
return ToolResult("Not recorded: `gaps` is a list; empty when none.")
return ToolResult("Recorded.", Submitted(json.dumps(gaps)))
tool = ToolSpec(
"report_gaps",
"Give every gap you found, in one call. An empty list when the Checks "
"verify every condition. Ends your turn.",
{
"type": "object",
"properties": {
"gaps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "The requirement or recommendation id",
},
"applies_to": {
"type": "string",
"description": "The Element or Relationship id",
},
"statement": {
"type": "string",
"description": "The Check that is missing",
},
},
"required": ["source", "applies_to", "statement"],
},
}
},
"required": ["gaps"],
},
report_gaps,
tier="execution",
)
task = AgentTask(
role=self._role.name,
prompt="Review whether the Target architecture's Checks verify every "
"condition of the requirements and recommendations.",
context={
"constraints": constraints,
"target_architecture": json.loads(text),
},
)
outcome = await self._runtime.run(self._role, task, [tool])
if not isinstance(outcome, Submitted):
logger.info("[%s] design coverage review gave no answer", scope)
return ()
try:
reported = json.loads(outcome.content)
except ValueError:
return ()
concerns = []
for gap in reported if isinstance(reported, list) else []:
if not isinstance(gap, Mapping):
continue
source, where = str(gap.get("source", "")), str(gap.get("applies_to", ""))
statement = " ".join(str(gap.get("statement", "")).split())
# A gap must be about something that exists: an invented id is dropped.
if source not in known or where not in applies_to or not statement:
continue
concerns.append(f"{source}: no Check verifies this on {where}: {statement}")
logger.info(
"[%s] design coverage review raised %d gap(s)", scope, len(concerns)
)
return tuple(concerns[:MAX_GAPS])

View File

@@ -39,12 +39,18 @@ REVIEW_HEADING = "Architecture framework checklist review"
# What a Change request carries over from its Baseline's working memory.
KEPT_FOR_CHANGES = (ADVICE_KEY, CHECKLIST_KEY)
_CHANGE_LIMIT = 6_000
STATUSES = ("addressed", "not_applicable", "not_addressed")
NEEDS_CUSTOMER = "needs_customer_input"
STATUSES = ("addressed", "not_applicable", NEEDS_CUSTOMER, "not_addressed")
_STATUS_WORDS = {
"addressed": "Addressed",
"not_applicable": "Does not apply",
# The item applies, and the customer's request does not say what would settle
# it. That is missing information, not a fault in the design: it is reported
# with the question to put to the customer.
NEEDS_CUSTOMER: "To confirm with the customer",
"not_addressed": "Not addressed",
}
QUESTIONS_HEADING = "Questions for the customer"
AFFECTED = ("not at all", "only indirectly", "directly")
@@ -215,17 +221,29 @@ def _submit_advice_tool(review: list[dict[str, str]]) -> ToolSpec:
async def submit_advice(content: str, checklist: Sequence[Any] = ()) -> ToolResult:
if not content.strip():
return ToolResult("Not submitted: the advice is empty.")
review[:] = [
entries = [
{
"item": " ".join(str(entry.get("item", "")).split()),
"status": str(entry.get("status", "")),
"note": " ".join(str(entry.get("note", "")).split()),
"question": " ".join(str(entry.get("question") or "").split()),
}
for entry in checklist or ()
if isinstance(entry, Mapping)
and str(entry.get("item", "")).strip()
and entry.get("status") in STATUSES
]
unasked = [
entry["item"]
for entry in entries
if entry["status"] == NEEDS_CUSTOMER and not entry["question"]
]
if unasked:
return ToolResult(
"Not submitted: an item to confirm with the customer needs the "
"`question` to put to them. Missing for: " + "; ".join(unasked)
)
review[:] = entries
return ToolResult("Advice submitted.", Submitted(content))
text = {"type": "string"}
@@ -248,8 +266,15 @@ def _submit_advice_tool(review: list[dict[str, str]]) -> ToolSpec:
"status": {"type": "string", "enum": list(STATUSES)},
"note": {
"type": "string",
"description": "How your advice addresses it, or "
"why it does not apply to this workload.",
"description": "How your advice addresses it, why "
"it does not apply to this workload, or what the "
"request leaves unsaid.",
},
"question": {
"type": "string",
"description": "For needs_customer_input only: "
"the question to put to the customer, answerable "
"by someone who knows their organisation.",
},
},
"required": ["item", "status", "note"],
@@ -274,7 +299,8 @@ def render_checklist_review(working: Mapping[str, Any]) -> str:
"",
(
"Each pillar advisor's review of its pillar's checklist for this "
"workload: what its advice addresses, and what does not apply and why."
"workload: what its advice addresses, what does not apply and why, and "
"what the request does not say enough to settle."
),
]
for pillar, entries in reviews.items():
@@ -301,4 +327,48 @@ def render_checklist_review(working: Mapping[str, Any]) -> str:
for entry in entries
if isinstance(entry, Mapping)
]
questions = customer_questions(working)
if questions:
parts += [
"",
f"### {QUESTIONS_HEADING}",
"",
(
"The request does not say enough to settle these. They are not "
"faults in the design: each is something to ask the customer, and "
"the answer may change a recommendation."
),
"",
"| Pillar | About | Question |",
"| --- | --- | --- |",
]
parts += [
"| "
+ " | ".join(
value.replace("|", "\\|")
for value in (item["pillar"], item["item"], item["question"])
)
+ " |"
for item in questions
]
return "\n".join(parts) + "\n"
def customer_questions(working: Mapping[str, Any]) -> list[dict[str, str]]:
"""What the advisors found the request does not say: each checklist item that
needs the customer's answer, with the question to put to them."""
reviews = working.get(CHECKLIST_KEY)
if not isinstance(reviews, Mapping):
return []
return [
{
"pillar": str(pillar),
"item": str(entry.get("item", "")),
"question": str(entry.get("question", "")),
}
for pillar, entries in reviews.items()
for entry in entries or ()
if isinstance(entry, Mapping)
and entry.get("status") == NEEDS_CUSTOMER
and entry.get("question")
]

View File

@@ -36,6 +36,9 @@ _NAME = re.compile(
r"(?![\w/\-])"
)
_PATH = re.compile(r"^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$")
# Values a Check may put in backticks. `true` and `false` were raised as missing
# settings in a run of 2026-10-10.
_LITERALS = frozenset({"true", "false", "null", "none"})
def named_settings(statement: str) -> tuple[str, ...]:
@@ -48,7 +51,7 @@ def named_settings(statement: str) -> tuple[str, ...]:
found: list[str] = []
for span in _CODE.findall(statement):
candidate = span.strip().split("=")[0].strip()
if _PATH.match(candidate):
if _PATH.match(candidate) and candidate not in _LITERALS:
found.append(candidate)
bare = _QUOTED.sub(" ", _CODE.sub(" ", statement))
found += [match.group(1).rstrip(".") for match in _NAME.finditer(bare)]

View File

@@ -31,6 +31,7 @@ from typing import Any
from app.agent import open_decider
from app.config import get_settings
from app.providers import load_provider
from app.tools.assessment import checklist_question
from eval.judge import DeciderJudge, GeminiJudge, Judge, JudgeUnavailable
from eval.scoring import QUALITY_RUBRIC, checklist_items
@@ -55,9 +56,7 @@ def build(seed: int = 7) -> list[dict[str, Any]]:
"id": f"{document.stem}.{pillar}.{len(items)}",
"document": document.name,
"kind": "yes_no",
"text": f"Do the recommendations address this {pillar} "
"checklist item, either by recommending it or by "
f"explaining why it does not apply? {item}",
"text": checklist_question(pillar, item),
"label": None,
}
)

View File

@@ -35,6 +35,8 @@ from __future__ import annotations
import asyncio
import sys
from collections.abc import Sequence
from dataclasses import replace
from datetime import UTC, datetime
from pathlib import Path
from app.agent import open_decider
@@ -42,7 +44,7 @@ from app.config import get_settings
from app.learning.curator import LESSON_CURATOR, curate
from app.learning.evidence import group_candidates, identifiers, read_candidates
from app.learning.proof import compare, record, render
from app.learning.proposals import ISSUES, load
from app.learning.proposals import ISSUES, load, write
from app.learning.skill import (
NotApproved,
mark_reviewed,
@@ -141,7 +143,7 @@ def show_status() -> int:
"in the Skill"
if proposal.id in live
else "retired"
if proposal.published
if proposal.retired
else "not in the Skill"
)
# One comparison suggests a direction; it does not prove a lesson.
@@ -211,6 +213,10 @@ def retire_lesson(arguments: Sequence[str]) -> int:
return 2
bundle = load_provider(get_settings().CLOUD_PROVIDER)
gone = retire(arguments[0], _skill_dir(bundle))
for proposal in load(ROOT / ISSUES):
if proposal.id == arguments[0] and not proposal.retired:
# Marked on its proposal, so the next publish does not bring it back.
write(replace(proposal, retired=datetime.now(UTC).date().isoformat()))
print(f"Retired {arguments[0]}." if gone else f"{arguments[0]} is not published.")
return 0 if gone else 1

View File

@@ -448,8 +448,12 @@
"forbid": "\"(?!europe-west[14]\")(?:us|europe|asia|australia|northamerica|southamerica|me|africa)-[a-z]+[0-9]+\""
},
{
"name": "names carry the environment from a variable",
"require": "name\\s*=\\s*\"[^\"]*\\$\\{(?:var|local)\\.[a-z_]*env[a-z_]*\\}"
"name": "names are built from variables",
"require": "name\\s*=\\s*\"\\$\\{(?:var|local)\\.[a-z_]+\\}-"
},
{
"name": "the environment comes from a variable",
"require": "var\\.environment\\b"
},
{
"name": "label workload",

View File

@@ -20,7 +20,7 @@ from typing import Any
from app.adk.runtime import ToolResult
from app.agent import Interaction
from app.tools.assessment import QUALITY_BAR, QUALITY_RUBRIC
from app.tools.assessment import QUALITY_BAR, QUALITY_RUBRIC, checklist_question
from app.tools.local import mermaid_check
from app.workflows.chain import (
COMPONENTS_FILE,
@@ -417,8 +417,7 @@ async def _checklist_coverage(
questions = {
f"{pillar}.{index}": {
"kind": "yes_no",
"text": f"Do the recommendations address this {pillar} checklist item, "
f"either by recommending it or by explaining why it does not apply? {item}",
"text": checklist_question(pillar, item),
}
for pillar, items in checklists.items()
for index, item in enumerate(items)

View File

@@ -22,6 +22,8 @@ models:
iac-author: gemini/gemini-3.1-pro-preview
validator: gemini/gemini-3.1-pro-preview
lesson-curator: gemini/gemini-3.1-pro-preview
# The same reading the validator makes of a design's coverage, made earlier.
coverage-reviewer: gemini/gemini-3.1-pro-preview
# A lighter model for a role's first attempt, used when MODEL_TIERS is on. Only a
# role whose work is checked by something else belongs here: the code is checked
# by terraform validate and by the validator. The validator is the check, and a
@@ -36,6 +38,7 @@ models:
iac-author: 300
validator: 300 # timed out five times at 180 s in a run of 2026-10-07
packager: 300
coverage-reviewer: 300
# Skills each role may load. Role files stay provider-neutral; the bundle names Skills.
role_skills:
@@ -84,6 +87,17 @@ terraform:
modules:
namespaces: [terraform-google-modules]
skill: google-cloud-iac-modules
# Not usable on 2026-10-09: each required a google provider below 8. Run
# scripts/check-terraform-modules.py to see whether that has changed.
watch:
- terraform-google-modules/lb-http/google
- terraform-google-modules/pubsub/google
- terraform-google-modules/bigquery/google
- terraform-google-modules/kubernetes-engine/google
- terraform-google-modules/log-export/google
- terraform-google-modules/event-function/google
- terraform-google-modules/scheduled-function/google
- terraform-google-modules/bastion-host/google
mcp_auth:
kind: google_adc # Application Default Credentials bearer token; sends X-Goog-User-Project

View File

@@ -0,0 +1,96 @@
#!/usr/bin/env python3
"""Review the published Terraform modules a provider bundle's modules Skill uses.
For each module the Skill's examples call: the version pinned there, the latest in
the registry, and whether the latest still works with the pinned provider. For each
module the bundle lists under `terraform.modules.watch`, which could not be used
when last looked at: whether its latest version now can.
It reads the public registry and changes nothing. Raising a pinned version is a
change to the Skill's example, which `tests/test_iac_modules.py` then validates.
Usage: .venv/bin/python scripts/check-terraform-modules.py [provider]
"""
from __future__ import annotations
import asyncio
import re
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from app.adk.runtime import ToolResult
from app.providers import load_provider
from app.tools.modules import ModuleLookup, admits, module_calls
_HCL = re.compile(r"^```hcl\n(.*?)^```", re.MULTILINE | re.DOTALL)
def _blocked(part: dict, pinned: dict[str, str]) -> list[str]:
"""The provider requirements of a module that the pinned versions do not meet."""
return [
f"{need.get('name')} {need.get('version')}"
for need in part.get("provider_dependencies") or []
if need.get("name") in pinned
and need.get("version")
and not admits(need["version"], pinned[need["name"]])
]
async def main(provider: str) -> int:
bundle = load_provider(provider)
if not bundle.terraform_modules_skill:
print(f"The {provider} bundle names no modules Skill.")
return 0
pinned = {name: pin["version"] for name, pin in bundle.terraform_providers.items()}
lookup = ModuleLookup(namespaces=bundle.terraform_module_namespaces, pinned=pinned)
skill = bundle.skills[bundle.terraform_modules_skill].path
used: dict[str, set[str]] = {}
for reference in sorted((skill / "references").glob("*.md")):
code = "\n".join(_HCL.findall(reference.read_text(encoding="utf-8")))
for call in module_calls({"main.tf": code}):
used.setdefault(call.source.split("//")[0], set()).add(call.version)
stale = 0
print(f"Pinned providers: {pinned}\n\nModules the Skill uses:")
for module, versions in sorted(used.items()):
data = await lookup._fetch(module, "")
if isinstance(data, ToolResult):
print(f" {module}: {data.message}")
continue
latest = str(data.get("version", "?"))
blocked = _blocked(data.get("root") or {}, pinned)
note = "up to date" if versions == {latest} else f"latest is {latest}"
if versions != {latest}:
stale += 1
if blocked:
note += f"; the latest needs {', '.join(blocked)}, so stay on the pin"
print(f" {module} {', '.join(sorted(versions))}: {note}")
print("\nModules that could not be used when last looked at:")
usable = 0
for name in bundle.terraform_modules_watch:
data = await lookup._fetch(name, "")
if isinstance(data, ToolResult):
print(f" {name}: {data.message}")
continue
blocked = _blocked(data.get("root") or {}, pinned)
if blocked:
print(f" {name} {data.get('version')}: still needs {', '.join(blocked)}")
else:
usable += 1
print(
f" {name} {data.get('version')}: NOW USABLE with the pinned provider"
)
print(
f"\n{stale} pinned module(s) have a newer version; {usable} watched "
"module(s) can now be used."
)
return 0
if __name__ == "__main__":
sys.exit(asyncio.run(main(sys.argv[1] if len(sys.argv) > 1 else "gcp")))

View File

@@ -44,6 +44,7 @@ Not usable with this provider version, so write these directly: the load balance
- Keep `terraform/versions.tf` from the patterns Skill unchanged. A module's own provider requirements are met by it.
- Pass every environment-specific value from a variable, as for resources.
- Before using an input the reference does not show, call `terraform_module` with `find` set to its name.
- Set every input a Check depends on, even when the module's default already gives that value. A Check is verified from a value written in the code; a default left unset can only be argued from the module's documentation, and changes when the module does.
- A module takes names, not always ids: read which one an input wants. Pass another module's output where one depends on the other, so Terraform orders them.
## Checks on an Element a module creates
@@ -52,4 +53,4 @@ A Check is still about the resource: "the instance has no public IP address". Th
- In `implementation.json`, `address` names the module and the input: `module.database.ip_configuration.ipv4_enabled`.
- When no input sets what a Check needs, the module does not fit that Element. Write its resources directly; do not mark the Check unimplementable, since the resource type does have the setting.
- When validating, read the input's value in the code and confirm with `terraform_module` what that input sets. An input left at its default is judged by the default the lookup shows. A Check is not verifiable only when neither the code nor the module's documentation shows what the resource will get.
- When validating, read the input's value in the code and confirm with `terraform_module` what that input sets. An input left at its default is judged by the default the lookup shows, and the verdict says the value is a default and not set in the code. A Check is not verifiable only when neither the code nor the module's documentation shows what the resource will get.

View File

@@ -18,7 +18,7 @@ Each reference below holds the lessons for one Deliverable. Read the one for the
| Deliverable | Reference | Lessons |
| --- | --- | --- |
| deployment guidance | `references/deployment_guidance.md` | 1 |
| target architecture | `references/target_architecture.md` | 4 |
| target architecture | `references/target_architecture.md` | 8 |
<!-- lessons:end -->
This Skill is written by the lessons loop (`app/learning/`), from proposals a person approved. Do not edit it by hand: change the proposal and publish again.

View File

@@ -8,4 +8,4 @@ Rules learned from earlier work. Follow every one that applies.
**Why.** Missing required arguments in nested blocks will cause Terraform validation to fail, preventing submission.
Published 2026-10-09, from lesson proposal 05.
Published 2026-10-10, from lesson proposal 05.

View File

@@ -8,7 +8,7 @@ Rules learned from earlier work. Follow every one that applies.
**Why.** If detailed constraints are missed, the validation phase will reject the design for incomplete coverage, forcing a revision.
Published 2026-10-09, from lesson proposal 01.
Published 2026-10-10, from lesson proposal 01.
## L-02: Assign Checks to Every Element
@@ -16,7 +16,7 @@ Published 2026-10-09, from lesson proposal 01.
**Why.** The submission tool will reject the architecture if any Element lacks a Check, wasting an attempt.
Published 2026-10-09, from lesson proposal 02.
Published 2026-10-10, from lesson proposal 02.
## L-03: Verify Resource Arguments for Checks
@@ -24,7 +24,7 @@ Published 2026-10-09, from lesson proposal 02.
**Why.** If a Check specifies an argument that does not exist on the resource, it cannot be implemented, forcing an architectural revision.
Published 2026-10-09, from lesson proposal 03.
Published 2026-10-10, from lesson proposal 03.
## L-06: Do Not Mark Requirements as Not Applicable
@@ -32,4 +32,36 @@ Published 2026-10-09, from lesson proposal 03.
**Why.** The submission tool will reject the deliverable if a Requirement lacks a Check or is incorrectly marked as not applicable.
Published 2026-10-09, from lesson proposal 06.
Published 2026-10-10, from lesson proposal 06.
## L-07: Verify location constraints
**Rule.** When a requirement specifies where resources must be provisioned, such as a designated region or multi-zone placement, create a Check for the `region` or `location` argument on every applicable Element, naming the region the design uses. Do not write a Check about a property of the region that code cannot show, such as its carbon rating.
**Why.** Validation frequently catches missing location constraints. Without this Check, resources may be provisioned in default regions, violating location requirements. A Check about a region's carbon rating cannot be verified from code and sends the design back.
Published 2026-10-10, from lesson proposal 07.
## L-08: Cloud SQL backup encryption
**Rule.** When writing a Check for CMEK encryption on a `google_sql_database_instance`, do not require an `encryption_key_name` argument for backup storage, as the instance-level `encryption_key_name` automatically encrypts backups as well.
**Why.** The database instance resource does not have a separate encryption key argument for backups. Asking for one causes validation to reject the Check as un-implementable.
Published 2026-10-10, from lesson proposal 08.
## L-09: Backend Service capabilities
**Rule.** When writing Checks for a `google_compute_backend_service`, do not verify IAM roles inside the backend service or require health checks when it is configured with a Serverless NEG.
**Why.** Roles are verified via IAM bindings outside the backend service, and Serverless NEGs do not support health checks. Invalid Checks cause the design to be rejected during validation.
Published 2026-10-10, from lesson proposal 09.
## L-10: Pub/Sub persistence regions
**Rule.** When a requirement dictates that a messaging queue or topic must replicate across zones or stay within a specific region, create a Check for the `message_storage_policy.allowed_persistence_regions` argument on the topic Element.
**Why.** Without this Check, topics might use default storage policies that violate geographical or high-availability requirements.
Published 2026-10-10, from lesson proposal 10.

View File

@@ -33,7 +33,7 @@ A list. Number functional requirements `FR-1`, `FR-2` and non-functional ones `N
]
```
Every non-functional requirement lists its `conditions`: one entry for each separate thing that must be true for it to be met and that infrastructure configuration can show. What it asks for that configuration cannot show goes under `outside_code`: an outcome measured in operation, behaviour of the application's own code, or a process people follow. A requirement has at least one entry between the two; one that is entirely outside code has `"conditions": []`. Write each so it can be checked on its own, and so that together they say everything the text says. The Target architecture needs a Check for each one.
Every non-functional requirement lists its `conditions`: one entry for each separate thing that must be true for it to be met and that infrastructure configuration can show. What it asks for that configuration cannot show goes under `outside_code`: an outcome measured in operation, behaviour of the application's own code, a process people follow, or a property of a region or product that only its provider publishes, such as a region's carbon rating or a product's service level. For those, the condition is the choice that configuration can show: "every resource is in the one agreed region" is a condition, and "that region has a high carbon-free energy score" is `outside_code`. A requirement has at least one entry between the two; one that is entirely outside code has `"conditions": []`. Write each so it can be checked on its own, and so that together they say everything the text says. The Target architecture needs a Check for each one.
`kind` is `functional` or `non_functional`. Write one requirement per entry, so each can be checked on its own.

View File

@@ -21,8 +21,9 @@ def test_every_engine_role_and_the_pillar_advisor_is_defined(bundle):
expected = {"orchestrator", "reply-writer", PILLAR_ADVISOR}
expected |= {spec.specialist for spec in DEPENDENCY_GRAPH.values()}
# The lesson curator runs outside any Execution; the engine does not need it.
assert set(roles) == expected | {"lesson-curator"}
# The lesson curator runs outside any Execution, and the coverage reviewer only
# when the deployment switches its review on; the engine needs neither.
assert set(roles) == expected | {"lesson-curator", "coverage-reviewer"}
for role in roles.values():
assert role.instructions.strip()

View File

@@ -0,0 +1,150 @@
"""A model reviews a design's coverage before it is approved (iteration 6 step 13)."""
from langgraph.checkpoint.memory import InMemorySaver
from app.adk.fake_runtime import SAMPLE_DATA, Call, FakeAgentRuntime, sample_submission
from app.adk.roles import COVERAGE_REVIEWER, load_roles
from app.adk.runtime import NoDecider, RoleSpec
from app.agent import AGENTS_DIR, ExecutionEngine
from app.nodes.router import Router, Thresholds
from app.providers import load_provider
from app.recorder import InMemoryRecorder
from app.tools.design_review import DesignCoverageReview
from app.workflows.deliverables import DEPENDENCY_GRAPH, DeliverableKind
K = DeliverableKind
GRAPH = {"target-architecture.json": SAMPLE_DATA["target-architecture.json"]}
UPSTREAM = {
"requirements": {
"attachments": {"requirements.json": SAMPLE_DATA["requirements.json"]}
},
"design_recommendations": {
"attachments": {"recommendations.json": SAMPLE_DATA["recommendations.json"]}
},
}
REVIEWER = RoleSpec(COVERAGE_REVIEWER, "Review.", budget=6)
GAP = {
"source": "NFR-1",
"applies_to": "E-1",
"statement": "min_instance_count is at least 2",
}
def reviewer(*gaps: dict, seen: dict | None = None) -> FakeAgentRuntime:
def turn(task):
if seen is not None:
seen.update(task.context)
return [Call("report_gaps", {"gaps": list(gaps)})]
return FakeAgentRuntime({COVERAGE_REVIEWER: [turn, turn]})
async def test_the_reviewer_is_given_the_constraints_and_the_design():
seen: dict = {}
review = DesignCoverageReview(reviewer(GAP, seen=seen), REVIEWER)
concerns = await review(K.TARGET_ARCHITECTURE, GRAPH, UPSTREAM, "exec-1")
assert concerns == (
"NFR-1: no Check verifies this on E-1: min_instance_count is at least 2",
)
# Non-functional requirements and recommendations; a functional requirement
# is reached through its components, not through a Check of its own.
assert [item["id"] for item in seen["constraints"]] == ["NFR-1", "DR-1"]
assert {e["id"] for e in seen["target_architecture"]["elements"]} >= {"E-1"}
async def test_a_gap_about_something_that_does_not_exist_is_dropped():
invented = [
{**GAP, "source": "NFR-99"},
{**GAP, "applies_to": "E-99"},
{**GAP, "statement": " "},
"not a gap",
]
review = DesignCoverageReview(reviewer(*invented, GAP), REVIEWER)
concerns = await review(K.TARGET_ARCHITECTURE, GRAPH, UPSTREAM, "exec-1")
assert len(concerns) == 1 and concerns[0].startswith("NFR-1:")
async def test_a_design_is_reviewed_once_in_an_execution():
runtime = reviewer(GAP)
review = DesignCoverageReview(runtime, REVIEWER)
first = await review(K.TARGET_ARCHITECTURE, GRAPH, UPSTREAM, "exec-1")
again = await review(K.TARGET_ARCHITECTURE, GRAPH, UPSTREAM, "exec-1")
other = await review(K.TARGET_ARCHITECTURE, GRAPH, UPSTREAM, "exec-2")
assert first and other and again == ()
assert len(runtime.runs) == 2
async def test_nothing_is_reviewed_but_a_readable_target_architecture():
runtime = reviewer(GAP)
review = DesignCoverageReview(runtime, REVIEWER)
assert await review(K.DEPLOYMENT_GUIDANCE, GRAPH, UPSTREAM, "a") == ()
assert await review(K.TARGET_ARCHITECTURE, {}, UPSTREAM, "b") == ()
assert await review(K.TARGET_ARCHITECTURE, GRAPH, None, "c") == ()
assert runtime.runs == []
async def test_a_complete_design_raises_nothing():
review = DesignCoverageReview(reviewer(), REVIEWER)
assert await review(K.TARGET_ARCHITECTURE, GRAPH, UPSTREAM, "exec-1") == ()
async def test_the_gaps_go_back_to_the_target_architect_before_the_design_stands(
tmp_path,
):
roles = {
"orchestrator": RoleSpec("orchestrator", "Unused.", budget=40),
**{
spec.specialist: RoleSpec(spec.specialist, "Produce.", budget=15)
for spec in DEPENDENCY_GRAPH.values()
},
}
architect = DEPENDENCY_GRAPH[K.TARGET_ARCHITECTURE].specialist
design = sample_submission(K.TARGET_ARCHITECTURE)
runtime = FakeAgentRuntime(
{
**{
spec.specialist: [[sample_submission(kind)]]
for kind, spec in DEPENDENCY_GRAPH.items()
},
# Submitted twice: once into the review, once after reading it.
architect: [[design, design]],
COVERAGE_REVIEWER: [[Call("report_gaps", {"gaps": [GAP]})]],
}
)
engine = ExecutionEngine(
runtime=runtime,
roles=roles,
recorder=InMemoryRecorder(),
checkpointer=InMemorySaver(),
output_root=tmp_path,
orchestrator=Router(NoDecider(), None, Thresholds()),
submission_review=DesignCoverageReview(runtime, REVIEWER),
)
result = await engine.start("Ingest webhooks", pre_approved=True)
assert result.status == "completed"
run = next(run for run in runtime.runs if run.role == architect)
first, second = (reply for _, reply in run.results)
assert first.startswith("Not submitted. A review found: NFR-1: no Check verifies")
assert not second.startswith("Not submitted")
# No Revision was needed: the gap was dealt with before anything was approved.
assert not [d for d in result.state["decisions"] if "revise" in d["action"]]
def test_the_reviewer_role_loads_with_the_bundles_model():
bundle = load_provider("gcp")
roles = load_roles(AGENTS_DIR, bundle)
role = roles[COVERAGE_REVIEWER]
assert role.model == bundle.models.for_role(COVERAGE_REVIEWER)
assert role.model == bundle.models.for_role("validator")
assert role.tools == () and role.model_timeout_seconds == 300

View File

@@ -464,3 +464,163 @@ async def test_an_empty_list_of_pillars_consults_none_and_returns_what_was_said(
assert len(runtime.runs) == 3 # nobody was consulted a second time
for pillar in PILLARS:
assert f"## {pillar} (from your earlier consultation)" in again.message
# --- what the request does not say is a question for the customer ------------------------
def unsure(question: str | None = "Do you have a central identity provider?"):
def turn(task):
entry = {
"item": "Identity is managed centrally",
"status": "needs_customer_input",
"note": "The request does not say how staff identities are managed.",
}
if question is not None:
entry["question"] = question
first = Call("submit_advice", {"content": "Advice.", "checklist": [entry]})
# A second attempt, used only when the first is refused.
fixed = Call(
"submit_advice",
{
"content": "Advice.",
"checklist": [{**entry, "question": "Who manages staff identities?"}],
},
)
return [first, fixed]
return turn
async def test_an_item_the_request_cannot_settle_is_kept_with_its_question():
from app.tools.pillars import CHECKLIST_KEY, customer_questions
memory: dict = {}
runtime = FakeAgentRuntime({PILLAR_ADVISOR: [unsure()] * 3})
await consult(
pillar_consultation_tool(runtime, ADVISOR, PILLARS, memory=memory), brief="b"
)
(entry,) = memory[CHECKLIST_KEY]["security"]
assert entry["status"] == "needs_customer_input"
assert customer_questions(memory)[0] == {
"pillar": "security",
"item": "Identity is managed centrally",
"question": "Do you have a central identity provider?",
}
assert len(customer_questions(memory)) == len(PILLARS)
async def test_an_item_for_the_customer_must_carry_the_question_to_ask():
from app.tools.pillars import CHECKLIST_KEY
memory: dict = {}
runtime = FakeAgentRuntime({PILLAR_ADVISOR: [unsure(question=None)] * 3})
await consult(
pillar_consultation_tool(runtime, ADVISOR, PILLARS, memory=memory), brief="b"
)
refused, accepted = (reply for _, reply in runtime.runs[0].results)
assert refused.startswith("Not submitted: an item to confirm with the customer")
assert "Identity is managed centrally" in refused
(entry,) = memory[CHECKLIST_KEY]["security"]
assert entry["question"] == "Who manages staff identities?"
assert accepted == "Advice submitted."
def test_the_questions_are_reported_as_missing_information_not_as_faults():
from app.tools.pillars import (
CHECKLIST_KEY,
QUESTIONS_HEADING,
render_checklist_review,
)
working = {
CHECKLIST_KEY: {
"security": [
{
"item": "Scans run in the pipeline",
"status": "addressed",
"note": "DR-3",
},
{
"item": "Identity is managed centrally",
"status": "needs_customer_input",
"note": "Not said.",
"question": "Do you have a central identity provider?",
},
]
}
}
text = render_checklist_review(working)
assert "| Identity is managed centrally | To confirm with the customer |" in text
assert f"### {QUESTIONS_HEADING}" in text
assert "They are not faults in the design" in text
assert (
"| security | Identity is managed centrally | Do you have a central "
"identity provider? |"
) in text
# With nothing to ask there is no questions section.
only_addressed = {
CHECKLIST_KEY: {"security": working[CHECKLIST_KEY]["security"][:1]}
}
assert QUESTIONS_HEADING not in render_checklist_review(only_addressed)
async def test_an_execution_writes_its_questions_for_the_customer(tmp_path):
import json
from langgraph.checkpoint.memory import InMemorySaver
from app.adk.fake_runtime import sample_submission
from app.adk.runtime import NoDecider
from app.agent import ExecutionEngine
from app.nodes.router import Router, Thresholds
from app.recorder import InMemoryRecorder
from app.tools.pillars import CONSULT_TOOL
from app.workflows.deliverables import DEPENDENCY_GRAPH, DeliverableKind
kind = DeliverableKind.DESIGN_RECOMMENDATIONS
advisor = DEPENDENCY_GRAPH[kind].specialist
roles = {
"orchestrator": RoleSpec("orchestrator", "Unused.", budget=40),
PILLAR_ADVISOR: ADVISOR,
**{
spec.specialist: RoleSpec(spec.specialist, "Produce.", budget=15)
for spec in DEPENDENCY_GRAPH.values()
},
}
turns = {
spec.specialist: [[sample_submission(k)]]
for k, spec in DEPENDENCY_GRAPH.items()
}
turns[advisor] = [[Call(CONSULT_TOOL, {"brief": "b"}), sample_submission(kind)]]
turns[PILLAR_ADVISOR] = [unsure()] * 3
runtime = FakeAgentRuntime(turns)
engine = ExecutionEngine(
runtime=runtime,
roles=roles,
recorder=InMemoryRecorder(),
checkpointer=InMemorySaver(),
output_root=tmp_path,
orchestrator=Router(NoDecider(), None, Thresholds()),
tool_factory=make_tool_factory(runtime, roles, pillar_skills=PILLARS),
)
result = await engine.start("Ingest", customer_case="acme", pre_approved=True)
assert result.status == "completed"
out = next(tmp_path.rglob("execution.json")).parent
manifest = json.loads((out / "execution.json").read_text())
assert manifest["customer_questions"] == "customer-questions.md"
questions = (out / "customer-questions.md").read_text()
assert questions.startswith("# Questions for the customer")
assert "Do you have a central identity provider?" in questions
assert (
"### Questions for the customer"
in (out / "deliverables" / "design_recommendations.md").read_text()
)

View File

@@ -303,7 +303,9 @@ async def test_a_check_the_code_cannot_meet_goes_back_to_the_graph_unvalidated(
"target_architecture",
(
"Check K-2 cannot be implemented as written (no such argument). "
"Rewrite it so it can be met, or remove it with a reason."
"Rewrite it so it can be met, or remove it with a reason. The same "
"fault may be in other Checks: read every Check against each reason "
"given here and correct every one it applies to."
),
)
]

View File

@@ -203,3 +203,12 @@ def test_the_gcp_bundle_names_its_modules_skill_for_the_roles_that_run_terraform
assert all(
bundle.terraform_modules_skill not in role.skills for role in roles.values()
)
def test_the_bundle_lists_modules_to_watch_from_its_approved_namespaces():
bundle = load_provider("gcp")
assert bundle.terraform_modules_watch
for module in bundle.terraform_modules_watch:
namespace, _, provider = module.split("/")
assert namespace in bundle.terraform_module_namespaces and provider == "google"

View File

@@ -148,6 +148,9 @@ def test_the_settings_a_check_names_are_read_from_its_statement():
"template.scaling.min_instance_count",
)
assert named_settings("startup_cpu_boost is true") == ("startup_cpu_boost",)
# A value in backticks is not a setting.
assert named_settings("`enable_cdn` is `false`") == ("enable_cdn",)
assert named_settings("`deletion_protection` is `true`") == ("deletion_protection",)
# Values, roles and plain prose name no setting.
assert named_settings("ingress is INGRESS_TRAFFIC_ALL") == ()
assert named_settings("roles/run.invoker is granted to allUsers") == ()

View File

@@ -10,9 +10,9 @@ from pathlib import Path
import pytest
from app.adk.fake_runtime import Call, FakeAgentRuntime
from app.adk.fake_runtime import Call, FakeAgentRuntime, FakeDecider
from app.adk.roles import load_roles
from app.adk.runtime import RoleSpec
from app.adk.runtime import Answer, RoleSpec
from app.learning.curator import LESSON_CURATOR, curate
from app.learning.evidence import group_candidates, identifiers, read_candidates
from app.learning.proposals import (
@@ -563,3 +563,101 @@ def test_the_published_lessons_were_reviewed_against_todays_vendored_skills():
assert upstream_reviewed(skill), "run: python -m eval.curate_lessons reviewed"
assert upstream_changes(skill, upstream_versions(bundle)) == []
# --- what recurs inside a kind of problem ------------------------------------------------
def addition(statement: str) -> dict:
return {"type": "proposed_addition", "statement": statement, "serves": "NFR-1"}
def test_the_same_setting_missed_in_several_executions_is_its_own_group():
records = [
record("run-1", addition("`deletion_protection` is true on the database")),
record("run-2", addition("deletion_protection is enabled"), addition("x y")),
record("run-3", addition("`min_tls_version` is TLS_1_2")),
]
groups = {group.subject: group for group in group_candidates(records)}
# Every proposed Check is one broad group; the setting missed twice is another.
assert len(groups[None].executions) == 3
narrow = groups["deletion_protection"]
assert len(narrow.executions) == 2 and narrow.kind == "proposed_addition"
assert narrow.description == (
"validation proposed a Check about `deletion_protection` that the design lacked"
)
assert narrow.key != groups[None].key
# Seen in one Execution only, a setting is not a pattern.
assert "min_tls_version" not in groups
def test_a_resource_that_checks_keep_asking_too_much_of_is_its_own_group():
def cannot(why: str) -> dict:
return {
"type": "revision",
"deliverable": "target_architecture",
"reason": f"Check K-1 cannot be implemented as written ({why}).",
}
records = [
record("run-1", cannot("example_database has no backup key argument")),
record("run-2", cannot("example_database has no query access flag")),
]
subjects = {group.subject for group in group_candidates(records)}
assert subjects == {None, "example_database"}
async def test_a_group_about_one_setting_reaches_the_curator_past_triage(tmp_path):
issues = tmp_path / "issues"
approve(proposal(issues), issues) # a general lesson already exists
records = [
record("run-1", addition("`deletion_protection` is true")),
record("run-2", addition("`deletion_protection` is true")),
]
groups = group_candidates(records)
# Triage says the general lesson covers everything it is asked about.
decider = FakeDecider(
{group.key: Answer("L-01", 0.95) for group in groups if group.subject is None}
)
seen: list[str] = []
def turn(task):
seen.extend(group["what_happened"] for group in task.context["groups"])
return [Call("finish")]
runtime = FakeAgentRuntime({LESSON_CURATOR: [turn]})
await curate(
runtime,
CURATOR,
groups,
executions=2,
folder=issues,
decider=decider,
)
assert seen == [
"validation proposed a Check about `deletion_protection` that the design lacked"
]
def test_a_retired_lesson_is_not_published_again(tmp_path):
"""Retiring left the proposal approved, so the next publish put the lesson
back: L-04 returned to the Skill that way on 2026-10-10."""
from dataclasses import replace
skill = lessons_skill(tmp_path)
issues = tmp_path / "issues"
made = publish(approve(proposal(issues), issues), skill, today=DAY)
retire(made.id, skill)
retired = write(replace(parse(made.path), retired="2026-10-09"), issues)
assert parse(retired.path).retired == "2026-10-09"
assert not retired.approved
with pytest.raises(NotApproved, match="was retired on 2026-10-09"):
publish(retired, skill)
assert published(skill) == {}