Class: Pikuri::Trifecta::Node
- Inherits:
-
Object
- Object
- Pikuri::Trifecta::Node
- Defined in:
- lib/pikuri/trifecta/node.rb
Overview
One agent in the tree the detector walks: the main agent at the root, a
persona per sub-agent below it. Assembled from a wired Agent (its tools
plus every extension's
Agent::Extension#trifecta_contribution), and hand-built in
specs — which is the point of carrying plain data rather than live
objects:
Node.new(label: 'demo',
tool_legs: { 'read' => read_legs },
children: [Node.new(label: 'RESEARCHER',
tool_legs: { 'fetch' => fetch_legs },
channel_egress: :human_reviewed)])
Immutable.
Instance Attribute Summary collapse
-
#channel_egress ⇒ Symbol?
readonly
How much egress the delegation channel from the parent permits, on the Pikuri::Tool::TrifectaLegs review axis —
:human_reviewedwhen a human gates the hand-off,:unreviewedotherwise. -
#children ⇒ Array<Node>
readonly
Sub-agents this agent can dispatch to.
-
#label ⇒ String
readonly
Name shown in the report — the binary/agent name at the root, the persona name for a sub-agent.
-
#tool_legs ⇒ Hash{String=>Pikuri::Tool::TrifectaLegs}
readonly
This agent's own tools, in wiring order.
Instance Method Summary collapse
-
#initialize(label:, tool_legs: {}, children: [], channel_egress: nil) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(label:, tool_legs: {}, children: [], channel_egress: nil) ⇒ Node
Returns a new instance of Node.
42 43 44 |
# File 'lib/pikuri/trifecta/node.rb', line 42 def initialize(label:, tool_legs: {}, children: [], channel_egress: nil) super end |
Instance Attribute Details
#channel_egress ⇒ Symbol? (readonly)
Returns how much egress the delegation channel from the
parent permits, on the Pikuri::Tool::TrifectaLegs review axis —
:human_reviewed when a human gates the hand-off, :unreviewed
otherwise. A property of the edge, stored on the child
because every child has exactly one parent edge; nil at the root,
which has none.
37 38 39 40 41 42 43 44 45 |
# File 'lib/pikuri/trifecta/node.rb', line 37 class Node < Data.define(:label, :tool_legs, :children, :channel_egress) # @param label [String] # @param tool_legs [Hash{String=>Pikuri::Tool::TrifectaLegs}] # @param children [Array<Node>] # @param channel_egress [Symbol, nil] def initialize(label:, tool_legs: {}, children: [], channel_egress: nil) super end end |
#children ⇒ Array<Node> (readonly)
Returns sub-agents this agent can dispatch to.
37 38 39 40 41 42 43 44 45 |
# File 'lib/pikuri/trifecta/node.rb', line 37 class Node < Data.define(:label, :tool_legs, :children, :channel_egress) # @param label [String] # @param tool_legs [Hash{String=>Pikuri::Tool::TrifectaLegs}] # @param children [Array<Node>] # @param channel_egress [Symbol, nil] def initialize(label:, tool_legs: {}, children: [], channel_egress: nil) super end end |
#label ⇒ String (readonly)
Returns name shown in the report — the binary/agent name at the root, the persona name for a sub-agent.
37 38 39 40 41 42 43 44 45 |
# File 'lib/pikuri/trifecta/node.rb', line 37 class Node < Data.define(:label, :tool_legs, :children, :channel_egress) # @param label [String] # @param tool_legs [Hash{String=>Pikuri::Tool::TrifectaLegs}] # @param children [Array<Node>] # @param channel_egress [Symbol, nil] def initialize(label:, tool_legs: {}, children: [], channel_egress: nil) super end end |
#tool_legs ⇒ Hash{String=>Pikuri::Tool::TrifectaLegs} (readonly)
Returns this agent's own tools, in wiring order. The per-tool breakdown is kept rather than pre-unioned so the rendered tree can show which tool contributes a leg instead of a bare total.
37 38 39 40 41 42 43 44 45 |
# File 'lib/pikuri/trifecta/node.rb', line 37 class Node < Data.define(:label, :tool_legs, :children, :channel_egress) # @param label [String] # @param tool_legs [Hash{String=>Pikuri::Tool::TrifectaLegs}] # @param children [Array<Node>] # @param channel_egress [Symbol, nil] def initialize(label:, tool_legs: {}, children: [], channel_egress: nil) super end end |