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

- block type: block
- date: 2026-10-28
- resulting state: closed/verified
- story points (combined assembled cost): 4792
- execution id: 20261028.161722.283Z-c11b1f4c

## Stories built
- Evaluate conditional and error-control expressions. (control) [story]

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

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

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

## Pre-build acceptance observation
- RED: control-corpus (FEATURE-Control.md)
  intent: Conditional and alternative expressions execute the selected corpus cases with jq truth and stream semantics.
  return code: 1
  stdout:
    {
      "candidate": [
        "/mnt/c/Users/barlo/projects/drydock/uat/jq/runs/20261028.145919/build/jq/jq"
      ],
      "corpus": "jq.test",
      "summary": {
        "pass": 0,
        "fail": 9,
        "error": 0,
        "skip": 0
      },
      "cases": [
        {
          "line": 1322,
          "program": "[if 1,null,2 then 3 else 4 end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[3,4,3]"
          ],
          "actual": []
        },
        {
          "line": 1326,
          "program": "[if empty then 3 else 4 end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[]"
          ],
          "actual": []
        },
        {
          "line": 1330,
          "program": "[if 1 then 3,4 else 5 end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[3,4]"
          ],
          "actual": []
        },
        {
          "line": 1334,
          "program": "[if null then 3 else 5,6 end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[5,6]"
          ],
          "actual": []
        },
        {
          "line": 1338,
          "program": "[if true then 3 end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[3]"
          ],
          "actual": []
        },
        {
          "line": 1342,
          "program": "[if false then 3 end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[7]"
          ],
          "actual": []
        },
        {
          "line": 1346,
          "program": "[if false then 3 else . end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[7]"
          ],
          "actual": []
        },
        {
          "line": 1350,
          "program": "[if false then 3 elif false then 4 end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[7]"
          ],
          "actual": []
        },
        {
          "line": 1354,
          "program": "[if false then 3 elif false then 4 else . end]",
          "status": "fail",
          "detail": "output mismatch",
          "expect_failure": false,
          "expected": [
            "[7]"
          ],
          "actual": []
        }
      ]
    }
    
    0 passed, 9 failed, 0 errored
  stderr:
    --- drydock: progress ---
    cases: pass=0 fail=9 error=0 skip=0 total=9 from=tally
    --- drydock: end progress ---
    --- drydock: values at failure ---
      tally = {'pass': 0, 'fail': 9, 'error': 0, 'skip': 0}
    --- drydock: end values ---
    Traceback (most recent call last):
      File "control-corpus.py", line 18, in <module>
        assert tally["fail"] == 0 and tally["error"] == 0, tally
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: {'pass': 0, 'fail': 9, 'error': 0, 'skip': 0}

## Post-build programmatic acceptance
- PASS: control-corpus (FEATURE-Control.md)
  intent: Conditional and alternative expressions execute the selected corpus cases with jq truth and stream semantics.
  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": 9,
        "fail": 0,
        "error": 0,
        "skip": 0
      },
      "cases": []
    }
    
    9 passed, 0 failed, 0 errored

## Build summary
Implemented conditional and error-control evaluation.

RESULT: SUCCESS

FILES CHANGED:
- jq_interpreter/errors.py
- jq_interpreter/parser.py
- jq_interpreter/evaluator.py
- tests/test_evaluator.py

SUMMARY:
Added `if/elif/else`, `?`, `try/catch`, error values, partial-output preservation, and correct `//` precedence. All tests pass; scoped corpus checks pass with zero failures/errors.

BLOCKERS:
- None
