Skip to content

Add diagnostic redaction regression tests#12

Open
fengyangxxx wants to merge 2 commits into
Peter7896:mainfrom
fengyangxxx:bounty/tot-1-diagnostic-redaction-tests
Open

Add diagnostic redaction regression tests#12
fengyangxxx wants to merge 2 commits into
Peter7896:mainfrom
fengyangxxx:bounty/tot-1-diagnostic-redaction-tests

Conversation

@fengyangxxx

Copy link
Copy Markdown

Summary

Fixes #1.

Adds focused diagnostic redaction regression coverage and the small build-script guards needed to keep diagnostic metadata reviewable: repository-relative paths, host identifier redaction, JSON-to-.logd pairing validation, chunked artifact validation, and deterministic missing-tool diagnostics.

This PR is scoped only to the diagnostic redaction/regression bounty.

Changes

  • Redacts local repository, home, temp, username, and machine identifiers from diagnostic metadata.
  • Normalizes diagnostic artifact references to repository-relative forward-slash paths.
  • Rejects absolute Windows and POSIX diagnostic_logd references.
  • Validates that generated diagnostic metadata references existing matching .logd artifacts, including chunked .logd parts.
  • Keeps missing npm and cmake tools as module failures instead of crashing diagnostic generation.
  • Adds 14 Python regression tests for redaction, path normalization, artifact pairing, chunked log references, non-UTF-8 console fallbacks, and missing-tool handling.
  • Includes script-generated diagnostic artifacts for code commit 0c8d9252.

Diagnostic artifacts

  • diagnostic/build-0c8d9252.json
  • diagnostic/build-0c8d9252.logd

The diagnostic bundle was generated by running python3 build.py in a clean Linux container using the committed tools/encryptly/linux-x64/encryptly binary. The JSON reports diagnostic_logd=diagnostic/build-0c8d9252.logd, chunked=false, no diagnostic_logd_error, and no message_blocker.

Testing

  • python3 -m unittest discover -s tests
    • PASS: 14 tests.
  • python3 build.py --list
    • PASS: command completed successfully.
  • python3 build.py
    • Generated the matching JSON and encrypted .logd bundle.
    • Diagnostic summary: 10 modules total, 7 passed, 3 failed.
    • Passing modules: backend, frontend, market, compliance, v2-market-stream, nfc-scanner, openapi-tools.
  • git diff --check
    • PASS.

Notes

  • The generated diagnostic password is intentionally not copied into this PR body.
  • Maintainers may remove diagnostic artifacts before merging if desired.

Notime02 added a commit to Notime02/TentOfTrials that referenced this pull request Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[$40 BOUNTY] [Python] Add diagnostic redaction regression tests

1 participant