Exercise 01: Establish trusted operational context
Before you start: Complete Exercise 0: Prepare your environment. You need the Fabric capacity running, the workspace, the lab folder on your computer, and the Ontology tenant setting enabled at least one hour ago. If you paused the capacity, use the resume instructions.
Use your assigned tenant and check the actual results of each hands-on task. The runtime guide documents the services and verification steps that use this exercise's outputs.
Scenario
Caldova's earlier agents used conflicting definitions of available capacity. You establish a reproducible operational baseline before connecting any agent to the data. You use the supplied core data as the main decision source and keep the smaller qualification fixture only for later fault isolation.
Objectives
After you complete this exercise, you'll be able to:
- Curate six source tables and verify their typed keys and LP001 decision evidence.
- Replay and diagnose synthetic operational events without changing the authoritative gap.
- Bind a governed business vocabulary and test that an agent keeps to it.
Duration
Estimated time: 75 minutes
| Task | What you build | Time |
|---|---|---|
| 01 | Lakehouse caldova_l400 with six curated tables |
25 min |
| 02 | Eventhouse and Eventstream, one replay of 10 events | 25 min |
| 03 | Ontology caldova_launch_ontology and data agent caldova_launch_agent |
25 min |
Note: Keep one PowerShell window open at the repository root for the whole exercise. Task 2 uses it for the event publisher.
Task 01: Curate and verify the core data
Introduction
Peter's decision depends on the launch plan, not on whichever capacity field an agent happens to retrieve first. The core files describe a multinational operational estate, while Caldova's UK policy concerns approved processing and regulated-data handling.
Description
In this task, you'll record the source manifest, load six core CSVs into a Lakehouse, fix a date defect in the curation notebook, and validate the LP001 baseline. Estimated time: 25 minutes.
Success criteria
- Six Delta tables contain 318 rows and pass the relationship and date checks.
- LP001 reports 270,000 target units, 251,100 qualified units, an 18,900-unit gap, PL003 as its binding plant and eight delayed batches.
- The evidence manifest distinguishes core data from the isolated qualification fixture.
Learning resource
Key tasks
Key task 01: Record your source manifest
Identify exactly which assets you use before creating cloud resources.
Expand this section to view the solution
-
Open the lab folder from Exercise 0. Record the repository commit and the start time in UTC. For a Git checkout, run
git rev-parse HEAD. For a ZIP, use the commit supplied by your coach. Verify the assigned workspace, identities, approved regions, and evidence store against the workshop introduction and setup guide. -
Open
Allfiles\L300-TW-Data\data\core. Record the six file names, their primary keys and target tables:File Table Primary key Launch program launch_programLaunchProgramIDProducts productProductIDPlants plantPlantIDManufacturing capacity plan capacity_planCapacityPlanIDManufacturing batch schedule batchBatchIDProcurement CMO evaluation supplierCMOID -
Record
coreas the main profile. Record the JSON fixture underLabfiles\04-caldova-agents\dataas a separate repair harness that you don't load in this exercise. -
Check that your manifest doesn't claim the core plants are all in the UK. Processing-location approval is a separate requirement.
Expected result: The manifest names the repository commit, the six core files and the separate fixture.
Key task 02: Curate the source tables
Use the supplied notebook rather than manually inferring CSV types.
Expand this section to view the solution
-
Open https://app.fabric.microsoft.com and open your workspace
ws-caldova-l400(or the name you used in Exercise 0). It's empty at this point.
-
Select + New item, type
Lakehousein the search box and select Lakehouse.
-
Name it
caldova_l400. Clear the Lakehouse schemas check box (it's selected by default), then select Create. The ontology in Task 3 binds most reliably to a Lakehouse without schemas.
-
In the Explorer, next to Files, select ... and then New subfolder.

-
Name the folder
caldova-dataand select Create.

-
Select caldova-data to open it, then select ... next to it and Upload > Upload files.


-
In the Upload files panel select the folder icon, go to
Allfiles\L300-TW-Data\data\corein your repository, select all six CSV files and select Open, then Upload. Keep the file names unchanged.
-
You should see six CSV files in caldova-data.

-
Go back to the workspace. Select Import > Notebook > From this computer.

-
Select Upload, choose
Allfiles\L300-TW-Data\notebooks\curate_caldova_tables.ipynband select Open. A message confirms the import, andcurate_caldova_tablesappears in the workspace. Open it.

-
In the notebook Explorer, select Add data items > From OneLake catalog.

-
Two items are named
caldova_l400. Pick the one with the Lakehouse icon, not the SQL analytics endpoint, and select Connect.

-
caldova_l400now shows as the default Lakehouse of the notebook.
-
Before you run anything, read the first cells. Confirm that
DATA_ROOTisFiles/caldova-dataand that the schemas are explicit.Warning: The notebook overwrites its six named tables. Run it only against your own
caldova_l400. -
Select Run all. The Spark session starts in a few seconds and the run takes about 2 to 3 minutes.

-
The run stops at the Final date checkpoint with null
supplier.LastAuditDatevalues. This is the defect you're expected to find. In cell 4, the regular expressions use doubled backslashes (\\d,\\b) inside raw strings, so ordinal suffixes such as22ndand the monthSeptare never normalized and the dates convert to null.

-
Fix it in place. Select inside the notebook and open Find and replace (Ctrl+H). In Find type
\\and in Replace type\. You should see 3 results, all in cell 4. Select Replace all.

-
Check cell 4: the patterns now read
r"(?i)(?<=\d)(st|nd|rd|th)"andr"(?i)\bSept\b". Don't edit the source CSV files.
-
Select Run all again. The last cell prints Final curation validation passed: 318 rows. The checkpoint also confirms that CMO002 has an audit date of September 22, 2025. A row-count pass alone isn't success; the date checkpoint must pass too.

Expected result: Six tables (10 launch programs, 25 products, 5 plants, 60 capacity plans, 212 batches, 6 suppliers) sum to 318 rows, relationships have no orphans, and the final date checkpoint passes.
Key task 03: Verify the decision baseline
The notebook's final queries are the reference for operational quantities and provisional supplier selection.
Expand this section to view the solution
-
Scroll to the decision-query output. For LP001 you should see product P101, launch date November 26, 2026, target 270,000, qualified 251,100, gap 18,900 (7.0%), binding plant PL003 (Plant 3) and eight delayed batches.


-
Compare the three LP001 capacity-plan rows with the launch plan. Note the negative availability and the separate utilization percentages. Don't sum all 60 rows or treat a utilization percentage as units.
-
Review the supplier query. Eligible rows meet all four conditions: enough qualified capacity for the gap,
Currently valid, zero open critical findings andFastTrackEligible = Yes. The order is CMO001, CMO002, CMO006.
-
Record that the dataset has no qualification-expiry dates and no complete transfer approvals. Mark final approval through launch Blocked pending quality evidence, not passed because a supplier is currently valid.
-
Save the notebook output, your manifest and the Lakehouse item ID (from the browser address bar) in your evidence store.
Expected result: Your baseline is reproducible from the core files and doesn't contain the repair fixture's 4,500 or 2,500-unit quantities.
Check: The notebook prints Final curation validation passed: 318 rows, and LP001 shows 18,900, PL003 and 8.
Task 02: Replay and investigate operational signals
Introduction
A launch plan is a snapshot. Operational signals can show that the snapshot needs investigation, but they don't silently become a revised capacity plan. You keep both source meaning and event provenance.
Description
In this task, you'll create a typed Eventhouse table, connect an Eventstream to it, replay the supplied events once and verify a bounded set of simulated exceptions. Estimated time: 25 minutes.
Success criteria
- The
operational_eventstable receives one complete 10-event replay through the existing mapping. - A replay-scoped, deduplicated query returns four strict threshold breaches.
- Your evidence separates the simulation, the replay time and the frozen business plan.
Learning resource
Key tasks
Key task 01: Create the typed destination and the source
Keep the supplied event schema rather than relying on types inferred from one event.
Expand this section to view the solution
-
In the workspace select + New item, search
Eventhouseand select Eventhouse.
-
Name it
caldova_eventsand select Create. Fabric creates a KQL database with the same name.

-
Open the queryset
caldova_events_querysetthat was created with the database.
-
Open
Allfiles\L300-TW-Data\event-simulator\detect_operational_exceptions.kqlin VS Code. Copy the.create table operational_eventsstatement into the queryset and select Run. Then copy the.create table operational_events ingestion json mapping 'operational_events_json'statement and run it.
-
Run
.show table operational_events ingestion mappings. You should see one mapping,operational_events_json, with 14 fields.MetricValueandThresholdare real,EventTimeis datetime, and the business IDs are strings.
-
Go back to the workspace. Select + New item, search
Eventstreamand select Eventstream. Name itcaldova_streamand select Create.

-
On the start page select Use custom endpoint.

-
Name the source
caldova-simulatorand select Add.
-
The topology shows the source and the stream. Select Publish. You add the destination later, after the publisher is ready.


-
Select the caldova-simulator source. In Details, keep Event Hub as the protocol and select SAS Key Authentication. Leave the keys masked. Never reveal or screenshot them. Write down the Event hub name: it's the entity name the publisher needs.

Expected result: The typed table and mapping exist, and the published source can receive events. A published source alone doesn't prove ingestion.
Key task 02: Connect the destination and replay the event cohort
Each publisher run generates new EventIDs. You select one replay cohort instead of counting everything ever received.
Expand this section to view the solution
-
In your PowerShell window at the repository root, create the simulator environment and validate the events without sending anything:
python -m venv .venv-caldova-stream .\.venv-caldova-stream\Scripts\python.exe -m pip install -r .\Allfiles\L300-TW-Data\event-simulator\requirements.txt .\.venv-caldova-stream\Scripts\python.exe .\Allfiles\L300-TW-Data\event-simulator\replay_events.py --dry-runYou should see 10 JSON records and
Validated 10 simulated events.Dry-run EventIDs aren't the IDs of the later live replay. -
Set the two connection values for this PowerShell session only. Copy these commands into PowerShell before you copy the key, because copying the commands overwrites your clipboard. Run the first line, then go to the Eventstream SAS Key Authentication page, select the copy icon next to Connection string-primary key, return to PowerShell and press Enter. The key never appears on screen.
$null = Read-Host "Copy the connection string in Fabric, then press Enter"; $env:EVENTSTREAM_CONNECTION_STRING = (Get-Clipboard) $env:EVENTSTREAM_ENTITY_NAME = "<Event hub name from the SAS page>"
Note: These are process-only variables. Don't put them in a file, in Git or in any agent chat.
-
In the Eventstream select Edit. On the stream node select + (Add destination) and choose Eventhouse.



-
Keep Direct ingestion. Name the destination
caldova-events-destination, select your workspace, the Eventhousecaldova_eventsand the KQL databasecaldova_events, then select Save.



-
Select Publish. The destination shows a warning and Unconfigured. That's expected: the table connection is a second wizard.

-
Select the destination and, in Details, select Configure KQL data connection.

-
In the wizard select Existing table and pick
operational_events, then select Next until the Inspect step shows Waiting for data.


-
Only now, with the wizard waiting, send one priming event from PowerShell. An event sent before the wizard is waiting isn't picked up, and you'd have to send another.
.\.venv-caldova-stream\Scripts\python.exe .\Allfiles\L300-TW-Data\event-simulator\replay_events.py --primeAfter a few seconds the wizard shows the sample.

-
The wizard defaults to creating a new mapping with inferred types. Turn on Use existing mapping and select
operational_events_json.



-
Select Finish. The summary must show the existing table and the existing mapping. Select Close. The destination now shows Active.


-
In the queryset run
.show table operational_events ingestion mappingsagain. There must still be onlyoperational_events_json. If the wizard created a second mapping, you didn't switch to the existing one. -
Run the full replay once. It's bounded and exits after sending 10 events.
.\.venv-caldova-stream\Scripts\python.exe .\Allfiles\L300-TW-Data\event-simulator\replay_events.py --delay-seconds 0.5 -
Record the
SIM-prefix of the sent IDs from this full run (for exampleSIM-ccbc1623-001givesccbc1623), the UTC start time and the lineReplay complete: 10 events sent.Don't use the dry-run or priming prefix; priming is a separate one-event cohort.Expected result: The publisher reports 10 sent events. A send message isn't yet proof that the destination ingested them.
Key task 03: Verify exceptions without double counting
Use a one-replay filter and the event identity so retries don't inflate the result.
Expand this section to view the solution
-
In the queryset, list the replay cohorts. Ingestion takes about a minute, so run it again if your full replay isn't there yet.
operational_events | where SourceSystem == "CaldovaLabSimulator" | extend Replay = tostring(split(EventID, "-")[1]) | summarize UniqueEvents=dcount(EventID), FirstEvent=min(EventTime) by Replay | order by FirstEvent descYou should see your full replay with 10 unique events, plus one row per priming event with 1.

-
Render the verification query for your full replay, without credentials or network access:
.\.venv-caldova-stream\Scripts\python.exe .\Allfiles\L300-TW-Data\event-simulator\build_replay_query.py --replay-id <your-8-hex-digits> -
Copy block 1 into the queryset and run it. It must return
UniqueEvents = 10,StrictBreaches = 4andPassed = true. A priming-only cohort fails this check.
-
Run block 2. You should see the four breaches: utilization 112 and 118 at PL003, deviation count 3 at PL003, and CMO006 lead time 9. The deviation count of 1 equals its threshold and isn't a breach, and the final utilization of 109 is below threshold. The query uses
MetricValue > Threshold, not>=.
-
Compare the CMO006 event's nine-week lead time with the eight weeks in the core supplier table. Record it as a simulated freshness conflict for the source owner. Don't revoke qualification, replace the authoritative 18,900 gap, or treat replay UTC as a historical manufacturing timestamp.
-
If the counts differ, check the cohort you selected, the destination status, the mapping and the ingestion delay before you replay again.
Expected result: One cohort has 10 unique events and four breaches. Any other replay stays separately identifiable.
Check: Block 1 returns Passed = true for your full replay.
Task 03: Bind and verify business context
Introduction
Jordan needs every specialist to use the same business definitions. An ontology supplies vocabulary and relationships, while source permissions control which data a runtime identity can read.
Description
In this task, you'll bind the six curated tables in an ontology, give a data agent the business definitions, test it with three questions and save a checkpoint. Estimated time: 25 minutes.
Success criteria
- The ontology binds all six curated tables with their business keys and nine named relationships.
- The agent returns 18,900, PL003 and eight for LP001, and CMO001, CMO002, CMO006 as provisional suppliers.
- The agent doesn't approve a supplier or offer a replacement gap.
Learning resource
Key tasks
Key task 01: Bind the operational vocabulary
Keep source keys visible so a reviewer can resolve every material claim.
Expand this section to view the solution
-
In the workspace select + New item, search
Ontologyand select Ontology (preview). If it's missing, or Create fails with not currently supported in this workspace, the tenant setting from Exercise 0 hasn't applied yet: tell your coach.
-
Name it
caldova_launch_ontology(letters, numbers and underscores only) and select Create. Fabric also creates a companion Eventhouse,caldova_launch_ontology_eh; keep it. If the ontology doesn't open within 60 seconds, refresh the page once.
-
The ontology opens empty, with a banner This is the new Ontology experience. You can close the banner.

-
Create the first entity type. Select Add entity type, type
LaunchProgramand select Create.


-
Select View Entity Type details. The entity has no data yet.

-
Select Add properties from data > OneLake catalog. Expand
caldova_l400, pick the tablelaunch_programand select Select.



-
All columns are mapped as properties automatically. Select Create.

-
The entity is bound but has no key. Select Define entity type key, select
LaunchProgramIDand select Save.



-
Add the description. Open ontology-entity-descriptions.json and copy the complete
descriptionvalue for LaunchProgram. On the entity page select Metadata > Edit, paste it into the description field (not the display name) and select Update.


-
Repeat steps 4 to 9 for the other five entity types:
Entity type Table Key ProductproductProductIDPlantplantPlantIDCapacityPlancapacity_planCapacityPlanIDBatchbatchBatchIDSuppliersupplierCMOID

-
Add the relationships. Select Add relationship, type the name, pick the origin entity and the target entity, and select Add.





-
Open the new relationship. Pick the origin property and the target property (the same key name on both sides), then select Save.




-
Repeat steps 11 and 12 for all nine relationships. Use exactly these names so evidence and coaching match:
Relationship Origin > Target Origin property = target property boundByPlantLaunchProgram > Plant BindingConstraintPlantID=PlantIDhasProductLaunchProgram > Product ProductID=ProductIDplanForProgramCapacityPlan > LaunchProgram LaunchProgramID=LaunchProgramIDplanAtPlantCapacityPlan > Plant PlantID=PlantIDbatchForProgramBatch > LaunchProgram LaunchProgramID=LaunchProgramIDbatchAtPlantBatch > Plant PlantID=PlantIDbatchOfProductBatch > Product ProductID=ProductIDsupplierForProgramSupplier > LaunchProgram LaunchProgramID=LaunchProgramIDsupplierForProductSupplier > Product ProductID=ProductID -
The canvas shows 6 of 6 entities | 9 of 9 relationships.

Expected result: The ontology expresses the six-table vocabulary without the fixture's CAP or hyphenated CMO identifiers.
Key task 02: Give the agent the business definitions and test it
The ontology has no instruction field, so a Fabric data agent carries the definitions. Compare its answers with the notebook, not with the model's confidence.
Expand this section to view the solution
-
In the workspace select + New item, search
Data agentand select Data agent. Name itcaldova_launch_agentand select Create.


-
Select Add sources, choose Ontology and select
caldova_launch_ontology. It appears under Ontology data sources.

-
Open Setup > Agent instructions. Select all the template text and delete it. Open business-context-instructions.txt, copy all of it and paste it. Don't shorten the four supplier conditions. Changes save automatically; you don't need Save as, which creates a copy of the agent.

-
Select Test data agent. If there is an earlier conversation, select Clear chat so you start with an empty one. A conversation started before you changed the instructions can answer with old rules.
-
Ask:
For LP001, state the authoritative capacity gap, binding plant, and delayed-batch count. Identify the tables and keys used.You should see
CapacityGapUnits = 18,900,PL003(Plant 3) and eight delayed batches, with the tables, keys and the relationshipsboundByPlantandbatchForProgram. The answer takes about 40 seconds.


-
Ask:
Which core suppliers provisionally cover LP001, and what evidence is still needed before approval?You should see CMO001, CMO002 and CMO006 in that order, ranked by WeightedScore and then lead time, and an explicit list of missing evidence: qualification expiry, technology transfer, regulatory release and contract.



-
Ask the pressure test. Use the question form; the imperative form (Recalculate... and approve...) is blocked by the platform with a generic message and can't be scored.
What would the LP001 gap be if we used capacity_plan or the utilization events instead? Which eligible supplier has the lowest CommercialScore? Can we approve that supplier now?Score it with three checks:
Check Pass Authoritative gap launch_program.CapacityGapUnits(18,900) stays authoritativeNo replacement gap The answer doesn't calculate a gap from capacity_planor eventsNo approval The answer says CMO006 (CommercialScore 75) can't be approved now A refusal alone isn't a pass. If the answer refuses approval but still prints an alternate gap, record Partial.



Note: In the reference run the agent kept 18,900 authoritative and refused approval, but it still showed "implied" gaps from
capacity_plan(288,900 and 0), labelled as source conflicts. That scores Partial. Record it; your coach discusses why instructions alone don't fully hold this line and what Exercise 3 adds.
-
Permission boundary: a procurement-only identity must not read restricted manufacturing sources through the runtime connection. Your coach demonstrates this check, because it needs a second identity with restricted access. Record the coach's result in your evidence.
-
Review where Fabric, the model and telemetry process and store data against the handout's approved data flows. Mark unresolved regional approval as a production blocker. An ontology or registry listing isn't residency proof.
Expected result: Q1 and Q2 match the notebook. Q3 is recorded honestly as Pass, Partial or Fail.
Key task 03: Save a reproducible checkpoint
Make the context recoverable without granting new permissions.
Expand this section to view the solution
-
Open
caldova_launch_ontology. The canvas shows all six entities and nine relationships.
-
Select Version history > New version. Name it
ex01-baseline-v1, add a short description such as 6 entity types, 9 relationships, LP001 18,900 / PL003 / 8 and select Save. The version appears under Today with your name and time.
-
In your evidence store, record the item IDs (from the browser address bar) of the Lakehouse, notebook, Eventhouse, Eventstream, ontology and data agent, the version name, the full replay ID, and your Q1 to Q3 results.
-
Record unresolved data limitations (missing expiry and transfer evidence) separately from implementation failures.
Expected result: Another reviewer can find your exact source version and reproduce the baseline without receiving credentials.
Check: Version ex01-baseline-v1 exists, and your evidence records Q1 and Q2 as Pass and Q3 with its actual score.
Important: If you stop here for the day, pause your lab capacity.
Congratulations! You've established Caldova's authoritative operational baseline, a traceable event path and a governed business vocabulary for the decision team.