diff --git a/DOCS-photo-pack.md b/DOCS-photo-pack.md index 6a7bb38..b9ee917 100644 --- a/DOCS-photo-pack.md +++ b/DOCS-photo-pack.md @@ -20,9 +20,11 @@ gamma — so the mechanism can be public while the album stays private. Found in this order: `PHOTO_PACK_DIR`, then `$STATE_DIRECTORY/pack` (what systemd hands a **system** unit), then `$XDG_DATA_HOME/signal-bot/pack`. -Under the *user* unit this repo installs, `StateDirectory=` would resolve -below `$XDG_STATE_HOME` rather than `$XDG_DATA_HOME`, so the deployed bot -names its pack outright in `.env` instead of relying on discovery. +`StateDirectory=` is deliberately **not** in the unit this repo installs: +for a *user* unit systemd resolves it below `$XDG_STATE_HOME`, which is not +where the album is. Discovery finds the same directory, and leaving +`PHOTO_PACK_DIR` unset is what keeps a not-yet-filled-in pack from turning +`Restart=always` into a restart loop. Two absences, deliberately different: @@ -62,7 +64,7 @@ Two absences, deliberately different: photo, so a combination that could be answered is not refused. - Triggers may not contain a digit — `folding.py` maps `0134578` onto letters, so `!alfa7` is not what you typed. Two spellings that fold the same are fine - *within one entry* (`!ala`/`!ala` is one person written twice) and + *within one entry* (`!celina`/`!celiną` is one person written twice) and refused across two. ## tags.json diff --git a/signal_bot/pack_load.py b/signal_bot/pack_load.py index 32e9b10..2ccd921 100644 --- a/signal_bot/pack_load.py +++ b/signal_bot/pack_load.py @@ -194,7 +194,7 @@ def _unique_triggers(entries: list[Entry]) -> None: Skeletons, not spellings: two triggers can look different and fold the same, because folding strips diacritics. Within one entry that is normal - and wanted -- "!ala" and "!ala" are one person written two ways, + and wanted -- "!celina" and "!celiną" are one person written two ways, and the registry collapses them into one frozenset. Across two entries it is a manifest that cannot work, and the registry would only be able to say which skeleton collided, not which entry to fix. diff --git a/tests/test_pack_load.py b/tests/test_pack_load.py index 34fb9e2..e29124a 100644 --- a/tests/test_pack_load.py +++ b/tests/test_pack_load.py @@ -83,7 +83,7 @@ def test_a_key_that_reads_like_a_name_is_refused(tmp_path: Path) -> None: def test_a_non_ascii_key_is_refused(tmp_path: Path) -> None: with pytest.raises(ConfigError, match="alphanumeric 'key'"): - _load(tmp_path, people=[{"key": "ala", "triggers": ["!alfa"]}], combos=[], tags={}) + _load(tmp_path, people=[{"key": "gamma\u0105", "triggers": ["!alfa"]}], combos=[], tags={}) def test_an_entry_needs_at_least_one_trigger(tmp_path: Path) -> None: @@ -140,7 +140,7 @@ def test_two_entries_folding_onto_one_trigger_are_refused(tmp_path: Path) -> Non def test_one_entry_may_spell_itself_two_ways_that_fold_the_same(tmp_path: Path) -> None: - """Which is the point: "!ala" and "!ala" are one person, written twice.""" + """Which is the point: "!gamma" and "!gammą" are one person, written twice.""" pack = _load( tmp_path, people=[{"key": "p1", "triggers": ["!gamma", "!gammą"]}], diff --git a/tool/tagger.html b/tool/tagger.html index 5b4d36b..7e95b8d 100644 --- a/tool/tagger.html +++ b/tool/tagger.html @@ -44,12 +44,12 @@ Jedna osoba na linię — Enter po każdej. Bez wykrzyknika. Przecinek to inna nazwa tej samej osoby, nie następna osoba.

-
marek
-ala
+    
ala
+basia
 celina, cela        ← jedna osoba, dwie nazwy
-iga
-oboje = ala + marek    ← zdjęcie, na którym są oboje
-ktokolwiek = ala | marek   ← losowo jedno z nich
+darek +oboje = ala + basia ← zdjęcie, na którym są obie +ktokolwiek = ala | basia ← losowo jedna z nich

W której grupie działają?

szukam grup…