Repository navigation
Open
Labels
area:backend-coreCore backend frameworks, DAG task runner, and server APItype:featureNew feature or request
Description
Part of #1049 / Follows up #1042
Summary
Finish the remaining parts of #1042: fix suggestions in INVALID_CEL errors and compile-time validation of path keys.
Background
CEL errors
- The CEL errors spec of MCP: Workbench read layer and common conventions #1042 returns
Position,Did you mean, andAvailable keys in path, or the available function names for a misspelled function. An agent without the plugin must be able to fix the expression from the error alone. - The acceptance criteria of MCP: Workbench read layer and common conventions #1042 say: "Passing invalid CEL returns Markdown starting with
Error: INVALID_CEL, containing the error position and fix suggestions, withisError: true." mdtemplate.InvalidCELErrorinpkg/server/mcp/mdtemplate/template.gowrites only Field, Expression, and Message. The position appears only inside the cel-go message text.
path keys
pathis declared asmap<string,string>inpkg/server/workbench/cel/env.go, so the MCP: Workbench read layer and common conventions #1042 examplepath.namspace == 'default'passesValidateTimelineQuery.- Indexing a level that a timeline does not have used to abort the whole filter with "no such key". The fix for that bug makes a missing level evaluate to an empty string. As a result, a misspelled key now matches nothing instead of failing. Compile-time validation is the only way to report it.
CEL references (Resolved in #1165, #1167, #1177)
- The code-generated CEL reference pipeline (
pkg/server/workbench/cel/reference.goandmake generate-agent-plugin-references) was replaced with static reference files (plugins/khi/skills/khi-investigation/references/cel-timeline.mdandcel-log.md, using lowercase kind names) paired with the dynamicFilter vocabularysection inkhi://inspections/{id}.
Proposed work
- Validate
pathkeys at compile time against the registered timeline type labels, inValidateTimelineQuery. The Web UI uses the same validation throughCELValidationServer. - Return structured CEL errors:
Positionwith line and column from the cel-go issues,Did you meanby edit distance, the availablepathkeys for an undefined key, and the available functions for an undeclared function.
Acceptance criteria
-
path.namspace == 'default'returnsINVALID_CELwithPosition,Did you mean: path.namespace, and the available keys. - A misspelled function name returns
INVALID_CELwith the available function names.
Related code
pkg/server/workbench/cel/env.go: CEL environments and declarations.pkg/server/mcp/mdtemplate/template.go:InvalidCELError.pkg/server/api/v1/cel_validation.go: Validation for the Web UI.
Metadata
Metadata
Assignees
Labels
area:backend-coreCore backend frameworks, DAG task runner, and server APItype:featureNew feature or request
Activity