Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d0884a9
Start D130 — Formats are managed: made, duplicated, renamed, changed,…
kitokey-nora[bot] Nov 27, 2026
42278c1
D130 — shell: the formats' oracle, red — made, duplicated, renamed, c…
kitokey-nora[bot] Nov 27, 2026
71da995
D130 — shell: formats.rs, the formats a person manages and the file -…
kitokey-nora[bot] Nov 27, 2026
254e949
D130 — shell: the formats kept in the settings' file, read back as th…
kitokey-nora[bot] Nov 27, 2026
b92618d
D130 — shell: kitokey-summary given the format chosen — none for gene…
kitokey-nora[bot] Nov 27, 2026
e498207
D130 — shell: Refaire offers the formats, the default marked; the sum…
kitokey-nora[bot] Nov 27, 2026
c0094cb
D130 — shell: the e2e's CW — Refaire offers the formats, the default …
kitokey-nora[bot] Nov 27, 2026
419c75a
D130 — shell: the e2e's scenario is CZ, CW being sam's (#1308)
kitokey-nora[bot] Nov 27, 2026
18debb1
D130 — shell: CZ expects the line as words.rs says it, a plain space …
kitokey-nora[bot] Nov 27, 2026
205ee8e
Merge origin/main (13528bc) into d130-2-the-summary-written-in-the-fo…
kitokey-nora[bot] Nov 28, 2026
df1941b
D130 — shell: CZ, no empty list when the formats are unread, no line …
kitokey-nora[bot] Nov 28, 2026
5442f1c
D130 — shell: no « Format » list until one is read, no line for a for…
kitokey-nora[bot] Nov 28, 2026
b8498a8
D130 — shell: CZ makes the formats unreadable by replacing Tauri's fr…
kitokey-nora[bot] Nov 28, 2026
73f3c94
Merge origin/main (e943ebc6) into d130-2-the-summary-written-in-the-f…
kitokey-nora[bot] Nov 30, 2026
8437eb9
Merge origin/main (499231bf) into d130-2-the-summary-written-in-the-f…
kitokey-nora[bot] Nov 30, 2026
57bf9d5
D130 — shell: a format chosen in Refaire serves one making alone, hel…
kitokey-nora[bot] Nov 30, 2026
4868296
D130 — shell e2e: DI checks the format chosen in Refaire through the …
kitokey-nora[bot] Nov 30, 2026
711445b
Merge origin/main (d43ebc0d) into d130-2-the-summary-written-in-the-f…
kitokey-nora[bot] Nov 30, 2026
704f21e
D130 — shell e2e: focus_swept counted at its measured ~1060 s, so its…
kitokey-nora[bot] Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/shell/scripts/e2e_times.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ axe_first_surfaces 14.9
bar_after_stop 40.4
ends_on_sigterm 7.0
focus_kept 40.2
focus_swept 691.3
# focus_swept measured again at 711445bd (e2e-history 20261130T214828): ~1060 s since 2026-11-30, not 691 s; counted at 691 s,
# its shard took 14 scenarios more, 1188 s of the window's 1200 s, and the attest was cut in versions_kept (#1340).
focus_swept 1062.5
key_kept_to_its_host 5.5
keys_first_surfaces 74.0
meeting_trashed 17.0
Expand Down
141 changes: 141 additions & 0 deletions modules/shell/scripts/e2e_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
printf '%s' "$context" > "$here/summary-context"
echo '{"event": "sending", "host": "h", "model": "m", "characters": 1}'
named=""; [ -n "$STANDIN" ] && named="provider: $provider\\n"
# A format given (D130): minutes/v5 in it, as the real one writes them — its file's structure and sections.
[ "$6" = --format ] && { python3 -c "$FIFTH" "$1" "$7" "$5"; echo '{"event": "written", "file": "x"}'; exit 0; }
printf -- "---\\ncontract: minutes/v1\\n${named}model: %s\\ncontext: %s\\n---\\n\\n## A\\n\\n## B\\n\\n## C\\n" "$5" "$context" > "$1/minutes.md"
echo '{"event": "written", "file": "x"}'
exit 0
Expand Down Expand Up @@ -192,6 +194,15 @@
"import json, pathlib, sys; f = pathlib.Path(sys.argv[1], 'context.txt'); "
"t = f.read_text().strip() if f.exists() else ''; print(json.dumps(t or None, ensure_ascii=False))"
)
# minutes/v5 in the format a file of `--format` holds (D130): its structure, its sections, a title each.
os.environ["FIFTH"] = (
"import json, pathlib, sys; f = json.loads(pathlib.Path(sys.argv[2]).read_text()); "
"front = ['contract: minutes/v5', 'made: 2026-11-27T10:00:00+01:00', 'provider: \"local\"', 'model: ' + json.dumps(sys.argv[3]),"
" 'context: null', 'structure: ' + f['structure'], 'sections: ' + json.dumps(f['sections'], ensure_ascii=False)]"
" + (['actions: ' + f['actions']] if 'actions' in f else []); "
"body = ''.join(f'## {s[\"id\"]}\\n\\n- x\\n\\n' for s in f['sections']); "
"pathlib.Path(sys.argv[1], 'minutes.md').write_text('---\\n' + '\\n'.join(front) + '\\n---\\n\\n' + body)"
)
# The host of a provider's address, and a request sent to a stand-in service, for the two above.
os.environ["HOST"] = "import sys, urllib.parse; print(urllib.parse.urlsplit(sys.argv[1]).hostname)"
os.environ["SEND"] = "import sys, urllib.request; urllib.request.urlopen(urllib.request.Request(sys.argv[1], data=b'x', method='POST'), timeout=5)"
Expand Down Expand Up @@ -16643,6 +16654,135 @@ def log_message(self, *_):
tags.shutdown()


def formats_redone(now: dt.datetime) -> None:
"""DI. D130: Refaire's dialog offers the formats — the six built in by their names, a person's own after them,
the default marked and chosen —; the summary is written in the one chosen, through summarising/v1's
`--structure` or `--format`, and its line names it. The summary is the stand-in's."""
print("DI. Refaire's dialog offers the formats, the default marked; the summary written in the one chosen names it (D130)")
meetings = WORK / "formats-redone"
meeting = meetings / "2026-11-27_09-00"
session(meeting, now - dt.timedelta(days=1), 10, {"local.wav": 1000})
(meeting / "transcript.jsonl").write_text(
'{"type":"header","contract":"transcript/v1","engine":"whisper.cpp","model":"m","language":null,"context":null}\n'
'{"type":"segment","speaker":"me","track":"local","start":0.0,"end":1.0,"text":"Bonjour."}\n{"type":"complete","duration":1.0}\n')
(meeting / "minutes.md").write_text(
"---\ncontract: minutes/v1\nmade: 2026-11-27T10:00:00+01:00\nprovider: local\nmodel: m\ncontext: null\n---\n\n"
"## 1.\n\nLe point.\n\n## 2.\n\n- Rien\n\n## 3.\n\n- Rien\n")
kept = ('reminder = false\nminutes_provider = "http://127.0.0.1:9/v1"\nminutes_model = "m"\nformat_default = "point_client"\n'
'formats_hidden = ["interview"]\n\n[[formats]]\nstructure = "point_client"\nname = "Point client"\nactions = 1\n'
'sections = [{ title = "Contexte", about = "Où en est le client" }, { title = "Suites", about = "Qui fait quoi, pour quand" }]\n')
# Ollama on this computer, its recommended model held: the making the confidential switch starts (D60).
class Ollama(http.server.BaseHTTPRequestHandler):
protocol_version = "HTTP/1.0"

def do_GET(self):
body = json.dumps({"models": [{"name": "qwen3:8b"}]}).encode()
self.send_response(200)
self.send_header("content-length", str(len(body)))
self.end_headers()
self.wfile.write(body)

def log_message(self, *_):
pass

ollama = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Ollama)
threading.Thread(target=ollama.serve_forever, daemon=True).start()
window = Window(meetings, "fr_FR.UTF-8", kept, ollama=f"http://127.0.0.1:{ollama.server_port}")
args = WORK / "summary-args"
offered = ("const p = document.getElementById('redo-format');"
" return p ? [...p.options].map((o) => [o.value, o.textContent, o.selected]) : []")
redone = lambda browser, value: (
redo_open(browser, "minutes"),
wait_for(browser, lambda b: len(b.execute_script(offered)) == 6, 5),
Select(browser.find_element(By.ID, "redo-format")).select_by_value(value) if value else None,
args.unlink(missing_ok=True),
press(browser, "redo-dialog-do"),
wait_for(None, lambda b: args.exists(), 15),
wait_for(browser, lambda b: b.execute_script(idle), 15))
idle = ("return window.__TAURI__.core.invoke('makings').then(m => m.transcript === null && m.minutes === null"
" && m.transcripts_waiting.length === 0 && m.minutes_waiting.length === 0)")
with window as browser:
browser.execute_script(f"location.hash = '#/meeting/{meeting.name}'")
wait_for(browser, lambda b: b.find_elements(By.ID, "redo-open"), 10)
redo_open(browser, "minutes")
listed = wait_for(browser, lambda b: len(b.execute_script(offered)) == 6, 5) and browser.execute_script(offered)
check("Refaire's dialog offers the built-in formats by their names, interview hidden, the person's own after; its default marked and chosen",
listed == [["general", "Général", False], ["one_to_one", "Point individuel", False], ["stand_up", "Point d’équipe", False],
["client_call", "Appel client", False], ["project_review", "Revue de projet", False],
["point_client", "Point client (par défaut)", True]], listed)
shot(browser, "cz-redo-formats")
press(browser, "redo-dialog-cancel")
redo_closed(browser)
redone(browser, None)
given = args.read_text().split()
file = window.file.parent / "formats" / "point_client.json"
written = json.loads(file.read_text()) if file.exists() else None
check("the default, a person's own: kitokey-summary given --format and its file, summarising/v1's format",
given[-2:] == ["--format", str(file)] and written == {"structure": "point_client", "sections": [
{"id": "contexte", "about": "Où en est le client"}, {"id": "suites", "about": "Qui fait quoi, pour quand"}], "actions": "suites"},
(given, written))
browser.execute_script("location.hash = '#/'")
browser.execute_script(f"location.hash = '#/meeting/{meeting.name}'")
named = wait_for(browser, lambda b: b.execute_script("return document.getElementById('minutes-format')?.textContent")
== "Format «\u00a0Point client\u00a0»", 10)
check("the summary written in it names its format on its line",
named, browser.execute_script("return document.getElementById('minutes-format')?.textContent"))
shot(browser, "cz-minutes-format")
redone(browser, "stand_up")
given = args.read_text().split()
check("another built-in chosen: --structure and its name, for that making", given[-2:] == ["--structure", "stand_up"], given)
redone(browser, "general")
given = args.read_text().split()
check("Général chosen: no structure, as before (minutes/v4)", "--structure" not in given and "--format" not in given, given)
# lina's points 1 and 2 on #1340: no list when the formats cannot be read — the making then in the default —,
# and no line for minutes written in a format the person deleted since, never its id.
# Tauri freezes `core` (its bundle.global.js): the whole object replaced, the page reading it at each call.
took = browser.execute_script(
"const t = window.__TAURI__, real = t.core.invoke;"
" window.__TAURI__ = { ...t, core: { ...t.core, invoke: (command, args) =>"
" command === 'formats_offered' ? Promise.reject('read') : real(command, args) } };"
" return window.__TAURI__.core.invoke !== real")
check("the formats made unreadable for this check", took is True, took)
redo_open(browser, "minutes")
time.sleep(1)
row = browser.execute_script("const p = document.getElementById('redo-format'); return p && p.closest('label').getClientRects().length > 0")
check("the formats unread: Refaire's dialog shows no empty « Format » list", row is False, row)
press(browser, "redo-dialog-cancel")
redo_closed(browser)
gone = meetings / "2026-11-27_11-00"
session(gone, now - dt.timedelta(hours=20), 10, {"local.wav": 1000})
(gone / "transcript.jsonl").write_text((meeting / "transcript.jsonl").read_text())
(gone / "minutes.md").write_text(
"---\ncontract: minutes/v5\nmade: 2026-11-27T12:00:00+01:00\nprovider: \"local\"\nmodel: \"m\"\ncontext: null\n"
'structure: point_ancien\nsections: [{"id": "contexte", "about": "Le contexte"}]\n---\n\n## Contexte\n\nLe point.\n')
browser.execute_script("location.reload()")
wait_for(browser, lambda b: b.find_elements(By.ID, "redo-open"), 10)
browser.execute_script(f"location.hash = '#/meeting/{gone.name}'")
wait_for(browser, lambda b: b.execute_script("return document.querySelectorAll('#meeting .minutes .body h2').length === 1"), 10)
time.sleep(1)
line = browser.execute_script("return document.getElementById('minutes-format')?.textContent ?? null")
check("minutes in a format deleted since: no line naming it, never its id", line is None, line)
# lina's F4 on #1340: a format chosen in Refaire serves that making alone. The next one, started outside Refaire
# — the switch said confidential, its minutes a service's —, is in Settings' default, through write_minutes_from.
browser.execute_script(f"location.hash = '#/meeting/{meeting.name}'")
wait_for(browser, lambda b: b.find_elements(By.ID, "redo-open"), 10)
redone(browser, "stand_up")
chosen = args.read_text().split()
text = (meeting / "minutes.md").read_text()
# Its minutes said written by a service (the stand-in names none): the switch makes them again here.
text = re.sub(r"(?m)^provider: .*\n", "", text, count=1)
(meeting / "minutes.md").write_text(text.replace("---\n", '---\nprovider: "writes.example"\n', 1))
args.unlink(missing_ok=True)
browser.execute_script("location.hash = '#/'")
browser.execute_script(f"location.hash = '#/meeting/{meeting.name}'")
wait_for(browser, lambda b: b.find_elements(By.ID, "confidential-switch"), 10)
press(browser, "confidential-switch")
made = wait_for(None, lambda b: args.exists(), 15) and args.read_text().split()
wait_for(browser, lambda b: b.execute_script(idle), 15)
check("Refaire in Point d’équipe, then made again here as the switch says confidential: Settings' default, its file, never Point d’équipe",
chosen[-2:] == ["--structure", "stand_up"] and made and made[-2:] == ["--format", str(file)], (chosen, made))


def settings_engine_cards(now: dt.datetime) -> None:
"""EC. D122 in Settings: « Écoute et rédaction » draws each job's engine cards first, engineCards()'s
own structure (CS reads it in its three scopes), « Auto » first and chosen when Settings name no
Expand Down Expand Up @@ -18679,6 +18819,7 @@ def aside(folder):
bar_window(now)
bar_opened(now)
bar_offers_no_engine_nor_language(now)
formats_redone(now)
engine_cards_drawn(now)
settings_engine_cards(now)
bar_after_stop(now)
Expand Down
25 changes: 25 additions & 0 deletions modules/shell/src/formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,31 @@ impl Formats {
}
}

/// The format a making of the meeting in `folder` is written in: the one chosen for it in Refaire, taken
/// (it serves that making alone), else `default`, Settings' (D130).
pub fn for_making(chosen: &mut std::collections::HashMap<std::path::PathBuf, String>, folder: &std::path::Path, default: &str) -> String {
chosen.remove(folder).unwrap_or_else(|| default.to_string())
}

/// What `kitokey-summary` is given after its model for the format of that structure: nothing for
/// `general` — `minutes/v4`, its sections the same —, `--structure` and its name for another built-in
/// one, `--format` and its file for a person's own, written in `folder` as [`file`] says. One
/// deleted or hidden since it was chosen: the default.
pub fn argument(formats: &Formats, structure: &str, folder: &std::path::Path) -> std::io::Result<Vec<String>> {
let offered = formats.shown().contains(&structure);
let structure = if offered { structure } else { formats.default.as_str() };
if structure == BUILT_IN[0] {
return Ok(Vec::new());
}
let Some(format) = formats.own(structure) else {
return Ok(vec!["--structure".into(), structure.into()]);
};
std::fs::create_dir_all(folder)?;
let path = folder.join(format!("{structure}.json"));
std::fs::write(&path, file(format).to_string())?;
Ok(vec!["--format".into(), path.to_string_lossy().into_owned()])
}

/// The file `kitokey-summary --format` reads (`summarising/v1`'s `format.schema.json`).
pub fn file(format: &Format) -> Value {
let ids = ids(&format.sections);
Expand Down
69 changes: 61 additions & 8 deletions modules/shell/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use kitokey_shell::microphone;
use kitokey_shell::{
autostart,
confidential::{self, Left, Wait, What},
context, correction, dates, desktop, engines, example, exporting, keys,
context, correction, dates, desktop, engines, example, exporting, formats, keys,
licence::{self, Licence},
log,
meeting::{self, Read, Transcript},
Expand Down Expand Up @@ -148,6 +148,9 @@ struct Shell {
/// The model each meeting's last minutes were asked with, when one was named (a Refaire…):
/// tried again, with that one (D25).
minutes_tried: Mutex<HashMap<PathBuf, Option<(String, String)>>>,
/// The format a *Refaire…* chose for its meeting (D130), its structure: that making alone;
/// none, Settings' default.
format_chosen: Mutex<HashMap<PathBuf, String>>,
/// The sessions whose transcripts wait for the one being made, or for the model — in
/// the order they were asked, each once; made again as a *Refaire…* asked (D25, D59).
waiting: Mutex<VecDeque<(PathBuf, Option<Again>, Cancel)>>,
Expand Down Expand Up @@ -419,6 +422,7 @@ fn main() {
busy_meetings,
freed,
minutes_redo,
formats_offered,
making_cancelled,
context_shown,
context_saved,
Expand Down Expand Up @@ -594,6 +598,7 @@ fn main() {
served: Mutex::new(None),
minutes_made: Mutex::new(HashMap::new()),
minutes_tried: Mutex::new(HashMap::new()),
format_chosen: Mutex::new(HashMap::new()),
asked_again: Mutex::new(HashMap::new()),
waiting: Mutex::new(VecDeque::new()),
examples: Mutex::default(),
Expand Down Expand Up @@ -1305,8 +1310,14 @@ fn minutes_redo(
name: String,
provider: Option<String>,
model: Option<String>,
format: Option<String>,
) -> Result<(), Told> {
let folder = session_folder(&shell, &name)?;
// The format chosen in its dialog, for this making (D130); none, Settings' default.
match format {
Some(format) => shell.format_chosen.lock().unwrap().insert(folder.clone(), format),
None => shell.format_chosen.lock().unwrap().remove(&folder),
};
// The settings' model, as they name it now, when none is chosen: still a redo, which waits
// its turn behind the meeting's own making — never taken for a second first one.
let chosen = match provider.zip(model) {
Expand All @@ -1320,6 +1331,37 @@ fn minutes_redo(
Ok(())
}

/// A format as *Refaire…* offers it and the summary's line names it (D130): its structure, a
/// person's own name — a built-in one is named by the page's words —, and whether it is the default.
#[derive(serde::Serialize)]
struct FormatOffered {
structure: String,
name: Option<String>,
default: bool,
shown: bool,
}

/// The formats: those offered in Settings' order, then the built-in ones hidden — a summary written
/// in one still names it.
#[tauri::command]
fn formats_offered(shell: State<'_, Shell>) -> Vec<FormatOffered> {
let formats = shell.settings().formats;
let shown = formats.shown();
let hidden = formats::BUILT_IN.iter().copied().filter(|built| !shown.contains(built));
shown
.iter()
.copied()
.map(|structure| (structure, true))
.chain(hidden.map(|structure| (structure, false)))
.map(|(structure, offered)| FormatOffered {
structure: structure.into(),
name: formats.own(structure).map(|format| format.name.clone()),
default: formats.default == structure,
shown: offered,
})
.collect()
}

/// « Annuler » on a meeting's page (D92, the decider's word of 2026-11-13): what is being made of
/// it — its transcript, its minutes — ends within two seconds, and what waits its turn leaves the
/// line. The version already whole stays; the user may at once start another making.
Expand Down Expand Up @@ -4557,6 +4599,7 @@ fn write_minutes_from(
shell.stopped.lock().unwrap().remove(&folder);
minuting(app, true);
let app = app.clone();
let formats = settings.formats.clone();
// The keyring may ask the user first: never on the window's and the tray's thread.
std::thread::spawn(move || {
let shell = app.state::<Shell>();
Expand Down Expand Up @@ -4585,13 +4628,23 @@ fn write_minutes_from(
// Cancelled while the keyring was asked: never started (D92).
Err(std::io::Error::other("cancelled"))
} else {
Summarising::start(
&program("kitokey-summary", "KITOKEY_SUMMARY"),
&folder,
&provider,
&model,
key.as_deref(),
)
// In the format chosen for it, else Settings' default (D130): its file, when it is a
// person's own, written beside the settings.
let structure = formats::for_making(&mut shell.format_chosen.lock().unwrap(), &folder, &formats.default);
let beside = settings::file().and_then(|file| file.parent().map(|folder| folder.join("formats")));
beside
.ok_or_else(|| std::io::Error::other("this system names no folder for settings"))
.and_then(|beside| formats::argument(&formats, &structure, &beside))
.and_then(|shape| {
Summarising::start_as(
&program("kitokey-summary", "KITOKEY_SUMMARY"),
&folder,
&provider,
&model,
key.as_deref(),
&shape,
)
})
};
let events = match started {
Ok((making, events)) => {
Expand Down
Loading
Loading