Skip to content

D94 — shell: a settings file refused says which setting and what to do, in the user's language - #813

Merged
napkinstack-agent[bot] merged 20 commits into
mainfrom
shell/d94-settings-words
Nov 15, 2026
Merged

napkinstack-agent[bot] merged 20 commits into
mainfrom
shell/d94-settings-words

Conversation

@kitokey-sam

@kitokey-sam kitokey-sam Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

D94 — shell: a settings file refused says which setting and what to do, in the user's language

Closes #783


Module

modules/shell.

  • This pull request touches a single module

Deliverable

Deliverable: D94, acceptance criterion 4 — « Given a settings file the shell cannot read, when it says so, then the notification and the window say in the user's language which setting is wrong and what to do, with no sentence of settings.rs in them — the technical detail in the log and behind « Développeur » only (#783); held by a test for each refusal settings.rs makes, in both languages, and by the e2e ».

Beside #792, open (lina, the « settings unreadable » banner): it says above every page but Settings that the file cannot be read, and links to Settings. This pull request does not touch the banner: Settings is where it leads, and Settings now says which setting and what to do. The two do not overlap, and merge in either order (no shared line: #792 adds two Window fields and a banner; this changes Failure, Trouble and settings::read).

What it changes

Before, the notification at a start said Kitokey runs with its defaults until the file is corrected: <settings.rs's sentence> — English and technical in a French notification (« line 4: keep_audio is "always" or a number of days »). The window's sentences said the file cannot be read, never which setting.

flowchart LR
    F["settings.toml<br/>broken by hand"]:::file --> R["settings::read"]:::shell
    R -->|"Refused: which, which line"| W["words::refused<br/>FR · EN"]:::here
    R -->|"its sentence, by the file's name"| L["the log<br/>and « Développeur »"]:::wait
    W --> N["notification at a start"]:::user
    W --> P["under a refused command,<br/>and on Settings"]:::user
    classDef file fill:#374151,color:#fff
    classDef shell fill:#5b21b6,color:#fff
    classDef here fill:#065f46,color:#fff
    classDef wait fill:#92400e,color:#fff
    classDef user fill:#1e3a8a,color:#fff
Loading

Legend — grey: the file · violet: the shell's reader · green: the sentence the user reads · amber: where the technical sentence goes · blue: where the user reads it.

  1. settings::read says what it refuses (Refused, beside today's sentence in Unread { refused, detail }), one variant for each refusal it makes:
    • Unopened: the file is there and cannot be opened;
    • Unparsed { line, key }: a line that is not a setting, or a value not of its kind. The key is named only when it is one of the file's own (KEYS), never what the user typed in its place;
    • SessionsNotWhole { line } and ModelNotWhole { line }: the folder or the model not a whole path. Two refusals, each with its own gesture — a folder's whole path, a file's — rather than one with a key: each reads on its own, and French says « chemin entier » as FolderNotWhole already does;
    • KeepAudio { line }: neither "always" nor 1 to 36,500 days.
      The sentence settings.rs wrote stays as it was, word for word: it is detail.
  2. words::refused says each one in French and in English, by the voice guide's error template (D94 — shell: the voice guide, and a notification's title held at 50 characters #811): which line, which setting, the gesture. E.g. « Ligne 4 : « keep_audio » vaut « always » ou un nombre de jours, de 1 à 36 500. Corrigez-le. » / "Line 4: “keep_audio” is “always” or a number of days, from 1 to 36,500. Correct it."
  3. Where it is said:
    • the notification at a start: « Kitokey fonctionne avec ses réglages par défaut tant que le fichier n’est pas corrigé. » then the refusal (Trouble::Settings(Refused));
    • under a command the window refused (Failure::SettingsUnread(Refused)): « …le fichier des réglages ne peut pas être lu. » then the refusal; its « corrigez-le, puis réessayez » is now the refusal's own gesture;
    • on Settings (Failure::SettingsLocked(Refused)): today's sentence, then the refusal.
  4. The technical sentence goes to the log, by the file's name, never its path: under a command as before (shell.command_failed, its failure field now naming the refusal, e.g. SettingsUnread(KeepAudio { line: 1 })), and at a start in a new shell.settings_unread warning, declared in the manifest's evidence.provoked under the window's K, the block that starts once on a broken file. In developer mode it stays under the window's sentence, as before.
  5. The e2e's three checks of these sentences in e2e_window.py are updated to the new ones; the raw text checks are unchanged.

Stacked on #812 (base shell/d94-words-rules, #812 merged in at 6d04754): its rules hold #783's new sentences too. Merging #813 into the comments' branch showed three clashes, fixed at 301716f: words::refused's comment was above the fn, where the reader does not look; the comments #813 put on trouble()'s and failure()'s settings arms also covered the arms after them (placeholders trouble comment 4), now each followed by a comment of its own; and the match on NotWhole { key: "model", .. }, gone with the split above. WITHOUT_COMMENT: 602 → 582, #783's sentences carrying theirs.

Oracle

  • The success criterion was written before the implementation
  • It was seen failing, for the right reason:
    • tests/words.rs, with words::refused a stub returning nothing: a_settings_file_refused_says_which_setting_and_what_to_do_in_both_languages failed (left: ""), and so did the updated a_settings_file_that_cannot_be_read_is_said_whole_… (the sentence ending after « corrigé. »);
    • tests/settings.rs, with the key never named (a mutant of read): a_file_refused_names_the_setting_and_its_line failed, left: Unparsed { line: 2, key: None }, right: … Some("developer").
  • It passes now

Kind of oracle: unit tests — tests/settings.rs: each refusal read makes, 12 files and a folder in the file's place, its line and key; tests/words.rs: each refusal's sentence word for word in both languages, at the end of the notification, of the sentence under a command and of Settings', the raw text only in developer mode; an exhaustive match on Refused so that a refusal added fails to compile until it is named. tests/log.rs: the log keeps the sentence of settings.rs by the file's name. And the e2e (e2e_window.py), updated — not run by the author: the e2e is the coordinator's.


Review budget

  • Lines changed (excluding generated), at 596ccd2 against main (c7e344f, D94 — shell: the tests read every sentence of words.rs against the voice guide #812 merged): 506 (+447 −59). Code: settings.rs +143 −14 (of which +55 the unit test tying KEYS to Written's fields, marc's survivor at 5612d21), words.rs +84 −12, main.rs +20 −11, autostart.rs +1 −1, MANIFEST.yaml +5 (scenario K). Tests: tests/words.rs +100 −12, tests/settings.rs +77 −3, tests/log.rs +7 −3, e2e_window.py +10 −3.
  • Files touched: 9
  • Within budget
  • ⚠️ Over budget by 106 lines — label over-budget. Justification: one refusal type is carried from the reader to its three surfaces, with its sentences in two languages. More than half the lines are its tests, among them the KEYS test asked by its verifier.

Contracts

  • No contract affected

Definition of Done

  • Oracle green
  • Lint, format, types — cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings; e2e_window.py parsed
  • Unit tests — cargo test --locked: 44 test binaries passed; tests/migrate.rs 23 passed, 1 failed on the author's sandbox (a_model_written_from_home_is_named_where_it_went writes under $HOME, read-only there; not touched here). The licence's release test was not run.
  • E2E on critical journeys — updated, not run by the author
  • Affected documentation updated — none other names these sentences
  • Diff self-reviewed line by line

Test sheet

Verifier: session 14f73956-90b9-46a3-9fcc-52dc45c43948

# Given · when · then Kind Result Evidence Commit Confirmed
S1 Given each refusal settings::read makes — a file it cannot open, a line that is no setting, a value not of its kind, sessions or model not whole, keep_audio out of range —, when it reads the file, then it says which, with its line and the key when it is one of Kitokey's own, and keeps its sentence for the log automated passed Own clone at c357426 (git clone --shared, detached; the head holds main): cargo test --locked --test settings 32 passed, the library's settings::tests 1 passed; fmt, clippy clean. Hand mutants of src/settings.rs, each alone (git diff --numstat), restored after each: K1 a key taken out of KEYS (1 2) → no longer compiles, [&str; 24] against [&str; 25]; K2 a key misspelt, the count kept (1 1) → the_keys_a_refusal_names_are_the_files_fields; K3 quotes no longer trimmed (1 1) → a_file_refused_names_the_setting_and_its_line. At 5612d21, K1 survived — no test held KEYS to Written's fields; c357426's test closes it. Probed, on the safe side: a value over several lines is said at the line the parser stops on, with no key (see remarks). Re-run at 0dd8193 (sam's merge of main with #865; src/settings.rs and tests/settings.rs unchanged since c357426): settings 32, settings::tests 1 passed; K1 no longer compiles, K2 and K3 fail, as above. 0dd8193 —
S2 Given each refusal, in French and in English, when the notification at a start, the sentence under a refused command and Settings' say it, then each ends with which setting, on which line, and the gesture, with no sentence of settings.rs — that one only under it in developer mode automated passed Same clone: cargo test --locked --test words 56 passed. Hand mutants of src/words.rs, each alone (1 1), all killed by a_settings_file_refused_says_which_setting_and_what_to_do_in_both_languages and one more: W1 the French keep_audio limit written otherwise (36 500); W2 the English « cannot be read » without the setting's sentence; W3 the key said otherwise than the file writes it (upper-cased). Re-run at 0dd8193 (src/words.rs moved by main only): words 56 passed; W1, W2, W3 each killed again. 0dd8193 —
S3 Given a settings file broken by hand, when Kitokey starts on it and when a change is refused, then the notification and the window say it as in S2, in the e2e's French, and the log holds settings.rs's sentence by the file's name, declared automated passed The coordinator's attest at c357426 (nstack 0.29.0), the full shell e2e: 1793 ok, 0 FAIL, « e2e: passed » (team/evidence-813/e2e.txt, read). Its checks of #813: « a settings file that cannot be read is said so, which setting and what to do, and nothing can be changed », « developer mode off, a settings file that cannot be read is said in a sentence, no raw text », « the shell refuses a change while the file cannot be read », all ok; and logs_read ok, shell.settings_unread declared under K and read. At 0dd8193: the coordinator's full shell e2e, 1823 ok, 0 FAIL, « e2e: passed »; the same three checks of #813 ok, and logs_read ok (team/evidence-813/e2e.txt, read). 0dd8193 —

Verifier's remarks: read at c357426; S3 is the coordinator's attest's e2e, the units mine.

  • The gap found at 5612d21, closed by sam: KEYS named no test-held list of the file's fields, so a setting added later would have been refused unnamed. c357426 holds it by an exhaustive pattern over Written, and names a key in quotes.
  • Left, on the safe side: a value written over several lines (bar_at = [\n 1,\n "x",\n]) is said at the line the parser stops on, with no key — never a wrong one.
    Ground: a git clone --shared detached at c357426 in modules/shell/target/verify-813, removed at the end.

Summary

DONE

  • settings::read says which refusal, its line and its key, beside its sentence.
  • words::refused says each one in French and in English; the notification, the window's sentence under a refused command and Settings' end with it.
  • settings.rs's sentence goes to the log (a new shell.settings_unread at a start, declared) and behind developer mode only.
  • The e2e's checks of these sentences are updated.

VERIFIED

  • Attested 5/5 at 0dd8193 (nstack 0.29.0), main merged in.
  • cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings: clean.
  • cargo test --locked --no-fail-fast: as above.
  • The oracle red on a stub and on a mutant, as above.

ASSUMED

  • A key is named back only when it is one of Kitokey's own: what a user typed in its place is not repeated to them, nor logged beyond the existing detail.
  • The e2e reads U+202F in « 36 500 » as itself: WebDriver's .text turns U+00A0 into a space, and the checks expect that; the narrow one is assumed kept.

NOT VERIFIED

  • The e2e: not run by the author.
  • The release build's licence test.

RISKS

  • Failure's log field now names the refusal (SettingsUnread(KeepAudio { line: 1 })): a line number and a key of Kitokey's, no path, no word of the user's.
  • Unparsed for a value spread over several lines names the line its error points to, which may be the value's and not the key's: the key is then not named, only the line.

🤖 Generated with Claude Code

kitokey-sam Bot and others added 4 commits November 14, 2026 01:26
…ice guide

Each sentence's comment (Shows, When, At most, Placeholders), the same
placeholders in French and in English and those its comment names, no
straight apostrophe, a list's label at 18 characters and any sentence
at its comment's limit, none of the lexicon's refused words.

What each rule finds today is counted in STILL_WRONG: the rewrite, one
pull request an area, lowers it, and a sentence that breaks a rule
raises it, which fails.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/words_still_wrong.txt lists, sorted, each sentence that still
breaks a rule: a sentence not listed fails, one listed and put right
fails until removed, so a sentence put right never covers another
written wrong. The comments alone stay counted, 604 keys being three
review budgets.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reader cannot place a helper's sentences, such as french_days', in
either language: they escaped the lexicon. They are now held to both;
none of today's is refused (the verifier's mutant, french_days saying
« fournisseur », now fails).

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o, in the user's language

settings::read gives each refusal its kind beside its sentence: a file
that cannot be opened, a line that is no setting or a value not of its
kind, a path that is not whole, keep_audio out of its range — with the
line and, when it is one of Kitokey's own, the key. words::refused says
it in French and in English; the notification at a start, the sentence
under a refused command and the one on Settings end with it. The
sentence of settings.rs goes to the log (shell.settings_unread at a
start, shell.command_failed under a command) and behind developer mode,
never to the user (#783).

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kitokey-sam kitokey-sam Bot added the over-budget Over the review budget, with its justification in the description label Nov 14, 2026
kitokey-sam Bot and others added 6 commits November 14, 2026 01:43
The window's block that starts on a settings file broken by hand is K;
the manifest names its scenarios by the e2e's letters.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A field's comment covers every place of its array: its placeholders are
read against all of them, not against each place, which refused
agree_context's « {} » found only in its second sentence. Each place is
still compared in both languages.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reader counted Language::of's "fr" and cfg!'s "linux" as sentences
waiting for their comment: literals after eq_ignore_ascii_case and
target_os are the code's, as an expect's are. WITHOUT_COMMENT: 602.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode's

The reader kept expect, eq_ignore_ascii_case or target_os as the word
before every literal up to the next identifier: a sentence after the
code's literal — cfg!(target_os = "linux") { "Can't open it" } — escaped
every rule (the verifier's probes). It is now forgotten after each
literal; the probes are tests of the reader. words.rs had no such
sentence: WITHOUT_COMMENT and the list do not move.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With #812 merged in: words::refused's comment is inside its body, where
a comment covers what follows it; trouble() and failure() carry a
comment after their settings' arms, so that it covers the arms it says.
The folder and the model not whole are two refusals, each with its own
gesture — a folder's whole path, a file's —, no longer one with a key;
French says « chemin entier » as FolderNotWhole already does.
WITHOUT_COMMENT: 582.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kitokey-sam Bot and others added 2 commits November 14, 2026 11:39
#808 added general_title without the voice guide's comment; merged with
main, every_sentence_carries_its_comment counted 603 for 602.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kitokey-sam Bot and others added 5 commits November 14, 2026 13:40
Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pped » kept on the list still wrong (D94)

Merged with main, #807's settings banners, « Annuler », and the stopped
transcript and minutes had no comment (607 against 602), and
window.minutes_stopped says « minutes », which the lexicon refuses. The
comments are given; the sentence is listed by key, its rewording being
criterion 3's.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/words.rs: #813's settings-refusal test and #812's D94 tests kept
both; every_notice's Trouble::Settings now takes a Refused, as #813 made it.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, and a key in quotes is named (#783)

marc's survivor at 5612d21: microphone_description taken out of KEYS left
every test green, nothing tying KEYS to Written. A unit test now lists
Written's fields in an exhaustive pattern — a field added or taken out
fails to compile — and compares their names with KEYS. A key written in
quotes ("after" or 'after'), as TOML allows, is now named as the bare one.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WITHOUT_COMMENT 582 -> 580: main (#817) leaves two fewer sentences without
the guide's comment, and the test asks to lower it.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kitokey-sam
kitokey-sam Bot requested a review from a team as a code owner November 15, 2026 01:07
Base automatically changed from shell/d94-words-rules to main November 15, 2026 08:52
#812 merged squashed: tests/words.rs's only conflict is WITHOUT_COMMENT,
main's 602 (#812 alone) against this branch's 580 (#813's comments and
#817's two); 580 kept, the test's own count at this merge.

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kitokey-sam Bot and others added 2 commits November 15, 2026 12:28
WITHOUT_COMMENT: main's 597 kept, the baseline #861 made one-way; this
branch's count is 577, said by the test as « can be lowered to 577 ».

Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: 92ded11e-58ef-492d-ba56-c820b9011de8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@napkinstack-agent
napkinstack-agent Bot merged commit 168dc3e into main Nov 15, 2026
14 of 16 checks passed
@napkinstack-agent
napkinstack-agent Bot deleted the shell/d94-settings-words branch November 15, 2026 13:58
kitokey-marc Bot added a commit that referenced this pull request Nov 15, 2026
…meeting-is-made

main.rs: a settings file refused, the minutes not started — #813's refusal (`why.detail` to the
line kept for the log, `why.refused` said) told by #824's path, naming the meeting where Kitokey
is not in front. tests/words.rs: both sides' tests kept.

Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

over-budget Over the review budget, with its justification in the description

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shell: an English technical sentence from settings.rs is inserted into a French notification (trouble:Settings)

0 participants