refactor(nodes): let the product own its node families - #36
Merged
Merged
Conversation
The platform coloured a node by reading annotations called agent, tool, viewer and source, and held an accent and an icon for each. Those are one product's decorator names: the other shell's vocabulary is actor and network, so it matched none of them and drew every node in the default graphite. A platform that knows one product's taxonomy renders every other product's graph plain, and nothing reports it — the colours simply never match anything. `task` and `network` stay. Every dataflow graph has nodes and subgraphs, and those are the platform's own concepts. The rest move to the profile as data: the annotation that puts a node in a family, the accent, and the icon. The class is derived from the declaration, so core names no family, and the CSS is generated the way the contributed palette icons already are. Two things the move had to keep. Declaration order decides, because a node can carry the annotation that makes it openable AND the one that says what it is — a source carries both, and without an order it is painted as the node it is the opposite of. And a family can be narrowed by an annotation argument, so one annotation splits into families that look different: a tool that runs an interpreter against a tool that runs anything else, which was a hardcoded special case. Removes two dead branches found on the way: nothing has ever set `cal:hasExternalMembers`, so the icon it selected and the class it drove could not appear, and `header-task-agent` had no producer either. Both were keyed on the same borrowed vocabulary.
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.
Stacked on #35. Pairs with wfpy-ide's declaration PR — the platform stops holding these and the product starts supplying them, so they land together.
The problem
The platform coloured nodes by reading annotations named
agent,tool,viewerandsource, and held an accent colour and an icon for each:Those are one product's decorator names. The other shell's vocabulary is
actorandnetwork— it matches none of them, so every one of its nodes drew in the default graphite. A platform that knows one product's taxonomy renders every other product's graph plain, and nothing reports it: the colours simply never match.The neutrality gate didn't catch it because it greps for product names.
agentandviewerare innocent words individually; it's the set that is one product's, and no grep sees a set.What moves, what stays
taskandnetworkstay — every dataflow graph has nodes and subgraphs. The annotation-derived families move to the profile as data: annotation, colour, icon. The class is derived (external-actor-<id>), so core names no family, and the CSS is generated the way contributed palette icons already are.Two things the move had to keep
Order decides. A node can carry the annotation that makes it openable and the one that says what it is. A source carries both — so without a declared order it is painted as the node it is the opposite of.
A family can be narrowed by an annotation argument. A
@tool(cmd="python")showed a script icon rather than a terminal; that was a hardcoded special case readingscriptInterpreterCommands. It is now two declared families sharing one annotation, split bymatchand told apart byid.Dead code found on the way
Nothing has ever set
cal:hasExternalMembers— declared and read, never written — so the icon it selected and theactor-node-agentclass it drove could not appear.header-task-agenthad no producer either. Both were keyed on the same borrowed vocabulary.Tests
14 new for the seam, plus the existing server tests updated to declare families like a profile does. Mutation-checked:
The generated CSS reproduces the removed rules selector-for-selector and colour-for-colour; I diffed the output against what was deleted.
Gates: typecheck 5/5, neutrality 4/4, full suite green (851 tests), bundle builds.
Not in scope, but noted
viewer-mouse-listenerstill keys double-click on an annotation namedviewer, and the create-node wizard still lists@tool/@agentby name. Same class of coupling, different seam — worth a follow-up rather than widening this one.