Skip to content
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"format:check": "oxfmt --check .",
"mock-server": "npx tsx scripts/mock-server.ts",
"repro:workspace-picker-lag": "npx tsx scripts/repro-workspace-picker-lag.ts",
"start:emulator": "node scripts/start-emulator.mjs"
"start:emulator": "node scripts/start-emulator.mjs",
"rpc-foundation:check": "tsx scripts/rpc-foundation-check.mts"
},
"dependencies": {
"@noble/hashes": "1.8.0",
Expand Down
618 changes: 618 additions & 0 deletions mobile/rpc-foundation/access-inventory.json

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions mobile/rpc-foundation/named-deltas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"baseline": "e80fae0c4d",
"regression": "bcba08b3e4",
"entries": [
{
"id": "retired-names-refused-read",
"description": "A refused retired-name read preserves the prior registry on the reference branch.",
"status": "reference-only",
"branch": {
"sha": "1043e1ebd3",
"file": "mobile/src/worktree/native-host-workspace-creation-read-operations.ts",
"line": 40
},
"main": {
"sha": "aac38d698f",
"file": "mobile/src/worktree/use-retired-worktree-names.ts",
"line": 47
}
},
{
"id": "linear-select-workspace-refusal",
"description": "The reference branch surfaces a refused Linear workspace selection.",
"status": "reference-only",
"branch": {
"sha": "1043e1ebd3",
"file": "mobile/src/tasks/native-host-task-linear-operations.ts",
"line": 24
},
"main": {
"sha": "aac38d698f",
"file": "mobile/src/tasks/mobile-tasks-filter-pickers.tsx",
"line": 173
}
},
{
"id": "malformed-error-operation-name",
"description": "Malformed outer error without a message gets a named Task provider request failed fallback on the reference branch; main constructs Error from the missing message.",
"status": "reference-only",
"branch": {
"sha": "1043e1ebd3",
"file": "mobile/src/tasks/native-host-task-detail-operations.ts",
"line": 106
},
"main": {
"sha": "aac38d698f",
"file": "mobile/src/tasks/use-mobile-tasks-item-detail-loading.tsx",
"line": 58
}
},
{
"id": "stop-ref-layout-effect",
"description": "The reference branch updates the Stop route ref in a layout effect instead of during render.",
"status": "reference-only",
"branch": {
"sha": "1043e1ebd3",
"file": "mobile/src/session/use-mobile-native-chat-stop.ts",
"line": 34
},
"main": {
"sha": "aac38d698f",
"file": "mobile/src/session/use-mobile-native-chat-stop.ts",
"line": 27
}
},
{
"id": "b1-stale-files-inventory",
"description": "Reference source bug fixed: generation and identity guards prevent reset loads poisoning a later same-workspace inventory.",
"status": "reference-only",
"branch": {
"sha": "1043e1ebd3",
"file": "mobile/src/session/native-host-session-native-chat-operations.ts",
"line": 106
},
"main": {
"sha": "aac38d698f",
"file": "mobile/src/session/use-mobile-native-chat-file-search.ts",
"line": 94
}
},
{
"id": "b2-null-project-mutation",
"description": "Reference source bug fixed: retain main per-site acceptance and rejection of null Project mutation results.",
"status": "reference-only",
"branch": {
"sha": "1043e1ebd3",
"file": "mobile/src/tasks/native-host-task-project-mutation-operations.ts",
"line": 211
},
"main": {
"sha": "aac38d698f",
"file": "mobile/src/tasks/use-mobile-tasks-project-file-merge-actions.tsx",
"line": 220
}
},
{
"id": "b3-linear-settlement-order",
"description": "Reference source bug fixed: await both raw responses before interpreting issue refusal so comments transport rejection wins.",
"status": "reference-only",
"branch": {
"sha": "1043e1ebd3",
"file": "mobile/src/tasks/native-host-task-detail-operations.ts",
"line": 72
},
"main": {
"sha": "aac38d698f",
"file": "mobile/src/tasks/use-mobile-tasks-item-detail-loading.tsx",
"line": 189
}
},
{
"id": "new-workspace-runtime-context-null-settings-typeerror",
"status": "ticket",
"description": "useNewWorkspaceRuntimeContext throws an unhandled TypeError when settings.get fulfills with a null/absent result: .settings is read off a cast with no guard and the void async effect has no catch",
"main": {
"sha": "aac38d698f",
"file": "mobile/src/components/use-new-workspace-runtime-context.ts",
"line": 53
}
}
]
}
83 changes: 83 additions & 0 deletions mobile/rpc-foundation/native-rpc-inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"schemaVersion": 1,
"scope": ["mobile/packages", "mobile/plugins"],
"extensions": ["swift", "kt", "m", "mm", "h", "java"],
"entries": [
{
"file": "mobile/packages/expo-two-way-audio/android/src/main/java/expo/modules/twowayaudio/AudioEngine.kt",
"sha256": "3e63ae5d3a382e8849f8ee81b6602908b3b6fd3df1836ba9668fff5873e192cb",
"nativeMethods": [],
"rpcCandidates": []
},
{
"file": "mobile/packages/expo-two-way-audio/android/src/main/java/expo/modules/twowayaudio/ExpoTwoWayAudioLifeCycleListener.kt",
"sha256": "e2cf2be8bd984e27c045c0691b31d73cb24a8b526e98f2915c1eb843ab82287e",
"nativeMethods": [],
"rpcCandidates": []
},
{
"file": "mobile/packages/expo-two-way-audio/android/src/main/java/expo/modules/twowayaudio/ExpoTwoWayAudioModule.kt",
"sha256": "a0a9cabb5c049b80535b28d897f497dc60b3c2fd0597206a0a142596492557fc",
"nativeMethods": [
"initialize",
"isRecording",
"toggleRecording",
"tearDown",
"restart",
"playPCMData",
"bypassVoiceProcessing",
"isPlaying",
"stopPlayback",
"pausePlayback",
"resumePlayback",
"getMicrophoneModeIOS",
"setMicrophoneModeIOS",
"getMicrophonePermissionsAsync",
"requestMicrophonePermissionsAsync"
],
"rpcCandidates": []
},
{
"file": "mobile/packages/expo-two-way-audio/android/src/main/java/expo/modules/twowayaudio/ExpoTwoWayAudioPackage.kt",
"sha256": "f9673f26ee87f7142e83bdefffba5c6aefc3f006056c8af5e8d964093e890433",
"nativeMethods": [],
"rpcCandidates": []
},
{
"file": "mobile/packages/expo-two-way-audio/ios/AudioEngine.swift",
"sha256": "424a18a4c11f6daac57f53e9f42d5b460596de1815b37530e17caed3ee9757b4",
"nativeMethods": [],
"rpcCandidates": []
},
{
"file": "mobile/packages/expo-two-way-audio/ios/ExpoTwoWayAudioModule.swift",
"sha256": "603ee85ca3a6b0127af46b59ab104b57867ab428b9ce16516ae8df4e15698706",
"nativeMethods": [
"initialize",
"isRecording",
"toggleRecording",
"getMicrophoneModeIOS",
"setMicrophoneModeIOS",
"tearDown",
"restart",
"playPCMData",
"bypassVoiceProcessing",
"isPlaying",
"stopPlayback",
"pausePlayback",
"resumePlayback",
"getMicrophonePermissionsAsync",
"requestMicrophonePermissionsAsync"
],
"rpcCandidates": []
},
{
"file": "mobile/packages/expo-two-way-audio/ios/MicrophonePermissionRequester.swift",
"sha256": "450f528defa4bb5fa3192bbdcb86a705dccf5d1982747be81c9d3c2a699ff68c",
"nativeMethods": [],
"rpcCandidates": []
}
],
"hostRpcCandidates": [],
"note": "Native ABI methods are audio operations; host dictation RPC construction lives in JavaScript and is covered by the access inventory."
}
40 changes: 40 additions & 0 deletions mobile/rpc-foundation/reference-regressions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"revision": "bcba08b3e4675fe0c687fe6346655f8ce66cd138",
"sources": [
{
"file": "mobile/src/session/native-host-session-native-chat-operations.ts",
"sha256": "2b8bf516424f730617826e3e6e180a5c3e7b3b626d0aba759c695677968d3000"
},
{
"file": "mobile/src/session/github-pr-mutations.ts",
"sha256": "9d07404d2936a7eca4a0b97aad495ae0adab01b18a15d37d9796d762edc0739a"
},
{
"file": "mobile/src/tasks/native-host-task-project-mutation-operations.ts",
"sha256": "360e0609c30ce099c9bba014b3bb8b7458f0af453351e0614cc1a12b5608a594"
},
{
"file": "mobile/src/tasks/native-host-task-detail-operations.ts",
"sha256": "92df0e2f312caeb7d6f8af20132ce6553d3343904ca2422c4a89c45344cec66b"
}
],
"supportingFunctions": ["rankSuggestions", "buildGithubPrParams", "githubPrRepoSlugParam"],
"supportingSource": "current main; ranking and sender parameter construction only, never reply acceptance or lifecycle",
"results": [
{
"id": "b1",
"killed": true,
"observed": "[\"stale/app.ts\"]"
},
{
"id": "b2",
"killed": true,
"observed": "null result accepted"
},
{
"id": "b3",
"killed": true,
"observed": "issue refused"
}
]
}
21 changes: 21 additions & 0 deletions mobile/rpc-foundation/regression-seeds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"baseline": "e80fae0c4d",
"regression": "bcba08b3e4",
"tests": [
{
"id": "b1",
"file": "mobile/src/session/use-mobile-native-chat-file-search.test.ts",
"name": "b1: reset during A-B-A ignores stale files.list inventory and preserves the fresh load"
},
{
"id": "b2",
"file": "mobile/src/tasks/use-mobile-tasks-project-file-merge-actions.test.ts",
"name": "b2: null Project mutation result does not commit success"
},
{
"id": "b3",
"file": "mobile/src/tasks/use-mobile-tasks-item-detail-loading.test.ts",
"name": "b3: comments transport error wins over an issue refusal after the raw barrier"
}
]
}
96 changes: 96 additions & 0 deletions mobile/scripts/rpc-access-inventory.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { join } from 'node:path'
import ts from 'typescript'
import { createRpcAccessResolver } from './rpc-access-resolution.mts'
import { emit, files, root } from './rpc-artifact-io.mts'

type AccessKind = 'request' | 'subscribe'
type CallSite = { file: string; line: number; column: number; kind: AccessKind; method: string }
const paths = [...files(join(root, 'mobile/src')), ...files(join(root, 'mobile/app'))].filter(
(file) => /\.[jt]sx?$/.test(file)
)
const config = ts.readConfigFile(join(root, 'mobile/tsconfig.json'), ts.sys.readFile)
const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, join(root, 'mobile'))
const program = ts.createProgram(
paths.map((file) => join(root, file)),
parsed.options
)
const calls: CallSite[] = []
const referenceFiles = new Set<string>()
let referenceCount = 0
const { entryKind, resolveKind, methods } = createRpcAccessResolver(
program,
paths.map((file) => join(root, file))
)
for (const file of paths) {
const sf = program.getSourceFile(join(root, file))!
const positions = new Set<number>()
function add(node: ts.Node, kind: AccessKind, call?: ts.CallExpression): void {
const start = node.getStart(sf)
if (positions.has(start)) {
return
}
positions.add(start)
if (!call) {
referenceCount++
referenceFiles.add(file)
return
}
const literals = methods(call.arguments[0])
const location = sf.getLineAndCharacterOfPosition(start)
calls.push({
file,
line: location.line + 1,
column: location.character + 1,
kind,
// A resolved family is every literal the checker proves may reach this argument; an
// unresolved call carries its callee text, which is what tells a listener from an RPC.
method: literals.length
? literals.join('|')
: `dynamic:${node.getText(sf).replace(/\s+/g, ' ')}`
})
}
function visit(node: ts.Node): void {
if (ts.isCallExpression(node)) {
const kind = resolveKind(node.expression)
if (kind) {
add(node.expression, kind, node)
}
}
if (ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) {
const kind = resolveKind(node)
if (kind) {
add(node, kind)
}
} else if (ts.isIdentifier(node) || ts.isStringLiteral(node)) {
const parent = node.parent
if (!(ts.isPropertyAccessExpression(parent) || ts.isElementAccessExpression(parent))) {
const kind = ts.isIdentifier(node) ? resolveKind(node) : entryKind(node.text)
if (kind) {
add(node, kind)
}
}
}
ts.forEachChild(node, visit)
}
visit(sf)
}
calls.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line || a.column - b.column)
const rows = calls.map(
(call) => `${call.file}:${call.line}:${call.column} ${call.kind} ${call.method}`
)
emit('access-inventory', {
schemaVersion: 2,
scope: ['mobile/src', 'mobile/app'],
summary: {
callSites: calls.length,
literalMethod: calls.filter((call) => !/[|:]/.test(call.method)).length,
resolvedFamily: calls.filter((call) => call.method.includes('|')).length,
unresolvedDynamic: calls.filter((call) => call.method.startsWith('dynamic:')).length,
referenceOccurrences: referenceCount,
referenceFileCount: referenceFiles.size,
note: 'calls are `file:line:column kind method`, where method is one literal, a `|`-joined family the checker resolved, or `dynamic:<callee>` when it resolved nothing. References are bare occurrences of the `sendRequest`/`subscribe` token with no call attached; only their count and files are recorded.'
},
calls: rows,
referenceFiles: [...referenceFiles].sort()
})
console.log(`access census: ${calls.length} call sites, ${referenceCount} token references`)
Loading
Loading