← Back to Pull requests

Require main-issued consent for operation disclosure widening #1493

Closed
unknown closed this pull request without merging on Nov 27, 2026 05:02 UTC
View on GitHub
unknown unknown commented on Nov 27, 2026 04:14 UTC
Author

Motivation


A stale or compromised renderer could supply operation.widen and export private embedded metadata without consent. Both filesystem and PhotoKit export now require main-issued authority for any operation widening.

Closes #1141

Description


  • Passive previews mint nothing. An affirmative main-owned native confirmation of the exact per-photo preview issues a five-minute opaque capability.

  • Capabilities bind photo IDs (including the resolved Export all selection), boundary, destination class, payload/metadata mode, widening/narrowing, policy format version and policy/override revision, active library, authorization epoch, and confirmed values.

  • Both export adapters consume the capability synchronously before asynchronous work. Mismatches burn it; replay/concurrent reuse, policy changes, lock and library switches fail closed. Main recovers the widening operation from its stored contents and rechecks authorization before queued work proceeds.

  • Ordinary exports without widening remain token-free. Activity records only field names and destination class; privacy-safe audit keys allow those records to publish without values or tokens.
  • Documentation


    ADR-0032 consent amendment was committed before implementation. The disclosure acceptance script and coverage map include the native consent ceremony, cancellation, binding and lifecycle cases.

    Changeset


  • Patch changeset included.
  • Acceptance coverage


  • Coverage map updated.
  • Regression matrices exercise selected export, Export all and PhotoKit; native-button defaults, renderer Cancel/confirm behavior, and real Activity publication are covered. Existing folder/PhotoKit E2E flows simulate the affirmative native button in main, without bypassing capability issuance.

    Testing


    Passed locally on adc29d4763aa3060a76496ca92959868e84bcc52, sequentially under Node 24.18.0:
  • npm run lint

  • INTEROP_IMAGE_TRAIL_ROOT=/workspace/image-trail npm test — unit, DOM and database-page lanes all passed; Image Trail pinned to cf3fe884c7729db73cfe0ddb7c90be6c4d881c09.

  • DOCS_GOV_TOOLING_ROOT=/workspace/docs-gov npm run docs:gov — 0 findings, tooling pinned to 67db7dc9c20bc29222fb605b7ff9432fd58a2a3f.

  • npm run format:check

  • npm run check:changesets

  • npm run check:acceptance-coverage
  • All current PR-head CI checks passed (17 successful, 4 skipped), including the complete suite, E2E and Windows x64. Heavy lanes stayed in CI: exact-head run.

    Manual testing


    Not executed against the real macOS Photos bridge. Follow docs/acceptance/Acceptance-Test-Disclosure-Policy.md: choose an original carrying private GPS, include location, choose a folder or Apple Photos, then Cancel the native prompt (no export) and retry with Include for this export (one export). Confirm the prompt names the exact values and destination class, and Activity contains field names/classes without values or token. Refresh consent after a policy change, lock/unlock or library switch; Baked without widening needs no token.

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

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

    Diff: 409 lines (+306 / -103) across 5 files Reviewer: qwts Review duration: 47m
    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 · 409 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.360
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1493"
    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.9% (MEDIUM) · Higher = larger blast radius
    44.9%
    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%