Module 8: Capstone The Andes Cargo Genai Extractor

1. Capstone introduction: the complete extractor, closed

Description

Seven modules each built, on its own, a different layer of Andes Cargo's manifest extractor: the architecture decision (M1), the cost model (M2), the infrastructure (M3), the guardrails (M4), security (M5), the token budget (M6), and observability (M7). None of those seven closing lessons integrated all seven pieces together — each closed its own module, citing the previous ones, without running the complete system end to end. This module does exactly that, and nothing more: it adds no new concept, no Bedrock mechanism this module's lessons 2 through 7 haven't already cited, no tool this ecosystem hasn't already used before. It takes the repository exactly as the previous seven modules left it and walks through it, once, from start to finish — with the exact same honesty criterion that sustained every lesson since Module 1: what really ran, what's a precise reconstruction of what would run, and why, at every point, unambiguously.

Connection to the module

This is genai-on-aws-production-guide's last module. Lesson 2 reviews the complete architecture, with the two paths overlaid on the inherited system. Lessons 3 and 4 walk each path end to end — the deterministic one, executed in full; the escalation one, mixed and declared as such. Lesson 5 brings together, in one place, every piece that stayed representative across this entire guide, with its exact reason. Lesson 6 closes, unambiguously, the boundary with AI Engineering M1.4 first fixed. Lesson 7 looks ahead: what Andes Cargo would need if its volume grew. Lesson 8 — this complete guide's final project — delivers the repository as a portfolio piece.


Analogy: the final inspection, not a new factory station

A factory that assembles a complex product — a car, an appliance — doesn't end its production line with a station that adds one more part. It ends with a final inspection station: someone, or some system, walks through the complete product, component by component, confirming every part the previous stations installed is where it should be, works how it should work, and that the complete product — not each piece separately — does what it promises. That station welds nothing new. It adds no missing component. Its job is, exclusively, integration: does the engine station 12 installed correctly talk to the transmission station 18 installed? This module is that final inspection station. bedrock.tf (M3) already exists. pre_invoke_checks.py/post_invoke_checks.py (M4) already exist, tested. bedrock-least-privilege.rego (M5) already exists, tested against a real plan. bedrock_cost_estimate.py and bedrock-budget.rego (M2, M6) already exist. escalation_rate.py and the smoke test harness (M7) already exist. This module welds no new part — it walks through the complete car, starts it, and confirms, with the same discipline as always, which of what you see running is the real engine and which is the dashboard showing a representative reading because the car never actually hit the road.


What gets delivered: the inherited pieces, module by module

ModulePiece(s) it delivers to this capstoneState
M1ADR-001-llm-as-escalation-path.md — the complete architecture decision; parse_manifest(), the ManifestParseFailed eventWritten decision; code inherited from aws-core-services-guide
M2GENAI-COST-PROFILE.md — Amazon Nova Lite chosen, two volume scenarios ($0.00 realistic, $0.42 stress)Complete document, calculator really run
M3bedrock.tf + modules/bedrock-guardrail/ + BedrockManifestExtractorRolePlan: 17 to add, real validate/plan, no LocalStack
M4Complete guardrail (6 mechanisms/5 policies) + guardrails/pre_invoke_checks.py + guardrails/post_invoke_checks.py + guardrails/defense_in_depth_flow.py34 pytest cases, all real
M5policy/bedrock-least-privilege.rego + functions/extract-shipment-manifest-fields/handler.py signed with cosignReal conftest/cosign; extended security gate, no new job
M6cost-policy/bedrock-budget.rego + local.ai_workload_tags (Workload=GenAIExtraction)Extended cost gate, no new job
M7observability/escalation_rate.py (12.0%, 6 of 50) + evals/manifest_extraction_smoke_test.py (3/5, 40% block rate)Literal SLI + structural harness, both real

Seven rows, none empty. This capstone doesn't rescue a forgotten piece or fix a pending mistake — every previous module closed with its own verified project, before this module even started being written.


This complete guide's honesty ledger, in advance

Before going into the detailed walkthrough, it's worth seeing, all at once, the final balance this module's lessons 3 through 5 are going to confirm with evidence:

   EXECUTED (really runs, in this environment, with no exception)

   - parse_manifest() against well-formed and free-text manifests (M1, M8.3)
   - terraform validate / plan over bedrock.tf + modules/bedrock-guardrail/ (M3)
   - pytest over pre_invoke_checks.py / post_invoke_checks.py / defense_in_depth_flow.py (M4)
   - conftest over bedrock-least-privilege.rego and bedrock-budget.rego (M5, M6)
   - cosign sign-blob / verify-blob over the extractor's .zip (M5)
   - bedrock_cost_estimate.py, escalation_rate.py, the smoke test harness (M2, M7)
   - building the real ManifestParseFailed and the invoke_model request (M8.4)

   REPRESENTATIVE (precisely reconstructed, never executed)

   - ANY real invocation to bedrock:InvokeModel, across this ENTIRE guide, no exception
   - Bedrock Guardrails' real blocking of an attack or a PII leak (M4.7)
   - terraform apply / tflocal apply of a real Bedrock resource (M3.6)
   - real InvocationLatency / TimeToFirstToken (M7.7)
   - the dollar figure Infracost would produce for bedrock.tf (M2.5, M2.6)
   - the semantic quality of a real extraction (M1.4, M7.5 -- boundary with AI Engineering)

This is, precisely, the complete map this module's lesson 5 is going to document row by row, with each one's exact technical reason — never a generic "couldn't be done" label.


Map of the eight lessons

  M8.1  Capstone introduction (this lesson) -- what gets delivered, the
        advance ledger
  M8.2  Architecture review: the complete system, two paths --
        ASCII + mermaid diagram, overlaid on the inherited system
  M8.3  End-to-end walkthrough: the deterministic, cheap path, executed
        -- FULLY EXECUTED, no exception
  M8.4  End-to-end walkthrough: the AI escalation path, mixed and
        declared -- real ManifestParseFailed, representative invocation,
        real custom guardrails over the simulated response
  M8.5  What this guide left representative -- the final ledger, with the
        exact technical reason for each row
  M8.6  The boundary with AI Engineering, closed -- recaps M1.4,
        with no ambiguity at close
  M8.7  What Andes Cargo still needs -- GPU/Provisioned Throughput
        at scale, named, not built; the ecosystem's close
  M8.8  Final project: Andes Cargo's GenAI package as a deliverable

Lessons 3 and 4 are this module's executable core — each runs real code, with the same literal-or-representative "What to expect" discipline every lesson in this guide has already applied to its own domain. Lessons 5, 6, and 7 are closing lessons: none runs new code, each consolidates what's already been demonstrated. Lesson 8 delivers the complete repository.


Common mistakes

Expecting this module to add a new infrastructure piece, a Bedrock mechanism previous lessons haven't covered (expecting new content). What happens: someone arrives at this module expecting, say, the sixth guardrail policy that was missing, or an AWS service no previous guide named. How to spot it: if your question upon opening this lesson is "what new thing am I learning here?" How to fix it: this module is, deliberately, a final inspection station, not a new assembly line — this same lesson's analogy explains it precisely. All this capstone's technical content already exists, built and tested, in Modules 1 through 7; what this module adds is integration and closure, not new pieces.

Assuming that, because this is the last module, at some point Bedrock WILL get invoked for real, "to close with a bang" (an expectation about the narrative climax). What happens: someone, used to a course's final chapters "raising the stakes," expects M8.4 to break the rule that sustained this entire guide and execute a real bedrock:InvokeModel call. How to spot it: if your expectation for M8.4 is "we finally see Bedrock respond for real." How to fix it: reread this guide's DISENO.md approval warning at the top — "it is the ONLY guide in the ecosystem where NO real model inference ever runs", a decision declared since Module 1, lesson 2, and sustained with no exception down to this module's last line of code. This guide's "bang" isn't a real invocation — it's complete honesty, with not a single crack, from start to finish.

Treating this lesson's advance ledger as the final ledger, without reading lesson 5 (substituting a summary for the complete document). What happens: someone copies this lesson's list directly into a README or a presentation, without checking lesson 5's complete, sourced version. How to spot it: if your citation of "what stayed representative in this guide" includes no reference to a specific lesson in a previous module. How to fix it: this lesson's list is, deliberately, a preview with no exact sources — this same module's lesson 5 is the complete version, with each row's technical reason and originating lesson, the one that does serve as a defensible citation in front of a technical interviewer.


Exercises

Exercise 1 — Without looking at this lesson's table, recite from memory the seven pieces each previous module delivers to this capstone. Check your answer against this lesson's "What gets delivered" table.

See solution

M1 → ADR-001-llm-as-escalation-path.md + parse_manifest()/ManifestParseFailed. M2 → GENAI-COST-PROFILE.md. M3 → bedrock.tf + modules/bedrock-guardrail/ + BedrockManifestExtractorRole. M4 → the complete guardrail + pre_invoke_checks.py/post_invoke_checks.py/defense_in_depth_flow.py. M5 → bedrock-least-privilege.rego + signed handler.py. M6 → bedrock-budget.rego + ai_workload_tags. M7 → escalation_rate.py + the smoke test harness. If you named all seven without looking, you have a clear grip on the complete base this module is built on.

Exercise 2 — Using this lesson's analogy, explain why it would be a design mistake for this module to add an eighth new guardrail policy. A colleague asks why not use the capstone to "complete" the guardrail with something M4 left out.

See solution

A complete answer sounds roughly like this: "Because a factory's final inspection station doesn't weld new parts — its job is confirming the parts already installed work together, not expanding the product. If M8 added a new guardrail policy, it would stop being an integrating capstone and would, in effect, become a ninth build module disguised as a close — exactly the role confusion this same lesson names in its Common Mistakes. Any additional policy the guardrail needed would, correctly, be M4's work, not this module's."

Exercise 3 — Predict, before reading lesson 5, how many rows of the final ledger you'd expect to stay marked "representative." Based on this lesson's advance ledger, count the rows in the "REPRESENTATIVE" section above.

See solution

Six: any real invocation to bedrock:InvokeModel, the managed guardrail's real blocking, apply of a real Bedrock resource, real InvocationLatency/TimeToFirstToken, Infracost's dollar figure, and a real extraction's semantic quality. This module's lesson 5 confirms this same count, with each row's exact originating lesson — if your count came to six, you already have this guide's complete balance before even reaching that lesson.


Summary and next step

This lesson mapped the complete capstone: the seven pieces each previous module delivers, none missing, and the advance honesty ledger this module's lessons 3 through 5 confirm with evidence. No new concept enters this guide from here on — everything that follows is integration, walkthrough, and closure.

Before moving on you should be able to: name the seven inherited pieces without looking at the table; explain why this module doesn't invoke Bedrock for real, not even "to close with a bang"; and anticipate, unaided, the approximate count of representative versus executed pieces in the final ledger.

Lesson 2 reviews the system's complete architecture, with the two paths — deterministic and escalation — overlaid on the system inherited from the ecosystem's previous seven guides.

Resources

  1. genai-on-aws-production-guide/DISENO.md — the "Module 8" section and the complete approval verdict, the source for this guide's honesty accounting.
  2. This same course, Module 1, lesson 8 (08-project-andes-cargos-ai-workload-map.md) — ADR-001-llm-as-escalation-path.md, the document that governs every decision in this capstone.
  3. This same course, Module 4, lesson 8 and Module 7, lesson 8 — the two module-closing projects whose same honesty-ledger pattern this capstone reapplies, now at the scale of the complete guide.
  4. AWS — Amazon Bedrock — official overview of the service this entire guide operates around, without ever invoking it.