projectworkflowseed

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package projectworkflowseed loads workflow definitions into the project workflow store. It owns two seed paths used at server startup:

  1. Global definitions from the server's [workflows] definition_paths (server-relative TOML files, restricted against absolute/traversal paths by the caller).
  2. Per-project definitions from each project's own local workflow directory under its configured root_path. By default this is <root_path>/.agentic/workflows/governed-*.toml, but the directory and glob are per-project configurable (config.Project.WorkflowsLocalDir / WorkflowsLocalGlob) so a repo that stores its workflow TOMLs elsewhere or under a different naming convention is not forced into the default. This makes the project-local workflow directory the single source of truth for project-local workflow definitions, exactly like .agentic/skills/ and .agentic/policies/ already are for skills and policies.

Per-project loading is GENERIC: any configured project with a root_path and Enabled=true is eligible. There is no per-repo special-casing. Project-local files override global definitions with the same workflow_ref for that project (ImportWorkflowTOML is an upsert); projects without a local workflow directory fall back to the global seed silently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadProjectLocalWorkflows

func LoadProjectLocalWorkflows(ctx context.Context, projects []config.Project, importer workflowImporter, logger *slog.Logger) error

LoadProjectLocalWorkflows imports the configured glob of TOML files from each eligible project's local workflow directory into that project's ID.

Eligibility per project: Enabled=true, non-empty RootPath, non-empty WorkflowsLocalDir (relative, no traversal), non-empty WorkflowsLocalGlob, and WorkflowsLocalEnabled=true (default true).

Error model (bulletproof):

  • A project without its local workflow directory present is skipped silently (fallback to the global seed). Missing dir is NOT an error.
  • A project with an empty WorkflowsLocalGlob is skipped silently (safe default; importing arbitrary *.toml is opt-in, never implicit).
  • A file that fails to read/parse, or that yields error-severity validation issues, or whose store import fails, returns an error and aborts the seed (fail loud, not silent drift).
  • A file that is a symlink escaping the local workflow directory is rejected (path safety).

The function is generic over cfg.Projects; there is no per-repo branching.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL