diff --git a/AGENTS.md b/AGENTS.md index 69f4a3ce3e..f2be76add7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,9 +18,13 @@ 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 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 what this version couldn't read; a reader checks the version it is given ([saved files](docs/maintaining.md#saved-files-and-settings)). diff --git a/docs/architecture.md b/docs/architecture.md index 3186df442c..bc38679e3e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -75,11 +75,13 @@ 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](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