Repository navigation
feat(register): native trackboard reservation adoption (§D.4 Path 1) - #14
Closed
convenientlymike wants to merge 5 commits into
Closed
convenientlymike wants to merge 5 commits into
convenientlymike wants to merge 5 commits into
Conversation
… wiring (B7) Vendored from the trackboard telemetry slice-3 B7 co-land (trackboard @ 9a45077). tb_kpi.sh is a side-effect-free sourced lib: resolves the trackboard checkout on this box (fail-loud, never a lying default), runs `python3 -m trackboard.telemetry_report` on a bare python3 via PYTHONPATH=<checkout>/src, and breadcrumbs LOUD (marker + board note) if unwired — never a silent no-op. heartbeat.sh sources it + calls _tb_kpi backgrounded/fail-open after ensure_self_registered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…board slice-5 #8b-2) Advance the per-target cursor only at a terminal disposition (gone/live/successful-wake); a throttle deferral (kill-switch/rate-limit/cooldown) holds the cursor so the next scan retries — the rate cap becomes a staggerer, not a dropper. Selftest gains the DEFER-NOT-DROP control. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… (from trackboard #8b-3)
…(from trackboard #9)
…ath 1)
When trackboard mints a reservation targeting this window's cwd+device, adopt
it on the target host at SessionStart — the AUTHORITATIVE adoption path
(deterministic, on-host, no roster-reconcile race).
adopt_reservation (lib.sh), called from register.sh between reap and the
agent-file write, guarded so it can NEVER block a normal registration:
(a) writes identities/<sid>.json (the name/role overlay trackboard reads);
(b) seeds the mission into the WINDOW-KEYED goalstack on this host (the only
reliable cross-device seed, §D.6);
(c) hands the device slug to register.sh's agent-file writer (host field);
(d) stamps the reservation adopted/bound_sid/bound_host/adopted_via=native
and RE-SIGNS so trackboard's read path still accepts it.
Load-bearing invariants (selftest-adopt.sh — 12 bites, wired into CI):
- authenticity: reservations are HMAC-SHA256-signed by trackboard; a record
whose sig doesn't verify is a forgery and is IGNORED. The verify + re-sign
reuse trackboard's exact canonicalization (sorted-key, tight-separator JSON
minus `sig`) via python3 — zero drift; the A1 re-sign-still-verifies bite is
the anti-drift forcing function. Canonical source: trackboard fleet.py
`_reservation_sig`.
- never-guess: match by explicit $FLEET_RESERVATION (preferred) else a UNIQUE
cwd+device fallback; ambiguity (>1) or a foreign device → adopt NONE, leave
pending. Requires a device slug from env — never `hostname`.
- back-compat: with no adopted reservation, ADOPT_HOST is empty and the agent
file is byte-identical to the pre-feature baseline (A2 bite via real
register.sh). Fail-closed (no python3/key) degrades to trackboard reconcile —
never worse than an un-patched checkout.
shellcheck-clean (--severity=warning); existing selftests still green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Superseded — native reservation adoption was already merged by #13 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
adopt_reservationto the Fleet SessionStart hook (register.sh), the authoritative path for a trackboard reservation to become a live agent on the target host. This is scope #3 of the trackboard fleet-agent-D design (docs/fleet-agent-D-v2-design.md§D.4 Path 1) — the signed companion to the daemon/launcher already landed on the trackboard side.When trackboard mints a reservation targeting this window's
cwd+device,register.sh(betweenreapand the agent-file write) adopts it on-host, deterministically, with no roster-reconcile race:identities/<sid>.json— the name/role overlay trackboard's roster reads (survives the heartbeat rewrite by construction).hostfield).adopted/bound_sid/bound_host/adopted_via=nativeand re-signs so trackboard's read path still accepts it.Why it's safe on a hook that runs on every window
python3— zero drift; the A1 re-sign-still-verifies selftest is the anti-drift forcing function. Canonical source: trackboardfleet.py:_reservation_sig.$FLEET_RESERVATION(preferred, unambiguous) else a unique cwd+device fallback; ambiguity (>1 match) or a foreign device → adopt NONE, leave pending. Requires a device slug from env — neverhostname(a fleet must not guess its own identity).ADOPT_HOSTis empty and the agent file is byte-identical to the pre-feature baseline (the A2 selftest runs the realregister.shand asserts nohostkey). Fail-closed (nopython3/key) degrades to trackboard's reconcile path — never worse than an un-patched checkout.Forcing function
selftest-adopt.sh— 12 hermetic bites (each paired with a control that fires), wired into the CIselftestjob:register.shwrites NOhoston a baseline reg; DOES on adoptVerification
selftest-adopt.sh— 12/12 green.shellcheck --severity=warningclean onlib.sh/register.sh/selftest-adopt.sh+ full-tree sweep.selftest-labels/selftest-collateralstill green (no regression).Host-verify owed (not checkable in CI)
The exact goalstack binary resolution + the launcher exporting
$FLEET_RESERVATION/TRACKBOARD_DEVICE_SLUGare runtime facts on the deploy host — smoke with a live trackboard mint before relying on the on-host mission seed.🤖 Generated with Claude Code