Repository navigation
Conversation
This branch has not been deployed
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 of Changes
This pull request resolves Issue #586 by ensuring that all redactions performed on
SourceSurfaceOmissionobjects are accounted for in the sealedPrivacyAuditsnapshot and propagated consistently to downstream reviewer artifacts.Root Cause
Previously in
_sanitize_for_output(),source_omissionswere sanitized inline as an argument to_SanitizedSurfaces(...), which occurred afterbuild_privacy_audit()had already sealed the redaction statistics. Consequently, any secret tokens in source omission fields (subject,detail,warning) incrementedprivacy_statstoo late to be included inreport.privacy_audit, causing discrepancy withplan.privacy_statsand downstream consumers.Implementation
In
src/agents_shipgate/cli/scan/sanitization.py:public_source_omissionslist comprehension directly above_sanitize_source_recovery_evidence()andbuild_privacy_audit().public_source_omissionsinto_SanitizedSurfaces.RULES_VERSION = "0.2").Closes #586
Regression Testing & Verification
Added Tests in
tests/test_privacy.py(494 lines):test_duplicate_mcp_omission_redactions_included_in_privacy_audit_and_outputs: End-to-end multi-artifact test checking exact occurrence count (11), path counts, reviewer summary synchronization, and absence of raw secrets or SHA-256 digests across 7 generated report files.test_source_omission_field_redactions_propagate_to_audit_and_reviewer_summary: Parametrized across 5 distinct test vectors:subjectalone (openai_api_key)detailalone (openai_api_key)warningalone (stripe_key)subject,detail, andwarning(github_token,openai_api_key,stripe_webhook_secret)test_multiple_duplicate_omissions_and_pre_sanitized_warning_do_not_double_count: 3-package duplicate MCP configuration confirming deduplicated warnings and multi-omissions calculate exact occurrences (14) without double-counting.test_clean_source_omissions_produce_zero_privacy_redactions: Negative control verifying clean omissions yieldoccurrence_count == 0and emptyredacted_paths.test_scan_source_omission_redactions_end_to_end: Scan pipeline test with POSIX guard (@pytest.mark.skipif(os.open not in os.supports_dir_fd)).Passing Checks:
python -m pytest tests/test_privacy.py -v -k "omission": 8 passed, 1 skipped in2.36s.python -m pytest tests/test_privacy.py -v -k "not test_scan and not test_a_40 and not test_a_finding and not test_verify": 81 passed in16.09s.python -m pytest tests/test_schema_roundtrip.py tests/test_reviewer_summary.py -k "not test_check_mode" -q: 48 passed in3.15s.python scripts/verify_dependency_lock.py: All 4 lock closures verified.ruff check .&compileall -q src tests: 0 errors.Platform Environmental Limitations & Failure Reconciliation
Note
Full Test Suite Execution & Platform Reconciliation Disclosure:
We explicitly do not claim the entire repository test suite passed on the local development environment.
During local test validation on native Windows, running:
exited with code 1. A detailed failure audit established:
tests/test_rule_credential_redaction.py: 100% Passed.tests/test_surface_exclusions.py,test_permission_rule_url_redaction.py, andtest_workflow_label_redaction.pyfailed due to pre-existing Windows environment constraints in upstream baseline code:dir_fdConstraint:open_directory_beneath()insrc/agents_shipgate/core/verification_identity.py:880usesos.open(root, O_NOFOLLOW | O_DIRECTORY). As noted in its docstring ("""POSIX only: it needs dir_fd support."""), Windows lacksdir_fd(os.supports_dir_fdis empty), raisingPermissionError: [Errno 13]. This failspublish_current_control()when writing receipt artifacts to disk.F:\nsoc\agents-shipgate\sampleswith pytestC:\Users\...\AppData\Local\Tempfail withValueError: path is on mount 'C:', start on mount 'F:'inos.path.relpath.Issue #586 does not touch verification publishing, directory descriptors, or path normalization. All Issue #586 logic was verified on Windows via
_run_sanitized_outputs(), and the end-to-end test skips gracefully on native Windows while executing cleanly on POSIX Linux CI runners.Reviewer Checklist
public_source_omissionsare sanitized prior to callingbuild_privacy_audit().privacy_statsaccurately captures all secret tokens insubject,detail, andwarningfields.reviewer_summary.privacy_redactionsmatchesprivacy_audit.redacted_occurrence_count.PrivacyAuditschema, redaction thresholds, and public contracts remain unchanged.