From 6ec6c5cbd6bec17017ddee21af82eb6655a58632 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 30 Aug 2026 10:25:13 +0200 Subject: [PATCH] Count the tags this rule would have cost, rather than guessing at it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module doc said an extractor keyed on string literals would "lose six genuine tags to save two false ones". The six is right — `schema.rs` carries that many `-- TRACES:` lines inside Rust literals — but the two undercounted the false ones, which were R1 twice, FR-CAT-1 twice, FR-CAT-2, NFR-P1, one in `gestures.rs` and two emitted by `dr-pipeline/build.rs`. The comparison it was drawing does not need a number on that side to hold. Co-Authored-By: Claude Opus 5 (1M context) --- tools/traceability/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/traceability/src/lib.rs b/tools/traceability/src/lib.rs index 8846d27..fa648fc 100644 --- a/tools/traceability/src/lib.rs +++ b/tools/traceability/src/lib.rs @@ -28,11 +28,10 @@ //! reported implemented on the strength of two string literals in a unit test. //! //! 3. **A tag is a comment whose first word is `TRACES:`**, not a line in which -//! the string appears. This is a rule about position -//! rather than about string literals, because `schema.rs` writes real tags -//! inside string literals — the SQL it embeds is commented with `--` — and -//! an extractor that refused those would lose six genuine tags to save two -//! false ones. +//! the string appears. See `tag_body`. It is a rule about position rather +//! than about string literals, because `schema.rs` writes six real tags +//! *inside* string literals — the SQL it embeds is commented with `--` — so +//! an extractor that refused string literals would lose more than it saved. use std::collections::{BTreeMap, BTreeSet}; use std::path::{Path, PathBuf};