chore: auto-commit (286 archivos)
- .claude/agents/fn-orquestador/SKILL.md - .claude/commands/fn_claude.md - .claude/rules/INDEX.md - .claude/rules/cpp_apps.md - .claude/rules/ids_naming.md - CHANGELOG.md - apps/dag_engine/README.md - apps/dag_engine/api.go - apps/dag_engine/dags_migrated/example.yaml - apps/dag_engine/dags_migrated/example_lineage_tracking.yaml - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
package core
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
// functionIDPattern matches registry IDs in `<name>_<lang>_<domain>` form.
|
||||
// Compiled once and reused across validations.
|
||||
var functionIDPattern = regexp.MustCompile(`^[a-z0-9_]+_[a-z]+_[a-z]+$`)
|
||||
|
||||
// DagValidate validates a DagDefinition for structural correctness.
|
||||
// Checks: steps have name/ID, no duplicate names/IDs, all depends reference
|
||||
@@ -31,6 +38,19 @@ func DagValidate(dag DagDefinition) DagValidationResult {
|
||||
result.Warnings = append(result.Warnings,
|
||||
fmt.Sprintf("step %q: has both command and script", ref))
|
||||
}
|
||||
|
||||
// Function-step validation.
|
||||
if step.Function != "" {
|
||||
if !functionIDPattern.MatchString(step.Function) {
|
||||
result.Errors = append(result.Errors,
|
||||
fmt.Sprintf("step %s: invalid function id format: %s", ref, step.Function))
|
||||
result.Valid = false
|
||||
}
|
||||
if step.Command != "" || step.Script != "" {
|
||||
result.Warnings = append(result.Warnings,
|
||||
fmt.Sprintf("step %s: function takes precedence; command/script ignored", ref))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !result.Valid {
|
||||
|
||||
Reference in New Issue
Block a user