Repository navigation
spec(AST-134): React Native platform: Web data, bundled web content and sign-in (draft) - #12569
imdreamrunner wants to merge 7 commits into
Conversation
…nd sign-in (draft)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval waits on an engineering owner deciding the draft contract. FR1–FR16 and DEC-1–DEC-5 of spec:AST-134 are new requirements that no current record states. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Whatever the decision, these need changes:
- Why this exists (lines 46–60) is a survey of eight community libraries, which
architecture:knowledge-contractsINV10 keeps out of records: move it to the description or an artifact, keep its one-sentence conclusion in a decision, and correct the R2 and R4 rubric lines that report none. - The record departs from
spec:AST-112(FR2 dropssupports(feature), FR10 answers a declined sign-in withnot-allowedinstead ofcancelled, FR1 letscancelreturn no result and puts data, bundles and snapshots inweb) although the description says it changes none, so conform to AST-112 or name and amend each departure. - Platform support (lines 404–410) prescribes engine APIs such as
WKWebsiteDataStore.nonPersistentDataStore()andWKURLSchemeHandler, which INV18 rules out unless a named caller depends on them, so state each row's observable guarantee instead. - FR3's verification row (line 439) asks for a bundle and a snapshot in each Preview project, which FR3 forbids, and
prewarmreturns a release function that cannot answernot-allowed, so limit those states to the app's runtime and say what a project'sprewarmdoes. - Line 227 starts with
1., so GitHub renders FR6's "(default 1)" as a numbered list and the default ofcountdisappears; rewrap so the number does not start a line. - FR10 lists
timeoutas a snapshot reason (line 321), but FR7 always takes the picture attimeoutMs, so state whentimeoutresolves or drop it.
The record also cites spec:AST-130 and spec:AST-131, which exist only in #12553 and #12551, so it should land with or after them.
Claims and files checked
Review mode: full; reason: no-earlier-review
- The five modules are opt-in
webmodules reached through the capability loader, and every call resolves a result: verified (FR1, FR10). - Every module works in the calling runtime's namespace, decided natively: verified (FR3).
- Sessions stay native under an opaque handle, and cookie values never reach props or logs: verified (FR4, FR9).
- Clearing web data never clears the network cookie jar: verified (FR5, DEC-1).
- Bundles load from a private origin with a byte route the app answers, and warm pages are a named feature: verified (FR6, FR13, DEC-2).
- Snapshots are drawn inert with no option that loosens the contract: verified (FR7, DEC-4).
- Sign-in runs in the system's authentication browser with a redirect URI per runtime, PKCE values and natively bound state: verified (FR8, DEC-3, DEC-5).
- Every contract is at revision 1, with five named features and a Stage version floor: verified (FR13).
- Native code uses public API only, with one Android gap line: verified as written (FR14).
- Five open questions remain unanswered with their options: verified (OQ1–OQ5).
- The record details the foundation record's FR3, FR6, FR7, FR8, FR12 and FR15 and changes none of them: false (FR1, FR2, FR10).
- The record stays consistent with the web view record's FR5, FR7, FR8, FR14, FR16 and DEC-4: verified against #12551, except that its FR14 keeps
supports(feature). - No other record owns these modules: verified (no match under
docs/orpackages/). - Open pull requests overlap only as sibling platform records: partly true; #12571 states the same named-feature and Stage-floor rule.
- The implementation lives in the React Native package's platform layer: not checkable, because this repository has no React Native package.
- Rubric R1 (one narration rewritten as "at once"), R3, R5, R6 and R7: verified.
- Rubric R2 (no research in the record): false (lines 46–60).
- Rubric R4 (alternatives only inside DEC-1–DEC-5): false (the table repeats three).
- Scope checklist, every named internal mechanism names its dependent caller: false (lines 404–410).
- Scope checklist, spec records only and no internal context in public text: verified.
- Validation, the knowledge check, Prettier and the whitespace check pass: verified at this head.
docs/specs/AST-134-react-native-web-data-sign-in/spec.md: the six findings above (lines 46–60, 114–118, 226–227, 321–324, 404–410, 439).
…ble platform guarantees, Stage by behaviour
…counter, named features, sign-in opt-in question
There was a problem hiding this comment.
Approval waits on an engineering owner deciding the draft contract in spec:AST-134: FR1–FR16 and DEC-1–DEC-5 are new requirements that no current record states, including the amendment that moves web data, bundled web content and page snapshots into web and the record's reliance on the AST-112 amendment in #12563, so it should land after #12563, #12551 and #12553. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
The warm-pool bullet, the timeout path, the Platform support guarantees, the FR3 verification row and the AST-112 alignment are fixed; two findings still need changes after the decision:
- The Why this exists table (lines 54–60) still compares named libraries outside any decision, which
architecture:knowledge-contractsINV10 keeps out of a record, and two of its rows restate the rejected alternatives of DEC-1 and DEC-4, so delete it, keep the one-sentence conclusion, and correct the R2 and R4 rubric lines. - Miss: FR15 (lines 389–399) says three modules behave as on a device only where Astryx Stage shows a web view and covers custom-scheme sign-in callbacks on macOS and Linux only, so add gap lines for Stage on Linux and Windows and for the Windows callback.
Also worth a look: AST-112's own FR1 web entry still needs the amendment this record declares, and FR8 and FR9 should name the web host declarations rather than "the configuration plugin", which #12563 makes Expo-only.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: the record depends on the AST-112 amendment, the web view record and the system modules record, landing after them: verified, all three are open drafts that hold the cited claims.
- Claim: the amended foundation gives these objects supports(feature) only where named features exist, no revision counter, and a Stage version floor: verified against the amendment's FR7, FR8 and FR12.
- Claim: the record amends the foundation's FR1
weblist: verified in Current-state impact; the foundation's own entry is unchanged (note above). - Claim: the record stays consistent with the web view record's pin, bundled folders, sessions, warm bundle, fallbacks and private-origin decision: verified.
- Claim: no other record owns these five modules: verified by searching the current docs.
- Claim: every call resolves a result, cancel included, and a declined consent is cancelled: verified in FR1, FR2 and FR10.
- Claim: five named features, public API only, and one gap line for a non-public field: verified in FR13 and FR14.
- Claim: a snapshot answers timeout when the renderer does not draw within a further timeoutMs: verified in FR7.
- Claim: three gaps are recorded and Stage is described by behaviour: verified, but FR15 omits Linux and Windows (finding).
- Claim: Platform support states each platform's observable guarantee: verified.
- Claim: rubric R2, the comparison moved out of the record: false, the library table remains (finding).
- Claim: rubric R4, the five rejected alternatives sit only inside the decisions: false, two table rows restate them (finding).
- Claims: rubric R1, R3, R5, R6 and R7: verified.
- Claim: the knowledge check, Prettier and the whitespace check pass: verified by rerunning them.
- Claim: no internal company context in the record or description: verified.
- File
docs/specs/AST-134-react-native-web-data-sign-in/spec.md: the two findings above.
… on Linux and Windows; web host declarations
There was a problem hiding this comment.
Approval waits on an engineering owner deciding the draft contract in spec:AST-134: FR1–FR16 and DEC-1–DEC-5 are new requirements that no current record states, including the amendment that moves web data, bundled web content and page snapshots into web and the record's reliance on the AST-112 amendment in #12563, so it should land after #12563, #12551 and #12553. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
The library comparison is gone, the Linux and Windows Astryx Stage gaps are stated, and FR8 and FR9 name the web host declarations, so no change is required beyond that decision. Four small wording gaps are worth fixing in the same pass (inline comments): the Platform support row for AstryxWebData on Stage needs the same "where Stage shows a web view" limit as its neighbours; FR10's cancelled omits the pre-empted project sign-in that FR8 settles that way; FR5 does not say whether a Preview project's clear() signs its own fetch out; and FR1's "every method" rule also catches getConstants.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: the record depends on the foundation amendment, the web view record and the system modules record, and lands after them: verified, all three are open drafts that hold the cited claims.
- Claim: the amended foundation supplies the
weblist, the opt-in rule, the result vocabulary, the capability shape, revision 1 with named features and no revision counter, the host declarations, the Stage version floor, the evidence rule and the sign-in opt-in question: verified against that amendment. - Claim: the record amends the foundation's FR1
weblist: verified in Current-state impact; the foundation's own FR1 entry is still unchanged in its amendment. - Claim: the record stays consistent with the web view record's pin, bundled folders, sessions, warm bundle, fallbacks and private-origin decision, and asks its OQ1 alongside that record's sign-in question: verified.
- Claim: the system modules record supplies the named-feature list and the cookie-methods question: verified.
- Claim: no other record owns these five modules and no other open pull request overlaps: verified by searching the current docs and open pull requests.
- Claim: every call resolves a result and never throws,
cancelincluded, and objects with named features havesupports(feature): verified in FR1, FR2 and FR10. - Claim: every module works in the calling runtime's namespace, decided natively: verified in FR3.
- Claims: the session, page-store, bundle, snapshot and sign-in bullets of the decision, including the
timeoutpath: verified in FR4 to FR8 and DEC-1 to DEC-5. - Claim: every contract is at revision 1 with five named features and a Stage version floor: verified in FR13.
- Claim: native code uses public API only, with one gap line for a non-public field: verified in FR14.
- Claim: five gaps are recorded, and Platform support states observable guarantees with Stage described by behaviour: verified in FR14, FR15 and Platform support (one Stage cell lacks the host limit, noted above).
- Claims: open questions OQ1 to OQ5, the who-uses-it table, one rejected alternative per decision, and the claim scope and non-goals: verified.
- Claims: rubric R1 to R7, including the comparison living only in the description and the rejected alternatives only inside the decisions: verified.
- Claim: the knowledge check, Prettier and the whitespace check pass: verified by rerunning them.
- Claim: no internal company context in the record or description: verified.
- File
docs/specs/AST-134-react-native-web-data-sign-in/spec.md: no blocking finding; the four wording notes above.
| | Contract | iOS | Android | Astryx Stage | | ||
| | --------------------- | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | ||
| | `AstryxWebSessions` | Sessions in memory only; an ephemeral store is discarded with its view | Sessions in memory only; an ephemeral store is deleted with its view, with no Cache API or service workers | As on a device, where Stage shows a web view | | ||
| | `AstryxWebData` | A page store apart from the network cookie jar on iOS 17 and later; before 17, pages run with no storage | A page store apart from the network cookie jar where the WebView has multiple profiles; otherwise no page storage | As on a device: clears the page store; the policy counts its views | |
There was a problem hiding this comment.
FR15 now says AstryxWebData answers unavailable on Astryx Stage under Linux and Windows, but this cell still reads "As on a device: clears the page store" with no host limit, while the AstryxWebSessions and AstryxWebBundles cells say "where Stage shows a web view". Add the same limit here (for example "As on a device, where Stage shows a web view: clears the page store; the policy counts its views").
There was a problem hiding this comment.
Resolved in a63768b: the record no longer states Astryx Stage behaviour (it points to spec:AST-139 in Non-goals), so the Stage column is gone here; the host limit for this cell goes with it to that record.
| `cancelled` is a sign-in the person closed or a project sign-in whose | ||
| consent the person declined (`spec:AST-112/FR6`). `origin-not-trusted` is |
There was a problem hiding this comment.
Miss: FR8 settles a project sign-in that the app's runtime pre-empts as cancelled, and cancel() closes the open sign-in with no stated result, but this line defines cancelled only as a sign-in the person closed or a declined project consent. Name the pre-emption here, and say what a sign-in closed by cancel() resolves, so a caller can tell the cases apart.
There was a problem hiding this comment.
Fixed in a63768b: cancelled is now a sign-in the person closed or one that cancel() closed, and FR8 says the sign-in that cancel() closes answers cancelled. The pre-emption case is Preview behaviour and moved to spec:AST-139.
| - A Preview project's page store is the project's own, and its `fetch` | ||
| shares it. |
There was a problem hiding this comment.
Miss: FR5 says clear() "never clears the network cookie jar", but a project's fetch shares its page store, so the record does not say whether a project's clear() signs the project's own fetch out, and the FR5 verification failure "the network jar loses a cookie" would fire in a project. State which, for example: "In a project, clear() also ends the project's own fetch session; the app's jar is never touched."
There was a problem hiding this comment.
Resolved in a63768b: Preview projects are out of this record (spec:AST-139 owns them), so FR5 now speaks only of the app's page store and its network jar; the project's clear() answer goes to that record.
| - Every method takes one request object and resolves one result object | ||
| with `status`, `reason`, and `message` (`spec:AST-112/FR8`), `cancel` | ||
| included. |
There was a problem hiding this comment.
Miss: this rule covers every method in the table above, including AstryxPageSnapshots.getConstants, whose isSupported constant backs the synchronous isAvailable() (FR7; spec:AST-112/FR7). Exempt it, for example "Every method other than getConstants takes one request object …".
There was a problem hiding this comment.
Fixed in a63768b: "Every method other than getConstants takes one request object …".
…eutral dependency line; cancel and getConstants wording
|
Parked: these modules belong to an optional add-on package, which is not part of the core React Native library. The branch stays so this work can resume. |
Depends on #12563 (AST-112 as amended: package shape, named features), #12594 (AST-140, platform code rules), #12551 (AST-131, the web view) and #12553 (AST-130, the platform info module); merge order #12576 → #12563 → the platform group records, this one with or after AST-131 and AST-130.
Exact decision needed
The target contract of five React Native web modules:
AstryxWebSessionsin the core package'swebcapability, andAstryxWebData,AstryxWebBundles,AstryxPageSnapshots, andAstryxAuthSessionin the optional add-on package, not the core package, as the recordspec:AST-134(docs/specs/AST-134-react-native-web-data-sign-in/spec.md) states them. It covers each module's JavaScript API and native contract, where each ships, results and closed reasons, security and privacy behaviour, the revision-1 baseline with named features, and public API use. Astryx Stage (spec:AST-139) and Preview in the Astryx app (spec:AST-141) are separate products that conform to these contracts.Existing authority searched
spec:AST-112(React Native foundation), as amended by spec(AST-112): React Native commands are one astryx rn group; package shape (Expo wrapper, default linking, named features) #12563: FR1 (thewebcapability's contents and the app-level modules list), FR3 (thewebcapability is opt-in), FR7 (capability shape,supports(feature)), DEC-14 (revision 1 with named features and no revision counter), OQ8 (sign-in as its own opt-in), FR15 (evidence). This record details them for the five modules and amends one: FR1'swebentry becomes the web view and its sessions, and web data, bundled web content, page snapshots, and the sign-in session move to the optional add-on package.spec:AST-140(React Native platform code, open as a draft): FR1 (registration), FR3 (result vocabulary), FR5 (additive evolution, revision 1 and named features), FR6 (threads). This record cites them for those shared rules instead ofspec:AST-112FR6 and FR8.spec:AST-131(open draft, the web view): it ownsAstryxWebView,AstryxWebViewInfo, and the part ofAstryxWebSessionsthe view depends on (FR8), and places these five modules in thewebcapability with their own record. This record is that record; it stays consistent with AST-131 FR5 (pin), FR7 (bundled folders), FR8 (sessions and page storage), FR14 (warmBundle), FR16 (fallbacks), and DEC-4.spec:AST-130(open draft, system modules): FR18 (named features incontractFeatures,hasContractFeature) and OQ2 (the network cookie methods).spec:AST-139(Astryx Stage) andspec:AST-141(Preview in the Astryx app): separate products that own how Stage and Preview run these modules; this record states no Stage or Preview behaviour.docs/specs/searched forAstryxWebSessions,AstryxWebData,AstryxWebBundles,AstryxPageSnapshots,AstryxAuthSession,useAuthSession: no other record owns them.Decision
The record's requirements FR1, FR2, FR4 to FR14, and FR16, and DEC-1 to DEC-5:
AstryxWebSessionsis part of the core package's opt-inwebcapability, reached only through the capability loader; the other four modules are part of the optional add-on package, not the core package. Every call resolves a result and never throws,cancelincluded; objects with named features havesupports(feature). It amendsspec:AST-112/FR1'sweblist.AstryxWebSessionskeeps an embedded page's cookies, ephemeral store, page-storage-off mode, and pin in memory under an opaque handle; cookie values never cross as props or appear in logs.AstryxWebDataclears the runtime's page store and sets it to clear when the last view closes, never the app's network cookie jar (DEC-1).AstryxWebBundlesserves bundled folders from a private origin and answers the page's byte route from JavaScript (DEC-2), with warm pages as a named feature.AstryxPageSnapshotsdraws an HTML document inert, with no option that loosens the contract (DEC-4);timeoutanswers a renderer that does not draw within a furthertimeoutMs.AstryxAuthSessionruns sign-in in the system's authentication browser (DEC-5), with PKCE values and the state bound natively (DEC-3);cancel()closes the open sign-in, which answerscancelled.contractFeatures(AstryxWebData.networkCaches,AstryxWebBundles.warmPages,AstryxAuthSession.safariView,.followUp,.ephemeral).prefersEphemeralrefuses (OQ3), session lifetime across a reload (OQ4), and where the network-cache clear belongs (OQ5).Why this exists
Each piece has a mature open-source alternative: react-native-app-auth (AppAuth: discovery, token exchange, refresh) and expo-auth-session with expo-web-browser for sign-in; react-native-webview's cookie modes with a cookie library for sessions and clearing; react-native-webview's file access with a file library or a loopback static server for bundled folders; react-native-view-shot over an offscreen web view for snapshots. These modules take no third-party native dependency, and apps may use any of these libraries beside them without conflict. The record keeps one conclusion per piece (the gap the module fills) and leaves this comparison here. No Astryx component uses web data, bundled web content, page snapshots, or sign-in, so they ship in the optional add-on package.
Who uses it
AstryxWebSessionsWebViewthrough itssession={{sessionId}}prop: the native view resolves the handle (spec:AST-131/FR8); no component calls the module; app API (./web)AstryxWebData./web)AstryxWebBundles./web); aNativeWebViewwith a{bundle}source shows its folders (spec:AST-131/FR7)AstryxPageSnapshots./web)AstryxAuthSessionuseAuthSessionhook reaches it; app API (./web)Rejected alternatives
Claim scope and non-goals
The record governs the five modules and the
useAuthSessionhook's use ofAstryxAuthSession. It leaves out the web view and its feature report (spec:AST-131), an OAuth client (discovery, token request, refresh, storage), the network cookie jar andAstryxNetwork's cookie methods, the files module's cache, and the sign-in browser's own features. Astryx Stage (spec:AST-139) and Preview in the Astryx app (spec:AST-141) are separate products.Evidence and implementation relationship
The implementation lives in the React Native packages' platform layers (the core package's
webcapability and the optional add-on package). No public evidence links. One gap is recorded: the Android network-cache clear reaches a non-public React Native field (FR14). Platform support states each platform's observable guarantee. The record citesspec:AST-130andspec:AST-131, which are open drafts, so it lands with or after them.Writing rubric results
./testingdoubles, source checks).FR14 gap:line.spec:AST-139(Stage) andspec:AST-141(Preview) in Non-goals; FR3 and FR15 stay unused so other records' citations hold. R1 to R7 rerun over the whole record after the sweep: results as above.Scope
Components:
AstryxWebSessions,AstryxWebData,AstryxWebBundles,AstryxPageSnapshots,AstryxAuthSession,useAuthSessionValidation
node scripts/check-knowledge.mjs: "Knowledge templates and records are aligned."; no error or status warning for this record.--checkon the record: all matched files use Prettier code style.git diff --check origin/main: clean.pnpm specs:foris not runnable in this checkout (no install); skipped.