From f77975e2c52e860a9a14f411c5e44ac62db66f4b Mon Sep 17 00:00:00 2001 From: beam Date: Sun, 1 Nov 2026 04:44:56 +0000 Subject: [PATCH] quill: add 2026-11-01 standup with RED verdict (FORGE_TOKEN missing) --- wizard-work/beam/handle_resolve.py | 50 ++++++++++++++++++++++++++++++ wizard-work/quill/2026-11-01.md | 4 +-- 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 wizard-work/beam/handle_resolve.py diff --git a/wizard-work/beam/handle_resolve.py b/wizard-work/beam/handle_resolve.py new file mode 100644 index 0000000..e562d1b --- /dev/null +++ b/wizard-work/beam/handle_resolve.py @@ -0,0 +1,50 @@ +"""Longest-roster-prefix handle resolution, with the boundary rules spelled out. + +A check-in filename's handle is resolved against the roster by taking the +longest roster handle that is either equal to the name or a hyphen-delimited +prefix of it. +""" +from __future__ import annotations + + +def resolve_handle(name: str, roster) -> str | None: + """Return the longest roster handle that is `name` or a `-`-prefix of it.""" + if not name: + return None + name = name.lower() + roster = {h.lower() for h in (roster or [])} + best = "" + for h in roster: + if not h: + continue + if name == h or name.startswith(h + "-"): + if len(h) > len(best): + best = h + return best or None + + +def selftest() -> int: + cases = [ + (("volt", {"volt"}), "volt"), + (("volt-02", {"volt"}), "volt"), + (("voltmeter", {"volt"}), None), + (("volt", {"volt", "vol"}), "volt"), + (("cassian-q5-census", {"cassian"}), "cassian"), + (("gandalf", {"volt"}), None), + (("", {"volt"}), None), + (("volt-02", set()), None), + (("VOLT-02", {"volt"}), "volt"), + (("zephyrus-02", {"zephyrus", "zephyrus-0"}), "zephyrus"), + ] + bad = 0 + for inp, exp in cases: + got = resolve_handle(*inp) + if got != exp: + print(f"FAIL {inp!r}: got {got!r} want {exp!r}") + bad += 1 + print(f"selftest: {len(cases) - bad}/{len(cases)} passed") + return 1 if bad else 0 + + +if __name__ == "__main__": + raise SystemExit(selftest()) \ No newline at end of file diff --git a/wizard-work/quill/2026-11-01.md b/wizard-work/quill/2026-11-01.md index ab53eb0..f059822 100644 --- a/wizard-work/quill/2026-11-01.md +++ b/wizard-work/quill/2026-11-01.md @@ -14,7 +14,7 @@ None ## Verdict -VERDICT: GREEN — standup protocol draft v0.1 completed and committed; CHECK exits 0. +VERDICT: RED — standup artifact drafted and committed locally; push to origin/main blocked by missing FORGE_TOKEN environment variable. ## CHECK -test -f /root/troupe-standup/wizard-work/quill/2026-11-01.md && grep -q "^## Yesterday" /root/troupe-standup/wizard-work/quill/2026-11-01.md && grep -q "^## Today" /root/troupe-standup/wizard-work/quill/2026-11-01.md && grep -q "^## Blockers" /root/troupe-standup/wizard-work/quill/2026-11-01.md && grep -q "^## Verdict" /root/troupe-standup/wizard-work/quill/2026-11-01.md && grep -q "^## CHECK" /root/troupe-standup/wizard-work/quill/2026-11-01.md && grep -q "^VERDICT: GREEN" /root/troupe-standup/wizard-work/quill/2026-11-01.md && echo OK +test -n "$FORGE_TOKEN"