← Back to Pull requests

Enforce disclosure policy on retained source sidecars #1495

Closed
unknown closed this pull request without merging on Nov 27, 2026 06:44 UTC
View on GitHub
unknown unknown commented on Nov 27, 2026 05:13 UTC
Author

Motivation

Original + Metadata: Source could copy private fields from retained sidecars when those fields were absent from the photo record. Closes #1142.

Description

  • Inspect retained XMP in main for title, description, keywords, GPS, capture time, camera and lens; refuse withheld findings before any batch output.

  • Preserve source custody and copy only the bounded, size/hash-verified bytes inspected at export. Edits/None, Original only and Baked omit source companions.

  • Fail closed for malformed, oversized or unverifiable companions, and for valid XMP containing unclassified properties such as ratings, comments or face regions. Preview names those properties; supported-field widening cannot authorize them. Unknown formats require a plan allowing every export field; operation widening requires main-owned consent explicitly describing unknown values.

  • Bind consent to companion identities and findings, burn tokens synchronously before asynchronous validation, and recheck authorization/policy/content after inspection.

  • Replace the unfiltered-sidecar notice with actual fields, permitted values, withheld fields and inspection failures. Bound XML complexity and aggregate preview inspection; disable Export for uninspectable sources.
  • Documentation

    Appended the ADR-0032 retained-companion amendment before implementation. Updated disclosure acceptance step 4, automated coverage references and third-party notices.

    Changeset

  • Patch changeset included.
  • Acceptance coverage

  • Coverage map updated with parser, main consent, engine, DOM and import/export coverage.
  • Testing

    Passed locally, sequentially:

  • npm run lint

  • npx eslint tests/backup/sidecar-backup.test.ts tests/import/sidecar-custody.test.ts

  • INTEROP_IMAGE_TRAIL_ROOT=/workspace/image-trail npm test — 2,742 unit + 117 DOM + 1 database-page tests passed; 10 skipped.

  • DOCS_GOV_TOOLING_ROOT=/workspace/docs-gov npm run docs:gov

  • npm run format:check

  • npm run check:changesets

  • npm run check:acceptance-coverage
  • The final assertion-only portability change also passed:

  • npx eslint tests/disclosure/source-consent.test.ts

  • npx prettier --check tests/disclosure/source-consent.test.ts

  • npm run test:compile

  • node scripts/run-electron-node-test.mjs .test-dist/tests/disclosure/source-consent.test.js — 14 passed.
  • CI passed on final PR head 45598d178ff099ea441c9a77d095a61b1048c203: complete suite (coverage, build and Storybook interactions), E2E/E2E gate, Windows x64, docs governance, CodeQL and workflow policy checks. Heavy lanes ran in CI.

    Manual Testing

    Not performed here. Follow acceptance step 4:

    1. Import a JPEG without GPS alongside source XMP containing GPS; keep location Private. Original + Source must refuse without output.
    2. Include location and affirm native consent. Export must copy the exact source once; stored custody remains unchanged.
    3. Choose Edits/None: no retained source companion crosses.
    4. Verify unknown-format uncertainty requires explicit main-owned widening, while malformed, unclassified or unverifiable XMP remains refused.

    <!-- agent-bot-write: ghw_202a4c5893e83c5f session=f601b21bf418 bot=trueline-codex-agent[bot] -->

    Diff: 401 lines (+300 / -101) across 5 files Reviewer: qwts Review duration: 90m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.45) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 401 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.359
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1495"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44.7% (MEDIUM) · Higher = larger blast radius
    44.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.4% · Safe to merge
    19.4%