← How the benchmark works
diff --git a/openspec/config.yaml b/openspec/config.yaml
index 7ecd4cf05dce35a16784b6d7ea6474c4f6b64ca7..ef3678b1b8f78a6683e071b95c2b5cb0bf04e86b 100644
--- a/openspec/config.yaml
+++ b/openspec/config.yaml
@@ -21,3 +21,46 @@ context: |
Code under `src/domain/` never throws: an operation that can fail returns a `Result`, with an error
that says what went wrong.
+
+ ## About the project
+
+ - `tidy-tasks`: the in-memory task list behind the Tidy Tasks to-do app (tasks have a title, a priority
+ `low|normal|high`, tags and a status `open|done`). The app's screens use only the public API exported
+ from `src/index.ts`; a new capability is reachable only if it is exported there.
+ - TypeScript (ES2022, ESM, `strict`, `NodeNext`), run directly by Node with type stripping: imports of
+ local files use the `.ts` extension, and only erasable syntax is allowed (no `enum`, no namespaces, no
+ constructor parameter properties). No build step; `package.json` has no runtime dependencies.
+ - Layout: `src/domain/task.ts` (task type and pure task functions), `src/domain/list.ts` (the in-memory
+ list, `createTaskList`), `src/domain/result.ts` (`Result`, `ok`, `err`, `valueOr`, `TodoErrorCode`),
+ `src/domain/summary.ts` (`summarize`), `src/index.ts` (public API), `test/*.test.ts` (tests).
+ - Tests: `npm test` (`node --test`, `node:test` with `node:assert/strict`, in `test/*.test.ts`, importing
+ from `../src/index.ts`). Run it before calling work done; add or update tests for every behaviour
+ change, including each failure path of a new operation.
+
+ ## Conventions
+
+ - Data is immutable: types use `readonly` fields and `readonly` arrays; task functions return a new
+ object rather than changing the one given.
+ - Task titles are trimmed, and are the key of the list (each title once). Tags keep the order given, each once.
+ - Failures use the existing `TodoErrorCode`s (`not-found`, `duplicate`, `invalid-state`); add a code to
+ `result.ts` only when none fits. Error messages are written for the person using the app.
+ - Pure task logic goes in `task.ts` and returns `Result` where it can fail; `list.ts` stores and
+ composes it. Types the app needs are re-exported from `src/index.ts`.
+ - Exported interfaces, types and constants get a one-line `/** … */` comment, as the existing ones have.
+ Parameter docs use `@param name - what it is`.
+ - Style: single quotes, semicolons, 2-space indent, trailing commas in multi-line literals, `ok(...)`
+ and `err(code, message)` to build results, results checked with `if (!result.ok) return result;`.
+ - Display order of tasks: open before done, then most urgent first, then by title (`compareTasks`).
+
+rules:
+ proposal:
+ - State which of the project's rules above the change touches, and how it stays within them.
+ - Say whether the public API in `src/index.ts` changes.
+ specs:
+ - Write requirements about behaviour a person using the app can observe, including the failure cases and their error codes.
+ design:
+ - Keep the domain pure and free of clock and randomness; if a time or an identifier is needed, it is passed in by the caller.
+ - Do not plan a new runtime dependency.
+ tasks:
+ - Include a task to add or update tests in `test/` for each behaviour, and a final task to run `npm test`.
+ - Include a task for TSDoc on each new exported function, and for exporting new public types or functions from `src/index.ts` when the app needs them.