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

- block type: block
- date: 2026-10-28
- resulting state: closed/verified
- story points (combined assembled cost): 4820
- execution id: 20261028.174456.902Z-fe458f27

## Stories built
- Implement SQL-style filters and builtin inventory. (sql) [story]

## Acceptance tooling authorization
- FEATURE-SqlBuiltins.md#sql-builtins-corpus: executable=python3; scope=test; authorization=existing Target environment

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

## Build directory changes
- jq_interpreter/builtins.py
- jq_interpreter/evaluator.py
- tests/test_sql_builtins.py

## Pre-build acceptance observation
- RED: sql-builtins-corpus (FEATURE-SqlBuiltins.md)
  intent: The SQL-style operators and builtin inventory pass their matching corpus programs.
  return code: 1
  stdout:
    {
      "candidate": [
        "/mnt/c/Users/barlo/projects/drydock/uat/jq/runs/20261028.145919/build/jq/jq"
      ],
      "corpus": "jq.test",
      "summary": {
        "pass": 5,
        "fail": 7,
        "error": 0,
        "skip": 0
      },
      "cases": [
        {
          "line": 2089,
          "program": "INDEX(range(5)|[., \"foo\\(.)\"]; .[0])",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "{\"0\":[0,\"foo0\"],\"1\":[1,\"foo1\"],\"2\":[2,\"foo2\"],\"3\":[3,\"foo3\"],\"4\":[4,\"foo4\"]}"
          ],
          "actual": []
        },
        {
          "line": 2093,
          "program": "JOIN({\"0\":[0,\"abc\"],\"1\":[1,\"bcd\"],\"2\":[2,\"def\"],\"3\":[3,\"efg\"],\"4\":[4,\"fgh\"]}; .[0]|tostring)",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[[[5,\"foo\"],null],[[3,\"bar\"],[3,\"efg\"]],[[1,\"foobar\"],[1,\"bcd\"]]]"
          ],
          "actual": []
        },
        {
          "line": 2125,
          "program": "IN(range(5;20); range(10))",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "true"
          ],
          "actual": [
            "false"
          ]
        },
        {
          "line": 2157,
          "program": "builtins|length > 10",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "true"
          ],
          "actual": []
        },
        {
          "line": 2161,
          "program": "\"-1\"|IN(builtins[] / \"/\"|.[1])",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "false"
          ],
          "actual": []
        },
        {
          "line": 2165,
          "program": "all(builtins[] / \"/\"; .[1]|tonumber >= 0)",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "true"
          ],
          "actual": []
        },
        {
          "line": 2169,
          "program": "builtins|any(.[:1] == \"_\")",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "false"
          ],
          "actual": []
        }
      ]
    }
    
    5 passed, 7 failed, 0 errored
  stderr:
    --- drydock: progress ---
    cases: pass=5 fail=7 error=0 skip=0 total=12 from=tally
    --- drydock: end progress ---
    --- drydock: values at failure ---
      tally = {'pass': 5, 'fail': 7, 'error': 0, 'skip': 0}
    --- drydock: end values ---
    Traceback (most recent call last):
      File "sql-builtins-corpus.py", line 19, in <module>
        assert tally["fail"] == 0 and tally["error"] == 0, tally
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: {'pass': 5, 'fail': 7, 'error': 0, 'skip': 0}

## Post-build programmatic acceptance
- PASS: sql-builtins-corpus (FEATURE-SqlBuiltins.md)
  intent: The SQL-style operators and builtin inventory pass their matching corpus programs.
  target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python
  provisioning: not required
  return code: 0
  stdout:
    {
      "candidate": [
        "/mnt/c/Users/barlo/projects/drydock/uat/jq/runs/20261028.145919/build/jq/jq"
      ],
      "corpus": "jq.test",
      "summary": {
        "pass": 12,
        "fail": 0,
        "error": 0,
        "skip": 0
      },
      "cases": []
    }
    
    12 passed, 0 failed, 0 errored

## Build summary
RESULT: SUCCESS

FILES CHANGED:
- jq_interpreter/builtins.py
- jq_interpreter/evaluator.py
- tests/test_sql_builtins.py

SUMMARY:
Implemented `INDEX`, `JOIN`, `IN`, and `builtins` inventory support with generator behavior and added regression tests.

Checks passed:
- Scoped conformance: 12 passed, 0 failed, 0 errors
- Targeted SQL tests: 6 passed
- Full pytest suite: 184 passed

BLOCKERS:
- None
