# Teaching notes

## Approach

Keep `index.html` as the browser entry point. Link every lesson and reference page back to it, and update its lesson list when new material becomes available. Keep available lessons distinct from planned coverage.

The learner works with Spring Boot daily. Use familiar controllers, services, repositories, and Maven; explain ArchUnit concepts without reteaching ordinary Java. A separate Rust course establishes a preference for short HTML lessons and one or two implementation exercises per lesson, with explicit expected behavior and a run/review loop.

Introduce each unfamiliar term in context before relying on it. Provide optional syntax hints, but do not solve exercise rules in the supplied source. Predictions supplement implementation. Preserve the learner's code and record understanding only after their explanation or work demonstrates it.

Use the official ArchUnit user guide as the primary tutorial reading, with version-specific source or Javadoc for detailed behavior. Use primary Rust tool documentation. Verify versions and tool capabilities when teaching them; similarly named architecture libraries are not necessarily related to TNG's ArchUnit.

## Course direction

| Stage | Lesson and practice | Status |
| --- | --- | --- |
| 1 | Import compiled classes; write a package rule; prove it fails on a forbidden reference and passes after removal | Lesson ready; learner has not attempted it |
| 2 | Freeze a rule; inspect stored descriptions; reject new debt in an existing class; repair and reintroduce debt | Lesson ready; learner has not attempted it |
| 3 | Rust migration track: write a cargo-deny ban; distinguish crate checks from module checks | Lesson ready; optional after lesson 2 |
| 4 | Spring annotations and JUnit integration: `@AnalyzeClasses`, `@ArchTest`, annotation rules, test exclusions, imported scope | Planned; use learner's actual Boot/JUnit versions |
| 5 | Layers and feature modules: compare package rules, `layeredArchitecture`, slices, and cycle checks; test a counterexample | Planned |
| 6 | Adopt rules in a real repository: stable descriptions, baseline review, CI settings, multi-module paths, missing classes, generated code | Planned |
| 7 | Rust module rules: compiler privacy, cargo-modules inspection, a small architecture-library trial with positive and negative fixtures | Planned |
| 8 | Rust API compatibility: run cargo-semver-checks on a small public-library change; distinguish accepted major changes from unnoticed breakage | Planned |
| 9 | Java/Rust contracts: verify a consumer expectation against a Rust provider; explore schema compatibility for the actual protocol | Planned |

Stages 4 onward are a direction, not a fixed schedule. Revisit a previous rule from memory at each session, then adjust based on the exercise. The user explicitly requested complementary Rust tools on November 24, 2026; they must remain part of the lessons and exercises.

## Important distinctions

- Freezing compares violation descriptions. It does not read Git history, detect changed files, or make an old class exempt from new constraints. Matching has deliberate tolerance, including source line numbers.
- Keep initial store creation separate from normal runs. Repair, run with updates allowed, and retain the reduced store before demonstrating rejection on reintroduction. A source reference can produce several violation lines.
- CI with store updates forbidden also rejects an unrecorded reduction. Explain why the local store change travels with the code fix. Never describe `allowStoreUpdate=false` as silently accepting repairs.
- Architecture tests inspect selected compiled code. Empty selections, missing imports, test discovery, and stale build output deserve explicit checks. Use `mvn clean test` when removing or renaming fixture classes.
- Rust crate graphs, source module dependencies, visibility, public Rust APIs, and HTTP/message contracts are different scopes. Do not claim that one tool proves all of them or shares ArchUnit's freeze store.

## Current evidence

Only the learner's daily Spring Boot experience and Maven preference are established. Course verification establishes that the supplied examples work, not that the learner has mastered them. See [verification](VERIFICATION.md) for instructor checks.

The initial design received an independent reduction review: one small Maven lab, shared CSS, and ordinary HTML disclosure are sufficient. The initial exercises need no Spring server, custom quiz runtime, or shared Java/Rust policy engine.
