Use canonical host chains for automation scripts
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
/** Script credentials follow the creator's ownership, fork, and branch ancestry, in T44 order. */
|
||||
import { defineDoc } from '@earendil-works/pi-durable'
|
||||
import { BACKGROUND_CONTEXT as context } from '@earendil-works/chord/context'
|
||||
const Started = defineDoc<{by?:number}>({kind:'board.started',version:1,scope:'conversation',history:'latest',fork:'initial',checkpointWhen:()=>false,initial:()=>({})})
|
||||
export async function executionChain(host: any, creator?: number): Promise<string[]> {
|
||||
if (creator === undefined) return []
|
||||
const record = await host.harness().commit((tx: any) => tx.conversation(creator), context)
|
||||
const up = record?.owner?.conversationId ?? record?.parent?.conversationId ??
|
||||
(await host.harness().snapshot(Started, creator, context))?.by
|
||||
return [String(creator), ...await executionChain(host, up)]
|
||||
}
|
||||
Reference in New Issue
Block a user