Skip to content

feat(routines): graph workflows group topics under broader ones - #594

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-70mebz
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-70mebz

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: graph workflows could merge, link, retype and hide entities (#567), but topics stayed a flat list unless someone set each one's broader topic by hand. "Sales calls", "Support calls" and "Team calls" sat side by side with nothing above them.

After: the Find what to tidy node has a third new kind in Look for, Topics to group (cluster):

  • A topic whose label ends in another topic's label goes under it ("Sales calls" under an existing "Calls").
  • Three or more topics with no broader topic that end in the same word (at least four letters, not filler) go under a new broader topic named for it ("Calls"), made when the group is applied.

Ask the model checks each group (it can rename the new topic or leave some out), and Apply changes makes the sure ones and proposes the rest. In Routines › Proposed changes a group shows as "Group under a new topic, “Calls”?" with its topics, Group them, Leave them and Undo. POST /graph-changes/{id}/accept takes label to name the new topic. Undo takes the topics out from under it and deletes the topic when the group made it and nothing has used it since.

No built-in workflow or routine changes: nothing is grouped until someone adds a workflow that looks for topics to group.

Motivation and Context

The last part of the parked "More graph cleanup nodes" item (DEVLOG: "More graph nodes: retype entities, hide noise, cluster topics"), following #567.

How

organize.py gets topic_groups (rules A and B above, keys cluster:<space>:<parent> so a dismissed or undone group isn't found again), a cluster judge schema (agree, label, leave), _make_group with topics.create/topics.update, and _ungroup for undo. Topics aren't in graph history, so a group is undone from its graph change only.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote a fragment in changelog.d/. (n/a: the title says it)

Done questions (AGENTS.md)

  • Goal: topic grouping with propose, apply and undo as for merges; merged on green CI.
  • Agents: graph workflows are made and run over the API and MCP; groups are listed, accepted (with label), dismissed and undone with /api/v1/graph-changes, and undo_graph_change over MCP.
  • Zero setup: nothing to install or set.
  • Fewest clicks: one click to group, leave or undo; the new topic's name is filled in.
  • Configurable: the node's kind, how sure and how many are on the canvas, with defaults.
  • Light: rules only; the model is asked only when a workflow has an Ask the model node.
  • Private and secure: n/a, no new surface (same endpoints and roles).
  • Cost: rules first, no model call unless the workflow asks; the judge goes through the existing LLM path and its ledger.
  • User decides: no built-in workflow uses the new kind; what someone dismissed or undid isn't redone.
  • Upgrades: n/a, new fields are optional and old rows read as before.
  • Honest: README and docs describe only what this PR builds.
  • Tests, docs and generated files updated (make openapi).
  • Open standards: groups use the SKOS broader links topics already have.
  • Result reported with evidence; refine later: co-occurrence clusters (topics said together), unticking single topics in a group card.
  • Reuse: topics.create/update, the graph change flow and the judge from feat(routines): graph workflows find wrong types and noise to tidy #567.

Local CI (ci/local-ci.sh): backend (embedded SurrealDB), Next.js, pre-commit, title and upgrade pass. The SurrealDB server job lost its server mid-run (handshake timeouts across unrelated tests, which this container does when jobs share its cores); GitHub CI decides it.


Generated by Claude Code

The Find what to tidy node gets a cluster kind: topics whose labels end in another topic's label go
under it, and three or more with no broader topic that end in the same word go under a new topic
for it. Ask the model checks each group, and Apply changes makes the sure ones and proposes the
rest. Undoing a group takes its topics out from under the broader one, and deletes that topic
when the group made it and nothing has used it since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Nbf5G7PvMgThj8BbUPGT8
@adeelahmad
adeelahmad merged commit a0c6e87 into main Oct 18, 2026
11 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-70mebz branch October 18, 2026 12:26
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.

2 participants