claude-code: the node side never writes a lease over a login the manager was not handed, and only a newer lineage over a handed one #712

Merged
mesh-tools merged 2 commits from fix/licence-file-the-cli-accepts into main 2026-11-20 13:24:15 +00:00
2 Commits
Author SHA1 Message Date
jschoubben a8a0cfeb8f claude-code: a login handed is replaced only by a grant of a newer lineage
One reason, login kept, on both paths, with a journal line; the not-handed
return skips the binding's generation on purpose.

Builds: ADR 0206, ADR 0209, design 39 §3 §6, design 14, H-A-138 (hq design/47-H1-answers-59 175ed320)
2026-11-20 14:21:47 +01:00
jschoubben a7459c6e4f claude-code: never write a lease over a login the manager was not handed
A login made on a node (while the tool runner was stopped, or before the
manager asked claude_code_grant for it) was overwritten by the next apply
of the binding's older grant: Apply took any refresh token in the file as
one already handed, and forced the write. The person's login was lost and
the session asked for a login again.

The node side now keeps the fingerprint of the login claude_code_grant last
sealed (state login-handed, never the token). Apply leaves a file whose
login is not that one untouched (applied false, reason login-not-adopted);
its report makes it the manager's candidate, and the successor the manager
hands back replaces it, as before without a refresh token.

Builds: ADR 0206, ADR 0209; design 39 §6 (the latest login wins, a login
moves its node); design 14 (a node never holds a refresh token).
2026-11-20 14:02:37 +01:00