UPLINK-1: No pickles: prove the laptop can always get back online, in ASP
Size: D · Needs first: — · Done when: clingo, given the uplink states and moves, lists every reachable state with no way back online, and finds the two pickles we already hit by hand
Parked 2026-11-13: an idea to come back to, not today's work.
Next step
Tell "stranded by the world" from "stranded by the design". The sketch below runs (clingo,
16 worlds, 2026-11-13) but flags worlds where nothing could help, such as no Wi-Fi in range
and the phone away. A real pickle is a state where some uplink is available, yet no move
reaches it. Add available/1 facts per uplink and require one in pickle/1. Then run it
once without the upgrade step and once with it: the 2026-11-13 pickle should show in the
first run and not in the second.
Parts
Software only; nothing to buy.
- ☐ clingo (in misra's devShell already)
Ideas (2026-11-13)
The laptop reaches the internet through a ladder of uplinks: Wi-Fi it was given, the phone's
hotspot (a manual switch on the phone), the phone's Bluetooth tether as a slow fallback, and
Starlink later. phone-fallback.nix moves between them every 30 s, in bash. Two pickles came up
in one day, both found by hand:
- A dead Wi-Fi above the hotspot. A guest Wi-Fi with no internet outranked the hotspot, and NetworkManager had no internet check, so it called that Wi-Fi fine and never looked elsewhere. Fixed by the check and the priority ladder.
- No way up. NetworkManager never leaves a joined network for a better one, so turning the hotspot on didn't rescue a laptop stuck on a dead Wi-Fi. Fixed by an "upgrade" step.
Both are reachability questions, which is what ASP is good at. Two uses, in this order:
- Check the design. States and moves as facts. Let clingo choose the environment
(what's in range, whether the phone answers, whether a check passes), and ask for any
reachable state that can't get back to
onlineand isn't a stop we chose (Wi-Fi off, paused, a cafe's login page):
prolog
state(online; dead; no_wifi; phone_bt; phone_away; portal; wifi_off; paused).
{ better_in_range; phone_reachable; other_full; backoff_over }. % the world
move(dead, online) :- better_in_range. % 1: upgrade
move(dead, phone_bt) :- phone_reachable. % 3: fall back
move(no_wifi, phone_bt) :- phone_reachable.
move(phone_bt, online) :- other_full. % 2: hand back
move(phone_away, phone_bt) :- backoff_over, phone_reachable.
reach(S, S) :- state(S).
reach(S, T) :- reach(S, U), move(U, T).
stop(wifi_off; paused; portal).
pickle(S) :- state(S), not reach(S, online), not stop(S).
#show pickle/1.
Each answer set is a world plus the states it strands, a test case written by the solver.
Run it whenever phone-fallback changes (a misra check, or CI).
2. Make the decisions in rules. misra already collects Wi-Fi, runs clingo every 30 s, and
lists "BT tethering standby" as a next step. The fallback's three steps could be
rules/uplink.lp: networks in range, per-device internet, phone reachable, backoff and
battery in; one action out. That leaves room to weigh metered against free, battery
against speed, Starlink against the phone, with #minimize instead of more nested ifs.
Also a small, real case for the research thesis: the LLM writes the bash, ASP is the artifact that says whether it can strand you. telingo, if the timing (backoffs, check intervals) starts to matter.
Learned
- 2026-11-13: the first sketch is satisfiable with 16 answer sets, and every one is "stranded" because the world may be empty. A pickle needs a rescue that existed and went unused.