Skip to content

design-15 S5: declared chain edges via downstream_line_uuid - #15

Closed
lr00rl wants to merge 3 commits into
alpha/v0.2.2from
feat/design-15-chain-edges
Closed

design-15 S5: declared chain edges via downstream_line_uuid#15
lr00rl wants to merge 3 commits into
alpha/v0.2.2from
feat/design-15-chain-edges

Conversation

@lr00rl

@lr00rl lr00rl commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

design-15 §6 chain recognition:

  • buildLineGroups step (5): a sidecar-declared downstream_line_uuid resolves to the downstream line's hash fleet-wide — exact across machines, immune to NAT/DNS/shared ports. Declared edges land in jump_edges (deduped against inferred ones) and in the new declared_jump_edges provenance subset.
  • Unknown or self-referencing uuids resolve to no edge (honest dangling state; the raw uuid stays visible on the line).
  • The existing (host,port) inference stays as the fallback for non-orchestrated nodes.
  • Companion UI: vpn-core line detail badges declared relay targets (plugin PR Carry operator inventory metadata through node enroll and update #3, updated digest/signature).

Stacked on #14.

Verification

  • gofmt/go vet clean; go test ./internal/server/ ok (21s)
  • New test covers: cross-node declared resolution, no duplication vs inferred, orphan line without downstream, dangling uuid → no edge

Refs LatticeNet/lattice#2, #13, #14, LatticeNet/lattice-plugin-vpn-core#3.

lr00rl added 3 commits July 18, 2026 05:30
D1/§4 slice: persist the line_hash_id -> line_uuid mapping in the
vpnmeta/lineuuid KV bucket, attach LineUUID/DownstreamLineUUID to the
Lines read model (allocation degrades, never fails the read), render the
lattice.singbox-metadata.v2 sidecar deterministically per node, and add
the reviewed apply-task helper (atomic tmp+mv, .bak backup) without
wiring any trigger yet.

Pins lattice-sdk @60c69bd (draft PR lattice-sdk#7) for the new
SingBoxNode line_uuid/downstream_line_uuid fields.
vpn-core users-admin gains plan_add/plan_remove (in-core, core-backed):
each compiles a pending approval whose Plan is a redacted payload
(op/line/user/credential SHA — never secret material) and whose Action
binds the exact credential bytes. The approval executor renders the
on-box `sb user add|del <line> <payload>` invocation, re-deriving the
credential from the write-only store and failing closed when the bytes
moved since approval.

Also adds rotate: regenerate one protocol credential with a one-time
reveal, preserving the write-only read model. Every on-line user carries
the design-15 §5 derived name (u_<sha256(user|line_uuid)[:16]>) — the
single join key for auth, auth_user routing, and per-user stats.

A successful remove drops the server-side binding so the read model
stops claiming the user belongs on the line. Managed-track user writes
(whole-config re-render) are explicitly rejected with a pointer to the
later slice.
design-15 §6: a sidecar-declared downstream_line_uuid now joins to the
downstream line's hash across the whole fleet — exact across machines
and immune to NAT or shared ports — and lands in both jump_edges and
the new declared_jump_edges provenance subset. Inferred (host,port)
edges stay as the fallback; unknown or self references resolve to no
edge.
@lr00rl
lr00rl force-pushed the feat/design-15-line-users branch from 0b39e33 to 9812a3c Compare July 22, 2026 13:29
Base automatically changed from feat/design-15-line-users to alpha/v0.2.2 July 22, 2026 13:41
@lr00rl

lr00rl commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #20, which rebased the complete remaining Design 15 stack onto alpha/v0.2.2 and passed go test, go vet, gosec, govulncheck, formatting, and Docker contract CI before merge as 86422a1.

@lr00rl lr00rl closed this Jul 22, 2026
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