Skip to content

feat(android): classify Access routes and retain origin ownership - #156231

Draft
vincentkoc wants to merge 1 commit into
split/android-access-native-persistence-20260923from
split/android-ingress-route-classification-20260923
Draft

vincentkoc wants to merge 1 commit into
split/android-access-native-persistence-20260923from
split/android-ingress-route-classification-20260923

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Android ingress needs to distinguish an ordinary gateway from a verified Access challenge without confusing service-header access with browser authorization. A profile changing origins must also retain durable ownership until its old grant has been retired.

User Impact

This introduces the dormant route-classification owner and durable origin association. Ordinary routes remain usable; verified challenges produce actionable attention. The controller is not wired into the app in this slice. It exposes no browser authentication, cached grant admission, public Forget/Sign out, Retry or cleartext transition API yet.

Why This Change Was Made

The same owner performs route TLS discovery, checks the current caller and registration, and publishes one presentation snapshot. Registry observations are queued to avoid inline monitor inversion. A shared-origin departure releases only its association; the last owner retains its durable association through transport drain and deletion, with an atomic retirement check before cleanup can clear it.

This is the fourth narrow slice of #147305, stacked on #156224. It contains 360 production lines and 453 test lines added, 813 total. The complete cleanup boundary stays with its tests.

Evidence

  • Eight existing aggregate test methods cover queued Registry delivery, stopped observers, ordinary/service-header routes, actionable challenges, ordinary-to-managed classification, shared last-owner retirement, superseded origin cleanup, and six configured TLS cells.
  • The subset is reconstructed from the final guarded implementation at 8aa382d7d196ec7ede0fbaa50980c9e6b1992e22. Its internal API exposes only present capabilities; browser-only test scaffolding will return with the browser slice. No historical intermediate race fix is replayed.
  • Normal signed commit hooks and git diff --check passed. Production call-site inspection confirms the controller remains dormant. Prefix compilation and test execution remain pending; historical aggregate results do not qualify this new prefix.
  • The stack's automated source review remains held by the review tool's synthetic-fixture filename classification. No substitute review or new clean verdict is claimed. Keep this draft unmerged until applicable review and validation are resolved. Final-app fresh-install/same-signer install-over proof remains outstanding.

@vincentkoc vincentkoc self-assigned this Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 7, 2026, 9:09 PM ET / October 8, 2026, 01:09 UTC (Revision 2).

ClawSweeper review

What this changes

Adds a dormant Android controller that classifies Cloudflare Access challenges and retains saved origin ownership until grant retirement finishes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, coherent source with no discrete finding, but prefix execution and installed-state compatibility remain unqualified.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The ordinary external-contributor proof gate is exempt for this MEMBER-authored PR, and the controller remains dormant. Independent stored-data compatibility is insufficient: the active registry serialization change still lacks fresh-install and same-signer installed-old preservation evidence; historical TLS and aggregate tests do not establish that upgrade result.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes
User problem: Android users need protected gateways distinguished from ordinary routes without treating service headers as browser authentication.
Reason: This is a coherent foundation for the existing Access integration direction, authored by a contributor with verified merged history in that area. Its dormant scope is explicit and does not claim complete app integration.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this maintainer-authored stack slice adds distinct work that current main does not implement. It needs real behavior proof of registry upgrade preservation before merge; the prior validation gaps remain unresolved.

Priority: P2
Reviewed head: d691cc4fc2b990393cb537785e4088321792def4

Before merge

  • Resolve merge risk (P1) - Existing gateway.registry records can be rewritten on startup; fresh-install and same-signer installed-old proof has not established preservation of profiles, selection, custom headers, settings, and pairing.
  • Resolve merge risk (P1) - The supplied test merge uses the stack parent rather than fetched current main, whose registry implementation has changed; stack synchronization and integration validation remain outstanding.
  • Complete next step (P2) - Synchronize the stack with current main, qualify this prefix with focused compilation/tests, and provide fresh-install plus same-signer installed-old preservation evidence before merge.

Findings

None.

Tests

  • Missing end-to-end proof: Historical aggregate harness results do not establish execution of this extracted prefix. Its focused compilation/test results and installed-old registry preservation evidence remain pending; this read-only review did not execute them.
Agent review details

How this fits together

The Android app stores paired gateways and their connection settings in encrypted preferences. The new controller probes a gateway using its selected TLS policy, records verified Access ownership, and publishes connection attention; production app wiring is deferred.

flowchart TD
  A[Paired gateway and TLS settings] --> B[Ingress controller]
  C[Saved gateway registry] --> B
  B --> D[Route discovery]
  D --> E{Verified Access challenge?}
  E -->|No| F[Ordinary admission]
  E -->|Yes| G[Saved origin and sign-in attention]
  B --> H[Drain transports and retire old grant]
Loading

Technical review

Best possible solution:

Keep one ingress owner, preserve current-main registry behavior, and qualify the persisted-format change before activating browser or cached-grant admission in later slices.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this introduces a dormant capability rather than repairing a reproduced existing-app defect; source confirms the controller has no production caller.

Is this the best way to solve the issue?

Yes, the single controller and existing registry/store owners are a coherent foundation; correctness in the installed app remains conditional on prefix validation and upgrade preservation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5ffec9b0ad85.

Merge-risk options

Maintainer options:

  1. Qualify registry preservation (recommended)
    Synchronize the stack with current main and attach fresh-install and same-signer installed-old evidence showing saved gateway state survives the registry rewrite.

Provenance checked

Testing

Proof path: in-process harness. Added test files: 1.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Tests +453, Other +360. Total +813 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 453 0 +453
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 360 0 +360
Total 3 813 0 +813

Review metrics

Metric Value Why it matters
Persisted registry fields 1 nullable field added The field is serialized by the existing startup rewrite path despite the controller remaining dormant.

Labels

Label changes:

  • add P2: This is a bounded Android Access improvement without a demonstrated urgent regression in the running app.
  • add merge-risk: 🚨 compatibility: The new serialized origin field changes existing registry writes before app activation, and installed-old preservation remains unproven.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This is a bounded Android Access improvement without a demonstrated urgent regression in the running app.
  • merge-risk: 🚨 compatibility: The new serialized origin field changes existing registry writes before app activation, and installed-old preservation remains unproven.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Compile and run the focused controller and registry coverage for the synchronized prefix, recording results and test duration.
  • Attach fresh-install and same-signer installed-old evidence showing registry and credential state is preserved.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-23T05:46:11.080Z sha d691cc4 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant