fix: size_verified, leftover contracts, and extras on raised errors - #118
Merged
Conversation
DLANSAMA
force-pushed
the
refactor/aaa-pr8-error-path
branch
from
August 13, 2026 02:45
456cd9f to
565f7e6
Compare
DLANSAMA
force-pushed
the
refactor/aaa-pr9-honesty
branch
2 times, most recently
from
August 13, 2026 02:57
a59c530 to
38f0351
Compare
DLANSAMA
force-pushed
the
refactor/aaa-pr8-error-path
branch
from
August 13, 2026 04:12
90f218f to
308345f
Compare
Upload/job JSON carry size_verified. Missing SIZE is still success with a warning; mismatch remains a retryable failure. TOFU pin copy now says a hostile LAN can poison the pin. --sim is documented as a canned printer, not a protocol test.
DLANSAMA
force-pushed
the
refactor/aaa-pr9-honesty
branch
from
August 13, 2026 04:21
38f0351 to
2bb7306
Compare
DLANSAMA
added a commit
that referenced
this pull request
Aug 14, 2026
* refactor: printer factory, MQTT/FTPS hardening, coverage to 86 Continues the boundary/error-model arc (#117/#118). Architecture: - RuntimeContext.printer() now uses an injectable factory registered downward from bambu_cli.printer (set_printer_factory); context.py no longer imports printer. Removes the last check_layers ALLOWED edge (context -> printer); ALLOWED is now empty. Correctness / resources: - mqtt_session: lock _pending_payload/_command_issued across the paho network thread; cached-complete-snapshot fast path on silent pushall. - mqtt_tls: drop global socket.setdefaulttimeout mutation; bound connect via client._connect_timeout; configurable, validated MQTTS port. - mqtt_cmd/mqtt_print/mqtt_monitor: teardown in finally (fixes leak on the connect-exception path). - ftps: close the socket if connect/login/prot_p fails. - snapshot/slice: drop unreachable safe_log_error+abort tails after emit_json_error (now typed NoReturn); it already logs and raises. Tests / CI: - +40 targeted tests for the above error paths; raise CI cov floor 83 -> 86 (measured 91.0% Linux). Stronger docs-coverage drift guard. - Docs: api.md support matrix; SECURITY.md residuals marked accepted for 1.0; scoreboard refreshed. * test: make preflight perms test platform-aware (Windows CI) _file_permission_check returns None on win32 by design (POSIX mode bits don't apply — see the Windows secret ACLs residual in SECURITY.md), so the 0o644/0o600 assertions only hold off-Windows. Assert the None path on win32 instead. --------- Co-authored-by: DLANSAMA <258674612+DLANSAMA@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AAA stack 9/9. Stacked on #117. Tip of the stack.
Two commits:
printer.last_size_verifiedwhen FTPSSIZEis missing; Upload/Download/JobOk carrysize_verified. TOFU copy is hostile-LAN honest.--simwording says canned printer, not a live one.cmd_uploadusesctx.printer().\"Command failed (exit 5)\"). Setup, preflight, andsetup --migrate-access-codeemit through Contract objects.RuntimeContext.printer()usesget_printer()when it is the installed context.Local gates on this tip: ruff, mypy, bandit, layers, schemas,
pytest -W error::ResourceWarning -m \"not live\"— 1436 passed, 1 deselected, 88.91% (floor 83).Stack: #110 → #111 → #112 → #113 → #114 → #115 → #116 → #117 → this