Repository: promptfoo/promptfoo
Issue: MissingPointerError when referencing root test file
Root cause: Documentation Deficiency

**Describe the bug**
promptfoo unable to find `- $ref: "#/assertionTemplates/emptyFacts"` template when the tests are written in a separate yaml file, however the template is defined in the  in the main `promptfooconfig.yaml` file.
```
// tests/test.yaml
- vars:
    query: "some test"
  assert:
    - $ref: "#/assertionTemplates/emptyFacts"
```

```
// promptfooconfig.yaml
assertionTemplates:
  emptyFacts:
    type: equals
    value: {'extracted_facts': []}

tests: 
  - file://tests/simple_tests.yaml
```

error:
```
JSONParserError: Missing $ref pointer "#/assertionTemplates/emptyFacts". Token "assertionTemplates" does not exist.
    at Pointer.resolve (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/pointer.js:118:23)
    at $Ref.resolve (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/ref.js:81:28)
    at $Refs._resolve (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/refs.js:168:21)
    at dereference$Ref (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js:191:27)
    at crawl (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js:105:40)
    at crawl (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js:136:44)
    at crawl (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js:136:44)
    at dereference (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js:55:26)
    at $RefParser.dereference (/Users/karolismariunas/.nvm/versions/node/v20.18.2/lib/node_modules/promptfoo/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js:197:42)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'EMISSINGPOINTER',
  name: 'MissingPointerError',
  source: '/Users/karolismariunas/Documents/api/prompts/tests/facts/',
  path: null,
  toJSON: [Function: toJSON],
  targetToken: 'assertionTemplates',
  targetRef: '#/assertionTemplates/emptyFacts',
  targetFound: '#',
  parentPath: '#/0/assert/0',
  [Symbol(nodejs.util.inspect.custom)]: [Function: inspect]
}
```

**To Reproduce**
Steps to reproduce the behavior, including example Promptfoo configurations if applicable:

1. Run 'promptfoo eval' with this file configuration

**Expected behavior**
we are able to reference templates in the main config file, or define them in separate ones

**Screenshots**
-

**System information:**

If possible, please output the results of `promptfoo debug` and paste the output here.
```
================================================================================================================================================================================================================
Promptfoo Debug Information
================================================================================================================================================================================================================
{
  "version": "0.104.4",
  "platform": {
    "os": "darwin",
    "release": "24.1.0",
    "arch": "arm64",
    "nodeVersion": "v20.18.2"
  },
  "env": {},
  "configInfo": {
    "defaultConfigPath": "/Users/karolismariunas/Documents/api/prompts/tests/facts/promptfooconfig.yaml",
    "configExists": true,
    "configContent": "Error loading config: MissingPointerError: Missing $ref pointer \"#/assertionTemplates/emptyFacts\". Token \"assertionTemplates\" does not exist."
  }
}
```
- Promptfoo version: 0.104.4

**Additional context**
Add any other context about the problem here.


Hi @kmariunas, were you able to resolve this issue? With how promptfoo loads test cases, it's relatively difficult to reference across yaml files because they are loaded at different points in the eval lifecycle. If you found a solution I would love to see it. 

One alternative is to define your templates in JavaScript or Python and import them. You can see more details in our documentation at https://www.promptfoo.dev/docs/configuration/parameters/#tests-file 

hey, i was actually able to resolve it. I was trying a bunch of things, reading the source code, and i noticed that referencing like this could work
`"promptfooconfig.yaml#/assertionTemplates/llm-rubric"`
and it did!