.......FFFFFFFF                                                          [100%]
=================================== FAILURES ===================================
___________________ test_repeated_replacement_is_idempotent ____________________

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_repeated_replacement_is_i0')

    def test_repeated_replacement_is_idempotent(tmp_path):
        target=tmp_path/'x.txt'; target.write_text('foo\n')
        r=make([{'type':'replace_text','path':'x.txt','before':'foo','after':'foobar'}])
        repo=Repository(tmp_path)
        r.apply(repo)
        first=target.read_bytes()
        r.apply(repo)
>       assert target.read_bytes()==first, 'Reapplying appends another bar'
E       AssertionError: Reapplying appends another bar
E       assert b'foobarbar\n' == b'foobar\n'
E         
E         At index 6 diff: b'b' != b'\n'
E         
E         Full diff:
E         - (b'foobar\n')
E         + (b'foobarbar\n')
E         ?          +++

mnt/data/yasarda-hardening/audit/test_safety_regressions.py:21: AssertionError
____________ test_conflicting_bundle_does_not_leave_partial_writes _____________

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_conflicting_bundle_does_n0')

    def test_conflicting_bundle_does_not_leave_partial_writes(tmp_path):
        target=tmp_path/'x.txt'; target.write_text('alpha\n')
        r=make([
            {'type':'replace_text','path':'x.txt','before':'alpha','after':'beta'},
            {'type':'replace_text','path':'x.txt','before':'alpha','after':'gamma'},
        ])
        repo=Repository(tmp_path)
        try:
            r.apply(repo)
        except ConflictError:
            pass
>       assert target.read_text()=='alpha\n', 'First transform persisted after second conflicted'
E       AssertionError: First transform persisted after second conflicted
E       assert 'beta\n' == 'alpha\n'
E         
E         - alpha
E         + beta

mnt/data/yasarda-hardening/audit/test_safety_regressions.py:35: AssertionError
_________ test_verify_requires_desired_state_even_with_explicit_checks _________

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_verify_requires_desired_s0')

    def test_verify_requires_desired_state_even_with_explicit_checks(tmp_path):
        target=tmp_path/'x.txt'; target.write_text('old\n')
        r=make([{'type':'replace_text','path':'x.txt','before':'old','after':'new'}],
               verify=[{'type':'exists','path':'x.txt'}])
>       assert not r.verify(Repository(tmp_path)).ok, 'Verify passes before remediation was applied'
E       AssertionError: Verify passes before remediation was applied
E       assert not True
E        +  where True = VerificationResult(remediation_id='R', ok=True, checks=(CheckResult(type='exists', ok=True, detail='x.txt exists'),)).ok
E        +    where VerificationResult(remediation_id='R', ok=True, checks=(CheckResult(type='exists', ok=True, detail='x.txt exists'),)) = verify(<yasarda.repository.Repository object at 0x7f0d51781e50>)
E        +      where verify = Remediation(id='R', version=1, title='Audit fixture', description='', risk='medium', branches=(), depends_on=(), chang...eplace_text', path='x.txt', before='old', after='new', count=1),), verify_specs=({'type': 'exists', 'path': 'x.txt'},)).verify
E        +      and   <yasarda.repository.Repository object at 0x7f0d51781e50> = Repository(PosixPath('/tmp/pytest-of-root/pytest-0/test_verify_requires_desired_s0'))

mnt/data/yasarda-hardening/audit/test_safety_regressions.py:42: AssertionError
___________ test_direct_sdk_apply_cannot_bypass_catalog_dependencies ___________

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_direct_sdk_apply_cannot_b0')

    def test_direct_sdk_apply_cannot_bypass_catalog_dependencies(tmp_path):
        (tmp_path/'a.txt').write_text('old-a'); (tmp_path/'b.txt').write_text('old-b')
        a=make([{'type':'replace_text','path':'a.txt','before':'old-a','after':'new-a'}]); a.id='A'
        b=make([{'type':'replace_text','path':'b.txt','before':'old-b','after':'new-b'}],depends_on=['A']); b.id='B'
        catalog=Catalog({'A':a,'B':b},tmp_path)
        repo=Repository(tmp_path)
        assert not catalog.plan('B',repo).can_apply
        try:
            catalog['B'].apply(repo)
        except SafetyError:
            pass
>       assert (tmp_path/'b.txt').read_text()=='old-b', 'Direct public SDK entrypoint bypassed dependency guard'
E       AssertionError: Direct public SDK entrypoint bypassed dependency guard
E       assert 'new-b' == 'old-b'
E         
E         - old-b
E         + new-b

mnt/data/yasarda-hardening/audit/test_safety_regressions.py:56: AssertionError
___________________ test_manifest_rejects_nonpositive_counts ___________________

    def test_manifest_rejects_nonpositive_counts():
>       with pytest.raises(ManifestError):
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       Failed: DID NOT RAISE <class 'yasarda.errors.ManifestError'>

mnt/data/yasarda-hardening/audit/test_safety_regressions.py:60: Failed
__________ test_manifest_rejects_new_hash_that_disagrees_with_payload __________

    def test_manifest_rejects_new_hash_that_disagrees_with_payload():
>       with pytest.raises(ManifestError):
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       Failed: DID NOT RAISE <class 'yasarda.errors.ManifestError'>

mnt/data/yasarda-hardening/audit/test_safety_regressions.py:65: Failed
_____________ test_text_replacement_preserves_unrelated_crlf_bytes _____________

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_text_replacement_preserve0')

    def test_text_replacement_preserves_unrelated_crlf_bytes(tmp_path):
        target=tmp_path/'x.txt'; target.write_bytes(b'old\r\nuntouched\r\n')
        r=make([{'type':'replace_text','path':'x.txt','before':'old','after':'new'}])
        r.apply(Repository(tmp_path))
>       assert target.read_bytes()==b'new\r\nuntouched\r\n', 'Replacement normalizes all CRLF line endings'
E       AssertionError: Replacement normalizes all CRLF line endings
E       assert b'new\nuntouched\n' == b'new\r\nuntouched\r\n'
E         
E         At index 3 diff: b'\n' != b'\r'
E         
E         Full diff:
E         - (b'new\r\nuntouched\r\n')
E         ?       --            --
E         + (b'new\nuntouched\n')

mnt/data/yasarda-hardening/audit/test_safety_regressions.py:74: AssertionError
__________________ test_delete_link_does_not_delete_referent ___________________

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_delete_link_does_not_dele0')

    def test_delete_link_does_not_delete_referent(tmp_path):
        target=tmp_path/'target.txt'; target.write_bytes(b'keep')
        link=tmp_path/'alias.txt'; link.symlink_to('target.txt')
        r=make([{'type':'delete_file','path':'alias.txt','expected_old_sha256':sha256_bytes(b'keep')}])
        try:
            r.apply(Repository(tmp_path))
        except (SafetyError, ConflictError):
            pass
>       assert target.exists(), 'Repository.path resolves symlink; delete unlinks the referent'
E       AssertionError: Repository.path resolves symlink; delete unlinks the referent
E       assert False
E        +  where False = exists()
E        +    where exists = PosixPath('/tmp/pytest-of-root/pytest-0/test_delete_link_does_not_dele0/target.txt').exists

mnt/data/yasarda-hardening/audit/test_safety_regressions.py:85: AssertionError
=========================== short test summary info ============================
FAILED mnt/data/yasarda-hardening/original::test_repeated_replacement_is_idempotent - AssertionError: Reapplying appends another bar
assert b'foobarbar\n' == b'foobar\n'
  
  At index 6 diff: b'b' != b'\n'
  
  Full diff:
  - (b'foobar\n')
  + (b'foobarbar\n')
  ?          +++
FAILED mnt/data/yasarda-hardening/original::test_conflicting_bundle_does_not_leave_partial_writes - AssertionError: First transform persisted after second conflicted
assert 'beta\n' == 'alpha\n'
  
  - alpha
  + beta
FAILED mnt/data/yasarda-hardening/original::test_verify_requires_desired_state_even_with_explicit_checks - AssertionError: Verify passes before remediation was applied
assert not True
 +  where True = VerificationResult(remediation_id='R', ok=True, checks=(CheckResult(type='exists', ok=True, detail='x.txt exists'),)).ok
 +    where VerificationResult(remediation_id='R', ok=True, checks=(CheckResult(type='exists', ok=True, detail='x.txt exists'),)) = verify(<yasarda.repository.Repository object at 0x7f0d51781e50>)
 +      where verify = Remediation(id='R', version=1, title='Audit fixture', description='', risk='medium', branches=(), depends_on=(), chang...eplace_text', path='x.txt', before='old', after='new', count=1),), verify_specs=({'type': 'exists', 'path': 'x.txt'},)).verify
 +      and   <yasarda.repository.Repository object at 0x7f0d51781e50> = Repository(PosixPath('/tmp/pytest-of-root/pytest-0/test_verify_requires_desired_s0'))
FAILED mnt/data/yasarda-hardening/original::test_direct_sdk_apply_cannot_bypass_catalog_dependencies - AssertionError: Direct public SDK entrypoint bypassed dependency guard
assert 'new-b' == 'old-b'
  
  - old-b
  + new-b
FAILED mnt/data/yasarda-hardening/original::test_manifest_rejects_nonpositive_counts - Failed: DID NOT RAISE <class 'yasarda.errors.ManifestError'>
FAILED mnt/data/yasarda-hardening/original::test_manifest_rejects_new_hash_that_disagrees_with_payload - Failed: DID NOT RAISE <class 'yasarda.errors.ManifestError'>
FAILED mnt/data/yasarda-hardening/original::test_text_replacement_preserves_unrelated_crlf_bytes - AssertionError: Replacement normalizes all CRLF line endings
assert b'new\nuntouched\n' == b'new\r\nuntouched\r\n'
  
  At index 3 diff: b'\n' != b'\r'
  
  Full diff:
  - (b'new\r\nuntouched\r\n')
  ?       --            --
  + (b'new\nuntouched\n')
FAILED mnt/data/yasarda-hardening/original::test_delete_link_does_not_delete_referent - AssertionError: Repository.path resolves symlink; delete unlinks the referent
assert False
 +  where False = exists()
 +    where exists = PosixPath('/tmp/pytest-of-root/pytest-0/test_delete_link_does_not_dele0/target.txt').exists
