Skip to content

feat(routines): graph workflows find wrong types and noise to tidy - #567

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

adeelahmad merged 7 commits into
mainfrom
claude/project-thread-70mebz

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: a graph workflow could only find look-alike entities to merge or link. An entity keeps the type its first asset gave it, so a name analysis called a Term stays a Term even when later lines say "Dr Ferris", and filler like "Okay so" stays in the graph until someone hides it by hand. A merge someone undid from a run could be made again by the next night's run.

After: the Find what to tidy node (candidates) has two more kinds in Look for:

  • Wrong types (retype): entities whose type the naming rules (name_types.py) read differently now, from the name itself (a title, an ending like Labs, a known place or organisation) or from most of the lines that say it (at least two). Types a person or an agent set, fixed-list and hidden entities, and types the namespace doesn't keep are left alone.
  • Noise (hide): no letters, one letter, filler words (not acronyms like US), a phrase rather than a name, or a term said once (50%, under the default 70%).

Ask the model judges each kind with its own question (the type, from the namespace's types; or noise or not), and every verdict now has agree. Apply changes makes the sure ones and proposes the rest. In Routines › Proposed changes they show as "Type: Term → Organisation?" and "Hide as noise?", with Make it Organisation / Hide it, Leave it, and Undo. POST /graph-changes/{id}/accept takes to to pick another type. Undo puts the type back or shows the entity again, unless someone changed it since; a rollback past one marks it undone.

Anything proposed, dismissed or undone is no longer found again, merges included, so a run never redoes what someone took back.

No built-in workflow or routine changes: nothing is retyped or hidden until someone adds a workflow that looks for these.

Motivation and Context

The parked "More graph cleanup nodes" item (DEVLOG: "More graph nodes: retype entities, hide noise, cluster topics"), and the feature list's "Retype existing entities when a later recording gives better evidence (needs a marker for types people set)": entities.typed_by_people is that marker now. Topic grouping follows in its own PR.

How

organize.py gets wrong_types and noise finders (name_types.votes split out of guess, same behaviour), graph_change rows for one entity (a, no b, to for a retype), kind-aware judge, _make, accept, dismiss and undo. graph_history.APPLIED covers the new ops for rollbacks.

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 it under ## Unreleased in CHANGELOG.md. (n/a: the title says it)

Done questions (AGENTS.md)

  • Goal: the retype and hide nodes with propose, apply and undo as for merges; merged on green CI.
  • Agents: graph workflows are made and run over the API and MCP; changes are listed, accepted, dismissed and undone with /api/v1/graph-changes, and undo_graph_change over MCP covers the new kinds.
  • Zero setup: nothing to install or set.
  • Fewest clicks: one click to make, leave or undo a change; the proposed type is filled in.
  • Configurable: the node's kind, how sure, how many and which types 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 as merges).
  • 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 kinds; 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: n/a; no new dependencies.
  • Result reported with evidence; refine later: a "keep this type" mark people can set on an entity, retyping through the decision model instead of the LLM, an MCP tool to list and accept proposed graph changes.
  • Reuse: the naming rules, typed_by_people, entities.retype/hide and the merge proposal flow.

Local CI (ci/local-ci.sh): backend (embedded and server), Next.js, pre-commit and title pass; the upgrade job couldn't run locally (no release tags in the container).


Generated by Claude Code

The Find what to tidy node (candidates) looks for two more kinds: entities whose type the naming
rules read differently now (retype), and noise to hide (hide). Ask the model judges them a kind at a
time, and Apply changes makes the sure ones and proposes the rest, each undoable like a merge.
A change someone dismissed or undid is no longer found again, so a run never redoes it.

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