diff --git a/context/examples/catalog.md b/context/examples/catalog.md index 327806b..b8d2b8f 100644 --- a/context/examples/catalog.md +++ b/context/examples/catalog.md @@ -2,7 +2,7 @@ -> Source of truth: `tools/examples-catalog/config.mjs`. Exemplar status: all 10 exemplar files pass oxlint. +> Source of truth: `tools/examples-catalog/config.mjs`. Exemplar status: all 12 exemplar files pass oxlint. The reference shape for each kind of unit in this repo. Copy the linked exemplar instead of inventing a shape. Every entry points at real, in-repo code that @@ -60,6 +60,16 @@ passes lint and (where paired) ships with its test — no throwaway samples. - Node built-ins imported explicitly; no hidden globals. - Ships WITH its test — no untested lib modules. +### Read-only plan / filesystem apply boundary + +- **Exemplar:** `./src/lib/writer.ts` +- **Paired with:** `./tests/writer-plan.test.ts` +- **When to use:** Adding preview, dry-run, or conflict reporting to a filesystem workflow without letting read-only and mutating paths drift. +- **Shape:** + - planBundle classifies every action without writing or prompting; applyBundle consumes that same plan. + - The shared result vocabulary covers created, unchanged, updated, and conflict outcomes. + - Parity tests prove planner classifications match apply results across the important state transitions. + ### API client seam (allowlisted hosts) - **Exemplar:** `./src/lib/api-client.ts` diff --git a/tools/examples-catalog/config.mjs b/tools/examples-catalog/config.mjs index e221d46..89b5e50 100644 --- a/tools/examples-catalog/config.mjs +++ b/tools/examples-catalog/config.mjs @@ -84,6 +84,20 @@ export const examples = [ 'Ships WITH its test — no untested lib modules.', ], }, + { + id: 'plan-apply-boundary', + category: 'lib', + title: 'Read-only plan / filesystem apply boundary', + file: 'src/lib/writer.ts', + subject: 'tests/writer-plan.test.ts', + whenToUse: + 'Adding preview, dry-run, or conflict reporting to a filesystem workflow without letting read-only and mutating paths drift.', + shape: [ + 'planBundle classifies every action without writing or prompting; applyBundle consumes that same plan.', + 'The shared result vocabulary covers created, unchanged, updated, and conflict outcomes.', + 'Parity tests prove planner classifications match apply results across the important state transitions.', + ], + }, { id: 'api-seam', category: 'lib',