Skip to content

design-15 S2: line_uuid metadata model + sidecar renderer - #13

Merged
lr00rl merged 3 commits into
alpha/v0.2.2from
feat/design-15-linemeta
Jul 22, 2026
Merged

design-15 S2: line_uuid metadata model + sidecar renderer#13
lr00rl merged 3 commits into
alpha/v0.2.2from
feat/design-15-linemeta

Conversation

@lr00rl

@lr00rl lr00rl commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

design-15 D1/§4 server slice:

  • KV mapping vpnmeta/lineuuid: ensureLineUUID get-or-allocate UUIDv4 (crypto/rand, no new deps), idempotent, mutex-serialized; allocation failure degrades the read model field, never the read.
  • Read model: Line.LineUUID / Line.DownstreamLineUUID; buildLineGroups fills both (discovered passthrough from agent inventory).
  • Sidecar renderer renderLineMetadataJSON(nodeID): deterministic lattice.singbox-metadata.v2 output (sorted inbounds, fixed reserved block); schema-invalid renders fail closed.
  • Apply-task helper newLineMetadataApplyTask: reviewed sh script (atomic tmp+mv, .bak backup, 0644 root) — no trigger wired (later slice).

Pins lattice-sdk@60c69bd (draft PR lattice-sdk#7) for SingBoxNode.line_uuid/downstream_line_uuid.

Verification

  • gofmt -l . clean; go vet ./... clean
  • go test ./internal/server/ ok (19.8s) — new linemeta tests: allocation idempotency + reopen persistence, UUID v4 format, buildLineGroups fill, renderer contract shape, degraded-store path, apply-task script shape
  • go test ./... all ok

Refs LatticeNet/lattice#2, LatticeNet/lattice-sdk#7. Next: S3 agent sidecar read + enrichment, then trigger wiring (S2b).

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.
lr00rl added 2 commits July 22, 2026 04:59
The prior workflow overrode go.mod with an SDK checkout chosen from the server branch name, then silently fell back to SDK main when that unrelated branch did not exist. Testing the declared module version keeps cross-repository slices reproducible and makes dependency pin failures honest.

Constraint: Design-15 server branches depend on a pushed SDK pseudo-version with a different branch name

Rejected: Add mirrored branch names in lattice-sdk | couples CI correctness to naming conventions

Confidence: high

Scope-risk: narrow

Directive: Cross-repository CI must not override go.mod with an unrelated default-branch checkout

Tested: GOWORK=off go mod verify; go vet ./...; go test -race -cover ./...; YAML parse; git diff --check
Removing the SDK workspace does not require changing gosec's invocation root. Preserve the repository-prefixed scan target so the dependency fix does not also alter analyzer behavior.

Constraint: CI dependency resolution and static-analysis semantics must change independently

Confidence: high

Scope-risk: narrow

Tested: Workflow diff review; prior successful main CI gosec evidence
@lr00rl
lr00rl marked this pull request as ready for review July 22, 2026 13:27
@lr00rl
lr00rl merged commit 5911c56 into alpha/v0.2.2 Jul 22, 2026
1 check passed
@lr00rl
lr00rl deleted the feat/design-15-linemeta branch July 22, 2026 13:28
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