From 4eb41a00a6b2716363a91ee6cc26ae4dc93c0376 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 1 Oct 2026 17:58:59 +0200 Subject: [PATCH 1/2] Ground one spelling per goal in one home per fact and one obvious way per need, and let a public API serve different needs --- CLAUDE.md | 9 ++++----- todo.md | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 25eb4c4e..71e03a24 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -38,11 +38,10 @@ The design rules every project follows, compose-not-entangle first: `~/.claude/p ## One spelling per goal -- When two spellings reach the same result, make one work and reject the other. Supporting both needs a stated reason, written down. -- Reject the redundant spelling as early as possible — at load, parse or compile, not at use — and have the error name the spelling to use instead: `token {p} renders a level that {p.first} reads a path into; name the fields you want instead`. -- Where the two spellings can *disagree*, this is a correctness rule. A caveat in the README does not close it. -- One spelling in two places is two spellings: reject the copied value at load and name the place that keeps it. -- Applies to data formats, config, CLI flags, public APIs and prose alike, a CHANGELOG line included. +- **One authoritative home per fact.** A value, rule or definition lives in one place, and everywhere else derives it from there or points at it. A copy that can drift is a second spelling: derive it from its owner, or, for config a human writes, reject it where it is read and name the owner. +- **One obvious way per need.** Before adding a way to do something, find the existing one and use it. Where two spellings serve the same caller for the same need, keep one and reject the other as early as possible — at load, parse or compile — with an error naming the one to use: `token {p} renders a level that {p.first} reads a path into; name the fields you want instead`. +- **Different needs may have different ways.** A public API may offer a convenience beside the general form — a one-line call for the common case over the primitive for the rest — where each serves a caller or scenario its docs name, and the convenience is built from the primitive. Code that looks alike but encodes different knowledge is not a second spelling: merging it is the wrong abstraction. +- **Two spellings that can disagree are a correctness bug**, whatever the reason for having both: derive one from the other, or reject the combination. ## Working loop diff --git a/todo.md b/todo.md index b6f69d57..995f6b10 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ The rebuild lifts every dimension, one chunk per item, until the last item opens ## 0.2.0 - **Sort `bin/`'s imports on their first binding, per `CLAUDE.md` → "Code style", and keep that rule in one place.** Today they sort by path, so a module move reorders unchanged lines; `CLAUDE.md` and `principles/technical-principles.md` each state the sort key, neither says how case sorts, and "host packages" names no Python group. -- **Reword `CLAUDE.md` → "One spelling per goal" so a copy in code is derived from its owner, and drop the README-caveat sentence and the scope list.** A prose pass found "reject at load" fits only copied config, and the scope list reads as excluding internal code. - **Name CLI flags and exit codes among larv-review's external contracts, or record that they do not fire the architecture pass.** A prose pass found the product-owner row names the CLI and the architecture row does not. - **Show the judge's reply when `loop-claude` rejects its verdict.** Its stdout is discarded, so a judge that failed three times running leaves nothing to diagnose. - **Back up `loop-claude`'s transcript archive to a destination other than this repo's remote.** -- 2.52.0 From 26877dc761685ff89156f316a5aa034908ac33e3 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 1 Oct 2026 18:05:52 +0200 Subject: [PATCH 2/2] Move one spelling per goal into the technical principles as DRY read as knowledge --- CLAUDE.md | 7 ------- principles/technical-principles.md | 7 +++++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 71e03a24..4ca33727 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,13 +36,6 @@ Shorter is better, none is best — chat output, commit messages, comments, docs The design rules every project follows, compose-not-entangle first: `~/.claude/principles/technical-principles.md`. Read it before designing or reviewing code. -## One spelling per goal - -- **One authoritative home per fact.** A value, rule or definition lives in one place, and everywhere else derives it from there or points at it. A copy that can drift is a second spelling: derive it from its owner, or, for config a human writes, reject it where it is read and name the owner. -- **One obvious way per need.** Before adding a way to do something, find the existing one and use it. Where two spellings serve the same caller for the same need, keep one and reject the other as early as possible — at load, parse or compile — with an error naming the one to use: `token {p} renders a level that {p.first} reads a path into; name the fields you want instead`. -- **Different needs may have different ways.** A public API may offer a convenience beside the general form — a one-line call for the common case over the primitive for the rest — where each serves a caller or scenario its docs name, and the convenience is built from the primitive. Code that looks alike but encodes different knowledge is not a second spelling: merging it is the wrong abstraction. -- **Two spellings that can disagree are a correctness bug**, whatever the reason for having both: derive one from the other, or reject the combination. - ## Working loop How work proceeds in any repo, unless that repo's `AGENTS.md` says otherwise. diff --git a/principles/technical-principles.md b/principles/technical-principles.md index ce67c347..e1f13714 100644 --- a/principles/technical-principles.md +++ b/principles/technical-principles.md @@ -48,8 +48,11 @@ - Sort it, on a key that does not move: the name a line introduces, never where it came from. A sorted list is searchable, its diff shows only what changed, and two edits to it conflict only where they mean to. * Keep It Simple, Stupid (KISS). - Keep solutions simple and easy to understand, so it is dead easy to grasp what they do. -* Don't Repeat Yourself (DRY). - - Reuse code instead of duplicating it; one concept, one implementation. +* Don't Repeat Yourself (DRY): one authoritative home per piece of knowledge, one obvious way per need. + - A value, rule, definition or concept lives in one place, and everywhere else derives it from there or points at it. A copy that can drift is a second spelling: derive it from its owner, or, for config a human writes, reject it where it is read and name the owner. + - Before adding a way to do something, find the existing one and use it. Where two spellings serve the same caller for the same need, keep one and reject the other as early as possible — at load, parse or compile — with an error naming the one to use: `token {p} renders a level that {p.first} reads a path into; name the fields you want instead`. + - Different needs may have different ways. A public API may offer a convenience beside the general form — a one-line call for the common case over the primitive for the rest — where each serves a caller or scenario its docs name, and the convenience is built from the primitive. Code that looks alike but encodes different knowledge is not a second spelling: merging it is the wrong abstraction. + - Two spellings that can disagree are a correctness bug, whatever the reason for having both: derive one from the other, or reject the combination. * All critical flows should have good traces, from where something was initiated until it completed. - Use traceparent OTLP and standardized logging for this. * Prefer the vendor-neutral option, and know what leaving would cost. -- 2.52.0