Repository navigation
spec(AST-136): React Native platform: Capture (draft) - #12575
imdreamrunner wants to merge 8 commits into
Conversation
|
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's decision on the new draft record spec:AST-136, and two fixes are needed whatever that decision is.
To approve, an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. The decision covers FR1–FR14 and DEC-1–DEC-3, in particular the new microphone capability and the core screen-capture module, whether ZXing (which every app that opts into camera links on Android) is the optional integration spec:AST-082 FR13 allows, and the recorder-owned microphone permission and the iOS hold that blocks nothing, which both depart from spec:AST-112 FR7.
- In a previewed project on Android, FR9 has
supports('preventCapture')answer true while FR11 and FR12 make the project's hold change nothing, so the project tells the person a private screen is protected when screenshots still capture it; list previewed projects among the places where it answers false. - The description says the record changes nothing in
spec:AST-112, but the record's own Current-state impact names two departures from its FR7, and FR2 keeps aversionconstant the amended FR8 drops; say so in the description and in the first Current-state impact bullet.
Smaller wording points on FR3, FR4 and FR10 are in the inline comments.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the record states the recorder, decoder and capture-hold contract as FR1–FR14 and DEC-1–DEC-3. Verified in the record.
- Claim: the record details the React Native foundation record and changes none of it. False: its Current-state impact names two FR7 departures.
- Claim:
microphoneandcamerastay opt-in and the screen-capture module is core. Verified (FR1, DEC-3). - Claim: the recorder never prompts by itself, records one file at a time into the runtime's own folder with no limit of its own, and sends native-timed levels. Verified (FR3–FR5).
- Claim: interruptions pause, a route change keeps recording, and leaving the app ends the recording with the file kept. Verified (FR6, DEC-1).
- Claim: the decoder reads a file or a picker grant with no camera and no permission, with upright bounds. Verified (FR8, DEC-2).
- Claim: the hold is counted per process and kept per runtime, covers the first frame and modal windows, and leaves an app-set flag alone. Verified (FR9, FR10).
- Claim: previewed projects cannot record, decode only their own files, and cannot read or change the app's hold. Verified (FR11).
- Claim: results never throw, contracts start at revision 1 with named features, and Astryx Stage pairs through a version floor. Verified (FR12, FR13).
- Claim: no other record owns these contracts. Verified by searching the records on the main branch.
- Claim: three gaps are recorded (Android average power, Astryx Stage audio session, one non-QR code per image on Android). Verified (Platform support).
- Claim: the writing rubric finds no narration, research, change references, long rejections, ruled open questions or project status. Verified in the record text.
- Claim: the knowledge, formatting and whitespace checks pass. Not verified: CI skipped its jobs on this draft.
- Claim: public text carries no internal company context. Verified.
- File
docs/specs/AST-136-react-native-capture/spec.md: two findings above and three wording notes.
| - The app's modal windows (the library's sheets, dialogs, menus, and | ||
| drawers on Android) are covered too: a modal shown during a hold takes | ||
| the flag from the activity, a modal already up when the first hold comes | ||
| gets the flag from the module, and both lose it with the last release | ||
| unless a web view inside the modal still holds it. |
There was a problem hiding this comment.
Non-blocking: FR9 puts the web view's preventsCapture in the same count, so no web-view hold can remain at the last release. Could this say whether web-view holds are counted per process or kept per window?
There was a problem hiding this comment.
Fixed in 40b7092: FR9 now says a web view's preventsCapture holds the window the view is in and counts in the same process count, and the last release leaves the flag on a window where a mounted web view still holds it.
…epartures; drop the revision constant
There was a problem hiding this comment.
Approval waits on an engineering owner's decision on the new draft record spec:AST-136; no defect blocks it after that.
spec:AST-136FR1–FR14 and DEC-1–DEC-3 are new draft requirements with no current spec authority, so an engineering owner records the decision by commenting/approve-spec <full head SHA>on this pull request (the author may do so as an engineering owner), settling in particular the newmicrophonecapability and the core capture module, ZXing as a required Android library ofcameraunderspec:AST-082FR13, and the two departures fromspec:AST-112FR7 left open as OQ1 and OQ2.
The two fixes requested earlier are in place. Three non-blocking points are noted on the lines: the web-view exception in FR9 and FR10 cannot apply while web-view holds share the process count, the record does not say whether usePreventCapture covers its own component's first frame, and FR1 names only the configuration plugin as the writer of the microphone declarations.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: the record depends on the four open sibling record pull requests and the promotion pull request, in the stated merge order. Verified: all five are open and unmerged.
- Claim: the amended foundation record makes
microphoneandcameraopt-in. Verified: its amended FR1 and FR5 listmicrophoneand./microphone; the version onmaindoes not. - Claim: the record departs from foundation FR7 in two places, pending OQ1 and OQ2. Verified: Current-state impact names both.
- Claim: the record follows the amended FR8 with named features and no revision counter. Verified: FR2 carries no version constant, and FR13 uses named features.
- Claim: the Media and camera, System modules and Web drafts own playback and live codes, permission states and contract features, and the web view's
preventsCapture. Verified, except that the Web draft's FR12 says only "counted across views" and does not name the shared capture count. - Claim: no other record owns these contracts, and no open pull request overlaps. Verified: no record on
mainnames them, and open pull requests name them only as scope notes. - Claim: the decision bullets, the usage table, the rejected alternatives, the non-goals and the three recorded gaps match the record. Verified, except that "covers the first frame" holds for
preventCapture()and is not stated forusePreventCapture(non-blocking). - Claim: the writing rubric results R1–R7. Verified against the record.
- Claim: the knowledge check, Prettier, the whitespace check and the leak scan pass. Verified by rerunning the knowledge check and Prettier on the head and scanning the added lines.
- File:
docs/specs/AST-136-react-native-capture/spec.md: three non-blocking notes (FR1, FR9 and FR10); otherwise clear.
| - A web view's `preventsCapture` (`spec:AST-131/FR12`) holds the window the | ||
| view is in, for as long as the view is in it, and counts in the same | ||
| process count. The last release clears the flag on every window except | ||
| one where a mounted web view still holds it. |
There was a problem hiding this comment.
Non-blocking: if a web view's preventsCapture counts in the same process count, no web view can still hold at the last release, so the exception here (and in FR10's modal bullet) never applies. The Web draft's FR12 says "counted across views", which suggests a separate count. Could this say that the process count holds only preventCapture() holds and web-view holds are kept per window, or drop the exception?
There was a problem hiding this comment.
Fixed in 0710c38: FR9 now says a web view's preventsCapture holds its window counted across views and apart from this count, so the last release of this count leaves the flag on a window a mounted web view still holds.
| - `preventCapture()` takes one hold and returns its release. Calling the | ||
| release again does nothing. `usePreventCapture(isActive = true)` holds | ||
| while the component is mounted and `isActive` is true, and releases on | ||
| unmount or when `isActive` turns false. |
There was a problem hiding this comment.
Non-blocking: FR10 promises that content rendered after preventCapture() returns is never in a frame without the flag, but the hook holds once its component is mounted, which is after the render that produces the component's own content. Could the record say whether usePreventCapture covers its own component's first frame, and if it does not, tell callers to hold before the private screen renders?
There was a problem hiding this comment.
Fixed in 0710c38: FR9 now says usePreventCapture takes its hold in a layout effect, before the system draws the component's first frame.
| the app's opt-in, the configuration plugin writes iOS's microphone usage | ||
| description and Android's `RECORD_AUDIO` permission with the microphone | ||
| hardware feature marked optional; an app that does not opt in carries |
There was a problem hiding this comment.
Non-blocking: the amended spec:AST-112 FR4 generates the native project with astryx shell or the Expo configuration plugin, and both write the same declarations. Suggest "the generated native project (spec:AST-112/FR4) carries iOS's microphone usage description and Android's RECORD_AUDIO permission …" so an app built with astryx shell is covered too.
There was a problem hiding this comment.
Fixed in 0710c38: FR1 now says the generated native project (spec:AST-112/FR4) carries the microphone declarations.
…-139; no third-party native dependency
|
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 (
spec:AST-112as amended), #12565 (spec:AST-132), #12553 (spec:AST-130), #12551 (spec:AST-131), #12579 (spec:AST-139, Astryx Stage),spec:AST-141(Preview in the Astryx app), and #12594 (spec:AST-140, platform code rules). Merge order: #12576, then #12563, then the platform records.Exact decision needed
The target contract of the React Native platform's capture pieces: the audio recorder
AstryxAudioRecorder(with themicrophoneopt-in), the image code decoderAstryxBarcode, and the screen-capture moduleAstryxScreenCapture, all part of the optional add-on package rather than the core package, as the recordspec:AST-136(docs/specs/AST-136-react-native-capture/spec.md) states them. It covers the microphone permission, recording to a file, native-timed levels, interruptions, routes and leaving the app, the system's microphone indicators, decoding codes from an image file, the counted capture hold and its first-frame and modal-window rules, no third-party native dependency and libraries beside the platform, results, fallbacks, the revision-1 baseline, and the one non-public API the group uses.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 (the package set; the add-on has no name there yet, OQ4) and FR3 (microphoneis opt-in), FR6 (results), FR7 (capability shape; explicit permissions), FR8 (additive evolution), FR11 (no Expo runtime library), FR15 (evidence). This record details them for the capture pieces and departs from FR7 in two places, pending OQ1 and OQ2: the recorder owns the microphone permission instead ofAstryxPermissions, and a hold on iOS blocks nothing and says so only throughsupports. It follows the amended FR8: named features, no revision counter.spec:AST-140(React Native platform code, draft): FR3 (result vocabulary), FR5 (additive evolution, revision-1 baseline), FR9 (no third-party native dependency; coexistence with an app's native code). Cited for those shared rules instead of the foundation record.spec:AST-132(Media and camera, draft): playback, peak levels, the camera view, live code detection, and the code types this record reuses. Referenced, not respecified.spec:AST-130(System modules, draft): the permission module's states (FR9) and the platform info module's contract features (FR8). Referenced, not respecified.spec:AST-131(Web, draft): the web view'spreventsCapture(FR12), which shares the capture count.docs/specs/searched forAstryxAudioRecorder,AstryxBarcode,AstryxScreenCapture,microphone,preventCapture,FLAG_SECURE: no other record owns these contracts.AST-136,capture,microphone,barcode, andReact Native platform: none overlaps; the sibling platform drafts name these pieces only as scope notes.Decision
The record's requirements FR1 to FR14, DEC-1 to DEC-3, and OQ1 to OQ4:
microphoneopt-in.spec:AST-139) and Preview in the Astryx app (spec:AST-141) are separate products that conform to these contracts; this record specifies neither.Who uses it
AstryxAudioRecorderAstryxAudioRecorder). A finished file plays through the library'suseAudioPlayer(spec:AST-132)AstryxBarcodeAstryxBarcode.decodeImage), often after the file picker (spec:AST-130)AstryxScreenCaptureWebView's ownpreventsCapture(spec:AST-131/FR12) stays in the core package. App API from the optional add-on package (AstryxScreenCapture,usePreventCapture)Rejected alternatives
Claim scope and non-goals
The record governs
AstryxAudioRecorder,AstryxBarcode,AstryxScreenCapture, andusePreventCapture. It leaves out playback, peak levels, the camera view, and live code detection (spec:AST-132), the permission and platform info modules (spec:AST-130), video and screen recording, audio formats other than AAC, generating codes, a drawn cover on iOS, Astryx Stage (spec:AST-139), and Preview in the Astryx app (spec:AST-141). OQ1 to OQ4 stay open: the microphone inAstryxPermissions, how iOS answers screen capture, whether still-image decoding stays native, and the add-on package's name and entries.Evidence and implementation relationship
Ecosystem comparison (research; the record keeps one conclusion per piece)
AstryxAudioRecorderAstryxBarcodeAstryxScreenCapturepreventsCapture, the flag before the first frame, the app's modal windows covered, and the count kept across runtimes and activity re-creation. iOS detection left open as OQ2.The implementation lives in the React Native package's platform layer and has no library component user, so it belongs to the optional add-on package. No public evidence links. Three gaps are recorded: Android reports no average power, Android finds at most one non-QR code per image, and Android decodes with ZXing's core library, a third-party library.
Writing rubric results
./testingdoubles).FR5,FR8, andFR11gap lines.Scope
Components:
AstryxAudioRecorder,AstryxBarcode,AstryxScreenCapture,usePreventCaptureValidation
pnpm check:knowledge(node scripts/check-knowledge.mjs): "Knowledge templates and records are aligned."; no error or status warning for this record.--check: all matched files use Prettier code style.git diff --check origin/main: clean.pnpm specs:foris not runnable in this checkout (no install); skipped.