Skip to content

validate: detect missing local paths in workspace hook commands #1056

@christso

Description

@christso

Summary

agentv validate does not validate local file paths referenced by workspace lifecycle hook commands, so an eval can pass validation and still fail immediately at runtime when before_all executes.

Repro

From an eval file directory, define a workspace hook like:

workspace:
  path: ${{ EVAL_EDIPROD_WORKSPACE_PATH }}
  hooks:
    before_all:
      command:
        - node
        - ../../../scripts/eval-config/copy-local-skills.mjs
    before_each:
      reset: fast

In this case the relative path is wrong and should have been ../../scripts/eval-config/copy-local-skills.mjs.

agentv validate eval.yaml reports the file as valid.

agentv eval eval.yaml then fails at runtime with:

Error: Cannot find module 'D:\GitHub\WiseTechGlobal\scripts\eval-config\copy-local-skills.mjs'
code: 'MODULE_NOT_FOUND'

Why this seems like a validation gap

AgentV already:

  • resolves hook cwd relative to the eval file directory during parsing
  • defaults hook execution cwd to the eval directory at runtime when cwd is omitted
  • validates some workspace semantics such as hooks.after_each.reset

So there is already a concrete execution base for hook validation, but validate does not currently stat/check the referenced local paths in hook commands.

Expected behavior

One of these would be sufficient:

  1. agentv validate should detect obviously local missing paths referenced by workspace hook commands and mark the eval invalid.
  2. If full command interpretation is too broad, validate should at least warn/error for common interpreter patterns where a local script path is passed as an arg, for example:
    • node ./script.mjs
    • bun run ./script.ts
    • python ./script.py
  3. Validation should use the same base directory as runtime hook execution (config.cwd ?? evalDir) so the result matches actual behavior.

Notes

This came up in a real eval where the only bug was a bad relative path in workspace.hooks.before_all.command. Static validation passed, but the run failed before any test executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions