feat(daemon): reconstruct managed session catalog - #1261
Conversation
4e1b046 to
4f87ab5
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5b96482. Configure here.
|
Follow-up fix in Validation: exact Biome 2.5.5; root |
* feat(daemon): reconstruct managed session catalog Reconstruct the unique net delta from PR #1261, excluding propagation merges. * fix(daemon): preserve family authority boundaries Scope live family catalogs, anchor relative parent paths, and retain legacy rename compatibility without weakening authority-aware requests.

Summary
Stack
core02-host-request-dispatcher)Validation
Exclusions
Note
High Risk
Changes authentication-adjacent agent family reach, cross-worker messaging, and catalog I/O; ambiguous or hostile topology now hard-denies ACL surfaces that previously might have succeeded.
Overview
Replaces ad-hoc sibling/parent inference with a managed family catalog built from saved sessions, RLM registries, and live workers. The catalog process gains
family/listCatalogFamilySessions, openat-based trusted reads, and strict topology checks (depth, cycles, duplicates, symlinks); siblings are derived from that graph instead of loose registry scans.agent-messagesnow resolves siblings only when the catalog yields a single unambiguous parent; contradictory id/path parent claims are rejected. Name reservation can still use direct parent claims when a passive child outlives its parent row, without widening family reach.Daemon and supervisor build
agentFamilyCatalogEntries/familyCatalogEntriesby merging persisted, artifact, passive, resident, and remote rows (duplicate or conflicting topology fails closed). Agent-origin send, observe, roster, and wake authorize against one captured snapshot; post-wake session substitution is rejected. CLI sends stay deliverable with advisory relationship labels when the catalog is ambiguous or unavailable.rename_saved_sessionbumps to schema revision 17 with optionalsessionDirso inactive renames and name checks use the correct catalog root.readSessionInfoFromBufferlets catalog parsing reuse bound file bytes without reopening paths.Reviewed by Cursor Bugbot for commit 8a3c33f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Reconstruct managed session catalog with authoritative topology snapshots for daemon ACL enforcement
listCatalogFamilySessionsindaemon-catalog-process.ts, which traverses the session family graph securely using O_NOFOLLOW directory handles and a Python descriptor-relative file reader to mitigate TOCTOU races and path traversal attacks.agentFamilyCatalogEntriestodaemon-mode.ts, merging saved, passive, resident, and remote session sources into a single immutable authorization snapshot; agent-origin message delivery is now gated against this snapshot rather than mutable live state.sameAgentFamilyParentandisAgentFamilyParentinagent-messages.tsto require catalog-resolved, unambiguous single parents for sibling classification; direct identifier equality without catalog resolution no longer qualifies.daemon-supervisor.tswithfamilyCatalogEntriesandauthoritativeFamilyCatalogEntryto scope rename, name-availability, and send-message authorization to a specificsessionDir; conflicting persisted vs. live topology now fails closed.sessionDirto therename_saved_sessioncommand, requiring protocol>=7 and schemaRevision>=17.listSavedSessionSiblingsnow throws if the target session is absent from the authoritative family traversal, and malformed remote peer topology raisesAGENT_FAMILY_REACH_ERRORinstead of being silently coerced.Macroscope summarized 8a3c33f.