mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-02 02:13:49 +00:00
Petri judges a workflow at admission, so Fabro's lint rules go: `fabro-validate` (its 35 rules and the `LintRule` trait) is deleted, and with it `fabro-acp` (only a rule and two legacy executor tests used it), the model-resolution transform, the legacy `create`, `compile_create_run` and `materialize_create_run` stages, and `fabro-graphviz`'s `condition` and `fidelity` modules. `Diagnostic`, `RelatedDiagnostic` and `Severity` move to `fabro_types::diagnostic`, the one shape every diagnostic takes. Validation is now the same question the create handler asks. A new server module, `petri_check`, builds Petri's check request from a workflow bundle and the run's settings (every workflow of the bundle at its bundle-relative path, the inputs, the run variables, the launch), runs the check, and maps the diagnostics; Fabro adds one rule of its own, `fabro.model.no_ready_provider`, refusing a model node when no provider is ready. Admission, the validate and preflight endpoints and the offline `fabro validate` all go through it: - `validate_prepared_manifest` runs Fabro's structural pass (parse and transform, whose diagnostics stay) and then Petri's check, on the blocking pool from the handlers; - the offline `validate_manifest` checks with no model client and with an unbound input as a warning (`CheckRequest.unbound_is_warning`), so a workflow validates before its inputs exist; a collected workflow before upload checks with unbound inputs as errors, as before; - preflight resolves each LLM node's selector against the ready providers and the catalog for its probe, as the deleted transform did, and no longer probes a model Petri refused; - the graph render endpoint needs only the structural pass; - a run manifest now carries its `[run.goal] file`, which Petri reads from the bundle as it does for a version. The transforms keep the authored model selector (`sonnet` stays `sonnet`): Petri pins the catalog model in the admitted graph, not in the graph Fabro displays or in the settings snapshot. Tests assert that, and the CLI's validate, preflight and graph snapshots carry Petri's diagnostics (`attractor.no_start`, `attractor.undeclared_node`, `attractor.bad_on_failure`, ...) in place of the lint rules' text. Known gaps, Petri's side: a `workflow.toml` whose `[run.environment]` names an environment the server catalog defines but the file does not is refused (`unsupported.workflow_toml.run.environment`), as admission already refused it; an unbound input inside an included template partial is a render error rather than the unbound-input warning. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
23 lines
706 B
Rust
23 lines
706 B
Rust
use fabro_graphviz::graph::Graph;
|
|
|
|
use crate::error::Error;
|
|
|
|
/// A transform that modifies the pipeline graph after parsing and before
|
|
/// validation.
|
|
pub trait Transform {
|
|
fn apply(&self, graph: Graph) -> Result<Graph, Error>;
|
|
}
|
|
|
|
mod file_inlining;
|
|
mod import;
|
|
mod importable_field;
|
|
mod model_stylesheet_template;
|
|
pub mod stylesheet;
|
|
mod stylesheet_application;
|
|
pub mod variable_expansion;
|
|
|
|
pub use file_inlining::FileInliningTransform;
|
|
pub use import::ImportTransform;
|
|
pub(crate) use model_stylesheet_template::ModelStylesheetTemplateTransform;
|
|
pub use stylesheet_application::StylesheetApplicationTransform;
|
|
pub use variable_expansion::{RenderMode, ScriptInterpolationTransform, TemplateTransform};
|