# fix: [210] Clojure Polylith + per-file stratified design compliance pass

**Branch:** `fix/compliance-210-clojure-polylith-per-file-stratified-design`
**Date:** 2026-05-01

---

```yaml
generated-by: miniforge-compliance-scanner
rule-id: 210
rule-title: "Clojure Polylith + per-file stratified design"
fix-type: mechanical
violations-fixed: 15
files-changed: 5
date: 2026-05-01
note: "5 sites reverted from the auto-fix because (or (:k m) default) was load-bearing — see PR description."
```

---

## Summary

Automated compliance pass applying mechanical fixes for **Clojure Polylith + per-file stratified design** (Dewey 210).
15 violations applied; 5 reverted (see PR description).

## Files Changed (kept)

| File | Line | Current | Suggested |
|------|------|---------|-----------|
| `components/event-stream/src/ai/miniforge/event_stream/core.clj` | 238 | `(or (:persist-tier data) :worktree)` | `(get data :persist-tier :worktree)` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 179 | `(or (:out r) "")` | `(get r :out "")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 180 | `(or (:err r) "could not resolve HEAD")` | `(get r :err "could not resolve HEAD")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 186 | `(or (:out r) "")` | `(get r :out "")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 188 | `(or (:err r) "git status --porcelain failed")` | `(get r :err "git status --porcelain failed")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 197 | `(or (:out r) "0")` | `(get r :out "0")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 202 | `(or (:err r) "git rev-list --count failed")` | `(get r :err "git rev-list --count failed")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 209 | `(or (:err r) "git add -A failed")` | `(get r :err "git add -A failed")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 222 | `(or (:err r) "git commit --no-verify failed")` | `(get r :err "git commit --no-verify failed")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 228 | `(or (:out r) "")` | `(get r :out "")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 230 | `(or (:err r) "git rev-parse HEAD failed")` | `(get r :err "git rev-parse HEAD failed")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 243 | `(or (:err r) "git bundle create failed")` | `(get r :err "git bundle create failed")` |
| `components/dag-executor/src/ai/miniforge/dag_executor/protocols/impl/worktree.clj` | 358 | `(or (:err r) "git fetch from bundle failed")` | `(get r :err "git fetch from bundle failed")` |
| `bases/cli/src/ai/miniforge/cli/main/commands/etl.clj` | 262 | `(or (:paths opts) ".")` | `(get opts :paths ".")` |
| `components/tui-views/src/ai/miniforge/tui_views/view/project.clj` | 389 | `(or (:key row) "")` | `(get row :key "")` |
| `components/tui-views/src/ai/miniforge/tui_views/view/project.clj` | 393 | `(or (:duration row) "")` | `(get row :duration "")` |

## Reverted (see PR description for rationale)

| File | Line | Why |
|------|------|------|
| `components/agent/src/ai/miniforge/agent/planner.clj` | 510 | `:message` from `(llm/get-error …)` can be explicit nil; `(get …)` would drop the fallback string |
| `components/dag-primitives/src/ai/miniforge/dag_primitives/result.clj` | 57 | `:message` can be `(.getMessage e)` returning nil; `(get …)` would produce a nil-message anomaly |
| `components/tool/src/ai/miniforge/tool/core.clj` | 195–196 | `:name` / `:description` can be explicit nil; `(get …)` returns nil and `str/lower-case nil` NPEs |

## Verification

- Re-run `bb miniforge run docs/compliance/miniforge-scan.md` to confirm zero violations for this rule
- All fixes are mechanical — no semantic changes

---
*Auto-generated by the Miniforge compliance scanner.*
