ReviewOS

also looking at this

stacks/wildloop

feat: native trail maps and complete native mobile screens

#1017
Draft chris wants to merge codex/trail-experience into main
60 files +2505 -823

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

tests/unit/native-record-screen.test.tsmodified+15-0
Changes to tests/unit/native-record-screen.test.ts
@@ -100,6 +100,21 @@ describe('native Record checkpoint recovery',()=>{
100100 const read=await waitForRequest(screen,requests(screen).indexOf(host)+1,r=>r.payload.method==='readRecording')
101101 expect(read.payload.args[0]).toMatchObject({expectedId:'run-7'})
102102 })
103 it('recovers a registered start whose native acknowledgement was interrupted',async()=>{
104 const screen=await start('Record',{},['fetch','secureStorage','storage','storageCompareAndSet','geolocation','locationRecordingOwnership','lifecycle'],new Map([['auth_token','record-token'],['wildloop-account',JSON.stringify({token:'record-token',user:{id:7}})]]))
105 const intent={...checkpoint,phase:'starting',pending:undefined}
106 const stored=await waitForRequest(screen,0,r=>r.payload.module==='Storage' && r.payload.method==='get')
107 answer(screen,stored,intent)
108 const host=await waitForRequest(screen,0,r=>r.payload.method==='getRecordingState')
109 expect(host.payload.args[0]).toEqual({expectedId:'run-7'})
110 answer(screen,host,{active:true,paused:false,id:'run-7',startedAt:100000})
111 const read=await waitForRequest(screen,0,r=>r.payload.method==='readRecording')
112 answer(screen,read,[])
113 const durable=await waitForRequest(screen,0,r=>r.payload.method==='compareAndSet')
114 expect(durable.payload.args[1]).toMatchObject({id:'run-7',phase:'starting'})
115 expect(durable.payload.args[2]).toMatchObject({id:'run-7',phase:'recording'})
116 expect(requests(screen).some(r=>r.payload.method==='startRecording')).toBe(false)
117 })
103118 it('does not read GPS when a legacy checkpoint has no verifiable host identity',async()=>{
104119 const screen=await start('Record',{},['fetch','secureStorage','storage','geolocation','locationRecordingOwnership','lifecycle','liveActivity'],new Map([['auth_token','record-token'],['wildloop-account',JSON.stringify({token:'record-token',user:{id:7}})]]))
105120 const stored=await waitForRequest(screen,0,r=>r.payload.module==='Storage' && r.payload.method==='get')