fix(brain): llm-wiki papercuts — duplicate member 400, account-email resolution, supervise ticks - #581
Open
futurepaul wants to merge 1 commit into
Open
fix(brain): llm-wiki papercuts — duplicate member 400, account-email resolution, supervise ticks#581futurepaul wants to merge 1 commit into
futurepaul wants to merge 1 commit into
Conversation
…resolution, supervise ticks Four papercuts from the finite-mono-llm-wiki workaround reports (2026-08-18/19), verified end-to-end against a devfinity services-only stack: - admin member add on an already-member target hit the brain_members primary key and surfaced a bare 500. The store now returns the same broken-invariant 400 as the invitation path: "target is already a brain member". - admin ensure-access / member add / role / folder-access resolved non-finite.vip email targets only through public NIP-05, which cannot answer for account mailboxes on domains without nostr.json (gmail surfaced as 502 transport) even though invite brain create resolves the same email through the Finite Core account-agent roster. resolve_identity_input now resolves account emails through the same roster + identity authorities first and falls back to NIP-05; finite.vip identifiers stay on the NIP-05 path, which is already routed to the identity authority. - daemon supervise workers never recorded tickCount/lastTickAt, so a healthy supervisor reported tickCount: 0 / lastTickAt: null forever — indistinguishable from a wedged daemon until failureCount climbed. Successful notification syncs now record a supervisor tick. - fbrain-cli.md (both packaged copies) documented admin targets as npub-only; aligned with the real <email|NIP-05|npub> surface. The vault-era SKILL.md the report hit was already hard-cut in-repo (7d48291); hosted runtimes pick that up on managed-skills refresh.
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.
Fast follow to the 2026-08-18 brain release, fixing the brain-related papercuts filed in the finite-mono-llm-wiki workaround reports (
workarounds-log/reports/, 2026-08-18/19). Four of the five reports are addressed; the fifth (vision_analyze Spark 502, 2026-08-17) is a provider-side vision failure with no brain-side fix and is not addressed here.Fixes
admin member add500 on already-member targets (2026-08-19-fbrain-admin-member-add-500.md)add_member_with_control_recordsinserted intobrain_memberswithout a duplicate check, so an already-member target hit the primary key and surfaced as a bare 500internal server error. The store now returns the samebroken invariant: target is already a brain member400 the invitation path returns.ensure-accessis unaffected (it short-circuits on its own membership check before calling the store; under a concurrent race it now also gets the clean 400 instead of a 500).admin ensure-access --target <email>→ NIP-05 502 (2026-08-19-fbrain-ensure-access-email-502.md)Non-finite.vip email targets were resolved only through public NIP-05 (
https://gmail.com/.well-known/nostr.json→ 502 transport), whileinvite brain createresolves the same email through the Finite Core account-agent roster.resolve_identity_inputnow resolves account emails through the same roster + identity user-resolution authorities first, falling back to NIP-05 when the email binds to no Finite account. This unifies email resolution acrossadmin member add/remove,admin role grant/revoke,admin folder-access grant/revoke,admin ensure-access, andcollaborator ensure-admin. finite.vip identifiers deliberately stay on the NIP-05 path — it is already routed to the identity authority and answers for managed agent mailboxes (deviating here also changes the departure-fact consumer's resolution sequence).fbraindaemon not ticking (2026-08-18-fbrain-daemon-not-ticking.md)daemon superviseworkers never wrotetickCount/lastTickAt, so even a healthy supervisor reportedtickCount: 0, lastTickAt: nullforever — indistinguishable from the wedged daemon the report suspected. Successful notification syncs now record a supervisor tick; failures keep incrementingfailureCountand persist the reason indaemon.lastError/daemon.sync_blockedactivity (visible viafbrain daemon logs). The reporter's underlying per-tick failure was environment divergence in the hosted daemon (failure string is persisted indaemon logs); the status surface no longer hides daemon health.Stale vault-era skill surface (
2026-08-18-fbrain-skill-vs-cli-mismatch.md)The repo's SKILL.md was already hard-cut to the Brain-era surface in 7d48291 — the report hit an un-refreshed managed-skills checkout in the hosted runtime, which picks the fix up on refresh. What was still stale in-repo:
fbrain-cli.md(both packaged copies) documented admin targets as npub-only. Aligned the reference and the folder-access help line with the real<email|NIP-05|npub>surface, which the email-resolution fix above now actually delivers.Testing
cargo testfor finite-brain-{store,server,cli,core}: all green;cargo fmt --checkandcargo clippyclean.fbrain):admin member add --target devfinity@finite.computerresolves through Core+identity and adds; the duplicate add returns400 {"error":"broken invariant: target is already a brain member"};admin ensure-access --target devfinity@finite.computerreturnsmembership: alreadyMember, state: complete.just dev smokepasses.just skills checkpasses (reference-copy sync enforced).Notes for reviewers
CoreAccountAgentRosterResponse/CoreRosterAgentEntrymoved fromroutes/invitation_plans.rstolib.rsso the shared resolution path can use them; the invitation plan flow is unchanged.origin/main, so pre-existing and out of scope here):authority_boundary_classifies_status_malformed_and_oversized_without_body_leaksintermittently classifies the fake authority's 503 astransporton darwin.