refactor(logs,landscape): unified log targets, injection-safe profile writes#56
Merged
Merged
Conversation
… writes Implements plans/refactor/05-logs-landscape-hardening.md: - One stream/collect implementation instead of six: frozen target dataclasses (StageTarget, ServerTarget, ReplicaTarget) select the StreamOperation; WorkspaceLogManager.open/stream/collect take a LogTarget. The six legacy methods (stream_server, stream_replica, collect_server, collect_replica, open_*_stream) and the positional stream(stage, step) form remain as deprecated shims that warn and delegate (tested via pytest.warns) - save_profile no longer builds a shell heredoc from user content: YAML is transported base64-encoded (printf '%s' '<b64>' | base64 -d), so content containing PROFILE_EOF, , backticks, or quotes is inert; get/delete_profile filenames are single-quoted. Adversarial round-trip tests cover terminator/substitution/quote/CRLF/unicode payloads - LogStream takes the APIHttpClient and uses its new public stream() passthrough and stream_timeout property (configured connect timeout, unbounded read) instead of reaching into _get_client() with a hardcoded Timeout(5.0); SSE terminator event names are a module constant - LogEntry.kind is a LogKind enum (I/E) with str fallback for unknown values (left_to_right union) No breaking changes: all legacy method names keep working with a DeprecationWarning.
🛡️ Bandit Security Scan Results✅ No security issues found by Bandit. |
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.
Implements plans/refactor/05-logs-landscape-hardening.md:
No breaking changes: all legacy method names keep working with a DeprecationWarning.