Skip to content

feat: add Device::tka_log for the tailnet-lock AUM history#269

Merged
GeiserX merged 1 commit into
mainfrom
feat/tka-log
Jun 15, 2026
Merged

feat: add Device::tka_log for the tailnet-lock AUM history#269
GeiserX merged 1 commit into
mainfrom
feat/tka-log

Conversation

@GeiserX

@GeiserX GeiserX commented Jun 15, 2026

Copy link
Copy Markdown
Owner

What

Engine ask #25 (slice PR-A): Device::tka_log(limit) -> Vec<TkaLogEntry>, mirroring Go NetworkLockLog — the tailnet-lock AUM update-chain history, head-first, read locally from the already-synced + verified MemAumStore. The daemon consumes it as tnet lock log (tsd-lq8).

Lowest-risk TKA slice: a pure local read — no crypto, no control RPC, no mutation. The two write-ops slices (PR-B tka_local_disable, PR-C tka_add/tka_remove) are designed and tracked separately.

How

  • AumKind::as_str() (ts_tka) — byte-exact Go AUMKind.String() strings (add-key/remove-key/checkpoint/update-key/no-op/invalid, cross-checked against Go v1.100.0 tka/aum.go).
  • TkaLogEntry { aum_hash, change, signer_key_ids, raw } — mirrors Go ipnstate.NetworkLockUpdate (raw = Go's .Raw serialized AUM so the daemon can decode signers faithfully; signer_key_ids is an honest convenience extracted from the decoded AUM).
  • A synchronous control-runner read message + a pure tka_log_entries(store, oldest, limit) mapping helper: linear_chain_from yields genesis→head, .rev() to match Go's head→genesis walk, then .take(limit). No lock synced → empty Vec.
  • Runtime::tka_log + Device::tka_log delegators (local read → coarse Error, like tka_status).

Tests (offline — no control)

AumKind::as_str string vector; tka_log_entries head-first ordering + field correctness, limit truncation (keeps newest), signer-key-id extraction, and unwalkable/no-synced → empty. 4 new + the as_str test, all green.

Gates (local, all green)

cargo test -p geiserx_ts_tka -p geiserx_ts_runtime -p geiserx_tailscale · clippy -D warnings (3 crates + tun lane) · cargo fmt --check · cargo doc (broken_intra_doc_links=deny) · cargo run -p checks.

Signed-off-by: Sergio sergio@geiser.cloud

Created using Claude Code (Opus 4.8)

Mirror Go LocalClient.NetworkLockLog: a pure local read of the
locally-synced + verified TKA chain, returning the AUM update-chain
history head-first up to a limit. No crypto, no RPC, no mutation.

- ts_tka: AumKind::as_str returns the byte-exact Go AUMKind.String
  values (add-key/remove-key/update-key/checkpoint/no-op/invalid).
- ts_runtime: new public TkaLogEntry type mirroring ipnstate
  NetworkLockUpdate plus a pure tka_log_entries mapping helper, a
  synchronous control_runner tka_log read message, and a Runtime
  delegator.
- facade: Device::tka_log delegating to the runtime, with TkaLogEntry
  re-exported.

Signed-off-by: GeiserX <9169332+GeiserX@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@GeiserX, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 32 minutes and 26 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 32c0ad93-867c-4af0-bf66-622e61d010a9

📥 Commits

Reviewing files that changed from the base of the PR and between 35e5db2 and f0238ba.

📒 Files selected for processing (5)
  • src/lib.rs
  • ts_runtime/src/control_runner.rs
  • ts_runtime/src/lib.rs
  • ts_runtime/src/tka_sync.rs
  • ts_tka/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tka-log

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@GeiserX GeiserX merged commit 0bc6f2f into main Jun 15, 2026
16 checks passed
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