Skip to content

egress fast-follows: record the raw paths + build hygiene - #86

Open
huximaxi wants to merge 4 commits into
feat/egress-tauri-writerfrom
feat/egress-hardening
Open

egress fast-follows: record the raw paths + build hygiene#86
huximaxi wants to merge 4 commits into
feat/egress-tauri-writerfrom
feat/egress-hardening

Conversation

@huximaxi

@huximaxi huximaxi commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What

Fast-follows surfaced by the #85 pre-deploy loop. Stacked on #85 (base is feat/egress-tauri-writer; merge after it).

  1. egress — every egress site records through one recorder. Closes the two dormant raw-egress commands (call_ollama, embed_text) that POST content to Ollama with no WAL frame: they now record through a shared note_egress(), which also honors LOCI_WAL_DISABLED and the egress.degraded/egress.disabled markers. egress_class_for_host() is shared by the backend and the raw paths; EgressLogged::new is now pub(crate) (the ollama()/claude() factories stay the only public constructors).
  2. security — bound the Tailscale CGNAT check. The local/private-network egress check treated the whole 100.64.0.0/8-shaped range as trusted; bound it to the actual CGNAT block, 100.64.0.0/10 (100.64.0.0100.127.255.255), so public addresses in 100.128.0.0/9 no longer get misclassified as local. Covered by four new tests hitting both bounds, above, below, and the wrong scheme.
  3. build — hygiene. build.sh VERSION 0.2.00.6.0-beta (matches tauri.conf.json); dropped the dead .github/workflows/release.yml reference; states plainly the build is UNSIGNED on both the macOS and Windows paths now.

Why these, and not the rest

Included the fast-follows that are cheap, safe, and self-contained. Deferred, with reasons:

  • WAL rotation/compaction — a real feature, not a fast-follow. The 256 MB loci audit cap is ~58 years at human pace (~7 months at agent pace). Its own PR.
  • wal.enabled config flag — the LOCI_WAL_DISABLED env var + the surfaced egress.disabled marker already give a reversible, non-silent off-ramp; a config field isn't worth the plumbing for beta.
  • Notarization wiring — needs your Apple Developer ID + a signing decision; build.sh now states unsigned plainly on the default path.
  • serde forward-compat (Unknown egress class) — has a serialize edge; low value, deferred.

Verified

  • src-tauri 28/28 (decorator + Tailscale-class + CGNAT-bound tests).
  • loci-wal / loci-cli untouched by this PR.

Boundary

Public; no new dependencies; no private-core terms (local bleed-guard clean).

@huximaxi
huximaxi force-pushed the feat/egress-hardening branch from 6518995 to 949f94c Compare September 9, 2026 11:12
@huximaxi
huximaxi marked this pull request as ready for review September 9, 2026 11:12
@huximaxi
huximaxi force-pushed the feat/egress-tauri-writer branch from bec1ab3 to 37a387f Compare September 9, 2026 11:43
huximaxi and others added 4 commits September 9, 2026 13:43
Close the two dormant raw-egress paths (call_ollama, embed_text) that egressed content with no WAL frame, and unify recording:
- note_egress() is the single recording path: honors LOCI_WAL_DISABLED (stamps egress.disabled) and stamps egress.degraded on write failure. The decorator + call_ollama + embed_text all record through it.
- egress_class_for_host() shared by the backend and the raw paths.
- EgressLogged::new is now pub(crate) (defense-in-depth; the ollama()/claude() factories are the only public constructors).
- VERSION 0.2.0 -> 0.6.0-beta (matches tauri.conf.json)
- drop the dead .github/workflows/release.yml reference
- state plainly the build is UNSIGNED (notarization wiring is a follow-up)
validate_ollama_url accepted any 100.x host whose second octet was >= 64,
which also permits 100.128.0.0 through 100.255.255.255 (public IP space)
despite the comment and error message both claiming the CGNAT range is
100.64 to 100.127. A base_url pointing at a routable public host in
100.128+ passed the SSRF gate and was classified as LocalNetwork egress.

Bound the second octet to 64..=127. Add url_validation_tests covering the
CGNAT edges, public space above and below the range, and non-permitted
hosts and schemes.
The macOS build path already prints an unsigned-binary notice before
notarization; the --windows NSIS path had none, so a user who only ever
cross-builds for Windows got no signing-risk warning at all. Also drops
the stale "v0.2.0" references in the header/output-path comments now that
VERSION is 0.6.0-beta.
@huximaxi
huximaxi force-pushed the feat/egress-hardening branch from 949f94c to c2efccd Compare September 9, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant