From b5414ce16b8ace8c0287eff3762994898250d2c8 Mon Sep 17 00:00:00 2001 From: mavrick Date: Wed, 2 Dec 2026 21:13:37 -0600 Subject: [PATCH 1/3] docs(agents): report a loss with its loss code The Never silent rule pointed contributors at plain Session::notify, which --strict, Python's DataLossWarning and MCP's losses can't see. Since #2371 coded the backlog, several merged changes have added plain loss notices again. Name the coded paths, keep plain notify for what isn't a loss, and have the test check the code too. --- AGENTS.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 69f4a3ce3e..1be61ac87a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,9 +18,14 @@ Before picking work, read [ROADMAP.md](ROADMAP.md) (check Underway) and ## Never silent - A reader, writer, tool or command that drops, truncates or approximates data says what, how much and where: Z values dropped, field names cut, a CRS assumed, features skipped. -- Report through `Session::notify` (app, CLI, Python `take_notices`) or `ToolResult::messages`, - one notice per kind with a count; `eprintln!` alone doesn't count. Unusable results are errors. -- Test both ways: lossy input gives the notice, clean input none. Existing silent losses are bugs. +- Report a loss with its code from `rustgis_data::loss::LossCode` (`Session::notify_loss` or + `notify_counted` in the engine, `Note::loss` in readers and writers, `LossMessage` in a tool's + `ToolResult::losses`), so `--strict`, Python's `DataLossWarning` and MCP's `losses` see it. Plain + `Session::notify` is for what isn't a loss: an ignored parameter, a policy, a "may". A loss no + code fits gets a new code and its entry in `docs/user-guide/loss-codes.md`. One notice per kind + with a count; `eprintln!` alone doesn't count. Unusable results are errors. +- Test both ways: lossy input gives the notice and its code, clean input none. Existing silent + losses are bugs. - A file or setting from a newer RustGIS is refused or kept unchanged, never saved again without what this version couldn't read; a reader checks the version it is given ([saved files](docs/maintaining.md#saved-files-and-settings)). From 49b4e4036b434467c57bad8a624346fcc95b3909 Mon Sep 17 00:00:00 2001 From: mavrick Date: Wed, 2 Dec 2026 21:25:47 -0600 Subject: [PATCH 2/3] docs(architecture): never silent names the coded loss paths too --- docs/architecture.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 3186df442c..a5355253a7 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -75,11 +75,14 @@ commands are skipped. ## Never silent When a reader, writer, tool or command can't represent something, approximates it or drops it, it -says so in a notice: what was lost, how much and where. Notices go through `Session::notify`, -which the app shows, the CLI prints and Python returns from `take_notices`. Commands pass on the -notes readers return, and geoprocessing tools report theirs in `ToolResult::messages`. A result -that would be unusable is an error instead. Older code doesn't yet report every loss; each one -found is treated as a bug. +says so in a notice: what was lost, how much and where, with a loss code +([Data loss codes](user-guide/loss-codes.md)). Readers and writers return coded notes +(`Note::loss`), commands pass them on with `Session::notify_loss` or `notify_counted`, and +geoprocessing tools report theirs in `ToolResult::losses`. The app shows the notices, the CLI +prints them and Python returns them from `take_notices`; the code is what `--strict`, Python's +`DataLossWarning` and MCP's `losses` act on. Plain `Session::notify` carries notices that aren't +a loss. A result that would be unusable is an error instead. Older code doesn't yet report every +loss, or reports some without a code; each one found is treated as a bug. ## Pure Rust From 481fb5a4a305034f10950a503fda18535fbcb399 Mon Sep 17 00:00:00 2001 From: mavrick Date: Wed, 2 Dec 2026 21:29:22 -0600 Subject: [PATCH 3/3] docs: trim the loss-code wording --- AGENTS.md | 11 +++++------ docs/architecture.md | 13 ++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1be61ac87a..f2be76add7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,12 +18,11 @@ Before picking work, read [ROADMAP.md](ROADMAP.md) (check Underway) and ## Never silent - A reader, writer, tool or command that drops, truncates or approximates data says what, how much and where: Z values dropped, field names cut, a CRS assumed, features skipped. -- Report a loss with its code from `rustgis_data::loss::LossCode` (`Session::notify_loss` or - `notify_counted` in the engine, `Note::loss` in readers and writers, `LossMessage` in a tool's - `ToolResult::losses`), so `--strict`, Python's `DataLossWarning` and MCP's `losses` see it. Plain - `Session::notify` is for what isn't a loss: an ignored parameter, a policy, a "may". A loss no - code fits gets a new code and its entry in `docs/user-guide/loss-codes.md`. One notice per kind - with a count; `eprintln!` alone doesn't count. Unusable results are errors. +- Report a loss with a `LossCode` (`Session::notify_loss` or `notify_counted` in the engine, + `Note::loss` in readers and writers, `ToolResult::losses` in tools), so `--strict`, Python and + MCP see it; a loss no code fits gets a new one. Plain `Session::notify` is for what isn't a + loss, such as an ignored parameter or a "may". One notice per kind with a count; `eprintln!` + alone doesn't count. Unusable results are errors. - Test both ways: lossy input gives the notice and its code, clean input none. Existing silent losses are bugs. - A file or setting from a newer RustGIS is refused or kept unchanged, never saved again without diff --git a/docs/architecture.md b/docs/architecture.md index a5355253a7..bc38679e3e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -75,13 +75,12 @@ commands are skipped. ## Never silent When a reader, writer, tool or command can't represent something, approximates it or drops it, it -says so in a notice: what was lost, how much and where, with a loss code -([Data loss codes](user-guide/loss-codes.md)). Readers and writers return coded notes -(`Note::loss`), commands pass them on with `Session::notify_loss` or `notify_counted`, and -geoprocessing tools report theirs in `ToolResult::losses`. The app shows the notices, the CLI -prints them and Python returns them from `take_notices`; the code is what `--strict`, Python's -`DataLossWarning` and MCP's `losses` act on. Plain `Session::notify` carries notices that aren't -a loss. A result that would be unusable is an error instead. Older code doesn't yet report every +says so in a notice: what was lost, how much and where, with a +[loss code](user-guide/loss-codes.md). The app, the CLI and Python (`take_notices`) show the +notice; `--strict`, Python's `DataLossWarning` and MCP's `losses` act on the code. Readers and +writers return coded notes (`Note::loss`), commands pass them on with `Session::notify_loss`, and +tools report theirs in `ToolResult::losses`; plain `Session::notify` carries the rest. A result +that would be unusable is an error instead. Older code doesn't yet report every loss, or reports some without a code; each one found is treated as a bug. ## Pure Rust