@@ -200,6 +200,17 @@ test("Cowork contracts survive follow-ups and reject only newly-created incompat
200200 assert . equal ( cowork . enforceCoworkCommandOutput ( channelId , null , whiteboards , boardBefore ) , null ) ;
201201} ) ;
202202
203+ test ( "retained OCI channel metadata can initialize without synchronously touching runtime storage" , ( ) => {
204+ seed ( ) ;
205+ const channelId = run ( "INSERT INTO channels (name,slug,kind,topic,purpose,status,created) VALUES ('retained-cold-start','retained-cold-start','channel','','','active',?)" , now ( ) ) . lastInsertRowid ;
206+ const botId = run ( "INSERT INTO bots (name,model,prompt,created) VALUES ('retained-cold-agent','mock','Resident.',?)" , now ( ) ) . lastInsertRowid ;
207+ const agentId = run ( "INSERT INTO agents (bot_id,kind,name,status,created) VALUES (?,'channel','retained-cold-agent','ready',?)" , botId , now ( ) ) . lastInsertRowid ;
208+ run ( "INSERT INTO agent_channels (agent_id,channel_id,bound_at) VALUES (?,?,?)" , agentId , channelId , now ( ) ) ;
209+ run ( "INSERT INTO agent_profiles (agent_id,purpose,instructions,updated) VALUES (?,'Cold start','Resident.',?)" , agentId , now ( ) ) ;
210+ assert . doesNotThrow ( ( ) => agents . ensureChannelWorkspace ( channelId , { initializeRuntimeStorage : false } ) ) ;
211+ assert . equal ( q1 ( "SELECT root_ref FROM channel_workspaces WHERE channel_id=?" , channelId ) . root_ref , `channels/${ channelId } ` ) ;
212+ } ) ;
213+
203214test ( "resident raw transcript search is semantic, exact, readable, and channel-isolated" , ( ) => {
204215 const ownerId = run ( "INSERT INTO users (username,pass,display,is_admin,created) VALUES ('history-owner','x','History Owner',1,?)" , now ( ) ) . lastInsertRowid ;
205216 const channelId = run ( "INSERT INTO channels (name,slug,kind,topic,purpose,status,created_by,created) VALUES ('history-home','history-home','channel','','Recall prior sessions','active',?,?)" , ownerId , now ( ) ) . lastInsertRowid ;
0 commit comments