Answer product-owner round 1: 0 🔴, 3 🟡 (0 misread); tell the worker what to do with the fact, name the decision log, say what a space-indented file keeps meanwhile

This commit is contained in:
2026-11-27 15:52:03 +01:00
parent bbaa56d0ec
commit 86f67899f6
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -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:
+1 -1
View File
@@ -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), [])
+4 -2
View File
@@ -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.