From 86f67899f62f6767e32843ba7e8ef330420ea041 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 27 Nov 2026 15:52:03 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20product-owner=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20tell=20the?= =?UTF-8?q?=20worker=20what=20to=20do=20with=20the=20fact,=20name=20the=20?= =?UTF-8?q?decision=20log,=20say=20what=20a=20space-indented=20file=20keep?= =?UTF-8?q?s=20meanwhile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/chunk_preflight/facts.py | 4 ++-- bin/chunk_preflight/test_chunk_preflight.py | 2 +- principles/technical-principles.md | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/chunk_preflight/facts.py b/bin/chunk_preflight/facts.py index 38541271..a8fc9ce0 100644 --- a/bin/chunk_preflight/facts.py +++ b/bin/chunk_preflight/facts.py @@ -40,12 +40,12 @@ def merge_lines(found: Gathered) -> list[str]: def indentation_lines(found: SpaceIndented | Failure | None) -> list[str]: - """The one fact about indentation: the project's code is space-indented with no setting that says so. It only reports: a client's repo belongs to its team.""" + """The fact about indentation, where the project's code is space-indented and no setting sets the indent, else why that cannot be read. It reports only and never fails the run, since a client's repo belongs to its team.""" if isinstance(found, Failure): return [f"- Whether the project's code is space-indented cannot be read: {found.reason}"] if found is None: return [] - return [f"- The project's code is space-indented ({found.spaced} lines against {found.tabbed} with tabs), and no `.editorconfig` with `indent_style` nor formatter setting (`rustfmt.toml` `hard_tabs`, Prettier `useTabs`, Biome `indentStyle`) says so. The technical principles indent with hard tabs unless a setting a tool reads, plus a decision in `docs/decisions.md` that names the reason, overrides that. Either convert the code to tabs, or record the override in `.editorconfig` and a decision."] + return [f"- The project's code is space-indented ({found.spaced} lines against {found.tabbed} with tabs), and neither an `.editorconfig` with `indent_style` nor a formatter setting (`rustfmt.toml` `hard_tabs`, Prettier `useTabs`, Biome `indentStyle`) sets the indent. The technical principles indent with hard tabs unless a setting a tool reads, plus a decision in the project's decision log that names the reason, overrides that. Don't reindent in a chunk with another purpose. Where the plan holds no item for either way out, file one: convert the code to tabs, or record the override in `.editorconfig` and a decision."] def last_release(default: str, release: LastCut) -> str: diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index 2afb7443..44a76492 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -811,7 +811,7 @@ class IndentationFact(unittest.TestCase): (line,) = self.said(SpaceIndented(spaced=120, tabbed=3)) self.assertIn("space-indented (120 lines against 3 with tabs)", line) self.assertIn("The technical principles indent with hard tabs", line) - self.assertIn("convert the code to tabs, or record the override in `.editorconfig` and a decision", line) + self.assertIn("file one: convert the code to tabs, or record the override in `.editorconfig` and a decision", line) def test_says_nothing_where_the_code_is_not_space_indented_and_why_where_it_cannot_be_read(self): self.assertEqual(self.said(None), []) diff --git a/principles/technical-principles.md b/principles/technical-principles.md index aa8b2f4f..3157a948 100644 --- a/principles/technical-principles.md +++ b/principles/technical-principles.md @@ -70,7 +70,7 @@ - Enumerate the cases that can go wrong and return them as explicit results (e.g. a result DTO with an optional error), so failure is part of the signature instead of a hidden second channel. - try/catch lives only at the edges, wrapped tightly around the call that can actually throw (DB, HTTP, filesystem), converting the exception into an explicit result right there. Pure functions and core logic never throw or catch for control flow. - A function that both returns a result and throws for some inputs has two error channels; collapse to one. Throw only for a truly unrecoverable state. - - Where code branches on why a call failed, it reads a status code, an exit code the tool documents, or a typed error. It reads message text only where the tool documents that text as unique to one cause, and treats every other failure as unknown, which stops the run rather than guessing. Older versions of a CLI often print one message for a missing image, a refused credential and a failed request. + - Where code branches on why a call failed, it reads a status code, an exit code the tool documents, or a typed error. It reads message text only where the tool documents that text as unique to one cause, and treats every other failure as unknown, which stops the run. * Commands and Queries Separation (CQS)-ish - Queries must never modify data, commands may only return data that is the result of their change. * Copy important contextual information on buisness transactions and equal data, instead of referencing it. @@ -118,4 +118,6 @@ - A Python script with a `#!/usr/bin/env python3` shebang runs identically across systems where shell dialects and builtins differ. - Read config (credentials, hosts, paths) from CLI params or env vars, never hardcoded. * Indent with hard tabs by default. - - Only a setting a tool reads overrides it: `.editorconfig` or a formatter's config (Prettier, `rustfmt.toml`, Biome, …), plus a decision in `docs/decisions.md` that names the reason. A prose rule in `AGENTS.md`, or the existing files' habit, doesn't. Output formats a spec fixes, such as a spelling's JSON, are outside the rule. `chunk-preflight` reports space-indented code that has no such setting. + - Overriding it takes two things: a setting a tool reads (`.editorconfig` or a formatter's config, such as Prettier, `rustfmt.toml` or Biome) and a decision in the decision log that names the reason. A prose rule in `AGENTS.md`, or the existing files' habit, doesn't override it. + - Files whose format fixes their indentation, such as YAML (no tabs) or a spelling's JSON, are outside the rule. + - A file already indented with spaces keeps them until the project converts it or records the override, so no file mixes the two. `chunk-preflight` reports a project in that state where `.editorconfig`, `rustfmt.toml`, Prettier and Biome set nothing about it.