Skip to content

feat(compass-agent): agents_tree native tool — indented agent tree with live presence (RIG-2678) - #1062

Open
rigel-mintaka wants to merge 4 commits into
mainfrom
compass-agent/rig-2678-agents-tree
Open

feat(compass-agent): agents_tree native tool — indented agent tree with live presence (RIG-2678)#1062
rigel-mintaka wants to merge 4 commits into
mainfrom
compass-agent/rig-2678-agents-tree

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

New read-only compass_tree tool, sibling of compass_roster: one GetRoster call (scope subtree|owner, default subtree), assembled client-side into an indented parent→child tree with each agent's presence + activity. Pure agent-side — no proto, no RPC, no server work; the roster already carries parent_agent_id + presence.

Handles and display names only, never account ids (ids are the internal tree keys); every peer-supplied string is flat-guarded exactly like the roster rows. An orphan (unknown parent) attaches at root rather than vanishing; a malformed parent cycle terminates via a visited set, each node rendered once. One hasParent predicate drives both child-grouping and root-selection so they cannot disagree.

Matt-ruled pull-tool-over-prompt-bake (the tree is live state, so a prompt bake would rot); the name compass_tree matches the compass_roster sibling and the name reserved in config/prompts/manager/SYSTEM.md. Usage guidance rides compass-server's prompts workstream separately.

Review R1 folded: unified tree predicate, exact-body + grandchild tests, tool-count docs. Sibling latent-flake finding filed as RIG-3611.

Closes RIG-2678

Co-authored-by: Matt Wilkinson matt@rigel.build

…th live presence (RIG-2678)

New read-only `agents_tree` tool, sibling of `compass_roster`: one `GetRoster` call (scope `subtree`|`owner`, default `subtree`), assembled client-side into an indented parent→child tree with each agent's presence + activity. Pure agent-side — no proto, no RPC, no server work; the roster already carries `parent_agent_id` + `presence`.

Handles and display names only, never account ids (ids are the internal tree keys); every peer-supplied string is `flat`-guarded exactly like the roster rows. An orphan (unknown parent) attaches at root rather than vanishing; a malformed parent cycle terminates via a `visited` set, each node rendered once.

Matt-ruled pull-tool-over-prompt-bake (the tree is live state, so a prompt bake would rot). The when/how usage guidance rides compass-server's prompts workstream separately, not a second prompt edit here.

Closes RIG-2678

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Sep 10, 2026

Copy link
Copy Markdown

RIG-2678

@trunk-io

trunk-io Bot commented Sep 10, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-agent-rig-2678-agent.compass-eng-docs.pages.dev

Deployed from compass-agent/rig-2678-agents-tree at 769330e.

Changed pages:

…cate, strengthen tests (RIG-2678)

Review R1 (5 medium, all dispositioned):

- **Name (Matt-ruled):** `agents_tree` → `compass_tree`, matching its sibling `compass_roster` (same GetRoster RPC) and the name already reserved in `config/prompts/manager/SYSTEM.md`'s deferred TODO. Renamed the tool, schema (`compassTreeParameters`), and all test references.
- **Correctness:** the `children` and `roots` predicates were not complementary — an entry with an empty `agentAccountId` could be demoted from root to child of that empty-id node. Unified both sites behind one `hasParent` predicate, so the doc comment's "empty or unknown parent is a root" is now enforced, not just claimed.
- **Test adequacy:** the orphan assertion was vacuous (the fallback loop masked a dropped-orphan mutant) → now pins the exact rendered body (row set, order, indentation) plus the single-block and anti-injection-framing invariants. Added a 3-level grandchild test — nothing exercised depth ≥ 2, so a depth-clamp mutant shipped green.
- **Docs:** `comms.ts` header enumeration and `packages/compass-agent/AGENTS.md` still said "Seven tools"; both now "Eight" with a `compass_tree` row. Added a `compass_tree` bullet to `docs/concepts/tools.md`.

Sibling latent-flake finding (four other test files carry the same unbounded cleanup hook) filed as RIG-3611. Lows (blank-line/period nits) folded in.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigelbuild-bot rigelbuild-bot changed the title feat(compass-agent): agents_tree native tool — indented agent tree with live presence (RIG-2678) feat(compass-agent): compass_tree native tool — indented agent tree with live presence (RIG-2678) Sep 11, 2026
@rigel-mintaka rigel-mintaka changed the title feat(compass-agent): compass_tree native tool — indented agent tree with live presence (RIG-2678) feat(compass-agent): agents_tree native tool — indented agent tree with live presence (RIG-2678) Sep 11, 2026
…tree prompts/skills, share rosterRow (RIG-2678)

- Add an empty-agentAccountId root regression test (red-green proven: fails on
  the pre-fix split predicate, passes on the unified hasParent).
- Activate the compass_tree lines in the manager/owner/supervisor SYSTEM prompts
  and the management-trees + compass-setup skills (GC-3/MP-4 same-PR flip: the
  tool ships here, and RIG-1721's roster fresh-read is Done). Re-parenting stays
  deferred (no tool wraps it yet).
- Extract a shared rosterRow() helper so the flat roster and the tree share one
  render-guarded row contract, removing the duplicated invariant.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-agent/rig-2678-agents-tree branch from 70cf0a9 to c732a71 Compare September 11, 2026 03:10
…e, fix dangling deferral refs (RIG-2678)

- manager/owner SYSTEM prompts: reading your parent fresh needs compass_tree
  with scope: owner (default subtree excludes the parent and renders you as a
  root) — the flip named the tools without the scope that surfaces the parent.
- management-trees skill: replace the dangling 'see Deferred affordances below'
  pointer (that section was removed) with an active pointer to Reading the tree;
  qualify roster-vs-tree default scope; make parent-read guidance consistent.
- compass-setup skill: fix the garbled 'track a shape to restructure' sentence.
- Forward-looking flip-discipline header in all three prompts so it stays true
  with an empty deferred set.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
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