Skip to content

docs(adrs): [#2913] add ADR: errors do not record source locations - #2930

Merged
josecelano merged 9 commits into
torrust:developfrom
josecelano-bot:2913-adr-errors-do-not-record-source-locations
Nov 18, 2026
Merged

josecelano merged 9 commits into
torrust:developfrom
josecelano-bot:2913-adr-errors-do-not-record-source-locations

Conversation

@josecelano-bot

Copy link
Copy Markdown
Contributor

Closes #2913

Sub-issue SI-1 of EPIC #2912 (remove source locations from errors). It records the maintainer's decision (option 4 of the #2804 audit: remove the field) and changes the guidance. It changes no Rust code; SI-2 to SI-6 implement the decision.

Changes

  • ADR docs/adrs/20261118045443_errors_do_not_record_source_locations.md, listed in docs/adrs/index.md. Root collection, because it binds every package. It records the context (audit result, Make Option to Strip Location from Errors sent to Clients #384, the three objections), the six decision points of the spec, the four options of options.md as alternatives, and the consequences:
    1. Error types have no location field and do not call Location::caller().
    2. The workspace does not use torrust-located-error; a source error is a plain #[source].
    3. Display states what failed and the offending input, never a source path.
    4. Client text is the error's own message; a source error from a crate the workspace does not control is not formatted into it.
    5. Developer diagnostics go to tracing events at the site (server only).
    6. #[track_caller] stays allowed in test helpers and assertion helpers.
  • Skill .claude/skills/handle-errors-in-code/SKILL.md: the "The located-error Package" section and the checklist item "Consider located-error" are replaced by a "No Source Locations in Errors" section with the rule and a link to the ADR, and a checklist item. The description and the "Where" context line no longer suggest a source location.
  • Spec of Record the decision that errors do not record source locations #2913: tasks T1-T3, manual scenario M1 (manual-verification-evidence.md), acceptance criteria and progress log.

Search for other guidance (T3)

No other live guidance recommends a source location. packages/axum-server/README.md and docs/media/packages/dependencies-workspace-packages.md describe the current dependency on torrust-located-error; they stay true until SI-6 drops it, and SI-6 should update them then. docs/packages.md lists the standalone crate, which still exists.

Verification

  • linter all exits 0.
  • No Rust code changed, so no tests apply.
  • M1: followed the skill's checklist for a new error variant; it leads to an error without a location field and links to the ADR (see manual-verification-evidence.md).

🤖 Generated with Claude Code

@josecelano josecelano self-assigned this Nov 18, 2026
@josecelano
josecelano requested review from da2ce7 and a balanced review from Copilot November 18, 2026 07:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

7 open issues
What changed in this PR

Adds an ADR capturing the decision to remove source locations from error types and updates contributor guidance/spec artifacts accordingly.

Changes:

  • Added a new workspace-scoped ADR documenting “errors do not record source locations” and listed it in the ADR index.
  • Updated the handle-errors-in-code skill to remove torrust-located-error guidance and replace it with the new rule + ADR link.
  • Updated the #2913 spec to mark tasks/ACs complete and added manual verification evidence.
File Description
docs/​issues/​open/​2913-2912-si-1-adr-errors-do-not-record-source-locations/​manual-verification-evidence.md Adds manual verification evidence showing the updated skill points to the ADR and enforces “no location field” guidance.
docs/​issues/​open/​2913-2912-si-1-adr-errors-do-not-record-source-locations/​ISSUE.md Marks tasks, scenarios, and acceptance criteria as DONE and updates progress log/metadata.
docs/​adrs/​index.md Registers the new ADR in the ADR index.
docs/​adrs/​20261118045443_errors_do_not_record_source_locations.md Introduces the ADR describing the decision, alternatives, and consequences.
.claude/​skills/​handle-errors-in-code/​SKILL.md Replaces located-error guidance with the “no source locations in errors” rule and links to the ADR.

Review effort: Lite

Comment thread docs/adrs/index.md Resolved
josecelano-bot and others added 5 commits November 18, 2026 08:57
…ions

Records the maintainer's decision for EPIC torrust#2912 (option 4 of the torrust#2804 audit): error types have no location field, the workspace drops torrust-located-error, Display names what failed and the input, client text is the error's own message, developer diagnostics go to tracing, and #[track_caller] stays allowed in test helpers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…no-source-location rule

The handle-errors-in-code skill no longer recommends torrust-located-error: it states the rule of the new ADR and links to it. Records T2, T3 and the manual verification M1 in the SI-1 specification.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…in-code valid Rust

Review finding F1 of PR 2930: the correct and wrong examples used the same variant name in one block. Each is now its own enum in its own block. The rule sentence says 'must not', like the ADR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s, not as the current state

Review findings F2, F3 and F4 of PR 2930: the Agreement and the index row read as if the workspace had already dropped torrust-located-error. They now say 'must not' and that EPIC torrust#2912 removes the existing uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review finding F7 of PR 2930: the 'Relevant tests pass' criterion is checked although no test ran; it now says none applies because no code changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@josecelano-bot
josecelano-bot force-pushed the 2913-adr-errors-do-not-record-source-locations branch from 3cc56a2 to 2995fa3 Compare November 18, 2026 09:00
@josecelano

Copy link
Copy Markdown
Member

ACK 2995fa3

@josecelano
josecelano requested a balanced review from Copilot November 18, 2026 09:01
Records Copilot's seven comments as F1-F7 with their dispositions, replies and the push delay caused by the nightly uncommon_codepoints failure.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

josecelano-bot and others added 2 commits November 18, 2026 09:21
…le and its examples

Review finding F8 of PR 2930: the recommended examples kept an authentication key in a String and printed it through Display and Debug. Agreement point 3 and the skill rule now exclude secrets, as handle-secrets requires; the examples report the expected format and the length, and use the numwant parameter for an input that may be echoed. The ADR's wrong example is now a complete enum in its own block, like the skill's after F1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Records Copilot's finding F8 (secrets in the error examples), its fix, reply and resolution.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@josecelano

Copy link
Copy Markdown
Member

ACK fb5f6c2

@da2ce7 da2ce7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at fb5f6c227dc6124797de9c4f206fb52103e4feb6. Recomputed from the bytes at this head, against the merge base d8e14450d; git merge-tree against develop d8e14450d writes the head's own tree with no conflicts, because develop is the merge base.

Process. create-adr, add-new-skill, create-issue with the evidence template, process-pr-review with its audit template, and commit-changes with open-pull-request govern this PR. Followed.

The change against its claim. Compared with the round-1 head, the rebase left the first two commits unchanged. The new commits do what their subjects say. The skill examples are now one enum per block, the Agreement and the index row state rules rather than the current state, the tests criterion says that none applies, and secrets are kept out of the offending-input rule and its examples, which matches handle-secrets (no secret in error messages). The ADR's facts still match the audit files: 37 production Location::caller() sites and three production #[track_caller] attributes at this head. Two statements do not recompute (F1, F2).

Audit record. It follows the template's sections, fields and table header. Its eight rows match the eight captured threads: each cites a reply posted on its own thread, every thread is resolved, the no-change replies use the prescribed form, and the log times match the replies and commits. The validator's logic, run offline against the capture, reports no failure.

Consistency. Every relative link and frontmatter path in the six files resolves, and the added words are in the dictionary or the tree.

Hygiene. Nine commits, Conventional subjects with [#2913], author = committer. Each commit has one attribution footer line (no rule in the tree on it), and the description carries one attribution footer line too. git diff --check is clean, the skill's commit-id check prints nothing, and the closing-keyword pattern matches only Closes #2913.

Verdict. No finding blocks. The three below are wording in records, which can be corrected in a later commit.

Findings. F1 [Minor] the M1 Observed Result is not the commands' output. F2 [Minor] the 24 variants and 23 formats predate #2850. F3 [Nit] the T3 record calls related history unrelated.

Checked, no finding. status: in-progress is valid under open/. The audit's inferred severities follow its own Status Values.

Checks

On the loop's compute node at this head, against the merge base d8e14450d (receipt server-gates-kranich-1149): the repository's pre-commit gate and lint roster exit 0 (265 s wall), and the audit validator passes this pull request's record (8 rows, 7 log entries, 0 failures). The PR changes documentation and skills only, so no package tests apply. F1 checked against the bytes at posting: .claude/skills/handle-errors-in-code/SKILL.md at this head carries a #[track_caller] bullet and the ## Unwrap and Expect Policy heading at line 103, and the evidence file's Observed Result contains neither. The head was confirmed with git ls-remote before posting. GitHub checks at this head at posting time: "Docs Lint: completed/success". At posting, develop is d8e14450d.

@da2ce7

da2ce7 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

ACK fb5f6c2 — ADR, skill, spec and review audit recomputed against the audit files, the captured threads and the tree at this head

@josecelano

Copy link
Copy Markdown
Member

ACK fb5f6c2

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human review is needed to assess package guidance that contradicts the new ADR and the resulting gap in AC3 verification.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@josecelano
josecelano merged commit 5b3c8b6 into torrust:develop Nov 18, 2026
1 check passed
@josecelano-bot

Copy link
Copy Markdown
Contributor Author

Post-merge workflow record for review 5953996662 (da2ce7, submitted 2026-11-18 09:39 UTC, approved with three non-blocking findings). The maintainer decided in chat at about 10:00 UTC, before the merge at 10:04 UTC, to merge this PR as is and fix the three findings (reviewer F1, F2, F3; audit F9, F10, F11) in the close-out PR of #2913. Posted by josecelano-bot on behalf of the maintainer; the replies on the three threads say the same and the threads stay open until the close-out PR merges.

josecelano pushed a commit that referenced this pull request Nov 18, 2026
Issue #2913 (SI-1 of EPIC #2912) closed with the merge of PR #2930. Sets status done, spec-path, related-pr and the checkpoints, and marks SI-1 DONE in the EPIC's sub-issue table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
josecelano added a commit that referenced this pull request Nov 18, 2026
…ssues/closed

c3a02e4 docs(pr-reviews): [#2913] audit review round 2 of PR 2936 (josecelano-bot)
6991702 docs(pr-reviews): [#2913] name the searches that found the four count lines of PR 2936 F2 (josecelano-bot)
538d94c docs(pr-reviews): [#2913] audit review round 1 of PR 2936 (josecelano-bot)
c936834 docs(issues): [#2913] give the location counts since #2850 in the EPIC and its specs (josecelano-bot)
f58fca1 docs(issues): [#2913] fix the parent EPIC link of the archived SI-1 spec (josecelano-bot)
9747987 docs(pr-reviews): [#2913] record da2ce7's post-merge follow-up findings of PR 2930 (josecelano-bot)
eb3bd2c chore(issues): archive closed issue #2913 spec to docs/issues/closed (josecelano-bot)
612836d docs(issues): [#2913] record the T3 search hits as history and add the skills directory (josecelano-bot)
0fe95a0 docs(issues): [#2913] re-run the manual verification V1 on the merged skill (josecelano-bot)
e4e89d5 docs(adrs): [#2913] give the location counts of the ADR since #2850 (josecelano-bot)

Pull request description:

  Close-out of issue #2913 (SI-1 of EPIC #2912), after PR #2930 merged. The issue is already closed on GitHub, so this PR uses no closing keyword.

  ## Changes

  - **Archive:** moves the SI-1 specification from `docs/issues/open/` to `docs/issues/closed/` (`status: done`, `spec-path`, `related-pr: 2930`, checkpoints, progress log) and marks SI-1 `DONE` in the EPIC's sub-issue table.
  - **da2ce7's three non-blocking findings on PR #2930** (review 5953996662), which the maintainer chose to fix here so that the ACKed head of #2930 stayed unchanged (record: #2930 (comment)):
    - F9 (reviewer F1): the manual verification V1 is re-run on the skill as merged and its output pasted verbatim.
    - F10 (reviewer F2): the ADR gives the counts since #2850 (23 variants, 22 `Display` formats, 37 sites) next to the audit's.
    - F11 (reviewer F3): the T3 record names the spec and review trees as history and adds `.claude/skills/` to the search; it finds only the changed skill.
  - **Audit:** `docs/pr-reviews/pr-2930-review/PR-REVIEW.md` records F9-F11 as `FOLLOW_UP` with the post-merge approval link. The three threads on #2930 stay open until this PR merges; then the audit marks them `FIXED` and they are resolved.
  - **Review round 1 of this PR** (da2ce7 review 5955371315, Copilot review 5955458544): the archived SI-1 spec's parent EPIC link points to `../../open/2912-remove-source-locations-from-errors/EPIC.md` again (F1, Copilot's re-raise F3); the pre-#2850 counts also get the "since #2850" figure in the EPIC spec (lines 46, 56), the archived SI-1 spec (line 43) and the #384 spec, SI-7 of the EPIC (line 57) (F2). `docs/pr-reviews/pr-2936-review/PR-REVIEW.md` records this PR's review rounds.

  ## Verification

  - `linter markdown` and `linter cspell` pass; the pre-commit hook ran on each commit.
  - Counts for F10 recomputed at `develop` `5b3c8b64c`: 22 `{location}` formats (`rg -U --multiline-dotall` over `packages`), 23 production `location: &'static Location<'static>` fields (24 matches, one in the test helper `axum-http-server/tests/server/asserts.rs`).

  🤖 Generated with [Claude Code](https://claude.com/claude-code)

ACKs for top commit:
  josecelano:
    ACK c3a02e4
  da2ce7:
    ACK c3a02e4 — the F12 record fix, the F13 description bullet and the round 2 audit rows with their offline validator run verified at this head

Tree-SHA512: f99327eaf959c406ef810ea68ab5921b132315ebdb31f01c34bbfa7d9dd5dba0aadd1f54265b77fa43752074e7033ef23c1c68eec84644418ec137aee81d7d06
josecelano added a commit that referenced this pull request Nov 18, 2026
…xed after PR 2936 merged

be132e7 docs(pr-reviews): [#2913] audit review round 1 of PR 2946 (josecelano-bot)
37a9b59 docs(pr-reviews): [#2913] record the post-merge checks behind F9 to F11 of the PR 2930 audit (josecelano-bot)
fcb9432 docs(pr-reviews): [#2913] mark F9 to F11 of the PR 2930 audit fixed after PR 2936 merged (josecelano-bot)

Pull request description:

  Closes the loop on da2ce7's post-merge findings F9 to F11 of PR #2930, following step 6 of the post-merge review workflow in `process-pr-review`. The fixes landed in the close-out PR #2936, merged into `develop` at 2026-11-18 13:31:43 UTC (`305027e70`). Docs only, two files.

  - In `docs/pr-reviews/pr-2930-review/PR-REVIEW.md`, F9 to F11 change from `FOLLOW_UP` / `OPEN` to `FIXED` / `RESOLVED`. Their resolution references now name the merged commit subjects, and their reply URLs the new replies.
  - A Processing Log entry records the merge, the three replies and the resolutions.
  - Review round 1 of this PR (da2ce7, two non-blocking findings): the Current-tree verification fields of F9 to F11 now record the check after the merge (the merge is an ancestor of `develop`, plus each finding's own check), and the merge time names its source, the forge `mergedAt`. The new audit `docs/pr-reviews/pr-2946-review/PR-REVIEW.md` records both findings.
  - All three threads on PR #2930 have a reply naming the merged fix and are resolved. A GraphQL refresh shows zero unresolved threads on #2930.

  The audit validator passes for both records (PR 2930: 11 rows, 10 log entries, 0 failures; PR 2946: 2 rows, 2 log entries, 0 failures), and the pre-commit and pre-push hooks passed.

  Refs #2913

  🤖 Generated with [Claude Code](https://claude.com/claude-code)

ACKs for top commit:
  josecelano:
    ACK be132e7
  da2ce7:
    ACK be132e7 — the post-merge checks and clock naming of F9-F11 and the new PR 2946 audit, with the validator run offline against the captured threads, verified at this head

Tree-SHA512: 59fec4b2885a2dd7c2d9553df0f21e456a686b12202ace8d8fa5351ef00c555288de791e0189189909d95fd2471dbea69bb9a6dc0fc74ba9196c3b9e0c8d1de2
josecelano pushed a commit that referenced this pull request Nov 19, 2026
Close-out of the audit issue #2804. Its fix work is now EPIC #2912
(sub-issues #2913 to #2918 and #384), created from the audit's slicing
plan, so the closing condition recorded in the spec is met.

- Mark the spec done: AC3 done by #2913 (ADR, PR #2930); AC4, AC5, the
  enforcement part of AC7 and the manual scenarios M1 to M3 handed over
  to the EPIC; checkpoints, progress log and completion review updated.
- Move the folder to docs/issues/closed/ and repair the live links in
  the EPIC, its sub-issue specs, #384 and the ADR. Progress-log entries
  and PR-review records keep the path they recorded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
josecelano added a commit that referenced this pull request Nov 19, 2026
…ssues/closed

5471550 chore(issues): archive closed issue #2804 spec to docs/issues/closed (josecelano-bot)

Pull request description:

  Closes #2804

  Close-out of the audit issue #2804 ("Audit and fix errors that record a wrong `Location::caller()`"). The audit (T1 to T5, PRs #2805, #2814, #2821, #2836) is done, and its fix work is now EPIC #2912 (PR #2919): sub-issues #2913 to #2918 and #384. The spec recorded that this issue closes once that EPIC exists, so this PR archives it. Documentation only, no code changes.

  ## Changes

  - **Spec marked done** (`docs/issues/closed/2804-location-caller-track-caller-audit/ISSUE.md`): AC3 done by #2913 (ADR `20261118045443_errors_do_not_record_source_locations.md`, PR #2930); AC4, AC5, the enforcement part of AC7 and the manual scenarios M1 to M3 are marked `MOVED` to the EPIC (#2914 to #2918, #384) instead of `DONE`. Checkpoints, progress log, completion review (no retrospective needed) and references updated. The "Reviewer validated" checkpoint is left for the maintainer.
  - **Archive:** the folder moves from `docs/issues/open/` to `docs/issues/closed/`; the frontmatter of its supplementary files points to the new path.
  - **Live links repaired** in EPIC #2912, the specs of #2914 to #2918 and #384, the archived #2913 spec and the ADR. Progress-log entries and `docs/pr-reviews/` records keep the path they recorded at the time.

  ## Note

  The `cleanup-completed-issues` skill archives a spec after its issue is closed. Here the issue is still open, so this PR archives the spec and closes the issue with `Closes #2804` when it merges, as the maintainer approved.

  ## Verification

  - `linter all`: pass.
  - Pre-commit checks (frontmatter validator, doc tests and the rest): pass.
  - `rg '2804-location-caller-track-caller-audit'` shows only `docs/issues/closed/...` paths, except progress-log entries and PR-review records.

  🤖 Generated with [Claude Code](https://claude.com/claude-code)

ACKs for top commit:
  josecelano:
    ACK 5471550

Tree-SHA512: 9d68e1744f8bc346fcd951f6029da8a49cf8f4f34cb000bc35dcf8bac857a4a3de00947b684e73b0e197535c0cb7e47c86ddeb8e38403c612067c62f666df000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record the decision that errors do not record source locations

4 participants