# FEATURE: Path Lookup

| Field | Value |
|-------|-------|
| Version | 20261028 V1 |
| Description | Generate jq paths and retrieve or project values through them. |
| Depends On | FEATURE-Bindings.md |
| Provides | jq path lookup |
| Consumes | jq lexical bindings and functions |

## Behavior

Track paths through path expressions, including composition and generators, in output order. `path` emits arrays of keys and indices; exact paths can be produced for missing locations where jq permits them, while traversal paths reflect existing values. `paths` traverses descendants and excludes the root path, optionally filtering nodes. `getpath` retrieves the value at each supplied path, including null for missing locations where specified. `pick` projects the selected paths into a new value, preserving the manual's array and missing-value rules.

Reject invalid path expressions and invalid accesses with jq runtime errors. Path tracking must preserve the relationship between selected values and their original input locations through eligible filters.

## Programmatic Acceptance

=== AC paths-corpus ===
Intent: Path generation and lookup execute the selected corpus cases with the required path values.
Suite: scoped
Requires: executable=python3; scope=test
Probe: --list
Probe Count: summary

import json
import os
import subprocess
import sys

SELECT = r"^path\(\.foo\[0,1\]\)$|^path\(\.\)$|^pick\(\.a\.b\.c\)$"
result = subprocess.run(
    [sys.executable, "sources/run_conformance.py", "--select", SELECT, "--json"],
    capture_output=True, text=True,
    env={**os.environ, "JQ": os.path.abspath("jq")},
)
print(result.stdout)
print(result.stderr, file=sys.stderr)
report = json.loads(result.stdout)
tally = report["summary"]
print(f"{tally['pass']} passed, {tally['fail']} failed, {tally['error']} errored")
assert sum(tally.values()) > 0
assert tally["fail"] == 0 and tally["error"] == 0, tally
assert result.returncode == 0, result.returncode
=== END AC paths-corpus ===

## User Acceptance

- None.

## Guardrails

- Preserve generator ordering and runtime error behavior.
- Do not alter the staged corpus or harness.
- Cases combining lookup with later path mutation remain covered by scoped integration.
