diff --git a/.github/workflows/quality-gates.yml b/.github/workflows/quality-gates.yml index 4b002a144..815184f09 100644 --- a/.github/workflows/quality-gates.yml +++ b/.github/workflows/quality-gates.yml @@ -434,6 +434,12 @@ jobs: python3 -c 'import pathlib, sys; names = [line for line in pathlib.Path(sys.argv[1]).read_text().splitlines() if "tool_loop" in line and line.endswith(": test")]; print("Tool-loop tests discovered:", len(names)); sys.exit(0 if len(names) == 15 else 1)' "$RUNNER_TEMP/tool-loop-tests.list" cargo test --locked -p pantograph-workflow-service --lib tool_loop + - name: Run exact-head custom-node authoring and admission regression suite + run: | + cargo test --locked -p pantograph-workflow-service --lib workflow::tests::custom_nodes:: -- --list > "$RUNNER_TEMP/custom-node-tests.list" + python3 -c 'import pathlib, sys; names = [line for line in pathlib.Path(sys.argv[1]).read_text().splitlines() if line.startswith("workflow::tests::custom_nodes::") and line.endswith(": test")]; print("Custom-node tests discovered:", len(names)); sys.exit(0 if len(names) == 10 else 1)' "$RUNNER_TEMP/custom-node-tests.list" + cargo test --locked -p pantograph-workflow-service --lib workflow::tests::custom_nodes:: + - name: Run complete session execution regression suite run: | cargo test -p pantograph-workflow-service --lib workflow::tests::session_execution:: -- --list > "$RUNNER_TEMP/session-execution-tests.list" diff --git a/crates/pantograph-workflow-service/examples/nodelab_host.rs b/crates/pantograph-workflow-service/examples/nodelab_host.rs new file mode 100644 index 000000000..c1b4d82c1 --- /dev/null +++ b/crates/pantograph-workflow-service/examples/nodelab_host.rs @@ -0,0 +1,187 @@ +//! Isolated stdio host for NodeLab authoring qualification. No runtime code loader. +//! A verifier supplies the loopback HTTP transport; EOF drops the temporary store. +use async_trait::async_trait; +use node_engine::{Context, ExecutorExtensions, NodeExecutor}; +use pantograph_node_contracts::{ + NodeAuthoringMetadata, NodeCategory, NodeExecutionSemantics, NodeTypeContract, PortContract, + PortRequirement, PortValueType, +}; +use pantograph_workflow_service::{ + custom_nodes::{authoring::CustomNodeDraftRequest, CustomNodeCatalog, TrustedCustomNode}, + *, +}; +use serde::{de::DeserializeOwned, Serialize}; +use serde_json::{json, Value}; +use std::{ + collections::HashMap, + io::{BufRead, Write}, + sync::Arc, +}; + +struct Uppercase; +#[async_trait] +impl NodeExecutor for Uppercase { + async fn execute( + &self, + _: &str, + inputs: HashMap, + _: &Context, + _: &ExecutorExtensions, + ) -> node_engine::Result> { + Ok(HashMap::from([( + "output".into(), + json!(inputs["input"] + .as_str() + .ok_or_else(|| node_engine::NodeEngineError::ExecutionFailed( + "string input required".into() + ))? + .to_uppercase()), + )])) + } +} +fn catalog() -> Result, Box> { + let mut output = PortContract::output("output".parse()?, "Output", PortValueType::String); + output.requirement = PortRequirement::Required; + let contract = NodeTypeContract { + node_type: "host-uppercase".parse()?, + category: NodeCategory::Processing, + label: "Host uppercase".into(), + description: "Pure string transform compiled into this isolated Rust host".into(), + inputs: vec![PortContract::input( + "input".parse()?, + "Input", + PortValueType::String, + PortRequirement::Required, + )], + outputs: vec![output], + execution_semantics: NodeExecutionSemantics::Batch, + capability_requirements: vec![], + inference_tasks: vec![], + authoring: NodeAuthoringMetadata::default(), + contract_version: Some("1.0.0".into()), + contract_digest: None, + }; + let digest = |text: &str| format!("blake3:{}", blake3::hash(text.as_bytes())); + Ok(Arc::new(CustomNodeCatalog::try_new(vec![ + TrustedCustomNode::admit( + contract, + digest("nodelab_host.rs uppercase v1"), + digest("isolated Rust authoring host v1"), + Arc::new(Uppercase), + )?, + ])?)) +} +fn decode(value: Value) -> Result { + serde_json::from_value(value).map_err(|e| WorkflowServiceError::InvalidRequest(e.to_string())) +} +fn encode(value: impl Serialize) -> Result { + serde_json::to_value(value).map_err(|e| WorkflowServiceError::Internal(e.to_string())) +} +fn string(args: &Value, name: &str) -> Result { + args[name] + .as_str() + .map(str::to_owned) + .ok_or_else(|| WorkflowServiceError::InvalidRequest(format!("{name} is required"))) +} +async fn dispatch( + service: &WorkflowService, + store: &FileSystemWorkflowGraphStore, + command: &str, + args: Value, +) -> Result { + let edit = || -> Result { + Ok(WorkflowGraphEditSessionGraphRequest { + session_id: string(&args, "executionId")?, + }) + }; + match command { + "get_custom_node_authoring_catalog" => encode(service.custom_node_authoring_catalog()), + "create_custom_node_draft" => encode( + service + .create_custom_node_draft(decode::( + args["request"].clone(), + )?) + .await?, + ), + "get_node_lab_draft" => encode( + service + .workflow_graph_get_edit_session_graph(edit()?) + .await?, + ), + "create_workflow_execution_session" => encode( + service + .workflow_graph_create_edit_session(WorkflowGraphEditSessionCreateRequest { + graph: decode(args["graph"].clone())?, + workflow_id: args["workflowId"].as_str().map(str::to_owned), + }) + .await?, + ), + "update_node_data" => encode( + service + .workflow_graph_update_node_data(WorkflowGraphUpdateNodeDataRequest { + session_id: string(&args, "executionId")?, + node_id: string(&args, "nodeId")?, + data: args["data"].clone(), + }) + .await?, + ), + "save_workflow" => encode( + service + .workflow_graph_save( + store, + WorkflowGraphSaveRequest { + name: string(&args, "name")?, + graph: decode(args["graph"].clone())?, + }, + )? + .path, + ), + "load_workflow" => encode(service.workflow_graph_load( + store, + WorkflowGraphLoadRequest { + path: string(&args, "path")?, + }, + )?), + "remove_execution" => { + service + .workflow_graph_close_edit_session(WorkflowGraphEditSessionCloseRequest { + session_id: edit()?.session_id, + }) + .await?; + Ok(Value::Null) + } + _ => Err(WorkflowServiceError::CapabilityViolation( + "unsupported authoring host command".into(), + )), + } +} +#[tokio::main] +async fn main() -> Result<(), Box> { + let directory = tempfile::tempdir()?; + let store = FileSystemWorkflowGraphStore::new(directory.path()); + let service = if std::env::args().any(|arg| arg == "--empty-catalog") { + WorkflowService::new() + } else { + WorkflowService::with_trusted_custom_nodes(catalog()?) + }; + for line in std::io::stdin().lock().lines() { + let result = match serde_json::from_str::(&line?) { + Ok(request) => match request["command"].as_str() { + Some(command) => dispatch(&service, &store, command, request["args"].clone()).await, + None => Err(WorkflowServiceError::InvalidRequest( + "command is required".into(), + )), + }, + Err(error) => Err(WorkflowServiceError::InvalidRequest(error.to_string())), + }; + let response = match result { + Ok(value) => json!({"ok": true, "value": value}), + Err(error) => { + json!({"ok": false, "error": serde_json::from_str::(&error.to_envelope_json())?}) + } + }; + println!("{}", serde_json::to_string(&response)?); + std::io::stdout().flush()?; + } + Ok(()) +} diff --git a/crates/pantograph-workflow-service/src/custom_nodes.rs b/crates/pantograph-workflow-service/src/custom_nodes.rs index 218a0a4db..28449f848 100644 --- a/crates/pantograph-workflow-service/src/custom_nodes.rs +++ b/crates/pantograph-workflow-service/src/custom_nodes.rs @@ -409,3 +409,5 @@ pub(crate) fn validate_payload( #[cfg(test)] pub(crate) mod tests; + +pub mod authoring; diff --git a/crates/pantograph-workflow-service/src/custom_nodes/authoring.rs b/crates/pantograph-workflow-service/src/custom_nodes/authoring.rs new file mode 100644 index 000000000..8dc69b4b2 --- /dev/null +++ b/crates/pantograph-workflow-service/src/custom_nodes/authoring.rs @@ -0,0 +1,37 @@ +//! Read-only host catalog and exactly pinned graph authoring. No execution/loading API. +use super::CustomNodeIdentity; +use serde::{Deserialize, Serialize}; + +/// Version 1 is a deliberately narrow projection of admitted string-port contracts. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct CustomNodeAuthoringCatalog { + pub contract_version: u16, + pub nodes: Vec, +} +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct CustomNodeAuthoringEntry { + pub identity: CustomNodeIdentity, + pub label: String, + pub description: String, + pub trust: CustomNodeAuthoringTrust, + pub inputs: Vec, + pub outputs: Vec, +} +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "snake_case")] +pub enum CustomNodeAuthoringTrust { + TrustedInProcess, +} +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct CustomNodeAuthoringPort { + pub id: String, + pub label: String, +} +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(deny_unknown_fields)] +pub struct CustomNodeDraftRequest { + pub identity: CustomNodeIdentity, +} diff --git a/crates/pantograph-workflow-service/src/graph/connection_insert.rs b/crates/pantograph-workflow-service/src/graph/connection_insert.rs index bd49a8b39..f267b7cd3 100644 --- a/crates/pantograph-workflow-service/src/graph/connection_insert.rs +++ b/crates/pantograph-workflow-service/src/graph/connection_insert.rs @@ -41,6 +41,13 @@ fn resolve_insert_definition<'a>( registry: &'a NodeRegistry, node_type: &str, ) -> Result<&'a NodeDefinition, ConnectionRejection> { + if registry.custom_nodes.get(node_type).is_some() { + return Err(ConnectionRejection { + reason: ConnectionRejectionReason::UnknownInsertNodeType, + message: "custom-node insertion by name is unsupported; add an exactly pinned node and connect its endpoints".into(), + contract_diagnostic: None, + }); + } registry .get_definition(node_type) .ok_or_else(|| ConnectionRejection { diff --git a/crates/pantograph-workflow-service/src/graph/connection_intent.rs b/crates/pantograph-workflow-service/src/graph/connection_intent.rs index 1360f02c0..a0c2caf1e 100644 --- a/crates/pantograph-workflow-service/src/graph/connection_intent.rs +++ b/crates/pantograph-workflow-service/src/graph/connection_intent.rs @@ -506,6 +506,7 @@ pub fn connection_candidates_with_surfaces( let mut insertable_node_types = registry .all_definitions() .into_iter() + .filter(|definition| registry.custom_nodes.get(&definition.node_type).is_none()) .filter_map(|definition| { let mut matching_input_port_ids = definition .inputs diff --git a/crates/pantograph-workflow-service/src/graph/session.rs b/crates/pantograph-workflow-service/src/graph/session.rs index d09eaa2a6..3d940e3bf 100644 --- a/crates/pantograph-workflow-service/src/graph/session.rs +++ b/crates/pantograph-workflow-service/src/graph/session.rs @@ -75,6 +75,7 @@ fn dirty_tasks_from_seed_nodes_unique(graph: &WorkflowGraph, node_ids: &[String] } pub struct GraphSessionStore { + node_registry: Arc, sessions: RwLock>, validation_state: Arc, validation_lifecycle: Arc, @@ -136,6 +137,7 @@ impl GraphSessionStore { dependency_provider: SharedDependencyEnvironmentProvider, ) -> Self { Self { + node_registry: Arc::new(super::registry::NodeRegistry::new()), sessions: RwLock::new(HashMap::new()), validation_state: Arc::new(CurrentInferenceValidationStateStore::new()), validation_lifecycle: Arc::new(WorkflowGraphValidationLifecycleOwner::new()), @@ -146,6 +148,14 @@ impl GraphSessionStore { } } + pub(crate) fn with_node_registry( + mut self, + registry: Arc, + ) -> Self { + self.node_registry = registry; + self + } + pub async fn set_validation_lifecycle_event_sink( &self, event_sink: Option>, @@ -159,7 +169,11 @@ impl GraphSessionStore { workflow_id: Option, ) -> WorkflowGraphEditSessionCreateResponse { let session_id = Uuid::new_v4().to_string(); - let session = Arc::new(Mutex::new(GraphEditSession::new(graph, workflow_id))); + let session = Arc::new(Mutex::new(GraphEditSession::new( + graph, + workflow_id, + self.node_registry.clone(), + ))); let graph_revision = { let state = session.lock().await; state.graph.compute_fingerprint() diff --git a/crates/pantograph-workflow-service/src/graph/session_connection_api.rs b/crates/pantograph-workflow-service/src/graph/session_connection_api.rs index 22a97ae4e..97f717675 100644 --- a/crates/pantograph-workflow-service/src/graph/session_connection_api.rs +++ b/crates/pantograph-workflow-service/src/graph/session_connection_api.rs @@ -13,7 +13,6 @@ use super::super::inference_validation_state::{ WorkflowGraphCurrentConnectionSurfacesStateRequest, }; use super::super::memory_impact::graph_memory_impact_from_graph_change; -use super::super::registry::NodeRegistry; use super::super::session_event::{dirty_tasks_from_seed_nodes, graph_modified_event}; use super::super::session_graph::sync_embedding_emit_metadata_flags; use super::super::session_types::{ @@ -39,10 +38,10 @@ impl GraphSessionStore { request.graph_revision.as_deref(), ) .await?; - let registry = NodeRegistry::new(); + let registry = self.node_registry.as_ref(); connection_candidates_with_surfaces( &graph, - ®istry, + registry, InferenceConnectionSurfaceView::new(&connection_surfaces.surfaces), request.source_anchor, request.graph_revision.as_deref(), @@ -65,10 +64,10 @@ impl GraphSessionStore { let mut state = handle.lock().await; state.touch(); let before_graph = state.graph.clone(); - let registry = NodeRegistry::new(); + let registry = self.node_registry.as_ref(); if let Err(rejection) = commit_connection_with_surfaces( &state.graph, - ®istry, + registry, InferenceConnectionSurfaceView::new(&connection_surfaces.surfaces), &request.graph_revision, &request.source_anchor, @@ -191,10 +190,10 @@ impl GraphSessionStore { let mut state = handle.lock().await; state.touch(); let before_graph = state.graph.clone(); - let registry = NodeRegistry::new(); + let registry = self.node_registry.as_ref(); let (inserted_node, inserted_edge) = match insert_node_and_connect( &state.graph, - ®istry, + registry, &request.graph_revision, &request.source_anchor, &request.node_type, @@ -252,11 +251,11 @@ impl GraphSessionStore { let handle = self.get_session_handle(&request.session_id).await?; let mut state = handle.lock().await; state.touch(); - let registry = NodeRegistry::new(); + let registry = self.node_registry.as_ref(); match preview_node_insert_on_edge( &state.graph, - ®istry, + registry, &request.graph_revision, &request.edge_id, &request.node_type, @@ -283,11 +282,11 @@ impl GraphSessionStore { let mut state = handle.lock().await; state.touch(); let before_graph = state.graph.clone(); - let registry = NodeRegistry::new(); + let registry = self.node_registry.as_ref(); let (inserted_node, incoming_edge, outgoing_edge, bridge) = match insert_node_on_edge( &state.graph, - ®istry, + registry, &request.graph_revision, &request.edge_id, &request.node_type, diff --git a/crates/pantograph-workflow-service/src/graph/session_contract.rs b/crates/pantograph-workflow-service/src/graph/session_contract.rs index ee8d764fc..d62215fc5 100644 --- a/crates/pantograph-workflow-service/src/graph/session_contract.rs +++ b/crates/pantograph-workflow-service/src/graph/session_contract.rs @@ -88,11 +88,28 @@ fn build_graph_session_response( build_graph_session_response_with_state(session_id, graph, workflow_event, None) } +#[cfg(test)] pub(crate) fn build_graph_session_response_with_state( session_id: &str, graph: &super::types::WorkflowGraph, workflow_event: Option, projection: Option<&WorkflowGraphSessionStateProjection>, +) -> WorkflowGraphEditSessionGraphResponse { + build_graph_session_response_with_registry( + session_id, + graph, + &NodeRegistry::new(), + workflow_event, + projection, + ) +} + +pub(crate) fn build_graph_session_response_with_registry( + session_id: &str, + graph: &super::types::WorkflowGraph, + registry: &NodeRegistry, + workflow_event: Option, + projection: Option<&WorkflowGraphSessionStateProjection>, ) -> WorkflowGraphEditSessionGraphResponse { let graph_revision = graph.compute_fingerprint(); WorkflowGraphEditSessionGraphResponse { @@ -106,10 +123,7 @@ pub(crate) fn build_graph_session_response_with_state( workflow_event.as_ref(), projection, )), - graph_diagnostics: validate_workflow_graph_contract_diagnostics( - graph, - &NodeRegistry::new(), - ), + graph_diagnostics: validate_workflow_graph_contract_diagnostics(graph, registry), } } diff --git a/crates/pantograph-workflow-service/src/graph/session_node_api.rs b/crates/pantograph-workflow-service/src/graph/session_node_api.rs index aa63ed567..4f2e3ba19 100644 --- a/crates/pantograph-workflow-service/src/graph/session_node_api.rs +++ b/crates/pantograph-workflow-service/src/graph/session_node_api.rs @@ -40,6 +40,33 @@ impl GraphSessionStore { request.node_id ))); } + let original = state + .graph + .find_node(&request.node_id) + .expect("checked node"); + if self + .node_registry + .custom_nodes + .get(&original.node_type) + .is_some() + || original + .data + .get(crate::custom_nodes::CUSTOM_NODE_IDENTITY_FIELD) + .is_some() + { + let mut candidate = original.clone(); + merge_node_data(&mut candidate.data, request.data.clone()); + if candidate + .data + .get(crate::custom_nodes::CUSTOM_NODE_IDENTITY_FIELD) + != original + .data + .get(crate::custom_nodes::CUSTOM_NODE_IDENTITY_FIELD) + || candidate.data.get("definition") != original.data.get("definition") + { + return Err(WorkflowServiceError::InvalidRequest("custom-node identity/definition cannot be patched; explicitly remove and recreate from the admitted catalog".into())); + } + } state.push_undo_snapshot(); let node = state.graph.find_node_mut(&request.node_id).ok_or_else(|| { WorkflowServiceError::InvalidRequest(format!( @@ -110,6 +137,24 @@ impl GraphSessionStore { let mut state = handle.lock().await; state.touch(); let before_graph = state.graph.clone(); + self.node_registry + .validate_custom_node_identity(&request.node) + .map_err(|error| WorkflowServiceError::InvalidRequest(error.to_string()))?; + if request + .node + .data + .get(crate::custom_nodes::CUSTOM_NODE_IDENTITY_FIELD) + .is_some() + && self + .node_registry + .custom_nodes + .get(&request.node.node_type) + .is_none() + { + return Err(WorkflowServiceError::InvalidRequest( + "custom-node implementation is unavailable".into(), + )); + } state.push_undo_snapshot(); let node_id = request.node.id.clone(); state.graph.nodes.push(request.node); diff --git a/crates/pantograph-workflow-service/src/graph/session_state.rs b/crates/pantograph-workflow-service/src/graph/session_state.rs index d44bda6b0..f4ff2e920 100644 --- a/crates/pantograph-workflow-service/src/graph/session_state.rs +++ b/crates/pantograph-workflow-service/src/graph/session_state.rs @@ -20,9 +20,10 @@ use super::types::WorkflowGraph; const DEFAULT_MAX_UNDO_SNAPSHOTS: usize = 64; -#[derive(Debug, Clone)] +#[derive(Clone)] pub(super) struct GraphEditSession { pub(super) graph: WorkflowGraph, + node_registry: std::sync::Arc, workflow_id: Option, undo_stack: Vec, redo_stack: Vec, @@ -31,10 +32,15 @@ pub(super) struct GraphEditSession { } impl GraphEditSession { - pub(super) fn new(mut graph: WorkflowGraph, workflow_id: Option) -> Self { + pub(super) fn new( + mut graph: WorkflowGraph, + workflow_id: Option, + node_registry: std::sync::Arc, + ) -> Self { graph = hydrate_embedding_emit_metadata_flags(graph); let mut session = Self { graph, + node_registry, workflow_id: workflow_id.and_then(normalize_optional_session_text), undo_stack: Vec::new(), redo_stack: Vec::new(), @@ -70,6 +76,7 @@ impl GraphEditSession { build_graph_session_response_with_projection( session_id, &self.graph, + &self.node_registry, None, phase6_memory_impact_projection(self.last_memory_impact.clone()), ) @@ -94,6 +101,7 @@ impl GraphEditSession { build_graph_session_response_with_projection( session_id, &self.graph, + &self.node_registry, workflow_event, projection, ) @@ -191,7 +199,7 @@ impl GraphEditSession { pub(super) fn canonicalize_graph(&mut self) { let graph = std::mem::take(&mut self.graph); - self.graph = canonicalize_workflow_graph(graph, &NodeRegistry::new()); + self.graph = canonicalize_workflow_graph(graph, &self.node_registry); self.graph.refresh_derived_graph(); } } @@ -199,12 +207,14 @@ impl GraphEditSession { pub(super) fn build_graph_session_response_with_projection( session_id: &str, graph: &WorkflowGraph, + registry: &NodeRegistry, workflow_event: Option, projection: Option, ) -> WorkflowGraphEditSessionGraphResponse { - super::session_contract::build_graph_session_response_with_state( + super::session_contract::build_graph_session_response_with_registry( session_id, graph, + registry, workflow_event, projection.as_ref(), ) diff --git a/crates/pantograph-workflow-service/src/workflow.rs b/crates/pantograph-workflow-service/src/workflow.rs index 24ee52b89..cf742ae05 100644 --- a/crates/pantograph-workflow-service/src/workflow.rs +++ b/crates/pantograph-workflow-service/src/workflow.rs @@ -1,3 +1,4 @@ +mod custom_node_authoring_api; #[cfg(test)] use async_trait::async_trait; use std::path::PathBuf; diff --git a/crates/pantograph-workflow-service/src/workflow/custom_node_authoring_api.rs b/crates/pantograph-workflow-service/src/workflow/custom_node_authoring_api.rs new file mode 100644 index 000000000..1992eadd9 --- /dev/null +++ b/crates/pantograph-workflow-service/src/workflow/custom_node_authoring_api.rs @@ -0,0 +1,112 @@ +use super::{WorkflowService, WorkflowServiceError}; +use crate::custom_nodes::{authoring::*, CUSTOM_NODE_IDENTITY_FIELD}; +use crate::{GraphEdge, GraphNode, Position, WorkflowGraph, WorkflowGraphEditSessionGraphResponse}; +use serde_json::json; + +impl WorkflowService { + /// Empty means no host registrations; transport failure is a separate outcome. + pub fn custom_node_authoring_catalog(&self) -> CustomNodeAuthoringCatalog { + CustomNodeAuthoringCatalog { + contract_version: 1, + nodes: self + .node_registry + .custom_nodes + .nodes() + .map(|node| { + let ports = |ports: &[pantograph_node_contracts::PortContract]| { + ports + .iter() + .map(|port| CustomNodeAuthoringPort { + id: port.id.as_str().into(), + label: port.label.clone(), + }) + .collect() + }; + CustomNodeAuthoringEntry { + identity: node.identity().clone(), + label: node.contract().label.clone(), + description: node.contract().description.clone(), + trust: CustomNodeAuthoringTrust::TrustedInProcess, + inputs: ports(&node.contract().inputs), + outputs: ports(&node.contract().outputs), + } + }) + .collect(), + } + } + + /// Resolve the user's complete selection before creating any session. Imported pins + /// never pass through this operation, and are never silently updated. + pub async fn create_custom_node_draft( + &self, + request: CustomNodeDraftRequest, + ) -> Result { + let custom = self + .node_registry + .custom_nodes + .get(&request.identity.node_type) + .ok_or_else(|| { + WorkflowServiceError::InvalidRequest( + crate::custom_nodes::CustomNodeError::Unavailable.to_string(), + ) + })?; + if custom.identity() != &request.identity { + return Err(WorkflowServiceError::InvalidRequest( + crate::custom_nodes::CustomNodeError::IdentityMismatch.to_string(), + )); + } + let mut graph = WorkflowGraph { + nodes: vec![GraphNode { + id: "custom".into(), + node_type: request.identity.node_type.clone(), + position: Position { x: 320.0, y: 0.0 }, + data: json!({"label": custom.contract().label, CUSTOM_NODE_IDENTITY_FIELD: custom.identity()}), + }], + edges: vec![], + derived_graph: None, + }; + for (direction, ports, node_type) in [ + ("input", &custom.contract().inputs, "text-input"), + ("output", &custom.contract().outputs, "text-output"), + ] { + let definition = self + .node_registry + .get_definition(node_type) + .ok_or_else(|| { + WorkflowServiceError::Internal("text authoring contract is unavailable".into()) + })?; + for (index, port) in ports.iter().enumerate() { + let id = format!("{direction}-{index}"); + let input = direction == "input"; + graph.nodes.push(GraphNode { + id: id.clone(), + node_type: node_type.into(), + position: Position { + x: if input { 0.0 } else { 640.0 }, + y: index as f64 * 160.0, + }, + data: json!({"label": port.label, "text": "", "definition": definition}), + }); + graph.edges.push(GraphEdge { + id: format!("edge-{id}"), + source: if input { id.clone() } else { "custom".into() }, + source_handle: if input { + "text".into() + } else { + port.id.as_str().into() + }, + target: if input { "custom".into() } else { id }, + target_handle: if input { + port.id.as_str().into() + } else { + "text".into() + }, + }); + } + } + let session = self.graph_session_store.create_session(graph, None).await; + self.graph_session_store + .get_session_graph(&session.session_id) + .await + } +} diff --git a/crates/pantograph-workflow-service/src/workflow/service_config.rs b/crates/pantograph-workflow-service/src/workflow/service_config.rs index 919c487c1..01a5c7a4e 100644 --- a/crates/pantograph-workflow-service/src/workflow/service_config.rs +++ b/crates/pantograph-workflow-service/src/workflow/service_config.rs @@ -92,7 +92,9 @@ impl WorkflowService { runtime_dispatch_assignment_repository: Arc::new(Mutex::new( InMemoryWorkflowRuntimeDispatchAssignmentRepository::new(), )), - graph_session_store: Arc::new(GraphSessionStore::new()), + graph_session_store: Arc::new( + GraphSessionStore::new().with_node_registry(node_registry.clone()), + ), artifact_writer: None, artifact_format_settings: Arc::new(Mutex::new(ArtifactFormatSettings::default())), artifact_format_settings_path: None, @@ -190,7 +192,8 @@ impl WorkflowService { provider: Arc, ) -> Self { self.graph_session_store = Arc::new( - GraphSessionStore::with_inference_interface_facts_provider(provider), + GraphSessionStore::with_inference_interface_facts_provider(provider) + .with_node_registry(self.node_registry.clone()), ); self } @@ -201,11 +204,14 @@ impl WorkflowService { inference_provider: Arc, provider: SharedDependencyEnvironmentProvider, ) -> Self { - self.graph_session_store = Arc::new(GraphSessionStore::with_timeout_and_providers( - std::time::Duration::from_secs(5 * 60), - inference_provider, - provider.clone(), - )); + self.graph_session_store = Arc::new( + GraphSessionStore::with_timeout_and_providers( + std::time::Duration::from_secs(5 * 60), + inference_provider, + provider.clone(), + ) + .with_node_registry(self.node_registry.clone()), + ); self.dependency_readiness_provider = Arc::new(DependencyEnvironmentService::new(provider)); self } diff --git a/crates/pantograph-workflow-service/src/workflow/tests/custom_nodes.rs b/crates/pantograph-workflow-service/src/workflow/tests/custom_nodes.rs index 6e16c03d5..76584515d 100644 --- a/crates/pantograph-workflow-service/src/workflow/tests/custom_nodes.rs +++ b/crates/pantograph-workflow-service/src/workflow/tests/custom_nodes.rs @@ -362,3 +362,362 @@ async fn custom_nodes_callback_failures_are_terminal_without_publishing_outputs( .is_err()); } } + +async fn authored_draft(service: &WorkflowService) -> crate::WorkflowGraphEditSessionGraphResponse { + let identity = service.custom_node_authoring_catalog().nodes[0] + .identity + .clone(); + service + .create_custom_node_draft(crate::custom_nodes::authoring::CustomNodeDraftRequest { + identity, + }) + .await + .unwrap() +} + +#[tokio::test] +async fn custom_node_authoring_registry_survives_provider_builders_and_undo_redo() { + for mode in 0..3 { + let service = WorkflowService::with_trusted_custom_nodes(catalog(Arc::new(Executor::new( + Behavior::Uppercase, + )))); + let service = match mode { + 1 => service.with_inference_interface_facts_provider(Arc::new(crate::graph::UnavailableInferenceInterfaceFactsProvider)), + 2 => service.with_graph_session_fact_providers(Arc::new(crate::graph::UnavailableInferenceInterfaceFactsProvider), Arc::new(pantograph_dependency_environment_service::NotImplementedDependencyEnvironmentProvider)), + _ => service, + }; + let draft = authored_draft(&service).await; + assert!( + draft + .graph_diagnostics + .iter() + .all(|d| !d.blocking_submission), + "{:?}", + draft.graph_diagnostics + ); + let pin = draft.graph.nodes[0].data[CUSTOM_NODE_IDENTITY_FIELD].clone(); + let updated = service + .workflow_graph_update_node_data(crate::WorkflowGraphUpdateNodeDataRequest { + session_id: draft.session_id.clone(), + node_id: "input-0".into(), + data: serde_json::json!({"text": "authored"}), + }) + .await + .unwrap(); + assert_eq!( + updated.graph.find_node("input-0").unwrap().data["text"], + "authored" + ); + let request = crate::WorkflowGraphEditSessionGraphRequest { + session_id: draft.session_id, + }; + let undo = service.workflow_graph_undo(request.clone()).await.unwrap(); + let redo = service.workflow_graph_redo(request).await.unwrap(); + for snapshot in [undo, redo] { + assert_eq!( + snapshot.graph.find_node("custom").unwrap().data[CUSTOM_NODE_IDENTITY_FIELD], + pin + ); + assert!(snapshot + .graph_diagnostics + .iter() + .all(|d| !d.blocking_submission)); + } + } +} + +#[tokio::test] +async fn custom_node_authoring_refuses_stale_selection_and_identity_patches_without_mutation() { + let service = WorkflowService::with_trusted_custom_nodes(catalog(Arc::new(Executor::new( + Behavior::Uppercase, + )))); + let entry = service.custom_node_authoring_catalog().nodes[0].clone(); + let mut stale = entry.identity.clone(); + stale.environment_digest = crate::custom_nodes::tests::digest("changed environment"); + let error = service + .create_custom_node_draft(crate::custom_nodes::authoring::CustomNodeDraftRequest { + identity: stale.clone(), + }) + .await + .unwrap_err(); + assert!(error.to_string().contains("identity does not match")); + assert!( + serde_json::from_value::( + serde_json::json!({"identity": entry.identity, "definition": {}}) + ) + .is_err() + ); + let draft = authored_draft(&service).await; + for patch in [ + serde_json::json!({CUSTOM_NODE_IDENTITY_FIELD: stale}), + serde_json::json!({"definition": {}}), + serde_json::json!({CUSTOM_NODE_IDENTITY_FIELD: null}), + ] { + let error = service + .workflow_graph_update_node_data(crate::WorkflowGraphUpdateNodeDataRequest { + session_id: draft.session_id.clone(), + node_id: "custom".into(), + data: patch, + }) + .await + .unwrap_err(); + assert!(error.to_string().contains("cannot be patched")); + let after = service + .workflow_graph_get_edit_session_graph(crate::WorkflowGraphEditSessionGraphRequest { + session_id: draft.session_id.clone(), + }) + .await + .unwrap(); + assert_eq!(after.graph_revision, draft.graph_revision); + assert_eq!(after.graph, draft.graph); + } + let mut unpinned = draft.graph.find_node("custom").unwrap().clone(); + unpinned.id = "bad".into(); + unpinned.data = serde_json::json!({}); + assert!(service + .workflow_graph_add_node(crate::WorkflowGraphAddNodeRequest { + session_id: draft.session_id, + node: unpinned + }) + .await + .unwrap_err() + .to_string() + .contains("identity does not match")); +} + +#[tokio::test] +async fn custom_node_authoring_candidates_and_commit_share_exact_registry() { + let service = WorkflowService::with_trusted_custom_nodes(catalog(Arc::new(Executor::new( + Behavior::Uppercase, + )))); + let draft = authored_draft(&service).await; + let removed = service + .workflow_graph_remove_edge(crate::WorkflowGraphRemoveEdgeRequest { + session_id: draft.session_id.clone(), + edge_id: "edge-input-0".into(), + }) + .await + .unwrap(); + let source = crate::ConnectionAnchor { + node_id: "input-0".into(), + port_id: "text".into(), + }; + let candidates = service + .workflow_graph_get_connection_candidates( + crate::WorkflowGraphGetConnectionCandidatesRequest { + session_id: draft.session_id.clone(), + source_anchor: source.clone(), + graph_revision: Some(removed.graph_revision.clone()), + }, + ) + .await + .unwrap(); + assert!(candidates + .compatible_nodes + .iter() + .any(|node| node.node_id == "custom")); + assert!(!candidates + .insertable_node_types + .iter() + .any(|node| node.node_type == "custom-uppercase")); + let rejected = service + .workflow_graph_preview_node_insert_on_edge( + crate::WorkflowGraphPreviewNodeInsertOnEdgeRequest { + session_id: draft.session_id.clone(), + edge_id: "edge-output-0".into(), + node_type: "custom-uppercase".into(), + graph_revision: removed.graph_revision.clone(), + }, + ) + .await + .unwrap(); + assert!(!rejected.accepted); + assert!(rejected + .rejection + .unwrap() + .message + .contains("insertion by name is unsupported")); + let committed = service + .workflow_graph_connect(crate::WorkflowGraphConnectRequest { + session_id: draft.session_id.clone(), + source_anchor: source, + target_anchor: crate::ConnectionAnchor { + node_id: "custom".into(), + port_id: "input".into(), + }, + graph_revision: removed.graph_revision, + }) + .await + .unwrap(); + assert!(committed.accepted); + let snapshot = service + .workflow_graph_get_edit_session_graph(crate::WorkflowGraphEditSessionGraphRequest { + session_id: draft.session_id, + }) + .await + .unwrap(); + assert!(snapshot + .graph_diagnostics + .iter() + .all(|d| !d.blocking_submission)); +} + +#[tokio::test] +async fn custom_node_authoring_saved_reopen_preserves_pin_and_scheduler_execution() { + let root = tempfile::tempdir().unwrap(); + let catalog = catalog(Arc::new(Executor::new(Behavior::Uppercase))); + let service = WorkflowService::with_trusted_custom_nodes(catalog.clone()); + let draft = authored_draft(&service).await; + let store = FileSystemWorkflowGraphStore::new(root.path()); + let saved = service + .workflow_graph_save( + &store, + crate::WorkflowGraphSaveRequest { + name: "custom-workflow".into(), + graph: draft.graph.clone(), + }, + ) + .unwrap(); + let reopened = WorkflowService::with_trusted_custom_nodes(catalog); + let graph = reopened + .workflow_graph_load( + &store, + crate::WorkflowGraphLoadRequest { + path: saved.path.clone(), + }, + ) + .unwrap() + .graph; + assert_eq!( + graph.find_node("custom").unwrap().data[CUSTOM_NODE_IDENTITY_FIELD], + draft.graph.find_node("custom").unwrap().data[CUSTOM_NODE_IDENTITY_FIELD] + ); + for (service, blocking) in [(&reopened, false), (&WorkflowService::new(), true)] { + let edit = service + .workflow_graph_create_edit_session(crate::WorkflowGraphEditSessionCreateRequest { + graph: graph.clone(), + workflow_id: Some(saved.path.clone()), + }) + .await + .unwrap(); + let snapshot = service + .workflow_graph_get_edit_session_graph(crate::WorkflowGraphEditSessionGraphRequest { + session_id: edit.session_id, + }) + .await + .unwrap(); + assert_eq!( + snapshot.graph.find_node("custom").unwrap().data, + graph.find_node("custom").unwrap().data + ); + assert_eq!( + snapshot + .graph_diagnostics + .iter() + .any(|d| d.blocking_submission), + blocking + ); + } + let host = SavedGraphHost { + root: root.path().into(), + }; + let session_id = session(&reopened, &host).await; + let mut request = run_request(&session_id); + request.inputs[0].node_id = "input-0".into(); + request.output_targets.as_mut().unwrap()[0].node_id = "output-0".into(); + let result = reopened + .run_workflow_execution_session(&host, request) + .await + .unwrap(); + assert_eq!(result.outputs[0].value, "MIXED CASE"); +} + +#[tokio::test] +async fn custom_node_edit_sessions_preserve_integrated_loop_admission() { + use crate::tool_loops::tests::{catalog as loop_catalog, Executor as LoopExecutor, Mode}; + use crate::tool_loops::TOOL_LOOP_IDENTITY_FIELD; + + let controller = LoopExecutor::new(Mode::RoundTrip); + let tool = LoopExecutor::new(Mode::Uppercase); + let catalog = loop_catalog(controller.clone(), tool.clone(), 3); + let mut graph = custom_graph(catalog.get("loop-controller").unwrap().identity()); + let node = graph.find_node_mut("custom").unwrap(); + node.node_type = "tool-loop".into(); + node.data = serde_json::json!({TOOL_LOOP_IDENTITY_FIELD: catalog.tool_loop_identity("pure-loop").unwrap()}); + graph.edges[0].target_handle = "prompt".into(); + graph.edges[1].source_handle = "response".into(); + let root = tempfile::tempdir().unwrap(); + let store = FileSystemWorkflowGraphStore::new(root.path()); + let service = WorkflowService::with_trusted_custom_nodes(catalog.clone()); + let saved = service + .workflow_graph_save( + &store, + crate::WorkflowGraphSaveRequest { + name: "integrated-loop".into(), + graph, + }, + ) + .unwrap(); + let graph = service + .workflow_graph_load( + &store, + crate::WorkflowGraphLoadRequest { + path: saved.path.clone(), + }, + ) + .unwrap() + .graph; + let pin = graph.find_node("custom").unwrap().data[TOOL_LOOP_IDENTITY_FIELD].clone(); + let changed = loop_catalog(controller.clone(), tool.clone(), 4); + for (service, blocking) in [ + (service, false), + (WorkflowService::with_trusted_custom_nodes(changed), true), + (WorkflowService::new(), true), + ] { + let edit = service + .workflow_graph_create_edit_session(crate::WorkflowGraphEditSessionCreateRequest { + graph: graph.clone(), + workflow_id: Some(saved.path.clone()), + }) + .await + .unwrap(); + let request = crate::WorkflowGraphEditSessionGraphRequest { + session_id: edit.session_id.clone(), + }; + let snapshot = service + .workflow_graph_get_edit_session_graph(request.clone()) + .await + .unwrap(); + assert_eq!( + snapshot.graph.find_node("custom").unwrap().data[TOOL_LOOP_IDENTITY_FIELD], + pin + ); + assert_eq!( + snapshot + .graph_diagnostics + .iter() + .any(|d| d.blocking_submission), + blocking, + "{:?}", + snapshot.graph_diagnostics + ); + let mut invalid = snapshot.graph.find_node("custom").unwrap().clone(); + invalid.id = "invalid-new-loop".into(); + invalid.data[TOOL_LOOP_IDENTITY_FIELD]["max_turns"] = serde_json::json!(5); + assert!(service + .workflow_graph_add_node(crate::WorkflowGraphAddNodeRequest { + session_id: edit.session_id, + node: invalid, + }) + .await + .is_err()); + let after = service + .workflow_graph_get_edit_session_graph(request) + .await + .unwrap(); + assert_eq!(after.graph_revision, snapshot.graph_revision); + assert_eq!(after.graph, snapshot.graph); + } + assert!(controller.calls.lock().is_empty()); + assert!(tool.calls.lock().is_empty()); +} diff --git a/docs/custom-nodes.md b/docs/custom-nodes.md index 5bc44d073..20ce7362f 100644 --- a/docs/custom-nodes.md +++ b/docs/custom-nodes.md @@ -82,13 +82,47 @@ retains the `custom_node` non-runtime template and adds `tool_loop`; identity ad bounded contract. Coordinated Rust producers/consumers are updated together; older implementations cannot execute that template. -NodeLab authoring, Local Agent and runtime publishing remain unavailable. -Graph edit-session authoring and connection APIs still use built-in discovery; -they are not custom-node authoring surfaces. Before exposing custom nodes there, -NodeLab must install host-authorized registrations and exact graph pins, use the -same registry for edit validation/connection previews, and expose trust, version -mismatch and unavailable implementation outcomes. Publishing arbitrary code -needs its own artifact verification, isolation and lifecycle contract. +## NodeLab graph authoring + +NodeLab authors workflows from implementations already admitted by its host. It +reads `custom_node_authoring_catalog` (wire version 1), a narrow projection of +canonical labels, required string port IDs and complete immutable identities. +The projection's `trusted_in_process` profile carries the trust obligations above; +it is not an installation or execution permission. Default desktop composition +has an empty catalog and says so. Host maintainers register implementations in +Rust before service construction; browser clients cannot register or load code. +The legacy generic palette remains built-in-only. + +`create_custom_node_draft` requires the complete selected identity. The service +resolves exact equality before creating a session, then builds one text source +per required input, the pinned custom node, and one text sink per output. Custom +nodes never receive `node.data.definition`. NodeLab owns a separate edit session, +allows text source edits, displays backend contract diagnostics, and saves/reopens +through existing graph persistence. It provides no execution button; saved graphs +use scheduler sessions. Input text is authored configuration, not tool authority. + +The same admitted registry reaches edit-session canonicalization, diagnostics, +connection candidates and commits, including provider-builder construction. New +custom additions require exact pins. General custom data patches cannot change +identity or definitions. Imported/reopened missing or stale pins remain unchanged +and produce blocking diagnostics; explicit new authoring is the recovery path. +Name-only insert-and-connect/insert-on-edge APIs cannot express a selected complete +identity, so custom insertion there is explicitly unsupported and omitted from +creation suggestions. Adding a pinned node and connecting existing endpoints is +supported. + +Failed create/reopen preserves the current draft. Replacement and page teardown +close owned sessions, including late creation completion. Transport failures during +close retain exact session IDs in the app-scoped NodeLab service. Pending cleanup +is visible on the next NodeLab mount, blocks new creation/reopening and has an +explicit retry action. No automatic graph-session reap is assumed. A process or +host restart ends these ephemeral sessions; saved files retain their exact pins. + +The desktop commands are `get_custom_node_authoring_catalog`, +`create_custom_node_draft` and `get_node_lab_draft`; mutations/persistence reuse +existing commands. Local Agent and runtime publishing remain unavailable or +unsupported. Arbitrary packages still need independently admitted artifact +verification, isolation and lifecycle contracts. The [scheduler-managed pure tool-loop adapter](tool-loops.md) consumes this exact admission and invocation identity plus separate host tool grants. It @@ -98,5 +132,13 @@ retired. Inference-backed controllers, side-effectful tools, external workers, Wasm, Python, package discovery, automatic updates, streaming and inference ports require follow-on admission; none are inferred from a palette entry. +NodeLab's creation catalog projects individual CN-01 registrations, not loop +templates or tool grants. Existing host-pinned loop graphs can be reopened using +the same registry; their pins remain unchanged and unavailable/stale grants are +blocking. A future loop-authoring surface must select a complete host-admitted +`ToolLoopIdentity` and produce exactly one prompt binding under the +[CN-03 contract](tool-loops.md); optional authoring ports and new grants remain +unsupported. No scheduler or loop authority is owned by NodeLab. + See [ADR-018](adr/ADR-018-trusted-custom-node-adapter.md) and the [admitted implementation slice](plans/domain-architecture-and-multimodal/plan.md#admitted-custom-node-adapter-slice-2026-10-21). diff --git a/docs/design/mockups/README.md b/docs/design/mockups/README.md new file mode 100644 index 000000000..dad133178 --- /dev/null +++ b/docs/design/mockups/README.md @@ -0,0 +1,19 @@ +# Workbench mockups + +Interactive mockups of the redesigned workbench, authored for the Claude +Design canvas and viewable locally. + +- `boards/*.dc.html`: one artboard per tab (`Revised` is the Scheduler) plus + the earlier rounds (`Main`, `Studio`, `Instrument`, `Dark`) and the + `Current` baseline screenshot. `boards/shell.css` holds the shared tokens + and primitives for the round-3 boards. +- `ctx-markup.html`, `ctx-mixin.js`, `inject.py`: the shared run-context + picker, expanded into every board by `python3 inject.py` (idempotent). +- `viewer/`: `support.js` is a local stand-in for the canvas runtime; + `build.sh --serve` builds the boards into `viewer/site/` and serves them on + http://127.0.0.1:8765/; `cdp.js` drives headless Chromium for scripted + walkthroughs and screenshots. + +The implementation contract derived from these boards is +`../workbench-redesign-spec.md`; the plan is +`../../plans/workbench-redesign/plan.md`. diff --git a/docs/design/mockups/boards/Current.dc.html b/docs/design/mockups/boards/Current.dc.html new file mode 100644 index 000000000..246f07bb1 --- /dev/null +++ b/docs/design/mockups/boards/Current.dc.html @@ -0,0 +1,28 @@ + + + + +Current Scheduler build + + + + + + + +
+ Screenshot of the current Pantograph Scheduler page: icon-only left rail, fourteen filter dropdowns, a wide empty run table, a transport error banner, and a timeline side panel +
+
+ + + diff --git a/docs/design/mockups/boards/Dark.dc.html b/docs/design/mockups/boards/Dark.dc.html new file mode 100644 index 000000000..45b6e7d69 --- /dev/null +++ b/docs/design/mockups/boards/Dark.dc.html @@ -0,0 +1,335 @@ + + + + +Scheduler, dark drafting paper with inbox + + + + + + + + +
+ +
+
Pantograph
+ +
+
Local engine, updated 20:05:51
+ Assistant +
+ +
+
+ +
+ + +
+ Engine unreachable since 20:03. Showing the last projection; runs keep executing on the engine. + +
+
+ + +
+ +
+
{{lane.name}}
+
+ +
{{b.label}}
+
+
+
+
+
+
+ +
+ +
+
+
+ + + +
+
+ + + +
+ +
+ + + + + + + + + + + +
+
+
+
+ + + +
+ +
+
Selected: {{sel.wf}}
+
+ + + +
+
+
+
+ +
+ +
+
+
{{sel.wf}} v{{sel.ver}}
+
{{sel.id}}
+
+ {{sel.statusLabel}} + {{sel.runtime}} on {{sel.device}} + priority {{sel.prio}} + queue {{sel.queue}} +
+
+ +
+ + + +
+
+
+
+
+

Estimate

+
{{sel.est}}
+
Based on 14 earlier runs of this version
+
+
+

Retention

+
Keep artifacts 7 days, 212 MB on disk
+
Expires 2026-11-09
+
+
+

Placement

+
{{sel.reasonOrPlaced}}
+
Policy fair-share, bucket default
+
+
+
+

Timeline

+
+ + {{e.t}}{{e.text}} + +
+
+ +
+ +
Select a run to see its timeline, estimate and retention.
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Diagnostics.dc.html b/docs/design/mockups/boards/Diagnostics.dc.html new file mode 100644 index 000000000..cf733cf74 --- /dev/null +++ b/docs/design/mockups/boards/Diagnostics.dc.html @@ -0,0 +1,408 @@ + + + + +Diagnostics tab + + + + + + + + + +
+
+
Pantograph
+ +
+ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
+ +
Local engine
+ Settings + +
+ +
+ +
+
+
+
Which run do you want to look into?
+
Diagnostics shows the events, errors and placement of one run. Pick one here, select it in the Scheduler, or paste a run id.
+ +
+
+
+ + +
+ +
+ +
+
+
+
{{sel.wf}} v{{sel.ver}}
+
{{sel.id}}
+
+ {{sel.statusLabel}} + {{sel.placement}} + from {{sel.client}}, session {{sel.session}} +
+
+
+

Timing

+
+ {{t.k}}{{t.v}} +
+
+
+

Placement

+
+ Runtime{{sel.runtime}}, cuda backend + Device{{sel.placementLong}} + Model{{sel.model}} + Policyfair-share, bucket default + Reason{{reason}} + Retention7 days, {{retention}} +
+
+ + +
+ + {{f.label}}{{f.n}} + +
+
+ + +
+
+
{{cmp.failed}}
runs of v{{sel.ver}} failed
+
{{cmp.median}}
median duration when it succeeds
+
+
{{cmp.note}}
+
+
+
+
+

Projection

+
Current at seq 1 842. Run list and node status rebuilt 20:05:50.
+
+
+
+ +
+
+
+ + + +
+
+ + + +
+ + + +
+ + +
+ +
+
{{err.title}} {{err.code}}
+
{{err.text}}
+
{{err.hint}}
+
+ +
+
+ +
+ +
+ {{e.t}} + + {{e.kind}} {{e.msg}} {{e.src}} +
+
+
{{lineCount}} of {{lineTotal}} events shown. Payload bodies for this run are in I/O Inspector.
+
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Graph.dc.html b/docs/design/mockups/boards/Graph.dc.html new file mode 100644 index 000000000..5aa2a701c --- /dev/null +++ b/docs/design/mockups/boards/Graph.dc.html @@ -0,0 +1,437 @@ + + + + +Graph tab + + + + + + + + + +
+
+
Pantograph
+ +
+ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
+ +
Local engine
+ Settings + +
+ +
+
+
+ + +
+
+ + +
+
Saved workflows
+ + + +
Picking a workflow switches to editing it. To see a workflow as a run used it, pick the run instead.
+
+
+
+ {{saveLine}} + read-only, as it ran + + + + + + + + + + + + + +
+ + +
Submit will save v{{version}} first. {{dirtyNote}}
+
+ +
The selected run is of {{sel.wf}}, not {{wfName}}. or keep editing {{wfName}}.
+
+ +
+ +
+
+ + +
+
+ + + + + + + + +
+
Drag onto the canvas, or double-click to add.
+
+
+ +
+ + +
+
{{n.label}}{{n.type}}
+
{{p}}
+
{{p}}
+
{{n.note}}
+
+
+
+ +
running now done in this run failed not reached
+
+ +
+ + +
+ +
+
+
{{node.label}}
+
{{node.type}} · {{node.id}}
+
{{node.stateLabel}}
+
+
+

Settings

+ + + +
Values as they were when the run started. Switch to Edit workflow to change them.
+
+
+

Ports

+
+ {{p.dir}}{{p.name}} {{p.type}} +
+
+ +
+

In this run

+
{{node.runNote}}
+ +
+
+
+
+
+ +
Select a node to see its settings.
+
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Instrument.dc.html b/docs/design/mockups/boards/Instrument.dc.html new file mode 100644 index 000000000..49488e3e2 --- /dev/null +++ b/docs/design/mockups/boards/Instrument.dc.html @@ -0,0 +1,292 @@ + + + + +Scheduler, night instrument direction + + + + + + + + +
+ + + +
+
+

Scheduler

+
{{summary}}
+
Local engine, updated 20:05:51
+
+ + +
+ Engine unreachable since 20:03. Showing the last projection; runs keep executing on the engine. + +
+
+ +
+ + + +
+
+ + +
+ + + +
+ +
+ + +
+ + + + + + + + + + + +
+
+ +
+ + + + +
+
+ + +
+
+
+
+ + + diff --git a/docs/design/mockups/boards/IoInspector.dc.html b/docs/design/mockups/boards/IoInspector.dc.html new file mode 100644 index 000000000..c6dea27ff --- /dev/null +++ b/docs/design/mockups/boards/IoInspector.dc.html @@ -0,0 +1,408 @@ + + + + +I/O Inspector tab + + + + + + + + + +
+
+
Pantograph
+ +
+ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
+ +
Local engine
+ Settings + +
+ +
+ +
+
+
+
Whose inputs and outputs?
+
The inspector shows what passed through each port of one run. Pick a run here, select it in the Scheduler, or paste a run id.
+ +
+
+
+ + +
+ +
+ +
+
+
+ + +
+
+ + + +
+
+
+ + + + + + + + +
+
Payloads kept 7 days. Retention settings
+
+ +
+ +
+
+
+
{{art.node}}:{{art.port}}
+
{{art.id}}
+
+ {{art.role}}{{art.kind}}{{art.retention}}{{art.media}}, {{art.size}} +
+
+
+ + + +
+
+
+ + + + +
{{art.body}}
+
{{art.bodyNote}}
+
+ + + +
+
+
+

Where it came from

+
+ Producer{{art.producer}} + Consumer{{art.consumer}} + Observed{{art.observed}} + Provenance{{art.prov}} +
+
+
+

How it was made

+
+ Runtime{{art.runtime}} + Backend{{art.backend}} + Model{{art.model}} + Format{{art.format}} +
+
+
+
+

Storage

+
+ Lifecycle{{art.lifecycle}} + Read handle{{art.handle}} + Content hash{{art.hash}} + Expires2026-11-09, with the run's other artifacts +
+
+
+
+ +
{{noArtText}}
+
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Library.dc.html b/docs/design/mockups/boards/Library.dc.html new file mode 100644 index 000000000..55b289ee0 --- /dev/null +++ b/docs/design/mockups/boards/Library.dc.html @@ -0,0 +1,387 @@ + + + + +Library tab + + + + + + + + + +
+
+
Pantograph
+ +
+ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
+ +
Local engine
+ Settings + +
+ +
+
+ +
+ +
+
+
+ + + +
+ +
+ + + +
+
+ +
Searching Hugging Face. Results download into the Pumas library on this machine.
+
+
+ +
+ + +
{{grp.title}} {{grp.n}}
+ + + +
+
+ + +
+ {{r.id}}{{r.sub}} + {{r.size}} + +
+
+
8 of 240 results. Narrow the search to see more specific models.
+
+
+
+ Cache on device on disk + {{diskLine}} +
+
+ +
+
+
+
+
{{sel.name}} {{sel.family}}
+
{{sel.id}}
+
+ {{c}} +
+
+
+ + + +
+
+ +
+
+

Where it lives

+
+ On disk{{sel.size}}, {{sel.path}} + On device{{sel.onDevice}} + Format{{sel.format}} +
+
+
+

How it is used

+
+ Runs{{sel.runs}} + Last used{{sel.lastLong}} + Read from network{{sel.net}} +
+
+
+ +
+

Workflows that use it

+ + + + +
WorkflowNodeRunsLast run
{{u.wf}} v{{u.ver}}{{u.node}}{{u.n}}{{u.last}}
+
+
+

Source

+
+ Repository{{sel.repo}} + Downloaded{{sel.downloaded}} + Licence{{sel.licence}} +
+
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Main.dc.html b/docs/design/mockups/boards/Main.dc.html new file mode 100644 index 000000000..db43b535c --- /dev/null +++ b/docs/design/mockups/boards/Main.dc.html @@ -0,0 +1,273 @@ + + + + +Scheduler, drafting paper direction + + + + + + + + +
+ + + +
+
+

Scheduler

+
Updated 20:05:51, live
+
+ + + + +
+ Engine unreachable since 20:03. Showing the last projection; runs keep executing on the engine. + +
+
+ +
+ + +
+ + + +
+ + + +
+ + +
+ + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + + + + + +
RunStatusPlacementQueueStartedDurationUpdated
{{run.id}} · v{{run.ver}}
{{run.statusLabel}}
{{run.reason}}
{{run.runtime}}
{{run.device}}
{{run.queue}}{{run.started}}{{run.dur}}{{run.updated}}
+
+ + +
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Network.dc.html b/docs/design/mockups/boards/Network.dc.html new file mode 100644 index 000000000..a1f6adc04 --- /dev/null +++ b/docs/design/mockups/boards/Network.dc.html @@ -0,0 +1,373 @@ + + + + +Network tab + + + + + + + + + +
+
+
Pantograph
+ +
+ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
+ +
Local engine
+ Settings + +
+ +
+
+ +
+ +
+
+
+ + + +
+
+
+ +
{{grp.title}} {{grp.n}}
+ + + +
+
+
Trusted peers only
+
+ +
+
+
+
+
{{host.name}} {{host.id}}
+
{{host.os}}, captured {{host.captured}}
+
+ {{host.transport}} + {{c}} +
+
+
+ + +
+
+ +
+
{{host.cpu}}
{{host.cores}} cores
+
{{host.mem}}
of {{host.memTotal}} memory in use
+
{{host.sched}}
running / queued here
+
{{host.sessions}}
runtime sessions loaded
+
+ + +
+

Devices

+
+ +
+
{{lane.name}}{{lane.meta}}
+
+ +
{{b.label}}
+
+
+
+
+
+
+
+ +

Devices

{{host.gpuNote}}
+
+ + +
+

{{sel.wf}} on this node

+
+ Run{{sel.id}} + State{{runState}} + Runtime session{{runSession}} + Assets read{{runAssets}} +
+
+
+ +
+

{{sel.wf}}

+
{{elsewhereText}}
+
+
+ +
+
+

Disks

+ + +
MountFreeTotal
{{d.mount}}{{d.free}}{{d.total}}
+
+
+

Interfaces

+ + +
NameReceivedSent
{{i.name}}{{i.rx}}{{i.tx}}
+
+
+
+

Identity

+
+ Node id{{host.id}} + Hostname{{host.host}} + Kernel{{host.kernel}} +
+
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/NodeEditor.dc.html b/docs/design/mockups/boards/NodeEditor.dc.html new file mode 100644 index 000000000..c403328d0 --- /dev/null +++ b/docs/design/mockups/boards/NodeEditor.dc.html @@ -0,0 +1,358 @@ + + + + +Node Editor tab + + + + + + + + + +
+
+
Pantograph
+ +
+ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
+ +
Local engine
+ Settings + +
+ +
+
+ + +
Node authoring is not available in this build. You can read your node definitions, but Save and Publish are off until the authoring API and the local agent are enabled in Settings.
+
+ +
+ +
+
+
+ + + +
+
+
+ +
{{grp.title}} {{grp.n}}
+ + + +
+
+
Built-in nodes are read-only. Duplicate one to start from it.
+
+ +
+
+
+
+
{{sel.label}}
+
{{sel.type}} v{{sel.ver}}
+
+
+ + +
+
+
+ + + + + +
+
+

Inputs

+ + + + +
NameTypeDefault
+ +
+
+

Outputs

+ + + + +
NameTypeRetained
+ +
+
+

Implementation

+
{{sel.code}}
+
+
+
+ +
+
On the canvaslive preview
+
+
+
{{sel.label}}{{sel.type}}
+
{{p.name}}
+
{{p.name}}
+
+
+
+

Checks

+
+ {{c.text}} +
+
+
+

Try it

+
Runs the node once with sample inputs on the local engine, outside any workflow.
+
{{tryNote}}
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Revised.dc.html b/docs/design/mockups/boards/Revised.dc.html new file mode 100644 index 000000000..a45ddcdf1 --- /dev/null +++ b/docs/design/mockups/boards/Revised.dc.html @@ -0,0 +1,474 @@ + + + + +Scheduler, dark drafting paper revised + + + + + + + + +
+
+
Pantograph
+ +
+ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
+ + +
Local engine
+
+ +
Engine unreachable since 20:03, showing last projection
+
+ Settings + +
+ +
+
+ + +
+
local
+
+ +
+
{{lane.name}}{{lane.meta}}
+
+ +
{{b.label}}
+
+
+
+
+
+
running waiting for memory next
+
+
+ +
+ +
+
+
+ + + +
+
+ + + +
+ +
+ + {{c.label}} + +
+
+ +
+ + + + + + + + + + + +
+
+
+ +
+ + + + + + + + +
+ +
+ + + + + + + {{sel.wf}} has finished. No actions available. + + + Select a run to act on it. The other tabs follow this selection. + +
+
+ +
+ +
+
+
+
{{sel.wf}} v{{sel.ver}}
+
{{sel.id}}
+
+ {{sel.statusLabel}} + {{c.text}} +
+
+ +
+
+
+

Progress

+
{{sel.progress}}
+
{{sel.est}}, based on 14 earlier runs of this version
+
+
+

Placement

+
{{sel.placementLong}}
+
Policy fair-share, bucket default, {{sel.vram}} GB requested
+
+
+

Retention

+
Keep artifacts 7 days, 212 MB on disk
+
Expires 2026-11-09
+
+
+
+

Scheduler timeline

+
+ {{e.t}}{{e.text}} +
+
Node-level events for this run are in Diagnostics.
+
+
+
+ +
Select a run to see its progress, placement and timeline.
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Sessions.dc.html b/docs/design/mockups/boards/Sessions.dc.html new file mode 100644 index 000000000..219425bde --- /dev/null +++ b/docs/design/mockups/boards/Sessions.dc.html @@ -0,0 +1,370 @@ + + + + +Sessions tab + + + + + + + + + +
+
+
Pantograph
+ +
+ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
+ +
Local engine
+ Settings + +
+ +
+
+ +
+ +
+
+
+ + + +
+
+ + + +
+
+
+ +
{{grp.title}} {{grp.n}}
+ + + +
+
+
Sessions are saved in .pantograph/sessions. Runs stay in the Scheduler history after a session closes.
+
+ +
+ +
+
+
+
{{sel.name}}
+
{{sel.id}}
+
+ {{sel.stateLabel}} + {{c}} +
+
+
+ + + + + + + + + + +
+
+ +
+
+

Activity

+
+ Opened{{sel.opened}} + Last activity{{sel.lastAct}} + Client{{sel.clientLong}} +
+
+
+

Runs from this session

+
+ Total{{sel.runsLong}} + Live now{{sel.live}} + Artifacts kept{{sel.disk}} +
+ +
+
+ +
+

Open in this session

+
+ +
{{o.name}} {{o.meta}}{{o.sub}}{{o.action}}
+
+
+
+ +
+

What resumes

+
Open graphs and their unsaved edits, the selected run context, the loaded runtime sessions when memory allows, and the last workbench tab. Finished runs are not re-run.
+
+
+
+ +
Select a session to see what it has open and what it ran.
+
+
+
+
+
+
+ + + diff --git a/docs/design/mockups/boards/Studio.dc.html b/docs/design/mockups/boards/Studio.dc.html new file mode 100644 index 000000000..306b6b690 --- /dev/null +++ b/docs/design/mockups/boards/Studio.dc.html @@ -0,0 +1,305 @@ + + + + +Scheduler, grey studio direction + + + + + + + + +
+ +
+
Pantograph
+ +
+
Local engine, 2 GPUs
+ Assistant +
+ +
+
+

Scheduler

+
{{summary}}. Updated 20:05:51, live
+
+ + +
+ Engine unreachable since 20:03. Showing the last projection; runs keep executing on the engine. + +
+
+ + +
+ +
+
{{lane.name}}
{{lane.meta}}
+
+ +
{{b.label}}
+
+
+
+
+
+
+ +
+ + +
+ + + +
+ + + +
+ + +
+ + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + + + + + +
RunStatusPlacementQueueStartedDurationUpdated
{{run.id}} · v{{run.ver}}
{{run.statusLabel}}
{{run.reason}}
{{run.runtime}}
{{run.device}}
{{run.queue}}{{run.started}}{{run.dur}}{{run.updated}}
+
+ + +
+
+
+
+ + + diff --git a/docs/design/mockups/boards/shell.css b/docs/design/mockups/boards/shell.css new file mode 100644 index 000000000..4cf3ed8d9 --- /dev/null +++ b/docs/design/mockups/boards/shell.css @@ -0,0 +1,186 @@ +/* Pantograph workbench shell, direction E (dark drafting paper). Shared by the tab artboards. */ +body{margin:0;background:#2A2E35;color:#E4E6EA;font-family:'Atkinson Hyperlegible',system-ui,sans-serif;font-size:14px;line-height:1.45} +a{color:#E4E6EA}a:hover{color:#fff} +*,*::before,*::after{box-sizing:border-box} +button,input,select,textarea{font:inherit;color:inherit} +*{scrollbar-width:thin;scrollbar-color:#5A6069 transparent} +::-webkit-scrollbar{width:10px;height:10px} +::-webkit-scrollbar-track{background:transparent} +::-webkit-scrollbar-thumb{background:#5A6069;border-radius:5px;border:2px solid #33383F} +::-webkit-scrollbar-thumb:hover{background:#7A818C} +::-webkit-scrollbar-corner{background:transparent} +.serif{font-family:Newsreader,Georgia,serif} +.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:12.5px} +.muted{color:#A3A9B4} +.small{font-size:12.5px} +.root{height:100vh;display:flex;flex-direction:column;background:#2A2E35;overflow:hidden} +.hdr{display:flex;align-items:center;gap:4px;padding:0 14px;border-bottom:1px solid #1F2227;background:#23272D;flex:none} +.brand{font-family:Newsreader,Georgia,serif;font-size:18px;font-weight:500;padding-right:14px;letter-spacing:-0.01em} +.tab{display:flex;align-items:center;height:40px;padding:0 11px;text-decoration:none;color:#B8BDC6;border-bottom:2px solid transparent;font-size:13.5px;white-space:nowrap} +.tab:hover{color:#fff;background:rgba(255,255,255,.04)} +.tab[aria-current="page"]{color:#fff;border-bottom-color:#E4E6EA} +.vdiv{width:1px;height:18px;background:#4A5059;margin:0 10px;flex:none} +.tgl{height:26px;padding:0 10px;border:1px solid #4A5059;border-radius:4px;background:transparent;color:#B8BDC6;cursor:pointer;display:inline-flex;align-items:center;gap:6px;font-size:12.5px;white-space:nowrap} +.tgl:hover{color:#fff;border-color:#8A909A} +.tgl[aria-pressed="true"]{background:#E4E6EA;color:#1F2227;border-color:#E4E6EA} +.ctx{display:inline-flex;align-items:center;gap:8px;height:26px;padding:0 4px 0 10px;border:1px solid #4A5059;border-radius:4px;background:#2E333A;font-size:12.5px;max-width:320px} +.ctx .x{width:20px;height:20px;border:0;border-radius:3px;background:transparent;color:#A3A9B4;cursor:pointer;display:inline-flex;align-items:center;justify-content:center} +.ctx .x:hover{background:#4A5059;color:#fff} +.eng{display:inline-block;width:7px;height:7px;background:#A7C4A0;border-radius:1px} +.eng.off{background:#E39A9A} +.engine{font-size:12.5px;display:flex;align-items:center;gap:8px;margin:0 10px 0 12px;white-space:nowrap} +.main{flex:1;min-height:0;padding:10px 22px 16px;display:flex;flex-direction:column;gap:10px} +.dimrow{display:flex;align-items:center;padding:8px 0 4px;flex:none} +.dim{position:relative;flex:1;height:1px;background:#8A909A;align-self:center;margin:0 6px} +.dim::before,.dim::after{content:"";position:absolute;top:-5px;width:1px;height:11px;background:#8A909A} +.dim::before{left:0}.dim::after{right:0} +.dim-label{position:absolute;left:50%;top:-9px;transform:translateX(-50%);padding:0 12px;background:#2A2E35;font-family:'JetBrains Mono',monospace;font-size:12px;color:#C9CDD4;white-space:nowrap} +.field{height:30px;padding:0 10px;border:1px solid #4A5059;border-radius:4px;background:#23272D;color:#E4E6EA} +.field:focus{outline:2px solid var(--accent);outline-offset:1px} +.seg{display:flex;flex-wrap:wrap;border:1px solid #4A5059;border-radius:4px;overflow:hidden;background:#23272D} +.seg button{height:30px;padding:0 7px;border:0;background:transparent;cursor:pointer;display:flex;gap:4px;align-items:center;justify-content:center;color:#B8BDC6;font-size:12.5px;white-space:nowrap;min-width:0;flex:1} +.seg button+button{border-left:1px solid #3B4048} +.seg button:hover{background:#33383F;color:#fff} +.seg button[aria-pressed="true"]{background:#E4E6EA;color:#1F2227} +.seg .n{font-family:'JetBrains Mono',monospace;font-size:11px;opacity:.8} +.btn{height:30px;padding:0 11px;border:1px solid #4A5059;border-radius:4px;background:#33383F;cursor:pointer;display:inline-flex;align-items:center;gap:6px;color:#E4E6EA;text-decoration:none;font-size:13px;white-space:nowrap} +.btn:hover{border-color:#8A909A} +.btn.sm{height:28px} +.btn.primary{background:#E4E6EA;color:#1F2227;border-color:#E4E6EA;font-weight:700} +.btn.danger{background:transparent;color:#E39A9A;border-color:#5A4247} +.btn.danger:hover{border-color:#E39A9A} +.btn.confirm{background:#E39A9A;color:#1F2227;border-color:#E39A9A;font-weight:700} +.btn:focus-visible,.seg button:focus-visible,.item:focus-visible,.tgl:focus-visible,.ghead:focus-visible,.fchip button:focus-visible,.row:focus-visible,.pill:focus-visible{outline:2px solid var(--accent);outline-offset:1px} +.panel{background:#33383F;border:1px solid #4A5059;border-radius:4px} +.col{display:flex;flex-direction:column;overflow:hidden;min-width:0} +.scroll{flex:1;min-height:0;overflow:auto} +.ptop{padding:10px 12px;display:flex;flex-direction:column;gap:8px;flex:none;border-bottom:1px solid #4A5059} +.pfoot{padding:8px 12px;border-top:1px solid #4A5059;background:#2E333A;display:flex;gap:8px;align-items:center;flex:none;min-height:48px} +.ghead{display:flex;align-items:center;gap:8px;width:100%;padding:7px 12px;border:0;border-top:1px solid #3B4048;background:#2E333A;color:#C9CDD4;font-size:12px;font-weight:700;text-align:left;cursor:pointer;position:sticky;top:0;z-index:1} +.ghead .n{font-family:'JetBrains Mono',monospace;font-size:11px;font-weight:400;color:#A3A9B4} +.ghead .chev{margin-left:auto;font-size:10px;color:#8A909A} +.item{display:grid;grid-template-columns:14px 1fr auto;gap:10px;align-items:start;width:100%;padding:8px 12px;border:0;border-top:1px solid #3B4048;background:transparent;text-align:left;cursor:pointer;color:#E4E6EA} +.item:hover{background:#3A3F47} +.item[aria-current="true"]{background:#434A54;box-shadow:inset 3px 0 0 #E4E6EA} +.item .name{font-weight:700;color:#fff} +.item .ver{font-family:'JetBrains Mono',monospace;font-size:11px;color:#A3A9B4;margin-left:6px} +.item .time{font-family:'JetBrains Mono',monospace;font-size:11.5px;color:#A3A9B4;padding-top:2px;white-space:nowrap} +.item .sub{display:block;font-size:12.5px;color:#A3A9B4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.g{display:inline-block;width:10px;height:10px;border-radius:50%;border:1.5px solid #A3A9B4;margin-top:4px;flex:none} +.g-running{background:var(--accent);border-color:var(--accent)} +.g-waiting{background:linear-gradient(90deg,var(--accent) 50%,transparent 50%);border-color:var(--accent)} +.g-queued{background:transparent} +.g-succeeded{background:#A3A9B4;border-color:#A3A9B4} +.g-failed{background:#E39A9A;border-color:#E39A9A;border-radius:1px;transform:rotate(45deg) scale(.9)} +.g-cancelled{border-style:dashed} +.g-idle{border-color:#6B717B} +.g-warn{background:#D9B06A;border-color:#D9B06A;border-radius:1px;transform:rotate(45deg) scale(.9)} +.g-dark{border-color:#1F2227} +.g-dark.g-running{background:#1F2227} +.st-failed{color:#E39A9A} +.sec{padding:14px 18px;border-top:1px solid #4A5059} +.sec h3{margin:0 0 8px;font-size:13px;font-weight:700;color:#fff} +.ev{display:grid;grid-template-columns:66px 1fr;gap:5px 14px;font-size:13.5px} +.ev .t{font-family:'JetBrains Mono',monospace;font-size:12px;color:#A3A9B4} +.kv{display:grid;grid-template-columns:max-content 1fr;gap:5px 16px;font-size:13.5px} +.kv .k{color:#A3A9B4} +.chip{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 8px;border:1px solid #4A5059;border-radius:11px;font-size:12px;background:#23272D;white-space:nowrap} +.chip .g{margin-top:0} +.fchip{display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 4px 0 8px;border:1px solid #6B717B;border-radius:12px;font-size:12px;background:#2E333A;color:#E4E6EA} +.fchip button{width:18px;height:18px;border:0;border-radius:9px;background:transparent;color:#A3A9B4;cursor:pointer} +.fchip button:hover{background:#4A5059;color:#fff} +.fl{font-size:12px;color:#A3A9B4} +.fl .field{display:block;width:100%;margin-top:3px;height:28px} +.title{font-family:Newsreader,Georgia,serif;font-size:24px;font-weight:500;letter-spacing:-0.01em;color:#fff} +.title .muted{font-size:16px} +.empty{padding:32px 24px;color:#A3A9B4} +/* table rows */ +.tbl{width:100%;border-collapse:collapse;font-size:13px} +.tbl th{position:sticky;top:0;z-index:1;background:#2E333A;color:#A3A9B4;font-weight:700;font-size:12px;text-align:left;padding:7px 12px;border-bottom:1px solid #4A5059;white-space:nowrap} +.tbl td{padding:7px 12px;border-top:1px solid #3B4048;vertical-align:top} +.tbl tr.row{cursor:pointer} +.tbl tr.row:hover td{background:#3A3F47} +.tbl tr[aria-current="true"] td{background:#434A54} +.tbl tr[aria-current="true"] td:first-child{box-shadow:inset 3px 0 0 #E4E6EA} +.num{font-family:'JetBrains Mono',monospace;font-size:12px;text-align:right;white-space:nowrap} +/* log lines */ +.log{font-family:'JetBrains Mono',monospace;font-size:12px;line-height:1.55} +.log .ln{display:grid;grid-template-columns:96px 14px 1fr;gap:10px;padding:3px 12px;border-top:1px solid #30353C;align-items:start} +.log .ln:hover{background:#3A3F47} +.log .ln .t{color:#8A909A} +.log .ln .g{margin-top:5px;width:8px;height:8px} +.log .ln.err{background:rgba(227,154,154,.06)} +.log .ln .m{white-space:pre-wrap;word-break:break-word;color:#D5D9DF} +.log .ln .m b{color:#fff;font-weight:500} +/* lanes */ +.lane{display:grid;grid-template-columns:118px 1fr;gap:8px;align-items:center} +.lane-name{font-family:'JetBrains Mono',monospace;font-size:11.5px;color:#C9CDD4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3} +.lane-track{display:flex;gap:2px;height:20px;border-radius:3px;overflow:hidden;background:#23272D} +.blk{display:flex;align-items:center;gap:6px;padding:0 6px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;border:1px solid transparent;border-radius:2px} +.blk-running{background:var(--accent);color:#1F2227;font-weight:700} +.blk-waiting{border-color:var(--accent);color:#E4E6EA;background:repeating-linear-gradient(135deg,transparent 0 4px,rgba(217,176,106,.25) 4px 6px)} +.blk-queued{border-color:#6B717B;color:#C9CDD4} +.blk-free{border:0} +.legend{display:flex;gap:14px;align-items:center;font-size:11.5px;color:#A3A9B4;white-space:nowrap} +.legend .g{margin-top:0} +/* meters */ +.meter{height:6px;border-radius:3px;background:#23272D;overflow:hidden} +.meter i{display:block;height:100%;background:#8A909A;border-radius:3px} +.meter i.acc{background:var(--accent)} +/* graph canvas */ +.canvas{position:relative;flex:1;min-width:0;overflow:hidden;border:1px solid #4A5059;border-radius:4px;background-color:#2E333A;background-image:radial-gradient(#4A5059 1px,transparent 1px);background-size:22px 22px} +.gnode{position:absolute;width:168px;background:#33383F;border:1px solid #5A6069;border-radius:4px;box-shadow:0 1px 0 rgba(0,0,0,.25)} +.gnode .nh{display:flex;align-items:center;gap:7px;padding:6px 9px;border-bottom:1px solid #4A5059;font-size:12.5px;font-weight:700;color:#fff} +.gnode .nh .g{margin-top:0;width:8px;height:8px} +.gnode .nh .mono{font-weight:400;color:#A3A9B4;font-size:11px;margin-left:auto} +.gnode .pt{display:flex;justify-content:space-between;padding:3px 9px;font-size:11.5px;color:#C9CDD4;position:relative} +.gnode .pt::before,.gnode .pt::after{content:"";position:absolute;top:50%;width:7px;height:7px;border-radius:50%;background:#2E333A;border:1.5px solid #8A909A;transform:translateY(-50%)} +.gnode .pt.in::after{display:none}.gnode .pt.in::before{left:-4px} +.gnode .pt.out::before{display:none}.gnode .pt.out::after{right:-4px} +.gnode .pt.out{justify-content:flex-end} +.gnode[aria-current="true"]{border-color:#E4E6EA;box-shadow:0 0 0 1px #E4E6EA} +.gnode.dim{opacity:.55} +.wire{fill:none;stroke:#8A909A;stroke-width:1.5} +.wire.live{stroke:var(--accent);stroke-width:2} +.wire.err{stroke:#E39A9A;stroke-dasharray:4 3} +.pill{height:26px;padding:0 9px;border:1px solid #4A5059;border-radius:4px;background:#33383F;color:#C9CDD4;cursor:pointer;display:inline-flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap} +.pill:hover{border-color:#8A909A;color:#fff} +.fab{position:absolute;display:flex;gap:6px;padding:6px;background:rgba(35,39,45,.9);border:1px solid #4A5059;border-radius:4px;backdrop-filter:blur(4px)} +.minimap{position:absolute;right:12px;bottom:12px;width:140px;height:84px;border:1px solid #4A5059;border-radius:3px;background:rgba(35,39,45,.9)} +.minimap i{position:absolute;width:12px;height:7px;background:#6B717B;border-radius:1px} +.minimap .view{position:absolute;border:1px solid #C9CDD4;background:transparent} +/* tree */ +.tree button{display:flex;align-items:center;gap:8px;width:100%;padding:5px 12px;border:0;background:transparent;color:#E4E6EA;text-align:left;cursor:pointer;font-size:13px} +.tree button:hover{background:#3A3F47} +.tree button[aria-current="true"]{background:#434A54;box-shadow:inset 3px 0 0 #E4E6EA} +.tree .lvl1{padding-left:28px} +.tree .lvl2{padding-left:46px;color:#C9CDD4} +.tree .typ{font-family:'JetBrains Mono',monospace;font-size:11px;color:#8A909A;margin-left:auto} +.code{font-family:'JetBrains Mono',monospace;font-size:12px;line-height:1.55;white-space:pre;overflow:auto;padding:12px 14px;background:#23272D;border-radius:4px;border:1px solid #4A5059;color:#D5D9DF} +.code .k{color:#C9CDD4}.code .s{color:#D9B06A}.code .n{color:#9FB7D9} +/* cards */ +.card{background:#33383F;border:1px solid #4A5059;border-radius:4px;padding:12px 14px} +.card h4{margin:0 0 6px;font-size:13px;font-weight:700;color:#fff} +.grid-auto{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px} +/* run-context picker */ +.ctxwrap{position:relative;display:flex;align-items:center} +.ctxbtn{display:inline-flex;align-items:center;gap:8px;height:24px;border:0;background:transparent;color:#E4E6EA;cursor:pointer;padding:0;max-width:280px;font-size:12.5px} +.ctxbtn .ctxname{white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.ctxbtn:hover .ctxname{color:#fff} +.ctx.ctxempty{padding:0 10px;color:#B8BDC6;border-style:dashed} +.ctx.ctxempty:hover{color:#fff;border-color:#8A909A} +.ctxbtn:focus-visible,.ctx .x:focus-visible,.poprow:focus-visible{outline:2px solid var(--accent);outline-offset:1px} +.pop{position:absolute;right:0;top:32px;width:400px;z-index:60;background:#23272D;border:1px solid #4A5059;border-radius:4px;box-shadow:0 10px 28px rgba(0,0,0,.45);display:flex;flex-direction:column;max-height:70vh} +.poplist{overflow:auto;min-height:0;flex:1} +.pophead{padding:6px 12px;border-top:1px solid #3B4048;background:#2E333A;color:#C9CDD4;font-size:12px;font-weight:700;position:sticky;top:0;display:flex;gap:8px;align-items:center} +.pophead .n{font-family:'JetBrains Mono',monospace;font-size:11px;font-weight:400;color:#A3A9B4} +.poprow{display:grid;grid-template-columns:14px 1fr auto;gap:10px;align-items:start;width:100%;padding:7px 12px;border:0;border-top:1px solid #3B4048;background:transparent;text-align:left;cursor:pointer;color:#E4E6EA;font-size:13px} +.poprow:hover{background:#3A3F47} +.poprow[aria-current="true"]{background:#434A54;box-shadow:inset 3px 0 0 #E4E6EA} +.poprow b{color:#fff} +.poprow .ver{font-family:'JetBrains Mono',monospace;font-size:11px;color:#A3A9B4} +.poprow .sub{display:block;font-size:12px;color:#A3A9B4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.poprow .time{font-family:'JetBrains Mono',monospace;font-size:11px;color:#A3A9B4;padding-top:3px} +.popfoot{padding:8px 12px;border-top:1px solid #3B4048;font-size:11.5px;color:#8A909A;line-height:1.4} +.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:70;padding:7px 12px;border:1px solid #4A5059;border-radius:4px;background:#23272D;color:#E4E6EA;font-size:12.5px;font-family:'JetBrains Mono',monospace;box-shadow:0 6px 18px rgba(0,0,0,.4)} +.btn[aria-disabled="true"],.tgl[aria-disabled="true"]{opacity:.45;cursor:default} diff --git a/docs/design/mockups/ctx-markup.html b/docs/design/mockups/ctx-markup.html new file mode 100644 index 000000000..781766f5f --- /dev/null +++ b/docs/design/mockups/ctx-markup.html @@ -0,0 +1,38 @@ +
+ +
+ + +
+
+ + + + + + +
+
Copied {{copiedId}}
diff --git a/docs/design/mockups/ctx-mixin.js b/docs/design/mockups/ctx-mixin.js new file mode 100644 index 000000000..d36c11c61 --- /dev/null +++ b/docs/design/mockups/ctx-mixin.js @@ -0,0 +1,121 @@ + catalog() { + return [ + { id: 'run_01JB2K7Q3M', wf: 'ingest-docs-rag', ver: '1.4.0', status: 'running', runtime: 'llama.cpp', device: 'cuda:0', deviceName: 'RTX 4090', vram: 17.2, queue: 0, prio: 0, est: 'About 2 min left', node: 'embed_chunks', pct: '61%', reason: '', started: '20:01:40', dur: '4m 12s', updated: '20:05:51', client: 'gui', session: 's-4f2a' }, + { id: 'run_01JB2K9F0A', wf: 'image-gen-sdxl', ver: '0.9.2', status: 'running', runtime: 'diffusers', device: 'cuda:1', deviceName: 'RTX 3090', vram: 9.8, queue: 0, prio: 0, est: 'About 40 s left', node: 'sample', pct: 'step 18 of 30', reason: '', started: '20:04:02', dur: '1m 49s', updated: '20:05:50', client: 'gui', session: 's-4f2a' }, + { id: 'run_01JB2KB4ZT', wf: 'transcribe-meeting', ver: '2.1.0', status: 'waiting', runtime: 'whisper', device: 'cuda:0', deviceName: 'RTX 4090', vram: 8, queue: 1, prio: 5, est: 'Starts after ingest-docs-rag', node: '', pct: '', reason: 'needs 8 GB on cuda:0, 6.8 GB free', started: '—', dur: '—', updated: '20:05:12', client: 'cli', session: 's-9c01' }, + { id: 'run_01JB2KC1PX', wf: 'summarize-daily', ver: '1.0.3', status: 'queued', runtime: 'llama.cpp', device: 'cuda:1', deviceName: 'RTX 3090', vram: 6, queue: 2, prio: 0, est: 'About 6 min', node: '', pct: '', reason: 'next on cuda:1, model cached', started: '—', dur: '—', updated: '20:04:40', client: 'gui', session: 's-4f2a' }, + { id: 'run_01JB2KD8RN', wf: 'embed-corpus', ver: '1.4.0', status: 'queued', runtime: 'llama.cpp', device: '', deviceName: '', vram: 7, queue: 3, prio: 0, est: 'About 9 min', node: '', pct: '', reason: 'cold load, 12 s', started: '—', dur: '—', updated: '20:04:41', client: 'gui', session: 's-4f2a' }, + { id: 'run_01JB2KE2QW', wf: 'image-gen-sdxl', ver: '0.9.2', status: 'queued', runtime: 'diffusers', device: '', deviceName: '', vram: 9.8, queue: 4, prio: 0, est: 'About 2 min', node: '', pct: '', reason: 'model cached', started: '—', dur: '—', updated: '20:04:55', client: 'gui', session: 's-4f2a' }, + { id: 'run_01JB2JZ0MT', wf: 'summarize-daily', ver: '1.0.3', status: 'succeeded', runtime: 'llama.cpp', device: 'cuda:0', deviceName: 'RTX 4090', vram: 6, queue: 0, prio: 0, est: 'Finished in 38 s', node: '', pct: '', reason: '', started: '19:52:10', dur: '38 s', updated: '19:52:48', client: 'gui', session: 's-4f2a' }, + { id: 'run_01JB2JV7KD', wf: 'embed-corpus', ver: '1.3.9', status: 'succeeded', runtime: 'llama.cpp', device: 'cuda:0', deviceName: 'RTX 4090', vram: 7, queue: 0, prio: 0, est: 'Finished in 11m 03s', node: '', pct: '', reason: '', started: '19:38:01', dur: '11m 03s', updated: '19:49:04', client: 'gui', session: 's-4f2a' }, + { id: 'run_01JB2JT3HB', wf: 'image-gen-sdxl', ver: '0.9.1', status: 'failed', runtime: 'diffusers', device: 'cuda:1', deviceName: 'RTX 3090', vram: 14.2, queue: 0, prio: 0, est: 'Stopped after 22 s', node: 'load_model', pct: '', reason: 'out of memory, needed 14.2 GB', started: '19:35:20', dur: '22 s', updated: '19:35:42', client: 'gui', session: 's-4f2a' }, + { id: 'run_01JB2JQ9XA', wf: 'transcribe-meeting', ver: '2.0.0', status: 'cancelled', runtime: 'whisper', device: 'cuda:0', deviceName: 'RTX 4090', vram: 8, queue: 0, prio: 0, est: 'Stopped after 1m 10s', node: 'transcribe', pct: '', reason: 'cancelled from the GUI', started: '19:30:05', dur: '1m 10s', updated: '19:31:15', client: 'gui', session: 's-4f2a' } + ]; + } + wfMap() { + return { + 'ingest-docs-rag': { model: 'pumas://models/bge-m3', nodes: [['read_docs', 'read-file', 'text'], ['chunking', 'expand-settings', 'settings'], ['split', 'processing', 'chunks'], ['embed_chunks', 'embedding', 'embedding'], ['index', 'vector-output', ''], ['manifest', 'write-file', '']] }, + 'image-gen-sdxl': { model: 'pumas://models/sdxl-base-1.0', nodes: [['prompt', 'text-input', 'text'], ['load_model', 'puma-lib', 'model_path'], ['sample', 'pytorch-inference', 'latents'], ['decode', 'image-output', 'image'], ['unload', 'unload-model', '']] }, + 'transcribe-meeting': { model: 'pumas://models/whisper-large-v3', nodes: [['audio', 'audio-input', 'audio'], ['transcribe', 'onnx-inference', 'transcript'], ['notes', 'text-output', 'text']] }, + 'summarize-daily': { model: 'pumas://models/qwen3-8b-instruct', nodes: [['fetch', 'read-file', 'text'], ['summarize', 'llm-inference', 'response'], ['write', 'write-file', '']] }, + 'embed-corpus': { model: 'pumas://models/bge-m3', nodes: [['read', 'read-file', 'text'], ['embed', 'embedding', 'embedding'], ['index', 'vector-output', '']] } + }; + } + nodeStates(run) { + const wf = this.wfMap()[run.wf] || { nodes: [['start', 'processing', 'out'], ['end', 'text-output', '']] }; + const idx = wf.nodes.findIndex((n) => n[0] === run.node); + return wf.nodes.map(([id, type, port], i) => { + let state = 'queued'; + if (run.status === 'succeeded') state = 'succeeded'; + else if (run.status === 'running') state = i < idx ? 'succeeded' : i === idx ? 'running' : 'queued'; + else if (run.status === 'failed') state = i < idx ? 'succeeded' : i === idx ? 'failed' : 'skipped'; + else if (run.status === 'cancelled') state = i < idx ? 'succeeded' : i === idx ? 'cancelled' : 'skipped'; + const glyph = state === 'skipped' ? 'g-cancelled' : 'g-' + state; + return { id, type, port, state, glyph, label: state === 'skipped' ? 'skipped' : state }; + }); + } + decorateRun(r) { + const labels = { running: 'Running', waiting: 'Waiting', queued: 'Queued', succeeded: 'Succeeded', failed: 'Failed', cancelled: 'Cancelled' }; + const isLive = r.status === 'running' || r.status === 'waiting' || r.status === 'queued'; + let context = ''; + if (r.status === 'running') context = ', ' + r.node + (r.pct ? ' ' + r.pct : ''); + else if (r.status === 'waiting') context = ', ' + r.reason; + else if (r.status === 'queued') context = ', #' + r.queue + ' in queue'; + else if (r.reason) context = ', ' + r.reason; + else context = ', ' + r.dur; + const placement = r.device ? r.runtime + ' on ' + r.device : r.runtime + ', device not assigned yet'; + const placementLong = r.device ? r.runtime + ' on ' + r.device + ' (' + r.deviceName + ')' : 'Not assigned to a device yet'; + let progress = r.est; + if (r.status === 'running') progress = r.node + ', ' + r.pct; + else if (r.status === 'waiting') progress = 'Waiting: ' + r.reason; + else if (r.status === 'queued') progress = 'Queue position ' + r.queue + ', ' + r.reason; + else if (r.status === 'failed') progress = 'Failed in ' + r.node + ': ' + r.reason; + const chips = []; + if (r.device) chips.push({ text: r.runtime + ' on ' + r.device }); + if (r.prio) chips.push({ text: 'priority ' + r.prio }); + if (r.queue) chips.push({ text: '#' + r.queue + ' in queue' }); + return { ...r, glyph: 'g-' + r.status, stClass: r.status === 'failed' ? 'st-failed' : '', statusLabel: labels[r.status], contextSuffix: context, placement, placementLong, progress, chips, isLive, + model: (this.wfMap()[r.wf] || {}).model || 'none', hoverOn: () => { this._hoverRun = r.id; }, hoverOff: () => { if (this._hoverRun === r.id) this._hoverRun = null; } }; + } + ctxBind() { + if (this._ctxBound || typeof document === 'undefined') return; + this._ctxBound = true; + const isField = (t) => t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.tagName === 'SELECT'); + document.addEventListener('keydown', (e) => { + const k = (e.key || '').toLowerCase(); const mod = e.ctrlKey || e.metaKey; + if (e.key === 'Escape' && this.state && this.state.pickerOpen) { this.setState({ pickerOpen: false }); return; } + if (!mod || isField(e.target)) return; + if (k === 'c' && this._hoverRun) this.copyRun(this._hoverRun); + if (k === 'v' && this._hoverCtx) { e.preventDefault(); this.pasteRun(); } + }); + document.addEventListener('mousedown', (e) => { + if (this.state && this.state.pickerOpen && !(e.target.closest && e.target.closest('.ctxwrap'))) this.setState({ pickerOpen: false }); + }); + window.addEventListener('storage', (e) => { if (e.key === 'pg.run') this.setState({ run: e.newValue || null }); }); + } + copyRun(id) { + try { localStorage.setItem('pg.clip', id); } catch (_) {} + if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(id).catch(() => {}); + this.setState({ copied: id }); + clearTimeout(this._copyT); this._copyT = setTimeout(() => this.setState({ copied: null }), 1600); + } + pasteRun() { + const apply = (text) => { const id = (text || '').trim(); if (this.catalog().some((r) => r.id === id)) this.pickRun(id); else this.setState({ pickerOpen: true, pickerQuery: id }); }; + let fallback = ''; try { fallback = localStorage.getItem('pg.clip') || ''; } catch (_) {} + if (navigator.clipboard && navigator.clipboard.readText) navigator.clipboard.readText().then(apply, () => apply(fallback)); else apply(fallback); + } + pickRun(id) { + try { localStorage.setItem('pg.run', id || ''); } catch (_) {} + this.setState({ run: id || null, pickerOpen: false, pickerQuery: '', confirmCancel: false }); + } + ctxRunId(fallback) { + const st = this.state || {}; + if ('run' in st) return st.run; + try { const v = localStorage.getItem('pg.run'); if (v !== null) return v || null; } catch (_) {} + return fallback; + } + ctxVals(fallbackId) { + this.ctxBind(); + const st = this.state || {}; + const runId = this.ctxRunId(fallbackId); + const all = this.catalog(); + const selRaw = all.find((r) => r.id === runId); + const sel = this.decorateRun(selRaw || all[0]); + const qRaw = st.pickerQuery || ''; const q = qRaw.toLowerCase(); + const match = (r) => !q || r.wf.includes(q) || r.id.toLowerCase().includes(q) || ('v' + r.ver).includes(q); + const groups = [['Running', ['running']], ['Waiting for memory', ['waiting']], ['Queued', ['queued']], ['Finished today', ['succeeded', 'failed', 'cancelled']]] + .map(([title, keys]) => { const runs = all.filter((r) => keys.includes(r.status) && match(r)).map((r) => ({ ...this.decorateRun(r), selected: r.id === runId, pick: () => this.pickRun(r.id) })); return { title, n: runs.length, runs }; }) + .filter((g) => g.n); + const total = groups.reduce((n, g) => n + g.n, 0); + return { + runId, hasSel: !!selRaw, noSel: !selRaw, sel, ctxHas: !!selRaw, ctxNone: !selRaw, ctxRun: sel, + pickerOpen: !!st.pickerOpen, pickerQuery: qRaw, pickerGroups: groups, + pickerEmpty: total === 0, pickerEmptyText: q.startsWith('run_') ? 'No run with id ' + qRaw + ' in today\'s history.' : 'No runs match.', + togglePicker: () => this.setState({ pickerOpen: !st.pickerOpen }), + openPicker: () => this.setState({ pickerOpen: true }), + setQuery: (e) => { const v = e.target.value; if (all.some((r) => r.id === v.trim())) this.pickRun(v.trim()); else this.setState({ pickerQuery: v }); }, + clearSel: () => this.pickRun(null), + ctxHoverOn: () => { this._hoverCtx = true; }, ctxHoverOff: () => { this._hoverCtx = false; }, + copied: !!st.copied, copiedId: st.copied || '' + }; + } diff --git a/docs/design/mockups/inject.py b/docs/design/mockups/inject.py new file mode 100644 index 000000000..1db44af99 --- /dev/null +++ b/docs/design/mockups/inject.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +"""Expands the shared run-context picker into every board. +Markup goes where a board has (or between ... ); +the mixin goes where the class has /*ctx*/ (or between /*ctx-start*/ ... /*ctx-end*/). Idempotent.""" +import pathlib, re, sys +here = pathlib.Path(__file__).parent +markup = (here / "ctx-markup.html").read_text().rstrip("\n") +mixin = (here / "ctx-mixin.js").read_text().rstrip("\n") +M0, M1 = "", "" +J0, J1 = "/*ctx-start*/", "/*ctx-end*/" +for f in sorted((here / "project").glob("*.dc.html")): + s = f.read_text() + if "" not in s and M0 not in s: + continue + s = s.replace("", f"{M0}\n{markup}\n {M1}") + s = re.sub(re.escape(M0) + r"[\s\S]*?" + re.escape(M1), lambda _: f"{M0}\n{markup}\n {M1}", s) + s = s.replace("/*ctx*/", f"{J0}\n{mixin}\n {J1}") + s = re.sub(re.escape(J0) + r"[\s\S]*?" + re.escape(J1), lambda _: f"{J0}\n{mixin}\n {J1}", s) + f.write_text(s) + print("injected", f.name) diff --git a/docs/design/mockups/viewer/.gitignore b/docs/design/mockups/viewer/.gitignore new file mode 100644 index 000000000..45ddf0ae3 --- /dev/null +++ b/docs/design/mockups/viewer/.gitignore @@ -0,0 +1 @@ +site/ diff --git a/docs/design/mockups/viewer/build.sh b/docs/design/mockups/viewer/build.sh new file mode 100755 index 000000000..2e0923223 --- /dev/null +++ b/docs/design/mockups/viewer/build.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Builds the local mockup site from ../boards into ./site and serves it on http://127.0.0.1:8765/ +set -euo pipefail +here="$(cd "$(dirname "$0")" && pwd)" +src="$here/../boards" +out="$here/site" +mkdir -p "$out" +cp "$here/support.js" "$out/support.js" +cp "$src/shell.css" "$out/shell.css" +cp "$here/current-scheduler.png" "$out/current-scheduler.png" +for f in "$src"/*.dc.html; do + b="$(basename "$f" .dc.html)" + sed -e 's#src="/_blob/[0-9a-f]*"#src="./current-scheduler.png"#' "$f" > "$out/$b.html" +done +python3 - "$out/index.html" <<'PY' +import sys, pathlib +rows = [("Round 1: current build and three directions", ["Current", "Main", "Studio", "Instrument"]), + ("Round 2: D and E (Scheduler)", ["Dark", "Revised"]), + ("Round 3: every tab in E's language", ["Sessions", "Diagnostics", "IoInspector", "Network", "Graph", "NodeEditor", "Library"])] +cards = [] +for title, names in rows: + cards.append(f'

{title}

') + for n in names: + cards.append(f'{n}') + cards.append('
') +html = '''Pantograph GUI mockups + +

Pantograph GUI mockups

Click a board to open it full size. Boards share one run context; Ctrl+C over a run copies its id, Ctrl+V over the chip views it.

''' + ''.join(cards) + '' +pathlib.Path(sys.argv[1]).write_text(html) +PY +echo "built in $out" +if [ "${1:-}" = "--serve" ]; then exec python3 -m http.server 8765 --directory "$out"; fi diff --git a/docs/design/mockups/viewer/cdp.js b/docs/design/mockups/viewer/cdp.js new file mode 100644 index 000000000..bc1d58323 --- /dev/null +++ b/docs/design/mockups/viewer/cdp.js @@ -0,0 +1,30 @@ +// Drives headless Chrome over the DevTools protocol with Node's built-in WebSocket. +// Usage: node cdp.js steps.json where steps is [{goto:url}|{eval:js}|{wait:ms}|{shot:file}] +const { spawn } = require('child_process'); +const fs = require('fs'); +const os = require('os'); +const CH = os.homedir() + '/.cache/ms-playwright/chromium_headless_shell-1246/chrome-headless-shell-linux64/chrome-headless-shell'; +const PORT = 9333; +const steps = JSON.parse(fs.readFileSync(process.argv[2], 'utf8')); +const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); + +(async () => { + const chrome = spawn(CH, ['--headless', '--disable-gpu', '--hide-scrollbars=false', '--remote-debugging-port=' + PORT, '--window-size=1440,900', '--user-data-dir=' + fs.mkdtempSync(os.tmpdir() + '/cdp-'), 'about:blank'], { stdio: 'ignore' }); + let targets = null; + for (let i = 0; i < 50 && !targets; i++) { await sleep(200); try { targets = await (await fetch('http://127.0.0.1:' + PORT + '/json')).json(); } catch (_) {} } + const page = targets.find((t) => t.type === 'page'); + const ws = new WebSocket(page.webSocketDebuggerUrl); + await new Promise((r) => (ws.onopen = r)); + let id = 0; const pending = new Map(); + ws.onmessage = (m) => { const d = JSON.parse(m.data); if (d.id && pending.has(d.id)) { pending.get(d.id)(d); pending.delete(d.id); } }; + const send = (method, params = {}) => new Promise((r) => { const i = ++id; pending.set(i, r); ws.send(JSON.stringify({ id: i, method, params })); }); + await send('Page.enable'); await send('Runtime.enable'); + await send('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false }); + for (const s of steps) { + if (s.goto) { await send('Page.navigate', { url: s.goto }); await sleep(s.settle || 1200); } + else if (s.eval) { const r = await send('Runtime.evaluate', { expression: s.eval, awaitPromise: true, returnByValue: true }); if (r.result && r.result.exceptionDetails) console.log('eval error:', r.result.exceptionDetails.text, s.eval.slice(0, 80)); else if (s.log) console.log(s.log + ':', JSON.stringify(r.result.result.value)); await sleep(s.settle || 250); } + else if (s.wait) await sleep(s.wait); + else if (s.shot) { const r = await send('Page.captureScreenshot', { format: 'png' }); fs.writeFileSync(s.shot, Buffer.from(r.result.data, 'base64')); console.log('shot', s.shot); } + } + ws.close(); chrome.kill(); +})().catch((e) => { console.error(e); process.exit(1); }); diff --git a/docs/design/mockups/viewer/current-scheduler.png b/docs/design/mockups/viewer/current-scheduler.png new file mode 100644 index 000000000..054584ef8 Binary files /dev/null and b/docs/design/mockups/viewer/current-scheduler.png differ diff --git a/docs/design/mockups/viewer/support.js b/docs/design/mockups/viewer/support.js new file mode 100644 index 000000000..fb3cbcbf8 --- /dev/null +++ b/docs/design/mockups/viewer/support.js @@ -0,0 +1,169 @@ +/* Local stand-in for the Design canvas runtime. Renders templates: + {{path}} interpolation, , , onClick/onChange handlers, + data-props defaults with a small tweak panel. Enough to view the mockups offline. */ +(function () { + class DCLogic { + constructor(props) { this.props = props; this.state = {}; } + setState(patch) { Object.assign(this.state, patch); scheduleRender(); } + } + window.DCLogic = DCLogic; + + let component, template, mount, propsSpec, renderQueued = false; + + function lit(s) { + s = s.trim(); + if (s === 'true') return true; + if (s === 'false') return false; + if (s === 'null') return null; + if (/^-?\d+(\.\d+)?$/.test(s)) return Number(s); + if (/^'.*'$/.test(s) || /^".*"$/.test(s)) return s.slice(1, -1); + return undefined; + } + function lookup(path, scope, vals) { + const l = lit(path); + if (l !== undefined) return l; + const parts = path.split('.'); + let cur = Object.prototype.hasOwnProperty.call(scope, parts[0]) ? scope[parts[0]] : vals[parts[0]]; + for (let i = 1; i < parts.length && cur != null; i++) cur = cur[parts[i]]; + return cur; + } + const RE_ONE = /^\s*\{\{\s*([^}]*?)\s*\}\}\s*$/; + const RE_ALL = /\{\{\s*([^}]*?)\s*\}\}/g; + function evalExpr(str, scope, vals) { + const m = str.match(RE_ONE); + if (m) return lookup(m[1], scope, vals); + return interp(str, scope, vals); + } + function interp(str, scope, vals) { + if (!str.includes('{{')) return str; + return str.replace(RE_ALL, (_, p) => { const v = lookup(p, scope, vals); return v == null ? '' : String(v); }); + } + function parseAttrs(s) { + const out = {}; const re = /([\w-]+)="([^"]*)"/g; let m; + while ((m = re.exec(s))) out[m[1]] = m[2]; + return out; + } + + function renderChildren(src, scope, vals) { return renderList(Array.from(src.childNodes), scope, vals); } + function renderList(kids, scope, vals) { + const out = []; let i = 0; + while (i < kids.length) { + const k = kids[i]; + if (k.nodeType === 8) { + const m = k.data.match(/^\s*sc-(for|if)\s+([\s\S]*)$/); + if (m) { + let depth = 1, j = i + 1; + for (; j < kids.length; j++) { + if (kids[j].nodeType !== 8) continue; + if (/^\s*sc-(for|if)\b/.test(kids[j].data)) depth++; + else if (/^\s*\/sc-(for|if)/.test(kids[j].data)) { depth--; if (depth === 0) break; } + } + const body = kids.slice(i + 1, j); const attrs = parseAttrs(m[2]); + if (m[1] === 'for') { + const list = evalExpr(attrs.list || '', scope, vals) || []; + list.forEach((item) => { const sc = Object.assign({}, scope); sc[attrs.as] = item; out.push(...renderList(body, sc, vals)); }); + } else if (evalExpr(attrs.value || '', scope, vals)) { + out.push(...renderList(body, scope, vals)); + } + i = j + 1; continue; + } + i++; continue; + } + out.push(...renderNode(k, scope, vals)); i++; + } + return out; + } + function renderNode(n, scope, vals) { + if (n.nodeType === 3) { const t = document.createTextNode(interp(n.data, scope, vals)); return [t]; } + if (n.nodeType !== 1) return []; + const el = n.cloneNode(false); + for (const a of Array.from(el.attributes)) { + if (a.name.startsWith('hint-')) { el.removeAttribute(a.name); continue; } + if (!a.value.includes('{{')) continue; + if (a.name.startsWith('on')) { + const fn = evalExpr(a.value, scope, vals); + el.removeAttribute(a.name); + if (typeof fn === 'function') el.addEventListener(a.name.slice(2), fn); + continue; + } + const v = evalExpr(a.value, scope, vals); + el.setAttribute(a.name, v == null ? '' : String(v)); + } + if (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true') el.style.opacity = '.5'; + renderChildren(n, scope, vals).forEach((c) => el.appendChild(c)); + if ((el.tagName === 'INPUT' || el.tagName === 'SELECT' || el.tagName === 'TEXTAREA') && n.hasAttribute('value')) { + const v = el.getAttribute('value'); if (v != null) requestAnimationFrame(() => { el.value = v; }); + } + return [el]; + } + + function scheduleRender() { if (renderQueued) return; renderQueued = true; requestAnimationFrame(render); } + function render() { + renderQueued = false; + const vals = component.renderVals(); + const nodes = renderChildren(template, {}, vals); + const ae = document.activeElement; const key = ae && ae.dataset ? ae.dataset.key : null; + const pos = key && 'selectionStart' in ae ? ae.selectionStart : null; + mount.replaceChildren(...nodes); + if (key) { const again = mount.querySelector('[data-key="' + key + '"]'); if (again) { again.focus(); if (pos != null) try { again.setSelectionRange(pos, pos); } catch (_) {} } } + else { const af = mount.querySelector('[data-autofocus]'); if (af && !component._afDone) { component._afDone = true; af.focus(); } if (!af) component._afDone = false; } + relink(mount); + } + const PAGES = { sessions: 'Sessions.html', scheduler: 'Revised.html', diagnostics: 'Diagnostics.html', io: 'IoInspector.html', network: 'Network.html', graph: 'Graph.html', nodes: 'NodeEditor.html', library: 'Library.html' }; + function relink(root) { + if (!/^https?:$/.test(location.protocol)) return; + root.querySelectorAll('a[href^="#"]').forEach((a) => { const page = PAGES[a.getAttribute('href').slice(1)]; if (page) a.setAttribute('href', page); }); + } + + function readProps(spec) { + const props = {}; const q = new URLSearchParams(location.search); + for (const [k, d] of Object.entries(spec)) { + if (k.startsWith('$')) continue; + let v = d.default; + if (q.has(k)) { const raw = q.get(k); v = d.editor === 'boolean' ? raw === 'true' || raw === '1' : raw; } + props[k] = v; + } + return props; + } + function tweakPanel(spec, props) { + const keys = Object.keys(spec).filter((k) => !k.startsWith('$')); + if (!keys.length) return; + const box = document.createElement('div'); + box.setAttribute('aria-label', 'Tweaks'); + box.style.cssText = 'position:fixed;right:10px;bottom:10px;z-index:9999;font:12px system-ui,sans-serif;color:#E4E6EA;background:rgba(35,39,45,.95);border:1px solid #4A5059;border-radius:4px;padding:6px 8px;display:flex;gap:10px;align-items:center;opacity:.35;transition:opacity .15s'; + box.onmouseenter = () => (box.style.opacity = '1'); box.onmouseleave = () => (box.style.opacity = '.35'); + const home = document.createElement('a'); home.href = './index.html'; home.textContent = 'All boards'; home.style.cssText = 'color:#D9B06A;text-decoration:none;margin-right:4px'; box.appendChild(home); + keys.forEach((k) => { + const d = spec[k]; const lab = document.createElement('label'); lab.style.cssText = 'display:inline-flex;gap:4px;align-items:center'; + lab.appendChild(document.createTextNode(k)); + let input; + if (d.editor === 'boolean') { input = document.createElement('input'); input.type = 'checkbox'; input.checked = !!props[k]; input.onchange = () => { props[k] = input.checked; scheduleRender(); }; } + else if (d.options || d.editor === 'enum') { input = document.createElement('select'); (d.options || []).forEach((o) => { const op = document.createElement('option'); op.value = o; op.textContent = o; op.selected = o === props[k]; input.appendChild(op); }); input.onchange = () => { props[k] = input.value; scheduleRender(); }; } + else { input = document.createElement('input'); input.type = d.editor === 'color' ? 'color' : 'text'; input.value = props[k]; input.onchange = () => { props[k] = input.value; scheduleRender(); }; } + input.style.cssText = 'font:inherit;background:#23272D;color:inherit;border:1px solid #4A5059;border-radius:3px;height:22px'; + lab.appendChild(input); box.appendChild(lab); + }); + document.body.appendChild(box); + } + + async function boot() { + const src = await (await fetch(location.href, { cache: 'no-store' })).text(); + const xm = src.match(/([\s\S]*?)<\/x-dc>/); + if (!xm) return; + let body = xm[1]; + const hm = body.match(/([\s\S]*?)<\/helmet>/); + if (hm) { body = body.replace(hm[0], ''); const h = document.createElement('div'); h.innerHTML = hm[1]; Array.from(h.childNodes).forEach((n) => document.head.appendChild(n)); } + body = body.replace(/]*)>/g, '').replace(/<\/sc-(for|if)>/g, ''); + template = document.createElement('div'); template.innerHTML = body; + const scriptEl = document.querySelector('script[data-dc-script]'); + propsSpec = JSON.parse(scriptEl.getAttribute('data-props') || '{}'); + const props = readProps(propsSpec); + const Component = new Function('DCLogic', scriptEl.textContent + '\nreturn Component;')(DCLogic); + component = new Component(props); + const old = document.querySelector('x-dc'); mount = document.createElement('div'); mount.id = 'app'; + if (old) old.replaceWith(mount); else document.body.prepend(mount); + render(); + tweakPanel(propsSpec, props); + } + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot); else boot(); +})(); diff --git a/docs/design/workbench-redesign-spec.md b/docs/design/workbench-redesign-spec.md new file mode 100644 index 000000000..63d537cd8 --- /dev/null +++ b/docs/design/workbench-redesign-spec.md @@ -0,0 +1,359 @@ +# Workbench redesign: implementation spec + +This is the design contract for porting the approved mockups in +`docs/design/mockups/` into the Svelte workbench. The mockups are the visual +authority; this document states the tokens, shared parts, behaviours and +page-by-page mapping so that pages built in parallel come out as one system. +The plan that sequences the work is `docs/plans/workbench-redesign/plan.md`. + +To view the mockups locally: `bash docs/design/mockups/viewer/build.sh --serve` +then open http://127.0.0.1:8765/. Boards `Revised` (Scheduler), `Sessions`, +`Diagnostics`, `IoInspector`, `Network`, `Graph`, `NodeEditor`, `Library` are +the targets. Boards `Main`, `Studio`, `Instrument`, `Dark` are earlier rounds +and are not targets. + +## Design principles (from the Calm Tech review) + +- One place for attention: the selected run is the context for every tab, shown + once in the header chip. Pages do not repeat it in their own headers. +- Status is carried by a small glyph vocabulary, never by pulsing motion, bright + LED-like colour, or uppercase tracked labels. +- Errors are explained in sentences with a suggested next action, inside the + panel they belong to, not in page-wide red banners. +- Filters are progressive: a search field, one status segment, and a `Filters` + disclosure. Applied secondary filters appear as removable chips. +- Lists are grouped under sticky collapsible headers and scroll inside their + panel; the page itself never scrolls. +- Destructive actions are two-step (`Cancel run` → `Confirm cancel`) and reset + after four seconds. +- Engine unavailability is shown in place: the header line changes and content + dims to 72% opacity; pages keep showing the last projection. + +## Tokens + +Define these as CSS custom properties on `:root` in `src/styles.css` and expose +them to Tailwind through `tailwind.config.cjs` (`theme.extend.colors` keyed to +`var(--…)`). Replace the current `!important` neutral overrides; the new +palette is the only palette. + +| Token | Value | Use | +| --- | --- | --- | +| `--pg-ground` | `#2A2E35` | page background | +| `--pg-panel` | `#33383F` | panels, cards | +| `--pg-panel-raised` | `#3A3F47` | hover rows | +| `--pg-panel-selected` | `#434A54` | selected row (plus 3px inset left bar `--pg-text`) | +| `--pg-panel-sunken` | `#23272D` | inputs, popovers, lane tracks, header bar | +| `--pg-panel-head` | `#2E333A` | group headers, panel footers, device lane strip | +| `--pg-border` | `#4A5059` | panel borders, dividers | +| `--pg-border-soft` | `#3B4048` | row separators | +| `--pg-border-strong` | `#8A909A` | hover borders, dimension lines | +| `--pg-text` | `#E4E6EA` | primary text | +| `--pg-text-bright` | `#FFFFFF` | titles, selected | +| `--pg-text-muted` | `#A3A9B4` | secondary text | +| `--pg-text-soft` | `#C9CDD4` | labels, mono ids | +| `--pg-accent` | `#D9B06A` | running state, focus ring, live wire (brass) | +| `--pg-danger` | `#E39A9A` | failed state, destructive text | +| `--pg-ok` | `#A7C4A0` | engine online dot | +| `--pg-info` | `#9FB7D9` | numbers in code views | + +Fonts: `Newsreader` (serif, titles and the brand word), `Atkinson Hyperlegible` +(UI text), `JetBrains Mono` (ids, timestamps, code). Bundle them through +`@fontsource/*` packages so the desktop app works offline; if the packages +cannot be installed, fall back to the system stacks `Georgia, serif`, +`system-ui, sans-serif`, `ui-monospace, monospace` and record the gap in +`issues.md`. Base size 14px, line height 1.45. Titles 24px/500 serif, page +subtitles 20px. + +Scrollbars: `scrollbar-width: thin; scrollbar-color: #5A6069 transparent` plus +the WebKit equivalents (10px, thumb `#5A6069` with a 2px `--pg-panel` border, +hover `#7A818C`). Apply globally. + +Focus: `outline: 2px solid var(--pg-accent); outline-offset: 1px` on every +focusable control via `:focus-visible`. + +## Status glyph vocabulary + +One component, `StatusGlyph`, 10px circle, 1.5px border: + +| State | Rendering | +| --- | --- | +| running | filled accent | +| waiting | left half accent (`linear-gradient(90deg, accent 50%, transparent 50%)`), accent border | +| queued / next / not reached | hollow, muted border | +| succeeded / done | filled muted | +| failed | filled danger, 1px radius, rotated 45° (a small diamond) | +| cancelled / skipped | hollow, dashed border | +| idle (no run) | hollow, soft border | +| warn (log level) | filled accent diamond | + +Map backend statuses: `accepted`, `future`, `scheduled`, `queued`, `delayed` +→ queued; `running` → running; `completed` → succeeded; `failed` → failed; +`cancelled` → cancelled. Node statuses map the same way; `Waiting` → waiting. + +## Shell + +`WorkbenchShell.svelte` becomes a top bar, 40px tall, background +`--pg-panel-sunken`, with a 1px `#1F2227` bottom border: + +``` +Pantograph | Sessions | │ | Scheduler Diagnostics I/O Inspector Network | │ | Graph Node Editor Library | … | [run chip ▾ ×] [■ Local engine] Settings [Assistant] +``` + +- Tabs are text, 13.5px, 11px horizontal padding, 2px bottom border on the + current tab (`--pg-text`), hover tint `rgba(255,255,255,.04)`. Keyboard + reachable, `aria-current="page"` on the active one. The lucide icon rail and + the "Active Run" label block are removed. +- Vertical dividers (1px, 18px tall) separate the three groups. Settings is + pinned to the right as a tab. The Assistant toggle keeps its existing + behaviour; style it as a `tgl` (26px, bordered). +- Engine line: a 7px square dot, `--pg-ok` when online, `--pg-danger` when the + transport reports unavailable, followed by "Local engine" or "Engine + unreachable since HH:MM, showing last projection" and a small Retry. +- The run-context picker (below) sits between the tabs and the engine line. + +Page ids gain `sessions`. Order: sessions, scheduler, diagnostics, io_inspector, +network, graph, node_lab, library, settings. Scheduler stays the default page. + +## Run-context picker + +The run chip in the header is the single control for the shared selection +(ADR-014: transient frontend state shared across pages). + +- Source of runs: the scheduler run-list projection (`schedulerRunListStore`, + fed by `workflowService.queryRunList`). The picker never queries the ledger. +- Chip when a run is selected: glyph, workflow id, version (`v1.4.0`, mono, + muted), `▾`; a separate `×` button clears the selection. Chip when none: + "Pick a run ▾" with a dashed border. +- Clicking the chip opens a popover (400px, anchored right) with a search field + (placeholder "Search runs, or paste a run id") and the grouped list: + Running, Waiting for memory, Queued, Finished today. Rows: glyph, workflow + id + version, one-line status context, run id in mono on the right. + Selecting a row sets the active run and closes the popover. Escape and an + outside click close it. Focus goes to the search field on open and returns + to the chip on close. +- Search matches workflow id, run id and version. If the typed or pasted text + equals a known run id, select it immediately. If it looks like a run id but + is unknown, show "No run with id … in today's history." +- Clipboard: while the pointer is over a run row in the Scheduler list, a + picker row, or any element that renders a run id with `data-run-id`, Ctrl+C + (or Cmd+C) copies the run id and shows a 1.6s toast "Copied run_…". While + the pointer is over the chip, Ctrl+V reads the clipboard and selects that + run if known, otherwise opens the popover with the text in the search field. + Clipboard permission failures fall back to opening the popover. Keystrokes + inside inputs are ignored. +- Pages with no run selected show an empty state centred in the page: a short + serif question ("Which run do you want to look into?"), one sentence, and a + primary "Pick a run" button that opens the popover. + +## Shared parts (`src/components/workbench/ui/`) + +Build these once; pages compose them. Names are suggestions, the behaviour is +the contract. + +- `DimensionLine`: a 1px rule with tick ends and a centred mono label on the + page background. Used as the page summary line under the header. +- `Panel`: `--pg-panel` background, `--pg-border` border, 4px radius; a column + variant with a fixed top (`ptop`), scrolling middle (`scroll`) and fixed + footer (`pfoot`, `--pg-panel-head` background, 48px min height). +- `GroupHeader`: sticky, collapsible, label + mono count + chevron, `aria-expanded`. +- `ListRow`: grid `14px 1fr auto`, glyph, name (bold) + mono version, two + muted sub-lines, time on the right; `aria-current="true"` when selected. +- `SegmentedControl`: bordered group, each button with a label and mono count, + `aria-pressed` on the active one; wraps instead of clipping. +- `FilterChip`: pill with a `×` button; `Chip`: static pill. +- `DeviceLanes`: per device, name + "x of y GB in use" and a track of blocks + whose widths are proportional to GB: running (accent fill), waiting (accent + hatch), next (hollow), free (empty). Legend to the right. +- `KeyValue`: two-column grid of muted keys and values. +- `LogLine`: grid `96px 14px 1fr`, mono timestamp, level glyph, message with a + bold kind and a muted source suffix. Error lines get a 6% danger tint. +- `ErrorCard`: left 3px danger bar, bold title, muted code line, one sentence + of explanation, one sentence starting "Try:", and an action button. +- `TwoStepButton`: `danger` → `confirm` with a 4s reset. +- `EmptyState`: the centred question + sentence + primary button. +- `Toast`: fixed bottom centre, mono, 1.6s. + +## Pages + +Each page keeps its presenters and service calls. What changes is the +projection into the new layout. Every page: dimension line first, then the +two-panel inbox layout (fixed-width list left, detail right) unless noted. + +### Scheduler (`Revised` board) + +- Dimension line: "N runs waiting, about M min of queued work on D devices" + from the scheduler estimate projection; omit the minutes when no estimate. +- Device lanes strip (collapsible via a `showLanes` preference) from the + local Network status projection where device memory is available; hide the + strip when the projection has no device facts. +- Left panel 380px: search, status segment (All, Active, Queued, Done, Failed + with counts), `Filters` disclosure holding the remaining 11 selects from the + current page in a two-column grid, applied-filter chips, then the grouped + list (Running, Waiting for memory, Queued, Finished today). Footer: `Move to + front`, `Priority` number input, two-step `Cancel run` for live runs; "has + finished. No actions available." for finished ones; "Select a run to act on + it. The other tabs follow this selection." when none. +- Right panel: title (workflow id, version), run id (copyable), status chip + plus placement/priority/queue chips, buttons Diagnostics / Graph / I/O that + switch tabs; three cells Progress, Placement, Retention; then the scheduler + timeline (`querySchedulerTimeline`) as a time/event grid with the sentence + "Node-level events for this run are in Diagnostics." +- Selecting a row sets the active run (same store as the chip). + +### Diagnostics (`Diagnostics` board) + +- Dimension line: "run_id, failed 19:35:42 after 22 s, 1 error in load_model" + style sentence from run detail. +- Left panel 300px: title, run id, chips (status, placement, client/session); + Timing and Placement key-value sections; collapsible "Nodes by status" with + thin bars; collapsible "Compared with earlier runs" using the comparison + facets (two big serif numbers and a sentence); Projection freshness line. +- Right panel: level segment (All, Warnings, Errors with counts), source + segment (All sources, Scheduler, Runtime, Nodes), search, Follow toggle; + the ErrorCard when the run has a terminal error, with "Show in log" which + switches the level filter to Errors; then the timeline as LogLines; a + footer sentence "N of M events shown. Payload bodies for this run are in + I/O Inspector." +- The existing `diagnosticsFocus` behaviour (deep link to an event) is kept: + the focused event line gets the selected row treatment and is scrolled into + view. + +### I/O Inspector (`IoInspector` board) + +- Dimension line: "run_id, N nodes, M retained artifacts, X MB kept for 7 days". +- Left panel 340px: search, direction segment (All, Inputs, Outputs); a tree of + nodes (glyph, node id, mono type, "N retained ports") each expandable to its + artifacts ("→ port" for outputs, "← port" for inputs, size, kind and + retention). Footer: "Payloads kept 7 days. Retention settings" linking to + Settings as today. +- Right panel: title `node:port`, artifact id, chips (role, kind, retention, + media + size); buttons Read body / Download / Acknowledge with the existing + semantics; the preview region (image, text/JSON in a code block, or the + "Only metadata was kept for this port." panel); sections "Where it came + from", "How it was made", "Storage" from the artifact descriptor fields. +- The compact run graph strip is removed from this page; Graph owns graphs. +- Saved-graph mode (no run) becomes the empty state with "Pick a run". + +### Network (`Network` board) + +- Dimension line: "N nodes, c connected, d degraded, p waiting to be paired. + G GPUs, V GB VRAM reachable" from local status plus peers; omit parts that + the projection does not provide. +- Left panel 340px: segment (All nodes, Shared with me, Mine), groups Local + and Peers with rows (glyph by transport state, display name, node id, + two sub-lines, latency on the right). Footer "Pair a node" (disabled with + a title until pairing exists) and "Trusted peers only". +- Right panel: title, OS and captured time, chips; four stat cells (CPU with + meter, memory with meter, running/queued, runtime sessions); Devices as + DeviceLanes; the selected run's placement on this node (" on this + node": run id, state, runtime session, assets read) or a sentence that the + run is placed elsewhere; Disks and Interfaces as small tables; Identity. +- Degraded metrics render as muted text in their section, not an amber list. + +### Graph (`Graph` board) + +- Toolbar row (no dimension line of its own; the dimension line sits in the + toolbar between the status text and the panel toggles): a two-way mode + switch `Edit workflow` / `As run `; the workflow selector + (bold name, mono version, popover of saved workflows with "Picking a + workflow switches to editing it…" footer); "Saved HH:MM" or "Unsaved + changes" in edit mode, "read-only, as it ran" in run mode; `Nodes` and + `Properties` panel toggles; Save, Version input, `+patch`, `Submit run` in + edit mode; `Edit current vX` and `Save as new workflow` in run mode. +- Edit mode is the current editor (SvelteFlow canvas, palette, properties) + restyled: palette as a tree with category counts and `in:out` port counts, + dotted canvas background, node cards with the glyph in the header, a + bottom-left zoom/fit/snap pill group, minimap bottom right. +- Run mode renders the run graph projection in an isolated read-only surface + (ADR-014): node glyphs from node status, the live wire in accent, failed + wires dashed danger, a legend top right, and the properties panel showing + values "as they were when the run started" plus an "In this run" section + with I/O and Diagnostics buttons. Entering run mode never touches the + editable graph store. +- If the selected run belongs to a different workflow than the one being + edited, a one-line note offers "Show as run" or keeps editing. +- Submit disabled reasons stay as today but render as the button's title and + a muted sentence under the toolbar, not a banner. + +### Node Editor (`NodeEditor` board) + +Node authoring has no backend in this build. Keep the capability represented +at its owning boundary: the page shows the built-in node definitions read-only +(list left with "Built-in" group, definition form centre with inputs/outputs +tables and an implementation block reading "built-in, source not editable", +live canvas preview and Checks right). Authoring controls (`New node`, `Add +input`, `Save draft`, `Publish to runtime`, `Try with sample inputs`) render +with `aria-disabled` and a title, and the page opens with the in-place notice +"Node authoring is not available in this build…" naming Settings as the place +where it would be enabled. Do not advertise saving or publishing as working. +The "Your nodes" group is omitted until a definition store exists. + +### Library (`Library` board) + +- Dimension line: "N models, X GB on disk, L loaded on devices, U unused for + 30 days (Y GB)". Omit facts the projection lacks. +- Left panel 400px: search + `Find on Hugging Face` toggle, kind segment + (All, Text, Image, Audio) when the model kind is known; groups "Loaded on a + device", "On disk, used this month", "On disk, unused 30 days"; rows with + two cache squares (accent = loaded on that device, grey = disk only), name, + family, usage sub-line, size and last-used on the right. Footer legend and + free disk space. +- Search mode replaces the list with Hugging Face results (mono repo id, + sub-line, size, Download button that reads "Queued" once requested) using + the existing search/download service calls. +- Right panel: title, pumas id, chips; `Use in a new graph` (disabled until + supported), `Open folder` (disabled until supported), two-step `Delete from + disk` blocked with a title while a run uses the model; sections "Where it + lives", "How it is used", "Workflows that use it" (table from usage + projection), "Source". + +### Sessions (new, `Sessions` board) + +Sessions are a new tab over existing authority only: + +- Active: the client sessions the attribution projection exposes (this GUI + window's session, CLI sessions) with their runs. If no service lists client + sessions, show only the current window's session derived from the run list + (runs whose client session matches) and record the gap in `issues.md`. +- Saved: the saved workflows (`list_workflows`) and orchestrations, each shown + as a session card with created/modified dates and the runs of that workflow + from the run list. +- Rows: glyph (running if any live run, succeeded if active and idle, idle if + saved), name, client tag, sub-line, a thin outcome strip (accent running, + grey succeeded, danger failed, hollow queued), run count and last activity. +- Detail: title, id, chips; Activity and "Runs from this session" key-value + sections with "Show in Scheduler" (switches tab and applies the session + filter); "Open in this session" list with Open graph buttons (loads the + saved workflow into Graph edit mode); "What resumes" sentence. +- Actions: `Rename`, `Save a copy`, `Close session`, `Resume`, `Delete` only + where a service exists. Others render `aria-disabled` with a title. Do not + invent persistence. + +### Settings + +Not redesigned in this effort. It must still look right under the new tokens: +remove its dependence on the old `bg-neutral-*` overrides and use the shared +`Panel`, `KeyValue` and field styles for its existing sections. + +## Accessibility contract (selected for this change) + +Supported users operate the desktop app with pointer and keyboard; screen +reader semantics are preserved through native elements. Every control is a +`button`, `a`, `input`, `select` or `textarea` with a visible or hidden name. +Lists of selectable rows are buttons with `aria-current`. Toggles use +`aria-pressed`, disclosure uses `aria-expanded`, the picker popover is a +`role="dialog"` with a label, the log is `role="log"`. Decorative glyphs are +`aria-hidden` and the status is also in text. Focus is visible (accent +outline) and never depends on colour alone. `scripts/check-svelte-a11y.mjs` +must pass on every changed file. + +## Evidence + +- Deterministic: presenter and store tests under `src/**/*.test.ts` + (`npm run test:frontend`), `npm run typecheck`, `npm run lint:a11y`, + `npm run lint:critical`, `npx eslint --max-warnings 0`. +- Representative browser: `npx vite build` then a headless Chromium walkthrough + with `docs/design/mockups/viewer/cdp.js` against the built site, capturing a + screenshot per page with mocked services where a live engine is absent. +- Real desktop: `npm run dev:desktop` by the owner, checking each tab with the + local engine running. Recorded as manual evidence in the ledger. diff --git a/docs/plans/README.md b/docs/plans/README.md index 52c0d3a42..1e6a37851 100644 --- a/docs/plans/README.md +++ b/docs/plans/README.md @@ -6,6 +6,7 @@ | [CPU scheduler completion and fair progress](cpu-scheduler/plan.md) | User-authorized CPU scheduler policy rollout; independently reviewed opt-in stages, with GPU/split and remote work deferred. | | [Domain architecture and multimodal workflows (main)](domain-architecture-and-multimodal/plan.md) | Active authority for current-standards review, domain ownership and real text/image workflows; milestone evidence and current model routing live in the plan. | | [Domain architecture and multimodal workflows (RPC branch)](domain-architecture-and-multimodal/plan.md) | Active; library-only Pumas RPC from an isolated pinned artifact, Pantograph-owned T/I/E inference, real desktop acceptance and current Coding-Standards MCP remediation. Revision 2 includes the current agent and baseline-selection policy. | +| [Workbench redesign](workbench-redesign/plan.md) | Active; replace the workbench GUI with the approved calm redesign (top tabs, shared run-context picker, eight redesigned tabs including a new Sessions tab) over existing projections. Independent write set from the RPC plan. | | [Current-standards remediation (main)](current-standards-remediation/plan.md) | Superseded; audit findings and unresolved claims transfer to the active plan. | | [Image-generation workflow (main)](current-image-generation-graphs/plan.md) | Superseded; the real editor-to-artifact objective transfers to the active mixed-workflow plan. | | [Documentation consolidation (main)](documentation-consolidation/plan.md) | Accepted cleanup and migration record. | diff --git a/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser-combined.log.gz b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser-combined.log.gz new file mode 100644 index 000000000..a137fef0c Binary files /dev/null and b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser-combined.log.gz differ diff --git a/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser-refresh.log.gz b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser-refresh.log.gz new file mode 100644 index 000000000..391ed64af Binary files /dev/null and b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser-refresh.log.gz differ diff --git a/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser.log.gz b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser.log.gz new file mode 100644 index 000000000..07f9f0f90 Binary files /dev/null and b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/browser.log.gz differ diff --git a/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/catalog-refresh-red.log.gz b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/catalog-refresh-red.log.gz new file mode 100644 index 000000000..2629229d6 Binary files /dev/null and b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/catalog-refresh-red.log.gz differ diff --git a/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/ci-discovery.log.gz b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/ci-discovery.log.gz new file mode 100644 index 000000000..f81bcbc8b Binary files /dev/null and b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/ci-discovery.log.gz differ diff --git a/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/native-unavailable.log.gz b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/native-unavailable.log.gz new file mode 100644 index 000000000..3080c4fbb Binary files /dev/null and b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/native-unavailable.log.gz differ diff --git a/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/qualification.json b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/qualification.json new file mode 100644 index 000000000..51fb69cfd --- /dev/null +++ b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/qualification.json @@ -0,0 +1,78 @@ +{ + "base": "46aad5841ca8f2185e639da44f73474af045bc13", + "environment": { + "os": "Linux x86_64", + "rust": "1.92.0", + "node": "24.12.0", + "chromium": "Chromium 151.0.7922.173 built on Debian GNU/Linux 13 (trixie)", + "mode": "headless; disposable profile/store; GPU disabled; container verification no-sandbox only", + "application_styles": true + }, + "claims": { + "browser_user_workflow": "passed on combined source: actual styled NodeLab -> loopback -> rebuilt Rust service -> filesystem create/edit/save/reopen; keyboard/pointer and focus; exact pin retained; missing implementation blocking; failed catalog refresh/recovery preserves draft/path. Latest receipt browser-combined.log.gz", + "service_tests": "1084 library +65 integration passed, zero failures/ignored; both custom-node and pure-loop suites included", + "frontend_tests": "740 passed, zero failures/ignored; 10 focused decoding/controller/presenter tests included", + "native_tauri": "unavailable: cargo check --locked -p pantograph --bin pantograph --no-default-features fails at glib-sys: missing glib-2.0.pc; pkg-config also lacks GTK/WebKit; no native startup claim", + "not_claimed": [ + "installed custom nodes in default desktop", + "arbitrary code loading", + "trained model T3", + "GPU", + "inference-backed/effectful tool loops", + "release qualification" + ], + "catalog_refresh": "focused red on 802544a0, green after repair; same mounted combined-source browser flow removes stale choices and preserves draft and saved path", + "hosted_test_discovery": "local exact CI commands discovered and passed 15 tool_loop tests and 10 workflow::tests::custom_nodes:: tests; original loop gate unchanged" + }, + "source_sha256": { + "crates/pantograph-workflow-service/examples/nodelab_host.rs": "1c9a33092e0bac9560247b8c1e158bc0405527cad7b0a280d79dc61334eed8c8", + "crates/pantograph-workflow-service/src/custom_nodes.rs": "93b016626ce454091fe6092807442184556f90b6f4ae65125af9c12a1e9c52aa", + "crates/pantograph-workflow-service/src/custom_nodes/authoring.rs": "ab2e37ca4a68b846e8f23897891eea064730a1376c8597eb5ce00e1bf5f909ed", + "crates/pantograph-workflow-service/src/graph/connection_insert.rs": "881afe99675e681a2bd1208f69e55f82afa881adec9ead9a6863089dd3a6f2af", + "crates/pantograph-workflow-service/src/graph/connection_intent.rs": "d5832d05d88dd0d2dc10cb367038a0a6d5973e1275fe19e888fb411c13057199", + "crates/pantograph-workflow-service/src/graph/session.rs": "e9248df745093b0ff078691a04036017fed894bdd073d922b0f628920a1efcac", + "crates/pantograph-workflow-service/src/graph/session_connection_api.rs": "f29f061031b4c70f829cfbd603108857ed7d093245ae3cdeb8d63797b9c5fefe", + "crates/pantograph-workflow-service/src/graph/session_contract.rs": "844733c80c5f5a372844637a104e901b9cd46433e1ef73662ff314f4b8e134b0", + "crates/pantograph-workflow-service/src/graph/session_node_api.rs": "61505593be43e6bc58e9c9c8f1b991cfd75949a55da8351278ca45a25015ecd3", + "crates/pantograph-workflow-service/src/graph/session_state.rs": "c19150bbf4b61dd506ad6bb618593c40f59a8fde43f554025eb940e8c75b1d17", + "crates/pantograph-workflow-service/src/workflow.rs": "47e42061802abc91ebe6b3babf8c578116d2e0fecf51d86fa53148cbed613886", + "crates/pantograph-workflow-service/src/workflow/custom_node_authoring_api.rs": "5bf54f01b2db4ec2ffc21b6af41291c695ff91a3b274deb80838c32020b9941d", + "crates/pantograph-workflow-service/src/workflow/service_config.rs": "257edc58a50b37e8dee265b971e91084b0f77b0ce4031f8d105b604f33cea513", + "crates/pantograph-workflow-service/src/workflow/tests/custom_nodes.rs": "39ea2a0a726a4a93e6199f6cf72d22914db7d43e4edc8d750178acc5084c55ec", + "scripts/README.md": "a1b99bbc7b161a5842b49b4a97e08c8042121a2b034848c35c53e22e3dbd881c", + "scripts/check-nodelab-browser.mjs": "82f884c2fb04394168c06ba09b0432345aad059e67bc54efdc281a759b68c88f", + "src-tauri/src/app_setup.rs": "b14c996956638c5a708156aaf8f110ce6f1fa3a175f6b03bb9ff0284bd392a50", + "src-tauri/src/workflow/commands.rs": "24834569833ec6509300b9c8c795b9eb8be233f0c6d9c37c5d67f82b63d24b6c", + "src/components/workbench/NodeLabPage.svelte": "ab23063b86e78e3dc919602df48d027f0e736bee678b8e5609eedc41d0da25d2", + "src/components/workbench/nodeLabController.ts": "0389ac2397e253926162195a1b41bddf1e07568f65afd568e1673b4fe44c0d1f", + "src/components/workbench/nodeLabPresenters.test.ts": "5debffcdba6ddc86d4b4093dceb08dbf691b7659b73a483abd8d991616faa02e", + "src/components/workbench/nodeLabPresenters.ts": "4792bedc18bf6b55173a892e0f15bc7900b4c36fd84bfc508da3dac9c0bbb075", + "src/services/workflow/customNodeAuthoring.test.ts": "97aa21f8487984832d03efac4f81d694b214ed065087099aca4a9b87433083dd", + "src/services/workflow/customNodeAuthoring.ts": "f4a11c2fa37816819db79176b2af584199c946a5e3c533482cc595362092dc08", + ".github/workflows/quality-gates.yml": "030e50d32426e0abaa17990e683e67a29b9cdb704a2a146908c78817e5369d2f", + "crates/pantograph-workflow-service/src/graph/registry.rs": "ad7cfd660e85e264a0c8f9e2ddd78fa3d4fd3074ee2275a13ee33c3f998434c7", + "crates/pantograph-workflow-service/src/tool_loops.rs": "3dee015aefb679de08564a02ed4175d902c9836c520c1b0de072cc5a036aaa09", + "crates/pantograph-workflow-service/src/scheduler/tool_loop.rs": "3af80db2ce8f4a621e2e1778e1c4dede603068fc12457c8a550d752d9a0bf362" + }, + "evidence_sha256": { + "browser.log.gz": "6c2a15df9371220e78251fd39f27631010da2e63d41f45843e9c9dba0c3bc97e", + "native-unavailable.log.gz": "f72bc764c185d785964c3ac95e9a0d6f24a1d999aefbd349dc143eed28d261b3", + "catalog-refresh-red.log.gz": "c849e1ead56e2b00b0f7fc3c7e04a4cf867a99fe176476aa9b0d9658613bf720", + "browser-refresh.log.gz": "2ddc4d6339e12a6c43cff584156c871b94352780d060b6ee4aa49495975884e2", + "browser-combined.log.gz": "a8ef7d653ecfa27ad28d01cf055ee112c4c83b03ee1d3b251e25671b37e7d598", + "service-combined.log.gz": "6cd931f20b55b2fc5bfd846b74e7ac0dfbcd4d61e4d175da0228192ec7374029", + "ci-discovery.log.gz": "272c0cad07fac982061e125acd110df89918e2147a478a2f30b9051fed19223a" + }, + "integrated_dependency": { + "pull_request": 94, + "head": "fcb2d7f618f32000ed1992569d7eabf3c77cf873", + "merge": "46aad5841ca8f2185e639da44f73474af045bc13", + "production_loop_core": "unchanged from merged main; NodeLab consumes the same immutable registry without authoring loop grants" + }, + "historical_evidence": { + "browser.log.gz": "802544a0ed5f523d2ce7a54f7859b8ed0187e63f; initial styled flow", + "browser-refresh.log.gz": "ff4e4de05d884f05338e70745db2400df0134926; refresh repair", + "catalog-refresh-red.log.gz": "regression failed on 802544a0 before repair", + "native-unavailable.log.gz": "original missing-GLib failure; retained unchanged" + } +} diff --git a/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/service-combined.log.gz b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/service-combined.log.gz new file mode 100644 index 000000000..ca5b09ba3 Binary files /dev/null and b/docs/plans/domain-architecture-and-multimodal/evidence/nodelab-authoring/service-combined.log.gz differ diff --git a/docs/plans/domain-architecture-and-multimodal/execution-ledger.md b/docs/plans/domain-architecture-and-multimodal/execution-ledger.md index ddfdda678..d1c921cc3 100644 --- a/docs/plans/domain-architecture-and-multimodal/execution-ledger.md +++ b/docs/plans/domain-architecture-and-multimodal/execution-ledger.md @@ -1365,3 +1365,93 @@ Accepted stop-string/PR60 and all seed/precision/repair/paused histories remain separate. Controlled package/readiness/dispatch/session facts and untrained CPU models do not qualify live Pumas, pretrained quality, GPU, desktop or native batching/throughput. Full plan acceptance and parent publication remain separate. + +## 2026-10-22 — NodeLab trusted-node authoring + +Continued the admitted CN-02 slice on main `285c4898` after CN-01/README merges. +The [consumer contract](../../custom-nodes.md#nodelab-graph-authoring) owns the +read-only versioned catalog, exact-selection server-built drafts, shared edit +registry, pin-preserving mutations and saved/reopened behavior. Default desktop +has no custom registrations; the separate real Rust qualification host supplies +one compiled pure transform. No code loader, execution UI or tool grant is added. +Independent GPT-6.1 Sol High review accepted after repairing failed replacement +loss, explicit-null diagnostic decoding and close-failure ownership/recovery. + +[Qualification](evidence/nodelab-authoring/qualification.json) retains source +bindings, actual Chromium→Rust→filesystem user-workflow evidence and the native +failure. Service tests pass 1,068 library +65 integration, zero failures/ignored; +740 frontend tests pass including ten focused parser/controller/presenter cases. +Formatting, typecheck, production frontend build, lint, critical/a11y gates, +scheduler-only guard and traceability tests pass. All-target package Clippy +retains only the existing inference dead-field warning. Initial new fixtures used +an unexported provider and a nonexistent response field; corrected against the +actual owning APIs, preserving the assertions. The first browser Enter simulation +omitted character text and did not activate the button; proper CDP key events +then passed the same workflow assertions, with no pointer fallback for that gate. +Full lint required keys on stateless diagnostic rows; repaired. Final browser +evidence loads the actual application stylesheet and checks nonzero focus outline. + +Native `cargo check --locked -p pantograph --bin pantograph --no-default-features` +is unavailable at glib-sys because this environment lacks `glib-2.0.pc`; GTK and +WebKit development packages are also absent. No native/desktop startup claim or +persistent access change is made. PR92 `afe33029` remains open with its unique +trained-text source/evidence and missing T3 gate unchanged. CN-03 PR94 integrates +first by parent instruction; CN-02 must then reconcile current main, preserve its +registry/loop validations, rerun combined affected tests and pass exact-head CI +before merge. The local/remote feature branch and worktree are retained pending +that disposition, with source and evidence preserved. + +While dependency integration was pending, a reachable catalog-refresh failure +left earlier Create choices visible. The focused regression failed on `802544a0` +and passes after clearing/publishing the catalog before transport; authored draft +and saved path remain unchanged. The same mounted real-browser flow passes +failed refresh and recovery. Its first probe inspected old-session closure before +Reopen completed; bounded observation now waits for replacement completion and +retains the original closure assertion. Original browser/native receipts remain; +the qualification manifest binds the repaired source and additional receipts. +No backend, scheduler or audit behavior changed. This repair remains local until +the required PR94 integration/current-main qualification. + +Hosted PR95 source/build/native-IPC checks passed on `802544a0`; the required +audit failed with an actual advisory-bulk HTTP 503. PR94 was likewise blocked +on audit service failures at that stage. No audit retries or gate changes were requested here. +Local native provisioning inspection stopped when `apt-cache policy` was denied +reading `/etc/apt/apt.conf.d/80-applied-apt-retries`; no package installation or +privileged retry was attempted. This does not qualify native startup/interaction. + + +## 2026-10-22 — Serial CN-02/CN-03 reconciliation + +PR94 passed its required exact-head checks and merged as `46aad584`. A normal +merge (`0acae31f`) incorporates that current main into the retained NodeLab branch; +only plan/issue conflicts required resolution, preserving both admitted slices. +CN-03 production registry/loop/scheduler code remains unchanged. The NodeLab +[handoff](../../custom-nodes.md#nodelab-graph-authoring) distinguishes individual +CN-01 authoring from future host-pinned loop-template authoring: no UI tool grants, +optional loop ports or second execution route are introduced. + +The combined edit-session regression saves/reopens an exact loop pin, accepts its +admitted catalog, preserves it with blocking diagnostics under changed/missing +catalogs, and refuses invalid new pins without snapshot/revision mutation or +callback invocation. Hosted coverage now explicitly discovers/runs all ten +custom-node workflow tests. The new regression is named outside the existing +`tool_loop` substring filter; that original fifteen-test discovery/execution gate +is unchanged. Local exact commands discover and pass both 15 and 10 tests. + +The [combined qualification](evidence/nodelab-authoring/qualification.json) binds +28 source files and retains seven receipts, including fresh 1,084 library +65 +integration tests (1,149 total, zero failed/ignored), both CI discovery/run filters +and styled Chromium → rebuilt Rust host → filesystem interaction. All eight +browser claims pass, including failed catalog refresh/recovery without losing +saved draft/path. The final frontend suite passes 740 tests; formatting, +typecheck, full/critical/a11y lint, production frontend build, scheduler-only guard +and 28 traceability tests pass. Original browser, refresh-red and missing-GLib +receipts remain preserved. Final package all-target Clippy passes with only the +existing inference dead-field warning. Local native startup/interaction remains unqualified; +the recorded APT read denial was not retried or bypassed. + +At this qualification stage, PR94 post-merge workflows and PR95 final independent +review/fresh exact-head CI/current-main rechecks still gate normal integration. +No old-head audit retry, dependency suppression, lockfile change, text-readiness +edit or branch deletion was performed. PR92's unique trained-text source/evidence +and missing T3 gate remain separate. diff --git a/docs/plans/domain-architecture-and-multimodal/issues.md b/docs/plans/domain-architecture-and-multimodal/issues.md index 0f1cbbcf6..bfe3e078d 100644 --- a/docs/plans/domain-architecture-and-multimodal/issues.md +++ b/docs/plans/domain-architecture-and-multimodal/issues.md @@ -481,5 +481,5 @@ authorize the historical resident-accounting next-slice text. | ID | Issue | Owner | Disposition / next evidence | | --- | --- | --- | --- | | CN-01 | Palette/callback registration does not establish canonical executable admission or implementation/environment identity. | Custom-node lead | Closed for the bounded trusted string adapter after independent GPT-6.1 Sol High review and 1,129 passing service tests. Exact admission, saved/reopened scheduler execution, cancellation/commit arbitration and inspection share the immutable catalog. Arbitrary executable loading remains outside this contract. | -| CN-02 | NodeLab authoring, Local Agent and runtime publishing remain unavailable. | NodeLab follow-on | Deferred. Consume the [custom-node contract](../../custom-nodes.md): host-authorized registrations and exact graph pins, same registry for edit-session validation/connection previews, trust/version/unavailable outcomes. Untrusted package publishing additionally needs independently admitted artifact verification and isolation. A palette entry cannot enable execution. | +| CN-02 | NodeLab graph authoring requires the same admission identity and registry as execution. | NodeLab lead | Implemented, verifying: service-owned exact-selection draft creation, NodeLab source editing/save/reopen, shared edit registry and blocking stale/unavailable diagnostics. Default desktop is honestly empty; nonempty host-composed browser flow is qualified separately. Local Agent/code publishing, generic name-only custom insertion and arbitrary loading remain unsupported. See [contract](../../custom-nodes.md#nodelab-graph-authoring). | | CN-03 | Scheduler-managed tool-loop exposure needs explicit authority and bounded progress. | Tool-loop owner | Verifying the [pure-controller slice](../../tool-loops.md): exact CN-01 identities plus separate host pure-tool grants, bounded serial turns, scheduler attempt/cancellation/commit ownership and saved/reopened execution. Independent review and exact-head CI gate serial CN-02 integration. Inference-backed turns and side effects remain deferred pending runtime resource admission and effect/idempotency contracts. No static loop restoration. | diff --git a/docs/plans/domain-architecture-and-multimodal/plan.md b/docs/plans/domain-architecture-and-multimodal/plan.md index cd4776ed2..2f3423aff 100644 --- a/docs/plans/domain-architecture-and-multimodal/plan.md +++ b/docs/plans/domain-architecture-and-multimodal/plan.md @@ -326,6 +326,78 @@ Development Proportionality, Commit, Documentation, Architecture/Code Design, Contracts, Security, Concurrency/Resilience and Library/Rust API/Async guidance. The rest of this plan retains its historical standards baseline. +## Admitted NodeLab/edit-session slice (2026-10-22) + +**Admission:** `continue` this Active plan under the delegated unfinished-path +instruction. CN-01 is integrated in `2e517f58`, README PR79 in current main +`285c4898`. Independent GPT-6.1 Sol High design review admits a bounded NodeLab +graph-authoring surface before implementation. This does not author or install +executable code. PR92's unique trained-text source/evidence and missing T3 gate +remain separate and protected; CN-03 has its own worker and integration gate. + +**Outcome and contract:** NodeLab reads a versioned service-owned projection of +host-admitted custom definitions and complete identities. The default desktop +catalog is honestly empty; a composed host supplies nonempty registrations. +Selecting an admitted node creates a separate edit-session draft with one text +source per required input and one text sink per output, derived from host ports. +Users edit source values, inspect backend diagnostics, save and reopen through +existing graph APIs. Saved pins are never silently refreshed. Missing/stale +implementations remain visible and blocking; recovery requires explicit new +authoring. No direct edit-session execution, Local Agent, runtime publishing, +arbitrary loader, new capability grant or static tool loop is enabled. + +The draft is constructed by the service from the exact selected identity, not +from a client-supplied custom definition. The same immutable registry must reach +graph-session construction, provider +builders, canonicalization, response diagnostics and connection candidate/commit +validation. Add requires the exact selected identity; custom data patches cannot +change identity or add dynamic definitions. Imported invalid graphs remain +inspectable without healing. Name-only custom insert-on-edge/insert-and-connect +is explicitly unsupported; use pinned add plus explicit connections. The +legacy generic palette stays built-in-only. CN-03 consumes saved graph pins and +CN-01 scheduler invocation, not NodeLab state or a second execution route. + +**Composition and write set:** registry/catalog owns admitted facts; graph +sessions own authored state, undo and validation; NodeLab owns local interaction +and observes service responses; existing store owns persistence. Stable +interfaces are the versioned read projection and existing pinned graph/mutation +contracts. This avoids duplicating admission or execution in the frontend. +Change service `custom_nodes`, `graph`, graph API/config and related tests; +NodeLab presenters/controller/page and narrow workflow transport projections; +desktop command wiring; a bounded real-host example/browser probe and affected +documentation. No scheduler-loop core, text runtime/readiness, root README or +PR92 edits. Branch `feat/nodelab-trusted-catalog`, worktree +`/workspace/pantograph-nodelab`, base `285c4898`, target `main`. Preserve source, +branches and evidence; parent coordinates serial integration if CN-03 intersects. + +**Acceptance:** focused admission/edit-session refusal tests, real save/reopen +and connection candidate/commit tests, provider-builder registry retention, +frontend decoder/lifecycle tests, and real-browser pointer/keyboard draft → +edit → save → reopen interaction through an injected Rust host. Browser evidence +does not qualify native Tauri startup. Native compile/smoke is attempted only +where available and its actual limits recorded. Required CI, independent source +review and current-main recheck precede merge under the later cleanup authority; +no gate waiver, evidence-weakening rerun or persistent access expansion. Status +`Verifying`; next slice complete independent review, current-main/CI gates and +serial integration. Failed replacement preserves the current draft; failed close +transfers exact session IDs to an app-scoped, user-retryable cleanup owner. Standards baseline `0fc92a2` +continues, adding routed Frontend, TypeScript/Async, Accessibility, IPC, +Persistence, protocol/evolution and GUI verification detail to the CN-01 routes. + +**Serial reconciliation (2026-10-22):** CN-03 PR94 is integrated as `46aad584`. +Continue CN-02 on that current-main base with the same production contract. +Preserve both admitted slices and CN-03 source unchanged. Add one edit-session +integration regression for a saved/reopened exact loop pin: its admitted catalog +accepts it, changed/missing catalogs retain it with blocking diagnostics, and an +invalid new pin is rejected without mutation. This tests the shared-registry +handoff rather than adding loop authoring or execution. Rerun both service suites, +frontend/static gates and the real-host browser flow; bind fresh combined-source +evidence, obtain independent review, then pass fresh exact-head CI and current-main +rechecks. PR94 post-merge CI must also pass before PR95 merges normally. +Add explicit hosted discovery/execution of all ten custom-node service tests; +keep CN-03's existing fifteen-test loop gate unchanged and name the new +edit-session regression outside that substring filter. + ## Admitted CN-03 pure tool-loop slice (2026-10-22) **Authority and status:** The user authorized unfinished Pantograph paths and diff --git a/docs/plans/workbench-redesign/execution-ledger.md b/docs/plans/workbench-redesign/execution-ledger.md new file mode 100644 index 000000000..f0e9f1ed4 --- /dev/null +++ b/docs/plans/workbench-redesign/execution-ledger.md @@ -0,0 +1,471 @@ +# Execution ledger: workbench redesign + +Dated slice, verification, deviation and commit summaries. The plan owns +current state; this file owns history. + +## 2026-11-03 + +- Planning: mockups (rounds 1–3) reviewed with the owner on the Design canvas + and locally; direction E approved for every tab; run-context picker, + clipboard shortcuts and Graph run/edit modes added at the owner's request. + Mockup sources copied to `docs/design/mockups/`; spec written at + `docs/design/workbench-redesign-spec.md`; branch `feat/workbench-redesign` + created from `019caf4aa`. +- Standards: Coding-Standards checkout `5bce3110`; task facts routed through the + Standards Engine CLI (application purpose), snapshot + `snapshot:v1:58a8cb6f-8bc1-4f8b-9f84-caa364b3df2b`; closure recorded in the plan. +- M0 started: delegated to an Opus 5.5 agent with the write set in the plan. + +### M0 Foundation: implemented, verified, uncommitted (2026-11-03) + +What changed: + +- Tokens and base styles: `src/styles.css` now defines the spec palette as + `--pg-*` on `:root`, plus a few derived values taken from the mockup CSS + (`--pg-ink`, `--pg-text-quiet`, `--pg-text-code`, `--pg-border-idle`, + `--pg-border-danger`, `--pg-rule-log`, scrollbar thumbs). Body background is + `var(--pg-ground)` with the Atkinson Hyperlegible stack at 14px/1.45; themed + thin scrollbars and a 2px accent `:focus-visible` outline apply globally. + The `!important` neutral overrides and the radial-gradient body hacks are + deleted; one `!important` block for package graph components remains + (WR-008). The mockup primitives are ported value for value as `pg-*` + classes in `@layer components`. +- `tailwind.config.cjs`: `pg` colours keyed to the variables, font families + (serif Newsreader, sans Atkinson Hyperlegible, mono JetBrains Mono), and the + `neutral` scale retuned to the same greys (950 ground, 900 panel) so pages + not yet restyled sit on the new palette without overrides. +- `index.html`: title "Pantograph", `bg-neutral-950` body class removed. +- Dependency decision (fonts): requirement is offline-safe bundled fonts for + the desktop app. Installed `@fontsource/newsreader@5.3.0`, + `@fontsource/atkinson-hyperlegible@5.3.0`, `@fontsource/jetbrains-mono@5.3.0` + (all SIL OFL 1.1, `license: OFL-1.1` in the lockfile), nothing else + installed or upgraded (one lockfile `peer` flag npm dropped on an unrelated + entry was restored). Consumer: `@import` of weights 400/500 (Newsreader, + JetBrains Mono) and 400/700 (Atkinson) at the top of `src/styles.css`. + Verification: `vite build` emits 18 woff2 files plus woff fallbacks under + `dist/assets/` and the CSS references them. The first `npm install` timed + out (ETIMEDOUT); a retry with longer fetch timeouts succeeded, so WR-003 is + not the font fallback and system stacks are only the in-stack fallback. +- Shell: `WorkbenchShell.svelte` rewritten: brand word, three tab groups with + dividers (Sessions | Scheduler, Diagnostics, I/O Inspector, Network | Graph, + Node Editor, Library), run-context picker, engine line, Settings pinned + right, Assistant toggle (`aria-pressed`, drives the existing side panel via + `toggleSidePanel`). The header and pages pad right by `$panelWidth` so the + Assistant panel never covers them. Engine line reads the run-list query: + `transport_error` shows "Engine unreachable since HH:MM, showing last + projection" (or "nothing loaded yet") with Retry, and the page area dims to + 72%. Icon rail and "Active Run" label removed. `data-testid` + `workbench-nav-` kept for the e2e suite. +- Store: `workbenchStore.ts` gains `sessions` (first) and a `group` per page, + `WORKBENCH_TAB_GROUPS`, `workbenchPagesInGroup`; Scheduler stays default. + `SessionsPage.svelte` placeholder renders EmptyState "Sessions are coming in + Milestone 8." +- Run-context picker in `src/components/workbench/shell/`: `RunContextPicker.svelte`, + pure helpers `runContextPicker.ts`, run-list source `runContextRunList.ts` + (generation token; outcomes applied, failed, unreachable, superseded, + detached), clipboard controller `runContextClipboard.ts` (one delegated + `pointerover`, `pointerout` and `keydown` listener on `document`; second + attach throws; stale paste reads classified superseded), shared actions in + `runContextStore.ts` (`openRunContextPicker`, `closeRunContextPicker`, + `selectRunContext`, `clearRunContext`, `refreshRunContextRunList`, + `runContextRunList`, `runContextLiveUpdates`). Run list from + `workflowService.queryRunList({ limit: 250 })` only. +- Shared parts in `src/components/workbench/ui/` (exported from `index.ts`): + StatusGlyph (+ `statusGlyph.ts`), DimensionLine, Panel, GroupHeader, ListRow, + SegmentedControl, Chip, FilterChip, DeviceLanes, KeyValue, LogLine, ErrorCard, + TwoStepButton, EmptyState, Toast, plus `types.ts`. +- READMEs with the hook's headings: `src/components/workbench/`, `shell/`, + `ui/`, and (outside the literal write set, under WR-001, see WR-003) + `src/README.md` and `src/stores/README.md`. + +Verification (run from the repo root, all on the final tree): + +- `npm run typecheck`: pass. +- `npm run test:frontend`: pass, 574 tests, 0 failures (new: 5 glyph, 10 + picker helper, 7 run-list source, 8 clipboard, 2 store tests). +- `npx eslint --max-warnings 0` on every changed .ts/.svelte file and + `tailwind.config.cjs`: pass. +- `npm run lint:a11y`: fails only on pre-existing items in untouched files + (`IoInspectorPage.svelte:1024`, `RunGraphSnapshot.svelte:156`, + `SavedGraphInspectionSnapshot.svelte:77`); no finding in M0 files (WR-007). +- `npm run lint:critical`: fails only on pre-existing + `IoInspectorPage.svelte:508:20` `no-append-remove-child` (WR-007). +- `TRACEABILITY_BASE_REF=codex/pantograph-rpc-workflow-2026-09-26 ./scripts/check-decision-traceability.sh`: + exit 0, "No changed files detected" (HEAD equals the base; nothing is + committed). A scratch copy that reads the working-tree change list passes + "Decision traceability check passed."; the same copy without + `src/README.md` in the list fails as expected (WR-003). +- `npx vite build --outDir /tmp/claude-1000/-media-jeremy-OrangeCream-Linux-Software-repos-owned-ai-systems-Pantograph/26f5ffd8-b094-44e6-bf07-1b07d5fc8def/scratchpad/m0/dist`: pass, no Svelte warnings. +- Headless screenshots of the built app (1440x900): + `/tmp/claude-1000/-media-jeremy-OrangeCream-Linux-Software-repos-owned-ai-systems-Pantograph/26f5ffd8-b094-44e6-bf07-1b07d5fc8def/scratchpad/m0/shell.png` (plain browser: engine unreachable, Scheduler shows its + existing transport error), and with a scratch Tauri stand-in that answers + only `workflow_run_list_query`: `/tmp/claude-1000/-media-jeremy-OrangeCream-Linux-Software-repos-owned-ai-systems-Pantograph/26f5ffd8-b094-44e6-bf07-1b07d5fc8def/scratchpad/m0/picker-open.png`, + `/tmp/claude-1000/-media-jeremy-OrangeCream-Linux-Software-repos-owned-ai-systems-Pantograph/26f5ffd8-b094-44e6-bf07-1b07d5fc8def/scratchpad/m0/picker-copied.png`, `/tmp/claude-1000/-media-jeremy-OrangeCream-Linux-Software-repos-owned-ai-systems-Pantograph/26f5ffd8-b094-44e6-bf07-1b07d5fc8def/scratchpad/m0/chip-selected.png`, `/tmp/claude-1000/-media-jeremy-OrangeCream-Linux-Software-repos-owned-ai-systems-Pantograph/26f5ffd8-b094-44e6-bf07-1b07d5fc8def/scratchpad/m0/picker-unknown.png`, + `/tmp/claude-1000/-media-jeremy-OrangeCream-Linux-Software-repos-owned-ai-systems-Pantograph/26f5ffd8-b094-44e6-bf07-1b07d5fc8def/scratchpad/m0/sessions.png`, `/tmp/claude-1000/-media-jeremy-OrangeCream-Linux-Software-repos-owned-ai-systems-Pantograph/26f5ffd8-b094-44e6-bf07-1b07d5fc8def/scratchpad/m0/diagnostics.png`. +- CDP walkthrough results: focus moves to the search field on open; groups + Running 2, Queued 3, Finished today 2; Ctrl+C over a hovered row copied the + id (headless denied the system clipboard, so the in-window fallback and its + toast were used, WR-010); Escape closed and returned focus to the chip; + Ctrl+V over the chip selected the copied run; `×` cleared it and focus + stayed on the chip; an unknown `run_` id showed "No run with id … in recent + history."; typing an exact id selected it and closed the popover; an outside + click closed it. + +Deviations and findings: WR-003 to WR-010 in `issues.md`. Device memory is +absent from the local network status projection (WR-006), so the plan's lanes +assumption resolves to its stop condition. +- M0 accepted by the integration owner after reviewing the shell and picker + screenshots; WR-003 READMEs kept and added to the write set; WR-009 + deviations accepted. Walkthrough tooling moved to `reports/tools/`. +- M1–M8 started in parallel (one Opus 5.5 agent per page, distinct scratch + directories, ports 8791–8798, CDP ports 9341–9348). Agents write + `reports/m-.md`; the integration owner merges them here. + +## 2026-11-03, page milestones (merged from reports/m*.md) + +### M1 Scheduler (report: reports/m1-scheduler.md) + +- M1 Scheduler implemented (Opus 5.5 agent, 2026-11-03). The Scheduler is rebuilt on the `Revised` board with the shared parts. It reads the shell's `runContextRunList` as its only run-list source and no longer queries `workflow_run_list_query` (WR-005). Grouping comes from the picker helpers, with no memory-wait group and delayed runs under Queued (WR-004). The device strip shows one muted sentence behind the `showLanes` preference (WR-006). +- The 14 filter selects moved into the Filters disclosure with applied-filter chips. The status segment and search stay outside it. +- Every action is still reachable: Move to front, Priority/Set and two-step Cancel run in the footer; Resume and GUI admin (two-step Admin cancel, Front, Priority/Set) under More actions. Each has its existing guard, and a disabled control has a title explaining why. +- Gates: typecheck pass; test:frontend 685/685; lint:a11y pass; lint:critical pass; eslint pass on the changed files; vite build pass. The traceability hook says "No changed files" (WR-003). A scratch copy run on the M1 file list needs the `src/components/workbench/README.md` and `src/stores/README.md` updates listed in the M1 report. +- CDP walkthrough with `fixture-scheduler.js`: one run-list query with Scheduler open, selection follows the chip, cancel arms then confirms, 14 disclosure selects, the page does not scroll. Screenshots are in `scratchpad/m1/`. + +### M2 Diagnostics (report: reports/m2-diagnostics.md) + +> **2026-11-03, M2 Diagnostics (Opus 5.5 agent).** +> +> `DiagnosticsPage.svelte` now follows the `Diagnostics` board, built from the shared parts: +> +> - `DimensionLine`, a 300px `Panel` "Run facts", `Chip`, `KeyValue`, `GroupHeader`, `FilterChip`, `SegmentedControl`, `ErrorCard`, `LogLine` and `EmptyState`. +> - Timing, Placement, Retention, More facts and Projection key-value blocks hold all 27 run-detail facts and all 5 projection cursors. +> - The six execution selects and the 14 comparison selects plus 2 date inputs moved into `Filters` disclosures with applied-filter chips and quick presets. +> - Node errors are log lines with the failed glyph. A compact table lists only node errors that are missing from the timeline. +> - The ErrorCard explanation and "Try:" advice come from `explainDiagnosticsError`: a known-code table with a neutral fallback that restates the message. +> - The `diagnosticsFocus` deep link switches the level filter, selects the line and scrolls it into view, once per request. +> - Transport and subscription failures are muted sentences inside the panel. +> - Service calls are unchanged, and there are no ledger reads. +> +> Gates: +> +> - typecheck, 685/685 frontend tests, lint:a11y, lint:critical, eslint on the 3 files and vite build all pass. +> - Traceability passes with `src/components/workbench/README.md` in the same change. +> - Headless CDP walkthrough with `reports/tools/fixture-diagnostics.js`. Screenshots in the M2 scratch directory: empty, failed, show-in-log, filters, more facts, nodes, running, unavailable. + +### M3 I/O Inspector (report: reports/m3-io-inspector.md) + +### M3 I/O Inspector: implemented, verified, uncommitted (2026-11-03) + +- **Board:** `IoInspectorPage.svelte` is rebuilt to the IoInspector board. + - Dimension line with run id, node and artifact counts, kept bytes and projection freshness (`data-run-id`). + - A 340px node and port tree built from the run snapshot nodes, node statuses and resolved node I/O joined with the artifact projection. Artifacts with no resolved row fall back to producer/consumer metadata, and node-less artifacts go under a "Workflow boundary" group. + - Direction segment, search, a Filters disclosure holding the Backend filter, and retention chips. + - A one-artifact detail panel: title `node:port`, chips, Read body / Read stream / Download / Acknowledge with unchanged service semantics, full-image preview, bounded 64 KiB text preview, binary-body message, metadata-only panel, and the three descriptor sections. +- **Stale graph facts:** muted ErrorCard-shaped cards inside the node they concern. +- **Saved-graph inspection:** moved into an "Inspect a saved workflow instead" disclosure under the no-run EmptyState. The select, the stable-ids note and the restyled `SavedGraphInspectionSnapshot` (native button nodes) are kept. +- **Graph strip:** the compact run graph strip (`RunGraphSnapshot`) is removed from this page. +- **WR-007 resolved for M3's files:** + - declarative download anchor, with one owner for the revoke timers; + - `