change: retire the last log scraping #91

Merged
mysticalsoap merged 2 commits from change/retire-log-parsing into trunk 2026-08-20 14:14:02 -04:00
Owner

Problem

Follow-up to #90: three free-form text scrapes remained after the management-interface migration. parse_tun_device still read the log for raw custom configs (and for tap configs, whose name write_config saw and threw away); the stdout loop waited on a SIGTERM[hard,] sentinel that a real exit never prints; and monitor.py split ip route output positionally — the same failure class that broke the 2.7 log parse.

Fix

  • The device name is always known before launch: write_config returns a tap config's own name; a raw config's dev directive is read pre-launch, and a bare/missing one gets a name assigned via --dev on the command line (later options beat --config). parse_tun_device is deleted.
  • The stdout read loop ends on EOF alone; the dead sentinel and post-loop line emit are gone. Stdout is now only the GUI log and the double-hop iptables retry.
  • monitor.py reads the default route with ip -j + JSON, matching the bypass pin in tunnel.py.

Verification

  • 130 passed. New TestConfigTunDevice covers concrete/bare/missing dev directives, per-role assignment, and the bare-tap case (a tap config must not get a tun_* name — the prefix carries the device type).
  • The EOF-only loop is backed by the captured DCO session fixture: a real disconnect prints only SIGTERM[soft,exit-with-notification].
  • ip -j route show default field names (gateway, dev) verified against the live host.
  • The captured-session device tests from #90 retire along with the parser they tested; the fixtures stay (management transcripts are active test inputs, the stdout logs back the EOF rationale and document real 2.7.6 formats).
**Problem** Follow-up to #90: three free-form text scrapes remained after the management-interface migration. `parse_tun_device` still read the log for raw custom configs (and for tap configs, whose name `write_config` saw and threw away); the stdout loop waited on a `SIGTERM[hard,]` sentinel that a real exit never prints; and `monitor.py` split `ip route` output positionally — the same failure class that broke the 2.7 log parse. **Fix** - The device name is always known before launch: `write_config` returns a tap config's own name; a raw config's `dev` directive is read pre-launch, and a bare/missing one gets a name assigned via `--dev` on the command line (later options beat `--config`). `parse_tun_device` is deleted. - The stdout read loop ends on EOF alone; the dead sentinel and post-loop line emit are gone. Stdout is now only the GUI log and the double-hop iptables retry. - `monitor.py` reads the default route with `ip -j` + JSON, matching the bypass pin in tunnel.py. **Verification** - 130 passed. New `TestConfigTunDevice` covers concrete/bare/missing `dev` directives, per-role assignment, and the bare-tap case (a tap config must not get a `tun_*` name — the prefix carries the device type). - The EOF-only loop is backed by the captured DCO session fixture: a real disconnect prints only `SIGTERM[soft,exit-with-notification]`. - `ip -j route show default` field names (`gateway`, `dev`) verified against the live host. - The captured-session device tests from #90 retire along with the parser they tested; the fixtures stay (management transcripts are active test inputs, the stdout logs back the EOF rationale and document real 2.7.6 formats).
The positional split of 'ip route show default' output is the same
failure class that broke the 2.7 log parse -- any field the kernel adds
or reorders shifts the indices silently. ip -j mirrors how tunnel.py
already reads routes for the bypass pin.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
change: resolve the tunnel device from the config, not the log
All checks were successful
ci / test (pull_request) Successful in 37s
ci / test (push) Successful in 58s
2b61ef9bc0
The last log-scraping unit is gone: write_config now reports a tap
config's own device name instead of discarding it, and a raw config
aqomui did not write either brings a concrete dev directive or gets a
name assigned on the command line (later options beat --config). With
nothing reading state from stdout anymore, the read loop ends on EOF
alone -- its SIGTERM[hard,] sentinel never matches a real exit, which
only prints SIGTERM[soft,...] (see the captured session fixture).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mysticalsoap deleted branch change/retire-log-parsing 2026-08-20 14:14:02 -04:00
Sign in to join this conversation.
No description provided.