Compare commits
6 Commits
5feaaa6271
...
feat/solut
| Author | SHA1 | Date | |
|---|---|---|---|
| a48468d477 | |||
| f9cc34817b | |||
| 7ee7054523 | |||
| c4c8a1f94e | |||
| 135401e41b | |||
| 81ac135cd9 |
@@ -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.
|
||||
|
||||
|
||||
@@ -95,3 +95,27 @@ Over the same 32 Executions this gave 22 groups and five proposals, L-07 to L-11
|
||||
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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
24
.agents/plans/iter-04-learning-and-skills/steps/step-29.md
Normal file
24
.agents/plans/iter-04-learning-and-skills/steps/step-29.md
Normal 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).
|
||||
@@ -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`) |
|
||||
|
||||
37
.agents/plans/iter-05-jev-decisions/steps/step-1.md
Normal file
37
.agents/plans/iter-05-jev-decisions/steps/step-1.md
Normal 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.
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -8,11 +8,11 @@ Published: 2026-10-10
|
||||
|
||||
## Rule
|
||||
|
||||
When a requirement specifies where resources must be provisioned, such as a designated region, multi-zone placement, or a low-carbon location, create a Check for the `region` or `location` argument on every applicable Element.
|
||||
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 compliance or sustainability requirements.
|
||||
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
|
||||
|
||||
@@ -25,3 +25,5 @@ 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.
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# L-10: Pub/Sub persistence regions
|
||||
|
||||
Status: needs-info
|
||||
Status: ready-for-agent
|
||||
Deliverable: target_architecture
|
||||
Evidence-key: ba78caba9a
|
||||
Proposed: 2026-10-10
|
||||
Published: 2026-10-10
|
||||
|
||||
## Rule
|
||||
|
||||
@@ -24,3 +25,5 @@ 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`).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -19,6 +19,7 @@ You produce the **deployment guidance** Deliverable: the Skill's task for genera
|
||||
- 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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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`:
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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]],
|
||||
|
||||
@@ -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")
|
||||
]
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -87,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
|
||||
|
||||
96
scripts/check-terraform-modules.py
Normal file
96
scripts/check-terraform-modules.py
Normal 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")))
|
||||
@@ -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.
|
||||
|
||||
@@ -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` | 7 |
|
||||
| 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.
|
||||
|
||||
@@ -36,9 +36,9 @@ 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, multi-zone placement, or a low-carbon location, create a Check for the `region` or `location` argument on every applicable Element.
|
||||
**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 compliance or sustainability requirements.
|
||||
**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.
|
||||
|
||||
@@ -57,3 +57,11 @@ Published 2026-10-10, from lesson proposal 08.
|
||||
**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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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()
|
||||
)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user