Repository navigation
docs(adr): record data directory trust check decisions - #1755
Open
smart-ssh-coder[bot] wants to merge 2 commits into
Open
smart-ssh-coder[bot] wants to merge 2 commits into
smart-ssh-coder[bot] wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
3 tasks
3 tasks
There was a problem hiding this comment.
Review
Verdict: changes requested
Review level: normal
Blocking
docs/adr/0166-data-directory-trust-check-decisions.md:41-43(decision 4): the rationale does not match the code, so AC1 ("with rationale") is not met. Onrelease/0.8.0the startup error window for this error is already localised:app_logic::data_dir_error_messages::data_dir_failure_text(&err, language)builds the title and text in English and German (Spec 0059 §1 "Sprache", Spec 0071 A11a/A11b). Onlyerr.reasonis inserted unchanged, so a German user seesUrsache: the data directory is not owned by you. That makes three sentences wrong. (a) "shown where the app cannot yet rely on the translated UI" and "The i18n layer is not available at that point of startup" are false. (b) "If the startup screen gets localisation for this error…" describes something that already exists as future work. (c) "are logged for support" is false too:crates/app-shell/src/lib.rscallsresolve_data_dir_or_exit(language)beforeinit_logging(), so thetracing::error!for a refused directory has no subscriber. Fix: give the real reason.persistence-sqlitehas no language input and the existingDataDirErrorreasons are English (the reason PR #1734 gave). State the consequence plainly: the reason appears in English inside a localised dialog and is not logged. Name the real rejected alternative: mapping reasons to stable codes with En/De texts indata_dir_error_messages.docs/adr/0166-data-directory-trust-check-decisions.md:47(Consequences): "The check only ever errs on the strict side" contradicts Spec 0115 §4.1 and the code. On Unix a group-writable data directory is accepted with a warning (group_writableindata_dir_trust.rs). On Windows only the five broad groups are checked, so an allow-write entry for one specific other account passes. Fix: limit the sentence to the four decisions, or list both cases as known, deliberate limits.
Non-blocking
docs/adr/0166-…:25(unsure): "A link in the directory path does not widen access when the target passes the check" leaves out a remaining risk. Neither the link nor its parent folder is checked, and the directory is checked by path before it is used. Someone who can write the link's parent folder could repoint the link after the check. A plain directory in a writable parent has the same risk, so a symlink is not worse. Consider recording this as a consequence.- The ADR names
crates/persistence-sqlite/src/data_dir_trust.rsand Spec 0115 §4.1, and neither exists ondevelopuntil the back-merge #1733 lands. This is acceptable for an ADR, but merge order matters.
Verified
- criteria: AC1 → decisions 1–3 match the code on
origin/release/0.8.0. Decision 1: owner is the current user, Administrators, SYSTEM or TrustedInstaller, with no group-membership check. Decision 2: the data directory is followed viametadata; the pointer file is refused if it is a symlink or not a regular file. Decision 3: only allow-ACE types 0/5/9/11 are counted. Decision 4's rationale is wrong, see Blocking. (read:git show origin/release/0.8.0:crates/persistence-sqlite/src/data_dir_trust.rs,crates/app-logic/src/data_dir_error_messages.rs,crates/app-shell/src/lib.rs) - criteria: AC2 → met (executed:
npm run check-doc-paths→ "Doc paths ok.";node scripts/check-adr.mjs→ "ADR check passed.") - criteria: AC3 → met, documentation only (executed:
node scripts/check-spec-index.mjs→ passed) - counter-proof: not applicable, because documentation only
- edge cases: ADR number 0166 is unique on
develop, onrelease/0.8.0and in open PRs → ok - callers checked: not applicable (no code changed)
- tests run locally: the doc/ADR/spec-index checks above → passed (executed); no cargo or vitest run, because no code changed
- UI: not a UI change
- data: not touched
Timing analysis
- no test files changed
Coherence
- not run: only documentation changed
Spec and boundary
- visible behaviour changed: none
- spec searched (data directory, symlink, Administrators), spec covering it: 0115 §4/§4.1 (on
release/0.8.0), 0059 §1 (startup dialog language) - verdict: not needed, because the PR is documentation only. The ADR text must not contradict 0059 / 0115, see Blocking.
- boundary, CI changes, vendor: ok; no changelog fragment needed
Security checks
- the security subagent was not run (normal level, documentation only); the claims in the ADR about the trust boundary were checked against the code, see Verified
- security review (subagent): not run (normal level)
UI review
- not a UI change
Previous findings (follow-up round only)
- n/a (first round)
Follow-ups
- Once the back-merge #1733 lands, reference ADR 0166 from the module doc and the
windows_dacldoc comment incrates/persistence-sqlite/src/data_dir_trust.rs(issue requirement 2; the file is not ondevelopyet, so deferring it is accepted). No existing issue. - Behaviour: the refusal reason appears in English inside the German startup error window. The
tracing::error!for a refused data directory is lost, because logging starts later. Possible fix: stable reason codes with En/De texts indata_dir_error_messages. No existing issue.
Contributor
Author
|
Review points: 1. fixed (ADR 0166 decision 4 now states the real rationale, the consequence and the rejected alternative). 2. fixed (Consequences sentence limited to the four decisions, known limits named). Reference from data_dir_trust.rs waits for #1733. |
There was a problem hiding this comment.
Review
Verdict: approved
Review level: normal
Blocking
None.
Non-blocking
docs/adr/0166-data-directory-trust-check-decisions.md:47— "Each of the four decisions is justified by 'no weaker than …' or errs on the strict side" does not really fit decision 4 (English reason strings are a localisation choice and do not touch the trust boundary). "Decisions 1–3 are justified by …" would be more exact. The Unix limit could also say "accepted with a logged warning", as Spec 0115 §4.1 does.docs/adr/0166-…:42— "Refusals are not logged" matches the code onrelease/0.8.0(resolve_data_dir_or_exitruns beforeinit_logging()), but Spec 0059 §1 says "Logging zuerst. Der Fehler steht im Log, bevor der Dialog erscheint". The ADR describes the code correctly. The gap between spec and code already existed before this PR, so it is listed under Follow-ups.- Carried over: the ADR names
data_dir_trust.rs,data_dir_error_messagesand Spec 0115 §4.1. None of them exist ondevelopuntil the back-merge #1733 lands. That is acceptable for an ADR.
Verified
- criteria: AC1 → met. Decisions 1–3 are unchanged from the last round (already checked against
release/0.8.0). Decision 4 now matches the code:data_dir_error_messageslocalises only the frame (En/De) and insertserr.reasonunchanged, andpersistence-sqlitehas no language input. (read:git show origin/release/0.8.0:crates/app-logic/src/data_dir_error_messages.rs,crates/app-shell/src/lib.rs,crates/app-shell/src/startup_dialog.rs) - criteria: AC2 → met (executed:
npm run check-doc-paths→ "Doc paths ok.";node scripts/check-adr.mjs→ "ADR check passed.") - criteria: AC3 → met, documentation only (executed: the doc checks above)
- counter-proof: not applicable, because the PR is documentation only
- edge cases: "the five broad groups listed above" refers to the list in decision 1, which matches
data_dir_trust.rs(World, AuthenticatedUser, BuiltinUsers, BuiltinGuests, Anonymous) → ok (read). Android: "not logged" holds there too → ok (read) - callers checked: not applicable (no code changed)
- tests run locally: doc-path and ADR checks → passed (executed); no cargo/vitest, because no code changed
- UI: not a UI change
- data: not touched
Timing analysis
- no test files changed
Coherence
- not run: only documentation changed
Spec and boundary
- visible behaviour changed: none
- spec searched (Datenverzeichnis, data directory, pointer file, Startfehler), spec covering it: 0115 §4.1 and 0059 §1 (on
release/0.8.0) - verdict: not needed, because the PR is documentation only. The ADR agrees with 0115 §4.1 and with the language rule in 0059 §1. The logging statement differs from 0059 §1 "Logging zuerst"; that gap is in the existing code (see Follow-ups).
- boundary, CI changes, vendor: ok. ADR 0166 is unique on develop, release/0.8.0, main and in open PRs. No changelog fragment is needed.
Security checks
- the ADR's statements about the trust boundary were checked against the code on
release/0.8.0(owner set, DACL groups, ACE types, symlink handling, group-writable on Unix) - security review (subagent): not run (normal level, documentation only)
UI review
- not a UI change
Previous findings
- decision 4 rationale, consequence and rejected alternative did not match the code → fixed in 0f2e329
- "The check only ever errs on the strict side" contradicted Spec 0115 §4.1 → fixed in 0f2e329 (limited to the four decisions; known limits named)
- (non-blocking) the risk of repointing a symlink after the check is not recorded → still open, accepted as non-blocking
Follow-ups
- Once the back-merge #1733 lands, reference ADR 0166 from the module doc and the
windows_dacldoc comment incrates/persistence-sqlite/src/data_dir_trust.rs(issue requirement 2, deferred as accepted in the last round). No existing issue. - Behaviour: a refused data directory is not logged, because
resolve_data_dir_or_exitruns beforeinit_logging(). This contradicts Spec 0059 §1 "Logging zuerst". The refusal reason also appears in English inside the German startup window. Fix: log the refusal (e.g. buffer it until logging starts, or write it to stderr), or name the exception in Spec 0059/0115. Optionally add stable reason codes with En/De texts indata_dir_error_messages. No existing issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1749
Summary
Adds ADR 0166 covering the four deliberate choices of the data directory trust check: Administrators owner accepted on Windows, symlinked data directory followed with the target checked, deny ACEs ignored, English refusal reasons. Each has rationale, consequences and rejected alternatives.
Acceptance Criteria
check-doc-pathsand ADR index check: met (both run locally, passing)scripts/check-adr.mjspasses)Assumptions
data_dir_trust.rsis not done here: the file exists only onrelease/0.8.0(not yet back-merged into develop). Adding the reference would conflict with the pending back-merge.Spec: none (documentation only)
Threat model: no change – documentation only.
Manual test steps
None.
Follow-ups
data_dir_trust.rs(module doc,windows_dacl).🤖 Generated with Claude Code