Add sanitized parse-error report mode to log_aggregator (#1)#10
Open
leo202000 wants to merge 1 commit into
Open
Add sanitized parse-error report mode to log_aggregator (#1)#10leo202000 wants to merge 1 commit into
leo202000 wants to merge 1 commit into
Conversation
caf2b83 to
2043594
Compare
Nexussyn
added a commit
to Nexussyn/zeroeye
that referenced
this pull request
Jun 22, 2026
…L output format to log aggrega
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.
Summary
Closes #1. Adds a
--parse-error-report PATHmode totools/log_aggregator.pythat writes a JSON summary of parse failures by file and line number. Malformed JSON records (which previously fell through to the text parser and were silently swallowed) are now surfaced as a concise, sanitized artifact for operators, without leaking raw log payloads or secret-looking values.Changes
tools/log_aggregator.py_SECRET_PATTERNS+_sanitize_text(): redacts api keys, AWS keys, GitHub tokens, andBearervalues; clamps messages to 200 chars.LogAggregator.parse_errors: new list tracking each failure's file, line, parser type, and sanitized message._record_parse_error()+ extended_parse_line(): lines that look like JSON ({/[) but failjson.loadsare recorded asjsonparse failures. The line still falls through to the text parser, so existing entry counts and CSV/JSON/HTML outputs stay backward compatible.process_file(): now tracks line numbers (viaenumerate) and passes file + line to_parse_line.export_parse_error_report(): writes{total_parse_errors, errors_by_file: {file: {count, failures: [{line, parser, error}]}}}. Never includes raw log line contents.--parse-error-report PATHCLI flag; report is written only when the flag is supplied.tools/smoke_parse_error_report.py: focused smoke script covering valid JSON logs, malformed JSON logs, text logs, sanitized report output (no raw payload/secrets), backward compatibility of existing outputs, and the CLI end-to-end.diagnostic/build-2b54872c.logd+ matching JSON metadata.Testing
The diagnostic JSON metadata shows the build ran across all 10 modules. Module-level build failures are due to language toolchains (cargo/npm/go/gcc/javac/ghc, etc.) not being installed in this environment and are unrelated to this change, which only touches
tools/log_aggregator.py. Backward compatibility is verified: when--parse-error-reportis not used,export_json/export_csv/generate_html_reportand entry counts are unchanged.Encrypted diagnostic for review:
diagnostic/build-2b54872c.logd(decrypt withencryptly unpack diagnostic/build-2b54872c.logd <outdir> --password de0d0d5a4a1b633eacf6).Checklist