@mriekki/lean 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/assets/components.json +3 -3
  2. package/assets/core/distribution.json +8 -0
  3. package/assets/deployment/distribution.json +2 -0
  4. package/assets/generated/ASSEMBLY.json +73 -23
  5. package/assets/generated/core/core/instructions/lean-docs.instructions.md +33 -2
  6. package/assets/generated/core/core/instructions/lean-workflow.instructions.md +42 -0
  7. package/assets/generated/core/core/learning/DIAGRAM_GUIDE.md +46 -6
  8. package/assets/generated/core/core/learning/ENGINEERING_LEARNING_WORKBOOK.md +29 -6
  9. package/assets/generated/core/core/learning/LEARNING_MAP.md +37 -2
  10. package/assets/generated/core/core/learning/LEARNING_PROGRESS.md +15 -7
  11. package/assets/generated/core/core/learning/SYSTEM_DESIGN_DRILLS.md +299 -19
  12. package/assets/generated/core/core/process/COACHING_GUIDE.md +35 -2
  13. package/assets/generated/core/core/process/DATABASE_LEARNING_WORKBENCH.md +153 -102
  14. package/assets/generated/core/core/process/DEPLOYMENT_ENABLEMENT.md +108 -71
  15. package/assets/generated/core/core/process/LEAN_ENGINEERING_GUIDE.md +317 -0
  16. package/assets/generated/core/core/process/PROJECT_DOCUMENTATION_FRAMEWORK.md +324 -0
  17. package/assets/generated/core/core/process/SYSTEM_DESIGN_LEARNING_WORKBENCH.md +520 -0
  18. package/assets/generated/core/core/skills/coach/SKILL.md +31 -4
  19. package/assets/generated/core/core/skills/db-lab/SKILL.md +59 -16
  20. package/assets/generated/core/core/skills/deliver/SKILL.md +77 -5
  21. package/assets/generated/core/core/skills/deploy/SKILL.md +164 -121
  22. package/assets/generated/core/core/skills/deployment-readiness/SKILL.md +223 -250
  23. package/assets/generated/core/core/skills/docs/SKILL.md +116 -0
  24. package/assets/generated/core/core/skills/next-step/SKILL.md +21 -6
  25. package/assets/generated/core/core/skills/system-lab/SKILL.md +333 -0
  26. package/assets/generated/core/core/skills/tear-down/SKILL.md +101 -61
  27. package/assets/generated/core/core/templates/ADR_TEMPLATE.md +41 -0
  28. package/assets/generated/core/tools/docs_site/docs_site.py +382 -0
  29. package/assets/generated/core/tools/system_lab/system_workbench.py +243 -0
  30. package/assets/generated/deployment/src/lean_poc_deployment/entrypoint.py +5 -1
  31. package/assets/generated/deployment/src/lean_poc_deployment/local_cli.py +112 -0
  32. package/assets/generated/deployment/src/lean_poc_deployment/local_runtime.py +523 -0
  33. package/assets/generated/deployment/src/lean_poc_deployment/teardown.py +49 -35
  34. package/assets/generated/deployment/src/lean_poc_deployment/teardown_cli.py +31 -12
  35. package/package.json +1 -1
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: docs
3
+ description: "Open or inspect the repository's current Lean project documentation site, ownership/authority map, and DB/System evidence freshness without creating a new workflow gate."
4
+ argument-hint: "[open|check|build]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Project Docs
10
+
11
+ `/docs` is the front door to repository documentation. It is read-only with respect to project prose unless the human explicitly asks to edit documentation.
12
+
13
+ ## Purpose
14
+
15
+ Use `/docs` to:
16
+
17
+ - open the local project documentation site;
18
+ - inspect documentation ownership/authority;
19
+ - find the correct product, architecture, engineering, operations, learning, or ADR document;
20
+ - see whether disposable System/DB evidence views are current, stale, unknown, or absent;
21
+ - keep `/db-lab` and `/system-lab` easy to discover.
22
+
23
+ Markdown remains canonical. The site is a generated local projection.
24
+
25
+ ## Default behavior
26
+
27
+ When invoked without a mode:
28
+
29
+ 1. Read `docs/lean-docs.json` when present.
30
+ 2. Verify the documentation viewer exists at `tools/lean-docs/docs-site.py`.
31
+ 3. If it exists, use the repository-local Python/runtime convention to run:
32
+
33
+ ```text
34
+ python tools/lean-docs/docs-site.py serve --root .
35
+ ```
36
+
37
+ The viewer binds to loopback only and writes disposable output under `.lean/`.
38
+
39
+ If the tool is unavailable, do not invent installation support. Fall back to a concise documentation map from repository Markdown and mention that the local viewer is unavailable in the current accepted baseline.
40
+
41
+ ## Modes
42
+
43
+ ### `/docs open`
44
+
45
+ Equivalent to the default behavior.
46
+
47
+ ### `/docs check`
48
+
49
+ Do not open a browser. Inspect:
50
+
51
+ - `docs/lean-docs.json` validity when present;
52
+ - missing listed documents;
53
+ - ownership/authority declarations;
54
+ - current Git commit;
55
+ - System Lab cache freshness when evidence exists;
56
+ - DB Lab cache availability/freshness only when evidence supports a conclusion.
57
+
58
+ Do not treat a missing optional Lean-managed document as project corruption when Bootstrap generation and reusable-package application are still distinct phases.
59
+
60
+ ### `/docs build`
61
+
62
+ Generate the disposable site without serving it:
63
+
64
+ ```text
65
+ python tools/lean-docs/docs-site.py build --root . --out .lean/docs-site
66
+ ```
67
+
68
+ This is a local derived artifact and should not normally be committed.
69
+
70
+ ## Current-by-default evidence
71
+
72
+ System Lab can reconstruct architecture from repository evidence. The docs viewer may best-effort prepare the current System Lab projection when it starts and the tool is present.
73
+
74
+ Database Lab is stricter: do not guess a database path. Show an existing DB projection or hand off to `/db-lab`; automatic generation is allowed only when a safe local development/test database path is already explicit.
75
+
76
+ Never create a database, apply migrations, mutate application data, or inspect Production merely to populate documentation.
77
+
78
+ ## Ownership
79
+
80
+ Respect `docs/lean-docs.json`:
81
+
82
+ - `project` — project-owned prose and ADRs;
83
+ - `lean` — reusable managed reference/process material;
84
+ - `generated-evidence` — disposable projections.
85
+
86
+ Do not silently rewrite `project` documents during `/docs` just because code changed. Surface likely documentation impact instead.
87
+
88
+ ## ADR behavior
89
+
90
+ If current evidence reveals a consequential architecture choice that lacks a durable decision record, `/docs` may recommend creating an ADR from `docs/templates/ADR_TEMPLATE.md`.
91
+
92
+ Recommendation is not approval. Do not invent or accept the decision for the human.
93
+
94
+ ## Output when not opening the site
95
+
96
+ Prefer a compact result such as:
97
+
98
+ ```text
99
+ PROJECT DOCS
100
+
101
+ Entry: PROJECT_BRIEF.md
102
+ Product authority: docs/product/PRODUCT_BRIEF.md
103
+ Work-item authority: docs/work-items/...
104
+ Current commit: abc1234
105
+
106
+ System evidence: CURRENT / STALE / NOT GENERATED
107
+ Database evidence: CURRENT / STALE / AVAILABLE-FRESHNESS-UNKNOWN / NOT GENERATED
108
+
109
+ Useful:
110
+ - /system-lab
111
+ - /db-lab
112
+ - /code-walkthrough
113
+ - /learning-review
114
+ ```
115
+
116
+ Documentation status is not a delivery gate unless an approved work item explicitly requires documentation as acceptance evidence.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: next-step
3
- description: Read-only orientation over work-item, Git, review, PR, PR CI, merge, post-merge default-branch CI, deployment readiness, and deployment handoff state.
3
+ description: Read-only orientation over work-item, Git, review, PR, PR CI, merge, post-merge default-branch CI, deployment readiness, deployment handoff state, and optional documentation/learning surfaces.
4
4
  argument-hint: "[optional work-item ID or external key]"
5
5
  user-invocable: true
6
6
  disable-model-invocation: true
@@ -68,7 +68,7 @@ Use only states supported by observed evidence.
68
68
 
69
69
  Do not add a separate final-PR-acceptance state when the PR still exactly matches the already accepted local implementation. In that normal case, `/deliver` combines final acceptance and merge into the single `MERGE_READY` decision. If PR evidence changed materially, describe the required final PR review explicitly before returning to `MERGE_READY`.
70
70
 
71
- Do not add learning-only states such as `CODE_WALKTHROUGH_PENDING`. Optional coaching does not change engineering delivery state.
71
+ Do not add learning- or documentation-only states such as `CODE_WALKTHROUGH_PENDING` or `DOCS_UPDATE_PENDING`. Optional coaching, labs, and project documentation do not change engineering delivery state unless the approved work item explicitly makes documentation acceptance evidence.
72
72
 
73
73
  ## 3. Output
74
74
 
@@ -88,17 +88,30 @@ OPTIONS
88
88
 
89
89
  Only show relevant options. `/next-step` orients; it does not become another workflow database.
90
90
 
91
- ## 4. Optional learning choices
91
+ ## 4. Optional documentation and learning choices
92
92
 
93
- When implementation is stable enough to learn from and the human appears interested in understanding the code, `/next-step` may offer learning choices without making them gates:
93
+ When implementation is stable enough to understand or document, `/next-step` may offer these choices without making them gates:
94
94
 
95
95
  ```text
96
+ /docs [open|check|build] — project documentation map/site and evidence freshness [READ ONLY]
96
97
  /code-walkthrough <scope> — guided changed-file explanation [READ ONLY]
97
98
  /learning-review <scope> — understanding assessment [READ ONLY]
98
99
  /coach <topic> — focused concept coaching [READ ONLY]
100
+ /db-lab [changes <work-item>] — current database/schema/query/ORM evidence [READ ONLY]
101
+ /system-lab [changes <work-item>] — current architecture/runtime/failure/design evidence [READ ONLY]
99
102
  ```
100
103
 
101
- Prefer `/code-walkthrough` when the user wants to understand what changed across an implementation. Do not recommend it as mandatory before `/deliver`.
104
+ Prefer `/docs` when the user wants the coherent project briefing, documentation map, ADR/architecture/operations references, or current DB/System projection status. Prefer `/code-walkthrough` when the user wants to understand what changed across an implementation. Prefer `/db-lab` when the question depends on concrete schema/query/index/ORM evidence. Prefer `/system-lab` when it depends on architecture, runtime flows, APIs, dependencies, failure behavior, scale, messaging, observability, security, deployment, testing, or system-design tradeoffs.
105
+
106
+ When a known work-item diff materially touches documentation-sensitive areas, make the impact visible without inventing a gate. Examples include public contracts, architecture/dependencies, persistence/schema, deployment/environments, developer workflow, test strategy, or a consequential architecture tradeoff that may deserve an ADR.
107
+
108
+ Safe generated projections may be prepared automatically. Do not silently rewrite project-owned prose or accept an ADR on the human's behalf merely because implementation evidence changed.
109
+
110
+ When a known work-item diff materially touches a DB/System evidence area, make the corresponding `changes <work-item>` option visibly relevant. Do not claim a runtime or physical-schema change solely because a file was touched.
111
+
112
+ Labs inspect current evidence when invoked. Do not tell the human to refresh, rebuild, or manually synchronize a generated diagram.
113
+
114
+ Do not recommend any documentation or learning activity as mandatory before `/deliver` unless the approved work item explicitly requires it.
102
115
 
103
116
  ## 5. Delivery handoff
104
117
 
@@ -140,7 +153,7 @@ Never merge from `/next-step` merely because CI is green.
140
153
  After merge:
141
154
  - if required default-branch CI is pending, return to `/deliver` to resume observation/finalization;
142
155
  - if failed, inspect/diagnose;
143
- - if green and branch finalization is safe/complete, report delivery complete.
156
+ - if green and branch finalization is safe/complete, report delivery complete and optional relevant documentation/learning follow-ups without changing the delivery state.
144
157
 
145
158
  ## 6. Deployment handoff
146
159
 
@@ -173,3 +186,5 @@ Do not infer readiness of one environment from another. Production is never an i
173
186
  ## 7. Keep it lean
174
187
 
175
188
  Do not auto-run Reviewer, auto-run learning activities, auto-merge, auto-deploy, pin/select a model, or maintain duplicate workflow state outside Git/GitHub and the configured work-item/readiness authority.
189
+
190
+ Generating a disposable read-only documentation or learning workbench is not the same as performing a learning activity, approving documentation prose, or proving understanding. `/deliver` may prepare such artifacts best-effort after successful delivery when safe and relevant; learning itself remains optional.
@@ -0,0 +1,333 @@
1
+ ---
2
+ name: system-lab
3
+ description: "Optional evidence-backed advanced system-design lab for architecture, runtime flows, APIs, failures, capacity, performance, observability, security, messaging, deployment, testing, evolution, debugging, and interview practice."
4
+ argument-hint: "[architecture|runtime|api|failure|capacity|performance|observability|security|messaging|deployment|testing|debug|changes|evolve|compare|interview|topic] [work-item]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # System Lab
10
+
11
+ `/system-lab` is an optional advanced learning surface built from current repository/runtime evidence. It complements `/coach`; it does not replace the engineering workflow or authorize implementation changes.
12
+
13
+ For detailed usage, model semantics, and examples, read `docs/process/SYSTEM_DESIGN_LEARNING_WORKBENCH.md` in a greenfield consumer (or canonical `core/process/SYSTEM_DESIGN_LEARNING_WORKBENCH.md`).
14
+
15
+ ## 1. Core contract
16
+
17
+ - Start from the current repository and the minimum safe evidence needed for the requested lens.
18
+ - Treat the repository/runtime/configuration evidence as authoritative; generated diagrams are disposable projections, never a second source of truth.
19
+ - Re-discover evidence whenever the lab is invoked. Do not make the human remember to refresh or rebuild a diagram.
20
+ - Prefer the distributed `tools/lean-system-lab/system-workbench.py` when present. It always rebuilds its model from current evidence and may compare with its prior disposable snapshot.
21
+ - Never inspect Production credentials, Production data, or secret values.
22
+ - Do not change production code, configuration, infrastructure, schemas, data, or deployment state while in System Lab mode.
23
+ - Do not claim runtime behavior from static topology alone. Label evidence precisely.
24
+ - Discovered implementation defects return to the normal engineering workflow; do not silently fix them here.
25
+ - Learning is optional and never blocks delivery.
26
+
27
+ ## 2. Evidence labels
28
+
29
+ Use these labels consistently:
30
+
31
+ ```text
32
+ CONFIRMED BY CODE — directly observed in source/configuration/tests
33
+ CONFIRMED BY RUNTIME — directly observed in safe runtime/telemetry evidence
34
+ DOCUMENTED INTENT — stated in project documentation/ADR/requirements
35
+ INFERRED — reasonable interpretation from incomplete evidence
36
+ UNKNOWN — evidence is insufficient
37
+ LEARNER ASSUMPTION — value supplied for a design/capacity exercise
38
+ ```
39
+
40
+ A diagram edge is not automatically proof that a runtime call occurred. A dependency discovered from configuration/package references may still be only structural evidence.
41
+
42
+ ## 3. System-design competencies
43
+
44
+ Assess independently rather than using one generic "system design level":
45
+
46
+ ```text
47
+ requirements + scope framing
48
+ capacity estimation + workload modeling
49
+ API + contract design
50
+ service/module decomposition
51
+ data/storage selection
52
+ caching
53
+ messaging + asynchronous workflows
54
+ consistency + distributed coordination
55
+ scaling + partitioning
56
+ availability + fault tolerance
57
+ latency + performance
58
+ runtime/deployment topology
59
+ observability + SLO reasoning
60
+ security + abuse resistance
61
+ cost/complexity awareness
62
+ architecture evolution
63
+ incident/debug reasoning
64
+ testing/verification strategy
65
+ tradeoff defense
66
+ interview communication
67
+ ```
68
+
69
+ Use the common L1-L6 levels, but record evidence per competency.
70
+
71
+ ## 4. Architecture lenses
72
+
73
+ Treat one system model as the basis for multiple views:
74
+
75
+ ```text
76
+ STRUCTURE components and dependencies
77
+ RUNTIME request/event path for a scenario
78
+ API contracts, boundaries, callers, downstreams
79
+ DATA stateful components and data movement
80
+ SCALE load assumptions and bottleneck questions
81
+ FAILURE failure domains and propagation hypotheses
82
+ CONSISTENCY places state may disagree or ordering/idempotency matters
83
+ PERFORMANCE latency budgets, fan-out, saturation, timeout/retry behavior
84
+ OBSERVABILITY metrics/logs/traces/SLO evidence and gaps
85
+ SECURITY trust boundaries, authn/authz, secrets/PII exposure, abuse controls
86
+ MESSAGING producers/consumers, delivery semantics, ordering, retries, DLQ
87
+ DEPLOYMENT processes/containers/nodes/environments and rollout concerns
88
+ TESTING verification boundaries and untested risk
89
+ CHANGES architecture impact of the current/recent work item
90
+ EVOLUTION what complexity becomes justified as constraints change
91
+ ```
92
+
93
+ If evidence for a lens is absent, show the gap instead of inventing detail.
94
+
95
+ ## 5. Interactive workbench
96
+
97
+ When `tools/lean-system-lab/system-workbench.py` exists, prefer it for a current project snapshot.
98
+
99
+ The tool is read-only and dependency-free. It:
100
+
101
+ - scans current repository evidence for application/service/frontend/library/datastore/cache/messaging/external/deployment/test signals;
102
+ - records provenance for inferred components and dependencies;
103
+ - generates a stable evidence fingerprint and current Git commit when available;
104
+ - automatically compares with the prior disposable snapshot in the selected output directory;
105
+ - accepts optional explicit model JSON for richer known architecture, scenarios, failure behavior, decisions, SLOs, and metadata;
106
+ - accepts changed-file paths so a delivered work item can be overlaid on the architecture;
107
+ - creates self-contained `index.html` plus `workbench.json`;
108
+ - supports draggable nodes, search, zoom, clickable nodes/edges, scenario highlighting, lens switching, change overlays, failure exploration, capacity calculations, latency budgets, scale/evolution prompts, design drills, and interview perturbations.
109
+
110
+ Generate into a stable per-repository temp/cache directory so the prior disposable snapshot can be used for change comparison. Do not commit generated output unless explicitly requested.
111
+
112
+ ## 6. Scenario-to-architecture tracing
113
+
114
+ For a scenario such as checkout, authentication, background processing, or notification:
115
+
116
+ ```text
117
+ entry point
118
+ → participating components
119
+ → synchronous calls
120
+ → state reads/writes
121
+ → asynchronous messages
122
+ → external dependencies
123
+ → user-visible/result state
124
+ ```
125
+
126
+ Highlight only evidence-backed participants. If the sequence is inferred from topology rather than captured runtime evidence, say so.
127
+
128
+ Ask the learner to explain the path before filling gaps when that improves learning.
129
+
130
+ ## 7. Prediction before reveal
131
+
132
+ For advanced learning, default to making the human predict before revealing the explanation when practical.
133
+
134
+ Examples:
135
+
136
+ ```text
137
+ What fails if this dependency times out?
138
+ Which component becomes the bottleneck at 10x traffic?
139
+ Where can duplicate delivery cause damage?
140
+ Which signal would distinguish database latency from downstream latency?
141
+ What consistency guarantee does the requirement actually need?
142
+ ```
143
+
144
+ Do not turn every interaction into a quiz. Explanation-first remains valid when explicitly requested.
145
+
146
+ ## 8. Failure and debugging mode
147
+
148
+ Failure mode should distinguish verified behavior from topological hypotheses.
149
+
150
+ ```text
151
+ symptom/failure injection
152
+ → learner predicts impact
153
+ → identify failure boundary
154
+ → likely propagation
155
+ → distinguishing telemetry/evidence
156
+ → resilience behavior
157
+ → user-visible effect
158
+ → prevention/design alternatives
159
+ ```
160
+
161
+ Useful perturbations include database/cache/queue/dependency unavailability, slow dependency, duplicate/delayed/out-of-order messages, retry amplification, queue backlog, regional failure, network partition, bad deployment, and traffic spikes.
162
+
163
+ For `/system-lab debug`, reveal evidence incrementally and ask what evidence the learner would inspect next. Do not implement the fix in learning mode.
164
+
165
+ ## 9. Capacity and performance mode
166
+
167
+ Use explicit learner/design assumptions, not invented production numbers.
168
+
169
+ Connect:
170
+
171
+ ```text
172
+ DAU / active users
173
+ requests per user
174
+ peak multiplier
175
+ read/write mix
176
+ payload size
177
+ retention
178
+ fan-out
179
+ latency/SLO target
180
+ ```
181
+
182
+ with derived average/peak RPS, write RPS, bandwidth, storage growth, and latency-budget reasoning. Explain simplifying assumptions.
183
+
184
+ A scale slider or changed workload is a prompt to re-evaluate bottlenecks and complexity; it is not proof that a specific technology is required.
185
+
186
+ ## 10. Distributed-systems and messaging mode
187
+
188
+ Practice:
189
+
190
+ - strong/eventual/read-after-write consistency;
191
+ - optimistic concurrency and conflict handling;
192
+ - idempotency and deduplication;
193
+ - at-least-once delivery and the limits of "exactly once" claims;
194
+ - ordering and partitioning;
195
+ - retry/backoff/DLQ behavior;
196
+ - outbox/inbox patterns;
197
+ - sagas/compensation;
198
+ - distributed locks only when justified.
199
+
200
+ Use timelines when helpful. Make the learner reason about state before and after duplicate, delayed, failed, or reordered events.
201
+
202
+ ## 11. API, security, observability, testing, and deployment lenses
203
+
204
+ API:
205
+ - contract shape, validation, versioning, auth, errors, pagination, idempotency, downstream coupling.
206
+
207
+ Security:
208
+ - trust boundaries, public exposure, authentication, authorization, secret handling, PII/data classification, replay/abuse/rate limiting.
209
+
210
+ Observability:
211
+ - logs, metrics, traces, SLOs, correlation, dependency health, saturation/queue depth, evidence gaps.
212
+
213
+ Testing:
214
+ - unit/integration/contract/e2e boundaries, failure-path coverage, architecture risks not currently exercised.
215
+
216
+ Deployment:
217
+ - artifact/process/container topology, environment/config boundaries, health/readiness, scaling, rollout/rollback, region/failure-domain assumptions.
218
+
219
+ Treat missing evidence as a learning question, not a defect by itself.
220
+
221
+ ## 12. Architecture evolution and counterfactuals
222
+
223
+ Use the current system as the baseline and explore changes such as:
224
+
225
+ ```text
226
+ remove the cache
227
+ make a synchronous path asynchronous
228
+ increase traffic 10x/100x
229
+ move from SQLite to a server database
230
+ introduce multi-region requirements
231
+ split or recombine a service
232
+ add a queue/search/object store/CDN
233
+ tighten latency/availability/privacy requirements
234
+ ```
235
+
236
+ For each evolution:
237
+
238
+ ```text
239
+ problem/evidence
240
+ → change
241
+ → expected benefit
242
+ → new complexity/failure modes
243
+ → migration path
244
+ → when NOT to do it
245
+ ```
246
+
247
+ Prefer evolutionary design over cargo-cult complexity.
248
+
249
+ ## 13. Tradeoff and "why not?" drills
250
+
251
+ Challenge choices with credible alternatives:
252
+
253
+ ```text
254
+ Why not a monolith?
255
+ Why not microservices?
256
+ Why not Kafka/a queue?
257
+ Why not synchronous HTTP?
258
+ Why not cache this?
259
+ Why not shard now?
260
+ Why not retry here?
261
+ Why not use the existing relational database?
262
+ ```
263
+
264
+ The goal is to defend the simplest design that satisfies current constraints, then adapt when constraints materially change.
265
+
266
+ ## 14. Architecture decisions
267
+
268
+ When ADRs or documented decisions exist, connect diagram components/edges to them. For each major choice discuss:
269
+
270
+ ```text
271
+ context
272
+ chosen decision
273
+ alternatives
274
+ tradeoffs
275
+ consequences
276
+ revisit trigger
277
+ ```
278
+
279
+ Do not silently create durable ADRs in learning mode.
280
+
281
+ ## 15. Change-focused learning
282
+
283
+ `/system-lab changes <work-item>` should focus on the accepted/delivered change set when evidence is available.
284
+
285
+ Show:
286
+
287
+ - added/removed/changed components and dependencies;
288
+ - affected runtime/data/message paths;
289
+ - newly introduced or materially changed failure modes;
290
+ - new security/observability/performance/testing questions;
291
+ - architecture decisions or assumptions worth explaining.
292
+
293
+ A changed file is evidence that a component was touched, not proof that its runtime behavior changed. Keep that distinction visible.
294
+
295
+ ## 16. Interview mode
296
+
297
+ Make the human drive:
298
+
299
+ ```text
300
+ requirements
301
+ → constraints + scale assumptions
302
+ → API/contracts
303
+ → data/storage
304
+ → high-level architecture
305
+ → deep dive
306
+ → bottleneck/failure analysis
307
+ → consistency/reliability
308
+ → security/observability
309
+ → evolution
310
+ → tradeoff defense
311
+ ```
312
+
313
+ Perturb one material constraint at a time: 20x traffic, multi-region, strict data residency, unreliable dependency, tighter p99, zero-downtime migration, duplicate delivery, cost pressure, or new abuse threat.
314
+
315
+ Score/coach the independent system-design competencies rather than assigning one generic score.
316
+
317
+ ## 17. Cross-lab navigation
318
+
319
+ System Lab owns system context; Database Lab owns schema/query/ORM/plan depth.
320
+
321
+ When a system node represents a database, explicitly offer `/db-lab` for deeper relational/query evidence. When `/db-lab` reaches system-level concerns such as service boundaries, traffic, availability, or end-to-end runtime flow, offer `/system-lab`.
322
+
323
+ Do not duplicate database internals inside System Lab or architecture reasoning inside Database Lab.
324
+
325
+ ## 18. Delivery-completion visibility
326
+
327
+ After successful delivery, Lean may recommend the labs as optional learning while the change is fresh.
328
+
329
+ - If database-related evidence changed, make `/db-lab` or `/db-lab changes <work-item>` visibly recommended.
330
+ - If architecture/runtime/API/messaging/deployment/security/observability behavior changed, make `/system-lab` or `/system-lab changes <work-item>` visibly recommended.
331
+ - If neither is especially relevant, the labs may remain visible as available options without claiming the ticket changed them.
332
+ - Never use user-facing wording such as "rebuild the diagram" or "refresh the database model". Running a lab already means inspect current evidence and generate the current view.
333
+ - Best-effort disposable artifact generation after delivery is allowed when safe and cheap, but failure to generate a learning artifact never changes delivery state.