Build a standalone JMESPath query engine in /workspace/program/main.py.
You may place additional standard-library Python source/data files under that
program directory. It will be delivered as a complete directory and run as
`python3 /program/main.py` in a fresh environment. Each invocation receives one
JSON object on stdin and must print exactly one JSON object on stdout. Other
diagnostics belong on stderr. The complete program may contain at most 128
ordinary files totaling 1 MiB, without symlinks or special files. Do not depend
on files outside the delivered
directory, network access, the reference client or the reference package.

An input has exactly two keys: expression, a JMESPath expression string, and data,
a finite JSON value. Return {"result": value} for successful evaluation, including
null results. For language errors return {"error": category}, where category is
syntax, invalid-type, invalid-value, unknown-function or invalid-arity. The target
is the supplied JMESPath Python 1.0.1 reference interface. The original official
specification is supplied at /workspace/SPECIFICATION.txt. The pinned interface
determines compatibility if a source description differs. JSON object member
order in a request is preserved by the reference. Output object key order does
not matter; array order and Boolean/number distinctions matter. Equivalent integer
and floating-point representations of the same number compare equally.

You can investigate requests through `from reference_client import query` in
Python, or by sending JSON lines to `python3 /workspace/reference_client.py`.
Each input there is one request of the form above; each output is the observed
interface result. Reference service failures raise an exception and do not
become language-error observations. The implementation and assessment files
are not available. Construct a reusable evaluator, not a lookup table of probes.

You retain native conversation, ordinary code, tests, saved versions and notes.
Choose useful inquiries and revise your construction or your interpretation as
needed. Your final answer ends this independent attempt; accurately describe
the delivered work and any remaining limitations. Assessment is not returned
during construction. All attempted inference, inquiry and other work count.

The complete attempt permits at most 100 actual model requests and 5400 seconds of construction, including automatic work. At most 64 reference calls are permitted.

The harness retains your actual reference responses and captures of the program
directory read-only under /run/repair. Original responses stay unchanged. Their
current applicability can be revised with an explicit reason, without rewriting
what was observed. Documentation and executable code remain your working materials.

After native tools, the harness captures program files and replays the current
program against your active acquired observations in a fresh environment without
the reference. Factual results are appended to tool feedback; full records and
saved source are readable. This finite agreement does not certify coverage,
correctness or the relevance of a probe. You can inspect prior work, use ordinary
tests or selective rollback, implement your own repair, or continue normally.

The controller's fixed limits are in /run/repair/configuration.json. Exhaustion,
unavailable snapshots and unresolved executions remain explicit and ordinary
construction stays available. Captures reject symlinks/special files; snapshot
consistency checks do not prove a complete or atomic dependency boundary.
Saved programs run with only their delivered directory and the pinned environment.

From Python, add /run/controller to sys.path and import client. The commands are
client.replay(version=None), for the current or a retained integer version ID,
and client.applicability(observation_id, active_boolean, reason). Actual inputs,
outputs, source identities and costs remain in the readable records.

When observations and source change, the controller can additionally search
combinations of differing text blocks from the nearest earlier distinct program
with the same file layout and executable modes. Within a supported search space,
current code is checked first. An excessive edit count can stop search before
that execution; ordinary replay remains available through client.replay().
A first program matching all active observations within the declared limits is
returned separately. No patch is installed. You may inspect, copy, reject or
further revise it, and investigate scope that the examples do not settle.
This search may omit a useful older program or a needed new implementation.
