# Set up for Unit 23: what you can try without a tenant, and Calder's AI landscape file

> Know which Joule and AI platform pieces you can try for free in November 2026, then create the Calder landscape file and check Unit 23 uses.

- Course: Orchestrate, Unit 23 · Joule and the AI platform: the architect's view
- Page: https://erpfde.com/topics/set-up-for-unit-23/
- Updated: 2026-11-30
- Reading time: Foundational 7 min, Deep 25 min

Independent learning resource. Not affiliated with, sponsored by or endorsed by SAP SE. SAP and other SAP products mentioned are trademarks of SAP SE in Germany and other countries.

## Foundational layer

### The 60-second version

Unit 23 looks at Joule and SAP's AI foundation the way an architect does: how they are activated, secured, governed and paid for across a landscape. The builder's view (writing prompts, agents and code) stays in Units 3, 8 and 14.

Most of the unit is reading and design. That suits the subject, because **Joule itself has no public trial**. Every SAP page read for this setup on 28 November 2026 ties Joule to a customer's own cloud subscription and an enterprise BTP account.

Three things can still be tried for free, each for 30 days:

- the **generative AI hub basic trial**, the AI platform under Joule and the course's agents;
- the **SAP Build basic trial**, whose workbooks include building an agent in Joule Studio, classic edition;
- your **BTP trial** from Unit 21, for the account side.

The rest of the setup is one file: a description of Calder Pumpworks' AI landscape that every Unit 23 exercise reads and extends, with a small script that checks it. Setup takes 15 to 30 minutes and costs nothing.

### Why it matters to the business

Joule looks like a chat window, but switching it on touches the identity setup, the BTP account structure and every SAP cloud product it connects to. A decision made in a hurry for one product (a new identity tenant, a Joule instance in the wrong subaccount) can block the next product, or split users into two assistants.

Calder Pumpworks, the course's fictional pump maker, has the usual mix: SAP S/4HANA for `CP10`, SuccessFactors for HR, Concur for expenses, and ECC in Augsburg until the July 2027 rollout. The landscape file in this setup puts those pieces on one page, so each Unit 23 topic can ask "what does this decision change?" against the same picture.

Doing this on paper first is also cheaper. A pilot tenant costs money and time to provision; a design that fails a review costs an afternoon.

### How SAP does it

As of 28 November 2026, SAP's own pages describe these entry points:

| Entry point | What you get | Who | Cost and limits |
| --- | --- | --- | --- |
| [Generative AI hub trial](https://www.sap.com/products/artificial-intelligence/generative-ai-hub-trial.html) | SAP AI Core and SAP AI Launchpad with a guided workbook (models, orchestration, document grounding) | Anyone who registers | No charge, 30 days; prompt optimization not included |
| [SAP Build trial](https://www.sap.com/products/technology-platform/build/trial.html) | A shared tenant with sample data; one workbook builds a custom agent in Joule Studio, classic edition | Anyone who registers | No charge, 30 days; a subset of features, nothing goes to production |
| [BTP trial](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/trial-accounts-and-free-tier-046f127.md) (Unit 21) | Account structure, and a trial tenant of SAP Cloud Identity Services | Anyone | Free, 90 days, personal use only |
| [Joule in the BTP cockpit](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/enable-joule-in-the-cockpit-8232891.md) | Joule for BTP administration questions | Enterprise (non-trial) global accounts | Free of charge, BTP administration only |
| [Joule Base](https://www.sap.com/products/artificial-intelligence/joule-base.html) | Joule's base capabilities in SAP cloud products | Customers with a cloud subscription that integrates with Joule | Ordered in the SAP Store; confirm the terms there |

No page we read offers a self-service Joule trial. SAP's Joule for Consultants lesson says outright that ["no free trial is available"](https://learning.sap.com/courses/introducing-sap-joule-for-consultants/evaluating-prerequisites-for-activation) for that product. Partners get a non-productive test tenant, according to the Joule Base page.

> **Note** **For functional consultants:** nothing in your configuration changes in this setup. The landscape file does show which systems Joule would connect to and which identity tenant each uses. That tells you early which test system a Joule pilot will run against, and that its users must exist in the matching identity tenant.

### What this unit adds

| Item | What it is | Cost | Used in |
| --- | --- | --- | --- |
| `unit23/ai_landscape.py` | Writes Calder's landscape file and checks it against eight placement rules | Free | Every Unit 23 topic |
| `unit23/calder_ai_landscape.json` | Calder's identity tenants, subaccounts, products, Joule instances, AI Core instances and agents | Free | Activation, security, Agent Hub, AI Core and commercial topics |
| `check_unit23.py` | Checks the files and counts down any trials you start | Free | Before every Unit 23 topic |
| Generative AI hub trial (optional) | Hands-on look at the platform under Joule | Free, 30 days | AI Core and generative AI hub topics |
| SAP Build trial (optional) | Hands-on look at Joule Studio, classic edition | Free, 30 days | [Joule Studio architecture](https://erpfde.com/topics/joule-studio-architecture/) |

Nothing new to install. Your BTP trial and the btp CLI from [Set up for Unit 21](https://erpfde.com/topics/set-up-for-unit-21/) are enough for the account side.

### Time and money

- **Time:** 15 to 30 minutes for the files and the check. Each optional trial adds 15 to 30 minutes of registration.
- **Money:** nothing. Both trials are free; SAP's pages ask for no payment for them.
- **Clocks:** both trials last 30 days from registration. If you already used the generative AI hub trial in Unit 3, don't register again just for this unit; the reading topics don't need it.

### Questions to ask

Ask IT or your SAP account team before planning a Joule pilot:

- Which of our SAP cloud subscriptions include Joule's base capabilities, and has anyone ordered Joule Base in the SAP Store?
- Which BTP global account would Joule use? SAP advises the central one, not a line-of-business account.
- How many SAP Cloud Identity Services tenants do we have, and which tier (production or non-production) is each?
- Has a global account administrator enabled Joule in the BTP cockpit, and accepted the generative AI terms?
- Are we a partner with access to SAP's non-productive Joule test tenant?

### Common misconceptions

- **"There must be a Joule trial somewhere."** None was found on SAP's pages on 28 November 2026. You can try the platform under Joule and Joule Studio classic, not Joule in a business application.
- **"Joule is free, so it needs no planning."** Base capabilities come with eligible cloud subscriptions, but activation still needs an enterprise BTP account, identity services and Work Zone set up correctly.
- **"The SAP Build trial shows the new Joule Studio."** Its workbook names Joule Studio, classic edition, and runs on a shared tenant with sample data.
- **"A trial is a safe pilot."** Trials are for personal, non-productive use. Real data and team pilots belong in an enterprise account.
- **"Each product gets its own Joule."** SAP's guidance is one Joule instance shared across products, with one identity tenant per landscape tier.

### Key terms

- **Joule Base:** SAP's name for the base set of Joule capabilities included with eligible SAP cloud subscriptions.
- **Joule instance:** a Joule subscription in one BTP subaccount, shared by the SAP products connected to it.
- **SAP Cloud Identity Services:** SAP's identity offering (Identity Authentication and Identity Provisioning) that Joule relies on for trust between products.
- **Landscape tier:** production or non-production; SAP asks for one identity tenant per tier.
- **Generative AI hub:** the part of SAP AI Core and SAP AI Launchpad that gives access to models, orchestration and grounding.
- **Basic trial:** SAP's 30-day, no-charge hands-on environment for a product, with guided workbooks.

### Check yourself

1. A Calder director asks for a free Joule trial to show the board next week. What is the accurate answer?
   - A. Sign up for the Joule trial on sap.com and connect it to S/4HANA
   - B. There is no Joule trial; try the AI platform trial instead
   - C. Use the BTP trial, which already includes Joule in S/4HANA screens
   - D. Ask SAP to extend the BTP trial so it includes Joule Premium

   Answer: B. SAP's pages read for this setup offer no self-service Joule trial; Joule ties to a customer's cloud subscription and an enterprise BTP account. The generative AI hub and SAP Build trials let people try the platform under Joule and Joule Studio, classic edition, instead.

2. Why does Unit 23 start with a landscape file rather than a tenant?
   - A. The file replaces the need ever to provision a real tenant
   - B. SAP requires a landscape file before it will activate Joule
   - C. Placement mistakes are cheap to fix on paper and costly in a tenant
   - D. The file lets Joule run locally on a learner's laptop for tests

   Answer: C. Activating Joule touches identity, the account structure and every connected product. Checking a design on paper first costs an afternoon; fixing a wrong identity tenant or subaccount in a live landscape costs far more.

3. Calder plans a second identity tenant just for the HR team's Joule. What risk should the architect raise?
   - A. HR data would leave the United States without consent
   - B. Users would be split across separate Joule instances
   - C. The second tenant would double the cost of every AI Unit
   - D. SuccessFactors cannot use SAP Cloud Identity Services

   Answer: B. SAP's guidance for a unified Joule is one identity tenant per landscape tier. Different tenants produce separate Joule instances, so people who use both HR and S/4HANA would meet two assistants.

4. What can a global account administrator enable in the BTP cockpit at no charge?
   - A. Joule Premium for every SAP product in the global account
   - B. The generative AI hub with unlimited model calls for a year
   - C. Joule in S/4HANA for all users who sign in to BTP
   - D. Joule for BTP administration questions in the cockpit

   Answer: D. SAP's BTP documentation says this version of Joule is free in non-trial global accounts and limited to BTP administration in the cockpit. It does not switch on Joule in business applications.

5. Which question belongs on the list for IT before a Joule pilot?
   - A. Which BTP global account Joule would use, and its admin
   - B. Which large language model Joule should be retrained on
   - C. Whether learners may store Calder data in the SAP Build trial
   - D. How to copy the BTP trial into the production global account

   Answer: A. Joule is activated in a chosen global account, and SAP advises the central one. The other options misread the setup: Joule isn't retrained by customers, trials are for non-productive use, and a trial can't be copied into production.

## Deep layer

### Mental model: the assistant sits on four pillars

SAP Learning describes Joule's architecture as [four pillars](https://learning.sap.com/courses/introducing-joule/identifying-technical-prerequisites-and-architecture): SAP BTP hosts Joule, SAP Build Work Zone handles navigation and content, SAP Cloud Identity Services carries trust and identity, and a supported SAP application supplies the business data. Under the agents and models sits SAP AI Core with the generative AI hub.

A learner can reach some pillars without a customer, and not others. That is the shape of this setup:

```mermaid
flowchart TB
  subgraph Customer only
    J[Joule instance] --> APP[S/4HANA, SuccessFactors...]
  end
  subgraph Free to try
    BTP[BTP trial<br/>accounts, identity trial tenant]
    GAH[Generative AI hub trial<br/>AI Core, AI Launchpad]
    JS[SAP Build trial<br/>Joule Studio classic]
  end
  J --- WZ[Work Zone]
  J --- IAS[Cloud Identity Services]
  BTP -.same concepts.-> IAS
  GAH -.platform under.-> J
  JS -.builds for.-> J
  F[calder_ai_landscape.json] -->|describes| J
```

The pillars you can't touch, you describe. The landscape file is that description, and the script checks it against the placement rules SAP documents.

### How it works

#### What SAP's pages say about placement

These rules come from the pages read on 28 November 2026. They are what `ai_landscape.py` checks.

| Rule | Source | Checked as |
| --- | --- | --- |
| Joule needs an enterprise global account | [Introducing Joule](https://learning.sap.com/courses/introducing-joule/identifying-technical-prerequisites-and-architecture), [Joule in the cockpit](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/enable-joule-in-the-cockpit-8232891.md) | `L01` |
| One identity tenant per landscape tier | [Unified Joule instance](https://learning.sap.com/courses/setting-up-joule-across-your-organizational-system-landscapes/setting-up-a-unified-joule-instance) | `L02`, `L04` |
| The Joule subscription and the Work Zone subscription in the same subaccount | Introducing Joule | `L03` |
| The generative AI hub needs SAP AI Core's extended plan | [AI Core service plans](https://github.com/SAP-docs/sap-artificial-intelligence/blob/main/docs/sap-ai-core/service-plans-c7244c6.md) | `L07` |

Three more rules are course rules, not SAP's: a production Joule instance lives in a subaccount staged `Prod` and a non-production one never does (`L05`); every product has a Joule path or a written reason for none (`L06`); every agent has an 8-digit owner and a known home (`L08`).

SAP Learning also says the Joule application entitlement is the **foundation** plan (technical name `das-application`), and that Work Zone can be the foundation or standard plan. The [unified instance lesson](https://learning.sap.com/courses/setting-up-joule-across-your-organizational-system-landscapes/setting-up-a-unified-joule-instance) allows one Work Zone edition per Joule instance. The file records the edition so [the activation topic](https://erpfde.com/topics/activating-joule-across-products/) can use it.

#### What the free trials cover

The **generative AI hub basic trial** gives a login with SAP AI Core and SAP AI Launchpad and a workbook on models, orchestration and document grounding. SAP's [tutorial](https://developers.sap.com/tutorials/teched2025-genaihub-basic-trial.html) says the account lasts 30 days from registration. It is the same trial [Set up for Unit 3](https://erpfde.com/topics/set-up-for-unit-03/) uses; SAP AI Core's former free plan is gone.

The **SAP Build basic trial** runs on a shared tenant with sample data. Its workbook list includes "Create a custom AI agent in Joule Studio, classic edition", and SAP says skills built there can't be deployed to production. For the new Joule Studio, see [Joule and Joule Studio](https://erpfde.com/topics/joule-and-joule-studio/); the Unit 23 Joule Studio topic covers its architecture.

#### The landscape file

> **Note** There is nothing to download. The script you create in [Step 2](#d-step-2-create-the-landscape-script) below writes this file as `unit23/calder_ai_landscape.json` when you run it with `--init`.

`calder_ai_landscape.json` has six sections. Every value is a course label.

| Section | Holds | Read by |
| --- | --- | --- |
| `identity_tenants` | `calder-ias` (production), `calder-ias-test` (non-production) | Activation and security topics |
| `subaccounts` | `calder-ai-dev`, `calder-ai-test`, `calder-ai-prod` in `us10`, from the [account model](https://erpfde.com/topics/btp-account-model/) | Every topic |
| `products` | `S4P` and `S4Q` (S/4HANA for `CP10`), `SF-EC` (SuccessFactors), `ECP` (ECC for `CP20`, no Joule) | Activation, embedded AI topics |
| `joule_instances` | `joule-prod` and `joule-nonprod`, each with its Work Zone and products | Activation, security, grounding topics |
| `ai_core_instances` | `calder-aicore`, `calder-aicore-qa` (extended plan) | AI Core, generative AI hub, cost topics |
| `agents` | `AGT_INV_TRIAGE`, `AGT_ORDER_EXC`, `AGT_SUPPLY_WATCH` with owners and homes | Agent catalogue and Agent Hub topics |

### Build it yourself: Calder's AI landscape file and the Unit 23 check

You will write a script that creates Calder's landscape file, review it, try one deliberate mistake, and run the Unit 23 check. Optionally you will register for one or both trials. Steps 1 to 5 need no account.

```mermaid
flowchart LR
  A[ai_landscape.py --init] --> B[calder_ai_landscape.json]
  B --> C[ai_landscape.py review]
  C --> D[check_unit23.py]
  E[trial dates in .env] --> D
```

**Before you start:** complete [Set up your computer for this course](https://erpfde.com/topics/set-up-your-computer/) and, for the account side, [Set up for Unit 21](https://erpfde.com/topics/set-up-for-unit-21/). This walkthrough doesn't repeat those steps.

> **Note** New words. **JSON** is a text format for structured data, with names in quotes and values after a colon. An **exit code** is a number a program returns when it ends; 0 means success. An **identity tenant** is your company's own instance of SAP Cloud Identity Services.

#### What you need

- Your course folder `orchestrate-course` with its `.venv` from the computer setup.
- About 15 to 30 minutes. Everything is free.
- Optional: an email address for the two SAP trials (Step 6).

#### Step 1: Open your course folder and turn on the virtual environment

1. Open VS Code, choose **File > Open Folder**, and open `orchestrate-course`.
2. Open a terminal: **Terminal > New Terminal**.
3. If the prompt doesn't start with `(.venv)`, turn it on:

   - **Windows (PowerShell):**

     ```powershell
     .venv\Scripts\Activate.ps1
     ```

   - **macOS / Linux:**

     ```bash
     source .venv/bin/activate
     ```

4. Create the folder for this unit:

   ```bash
   mkdir unit23
   ```

Run every command from the course folder.

#### Step 2: Create the landscape script

1. In VS Code, create `unit23/ai_landscape.py`, paste the code below and save:

```python
"""Calder's AI landscape file for Unit 23, and a review of it against placement rules.

Run from your course folder:
    python unit23/ai_landscape.py --init     # write unit23/calder_ai_landscape.json (the sample)
    python unit23/ai_landscape.py            # review the file and print one line per check
    python unit23/ai_landscape.py --json     # the same review as JSON, for later topics' scripts

Built-in Python only, no randomness, no account. Calder Pumpworks is fictional; every name,
number and rule marked "course" is a course label. Rules marked "SAP" restate what SAP Learning
and SAP's BTP documentation said when this topic was written (2026-11-28).
Exit code 0 when nothing fails, 2 when a check fails.
"""
import argparse
import json
import pathlib
import re
import sys

HERE = pathlib.Path(__file__).resolve().parent
LANDSCAPE = HERE / "calder_ai_landscape.json"

SAMPLE = {
    "as_of": "2026-11-28",
    "note": "Calder Pumpworks is fictional. Names, IDs and tiers are course labels.",
    "global_account": {"name": "Calder Pumpworks", "type": "enterprise", "default_region": "us10"},
    "identity_tenants": [
        {"id": "calder-ias", "tier": "production"},
        {"id": "calder-ias-test", "tier": "non-production"},
    ],
    "subaccounts": [
        {"id": "calder-ai-dev", "directory": "AI and agents", "stage": "Dev", "region": "us10"},
        {"id": "calder-ai-test", "directory": "AI and agents", "stage": "Test", "region": "us10"},
        {"id": "calder-ai-prod", "directory": "AI and agents", "stage": "Prod", "region": "us10"},
    ],
    "products": [
        {"id": "S4P", "product": "SAP S/4HANA Cloud Private Edition", "company_code": "CP10",
         "tier": "production", "identity_tenant": "calder-ias", "joule": "candidate"},
        {"id": "S4Q", "product": "SAP S/4HANA Cloud Private Edition", "company_code": "CP10",
         "tier": "non-production", "identity_tenant": "calder-ias-test", "joule": "candidate"},
        {"id": "SF-EC", "product": "SAP SuccessFactors Employee Central", "company_code": "CP10",
         "tier": "production", "identity_tenant": "calder-ias", "joule": "candidate"},
        {"id": "ECP", "product": "SAP ECC 6.0 (on-premise)", "company_code": "CP20",
         "tier": "production", "identity_tenant": "", "joule": "none",
         "reason": "On-premise ECC until the July 2027 rollout; Unit 12 covers AI on ECC"},
    ],
    "joule_instances": [
        {"id": "joule-prod", "subaccount": "calder-ai-prod", "tier": "production",
         "identity_tenant": "calder-ias",
         "work_zone": {"subaccount": "calder-ai-prod", "edition": "standard"},
         "products": ["S4P", "SF-EC"]},
        {"id": "joule-nonprod", "subaccount": "calder-ai-test", "tier": "non-production",
         "identity_tenant": "calder-ias-test",
         "work_zone": {"subaccount": "calder-ai-test", "edition": "standard"},
         "products": ["S4Q"]},
    ],
    "ai_core_instances": [
        {"id": "calder-aicore", "subaccount": "calder-ai-prod", "plan": "extended",
         "generative_ai": True},
        {"id": "calder-aicore-qa", "subaccount": "calder-ai-test", "plan": "extended",
         "generative_ai": True},
    ],
    "agents": [
        {"id": "AGT_INV_TRIAGE", "owner": "00100244", "home": "joule-studio"},
        {"id": "AGT_ORDER_EXC", "owner": "00100296", "home": "joule-studio"},
        {"id": "AGT_SUPPLY_WATCH", "owner": "00100153", "home": "btp-custom"},
    ],
}

HOMES = {"joule-studio", "btp-custom", "hyperscaler", "third-party", "delivered"}


def review(data: dict) -> list:
    """Return a list of (status, rule, message). Status is OK, WARN or FAIL."""
    out = []
    subs = {s["id"]: s for s in data.get("subaccounts", [])}
    tenants = {t["id"]: t for t in data.get("identity_tenants", [])}
    products = {p["id"]: p for p in data.get("products", [])}

    # L01 (SAP): Joule needs an enterprise global account, not a trial.
    kind = data.get("global_account", {}).get("type", "")
    out.append(("OK" if kind == "enterprise" else "FAIL", "L01",
                f"global account type is '{kind or 'missing'}' (Joule needs an enterprise account)"))

    # L02 (SAP): one identity tenant per tier.
    for tier in ("production", "non-production"):
        ids = [t for t, v in tenants.items() if v.get("tier") == tier]
        status = "OK" if len(ids) == 1 else "FAIL"
        out.append((status, "L02", f"{tier}: {len(ids)} identity tenant(s) {ids}; SAP asks for one per tier"))

    for inst in data.get("joule_instances", []):
        name = inst["id"]
        # L03 (SAP): Work Zone in the same subaccount as the Joule subscription.
        wz = inst.get("work_zone", {})
        same = wz.get("subaccount") == inst.get("subaccount")
        out.append(("OK" if same else "FAIL", "L03",
                    f"{name}: Joule in {inst.get('subaccount')}, Work Zone in {wz.get('subaccount')}"))
        # L04 (SAP): the instance uses its tier's tenant, and so does every product on it.
        tenant = tenants.get(inst.get("identity_tenant"), {})
        wrong = [p for p in inst.get("products", [])
                 if products.get(p, {}).get("identity_tenant") != inst.get("identity_tenant")
                 or products.get(p, {}).get("tier") != inst.get("tier")]
        ok = tenant.get("tier") == inst.get("tier") and not wrong
        detail = f"products on another tenant or tier: {wrong}" if wrong else "all products share it"
        out.append(("OK" if ok else "FAIL", "L04",
                    f"{name}: tenant {inst.get('identity_tenant')} ({tenant.get('tier', 'unknown')}); {detail}"))
        # L05 (course): production Joule in a Prod subaccount, non-production never there.
        stage = subs.get(inst.get("subaccount"), {}).get("stage", "")
        ok = (stage == "Prod") == (inst.get("tier") == "production")
        out.append(("OK" if ok else "FAIL", "L05", f"{name}: {inst.get('tier')} instance in a {stage or 'unknown'} subaccount"))

    # L06 (course): every product has a Joule path or a written reason for none.
    connected = {p for i in data.get("joule_instances", []) for p in i.get("products", [])}
    for pid, prod in products.items():
        if prod.get("joule") == "none":
            ok = bool(prod.get("reason"))
            out.append(("OK" if ok else "WARN", "L06", f"{pid}: no Joule, reason: {prod.get('reason') or 'missing'}"))
        else:
            ok = pid in connected
            out.append(("OK" if ok else "WARN", "L06", f"{pid}: {'on a Joule instance' if ok else 'candidate on no instance'}"))

    # L07 (SAP): generative AI hub needs SAP AI Core's extended plan.
    for core in data.get("ai_core_instances", []):
        ok = (not core.get("generative_ai")) or core.get("plan") == "extended"
        out.append(("OK" if ok else "FAIL", "L07", f"{core['id']}: plan {core.get('plan')}, generative AI {core.get('generative_ai')}"))

    # L08 (course): every agent has an 8-digit owner and a known home.
    for agent in data.get("agents", []):
        ok = bool(re.fullmatch(r"\d{8}", agent.get("owner", ""))) and agent.get("home") in HOMES
        out.append(("OK" if ok else "FAIL", "L08", f"{agent['id']}: owner {agent.get('owner') or 'missing'}, home {agent.get('home')}"))
    return out


def main() -> int:
    parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
    parser.add_argument("--init", action="store_true", help="write the sample landscape file")
    parser.add_argument("--json", action="store_true", help="print the review as JSON")
    args = parser.parse_args()

    if args.init:
        if LANDSCAPE.exists():
            print(f"{LANDSCAPE.name} already exists; delete it first to start again.")
            return 0
        LANDSCAPE.write_text(json.dumps(SAMPLE, indent=2) + "\n", encoding="utf-8")
        print(f"Wrote {LANDSCAPE.relative_to(HERE.parent)} (synthetic, Calder Pumpworks is fictional)")
        return 0

    if not LANDSCAPE.exists():
        print("No landscape file yet. Run: python unit23/ai_landscape.py --init")
        return 1
    try:
        data = json.loads(LANDSCAPE.read_text(encoding="utf-8"))
    except json.JSONDecodeError as error:
        print(f"{LANDSCAPE.name} is not valid JSON: line {error.lineno}, column {error.colno}")
        return 1

    results = review(data)
    if args.json:
        print(json.dumps([{"status": s, "rule": r, "message": m} for s, r, m in results], indent=2))
    else:
        print(f"Calder AI landscape as of {data.get('as_of', '?')} (synthetic)")
        for status, rule, message in results:
            print(f"  {status:<5} {rule}  {message}")
        counts = {k: sum(1 for s, _, _ in results if s == k) for k in ("OK", "WARN", "FAIL")}
        print(f"{counts['OK']} OK, {counts['WARN']} WARN, {counts['FAIL']} FAIL")
    return 2 if any(s == "FAIL" for s, _, _ in results) else 0


if __name__ == "__main__":
    sys.exit(main())
```

2. Write the landscape file:

   ```bash
   python unit23/ai_landscape.py --init
   ```

   You should see:

   ```text
   Wrote unit23/calder_ai_landscape.json (synthetic, Calder Pumpworks is fictional)
   ```

   On Windows the path prints with a backslash (`unit23\calder_ai_landscape.json`). Both are fine.

#### Step 3: Review the landscape

1. Run the review:

   ```bash
   python unit23/ai_landscape.py
   ```

2. Compare with the expected output:

   ```text
   Calder AI landscape as of 2026-11-28 (synthetic)
     OK    L01  global account type is 'enterprise' (Joule needs an enterprise account)
     OK    L02  production: 1 identity tenant(s) ['calder-ias']; SAP asks for one per tier
     OK    L02  non-production: 1 identity tenant(s) ['calder-ias-test']; SAP asks for one per tier
     OK    L03  joule-prod: Joule in calder-ai-prod, Work Zone in calder-ai-prod
     OK    L04  joule-prod: tenant calder-ias (production); all products share it
     OK    L05  joule-prod: production instance in a Prod subaccount
     OK    L03  joule-nonprod: Joule in calder-ai-test, Work Zone in calder-ai-test
     OK    L04  joule-nonprod: tenant calder-ias-test (non-production); all products share it
     OK    L05  joule-nonprod: non-production instance in a Test subaccount
     OK    L06  S4P: on a Joule instance
     OK    L06  S4Q: on a Joule instance
     OK    L06  SF-EC: on a Joule instance
     OK    L06  ECP: no Joule, reason: On-premise ECC until the July 2027 rollout; Unit 12 covers AI on ECC
     OK    L07  calder-aicore: plan extended, generative AI True
     OK    L07  calder-aicore-qa: plan extended, generative AI True
     OK    L08  AGT_INV_TRIAGE: owner 00100244, home joule-studio
     OK    L08  AGT_ORDER_EXC: owner 00100296, home joule-studio
     OK    L08  AGT_SUPPLY_WATCH: owner 00100153, home btp-custom
   18 OK, 0 WARN, 0 FAIL
   ```

> **Note** This landscape is synthetic. Calder is fictional, and an OK line means the file follows the rules as written here, not that a real activation would succeed.

#### Step 4: Make one mistake on purpose

Seeing a rule fail teaches more than seeing it pass.

1. Open `unit23/calder_ai_landscape.json` in VS Code.
2. Find `"id": "joule-prod"` and its line `"products": [`. Add `"S4Q"` to that list, so it reads `"S4P", "SF-EC", "S4Q"`. Save.
3. Run the review again:

   ```bash
   python unit23/ai_landscape.py
   ```

   Among the lines you now see:

   ```text
     FAIL  L04  joule-prod: tenant calder-ias (production); products on another tenant or tier: ['S4Q']
   18 OK, 0 WARN, 1 FAIL
   ```

   The quality system `S4Q` sits on the non-production identity tenant, so it can't join the production Joule instance.

4. Remove `"S4Q"` from that list again, save, and rerun. You are back to `18 OK, 0 WARN, 0 FAIL`.

#### Step 5: Run the Unit 23 check

This unit adds no Python libraries, so `requirements.txt` doesn't change.

1. In the course folder (not in `unit23`), create `check_unit23.py`, paste the code below and save:

```python
"""Check that your course folder is ready for Unit 23 (Joule and the AI platform).

Run it from your course folder:  python check_unit23.py
Built-in Python only. It reads files and .env dates; it calls no SAP service and changes nothing.
"""
import datetime
import json
import os
import subprocess
import sys

problems = 0
TRIALS = {  # .env name: (what it is, length in days as SAP states it)
    "GENAI_HUB_TRIAL_START": ("generative AI hub basic trial", 30),
    "SAP_BUILD_TRIAL_START": ("SAP Build basic trial", 30),
    "BTP_TRIAL_START": ("SAP BTP trial (Unit 21)", 90),
}


def report(ok: bool, label: str, fix: str = "", optional: bool = False) -> None:
    """Print one line: OK, MISSING (must fix) or LATER (optional for now)."""
    global problems
    if ok:
        print(f"  OK       {label}")
    elif optional:
        print(f"  LATER    {label}  ->  {fix}")
    else:
        problems += 1
        print(f"  MISSING  {label}  ->  {fix}")


def env_value(name: str) -> str:
    """Read one line NAME=value from .env without extra libraries."""
    if not os.path.exists(".env"):
        return ""
    with open(".env", encoding="utf-8") as handle:
        for line in handle:
            if line.strip().startswith(name + "="):
                return line.split("=", 1)[1].strip().strip('"').strip("'")
    return ""


def main() -> int:
    today = datetime.date.today()
    print(f"Unit 23 check, {today.isoformat()}")

    report(sys.version_info >= (3, 10), f"Python {sys.version.split()[0]}", "install Python 3.10 or newer")
    report(os.path.isdir("unit23"), "folder unit23/", "run this from orchestrate-course, then: mkdir unit23")

    script = os.path.join("unit23", "ai_landscape.py")
    report(os.path.exists(script), "unit23/ai_landscape.py", "create it in Step 2")

    path = os.path.join("unit23", "calder_ai_landscape.json")
    data = None
    if os.path.exists(path):
        try:
            with open(path, encoding="utf-8") as handle:
                data = json.load(handle)
        except json.JSONDecodeError as error:
            report(False, "calder_ai_landscape.json is valid JSON",
                   f"fix line {error.lineno}, or delete it and run --init again")
    else:
        report(False, "unit23/calder_ai_landscape.json", "run: python unit23/ai_landscape.py --init")
    if data is not None:
        keys = ["identity_tenants", "subaccounts", "products", "joule_instances", "ai_core_instances", "agents"]
        missing = [k for k in keys if k not in data]
        report(not missing, "landscape file has every section", f"missing {missing}; run --init again")

    if os.path.exists(script) and data is not None:
        done = subprocess.run([sys.executable, script], capture_output=True, text=True, timeout=60)
        last = (done.stdout.strip().splitlines() or ["no output"])[-1]
        report(done.returncode == 0, f"landscape review: {last}", "read the FAIL lines in Step 3")

    for name, (label, days) in TRIALS.items():
        value = env_value(name)
        if not value:
            report(False, label, f"optional; add {name}=YYYY-MM-DD to .env when you start it", optional=True)
            continue
        try:
            start = datetime.date.fromisoformat(value)
        except ValueError:
            report(False, f"{label} date '{value}'", "use the form YYYY-MM-DD")
            continue
        left = days - (today - start).days
        if left > 0:
            report(True, f"{label}: {left} day(s) left of {days}")
        else:
            report(False, f"{label} ended {-left} day(s) ago", "register again only when a topic needs it",
                   optional=True)

    print("Ready for Unit 23." if problems == 0 else f"{problems} item(s) to fix before Unit 23.")
    return 0 if problems == 0 else 1


if __name__ == "__main__":
    sys.exit(main())
```

2. Run it:

   ```bash
   python check_unit23.py
   ```

3. Before any trial, the output looks like this (your date and Python version differ):

   ```text
   Unit 23 check, 2026-11-28
     OK       Python 3.12.7
     OK       folder unit23/
     OK       unit23/ai_landscape.py
     OK       landscape file has every section
     OK       landscape review: 18 OK, 0 WARN, 0 FAIL
     LATER    generative AI hub basic trial  ->  optional; add GENAI_HUB_TRIAL_START=YYYY-MM-DD to .env when you start it
     LATER    SAP Build basic trial  ->  optional; add SAP_BUILD_TRIAL_START=YYYY-MM-DD to .env when you start it
     LATER    SAP BTP trial (Unit 21)  ->  optional; add BTP_TRIAL_START=YYYY-MM-DD to .env when you start it
   Ready for Unit 23.
   ```

   `LATER` lines are fine. Unit 23's reading topics don't need any trial.

#### Step 6: Register for a trial (optional)

Do this only when you have time to use the 30 days. Each trial is personal and non-productive; never put your company's real data in it.

**Generative AI hub trial**

1. Open `https://www.sap.com/products/artificial-intelligence/generative-ai-hub-trial.html`.
2. Register with your name and email address. SAP's tutorial says the username and password appear on screen and arrive by email.
3. Click **Start your basic trial!** and log in with those credentials.
4. Add one line with today's date to `.env`:

   ```text
   GENAI_HUB_TRIAL_START=2026-11-28
   ```

If you registered during Unit 3 and the 30 days have passed, leave it; the check shows `LATER`.

**SAP Build trial**

1. Open `https://www.sap.com/products/technology-platform/build/trial.html`.
2. Register with the form on the page and follow the email SAP sends.
3. In the trial, find the workbook *Create a custom AI agent in Joule Studio, classic edition*. You need it only for the Unit 23 Joule Studio topic.
4. Add the date to `.env`:

   ```text
   SAP_BUILD_TRIAL_START=2026-11-28
   ```

Rerun `python check_unit23.py`. Each trial you started now shows `OK` with the days left.

> **Warning** The trial passwords are secrets. Keep them in a password manager, not in `.env` or in Git. The dates in `.env` are not secrets, but `.env` stays out of Git as before.

#### Step 7: Save your work in Git

```bash
git add unit23 check_unit23.py
git commit -m "Unit 23 setup: Calder AI landscape file and check"
```

#### How the code works

| Part | What it does |
| --- | --- |
| `SAMPLE` | Calder's landscape as a Python dictionary; `--init` writes it to JSON once and never overwrites |
| `review()` | Runs rules `L01` to `L08` and returns one line per check |
| `L02`, `L04` | Count identity tenants per tier, then compare each Joule instance and its products with their tenant and tier |
| `L03` | Compares the Joule subaccount with the Work Zone subaccount |
| `--json` | Prints the same results for later topics' scripts to read |
| Exit code | 0 without failures, 2 with any `FAIL`, so a script or pipeline can stop on it |
| `check_unit23.py` | Checks files, runs the review, and counts down trials from dates in `.env` |

#### If something goes wrong

| What you see | What it means | What to do |
| --- | --- | --- |
| `python: command not found` or `'python' is not recognized` | Python isn't on your PATH, or the virtual environment is off | Turn on `.venv` (Step 1); on macOS/Linux try `python3` |
| `No landscape file yet` | `--init` hasn't run | Run `python unit23/ai_landscape.py --init` |
| `is not valid JSON: line 40` | An edit left a missing comma or quote | Fix that line, or delete the file and run `--init` again |
| `already exists; delete it first` | `--init` refuses to overwrite your edits | Delete the file only if you want the sample back |
| `MISSING unit23/ai_landscape.py` in the check | The check runs from the wrong folder | Run it from `orchestrate-course`, not from `unit23` |
| A trial page won't load or the form fails | A company proxy or firewall blocks sap.com sign-ups | Use a personal network, or skip the trial; nothing in Unit 23 depends on it |
| `ModuleNotFoundError` | You ran a script from another unit by mistake | These two scripts use built-in modules only; check the file name |

### Where this shows up in SAP

The file mirrors decisions SAP's onboarding makes you take. The [unified instance lesson](https://learning.sap.com/courses/setting-up-joule-across-your-organizational-system-landscapes/setting-up-a-unified-joule-instance) orders them: prepare the BTP structure, verify identity (Identity Authentication, Identity Provisioning where needed, and a consistent global user ID), run the unified Joule onboarding, then enable Joule per line of business on the same instance. The Joule Base page adds that the BTP global account is chosen when contracting in the SAP Store, and SAP advises the central one. [Activating Joule across SAP products](https://erpfde.com/topics/activating-joule-across-products/) walks that sequence per product family.

### Where AI fits

Everything in this unit is about AI, so the question here is narrower: what does an architect use AI for while designing it? Joule in the BTP cockpit answers questions about BTP services and can run predefined administrative actions, free in non-trial global accounts per [SAP's documentation](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/enable-joule-in-the-cockpit-8232891.md). It is useful for looking things up, not as the source of a placement decision; check each answer against the documentation it links. Agent placement itself is covered in [where should an agent live](https://erpfde.com/topics/where-should-an-agent-live/).

### Production concerns

- **Trials are not pilots.** SAP's terms limit the BTP trial to personal, non-productive use; the SAP Build trial is a shared tenant. A real pilot needs the customer's enterprise account.
- **Identity first.** The file makes tenant tiers explicit because a wrong tenant is the hardest mistake to undo later.
- **Keep the file in Git and review changes.** It becomes the design record for the unit; a change to a Joule instance's products is an architecture change.
- **Date everything.** Status and offers change; the `as_of` field and each topic's sources say when a fact was true.

### Pitfalls

- Starting a trial on day one and losing it before the topic that needs it.
- Reading the SAP Build trial's Joule Studio, classic edition, as the current Joule Studio.
- Adding a product to a Joule instance without checking which identity tenant its users sit in.
- Treating an all-OK review as proof that activation will work; the rules are a subset of SAP's prerequisites.
- Copying trial passwords into `.env` or a script.

### Exercise

Calder's finance team wants Joule in SAP Concur Expense for `CP10`.

1. Open `unit23/calder_ai_landscape.json`.
2. In `products`, add an entry after `SF-EC`:

   ```json
   {"id": "CONCUR", "product": "SAP Concur Expense", "company_code": "CP10",
    "tier": "production", "identity_tenant": "calder-ias", "joule": "candidate"},
   ```

3. Run `python unit23/ai_landscape.py`. You get one `WARN L06  CONCUR: candidate on no instance`.
4. Add `"CONCUR"` to the `products` list of `joule-prod`, save and run again.
5. Write two sentences in `unit23/notes.md`: which identity tenant Concur's users must be in, and one question for SAP before Concur joins `joule-prod`.

**Done when** the review prints `19 OK, 0 WARN, 0 FAIL` and `notes.md` holds your two sentences. [Activating Joule across SAP products](https://erpfde.com/topics/activating-joule-across-products/) builds its readiness checklist from this file.

### Check yourself

1. Which Joule pillars can a learner try hands-on without a customer, as of November 2026?
   - A. Joule inside S/4HANA, through the BTP trial's sample tenant
   - B. The AI platform and Joule Studio classic, through two trials
   - C. SuccessFactors with Joule, through SAP's 30-day HR trial
   - D. Joule Premium, through the Joule Base page's free order

   Answer: B. SAP's pages offer a generative AI hub trial (AI Core and AI Launchpad) and an SAP Build trial with a Joule Studio, classic edition, workbook. No page read offers Joule inside a business application without a customer subscription.

2. In `ai_landscape.py`, what does rule `L04` compare?
   - A. The subaccount of Joule with the subaccount of Work Zone
   - B. Each agent's owner against an eight-digit personnel number
   - C. Each instance's tenant and tier with those of its products
   - D. The AI Core plan against the need for generative AI

   Answer: C. `L04` checks that a Joule instance's identity tenant has the instance's tier and that every connected product uses the same tenant and tier. The subaccount check is `L03`, the owner check `L08`, the plan check `L07`.

3. A colleague adds `S4Q` to `joule-prod`. What does the review report, and why?
   - A. `L03` fails because S4Q's Work Zone is in another subaccount
   - B. `L06` warns because S4Q is still a candidate on no instance
   - C. `L01` fails because the global account turns into a trial
   - D. `L04` fails because S4Q is on the non-production tenant

   Answer: D. S4Q uses `calder-ias-test`, the non-production tenant, while `joule-prod` uses `calder-ias`. SAP's guidance is one identity tenant per landscape tier, so the rule flags it.

4. Why does `--init` refuse to overwrite an existing landscape file?
   - A. JSON files can't be rewritten once Python has read them
   - B. Later exercises edit the file, and those edits must survive
   - C. SAP's onboarding locks the file after the first activation
   - D. The review needs the old file to compute a difference

   Answer: B. The file is the unit's design record, extended by later exercises. Overwriting it silently would lose that work, so the script asks you to delete it first if you really want the sample back.

5. A partner proposes running Calder's Joule pilot on the SAP Build trial to save time. What do you answer?
   - A. Fine, as long as the trial is extended past its 30 days
   - B. Fine, because Joule Studio classic is the current product
   - C. No: it's a shared, non-productive tenant with sample data
   - D. No: the SAP Build trial has no Joule Studio workbook at all

   Answer: C. SAP describes the SAP Build trial as a shared tenant with sample data, and says what is built there can't go to production. A pilot with Calder's processes and users belongs in Calder's enterprise account.

6. Why does rule `L07` require the extended plan for `calder-aicore`?
   - A. The standard plan is only offered in trial accounts
   - B. The extended plan is the only one with resource groups
   - C. The standard plan can't be upgraded to any other plan
   - D. SAP includes the generative AI hub only in extended

   Answer: D. SAP AI Core's service plans page lists the generative AI hub under the extended plan, not standard; both plans need an enterprise account and both have resource groups. You can upgrade from standard to extended, but not downgrade back.

## Sources

- [Identifying Technical Prerequisites and Architecture (SAP Learning, Introducing Joule, read 2026-11-28)](https://learning.sap.com/courses/introducing-joule/identifying-technical-prerequisites-and-architecture): four pillars (SAP BTP, SAP Build Work Zone, SAP Cloud Identity Services, a supported SAP application); enterprise global account; Joule foundation plan (das-application); Work Zone foundation or standard plan; Identity Authentication and Identity Provisioning entitlements; Joule and Work Zone in the same subaccount; no trial mentioned
- [Setting Up a Unified Joule Instance (SAP Learning, read 2026-11-28)](https://learning.sap.com/courses/setting-up-joule-across-your-organizational-system-landscapes/setting-up-a-unified-joule-instance): one Joule instance shared across SAP cloud applications; a single Identity Authentication tenant per landscape tier (production and non-production); one Work Zone edition per Joule instance; prerequisites a licensed SAP product that supports Joule and an enterprise global account
- [Evaluating Prerequisites for Activation (SAP Learning, SAP Joule for Consultants, read 2026-11-28)](https://learning.sap.com/courses/introducing-sap-joule-for-consultants/evaluating-prerequisites-for-activation): says no free trial is available; commercial agreement and AI Units required; subaccount in EU10 or EU11
- [Enable Joule in the Cockpit (SAP BTP documentation, SAP-docs on GitHub, read 2026-11-28)](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/enable-joule-in-the-cockpit-8232891.md): global account administrator accepts the generative AI terms and enables Joule; this version is free of charge in non-trial global accounts and limited to BTP administration in the cockpit
- [Trial Accounts and Free Tier (SAP BTP documentation, SAP-docs on GitHub, read 2026-11-28)](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/trial-accounts-and-free-tier-046f127.md): 90-day trial for personal, non-productive use; self-registration for an enterprise account with free tier plans; a trial can include a trial tenant of SAP Cloud Identity Services
- [Service Plans (SAP AI Core documentation, SAP-docs on GitHub, read 2026-11-28)](https://github.com/SAP-docs/sap-artificial-intelligence/blob/main/docs/sap-ai-core/service-plans-c7244c6.md): standard plan without generative AI, extended plan with generative AI hub, both enterprise accounts; no downgrade from extended; points to the 30-day trial for a hands-on environment
- [Start your free trial of generative AI hub (sap.com, read 2026-11-28)](https://www.sap.com/products/artificial-intelligence/generative-ai-hub-trial.html): 30-day basic trial; includes SAP AI Core and SAP AI Launchpad; names Claude Sonnet 4, Gemini 2.5 Pro and GPT-5; no prompt optimization; buy afterwards through Pay-As-You-Go or an enterprise agreement
- [Generative AI Hub basic trial tutorial (SAP Developers, 28 October 2025)](https://developers.sap.com/tutorials/teched2025-genaihub-basic-trial.html): register, receive a username and password, Start your basic trial, workbook with AI Launchpad, orchestration and document grounding; available for 30 days from registration
- [Start your free trial of SAP Build (sap.com, read 2026-11-28)](https://www.sap.com/products/technology-platform/build/trial.html): 30-day basic trial at no cost on a shared tenant with sample data; workbooks include creating a custom AI agent in Joule Studio, classic edition; no deployment to production; a subset of functionality
- [Activate Joule across your SAP cloud products for free (Joule Base, sap.com, read 2026-11-28)](https://www.sap.com/products/artificial-intelligence/joule-base.html): base capabilities included with SAP cloud subscriptions that integrate with Joule; needs an active subscription; BTP global account chosen in the SAP Store; plan block shows flat fee, 1 to 3 years, auto-renewal; partner test tenant
