# Failing-before transcript — cross-library calls

## A. Original cross-library tests vs HEAD 1a632f0e (feature absent) -> 5 failed
# command: PYTHONPATH=<src copy with HEAD compiler.py> .venv/bin/python -m pytest tests/test_compiler_library_inline.py -q --tb=line -k cross_library
FFFFF                                                                    [100%]
=================================== FAILURES ===================================
E   AssertionError: Compile Error: CompileEmitError: library function add calls unsupported namespace b; use mode=interpret or auto
    assert 'error' not in {'error': 'Compile Error: CompileEmitError: library function add calls unsupported namespace b; use mode=interpret or auto', 'error_kind': 'compile', 'error_type': 'CompileEmitError', 'logs': [], ...}
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:441: AssertionError: Compile Error: CompileEmitError: library function add calls unsupported namespace b; use mode=interpret or auto
E   AssertionError: Compile Error: CompileEmitError: library function add calls unsupported namespace b; use mode=interpret or auto
    assert 'error' not in {'error': 'Compile Error: CompileEmitError: library function add calls unsupported namespace b; use mode=interpret or auto', 'error_kind': 'compile', 'error_type': 'CompileEmitError', 'logs': [], ...}
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:448: AssertionError: Compile Error: CompileEmitError: library function add calls unsupported namespace b; use mode=interpret or auto
E   AssertionError: assert 'library source not supplied' in 'compile error: compileemiterror: library function add calls unsupported namespace b; use mode=interpret or auto'
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:457: AssertionError: assert 'library source not supplied' in 'compile error: compileemiterror: library function add calls unsupported namespace b; use mode=interpret or auto'
E   AssertionError: assert 'recursive library import' in 'compile error: compileemiterror: library function add calls unsupported namespace b; use mode=interpret or auto'
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:482: AssertionError: assert 'recursive library import' in 'compile error: compileemiterror: library function add calls unsupported namespace b; use mode=interpret or auto'
E   AssertionError: assert 'unsupported library method' in 'compile error: compileemiterror: library function add calls unsupported namespace b; use mode=interpret or auto'
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:498: AssertionError: assert 'unsupported library method' in 'compile error: compileemiterror: library function add calls unsupported namespace b; use mode=interpret or auto'
=========================== short test summary info ============================
FAILED tests/test_compiler_library_inline.py::test_cross_library_call_inlines
FAILED tests/test_compiler_library_inline.py::test_cross_library_alias_scoping
FAILED tests/test_compiler_library_inline.py::test_cross_library_missing_source_fails_closed
FAILED tests/test_compiler_library_inline.py::test_cross_library_cycle_fails_closed
FAILED tests/test_compiler_library_inline.py::test_cross_library_unknown_export_fails_closed
5 failed, 31 deselected in 1.48s

## B. Alias-collision regressions vs pre-fix 6b3599ef (old cross-library code) -> 3 failed
# command: PYTHONPATH=<src copy with 6b3599ef compiler.py> .venv/bin/python -m pytest tests/test_compiler_library_inline.py -q --tb=line -k 'tuple_collision or consumer_alias_collision or parameter_shadowing'
FFF                                                                      [100%]
=================================== FAILURES ===================================
E   assert [203.0, 205.0, 207.0, 209.0] == [302.0, 304.0, 306.0, 308.0]
      
      At index 0 diff: 203.0 != 302.0
      Use -v to get more diff
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:571: assert [203.0, 205.0, 207.0, 209.0] == [302.0, 304.0, 306.0, 308.0]
E   assert [201.0, 203.0, 205.0, 207.0] == [200.5, 201.5, 202.5, 203.5]
      
      At index 0 diff: 201.0 != 200.5
      Use -v to get more diff
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:583: assert [201.0, 203.0, 205.0, 207.0] == [200.5, 201.5, 202.5, 203.5]
E   AssertionError: assert 'runtime' == 'compile'
      
      - compile
      + runtime
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:593: AssertionError: assert 'runtime' == 'compile'
=========================== short test summary info ============================
FAILED tests/test_compiler_library_inline.py::test_cross_library_synthetic_alias_tuple_collision
FAILED tests/test_compiler_library_inline.py::test_cross_library_consumer_alias_collision
FAILED tests/test_compiler_library_inline.py::test_cross_library_parameter_shadowing_fails_closed
3 failed, 36 deselected in 1.72s

## C. Incoming-alias guard vs pre-fix 6b3599ef -> 1 failed
# The old cross-library code had no incoming-alias check, so importing D as
# __xlib_1 after A did not fail closed. Failing test:
# test_cross_library_incoming_alias_after_a_fails_closed. The library-local
# edge failing-before is checker proof 24f1038c (round-2 sequential rewrite
# silently sent both calls to one library); it is not reproduced here.
# command: PYTHONPATH=<src copy with 6b3599ef compiler.py> .venv/bin/python -m pytest tests/test_compiler_library_inline.py -q --tb=line -k 'local_alias_collision or incoming_alias'
.F.                                                                      [100%]
=================================== FAILURES ===================================
E   AssertionError: assert None == 'compile'
     +  where None = <built-in method get of dict object at 0x7f8167d57700>('error_kind')
     +    where <built-in method get of dict object at 0x7f8167d57700> = {'alerts': [], 'compile_cached': False, 'compile_ms': 44.0, 'count': 4, ...}.get
/mnt/data/home/jango/Git/hoox-open-trading-stack/pynescript/tests/test_compiler_library_inline.py:646: AssertionError: assert None == 'compile'
=========================== short test summary info ============================
FAILED tests/test_compiler_library_inline.py::test_cross_library_incoming_alias_after_a_fails_closed
1 failed, 2 passed, 39 deselected in 1.74s
