# Evidence: Block 9 · Service (block-9)

- block type: block
- date: 2026-10-28
- resulting state: closed/verified
- story points (combined assembled cost): 4946
- execution id: 20261028.161953.349Z-48e154fc

## Stories built
- Support lexical bindings, destructuring, and user functions. (bindings) [story]

## Acceptance tooling authorization
- FEATURE-Bindings.md#bindings-corpus: executable=python3; scope=test; authorization=existing Target environment

## Stacked context
- stack: python_compact.md (SP 654)
- compass: COMPASS.md (SP 3420)
- implements: FEATURE-Bindings.md (SP 673)
- context: ARCHITECTURE_compact.md (SP 129)

## Build directory changes
- jq_interpreter/evaluator.py
- jq_interpreter/parser.py
- tests/test_bindings.py

## Pre-build acceptance observation
- RED: bindings-corpus (FEATURE-Bindings.md)
  intent: Bindings and function definitions execute the selected corpus cases with lexical scope and generator semantics.
  return code: 1
  stdout:
    FAIL jq.test:498  output mismatch
        program:  1 as $x | 2 as $y | [$x,$y,$x]
        input:    null
        expected: ['[1,2,1]']
        actual:   (no output)
        stderr:   unsupported filter bind
    FAIL jq.test:520  output mismatch
        program:  1 as $x | [$x,$x,$x as $x | $x]
        input:    null
        expected: ['[1,1,1]']
        actual:   (no output)
        stderr:   unsupported filter bind
    FAIL jq.test:789  output mismatch
        program:  def f: (1000,2000); f
        input:    123412345
        expected: ['1000', '2000']
        actual:   (no output)
        stderr:   unknown function f
    FAIL jq.test:803  output mismatch
        program:  def a: 0; . | a
        input:    null
        expected: ['0']
        actual:   (no output)
        stderr:   unknown function a
    0 passed, 4 failed, 0 errored
  stderr:
    --- drydock: progress ---
    cases: pass=0 fail=4 error=0 skip=0 total=4 from=tally
    --- drydock: end progress ---
    --- drydock: values at failure ---
      tally = {'pass': 0, 'fail': 4, 'error': 0, 'skip': 0}
    --- drydock: end values ---
    Traceback (most recent call last):
      File "bindings-corpus.py", line 24, in <module>
        assert tally["fail"] == 0 and tally["error"] == 0, tally
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: {'pass': 0, 'fail': 4, 'error': 0, 'skip': 0}

## Post-build programmatic acceptance
- PASS: bindings-corpus (FEATURE-Bindings.md)
  intent: Bindings and function definitions execute the selected corpus cases with lexical scope and generator semantics.
  target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python
  provisioning: not required
  return code: 0
  stdout:
    4 passed, 0 failed, 0 errored

## Build summary
RESULT: SUCCESS

FILES CHANGED:
- jq_interpreter/parser.py
- jq_interpreter/evaluator.py
- tests/test_bindings.py

SUMMARY:
Implemented lexical bindings, destructuring alternatives, closures, recursion, filter/value parameters, function shadowing, and generator semantics.

Checks passed:
- `python3 -m pytest -q` — 51 passed
- Scoped bindings conformance — 4 passed
- Destructuring alternatives conformance — 17 passed

BLOCKERS:
- None
