# @oshun/tara-workbench

Domain logic for the **Tara Content Workbench** — the V1 creation/curation
workspace for Tara (meditation/mindfulness) content. Design:
[`V1/TARA_CONTENT_WORKBENCH_DESIGN_2026-07-19.md`](../../../V1/TARA_CONTENT_WORKBENCH_DESIGN_2026-07-19.md);
task ledger:
[`TARA_CONTENT_WORKBENCH_TODOS_2026-07-19.md`](../../../TARA_CONTENT_WORKBENCH_TODOS_2026-07-19.md).

## At a glance

- **Path:** `libs/oshun/tara-workbench`
- **Nx project:** `@oshun/tara-workbench`
- **Pure ESM source library** (like `@oshun/studio-authoring`): injected clocks
  and ids, no I/O — durability and transport live at the BFF boundary
  (`apps/oshun/bff`).

## Modules

| Module                  | What it owns                                                                                             |
| ----------------------- | -------------------------------------------------------------------------------------------------------- |
| `types`                 | Entities: Spark, Concept/premise, Source/Claim/CitationLink, Program, CategoryRow, gate results, bundles |
| `state-machine`         | The maturity ladder (spark → … → published) with evidence-based transition guards                        |
| `script-blocks`         | Duration-typed guidance blocks (spoken, breath-cue, silence, bell) + deterministic timeline compilation  |
| `gates`                 | Duration-coherence and transcript/captions gates; the honest `unavailable` audio-QA seam                 |
| `invitational-language` | Meditation-adapted directive-language linter (ported from the V3 yoga linter, attributed)                |
| `grounding`             | Claim severity floors, clinical-grade support rules, grounding gate, source blast radius                 |
| `steering-overlay`      | Program overlays composed onto the global `CreativeDirection` — tighten-only autonomy, raise-only bars   |
| `category-registry`     | tara.\* category merge over the plane's code floor (`V1_AUTONOMY_LAUNCH_CATEGORIES`), tighten-only       |
| `decision-records`      | ADR-style creative decisions; idea-score blend/display helpers over plane `IdeaScoreBreakdown`           |
| `manifest`              | Publish-manifest builder mirroring `apps/tara/content/schemas/meditation.schema.json` (golden-tested)    |
| `provider`              | `TaraWorkbenchModelProvider` LLM seam (diverge/extractClaims/assistScript) — fail-loud `not_configured`  |

## Fail-loud seams

Every backing dependency (LLM provider, Sophia grounding, TTS, autonomy plane,
content tree) refuses with a typed `not_configured`/`unavailable` rather than
fabricating output. See design §8 and `errors.ts`.

## Commands

```bash
pnpm nx test @oshun/tara-workbench
pnpm nx lint @oshun/tara-workbench
pnpm nx typecheck @oshun/tara-workbench
```
