# fix\(managed-cli\): map undecodable staged files to unverified · PR \#369 · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/pull/369)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

State: merged

Source repository: lucenx/codexbar-plasma

Source branch: fix/staged-decode-unverified

Target branch: main

Head commit: a5f0987cd55a5f3b8eef73ac58e152c08d87cb4a

[Discussion and reviews](https://git.cafe/lucenx/codexbar-plasma/pull/369)

[Commits](https://git.cafe/lucenx/codexbar-plasma/pull/369/commits?format=markdown)

[Files changed](https://git.cafe/lucenx/codexbar-plasma/pull/369/diffs?format=markdown)

## Description

---

## Summary

- A staged checksum or `VERSION` file that is not valid UTF-8 raised `UnicodeDecodeError`, which `failure_status()` degraded to the generic `error` instead of the `unverified` tampering signal used for other refused content.
- Decode failures in `install()` now fold into the existing `checksum_file` and `version_file` codes, so binary staged files report `unverified` like mismatched ones.
- Observable result: same install refusal, but the widget renders the tampering signal instead of a generic error.

## Related issue

None

## Documentation impact

- `docs/development.md` already documents that refused downloads report `unverified`; this change aligns the behavior with the doc, so no guide update is needed.
- TODO.md is unaffected: no parity entry covers helper failure mapping.
- Changelog: updated Unreleased.

## Verification

- New test `test_binary_staged_files_report_unverified` in `tests/test_managed_cli.py` (binary `.sha256` and binary `VERSION` fixtures): observed red before the fix (`UnicodeDecodeError` message mismatch), green after.
- `make check`: full suite green locally on the stacked tip `0e63e84`. Skipped locally (tools absent, CI covers them): `actionlint`, `pyflakes`. QML hardening noted partial import/type checks locally ("CI requires full checks").
- CI: green on `0e63e84` — `check`, `smoke`, `smoke-runtime`, `pr-title` all pass ([run](https://github.com/Lucenx9/codexbar-plasma/actions/runs/36062238673)).

## Visual changes

None

## Review notes

- Stacked on #368 (base `fix/todo-gate-harden`); retarget to `main` once #368 merges. This PR's own diff is only the `managed_cli` commit.
- Only `UnicodeDecodeError` is folded in; a missing staged file still reports `error`, which fits a local staging problem rather than refused content.

