[{"data":1,"prerenderedAt":4616},["ShallowReactive",2],{"navigation":3,"\u002Fservices\u002Fderivations":927,"mdc--ebskhy-key":4577,"mdc--72jpzy-key":4591,"mdc-vp5ag1-key":4603},[4,40,114,446,474,498,596,903],{"title":5,"path":6,"stem":7,"children":8},"Architecture","\u002Farchitecture","architecture",[9,14,28,32,36],{"title":10,"path":6,"stem":11,"access":12,"icon":13},"Overview","architecture\u002Findex","public","i-lucide-network",{"title":10,"path":15,"stem":16,"children":17,"access":12,"icon":19},"\u002Farchitecture\u002Fkernel","architecture\u002F1.kernel\u002Findex",[18,20,24],{"title":10,"path":15,"stem":16,"access":12,"icon":19},"i-lucide-box",{"title":21,"path":22,"stem":23,"access":12},"Enclave","\u002Farchitecture\u002Fkernel\u002Fenclave","architecture\u002F1.kernel\u002Fenclave",{"title":25,"path":26,"stem":27,"access":12},"Forking the enclave","\u002Farchitecture\u002Fkernel\u002Fforking-the-enclave","architecture\u002F1.kernel\u002Fforking-the-enclave",{"title":29,"path":30,"stem":31,"access":12},"Ports","\u002Farchitecture\u002Fports","architecture\u002F2.ports",{"title":33,"path":34,"stem":35,"access":12},"Service layers","\u002Farchitecture\u002Fservice-layers","architecture\u002F3.service-layers",{"title":37,"path":38,"stem":39,"access":12},"Families","\u002Farchitecture\u002Ffamilies","architecture\u002F4.families",{"title":41,"path":42,"stem":43,"children":44},"Core","\u002Fcore","core",[45,47,50,53,56,88,97],{"title":10,"path":42,"stem":46,"access":12,"icon":19},"core\u002Findex",{"title":10,"path":48,"stem":49,"access":12},"\u002Fcore\u002F01-overview","core\u002F01-overview",{"title":10,"path":51,"stem":52,"access":12},"\u002Fcore\u002F05-stores","core\u002F05-stores",{"title":10,"path":54,"stem":55,"access":12},"\u002Fcore\u002F06-permissions-and-keyring","core\u002F06-permissions-and-keyring",{"title":10,"path":57,"stem":58,"children":59,"access":12},"\u002Fcore\u002Fnoydb","core\u002F2.noydb\u002Findex",[60,61,65,68,72,76,80,84],{"title":10,"path":57,"stem":58,"access":12},{"title":62,"path":63,"stem":64,"access":12},"Noydb","\u002Fcore\u002Fnoydb\u002Fmethods","core\u002F2.noydb\u002F1.methods",{"title":21,"path":66,"stem":67,"access":12},"\u002Fcore\u002Fnoydb\u002Fenclave","core\u002F2.noydb\u002F2.enclave",{"title":69,"path":70,"stem":71,"access":12},"Secret & keyring","\u002Fcore\u002Fnoydb\u002Fkeyring","core\u002F2.noydb\u002F3.keyring",{"title":73,"path":74,"stem":75,"access":12},"Authentication","\u002Fcore\u002Fnoydb\u002Fauthentication","core\u002F2.noydb\u002F4.authentication",{"title":77,"path":78,"stem":79,"access":12},"Auth recovery","\u002Fcore\u002Fnoydb\u002Frecovery","core\u002F2.noydb\u002F5.recovery",{"title":81,"path":82,"stem":83,"access":12},"Configuration","\u002Fcore\u002Fnoydb\u002Fconfiguration","core\u002F2.noydb\u002F6.configuration",{"title":85,"path":86,"stem":87,"access":12},"Strategies","\u002Fcore\u002Fnoydb\u002Fstrategies","core\u002F2.noydb\u002F7.strategies",{"title":10,"path":89,"stem":90,"children":91,"access":12},"\u002Fcore\u002Fvault","core\u002F3.vault\u002Findex",[92,93],{"title":10,"path":89,"stem":90,"access":12},{"title":94,"path":95,"stem":96,"access":12},"Vault","\u002Fcore\u002Fvault\u002Fmethods","core\u002F3.vault\u002F1.methods",{"title":10,"path":98,"stem":99,"children":100,"access":12},"\u002Fcore\u002Fcollection","core\u002F4.collection\u002Findex",[101,102,106,110],{"title":10,"path":98,"stem":99,"access":12},{"title":103,"path":104,"stem":105,"access":12},"Collection","\u002Fcore\u002Fcollection\u002Fmethods","core\u002F4.collection\u002F1.methods",{"title":107,"path":108,"stem":109,"access":12},"Querying","\u002Fcore\u002Fcollection\u002Fquerying","core\u002F4.collection\u002F2.querying",{"title":111,"path":112,"stem":113,"access":12},"Schema","\u002Fcore\u002Fcollection\u002Fschema","core\u002F4.collection\u002F3.schema",{"title":37,"path":115,"stem":116,"children":117},"\u002Ffamilies","families",[118,121,168,194,208,212,216,294,340],{"title":10,"path":115,"stem":119,"access":12,"icon":120},"families\u002Findex","i-lucide-plug",{"title":122,"path":123,"stem":124,"children":125,"access":12,"icon":127},"as-Exports","\u002Ffamilies\u002Fas","families\u002Fas\u002Findex",[126,128,132,136,140,144,148,152,156,160,164],{"title":122,"path":123,"stem":124,"access":12,"icon":127},"i-lucide-book-open",{"title":129,"path":130,"stem":131,"access":12},"aws-s3","\u002Ffamilies\u002Fas\u002Faws-s3","families\u002Fas\u002Faws-s3",{"title":133,"path":134,"stem":135,"access":12},"blob","\u002Ffamilies\u002Fas\u002Fblob","families\u002Fas\u002Fblob",{"title":137,"path":138,"stem":139,"access":12},"csv","\u002Ffamilies\u002Fas\u002Fcsv","families\u002Fas\u002Fcsv",{"title":141,"path":142,"stem":143,"access":12},"json","\u002Ffamilies\u002Fas\u002Fjson","families\u002Fas\u002Fjson",{"title":145,"path":146,"stem":147,"access":12},"ndjson","\u002Ffamilies\u002Fas\u002Fndjson","families\u002Fas\u002Fndjson",{"title":149,"path":150,"stem":151,"access":12},"noydb","\u002Ffamilies\u002Fas\u002Fnoydb","families\u002Fas\u002Fnoydb",{"title":153,"path":154,"stem":155,"access":12},"sql","\u002Ffamilies\u002Fas\u002Fsql","families\u002Fas\u002Fsql",{"title":157,"path":158,"stem":159,"access":12},"xlsx","\u002Ffamilies\u002Fas\u002Fxlsx","families\u002Fas\u002Fxlsx",{"title":161,"path":162,"stem":163,"access":12},"xml","\u002Ffamilies\u002Fas\u002Fxml","families\u002Fas\u002Fxml",{"title":165,"path":166,"stem":167,"access":12},"zip","\u002Ffamilies\u002Fas\u002Fzip","families\u002Fas\u002Fzip",{"title":169,"path":170,"stem":171,"children":172,"access":12,"icon":127},"at-Seals","\u002Ffamilies\u002Fat","families\u002Fat\u002Findex",[173,174,178,182,186,190],{"title":169,"path":170,"stem":171,"access":12,"icon":127},{"title":175,"path":176,"stem":177,"access":12},"aws-kms","\u002Ffamilies\u002Fat\u002Faws-kms","families\u002Fat\u002Faws-kms",{"title":179,"path":180,"stem":181,"access":12},"azure-keyvault","\u002Ffamilies\u002Fat\u002Fazure-keyvault","families\u002Fat\u002Fazure-keyvault",{"title":183,"path":184,"stem":185,"access":12},"env","\u002Ffamilies\u002Fat\u002Fenv","families\u002Fat\u002Fenv",{"title":187,"path":188,"stem":189,"access":12},"gcp-kms","\u002Ffamilies\u002Fat\u002Fgcp-kms","families\u002Fat\u002Fgcp-kms",{"title":191,"path":192,"stem":193,"access":12},"macos-keychain","\u002Ffamilies\u002Fat\u002Fmacos-keychain","families\u002Fat\u002Fmacos-keychain",{"title":195,"path":196,"stem":197,"children":198,"access":12,"icon":127},"by-Sessions","\u002Ffamilies\u002Fby","families\u002Fby\u002Findex",[199,200,204],{"title":195,"path":196,"stem":197,"access":12,"icon":127},{"title":201,"path":202,"stem":203,"access":12},"peer","\u002Ffamilies\u002Fby\u002Fpeer","families\u002Fby\u002Fpeer",{"title":205,"path":206,"stem":207,"access":12},"tabs","\u002Ffamilies\u002Fby\u002Ftabs","families\u002Fby\u002Ftabs",{"title":209,"path":210,"stem":211,"access":12},"Classifying a package","\u002Ffamilies\u002Fclassification","families\u002Fclassification",{"title":213,"path":214,"stem":215,"access":12},"Command-line tools","\u002Ffamilies\u002Fcli","families\u002Fcli",{"title":217,"path":218,"stem":219,"children":220,"access":12,"icon":127},"in-Frameworks","\u002Ffamilies\u002Fin","families\u002Fin\u002Findex",[221,222,226,230,234,238,242,246,250,254,258,262,266,270,274,278,282,286,290],{"title":217,"path":218,"stem":219,"access":12,"icon":127},{"title":223,"path":224,"stem":225,"access":12},"ai","\u002Ffamilies\u002Fin\u002Fai","families\u002Fin\u002Fai",{"title":227,"path":228,"stem":229,"access":12},"devtools","\u002Ffamilies\u002Fin\u002Fdevtools","families\u002Fin\u002Fdevtools",{"title":231,"path":232,"stem":233,"access":12},"devtools-tui","\u002Ffamilies\u002Fin\u002Fdevtools-tui","families\u002Fin\u002Fdevtools-tui",{"title":235,"path":236,"stem":237,"access":12},"liff","\u002Ffamilies\u002Fin\u002Fliff","families\u002Fin\u002Fliff",{"title":239,"path":240,"stem":241,"access":12},"nextjs","\u002Ffamilies\u002Fin\u002Fnextjs","families\u002Fin\u002Fnextjs",{"title":243,"path":244,"stem":245,"access":12},"nuxt","\u002Ffamilies\u002Fin\u002Fnuxt","families\u002Fin\u002Fnuxt",{"title":247,"path":248,"stem":249,"access":12},"pinia","\u002Ffamilies\u002Fin\u002Fpinia","families\u002Fin\u002Fpinia",{"title":251,"path":252,"stem":253,"access":12},"pwa","\u002Ffamilies\u002Fin\u002Fpwa","families\u002Fin\u002Fpwa",{"title":255,"path":256,"stem":257,"access":12},"react","\u002Ffamilies\u002Fin\u002Freact","families\u002Fin\u002Freact",{"title":259,"path":260,"stem":261,"access":12},"relay","\u002Ffamilies\u002Fin\u002Frelay","families\u002Fin\u002Frelay",{"title":263,"path":264,"stem":265,"access":12},"rest","\u002Ffamilies\u002Fin\u002Frest","families\u002Fin\u002Frest",{"title":267,"path":268,"stem":269,"access":12},"solid","\u002Ffamilies\u002Fin\u002Fsolid","families\u002Fin\u002Fsolid",{"title":271,"path":272,"stem":273,"access":12},"svelte","\u002Ffamilies\u002Fin\u002Fsvelte","families\u002Fin\u002Fsvelte",{"title":275,"path":276,"stem":277,"access":12},"tanstack-query","\u002Ffamilies\u002Fin\u002Ftanstack-query","families\u002Fin\u002Ftanstack-query",{"title":279,"path":280,"stem":281,"access":12},"tanstack-table","\u002Ffamilies\u002Fin\u002Ftanstack-table","families\u002Fin\u002Ftanstack-table",{"title":283,"path":284,"stem":285,"access":12},"vue","\u002Ffamilies\u002Fin\u002Fvue","families\u002Fin\u002Fvue",{"title":287,"path":288,"stem":289,"access":12},"yjs","\u002Ffamilies\u002Fin\u002Fyjs","families\u002Fin\u002Fyjs",{"title":291,"path":292,"stem":293,"access":12},"zustand","\u002Ffamilies\u002Fin\u002Fzustand","families\u002Fin\u002Fzustand",{"title":295,"path":296,"stem":297,"children":298,"access":12,"icon":127},"on-Auth","\u002Ffamilies\u002Fon","families\u002Fon\u002Findex",[299,300,304,308,312,316,320,324,328,332,336],{"title":295,"path":296,"stem":297,"access":12,"icon":127},{"title":301,"path":302,"stem":303,"access":12},"email-otp","\u002Ffamilies\u002Fon\u002Femail-otp","families\u002Fon\u002Femail-otp",{"title":305,"path":306,"stem":307,"access":12},"magic-link","\u002Ffamilies\u002Fon\u002Fmagic-link","families\u002Fon\u002Fmagic-link",{"title":309,"path":310,"stem":311,"access":12},"oidc","\u002Ffamilies\u002Fon\u002Foidc","families\u002Fon\u002Foidc",{"title":313,"path":314,"stem":315,"access":12},"password","\u002Ffamilies\u002Fon\u002Fpassword","families\u002Fon\u002Fpassword",{"title":317,"path":318,"stem":319,"access":12},"pin","\u002Ffamilies\u002Fon\u002Fpin","families\u002Fon\u002Fpin",{"title":321,"path":322,"stem":323,"access":12},"recovery","\u002Ffamilies\u002Fon\u002Frecovery","families\u002Fon\u002Frecovery",{"title":325,"path":326,"stem":327,"access":12},"shamir","\u002Ffamilies\u002Fon\u002Fshamir","families\u002Fon\u002Fshamir",{"title":329,"path":330,"stem":331,"access":12},"threat","\u002Ffamilies\u002Fon\u002Fthreat","families\u002Fon\u002Fthreat",{"title":333,"path":334,"stem":335,"access":12},"totp","\u002Ffamilies\u002Fon\u002Ftotp","families\u002Fon\u002Ftotp",{"title":337,"path":338,"stem":339,"access":12},"webauthn","\u002Ffamilies\u002Fon\u002Fwebauthn","families\u002Fon\u002Fwebauthn",{"title":341,"path":342,"stem":343,"children":344,"access":12,"icon":127},"to-Stores","\u002Ffamilies\u002Fto","families\u002Fto\u002Findex",[345,346,350,353,357,361,365,370,374,378,382,386,390,394,398,402,406,410,414,417,421,425,429,434,438,442],{"title":341,"path":342,"stem":343,"access":12,"icon":127},{"title":347,"path":348,"stem":349,"access":12},"aws-dynamo","\u002Ffamilies\u002Fto\u002Faws-dynamo","families\u002Fto\u002Faws-dynamo",{"title":129,"path":351,"stem":352,"access":12},"\u002Ffamilies\u002Fto\u002Faws-s3","families\u002Fto\u002Faws-s3",{"title":354,"path":355,"stem":356,"access":12},"browser-fs","\u002Ffamilies\u002Fto\u002Fbrowser-fs","families\u002Fto\u002Fbrowser-fs",{"title":358,"path":359,"stem":360,"access":12},"browser-idb","\u002Ffamilies\u002Fto\u002Fbrowser-idb","families\u002Fto\u002Fbrowser-idb",{"title":362,"path":363,"stem":364,"access":12},"browser-local","\u002Ffamilies\u002Fto\u002Fbrowser-local","families\u002Fto\u002Fbrowser-local",{"title":366,"path":367,"stem":368,"access":12,"icon":369},"Choosing a store","\u002Ffamilies\u002Fto\u002Fchoosing-a-store","families\u002Fto\u002Fchoosing-a-store","i-lucide-split",{"title":371,"path":372,"stem":373,"access":12},"cloudflare-d1","\u002Ffamilies\u002Fto\u002Fcloudflare-d1","families\u002Fto\u002Fcloudflare-d1",{"title":375,"path":376,"stem":377,"access":12},"cloudflare-r2","\u002Ffamilies\u002Fto\u002Fcloudflare-r2","families\u002Fto\u002Fcloudflare-r2",{"title":379,"path":380,"stem":381,"access":12},"drive","\u002Ffamilies\u002Fto\u002Fdrive","families\u002Fto\u002Fdrive",{"title":383,"path":384,"stem":385,"access":12},"file","\u002Ffamilies\u002Fto\u002Ffile","families\u002Fto\u002Ffile",{"title":387,"path":388,"stem":389,"access":12},"icloud","\u002Ffamilies\u002Fto\u002Ficloud","families\u002Fto\u002Ficloud",{"title":391,"path":392,"stem":393,"access":12},"memory","\u002Ffamilies\u002Fto\u002Fmemory","families\u002Fto\u002Fmemory",{"title":395,"path":396,"stem":397,"access":12},"meter","\u002Ffamilies\u002Fto\u002Fmeter","families\u002Fto\u002Fmeter",{"title":399,"path":400,"stem":401,"access":12},"mysql","\u002Ffamilies\u002Fto\u002Fmysql","families\u002Fto\u002Fmysql",{"title":403,"path":404,"stem":405,"access":12},"nfs","\u002Ffamilies\u002Fto\u002Fnfs","families\u002Fto\u002Fnfs",{"title":407,"path":408,"stem":409,"access":12},"postgres","\u002Ffamilies\u002Fto\u002Fpostgres","families\u002Fto\u002Fpostgres",{"title":411,"path":412,"stem":413,"access":12},"probe","\u002Ffamilies\u002Fto\u002Fprobe","families\u002Fto\u002Fprobe",{"title":263,"path":415,"stem":416,"access":12},"\u002Ffamilies\u002Fto\u002Frest","families\u002Fto\u002Frest",{"title":418,"path":419,"stem":420,"access":12},"smb","\u002Ffamilies\u002Fto\u002Fsmb","families\u002Fto\u002Fsmb",{"title":422,"path":423,"stem":424,"access":12},"sqlite","\u002Ffamilies\u002Fto\u002Fsqlite","families\u002Fto\u002Fsqlite",{"title":426,"path":427,"stem":428,"access":12},"ssh","\u002Ffamilies\u002Fto\u002Fssh","families\u002Fto\u002Fssh",{"title":430,"path":431,"stem":432,"access":12,"icon":433},"Store-locator descriptors","\u002Ffamilies\u002Fto\u002Fstore-locator","families\u002Fto\u002Fstore-locator","i-lucide-map-pin",{"title":435,"path":436,"stem":437,"access":12},"supabase","\u002Ffamilies\u002Fto\u002Fsupabase","families\u002Fto\u002Fsupabase",{"title":439,"path":440,"stem":441,"access":12},"turso","\u002Ffamilies\u002Fto\u002Fturso","families\u002Fto\u002Fturso",{"title":443,"path":444,"stem":445,"access":12},"webdav","\u002Ffamilies\u002Fto\u002Fwebdav","families\u002Fto\u002Fwebdav",{"title":447,"path":448,"stem":449,"children":450},"Faq","\u002Ffaq","faq",[451,454,458,462,466,470],{"title":10,"path":448,"stem":452,"access":12,"icon":453},"faq\u002Findex","i-lucide-circle-help",{"title":455,"path":456,"stem":457,"access":12},"Where can noy-db run?","\u002Ffaq\u002Fwhere-can-noy-db-run","faq\u002F1.where-can-noy-db-run",{"title":459,"path":460,"stem":461,"access":12},"Native mobile & PWA","\u002Ffaq\u002Fmobile-and-pwa","faq\u002F2.mobile-and-pwa",{"title":463,"path":464,"stem":465,"access":12},"Threat model","\u002Ffaq\u002Fthreat-model","faq\u002F3.threat-model",{"title":467,"path":468,"stem":469,"access":12},"Community & ecosystem","\u002Ffaq\u002Fcommunity-and-ecosystem","faq\u002F4.community-and-ecosystem",{"title":471,"path":472,"stem":473,"access":12},"Licensing","\u002Ffaq\u002Flicensing","faq\u002F5.licensing",{"title":475,"path":476,"stem":477,"children":478},"Glossary","\u002Fglossary","glossary",[479,482,486,490,494],{"title":10,"path":476,"stem":480,"access":12,"icon":481},"glossary\u002Findex","i-lucide-book-a",{"title":483,"path":484,"stem":485,"access":12},"Core vocabulary","\u002Fglossary\u002Fcore-vocabulary","glossary\u002Fcore-vocabulary",{"title":487,"path":488,"stem":489,"access":12},"Deletion vocabulary","\u002Fglossary\u002Fdeletion","glossary\u002Fdeletion",{"title":491,"path":492,"stem":493,"access":12},"Satellite collection vocabulary","\u002Fglossary\u002Fsatellite-collections","glossary\u002Fsatellite-collections",{"title":495,"path":496,"stem":497,"access":12},"Schema migration vocabulary","\u002Fglossary\u002Fschema-migration","glossary\u002Fschema-migration",{"title":499,"path":500,"stem":501,"children":502},"Recipes","\u002Frecipes","recipes",[503,506,510,514,518,522,526,530,534,538,542,546,550,554,558,562,567,571,575,580,584,588,592],{"title":10,"path":500,"stem":504,"access":12,"icon":505},"recipes\u002Findex","i-lucide-play",{"title":507,"path":508,"stem":509,"access":12},"Accounting app","\u002Frecipes\u002Faccounting-app","recipes\u002Faccounting-app",{"title":511,"path":512,"stem":513,"access":12},"Analytics app","\u002Frecipes\u002Fanalytics-app","recipes\u002Fanalytics-app",{"title":515,"path":516,"stem":517,"access":12},"Attestation verifier","\u002Frecipes\u002Fattestation-verifier","recipes\u002Fattestation-verifier",{"title":519,"path":520,"stem":521,"access":12},"AWS-KMS attestation","\u002Frecipes\u002Faws-kms-pdf-attestation","recipes\u002Faws-kms-pdf-attestation",{"title":523,"path":524,"stem":525,"access":12},"Browser durability","\u002Frecipes\u002Fbrowser-durability","recipes\u002Fbrowser-durability",{"title":527,"path":528,"stem":529,"access":12},"Production cloud store","\u002Frecipes\u002Fcloud-store","recipes\u002Fcloud-store",{"title":531,"path":532,"stem":533,"access":12},"Compose your own setup","\u002Frecipes\u002Fcompose-your-own","recipes\u002Fcompose-your-own",{"title":535,"path":536,"stem":537,"access":12},"Confidential HR records","\u002Frecipes\u002Fconfidential-hr","recipes\u002Fconfidential-hr",{"title":539,"path":540,"stem":541,"access":12},"Composing an echo secret","\u002Frecipes\u002Fecho-secret-enrollment","recipes\u002Fecho-secret-enrollment",{"title":543,"path":544,"stem":545,"access":12},"Email archive","\u002Frecipes\u002Femail-archive","recipes\u002Femail-archive",{"title":547,"path":548,"stem":549,"access":12},"Email archive — threads & revisions","\u002Frecipes\u002Femail-archive-threads-revisions","recipes\u002Femail-archive-threads-revisions",{"title":551,"path":552,"stem":553,"access":12},"Export & portability","\u002Frecipes\u002Fexport-portability","recipes\u002Fexport-portability",{"title":555,"path":556,"stem":557,"access":12},"Passwordless OIDC (AWS Cognito)","\u002Frecipes\u002Fpasswordless-oidc","recipes\u002Fpasswordless-oidc",{"title":559,"path":560,"stem":561,"access":12},"Personal notebook","\u002Frecipes\u002Fpersonal-notebook","recipes\u002Fpersonal-notebook",{"title":563,"path":564,"stem":565,"access":12,"icon":566},"Playgrounds","\u002Frecipes\u002Fplaygrounds","recipes\u002Fplaygrounds","i-lucide-gamepad-2",{"title":568,"path":569,"stem":570,"access":12},"React invoice app","\u002Frecipes\u002Freact-invoices","recipes\u002Freact-invoices",{"title":572,"path":573,"stem":574,"access":12},"Collaborative app","\u002Frecipes\u002Frealtime-crdt-app","recipes\u002Frealtime-crdt-app",{"title":576,"path":577,"stem":578,"access":12,"icon":579},"Run the showcases","\u002Frecipes\u002Frun-the-showcases","recipes\u002Frun-the-showcases","i-lucide-flask-conical",{"title":581,"path":582,"stem":583,"access":12},"Search & RAG","\u002Frecipes\u002Fsearch-rag","recipes\u002Fsearch-rag",{"title":585,"path":586,"stem":587,"access":12},"Team vault topology","\u002Frecipes\u002Fteam-vault-topology","recipes\u002Fteam-vault-topology",{"title":589,"path":590,"stem":591,"access":12},"Unlock ceremonies","\u002Frecipes\u002Funlock-ceremonies","recipes\u002Funlock-ceremonies",{"title":593,"path":594,"stem":595,"access":12},"User preferences","\u002Frecipes\u002Fuser-preferences","recipes\u002Fuser-preferences",{"title":597,"path":598,"stem":599,"children":600},"Services","\u002Fservices","services",[601,604,608,612,616,620,624,628,632,636,640,644,648,652,656,660,664,668,672,676,680,684,688,692,696,700,704,710,714,718,722,726,730,734,738,742,746,750,755,759,763,767,771,775,779,783,787,791,795,799,803,807,811,815,819,823,827,831,835,839,843,847,851,855,859,863,867,871,875,879,883,887,891,895,899],{"title":10,"path":598,"stem":602,"access":12,"icon":603},"services\u002Findex","i-lucide-layers",{"title":605,"path":606,"stem":607,"access":12},"archive","\u002Fservices\u002Farchive","services\u002Farchive",{"title":609,"path":610,"stem":611,"access":12},"attestation","\u002Fservices\u002Fattestation","services\u002Fattestation",{"title":613,"path":614,"stem":615,"access":12},"auth-introspection","\u002Fservices\u002Fauth-introspection","services\u002Fauth-introspection",{"title":617,"path":618,"stem":619,"access":12},"auth-landscape","\u002Fservices\u002Fauth-landscape","services\u002Fauth-landscape",{"title":621,"path":622,"stem":623,"access":12},"blobs","\u002Fservices\u002Fblobs","services\u002Fblobs",{"title":625,"path":626,"stem":627,"access":12},"broker","\u002Fservices\u002Fbroker","services\u002Fbroker",{"title":629,"path":630,"stem":631,"access":12},"bundle","\u002Fservices\u002Fbundle","services\u002Fbundle",{"title":633,"path":634,"stem":635,"access":12},"classified","\u002Fservices\u002Fclassified","services\u002Fclassified",{"title":637,"path":638,"stem":639,"access":12},"computed","\u002Fservices\u002Fcomputed","services\u002Fcomputed",{"title":641,"path":642,"stem":643,"access":12},"consent","\u002Fservices\u002Fconsent","services\u002Fconsent",{"title":645,"path":646,"stem":647,"access":12},"cover","\u002Fservices\u002Fcover","services\u002Fcover",{"title":649,"path":650,"stem":651,"access":12},"coverage","\u002Fservices\u002Fcoverage","services\u002Fcoverage",{"title":653,"path":654,"stem":655,"access":12},"crdt","\u002Fservices\u002Fcrdt","services\u002Fcrdt",{"title":657,"path":658,"stem":659,"access":12},"cross-join","\u002Fservices\u002Fcross-join","services\u002Fcross-join",{"title":661,"path":662,"stem":663,"access":12},"custody","\u002Fservices\u002Fcustody","services\u002Fcustody",{"title":665,"path":666,"stem":667,"access":12},"derivations","\u002Fservices\u002Fderivations","services\u002Fderivations",{"title":669,"path":670,"stem":671,"access":12},"directory","\u002Fservices\u002Fdirectory","services\u002Fdirectory",{"title":673,"path":674,"stem":675,"access":12},"search — AI","\u002Fservices\u002Fembeddings","services\u002Fembeddings",{"title":677,"path":678,"stem":679,"access":12},"Field metadata","\u002Fservices\u002Ffield-metadata","services\u002Ffield-metadata",{"title":681,"path":682,"stem":683,"access":12},"Foreign refs","\u002Fservices\u002Fforeign-refs","services\u002Fforeign-refs",{"title":685,"path":686,"stem":687,"access":12},"forget","\u002Fservices\u002Fforget","services\u002Fforget",{"title":689,"path":690,"stem":691,"access":12},"governance","\u002Fservices\u002Fgovernance","services\u002Fgovernance",{"title":693,"path":694,"stem":695,"access":12},"guards","\u002Fservices\u002Fguards","services\u002Fguards",{"title":697,"path":698,"stem":699,"access":12},"history","\u002Fservices\u002Fhistory","services\u002Fhistory",{"title":701,"path":702,"stem":703,"access":12},"i18n","\u002Fservices\u002Fi18n","services\u002Fi18n",{"title":705,"path":706,"stem":707,"children":708,"access":12},"indexing","\u002Fservices\u002Findexing","services\u002Findexing",[709],{"title":705,"path":706,"stem":707,"access":12},{"title":711,"path":712,"stem":713,"access":12},"introspection","\u002Fservices\u002Fintrospection","services\u002Fintrospection",{"title":715,"path":716,"stem":717,"access":12},"joins","\u002Fservices\u002Fjoins","services\u002Fjoins",{"title":719,"path":720,"stem":721,"access":12},"lazy","\u002Fservices\u002Flazy","services\u002Flazy",{"title":723,"path":724,"stem":725,"access":12},"links","\u002Fservices\u002Flinks","services\u002Flinks",{"title":727,"path":728,"stem":729,"access":12},"live","\u002Fservices\u002Flive","services\u002Flive",{"title":731,"path":732,"stem":733,"access":12},"lookup","\u002Fservices\u002Flookup","services\u002Flookup",{"title":735,"path":736,"stem":737,"access":12},"manifest","\u002Fservices\u002Fmanifest","services\u002Fmanifest",{"title":739,"path":740,"stem":741,"access":12},"materialized-views","\u002Fservices\u002Fmaterialized-views","services\u002Fmaterialized-views",{"title":743,"path":744,"stem":745,"access":12},"Metadata ladder","\u002Fservices\u002Fmetadata-ladder","services\u002Fmetadata-ladder",{"title":747,"path":748,"stem":749,"access":12},"Metadata riders","\u002Fservices\u002Fmetadata-riders","services\u002Fmetadata-riders",{"title":751,"path":752,"stem":753,"access":12,"badge":754},"metrics","\u002Fservices\u002Fmetrics","services\u002Fmetrics","Planned",{"title":756,"path":757,"stem":758,"access":12,"badge":754},"migrations","\u002Fservices\u002Fmigrations","services\u002Fmigrations",{"title":760,"path":761,"stem":762,"access":12},"money","\u002Fservices\u002Fmoney","services\u002Fmoney",{"title":764,"path":765,"stem":766,"access":12},"numbering","\u002Fservices\u002Fnumbering","services\u002Fnumbering",{"title":768,"path":769,"stem":770,"access":12},"overlay-views","\u002Fservices\u002Foverlay-views","services\u002Foverlay-views",{"title":772,"path":773,"stem":774,"access":12,"badge":754},"partitioning","\u002Fservices\u002Fpartitioning","services\u002Fpartitioning",{"title":776,"path":777,"stem":778,"access":12},"periods","\u002Fservices\u002Fperiods","services\u002Fperiods",{"title":780,"path":781,"stem":782,"access":12},"persisted-schemas","\u002Fservices\u002Fpersisted-schemas","services\u002Fpersisted-schemas",{"title":784,"path":785,"stem":786,"access":12},"plaintext-bypass","\u002Fservices\u002Fplaintext-bypass","services\u002Fplaintext-bypass",{"title":788,"path":789,"stem":790,"access":12},"pod-redirect","\u002Fservices\u002Fpod-redirect","services\u002Fpod-redirect",{"title":792,"path":793,"stem":794,"access":12},"pod-signature","\u002Fservices\u002Fpod-signature","services\u002Fpod-signature",{"title":796,"path":797,"stem":798,"access":12},"policy","\u002Fservices\u002Fpolicy","services\u002Fpolicy",{"title":800,"path":801,"stem":802,"access":12},"portability","\u002Fservices\u002Fportability","services\u002Fportability",{"title":804,"path":805,"stem":806,"access":12},"reduce","\u002Fservices\u002Freduce","services\u002Freduce",{"title":808,"path":809,"stem":810,"access":12},"routing","\u002Fservices\u002Frouting","services\u002Frouting",{"title":812,"path":813,"stem":814,"access":12},"satellites","\u002Fservices\u002Fsatellites","services\u002Fsatellites",{"title":816,"path":817,"stem":818,"access":12},"schema-identifiers","\u002Fservices\u002Fschema-identifiers","services\u002Fschema-identifiers",{"title":820,"path":821,"stem":822,"access":12},"schema-update","\u002Fservices\u002Fschema-update","services\u002Fschema-update",{"title":824,"path":825,"stem":826,"access":12},"sealed-record","\u002Fservices\u002Fsealed-record","services\u002Fsealed-record",{"title":828,"path":829,"stem":830,"access":12},"sealing provider id","\u002Fservices\u002Fsealing-pid-stability","services\u002Fsealing-pid-stability",{"title":832,"path":833,"stem":834,"access":12},"search — full-text","\u002Fservices\u002Fsearch","services\u002Fsearch",{"title":836,"path":837,"stem":838,"access":12},"sequence","\u002Fservices\u002Fsequence","services\u002Fsequence",{"title":840,"path":841,"stem":842,"access":12},"session","\u002Fservices\u002Fsession","services\u002Fsession",{"title":844,"path":845,"stem":846,"access":12},"session-tiers","\u002Fservices\u002Fsession-tiers","services\u002Fsession-tiers",{"title":848,"path":849,"stem":850,"access":12},"shadow","\u002Fservices\u002Fshadow","services\u002Fshadow",{"title":852,"path":853,"stem":854,"access":12},"share-link","\u002Fservices\u002Fshare-link","services\u002Fshare-link",{"title":856,"path":857,"stem":858,"access":12},"snapshots","\u002Fservices\u002Fsnapshots","services\u002Fsnapshots",{"title":860,"path":861,"stem":862,"access":12},"store capabilities","\u002Fservices\u002Fstorage-capability-matrix","services\u002Fstorage-capability-matrix",{"title":864,"path":865,"stem":866,"access":12},"sync","\u002Fservices\u002Fsync","services\u002Fsync",{"title":868,"path":869,"stem":870,"access":12},"team","\u002Fservices\u002Fteam","services\u002Fteam",{"title":872,"path":873,"stem":874,"access":12},"tiers","\u002Fservices\u002Ftiers","services\u002Ftiers",{"title":876,"path":877,"stem":878,"access":12},"transactions","\u002Fservices\u002Ftransactions","services\u002Ftransactions",{"title":880,"path":881,"stem":882,"access":12},"partitions","\u002Fservices\u002Ftransferable-partitions","services\u002Ftransferable-partitions",{"title":884,"path":885,"stem":886,"access":12},"user-envelope","\u002Fservices\u002Fuser-envelope","services\u002Fuser-envelope",{"title":888,"path":889,"stem":890,"access":12,"badge":754},"validation","\u002Fservices\u002Fvalidation","services\u002Fvalidation",{"title":892,"path":893,"stem":894,"access":12},"vault-head","\u002Fservices\u002Fvault-head","services\u002Fvault-head",{"title":896,"path":897,"stem":898,"access":12},"via","\u002Fservices\u002Fvia","services\u002Fvia",{"title":900,"path":901,"stem":902,"access":12},"withdrawal","\u002Fservices\u002Fwithdrawal","services\u002Fwithdrawal",{"title":904,"path":905,"stem":906,"children":907},"Start","\u002Fstart","start",[908,911,915,919,923],{"title":10,"path":905,"stem":909,"access":12,"icon":910},"start\u002Findex","i-lucide-flag",{"title":912,"path":913,"stem":914,"access":12},"Install","\u002Fstart\u002Finstall","start\u002F1.install",{"title":916,"path":917,"stem":918,"access":12},"Your first vault","\u002Fstart\u002Ffirst-vault","start\u002F2.first-vault",{"title":920,"path":921,"stem":922,"access":12},"Your first service","\u002Fstart\u002Ffirst-service","start\u002F3.first-service",{"title":924,"path":925,"stem":926,"access":12},"See the ciphertext","\u002Fstart\u002Fsee-the-ciphertext","start\u002F4.see-the-ciphertext",{"id":928,"title":665,"access":12,"apiToc":929,"body":930,"category":4568,"description":4569,"extension":4570,"meta":4571,"navigation":4568,"nest":4572,"path":666,"seo":4573,"sinceVersion":4568,"status":4574,"stem":667,"subtitle":4568,"tier":4575,"tocExternal":4568,"__hash__":4576},"docs\u002Fservices\u002Fderivations.md",false,{"type":931,"value":932,"toc":4530},"minimark",[933,936,973,977,982,997,1004,1008,1039,1043,1533,1537,1547,1771,1775,1783,1797,2161,2185,2188,2193,2206,2385,2388,2392,2409,2722,2803,2810,2839,2940,2974,2980,2990,3119,3141,3156,3162,3178,3182,3193,3233,3237,3255,3327,3345,3351,3361,3521,3585,3612,3617,3631,3789,3792,3825,3831,3835,3856,3874,3888,3893,3913,3918,3927,3968,3980,3986,3993,4039,4044,4047,4175,4195,4199,4205,4213,4217,4223,4263,4267,4304,4308,4335,4339,4343,4349,4353,4363,4367,4412,4416,4424,4465,4469,4526],[934,935,665],"h1",{"id":665},[937,938,939,946,947,952,953,956,957,960,961,964,965,972],"p",{},[940,941,942],"strong",{},[943,944,945],"code",{},"withDerivation()"," keeps computed data in sync with its source: a deterministic function\nprojects one source record into one or more typed outputs, encrypted the same way as everything\nelse in a ",[948,949,951],"a",{"href":950},"..\u002Fcore\u002F01-overview","vault",". It is one of three related derived-data\nservices registered on ",[943,954,955],{},"createNoydb","; the other two have their own pages —\n",[948,958,739],{"href":959},".\u002Fmaterialized-views"," persist the result of an entire query as a live\ncollection, and ",[948,962,768],{"href":963},".\u002Foverlay-views"," let an operator override specific rows. All\nthree share one cycle detector (checked once when a vault opens) and one rule for internal cleanup:\nsystem-issued deletes (tombstones, refresh-driven row removal) bypass your own\n",[948,966,968,971],{"href":967},".\u002Fguards",[943,969,970],{},"onDelete"," guards"," — the write-time rules a collection can register to reject a\ndelete — so housekeeping never deadlocks a rule you wrote for humans.",[974,975],"service-meta",{":rows":976},"[{\"label\":\"Subpath\",\"value\":\"`@noy-db\u002Fhub\u002Fderivations`\"},{\"label\":\"Factory\",\"value\":\"`withDerivation()`\"},{\"label\":\"Layer\",\"value\":\"`with-formula`\"}]",[978,979,981],"h2",{"id":980},"what-it-does","What it does",[937,983,984,987,988,991,992,996],{},[943,985,986],{},"withDerivation"," lets a vault declare a deterministic function that turns one source record into\none or more typed outputs — for example, a PDF source row that derives extracted metadata and\nsearchable text into two separate collections. The ",[943,989,990],{},"derive"," function runs on plaintext, after the\nsource collection's ",[948,993,995],{"href":994},"..\u002Fcore\u002Fnoydb\u002Fenclave","data-encryption key (DEK)"," is unwrapped, and every\noutput is re-encrypted with the same DEK before it reaches the store — a storage backend that only\never sees ciphertext cannot reconstruct the derivation graph by listing records.",[937,998,999,1000,1003],{},"Reach for it when you're splitting a large record into faster-to-read projections, keeping side\ndata encrypted under the same key as its source, mixing cheap eager outputs with expensive lazy\nones, or need a bulk recompute path after a strategy change (",[943,1001,1002],{},"vault.deriveAll",").",[978,1005,1007],{"id":1006},"prerequisites","Prerequisites",[1009,1010,1011,1021],"ul",{},[1012,1013,1014,1017,1018,1020],"li",{},[940,1015,1016],{},"None"," for same-collection derivations — ",[943,1019,945],{}," plus the strategy declarations on this page.",[1012,1022,1023,1031,1032,1035,1036,1038],{},[1024,1025,1026,1027,1030],"em",{},"For FK-keyed triggers (",[943,1028,1029],{},"triggerBy","):"," the trigger field must be indexed, which requires ",[943,1033,1034],{},"indexingStrategy: withIndexing()"," — see ",[948,1037,705],{"href":706},".",[978,1040,1042],{"id":1041},"opt-in","Opt in",[1044,1045,1050],"pre",{"className":1046,"code":1047,"language":1048,"meta":1049,"style":1049},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createNoydb } from '@noy-db\u002Fhub'\nimport { toMemory } from '@noy-db\u002Fto-memory'\nimport { withDerivation } from '@noy-db\u002Fhub\u002Fderivations'\n\nconst pdfDerivation = withDerivation\u003CPdf, { meta: PdfMeta; text: PdfText }>({\n  source: 'pdfs',\n  deterministic: true,\n  outputs: {\n    meta: { shape: 'record', collection: 'pdf-meta' },\n    text: { shape: 'record', collection: 'pdf-text' },\n  },\n  derive: (pdf) => ({\n    meta: { len: pdf.body.length, pages: pdf.pages.length },\n    text: { content: extractText(pdf.body) },\n  }),\n  lifecycle: 'eager', \u002F\u002F or 'lazy'\n})\n\nconst db = await createNoydb({\n  store: toMemory(),\n  user: 'alice',\n  derivationStrategies: [pdfDerivation],\n})\n","ts","",[943,1051,1052,1085,1106,1127,1134,1192,1211,1225,1236,1275,1310,1316,1341,1390,1417,1427,1448,1457,1462,1481,1496,1513,1526],{"__ignoreMap":1049},[1053,1054,1057,1061,1065,1069,1072,1075,1078,1082],"span",{"class":1055,"line":1056},"line",1,[1053,1058,1060],{"class":1059},"s7zQu","import",[1053,1062,1064],{"class":1063},"sMK4o"," {",[1053,1066,1068],{"class":1067},"sTEyZ"," createNoydb",[1053,1070,1071],{"class":1063}," }",[1053,1073,1074],{"class":1059}," from",[1053,1076,1077],{"class":1063}," '",[1053,1079,1081],{"class":1080},"sfazB","@noy-db\u002Fhub",[1053,1083,1084],{"class":1063},"'\n",[1053,1086,1088,1090,1092,1095,1097,1099,1101,1104],{"class":1055,"line":1087},2,[1053,1089,1060],{"class":1059},[1053,1091,1064],{"class":1063},[1053,1093,1094],{"class":1067}," toMemory",[1053,1096,1071],{"class":1063},[1053,1098,1074],{"class":1059},[1053,1100,1077],{"class":1063},[1053,1102,1103],{"class":1080},"@noy-db\u002Fto-memory",[1053,1105,1084],{"class":1063},[1053,1107,1109,1111,1113,1116,1118,1120,1122,1125],{"class":1055,"line":1108},3,[1053,1110,1060],{"class":1059},[1053,1112,1064],{"class":1063},[1053,1114,1115],{"class":1067}," withDerivation",[1053,1117,1071],{"class":1063},[1053,1119,1074],{"class":1059},[1053,1121,1077],{"class":1063},[1053,1123,1124],{"class":1080},"@noy-db\u002Fhub\u002Fderivations",[1053,1126,1084],{"class":1063},[1053,1128,1130],{"class":1055,"line":1129},4,[1053,1131,1133],{"emptyLinePlaceholder":1132},true,"\n",[1053,1135,1137,1141,1144,1147,1150,1153,1157,1160,1162,1166,1169,1172,1175,1178,1180,1183,1186,1189],{"class":1055,"line":1136},5,[1053,1138,1140],{"class":1139},"spNyl","const",[1053,1142,1143],{"class":1067}," pdfDerivation ",[1053,1145,1146],{"class":1063},"=",[1053,1148,1115],{"class":1149},"s2Zo4",[1053,1151,1152],{"class":1063},"\u003C",[1053,1154,1156],{"class":1155},"sBMFI","Pdf",[1053,1158,1159],{"class":1063},",",[1053,1161,1064],{"class":1063},[1053,1163,1165],{"class":1164},"swJcz"," meta",[1053,1167,1168],{"class":1063},":",[1053,1170,1171],{"class":1155}," PdfMeta",[1053,1173,1174],{"class":1063},";",[1053,1176,1177],{"class":1164}," text",[1053,1179,1168],{"class":1063},[1053,1181,1182],{"class":1155}," PdfText",[1053,1184,1185],{"class":1063}," }>",[1053,1187,1188],{"class":1067},"(",[1053,1190,1191],{"class":1063},"{\n",[1053,1193,1195,1198,1200,1202,1205,1208],{"class":1055,"line":1194},6,[1053,1196,1197],{"class":1164},"  source",[1053,1199,1168],{"class":1063},[1053,1201,1077],{"class":1063},[1053,1203,1204],{"class":1080},"pdfs",[1053,1206,1207],{"class":1063},"'",[1053,1209,1210],{"class":1063},",\n",[1053,1212,1214,1217,1219,1223],{"class":1055,"line":1213},7,[1053,1215,1216],{"class":1164},"  deterministic",[1053,1218,1168],{"class":1063},[1053,1220,1222],{"class":1221},"sfNiH"," true",[1053,1224,1210],{"class":1063},[1053,1226,1228,1231,1233],{"class":1055,"line":1227},8,[1053,1229,1230],{"class":1164},"  outputs",[1053,1232,1168],{"class":1063},[1053,1234,1235],{"class":1063}," {\n",[1053,1237,1239,1242,1244,1246,1249,1251,1253,1256,1258,1260,1263,1265,1267,1270,1272],{"class":1055,"line":1238},9,[1053,1240,1241],{"class":1164},"    meta",[1053,1243,1168],{"class":1063},[1053,1245,1064],{"class":1063},[1053,1247,1248],{"class":1164}," shape",[1053,1250,1168],{"class":1063},[1053,1252,1077],{"class":1063},[1053,1254,1255],{"class":1080},"record",[1053,1257,1207],{"class":1063},[1053,1259,1159],{"class":1063},[1053,1261,1262],{"class":1164}," collection",[1053,1264,1168],{"class":1063},[1053,1266,1077],{"class":1063},[1053,1268,1269],{"class":1080},"pdf-meta",[1053,1271,1207],{"class":1063},[1053,1273,1274],{"class":1063}," },\n",[1053,1276,1278,1281,1283,1285,1287,1289,1291,1293,1295,1297,1299,1301,1303,1306,1308],{"class":1055,"line":1277},10,[1053,1279,1280],{"class":1164},"    text",[1053,1282,1168],{"class":1063},[1053,1284,1064],{"class":1063},[1053,1286,1248],{"class":1164},[1053,1288,1168],{"class":1063},[1053,1290,1077],{"class":1063},[1053,1292,1255],{"class":1080},[1053,1294,1207],{"class":1063},[1053,1296,1159],{"class":1063},[1053,1298,1262],{"class":1164},[1053,1300,1168],{"class":1063},[1053,1302,1077],{"class":1063},[1053,1304,1305],{"class":1080},"pdf-text",[1053,1307,1207],{"class":1063},[1053,1309,1274],{"class":1063},[1053,1311,1313],{"class":1055,"line":1312},11,[1053,1314,1315],{"class":1063},"  },\n",[1053,1317,1319,1322,1324,1327,1331,1334,1337,1339],{"class":1055,"line":1318},12,[1053,1320,1321],{"class":1149},"  derive",[1053,1323,1168],{"class":1063},[1053,1325,1326],{"class":1063}," (",[1053,1328,1330],{"class":1329},"sHdIc","pdf",[1053,1332,1333],{"class":1063},")",[1053,1335,1336],{"class":1139}," =>",[1053,1338,1326],{"class":1067},[1053,1340,1191],{"class":1063},[1053,1342,1344,1346,1348,1350,1353,1355,1358,1360,1363,1365,1368,1370,1373,1375,1377,1379,1382,1384,1387],{"class":1055,"line":1343},13,[1053,1345,1241],{"class":1164},[1053,1347,1168],{"class":1063},[1053,1349,1064],{"class":1063},[1053,1351,1352],{"class":1164}," len",[1053,1354,1168],{"class":1063},[1053,1356,1357],{"class":1067}," pdf",[1053,1359,1038],{"class":1063},[1053,1361,1362],{"class":1067},"body",[1053,1364,1038],{"class":1063},[1053,1366,1367],{"class":1067},"length",[1053,1369,1159],{"class":1063},[1053,1371,1372],{"class":1164}," pages",[1053,1374,1168],{"class":1063},[1053,1376,1357],{"class":1067},[1053,1378,1038],{"class":1063},[1053,1380,1381],{"class":1067},"pages",[1053,1383,1038],{"class":1063},[1053,1385,1386],{"class":1067},"length ",[1053,1388,1389],{"class":1063},"},\n",[1053,1391,1393,1395,1397,1399,1402,1404,1407,1410,1412,1415],{"class":1055,"line":1392},14,[1053,1394,1280],{"class":1164},[1053,1396,1168],{"class":1063},[1053,1398,1064],{"class":1063},[1053,1400,1401],{"class":1164}," content",[1053,1403,1168],{"class":1063},[1053,1405,1406],{"class":1149}," extractText",[1053,1408,1409],{"class":1067},"(pdf",[1053,1411,1038],{"class":1063},[1053,1413,1414],{"class":1067},"body) ",[1053,1416,1389],{"class":1063},[1053,1418,1420,1423,1425],{"class":1055,"line":1419},15,[1053,1421,1422],{"class":1063},"  }",[1053,1424,1333],{"class":1067},[1053,1426,1210],{"class":1063},[1053,1428,1430,1433,1435,1437,1440,1442,1444],{"class":1055,"line":1429},16,[1053,1431,1432],{"class":1164},"  lifecycle",[1053,1434,1168],{"class":1063},[1053,1436,1077],{"class":1063},[1053,1438,1439],{"class":1080},"eager",[1053,1441,1207],{"class":1063},[1053,1443,1159],{"class":1063},[1053,1445,1447],{"class":1446},"sHwdD"," \u002F\u002F or 'lazy'\n",[1053,1449,1451,1454],{"class":1055,"line":1450},17,[1053,1452,1453],{"class":1063},"}",[1053,1455,1456],{"class":1067},")\n",[1053,1458,1460],{"class":1055,"line":1459},18,[1053,1461,1133],{"emptyLinePlaceholder":1132},[1053,1463,1465,1467,1470,1472,1475,1477,1479],{"class":1055,"line":1464},19,[1053,1466,1140],{"class":1139},[1053,1468,1469],{"class":1067}," db ",[1053,1471,1146],{"class":1063},[1053,1473,1474],{"class":1059}," await",[1053,1476,1068],{"class":1149},[1053,1478,1188],{"class":1067},[1053,1480,1191],{"class":1063},[1053,1482,1484,1487,1489,1491,1494],{"class":1055,"line":1483},20,[1053,1485,1486],{"class":1164},"  store",[1053,1488,1168],{"class":1063},[1053,1490,1094],{"class":1149},[1053,1492,1493],{"class":1067},"()",[1053,1495,1210],{"class":1063},[1053,1497,1499,1502,1504,1506,1509,1511],{"class":1055,"line":1498},21,[1053,1500,1501],{"class":1164},"  user",[1053,1503,1168],{"class":1063},[1053,1505,1077],{"class":1063},[1053,1507,1508],{"class":1080},"alice",[1053,1510,1207],{"class":1063},[1053,1512,1210],{"class":1063},[1053,1514,1516,1519,1521,1524],{"class":1055,"line":1515},22,[1053,1517,1518],{"class":1164},"  derivationStrategies",[1053,1520,1168],{"class":1063},[1053,1522,1523],{"class":1067}," [pdfDerivation]",[1053,1525,1210],{"class":1063},[1053,1527,1529,1531],{"class":1055,"line":1528},23,[1053,1530,1453],{"class":1063},[1053,1532,1456],{"class":1067},[978,1534,1536],{"id":1535},"basic-usage","Basic usage",[937,1538,1539,1540,1542,1543,1546],{},"Writing a source record fires ",[943,1541,990],{}," inside the same transaction (",[943,1544,1545],{},"lifecycle: 'eager'","); the\noutputs are readable immediately through their own collections:",[1044,1548,1550],{"className":1046,"code":1549,"language":1048,"meta":1049,"style":1049},"const vault = await db.openVault('docs')\n\nawait vault.collection\u003CPdf>('pdfs').put('doc-1', {\n  id: 'doc-1',\n  body: 'Annual report body text',\n  pages: 12,\n})\n\nawait vault.collection('pdf-meta').get('doc-1')\n\u002F\u002F → { len: 24, pages: 12, _derivedFrom: { source: 'pdfs', sourceId: 'doc-1', sourceVersion: 1, derivedAt: '2026-05-18T00:00:00.000Z', strategyHash: 'sha256-...' } }\n\nawait vault.collection('pdf-text').get('doc-1')\n\u002F\u002F → { content: 'Annual report body text', _derivedFrom: { source: 'pdfs', sourceId: 'doc-1', sourceVersion: 1, derivedAt: '2026-05-18T00:00:00.000Z', strategyHash: 'sha256-...' } }\n",[943,1551,1552,1582,1586,1634,1649,1665,1678,1684,1688,1723,1728,1732,1766],{"__ignoreMap":1049},[1053,1553,1554,1556,1559,1561,1563,1566,1568,1571,1573,1575,1578,1580],{"class":1055,"line":1056},[1053,1555,1140],{"class":1139},[1053,1557,1558],{"class":1067}," vault ",[1053,1560,1146],{"class":1063},[1053,1562,1474],{"class":1059},[1053,1564,1565],{"class":1067}," db",[1053,1567,1038],{"class":1063},[1053,1569,1570],{"class":1149},"openVault",[1053,1572,1188],{"class":1067},[1053,1574,1207],{"class":1063},[1053,1576,1577],{"class":1080},"docs",[1053,1579,1207],{"class":1063},[1053,1581,1456],{"class":1067},[1053,1583,1584],{"class":1055,"line":1087},[1053,1585,1133],{"emptyLinePlaceholder":1132},[1053,1587,1588,1591,1594,1596,1599,1601,1603,1606,1608,1610,1612,1614,1616,1618,1621,1623,1625,1628,1630,1632],{"class":1055,"line":1108},[1053,1589,1590],{"class":1059},"await",[1053,1592,1593],{"class":1067}," vault",[1053,1595,1038],{"class":1063},[1053,1597,1598],{"class":1149},"collection",[1053,1600,1152],{"class":1063},[1053,1602,1156],{"class":1155},[1053,1604,1605],{"class":1063},">",[1053,1607,1188],{"class":1067},[1053,1609,1207],{"class":1063},[1053,1611,1204],{"class":1080},[1053,1613,1207],{"class":1063},[1053,1615,1333],{"class":1067},[1053,1617,1038],{"class":1063},[1053,1619,1620],{"class":1149},"put",[1053,1622,1188],{"class":1067},[1053,1624,1207],{"class":1063},[1053,1626,1627],{"class":1080},"doc-1",[1053,1629,1207],{"class":1063},[1053,1631,1159],{"class":1063},[1053,1633,1235],{"class":1063},[1053,1635,1636,1639,1641,1643,1645,1647],{"class":1055,"line":1129},[1053,1637,1638],{"class":1164},"  id",[1053,1640,1168],{"class":1063},[1053,1642,1077],{"class":1063},[1053,1644,1627],{"class":1080},[1053,1646,1207],{"class":1063},[1053,1648,1210],{"class":1063},[1053,1650,1651,1654,1656,1658,1661,1663],{"class":1055,"line":1136},[1053,1652,1653],{"class":1164},"  body",[1053,1655,1168],{"class":1063},[1053,1657,1077],{"class":1063},[1053,1659,1660],{"class":1080},"Annual report body text",[1053,1662,1207],{"class":1063},[1053,1664,1210],{"class":1063},[1053,1666,1667,1670,1672,1676],{"class":1055,"line":1194},[1053,1668,1669],{"class":1164},"  pages",[1053,1671,1168],{"class":1063},[1053,1673,1675],{"class":1674},"sbssI"," 12",[1053,1677,1210],{"class":1063},[1053,1679,1680,1682],{"class":1055,"line":1213},[1053,1681,1453],{"class":1063},[1053,1683,1456],{"class":1067},[1053,1685,1686],{"class":1055,"line":1227},[1053,1687,1133],{"emptyLinePlaceholder":1132},[1053,1689,1690,1692,1694,1696,1698,1700,1702,1704,1706,1708,1710,1713,1715,1717,1719,1721],{"class":1055,"line":1238},[1053,1691,1590],{"class":1059},[1053,1693,1593],{"class":1067},[1053,1695,1038],{"class":1063},[1053,1697,1598],{"class":1149},[1053,1699,1188],{"class":1067},[1053,1701,1207],{"class":1063},[1053,1703,1269],{"class":1080},[1053,1705,1207],{"class":1063},[1053,1707,1333],{"class":1067},[1053,1709,1038],{"class":1063},[1053,1711,1712],{"class":1149},"get",[1053,1714,1188],{"class":1067},[1053,1716,1207],{"class":1063},[1053,1718,1627],{"class":1080},[1053,1720,1207],{"class":1063},[1053,1722,1456],{"class":1067},[1053,1724,1725],{"class":1055,"line":1277},[1053,1726,1727],{"class":1446},"\u002F\u002F → { len: 24, pages: 12, _derivedFrom: { source: 'pdfs', sourceId: 'doc-1', sourceVersion: 1, derivedAt: '2026-05-18T00:00:00.000Z', strategyHash: 'sha256-...' } }\n",[1053,1729,1730],{"class":1055,"line":1312},[1053,1731,1133],{"emptyLinePlaceholder":1132},[1053,1733,1734,1736,1738,1740,1742,1744,1746,1748,1750,1752,1754,1756,1758,1760,1762,1764],{"class":1055,"line":1318},[1053,1735,1590],{"class":1059},[1053,1737,1593],{"class":1067},[1053,1739,1038],{"class":1063},[1053,1741,1598],{"class":1149},[1053,1743,1188],{"class":1067},[1053,1745,1207],{"class":1063},[1053,1747,1305],{"class":1080},[1053,1749,1207],{"class":1063},[1053,1751,1333],{"class":1067},[1053,1753,1038],{"class":1063},[1053,1755,1712],{"class":1149},[1053,1757,1188],{"class":1067},[1053,1759,1207],{"class":1063},[1053,1761,1627],{"class":1080},[1053,1763,1207],{"class":1063},[1053,1765,1456],{"class":1067},[1053,1767,1768],{"class":1055,"line":1343},[1053,1769,1770],{"class":1446},"\u002F\u002F → { content: 'Annual report body text', _derivedFrom: { source: 'pdfs', sourceId: 'doc-1', sourceVersion: 1, derivedAt: '2026-05-18T00:00:00.000Z', strategyHash: 'sha256-...' } }\n",[978,1772,1774],{"id":1773},"api","API",[1776,1777,1779,1782],"h3",{"id":1778},"derivesource-ctx-and-the-read-only-vault-facade",[943,1780,1781],{},"derive(source, ctx)"," and the read-only vault facade",[937,1784,1785,1786,1788,1789,1792,1793,1796],{},"The ",[943,1787,990],{}," function receives a second argument: a ",[943,1790,1791],{},"DerivationContext","\ncarrying the same read-only vault facade guards see as ",[943,1794,1795],{},"ctx.vault",". Use it\nto fetch sibling records without denormalising them onto the source row.",[1044,1798,1800],{"className":1046,"code":1799,"language":1048,"meta":1049,"style":1049},"withDerivation\u003CAllocation, { receipt: Receipt }>({\n  source: 'allocations',\n  deterministic: true,\n  outputs: { receipt: { shape: 'record', collection: 'receipts' } },\n  derive: async (alloc, ctx) => {\n    const payment = await ctx.vault.collection\u003CPayment>('payments').get(alloc.paymentId)\n    const bill = await ctx.vault.collection\u003CBill>('bills').get(alloc.billId)\n    return {\n      receipt: {\n        id: alloc.id,\n        paymentId: alloc.paymentId,\n        issuedAt: payment!.paymentDate,\n        clientId: bill!.clientId,\n        appliedAmount: alloc.appliedAmount,\n      },\n    }\n  },\n  lifecycle: 'eager',\n})\n",[943,1801,1802,1829,1844,1854,1895,1920,1976,2030,2037,2046,2063,2078,2095,2111,2127,2132,2137,2141,2155],{"__ignoreMap":1049},[1053,1803,1804,1806,1808,1811,1813,1815,1818,1820,1823,1825,1827],{"class":1055,"line":1056},[1053,1805,986],{"class":1149},[1053,1807,1152],{"class":1063},[1053,1809,1810],{"class":1155},"Allocation",[1053,1812,1159],{"class":1063},[1053,1814,1064],{"class":1063},[1053,1816,1817],{"class":1164}," receipt",[1053,1819,1168],{"class":1063},[1053,1821,1822],{"class":1155}," Receipt",[1053,1824,1185],{"class":1063},[1053,1826,1188],{"class":1067},[1053,1828,1191],{"class":1063},[1053,1830,1831,1833,1835,1837,1840,1842],{"class":1055,"line":1087},[1053,1832,1197],{"class":1164},[1053,1834,1168],{"class":1063},[1053,1836,1077],{"class":1063},[1053,1838,1839],{"class":1080},"allocations",[1053,1841,1207],{"class":1063},[1053,1843,1210],{"class":1063},[1053,1845,1846,1848,1850,1852],{"class":1055,"line":1108},[1053,1847,1216],{"class":1164},[1053,1849,1168],{"class":1063},[1053,1851,1222],{"class":1221},[1053,1853,1210],{"class":1063},[1053,1855,1856,1858,1860,1862,1864,1866,1868,1870,1872,1874,1876,1878,1880,1882,1884,1886,1889,1891,1893],{"class":1055,"line":1129},[1053,1857,1230],{"class":1164},[1053,1859,1168],{"class":1063},[1053,1861,1064],{"class":1063},[1053,1863,1817],{"class":1164},[1053,1865,1168],{"class":1063},[1053,1867,1064],{"class":1063},[1053,1869,1248],{"class":1164},[1053,1871,1168],{"class":1063},[1053,1873,1077],{"class":1063},[1053,1875,1255],{"class":1080},[1053,1877,1207],{"class":1063},[1053,1879,1159],{"class":1063},[1053,1881,1262],{"class":1164},[1053,1883,1168],{"class":1063},[1053,1885,1077],{"class":1063},[1053,1887,1888],{"class":1080},"receipts",[1053,1890,1207],{"class":1063},[1053,1892,1071],{"class":1063},[1053,1894,1274],{"class":1063},[1053,1896,1897,1899,1901,1904,1906,1909,1911,1914,1916,1918],{"class":1055,"line":1136},[1053,1898,1321],{"class":1149},[1053,1900,1168],{"class":1063},[1053,1902,1903],{"class":1139}," async",[1053,1905,1326],{"class":1063},[1053,1907,1908],{"class":1329},"alloc",[1053,1910,1159],{"class":1063},[1053,1912,1913],{"class":1329}," ctx",[1053,1915,1333],{"class":1063},[1053,1917,1336],{"class":1139},[1053,1919,1235],{"class":1063},[1053,1921,1922,1925,1928,1931,1933,1935,1937,1939,1941,1943,1945,1948,1950,1952,1954,1957,1959,1961,1963,1965,1967,1969,1971,1974],{"class":1055,"line":1194},[1053,1923,1924],{"class":1139},"    const",[1053,1926,1927],{"class":1067}," payment",[1053,1929,1930],{"class":1063}," =",[1053,1932,1474],{"class":1059},[1053,1934,1913],{"class":1067},[1053,1936,1038],{"class":1063},[1053,1938,951],{"class":1067},[1053,1940,1038],{"class":1063},[1053,1942,1598],{"class":1149},[1053,1944,1152],{"class":1063},[1053,1946,1947],{"class":1155},"Payment",[1053,1949,1605],{"class":1063},[1053,1951,1188],{"class":1164},[1053,1953,1207],{"class":1063},[1053,1955,1956],{"class":1080},"payments",[1053,1958,1207],{"class":1063},[1053,1960,1333],{"class":1164},[1053,1962,1038],{"class":1063},[1053,1964,1712],{"class":1149},[1053,1966,1188],{"class":1164},[1053,1968,1908],{"class":1067},[1053,1970,1038],{"class":1063},[1053,1972,1973],{"class":1067},"paymentId",[1053,1975,1456],{"class":1164},[1053,1977,1978,1980,1983,1985,1987,1989,1991,1993,1995,1997,1999,2002,2004,2006,2008,2011,2013,2015,2017,2019,2021,2023,2025,2028],{"class":1055,"line":1213},[1053,1979,1924],{"class":1139},[1053,1981,1982],{"class":1067}," bill",[1053,1984,1930],{"class":1063},[1053,1986,1474],{"class":1059},[1053,1988,1913],{"class":1067},[1053,1990,1038],{"class":1063},[1053,1992,951],{"class":1067},[1053,1994,1038],{"class":1063},[1053,1996,1598],{"class":1149},[1053,1998,1152],{"class":1063},[1053,2000,2001],{"class":1155},"Bill",[1053,2003,1605],{"class":1063},[1053,2005,1188],{"class":1164},[1053,2007,1207],{"class":1063},[1053,2009,2010],{"class":1080},"bills",[1053,2012,1207],{"class":1063},[1053,2014,1333],{"class":1164},[1053,2016,1038],{"class":1063},[1053,2018,1712],{"class":1149},[1053,2020,1188],{"class":1164},[1053,2022,1908],{"class":1067},[1053,2024,1038],{"class":1063},[1053,2026,2027],{"class":1067},"billId",[1053,2029,1456],{"class":1164},[1053,2031,2032,2035],{"class":1055,"line":1227},[1053,2033,2034],{"class":1059},"    return",[1053,2036,1235],{"class":1063},[1053,2038,2039,2042,2044],{"class":1055,"line":1238},[1053,2040,2041],{"class":1164},"      receipt",[1053,2043,1168],{"class":1063},[1053,2045,1235],{"class":1063},[1053,2047,2048,2051,2053,2056,2058,2061],{"class":1055,"line":1277},[1053,2049,2050],{"class":1164},"        id",[1053,2052,1168],{"class":1063},[1053,2054,2055],{"class":1067}," alloc",[1053,2057,1038],{"class":1063},[1053,2059,2060],{"class":1067},"id",[1053,2062,1210],{"class":1063},[1053,2064,2065,2068,2070,2072,2074,2076],{"class":1055,"line":1312},[1053,2066,2067],{"class":1164},"        paymentId",[1053,2069,1168],{"class":1063},[1053,2071,2055],{"class":1067},[1053,2073,1038],{"class":1063},[1053,2075,1973],{"class":1067},[1053,2077,1210],{"class":1063},[1053,2079,2080,2083,2085,2087,2090,2093],{"class":1055,"line":1318},[1053,2081,2082],{"class":1164},"        issuedAt",[1053,2084,1168],{"class":1063},[1053,2086,1927],{"class":1067},[1053,2088,2089],{"class":1063},"!.",[1053,2091,2092],{"class":1067},"paymentDate",[1053,2094,1210],{"class":1063},[1053,2096,2097,2100,2102,2104,2106,2109],{"class":1055,"line":1343},[1053,2098,2099],{"class":1164},"        clientId",[1053,2101,1168],{"class":1063},[1053,2103,1982],{"class":1067},[1053,2105,2089],{"class":1063},[1053,2107,2108],{"class":1067},"clientId",[1053,2110,1210],{"class":1063},[1053,2112,2113,2116,2118,2120,2122,2125],{"class":1055,"line":1392},[1053,2114,2115],{"class":1164},"        appliedAmount",[1053,2117,1168],{"class":1063},[1053,2119,2055],{"class":1067},[1053,2121,1038],{"class":1063},[1053,2123,2124],{"class":1067},"appliedAmount",[1053,2126,1210],{"class":1063},[1053,2128,2129],{"class":1055,"line":1419},[1053,2130,2131],{"class":1063},"      },\n",[1053,2133,2134],{"class":1055,"line":1429},[1053,2135,2136],{"class":1063},"    }\n",[1053,2138,2139],{"class":1055,"line":1450},[1053,2140,1315],{"class":1063},[1053,2142,2143,2145,2147,2149,2151,2153],{"class":1055,"line":1459},[1053,2144,1432],{"class":1164},[1053,2146,1168],{"class":1063},[1053,2148,1077],{"class":1063},[1053,2150,1439],{"class":1080},[1053,2152,1207],{"class":1063},[1053,2154,1210],{"class":1063},[1053,2156,2157,2159],{"class":1055,"line":1464},[1053,2158,1453],{"class":1063},[1053,2160,1456],{"class":1067},[937,2162,2163,2165,2166,2169,2170,2173,2174,2177,2178,2181,2182,2184],{},[943,2164,1795],{}," exposes ",[943,2167,2168],{},".get(id)",", ",[943,2171,2172],{},".list()",", and ",[943,2175,2176],{},".query()"," — no write\ncapability is reachable from the facade. The strategy hash incorporates\n",[943,2179,2180],{},"derive.toString()",", so the function source pins the inputs; whatever\nsibling reads happen inside ",[943,2183,990],{}," must be deterministic given the\nsame source record (the consumer's responsibility — the hash does not\nfingerprint sibling-record content).",[937,2186,2187],{},"Available on both lifecycles: the eager dispatch and the lazy\nresolve-on-read paths both pass the same facade.",[1776,2189,2191],{"id":2190},"sources",[943,2192,2190],{},[937,2194,2195,2198,2199,2201,2202,2205],{},[943,2196,2197],{},"sources: ['a', 'b']"," declares sibling collections whose writes re-fire\nthis derivation. A write to any declared sibling re-runs ",[943,2200,990],{},"\nagainst the PRIMARY ",[943,2203,2204],{},"source"," record at the SAME id (a silent no-op if no\nprimary record exists there). Siblings participate in cycle detection.",[1044,2207,2209],{"className":1046,"code":2208,"language":1048,"meta":1049,"style":1049},"withDerivation\u003CAllocation, { receipt: Receipt }>({\n  source: 'allocations',\n  sources: ['payments', 'bills'],  \u002F\u002F sibling writes re-derive at the same id\n  deterministic: true,\n  outputs: { receipt: { shape: 'record', collection: 'receipts' } },\n  derive: async (alloc, ctx) => ({ \u002F* … *\u002F }),\n  lifecycle: 'eager',\n})\n",[943,2210,2211,2235,2249,2281,2291,2331,2365,2379],{"__ignoreMap":1049},[1053,2212,2213,2215,2217,2219,2221,2223,2225,2227,2229,2231,2233],{"class":1055,"line":1056},[1053,2214,986],{"class":1149},[1053,2216,1152],{"class":1063},[1053,2218,1810],{"class":1155},[1053,2220,1159],{"class":1063},[1053,2222,1064],{"class":1063},[1053,2224,1817],{"class":1164},[1053,2226,1168],{"class":1063},[1053,2228,1822],{"class":1155},[1053,2230,1185],{"class":1063},[1053,2232,1188],{"class":1067},[1053,2234,1191],{"class":1063},[1053,2236,2237,2239,2241,2243,2245,2247],{"class":1055,"line":1087},[1053,2238,1197],{"class":1164},[1053,2240,1168],{"class":1063},[1053,2242,1077],{"class":1063},[1053,2244,1839],{"class":1080},[1053,2246,1207],{"class":1063},[1053,2248,1210],{"class":1063},[1053,2250,2251,2254,2256,2259,2261,2263,2265,2267,2269,2271,2273,2276,2278],{"class":1055,"line":1108},[1053,2252,2253],{"class":1164},"  sources",[1053,2255,1168],{"class":1063},[1053,2257,2258],{"class":1067}," [",[1053,2260,1207],{"class":1063},[1053,2262,1956],{"class":1080},[1053,2264,1207],{"class":1063},[1053,2266,1159],{"class":1063},[1053,2268,1077],{"class":1063},[1053,2270,2010],{"class":1080},[1053,2272,1207],{"class":1063},[1053,2274,2275],{"class":1067},"]",[1053,2277,1159],{"class":1063},[1053,2279,2280],{"class":1446},"  \u002F\u002F sibling writes re-derive at the same id\n",[1053,2282,2283,2285,2287,2289],{"class":1055,"line":1129},[1053,2284,1216],{"class":1164},[1053,2286,1168],{"class":1063},[1053,2288,1222],{"class":1221},[1053,2290,1210],{"class":1063},[1053,2292,2293,2295,2297,2299,2301,2303,2305,2307,2309,2311,2313,2315,2317,2319,2321,2323,2325,2327,2329],{"class":1055,"line":1136},[1053,2294,1230],{"class":1164},[1053,2296,1168],{"class":1063},[1053,2298,1064],{"class":1063},[1053,2300,1817],{"class":1164},[1053,2302,1168],{"class":1063},[1053,2304,1064],{"class":1063},[1053,2306,1248],{"class":1164},[1053,2308,1168],{"class":1063},[1053,2310,1077],{"class":1063},[1053,2312,1255],{"class":1080},[1053,2314,1207],{"class":1063},[1053,2316,1159],{"class":1063},[1053,2318,1262],{"class":1164},[1053,2320,1168],{"class":1063},[1053,2322,1077],{"class":1063},[1053,2324,1888],{"class":1080},[1053,2326,1207],{"class":1063},[1053,2328,1071],{"class":1063},[1053,2330,1274],{"class":1063},[1053,2332,2333,2335,2337,2339,2341,2343,2345,2347,2349,2351,2353,2356,2359,2361,2363],{"class":1055,"line":1194},[1053,2334,1321],{"class":1149},[1053,2336,1168],{"class":1063},[1053,2338,1903],{"class":1139},[1053,2340,1326],{"class":1063},[1053,2342,1908],{"class":1329},[1053,2344,1159],{"class":1063},[1053,2346,1913],{"class":1329},[1053,2348,1333],{"class":1063},[1053,2350,1336],{"class":1139},[1053,2352,1326],{"class":1067},[1053,2354,2355],{"class":1063},"{",[1053,2357,2358],{"class":1446}," \u002F* … *\u002F",[1053,2360,1071],{"class":1063},[1053,2362,1333],{"class":1067},[1053,2364,1210],{"class":1063},[1053,2366,2367,2369,2371,2373,2375,2377],{"class":1055,"line":1213},[1053,2368,1432],{"class":1164},[1053,2370,1168],{"class":1063},[1053,2372,1077],{"class":1063},[1053,2374,1439],{"class":1080},[1053,2376,1207],{"class":1063},[1053,2378,1210],{"class":1063},[1053,2380,2381,2383],{"class":1055,"line":1227},[1053,2382,1453],{"class":1063},[1053,2384,1456],{"class":1067},[937,2386,2387],{},"This retires the hand-rolled \"poke a sibling\" pattern (writing a no-op\nback to the source to force a re-derive when a referenced record\nchanged).",[1776,2389,2391],{"id":2390},"fk-keyed-triggers-reverse-denormalization","FK-keyed triggers — reverse-denormalization",[937,2393,2394,2397,2398,2401,2402,2404,2405,2408],{},[943,2395,2396],{},"sources[]"," re-fires at the ",[940,2399,2400],{},"same id",". ",[943,2403,1029],{}," re-fires keyed by a\n",[940,2406,2407],{},"foreign key",": a write to a PARENT collection fans out to every source\nrecord whose FK matches the parent's id. The canonical use is keeping a\ndenormalized field on the children in sync with a parent change.",[1044,2410,2412],{"className":1046,"code":2411,"language":1048,"meta":1049,"style":1049},"withDerivation\u003CSale, { self: Sale }>({\n  source: 'sales',\n  deterministic: true,\n  \u002F\u002F A write to buyers re-derives every sale where sale.buyerId === buyer.id.\n  triggerBy: [{ collection: 'buyers', on: 'buyerId' }], \u002F\u002F `on` = the FK ON the source\n  \u002F\u002F Self-write: patch ONLY buyerName back onto the sale (field-level provenance).\n  outputs: { self: { shape: 'record', collection: 'sales', denorm: ['buyerName'] } },\n  derive: async (sale, ctx) => {\n    const b = await ctx.vault.collection\u003CBuyer>('buyers').get(sale.buyerId)\n    return { self: { ...sale, buyerName: b?.companyName ?? null } }\n  },\n  lifecycle: 'eager',\n})\n",[943,2413,2414,2441,2456,2466,2471,2516,2521,2580,2603,2655,2698,2702,2716],{"__ignoreMap":1049},[1053,2415,2416,2418,2420,2423,2425,2427,2430,2432,2435,2437,2439],{"class":1055,"line":1056},[1053,2417,986],{"class":1149},[1053,2419,1152],{"class":1063},[1053,2421,2422],{"class":1155},"Sale",[1053,2424,1159],{"class":1063},[1053,2426,1064],{"class":1063},[1053,2428,2429],{"class":1164}," self",[1053,2431,1168],{"class":1063},[1053,2433,2434],{"class":1155}," Sale",[1053,2436,1185],{"class":1063},[1053,2438,1188],{"class":1067},[1053,2440,1191],{"class":1063},[1053,2442,2443,2445,2447,2449,2452,2454],{"class":1055,"line":1087},[1053,2444,1197],{"class":1164},[1053,2446,1168],{"class":1063},[1053,2448,1077],{"class":1063},[1053,2450,2451],{"class":1080},"sales",[1053,2453,1207],{"class":1063},[1053,2455,1210],{"class":1063},[1053,2457,2458,2460,2462,2464],{"class":1055,"line":1108},[1053,2459,1216],{"class":1164},[1053,2461,1168],{"class":1063},[1053,2463,1222],{"class":1221},[1053,2465,1210],{"class":1063},[1053,2467,2468],{"class":1055,"line":1129},[1053,2469,2470],{"class":1446},"  \u002F\u002F A write to buyers re-derives every sale where sale.buyerId === buyer.id.\n",[1053,2472,2473,2476,2478,2480,2482,2484,2486,2488,2491,2493,2495,2498,2500,2502,2505,2507,2509,2511,2513],{"class":1055,"line":1136},[1053,2474,2475],{"class":1164},"  triggerBy",[1053,2477,1168],{"class":1063},[1053,2479,2258],{"class":1067},[1053,2481,2355],{"class":1063},[1053,2483,1262],{"class":1164},[1053,2485,1168],{"class":1063},[1053,2487,1077],{"class":1063},[1053,2489,2490],{"class":1080},"buyers",[1053,2492,1207],{"class":1063},[1053,2494,1159],{"class":1063},[1053,2496,2497],{"class":1164}," on",[1053,2499,1168],{"class":1063},[1053,2501,1077],{"class":1063},[1053,2503,2504],{"class":1080},"buyerId",[1053,2506,1207],{"class":1063},[1053,2508,1071],{"class":1063},[1053,2510,2275],{"class":1067},[1053,2512,1159],{"class":1063},[1053,2514,2515],{"class":1446}," \u002F\u002F `on` = the FK ON the source\n",[1053,2517,2518],{"class":1055,"line":1194},[1053,2519,2520],{"class":1446},"  \u002F\u002F Self-write: patch ONLY buyerName back onto the sale (field-level provenance).\n",[1053,2522,2523,2525,2527,2529,2531,2533,2535,2537,2539,2541,2543,2545,2547,2549,2551,2553,2555,2557,2559,2562,2564,2566,2568,2571,2573,2576,2578],{"class":1055,"line":1213},[1053,2524,1230],{"class":1164},[1053,2526,1168],{"class":1063},[1053,2528,1064],{"class":1063},[1053,2530,2429],{"class":1164},[1053,2532,1168],{"class":1063},[1053,2534,1064],{"class":1063},[1053,2536,1248],{"class":1164},[1053,2538,1168],{"class":1063},[1053,2540,1077],{"class":1063},[1053,2542,1255],{"class":1080},[1053,2544,1207],{"class":1063},[1053,2546,1159],{"class":1063},[1053,2548,1262],{"class":1164},[1053,2550,1168],{"class":1063},[1053,2552,1077],{"class":1063},[1053,2554,2451],{"class":1080},[1053,2556,1207],{"class":1063},[1053,2558,1159],{"class":1063},[1053,2560,2561],{"class":1164}," denorm",[1053,2563,1168],{"class":1063},[1053,2565,2258],{"class":1067},[1053,2567,1207],{"class":1063},[1053,2569,2570],{"class":1080},"buyerName",[1053,2572,1207],{"class":1063},[1053,2574,2575],{"class":1067},"] ",[1053,2577,1453],{"class":1063},[1053,2579,1274],{"class":1063},[1053,2581,2582,2584,2586,2588,2590,2593,2595,2597,2599,2601],{"class":1055,"line":1227},[1053,2583,1321],{"class":1149},[1053,2585,1168],{"class":1063},[1053,2587,1903],{"class":1139},[1053,2589,1326],{"class":1063},[1053,2591,2592],{"class":1329},"sale",[1053,2594,1159],{"class":1063},[1053,2596,1913],{"class":1329},[1053,2598,1333],{"class":1063},[1053,2600,1336],{"class":1139},[1053,2602,1235],{"class":1063},[1053,2604,2605,2607,2610,2612,2614,2616,2618,2620,2622,2624,2626,2629,2631,2633,2635,2637,2639,2641,2643,2645,2647,2649,2651,2653],{"class":1055,"line":1238},[1053,2606,1924],{"class":1139},[1053,2608,2609],{"class":1067}," b",[1053,2611,1930],{"class":1063},[1053,2613,1474],{"class":1059},[1053,2615,1913],{"class":1067},[1053,2617,1038],{"class":1063},[1053,2619,951],{"class":1067},[1053,2621,1038],{"class":1063},[1053,2623,1598],{"class":1149},[1053,2625,1152],{"class":1063},[1053,2627,2628],{"class":1155},"Buyer",[1053,2630,1605],{"class":1063},[1053,2632,1188],{"class":1164},[1053,2634,1207],{"class":1063},[1053,2636,2490],{"class":1080},[1053,2638,1207],{"class":1063},[1053,2640,1333],{"class":1164},[1053,2642,1038],{"class":1063},[1053,2644,1712],{"class":1149},[1053,2646,1188],{"class":1164},[1053,2648,2592],{"class":1067},[1053,2650,1038],{"class":1063},[1053,2652,2504],{"class":1067},[1053,2654,1456],{"class":1164},[1053,2656,2657,2659,2661,2663,2665,2667,2670,2672,2674,2677,2679,2681,2684,2687,2690,2693,2695],{"class":1055,"line":1277},[1053,2658,2034],{"class":1059},[1053,2660,1064],{"class":1063},[1053,2662,2429],{"class":1164},[1053,2664,1168],{"class":1063},[1053,2666,1064],{"class":1063},[1053,2668,2669],{"class":1063}," ...",[1053,2671,2592],{"class":1067},[1053,2673,1159],{"class":1063},[1053,2675,2676],{"class":1164}," buyerName",[1053,2678,1168],{"class":1063},[1053,2680,2609],{"class":1067},[1053,2682,2683],{"class":1063},"?.",[1053,2685,2686],{"class":1067},"companyName",[1053,2688,2689],{"class":1063}," ??",[1053,2691,2692],{"class":1063}," null",[1053,2694,1071],{"class":1063},[1053,2696,2697],{"class":1063}," }\n",[1053,2699,2700],{"class":1055,"line":1312},[1053,2701,1315],{"class":1063},[1053,2703,2704,2706,2708,2710,2712,2714],{"class":1055,"line":1318},[1053,2705,1432],{"class":1164},[1053,2707,1168],{"class":1063},[1053,2709,1077],{"class":1063},[1053,2711,1439],{"class":1080},[1053,2713,1207],{"class":1063},[1053,2715,1210],{"class":1063},[1053,2717,2718,2720],{"class":1055,"line":1343},[1053,2719,1453],{"class":1063},[1053,2721,1456],{"class":1067},[1009,2723,2724,2759,2788],{},[1012,2725,2726,2732,2733,2735,2736,2738,2739,2742,2743,2746,2747,2750,2751,2754,2755,2758],{},[940,2727,2728,2729,1038],{},"Self-write + ",[943,2730,2731],{},"denorm"," A record output whose ",[943,2734,1598],{}," equals the\n",[943,2737,2204],{}," is a ",[1024,2740,2741],{},"self-write"," and MUST declare ",[943,2744,2745],{},"denorm: [...]",". Only those\nfields are merged onto the ",[940,2748,2749],{},"raw stored record"," — the rest of the user's\nrecord (and any i18n maps) is never clobbered, and no whole-record\n",[943,2752,2753],{},"_derivedFrom"," tag is added (the record stays user-owned). The self-write\nedge is exempt from cycle detection; a ",[940,2756,2757],{},"value-equality guard"," breaks the\nrecursion: when the patch changes nothing, no write is issued.",[1012,2760,2761,2764,2765,2768,2769,2772,2773,2775,2776,2779,2780,2783,2784,2787],{},[940,2762,2763],{},"Fan-out cost."," The match runs through the FK index when the source\ncollection has an index on ",[943,2766,2767],{},"on"," (declared via ",[943,2770,2771],{},"indexes: [...]"," with\n",[943,2774,1034],{}," enabled — see ",[948,2777,705],{"href":2778},".\u002Findexing",");\notherwise it scans the collection (O(N) — fine for small child sets;\nindex the FK to scale). An optional ",[943,2781,2782],{},"maxFanout"," on the trigger entry\n(default 64) throws ",[943,2785,2786],{},"DerivationCapExceededError"," before any write.",[1012,2789,2790,2793,2794,2796,2797,2799,2800,1038],{},[943,2791,2792],{},"triggerBy.collection"," must differ from ",[943,2795,2204],{},". Give it either ",[943,2798,2767],{}," or ",[943,2801,2802],{},"match",[2804,2805,2807,2808],"h4",{"id":2806},"composite-matches-match","Composite matches — ",[943,2809,2802],{},[937,2811,2812,2813,2816,2817,2820,2821,2823,2824,2827,2828,2831,2832,2835,2836,1038],{},"Since ",[943,2814,2815],{},"0.7.0-pre.12"," a trigger entry can key on ",[940,2818,2819],{},"several fields at once","\n(noy-db#1249). ",[943,2822,2802],{}," is a list of ",[943,2825,2826],{},"{ from, to }"," pairs, read as a\n",[940,2829,2830],{},"conjunction",": a source record matches when ",[1024,2833,2834],{},"every"," pair satisfies\n",[943,2837,2838],{},"String(source[to]) === String(written[from])",[1044,2840,2842],{"className":1046,"code":2841,"language":1048,"meta":1049,"style":1049},"\u002F\u002F Re-derive every sale for the same buyer AND the same region.\ntriggerBy: [{ collection: 'buyers', match: [{ from: 'id', to: 'buyerId' }, { from: 'region', to: 'region' }] }]\n",[943,2843,2844,2849],{"__ignoreMap":1049},[1053,2845,2846],{"class":1055,"line":1056},[1053,2847,2848],{"class":1446},"\u002F\u002F Re-derive every sale for the same buyer AND the same region.\n",[1053,2850,2851,2853,2855,2857,2859,2861,2863,2865,2867,2869,2871,2874,2876,2878,2880,2882,2884,2886,2888,2890,2892,2895,2897,2899,2901,2903,2906,2908,2910,2912,2914,2917,2919,2921,2923,2925,2927,2929,2931,2933,2935,2937],{"class":1055,"line":1087},[1053,2852,1029],{"class":1155},[1053,2854,1168],{"class":1063},[1053,2856,2258],{"class":1067},[1053,2858,2355],{"class":1063},[1053,2860,1262],{"class":1164},[1053,2862,1168],{"class":1063},[1053,2864,1077],{"class":1063},[1053,2866,2490],{"class":1080},[1053,2868,1207],{"class":1063},[1053,2870,1159],{"class":1063},[1053,2872,2873],{"class":1164}," match",[1053,2875,1168],{"class":1063},[1053,2877,2258],{"class":1067},[1053,2879,2355],{"class":1063},[1053,2881,1074],{"class":1164},[1053,2883,1168],{"class":1063},[1053,2885,1077],{"class":1063},[1053,2887,2060],{"class":1080},[1053,2889,1207],{"class":1063},[1053,2891,1159],{"class":1063},[1053,2893,2894],{"class":1164}," to",[1053,2896,1168],{"class":1063},[1053,2898,1077],{"class":1063},[1053,2900,2504],{"class":1080},[1053,2902,1207],{"class":1063},[1053,2904,2905],{"class":1063}," },",[1053,2907,1064],{"class":1063},[1053,2909,1074],{"class":1164},[1053,2911,1168],{"class":1063},[1053,2913,1077],{"class":1063},[1053,2915,2916],{"class":1080},"region",[1053,2918,1207],{"class":1063},[1053,2920,1159],{"class":1063},[1053,2922,2894],{"class":1164},[1053,2924,1168],{"class":1063},[1053,2926,1077],{"class":1063},[1053,2928,2916],{"class":1080},[1053,2930,1207],{"class":1063},[1053,2932,1071],{"class":1063},[1053,2934,2575],{"class":1067},[1053,2936,1453],{"class":1063},[1053,2938,2939],{"class":1067},"]\n",[937,2941,2942,2945,2946,2949,2950,2952,2953,2956,2957,2401,2960,2965,2966,2969,2970,2973],{},[943,2943,2944],{},"from: 'id'"," reads the ",[940,2947,2948],{},"written"," record's id, so the ",[943,2951,2767],{}," form above is the\nsingle-pair special case — ",[943,2954,2955],{},"on: 'buyerId'"," normalizes to\n",[943,2958,2959],{},"match: [{ from: 'id', to: 'buyerId' }]",[940,2961,2962,2964],{},[943,2963,2767],{}," is unchanged and still\nsupported","; nothing that uses it needs rewriting. Both sides of a pair are\ncoerced to strings, and a pair whose value is neither ",[943,2967,2968],{},"string"," nor ",[943,2971,2972],{},"number","\nfails to match rather than throwing.",[2804,2975,2977,2978],{"id":2976},"one-declared-hop-via","One declared hop — ",[943,2979,896],{},[937,2981,2812,2982,2985,2986,2989],{},[943,2983,2984],{},"0.7.0-pre.16"," a match pair may resolve through an ",[940,2987,2988],{},"intermediate collection","\n(noy-db#1277), which makes a relationship expressible where the two collections share no field\nat all:",[1044,2991,2993],{"className":1046,"code":2992,"language":1048,"meta":1049,"style":1049},"\u002F\u002F Bills carry `entityId`; disbursements carry `clientId`. The client record relates them.\nmatch: [\n  { from: 'clientId', to: 'entityId', via: { collection: 'clients', take: 'id', on: 'entityId' } },\n  { from: 'cycle', to: 'cycle' },\n]\n",[943,2994,2995,3000,3009,3086,3115],{"__ignoreMap":1049},[1053,2996,2997],{"class":1055,"line":1056},[1053,2998,2999],{"class":1446},"\u002F\u002F Bills carry `entityId`; disbursements carry `clientId`. The client record relates them.\n",[1053,3001,3002,3004,3006],{"class":1055,"line":1087},[1053,3003,2802],{"class":1155},[1053,3005,1168],{"class":1063},[1053,3007,3008],{"class":1067}," [\n",[1053,3010,3011,3014,3016,3018,3020,3022,3024,3026,3028,3030,3032,3035,3037,3039,3042,3044,3046,3048,3050,3052,3055,3057,3059,3062,3064,3066,3068,3070,3072,3074,3076,3078,3080,3082,3084],{"class":1055,"line":1108},[1053,3012,3013],{"class":1063},"  {",[1053,3015,1074],{"class":1164},[1053,3017,1168],{"class":1063},[1053,3019,1077],{"class":1063},[1053,3021,2108],{"class":1080},[1053,3023,1207],{"class":1063},[1053,3025,1159],{"class":1063},[1053,3027,2894],{"class":1164},[1053,3029,1168],{"class":1063},[1053,3031,1077],{"class":1063},[1053,3033,3034],{"class":1080},"entityId",[1053,3036,1207],{"class":1063},[1053,3038,1159],{"class":1063},[1053,3040,3041],{"class":1164}," via",[1053,3043,1168],{"class":1063},[1053,3045,1064],{"class":1063},[1053,3047,1262],{"class":1164},[1053,3049,1168],{"class":1063},[1053,3051,1077],{"class":1063},[1053,3053,3054],{"class":1080},"clients",[1053,3056,1207],{"class":1063},[1053,3058,1159],{"class":1063},[1053,3060,3061],{"class":1164}," take",[1053,3063,1168],{"class":1063},[1053,3065,1077],{"class":1063},[1053,3067,2060],{"class":1080},[1053,3069,1207],{"class":1063},[1053,3071,1159],{"class":1063},[1053,3073,2497],{"class":1164},[1053,3075,1168],{"class":1063},[1053,3077,1077],{"class":1063},[1053,3079,3034],{"class":1080},[1053,3081,1207],{"class":1063},[1053,3083,1071],{"class":1063},[1053,3085,1274],{"class":1063},[1053,3087,3088,3090,3092,3094,3096,3099,3101,3103,3105,3107,3109,3111,3113],{"class":1055,"line":1129},[1053,3089,3013],{"class":1063},[1053,3091,1074],{"class":1164},[1053,3093,1168],{"class":1063},[1053,3095,1077],{"class":1063},[1053,3097,3098],{"class":1080},"cycle",[1053,3100,1207],{"class":1063},[1053,3102,1159],{"class":1063},[1053,3104,2894],{"class":1164},[1053,3106,1168],{"class":1063},[1053,3108,1077],{"class":1063},[1053,3110,3098],{"class":1080},[1053,3112,1207],{"class":1063},[1053,3114,1274],{"class":1063},[1053,3116,3117],{"class":1055,"line":1136},[1053,3118,2939],{"class":1067},[937,3120,3121,3122,3125,3126,3129,3130,3133,3134,3137,3138,1038],{},"A source matches when the intermediate — the record in ",[943,3123,3124],{},"via.collection"," whose ",[943,3127,3128],{},"via.take"," equals\n",[943,3131,3132],{},"written[from]"," — carries a ",[943,3135,3136],{},"via.on"," equal to ",[943,3139,3140],{},"source[to]",[3142,3143,3146],"callout",{"color":3144,"icon":3145},"warning","i-lucide-git-branch",[937,3147,3148,3151,3152,3155],{},[940,3149,3150],{},"A write to the INTERMEDIATE collection fires the trigger too",", fanning out on its old ∪ new\nvalue. This is the whole correctness argument rather than a detail: re-pointing an intermediate\nwrites to ",[940,3153,3154],{},"neither"," the trigger collection nor the source collection, so nothing else in the\nsystem can notice, and every source it used to address would be stranded silently. The cheaper\ndesign — resolving the hop only on writes to the trigger collection — passes every test anyone\nwould think to write, and fails only on that one edit.",[937,3157,3158,3159,3161],{},"The alternative to a hop is a denormalised key on one side. That is a second copy of something\nthe vault can already resolve, and a partial backfill goes quiet on exactly the oldest,\nleast-audited rows — the silent staleness ",[943,3160,2802],{}," exists to remove, handed back one layer down.",[937,3163,3164,3165,1326,3168,3171,3172,3174,3175,3177],{},"Cost and edges: hop resolution is ",[940,3166,3167],{},"one lookup per written record",[943,3169,3170],{},"take: 'id'"," is a direct\n",[943,3173,1712],{},"), never one per candidate row. A dangling hop matches nothing rather than throwing.\n",[943,3176,2782],{}," caps the hop fan-out as it does the direct form, and the intermediate's edge enters\nthe cycle-detection graph.",[2804,3179,3181],{"id":3180},"when-the-fan-out-fires-updates-and-deletes","When the fan-out fires — updates and deletes",[937,3183,3184,3185,3187,3188,1168],{},"Two behaviours changed with ",[943,3186,2802],{},", and they apply to the ",[940,3189,3190,3192],{},[943,3191,2767],{}," form too",[1009,3194,3195,3209],{},[1012,3196,3197,3200,3201,3204,3205,3208],{},[940,3198,3199],{},"An update fans out on the old match ∪ the new one."," Changing a matched\nfield re-derives the records addressed by the ",[1024,3202,3203],{},"previous"," value as well as the\nnew one, so nothing is left silently stale. ⚠️ ",[940,3206,3207],{},"A write that does not thread\nthe prior record — a sync-applied wave write, a tiers restore — degrades to\nthe new tuple only."," That is the previous behaviour, chosen over guessing at\nan old key.",[1012,3210,3211,3214,3215,3218,3219,3221,3222,3225,3226,3232],{},[940,3212,3213],{},"A delete fans out on the tombstoned record's values."," Deletes previously\nfired no triggers at all. The fan-out runs ",[1024,3216,3217],{},"after"," the delete commits, so a\n",[943,3220,2782],{}," cap or a ",[943,3223,3224],{},"strict: true"," failure ",[940,3227,3228,3229],{},"can surface from ",[943,3230,3231],{},"delete()"," —\na call site that never used to throw for derivation reasons.",[2804,3234,3236],{"id":3235},"match-targets-are-checked-at-registration","Match targets are checked at registration",[937,3238,3239,3242,3243,3246,3247,3250,3251,3254],{},[943,3240,3241],{},"vault.collection()"," validates every ",[943,3244,3245],{},"from"," \u002F ",[943,3248,3249],{},"to"," against the collection's\ndeclared fields, so a provable typo throws there rather than matching nothing\nforever. Two refinements land in ",[943,3252,3253],{},"0.7.0-pre.13"," (noy-db#1266):",[3256,3257,3258,3271],"table",{},[3259,3260,3261],"thead",{},[3262,3263,3264,3268],"tr",{},[3265,3266,3267],"th",{},"target",[3265,3269,3270],{},"verdict",[3272,3273,3274,3293,3311,3319],"tbody",{},[3262,3275,3276,3287],{},[3277,3278,3279,3280,3283,3284],"td",{},"a field declared via ",[943,3281,3282],{},"via()"," and ",[940,3285,3286],{},"materialized",[3277,3288,3289,3292],{},[940,3290,3291],{},"accepted"," — it was previously rejected as an undeclared typo",[3262,3294,3295,3302],{},[3277,3296,3297,3298,3301],{},"a ",[943,3299,3300],{},"mode: 'virtual'"," computed field",[3277,3303,3304,3307,3308],{},[940,3305,3306],{},"refused",", and the error says ",[943,3309,3310],{},"VIRTUAL",[3262,3312,3313,3316],{},[3277,3314,3315],{},"an unknown name, where the field set is enumerable",[3277,3317,3318],{},"refused as a typo",[3262,3320,3321,3324],{},[3277,3322,3323],{},"anything, on a TS-generic collection with no readable field list",[3277,3325,3326],{},"unguarded, by design",[937,3328,3329,3330,3333,3334,2401,3337,3340,3341,3344],{},"A virtual field is evaluated on read and never stored, so a matcher pointed at\none reads every candidate row and matches nothing, permanently — the exact\nfailure the guard exists to prevent, reached ",[1024,3331,3332],{},"through"," it. It is refused rather\nthan supported because matching a virtual field turns an indexed narrow into a\nfull scan; use ",[943,3335,3336],{},"mode: 'materialized'",[940,3338,3339],{},"The virtual check runs even when the\nfield list is unreadable",", unlike the typo check beside it: ",[1024,3342,3343],{},"\"declared but\nnever stored\""," is provable from the declaration alone.",[1776,3346,3348],{"id":3347},"withrollupoptions",[943,3349,3350],{},"withRollup(options)",[937,3352,3353,3356,3357,3360],{},[943,3354,3355],{},"withRollup"," is the inverse of a join: instead of reading children on\ndemand, the parent carries a ",[940,3358,3359],{},"maintained summary"," folded from its\nchildren by foreign key. It recomputes on child insert, update, AND\ndelete — gap-free.",[1044,3362,3364],{"className":1046,"code":3363,"language":1048,"meta":1049,"style":1049},"import { withRollup } from '@noy-db\u002Fhub\u002Fderivations'\n\nwithRollup\u003CSale, Buyer>({\n  from: 'sales',          \u002F\u002F child collection (the trigger)\n  key: 'buyerId',         \u002F\u002F FK on the child → parent id\n  into: 'buyers',         \u002F\u002F parent collection\n  field: 'revenueByYear', \u002F\u002F field on the parent to maintain\n  compute: (sales) => groupSumByYear(sales, 'total'),\n})\n",[943,3365,3366,3385,3389,3408,3426,3444,3462,3481,3515],{"__ignoreMap":1049},[1053,3367,3368,3370,3372,3375,3377,3379,3381,3383],{"class":1055,"line":1056},[1053,3369,1060],{"class":1059},[1053,3371,1064],{"class":1063},[1053,3373,3374],{"class":1067}," withRollup",[1053,3376,1071],{"class":1063},[1053,3378,1074],{"class":1059},[1053,3380,1077],{"class":1063},[1053,3382,1124],{"class":1080},[1053,3384,1084],{"class":1063},[1053,3386,3387],{"class":1055,"line":1087},[1053,3388,1133],{"emptyLinePlaceholder":1132},[1053,3390,3391,3393,3395,3397,3399,3402,3404,3406],{"class":1055,"line":1108},[1053,3392,3355],{"class":1149},[1053,3394,1152],{"class":1063},[1053,3396,2422],{"class":1155},[1053,3398,1159],{"class":1063},[1053,3400,3401],{"class":1155}," Buyer",[1053,3403,1605],{"class":1063},[1053,3405,1188],{"class":1067},[1053,3407,1191],{"class":1063},[1053,3409,3410,3413,3415,3417,3419,3421,3423],{"class":1055,"line":1129},[1053,3411,3412],{"class":1164},"  from",[1053,3414,1168],{"class":1063},[1053,3416,1077],{"class":1063},[1053,3418,2451],{"class":1080},[1053,3420,1207],{"class":1063},[1053,3422,1159],{"class":1063},[1053,3424,3425],{"class":1446},"          \u002F\u002F child collection (the trigger)\n",[1053,3427,3428,3431,3433,3435,3437,3439,3441],{"class":1055,"line":1136},[1053,3429,3430],{"class":1164},"  key",[1053,3432,1168],{"class":1063},[1053,3434,1077],{"class":1063},[1053,3436,2504],{"class":1080},[1053,3438,1207],{"class":1063},[1053,3440,1159],{"class":1063},[1053,3442,3443],{"class":1446},"         \u002F\u002F FK on the child → parent id\n",[1053,3445,3446,3449,3451,3453,3455,3457,3459],{"class":1055,"line":1194},[1053,3447,3448],{"class":1164},"  into",[1053,3450,1168],{"class":1063},[1053,3452,1077],{"class":1063},[1053,3454,2490],{"class":1080},[1053,3456,1207],{"class":1063},[1053,3458,1159],{"class":1063},[1053,3460,3461],{"class":1446},"         \u002F\u002F parent collection\n",[1053,3463,3464,3467,3469,3471,3474,3476,3478],{"class":1055,"line":1213},[1053,3465,3466],{"class":1164},"  field",[1053,3468,1168],{"class":1063},[1053,3470,1077],{"class":1063},[1053,3472,3473],{"class":1080},"revenueByYear",[1053,3475,1207],{"class":1063},[1053,3477,1159],{"class":1063},[1053,3479,3480],{"class":1446}," \u002F\u002F field on the parent to maintain\n",[1053,3482,3483,3486,3488,3490,3492,3494,3496,3499,3502,3504,3506,3509,3511,3513],{"class":1055,"line":1227},[1053,3484,3485],{"class":1149},"  compute",[1053,3487,1168],{"class":1063},[1053,3489,1326],{"class":1063},[1053,3491,2451],{"class":1329},[1053,3493,1333],{"class":1063},[1053,3495,1336],{"class":1139},[1053,3497,3498],{"class":1149}," groupSumByYear",[1053,3500,3501],{"class":1067},"(sales",[1053,3503,1159],{"class":1063},[1053,3505,1077],{"class":1063},[1053,3507,3508],{"class":1080},"total",[1053,3510,1207],{"class":1063},[1053,3512,1333],{"class":1067},[1053,3514,1210],{"class":1063},[1053,3516,3517,3519],{"class":1055,"line":1238},[1053,3518,1453],{"class":1063},[1053,3520,1456],{"class":1067},[1009,3522,3523,3545,3561,3568,3578],{},[1012,3524,3525,3526,3528,3529,3532,3533,3536,3537,3540,3541,3544],{},"On a ",[943,3527,3245],{}," write\u002Fdelete the parent at id ",[943,3530,3531],{},"child[key]"," is recomputed:\n",[943,3534,3535],{},"compute(children where child[key] === parentId)"," is patched onto\n",[943,3538,3539],{},"parent[field]",". A parent write also recomputes its own aggregate, so a\n",[940,3542,3543],{},"parent created after its children"," still fills in.",[1012,3546,3547,3550,3551,3553,3554,3556,3557,3560],{},[940,3548,3549],{},"A child that RE-PARENTS recomputes both parents"," since ",[943,3552,3253],{},"\n(noy-db#1257). Moving a child from A to B previously recomputed only B and\nleft A's aggregate holding a number that was correct before the move — a\nstale total reads as data rather than as an error, so nothing prompts anyone\nto re-check it. ⚠️ Same qualification as the ",[943,3555,1029],{}," fan-out: ",[940,3558,3559],{},"a write\nthat does not thread a prior record — a sync-applied wave write, a tiers\nrestore — degrades to new-parent-only"," rather than guessing at the old key.",[1012,3562,3563,3564,3567],{},"Only ",[943,3565,3566],{},"field"," is patched onto the parent's raw record (other fields and\ni18n maps untouched); a value-equality guard suppresses no-op writes.",[1012,3569,3570,3571,3573,3574,3577],{},"The aggregate gathers children through the FK index when ",[943,3572,3245],{}," is\nindexed on ",[943,3575,3576],{},"key",", else a scan.",[1012,3579,3580,3581,3584],{},"Eager-only in this slice. Desugars to a derivation carrying a ",[943,3582,3583],{},"rollup","\nmarker; dispatch handles it without the executor.",[3586,3587,3588],"blockquote",{},[937,3589,3590,3593,3594,3597,3598,3601,3602,3604,3605,3607,3608,3611],{},[940,3591,3592],{},"Why not a materialized view?"," An MV aggregates children into a\n",[1024,3595,3596],{},"parallel"," collection (",[943,3599,3600],{},"buyer-totals.get(id)","); it cannot write the\naggregate onto a field of the parent ",[943,3603,2490],{}," record. ",[943,3606,3355],{}," does.\n",[943,3609,3610],{},"vault.forget()"," does not auto-re-derive (it bypasses the put path) —\nrecompute explicitly if a forgotten record must drop out of an aggregate.",[1776,3613,3615],{"id":3614},"optional",[943,3616,3614],{},[937,3618,3619,3620,3623,3624,3626,3627,3630],{},"Declare an output as ",[943,3621,3622],{},"optional: true"," to let ",[943,3625,990],{}," return ",[943,3628,3629],{},"null"," for\nthat key:",[1044,3632,3634],{"className":1046,"code":3633,"language":1048,"meta":1049,"style":1049},"outputs: {\n  receipt: { shape: 'record', collection: 'receipts', optional: true },\n},\nderive: (alloc) => ({\n  receipt: alloc.servicesNetPortion > 0\n    ? { id: alloc.id, paymentId: alloc.paymentId, appliedAmount: alloc.appliedAmount }\n    : null,\n})\n",[943,3635,3636,3645,3687,3691,3709,3727,3775,3783],{"__ignoreMap":1049},[1053,3637,3638,3641,3643],{"class":1055,"line":1056},[1053,3639,3640],{"class":1155},"outputs",[1053,3642,1168],{"class":1063},[1053,3644,1235],{"class":1063},[1053,3646,3647,3650,3652,3654,3656,3658,3660,3662,3664,3666,3668,3670,3672,3674,3676,3678,3681,3683,3685],{"class":1055,"line":1087},[1053,3648,3649],{"class":1155},"  receipt",[1053,3651,1168],{"class":1063},[1053,3653,1064],{"class":1063},[1053,3655,1248],{"class":1155},[1053,3657,1168],{"class":1063},[1053,3659,1077],{"class":1063},[1053,3661,1255],{"class":1080},[1053,3663,1207],{"class":1063},[1053,3665,1159],{"class":1063},[1053,3667,1262],{"class":1155},[1053,3669,1168],{"class":1063},[1053,3671,1077],{"class":1063},[1053,3673,1888],{"class":1080},[1053,3675,1207],{"class":1063},[1053,3677,1159],{"class":1063},[1053,3679,3680],{"class":1155}," optional",[1053,3682,1168],{"class":1063},[1053,3684,1222],{"class":1221},[1053,3686,1274],{"class":1063},[1053,3688,3689],{"class":1055,"line":1108},[1053,3690,1389],{"class":1063},[1053,3692,3693,3695,3697,3699,3701,3703,3705,3707],{"class":1055,"line":1129},[1053,3694,990],{"class":1155},[1053,3696,1168],{"class":1063},[1053,3698,1326],{"class":1063},[1053,3700,1908],{"class":1329},[1053,3702,1333],{"class":1063},[1053,3704,1336],{"class":1139},[1053,3706,1326],{"class":1067},[1053,3708,1191],{"class":1063},[1053,3710,3711,3713,3715,3717,3719,3722,3724],{"class":1055,"line":1136},[1053,3712,3649],{"class":1164},[1053,3714,1168],{"class":1063},[1053,3716,2055],{"class":1067},[1053,3718,1038],{"class":1063},[1053,3720,3721],{"class":1067},"servicesNetPortion ",[1053,3723,1605],{"class":1063},[1053,3725,3726],{"class":1674}," 0\n",[1053,3728,3729,3732,3734,3737,3739,3741,3743,3745,3747,3750,3752,3754,3756,3758,3760,3763,3765,3767,3769,3772],{"class":1055,"line":1194},[1053,3730,3731],{"class":1063},"    ?",[1053,3733,1064],{"class":1063},[1053,3735,3736],{"class":1164}," id",[1053,3738,1168],{"class":1063},[1053,3740,2055],{"class":1067},[1053,3742,1038],{"class":1063},[1053,3744,2060],{"class":1067},[1053,3746,1159],{"class":1063},[1053,3748,3749],{"class":1164}," paymentId",[1053,3751,1168],{"class":1063},[1053,3753,2055],{"class":1067},[1053,3755,1038],{"class":1063},[1053,3757,1973],{"class":1067},[1053,3759,1159],{"class":1063},[1053,3761,3762],{"class":1164}," appliedAmount",[1053,3764,1168],{"class":1063},[1053,3766,2055],{"class":1067},[1053,3768,1038],{"class":1063},[1053,3770,3771],{"class":1067},"appliedAmount ",[1053,3773,3774],{"class":1063},"}\n",[1053,3776,3777,3780],{"class":1055,"line":1213},[1053,3778,3779],{"class":1063},"    :",[1053,3781,3782],{"class":1063}," null,\n",[1053,3784,3785,3787],{"class":1055,"line":1227},[1053,3786,1453],{"class":1063},[1053,3788,1456],{"class":1067},[937,3790,3791],{},"Semantics:",[1009,3793,3794,3803,3810,3813],{},[1012,3795,3796,3798,3799,3802],{},[943,3797,3629],{}," (or ",[943,3800,3801],{},"undefined",") for an optional output → no write fires.",[1012,3804,3805,3806,3809],{},"If a previous derivation emitted an output at this id, it's ",[940,3807,3808],{},"deleted","\n(a tombstone for derived data). The eager path captures the prior\nenvelope on the active transaction context so the delete rolls back\nalongside the source op on transaction failure.",[1012,3811,3812],{},"A never-emitted optional output is a silent no-op.",[1012,3814,3815,3816,3818,3819,3821,3822,1038],{},"Returning ",[943,3817,3629],{}," for a required output (default — no ",[943,3820,3614],{}," flag)\nstill throws ",[943,3823,3824],{},"DerivationOutputShapeError",[937,3826,3827,3828,1038],{},"Same behavior on eager and lazy lifecycles, and through ",[943,3829,3830],{},"vault.deriveAll()",[2804,3832,3834],{"id":3833},"tombstone-vs-ondelete-composition","Tombstone-vs-onDelete composition",[937,3836,3837,3838,3841,3842,3844,3845,3848,3849,3851,3852,3855],{},"A tombstone is a ",[940,3839,3840],{},"system-internal"," delete: the derivation engine\nrevoking its own prior emission because the source flipped to the\n\"no output\" branch. User ",[943,3843,970],{}," guards registered on the output\ncollection are ",[940,3846,3847],{},"not"," consulted on tombstones — the same way amendments\nbypass user-facing hooks. If they fired, a consumer registering both\n(a) an ",[943,3850,3622],{}," derivation and (b) an ",[943,3853,3854],{},"onDelete: () => throw","\non the output collection would deadlock: every flip-to-null source\nwrite would block on the user's own append-only rule.",[937,3857,3858,3859,3862,3863,3865,3866,3869,3870,3873],{},"Concretely: if you ship a ",[943,3860,3861],{},"paymentAllocation → receipt"," derivation with\n",[943,3864,3622],{},", AND ",[943,3867,3868],{},"receipts.onDelete: throw"," for legal-document\nimmutability, ",[940,3871,3872],{},"the tombstone bypass keeps both coherent",". Users can\nno longer manually delete a receipt (good), and the system can still\nrevoke its own prior emission when the underlying allocation\nrestructures (also good).",[937,3875,3876,3877,3880,3881,3884,3885,3887],{},"The bypass is scoped to the system-internal delete path\n(",[943,3878,3879],{},"Collection._internalDelete","); a user-initiated ",[943,3882,3883],{},"Collection.delete","\non the same record still fires ",[943,3886,970],{}," normally.",[1776,3889,3891],{"id":3890},"lifecycle",[943,3892,3890],{},[1009,3894,3895,3906],{},[1012,3896,3897,3901,3902,3905],{},[940,3898,3899],{},[943,3900,1439],{}," — derive runs synchronously inside the source-write transaction.\nOutputs are written via the same ",[943,3903,3904],{},"Collection.put"," pipeline. Recommended for\nsmall, fast derive functions.",[1012,3907,3908,3912],{},[940,3909,3910],{},[943,3911,719],{}," — source-write marks output ids stale; first read of any output\ntriggers the derive. Recommended when the derive is expensive and most\nsources are written without being read.",[1776,3914,3916],{"id":3915},"strict",[943,3917,3915],{},[937,3919,3920,3921,3924,3925,1038],{},"Default (",[943,3922,3923],{},"strict: false","): per-output failures are isolated. Other outputs\ncommit; the failed output is absent from the store and re-attempts on next\n",[943,3926,1002],{},[3142,3928,3931,3962],{"color":3929,"icon":3930},"neutral","i-lucide-refresh-cw",[937,3932,3933,3939,3940,3942,3943,3946,3947,3950,3951,3953,3954,3957,3958,3961],{},[940,3934,3935,3936,3938],{},"On the ",[943,3937,719],{}," lifecycle, a failed non-strict re-derive now keeps the record\nstale"," (noy-db#1258, ",[943,3941,3253],{},"). ",[943,3944,3945],{},"resolveStaleOnRead"," consumes the pending\nflag before reading the source — a recursion guard for self-write outputs — and\na non-strict failure used to leave it consumed, so the record was served as\nfresh and ",[940,3948,3949],{},"never retried, permanently",", because nothing would mark it stale\nagain. ",[943,3952,3923],{}," means ",[1024,3955,3956],{},"\"a failed derivation must not break the read\"",",\nnot ",[1024,3959,3960],{},"\"report this output as current\"",": the record is still served and the\nwarning still fires, but the flag survives and the next read retries.",[937,3963,3964,3965,3967],{},"The stated cost: a permanently-failing non-strict derivation now re-runs on\n",[940,3966,2834],{}," read of that id rather than once. Louder and more expensive than\nserving a stale value forever, and deliberately so.",[937,3969,3970,3972,3973,3979],{},[943,3971,3224],{},": a single output failure rolls back the source write (only\nwhen wrapped in ",[948,3974,3976],{"href":3975},".\u002Ftransactions",[943,3977,3978],{},"withTransactions","). Use for outputs\nthat must remain consistent with the source.",[1776,3981,3983],{"id":3982},"vaultderiveallcollection",[943,3984,3985],{},"vault.deriveAll(collection)",[937,3987,3988,3989,3992],{},"Re-derive every record in the named source collection. Useful after a strategy\nchange (the strategy hash mismatch forces a recompute on next visit, but\n",[943,3990,3991],{},"deriveAll"," is the explicit bulk path):",[1044,3994,3996],{"className":1046,"code":3995,"language":1048,"meta":1049,"style":1049},"const { derived, failed } = await vault.deriveAll('pdfs')\n\u002F\u002F → { derived: 42, failed: 0 }\n",[943,3997,3998,4034],{"__ignoreMap":1049},[1053,3999,4000,4002,4004,4007,4009,4012,4014,4016,4018,4020,4022,4024,4026,4028,4030,4032],{"class":1055,"line":1056},[1053,4001,1140],{"class":1139},[1053,4003,1064],{"class":1063},[1053,4005,4006],{"class":1067}," derived",[1053,4008,1159],{"class":1063},[1053,4010,4011],{"class":1067}," failed ",[1053,4013,1453],{"class":1063},[1053,4015,1930],{"class":1063},[1053,4017,1474],{"class":1059},[1053,4019,1593],{"class":1067},[1053,4021,1038],{"class":1063},[1053,4023,3991],{"class":1149},[1053,4025,1188],{"class":1067},[1053,4027,1207],{"class":1063},[1053,4029,1204],{"class":1080},[1053,4031,1207],{"class":1063},[1053,4033,1456],{"class":1067},[1053,4035,4036],{"class":1055,"line":1087},[1053,4037,4038],{"class":1446},"\u002F\u002F → { derived: 42, failed: 0 }\n",[1776,4040,4042],{"id":4041},"_derivedfrom",[943,4043,2753],{},[937,4045,4046],{},"Every derived record carries:",[1044,4048,4051],{"className":4049,"code":4050,"language":141,"meta":1049,"style":1049},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"_derivedFrom\": {\n    \"source\": \"pdfs\",\n    \"sourceId\": \"abc\",\n    \"sourceVersion\": 3,\n    \"derivedAt\": \"2026-05-18T00:00:00.000Z\",\n    \"strategyHash\": \"sha256-...\"\n  }\n}\n",[943,4052,4053,4057,4071,4091,4111,4127,4147,4166,4171],{"__ignoreMap":1049},[1053,4054,4055],{"class":1055,"line":1056},[1053,4056,1191],{"class":1063},[1053,4058,4059,4062,4064,4067,4069],{"class":1055,"line":1087},[1053,4060,4061],{"class":1063},"  \"",[1053,4063,2753],{"class":1139},[1053,4065,4066],{"class":1063},"\"",[1053,4068,1168],{"class":1063},[1053,4070,1235],{"class":1063},[1053,4072,4073,4076,4078,4080,4082,4085,4087,4089],{"class":1055,"line":1108},[1053,4074,4075],{"class":1063},"    \"",[1053,4077,2204],{"class":1155},[1053,4079,4066],{"class":1063},[1053,4081,1168],{"class":1063},[1053,4083,4084],{"class":1063}," \"",[1053,4086,1204],{"class":1080},[1053,4088,4066],{"class":1063},[1053,4090,1210],{"class":1063},[1053,4092,4093,4095,4098,4100,4102,4104,4107,4109],{"class":1055,"line":1129},[1053,4094,4075],{"class":1063},[1053,4096,4097],{"class":1155},"sourceId",[1053,4099,4066],{"class":1063},[1053,4101,1168],{"class":1063},[1053,4103,4084],{"class":1063},[1053,4105,4106],{"class":1080},"abc",[1053,4108,4066],{"class":1063},[1053,4110,1210],{"class":1063},[1053,4112,4113,4115,4118,4120,4122,4125],{"class":1055,"line":1136},[1053,4114,4075],{"class":1063},[1053,4116,4117],{"class":1155},"sourceVersion",[1053,4119,4066],{"class":1063},[1053,4121,1168],{"class":1063},[1053,4123,4124],{"class":1674}," 3",[1053,4126,1210],{"class":1063},[1053,4128,4129,4131,4134,4136,4138,4140,4143,4145],{"class":1055,"line":1194},[1053,4130,4075],{"class":1063},[1053,4132,4133],{"class":1155},"derivedAt",[1053,4135,4066],{"class":1063},[1053,4137,1168],{"class":1063},[1053,4139,4084],{"class":1063},[1053,4141,4142],{"class":1080},"2026-05-18T00:00:00.000Z",[1053,4144,4066],{"class":1063},[1053,4146,1210],{"class":1063},[1053,4148,4149,4151,4154,4156,4158,4160,4163],{"class":1055,"line":1213},[1053,4150,4075],{"class":1063},[1053,4152,4153],{"class":1155},"strategyHash",[1053,4155,4066],{"class":1063},[1053,4157,1168],{"class":1063},[1053,4159,4084],{"class":1063},[1053,4161,4162],{"class":1080},"sha256-...",[1053,4164,4165],{"class":1063},"\"\n",[1053,4167,4168],{"class":1055,"line":1227},[1053,4169,4170],{"class":1063},"  }\n",[1053,4172,4173],{"class":1055,"line":1238},[1053,4174,3774],{"class":1063},[937,4176,4177,4179,4180,4182,4183,2401,4185,4187,4188,4191,4192,4194],{},[943,4178,4153],{}," (a hash of the source name, the output keys, and the ",[943,4181,990],{},"\nfunction's own source) is the mechanism for detecting strategy drift: a\nrecord whose hash doesn't match the current strategy is recomputed by\n",[943,4184,1002],{},[943,4186,4117],{}," is stamped ",[943,4189,4190],{},"0"," on records produced by\n",[943,4193,3830],{}," or by lazy resolution — the source record's real version\nisn't threaded through those two paths yet.",[1776,4196,4198],{"id":4197},"composition-order","Composition order",[937,4200,4201,4202,4204],{},"Derivations fire ",[940,4203,3217],{}," the store write and ledger append. A guard that\nblocks a source write also blocks the derivation that would have fired from\nit.",[1044,4206,4211],{"className":4207,"code":4209,"language":4210},[4208],"language-text","Collection.put\n  1. Permission check\n  2. GuardRegistry.check\n  3. Encrypt + store.put\n  4. Ledger append\n  5. DerivationRegistry           ← this doc\n","text",[943,4212,4209],{"__ignoreMap":1049},[1776,4214,4216],{"id":4215},"errors","Errors",[937,4218,4219,4220,1168],{},"All extend ",[943,4221,4222],{},"NoydbError",[1009,4224,4225,4231,4240,4246,4252],{},[1012,4226,4227,4230],{},[943,4228,4229],{},"DerivationCycleError(path[])"," — graph contains a cycle",[1012,4232,4233,4236,4237],{},[943,4234,4235],{},"DerivationDepthError(limit, attempted)"," — cascade exceeded ",[943,4238,4239],{},"maxDepth",[1012,4241,4242,4245],{},[943,4243,4244],{},"DerivationOutputUnknownError(collection)"," — output collection unknown",[1012,4247,4248,4251],{},[943,4249,4250],{},"DerivationOutputShapeError(outputKey, detail)"," — derive returned wrong shape",[1012,4253,4254,4257,4258,4260,4261],{},[943,4255,4256],{},"DerivationCapExceededError(key, count, max)"," — a ",[943,4259,1029],{}," fan-out or\narray-shape output exceeded ",[943,4262,2782],{},[978,4264,4266],{"id":4265},"behavior-when-not-opted-in","Behavior when NOT opted in",[1009,4268,4269,4275,4284],{},[1012,4270,4271,4274],{},[943,4272,4273],{},"createNoydb({ derivationStrategies: [...] })"," is the only way to register\nderivations; without it, no derive function fires",[1012,4276,4277,4279,4280,4283],{},[943,4278,3985],{}," is a no-op — it returns ",[943,4281,4282],{},"{ derived: 0, failed: 0 }","\nrather than throwing, since there is nothing registered to run",[1012,4285,4286,3246,4289,4292,4293,3246,4296,4292,4298,4300,4301,4303],{},[943,4287,4288],{},"DerivationCycleError",[943,4290,4291],{},"DerivationDepthError"," \u002F\n",[943,4294,4295],{},"DerivationOutputUnknownError",[943,4297,3824],{},[943,4299,2786],{}," are still importable from\n",[943,4302,1124],{}," but are never thrown by core",[978,4305,4307],{"id":4306},"pairs-well-with","Pairs well with",[1009,4309,4310,4315,4326],{},[1012,4311,4312,4314],{},[948,4313,693],{"href":967}," — guards run before encryption; a blocked source write\nshort-circuits the derivation that would have fired",[1012,4316,4317,4319,4320,4322,4323,4325],{},[948,4318,876],{"href":3975}," — ",[943,4321,3224],{}," derivations require\n",[943,4324,3978],{}," so output failures can roll back the source write",[1012,4327,4328,4331,4332,4334],{},[948,4329,697],{"href":4330},".\u002Fhistory"," — every committed derivation output fires its own\nledger entry through the standard ",[943,4333,3904],{}," pipeline",[978,4336,4338],{"id":4337},"edge-cases-limits","Edge cases & limits",[1776,4340,4342],{"id":4341},"zero-knowledge-guarantee","Zero-knowledge guarantee",[937,4344,4345,4346,4348],{},"The derive function executes after DEK unwrap, on plaintext. The store never\nsees plaintext. Outputs are encrypted with the same DEK as the source before\nthey reach the store. ",[943,4347,2753],{}," metadata lives inside the encrypted\npayload, not in the plaintext envelope.",[1776,4350,4352],{"id":4351},"cycle-detection","Cycle detection",[937,4354,4355,4356,4359,4360,4362],{},"Cyclic graphs (A → B → A, self-loops, etc.) are rejected when a vault opens\n(",[943,4357,4358],{},"db.openVault","), with ",[943,4361,4288],{},". The graph is the union of\nevery strategy's source + output collection set.",[1776,4364,4366],{"id":4365},"behavior-notes","Behavior notes",[1009,4368,4369,4381,4397],{},[1012,4370,4371,4374,4375,4377,4378,4380],{},[940,4372,4373],{},"Lazy stale-tracking is in-memory only."," A vault close-and-reopen\nloses pending stale flags. Derived records with a matching ",[943,4376,4153],{},"\nare treated as fresh; ",[943,4379,3830],{}," is the explicit recompute path\nafter strategy changes.",[1012,4382,4383,4389,4390,4392,4393,4396],{},[940,4384,4385,4388],{},[943,4386,4387],{},"sourceVersion: 0"," on bulk recomputes."," ",[943,4391,3830],{}," and the\nlazy-resolution path stamp ",[943,4394,4395],{},"_derivedFrom.sourceVersion = 0"," because the\nenvelope version isn't threaded through those two paths.",[1012,4398,4399,4402,4403,4405,4406,4408,4409,4411],{},[940,4400,4401],{},"Recursion guard."," The dispatch hook in ",[943,4404,3904],{}," skips when the\nincoming record carries a ",[943,4407,2753],{}," field — a defense-in-depth check\nalongside the ",[943,4410,1570],{}," cycle validator.",[1776,4413,4415],{"id":4414},"not-yet-built","Not yet built",[937,4417,4418,4419,3246,4421,4423],{},"The following are outside what ",[943,4420,986],{},[943,4422,3355],{}," do today —\nthere is no API surface for them yet:",[1009,4425,4426,4429,4435,4443,4450,4453,4456,4459,4462],{},[1012,4427,4428],{},"Cache-tier storage backends as a derivation target",[1012,4430,4431,4432,4434],{},"Built-in derivers (PDF text extraction, image processing, etc.) — you\nbring your own ",[943,4433,990],{}," function",[1012,4436,4437,4438,3283,4440,4442],{},"Scheduled \u002F cron-style refresh (only ",[943,4439,1439],{},[943,4441,719],{}," exist)",[1012,4444,4445,4446,4449],{},"Non-deterministic derivations with persistence — ",[943,4447,4448],{},"deterministic: true","\nis required",[1012,4451,4452],{},"External or sandboxed derivation runtimes",[1012,4454,4455],{},"Publishing a derivation's output to a public CDN",[1012,4457,4458],{},"Streaming materialized views for continuous\u002Funbounded result sets",[1012,4460,4461],{},"Persisting the lazy stale-flag map across a vault close",[1012,4463,4464],{},"Threading the real per-record source version through bulk recompute paths",[978,4466,4468],{"id":4467},"see-also","See also",[1009,4470,4471,4476,4481,4486,4494,4499,4510],{},[1012,4472,4473,4475],{},[948,4474,739],{"href":959}," — persist an entire query as a live, auto-refreshed collection (sibling derived-data service)",[1012,4477,4478,4480],{},[948,4479,768],{"href":963}," — operator row-level overrides on a source or MV (sibling derived-data service)",[1012,4482,4483,4485],{},[948,4484,693],{"href":967}," — write-time rules; system-internal deletes from derivations bypass them",[1012,4487,4488,4490,4491,4493],{},[948,4489,876],{"href":3975}," — required for ",[943,4492,3224],{}," rollback on derivations",[1012,4495,4496,4498],{},[948,4497,697],{"href":4330}," — every derived write still appends its own ledger entry",[1012,4500,4501,4502],{},"Package tests plus showcase ",[948,4503,4507],{"href":4504,"rel":4505},"https:\u002F\u002Fgithub.com\u002Fnoy-db\u002Fdocs\u002Fblob\u002Fmain\u002Fshowcases\u002Fsrc\u002F80-with-derivation.showcase.test.ts",[4506],"nofollow",[943,4508,4509],{},"80-with-derivation.showcase.test.ts",[1012,4511,4512,4513,3283,4519,1038],{},"Proven by showcases ",[948,4514,4516],{"href":4504,"rel":4515},[4506],[943,4517,4518],{},"80-with-derivation",[948,4520,4523],{"href":4521,"rel":4522},"https:\u002F\u002Fgithub.com\u002Fnoy-db\u002Fdocs\u002Fblob\u002Fmain\u002Fshowcases\u002Fsrc\u002F104-reverse-denorm.showcase.test.ts",[4506],[943,4524,4525],{},"104-reverse-denorm",[4527,4528,4529],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":1049,"searchDepth":1108,"depth":1108,"links":4531},[4532,4533,4534,4535,4536,4559,4560,4561,4567],{"id":980,"depth":1087,"text":981},{"id":1006,"depth":1087,"text":1007},{"id":1041,"depth":1087,"text":1042},{"id":1535,"depth":1087,"text":1536},{"id":1773,"depth":1087,"text":1774,"children":4537},[4538,4540,4541,4549,4550,4553,4554,4555,4556,4557,4558],{"id":1778,"depth":1108,"text":4539},"derive(source, ctx) and the read-only vault facade",{"id":2190,"depth":1108,"text":2190},{"id":2390,"depth":1108,"text":2391,"children":4542},[4543,4545,4547,4548],{"id":2806,"depth":1129,"text":4544},"Composite matches — match",{"id":2976,"depth":1129,"text":4546},"One declared hop — via",{"id":3180,"depth":1129,"text":3181},{"id":3235,"depth":1129,"text":3236},{"id":3347,"depth":1108,"text":3350},{"id":3614,"depth":1108,"text":3614,"children":4551},[4552],{"id":3833,"depth":1129,"text":3834},{"id":3890,"depth":1108,"text":3890},{"id":3915,"depth":1108,"text":3915},{"id":3982,"depth":1108,"text":3985},{"id":4041,"depth":1108,"text":2753},{"id":4197,"depth":1108,"text":4198},{"id":4215,"depth":1108,"text":4216},{"id":4265,"depth":1087,"text":4266},{"id":4306,"depth":1087,"text":4307},{"id":4337,"depth":1087,"text":4338,"children":4562},[4563,4564,4565,4566],{"id":4341,"depth":1108,"text":4342},{"id":4351,"depth":1108,"text":4352},{"id":4365,"depth":1108,"text":4366},{"id":4414,"depth":1108,"text":4415},{"id":4467,"depth":1087,"text":4468},null,"Deterministic derived data: withDerivation() projects one source record into typed outputs, encrypted under the source's key, with cycle detection at open.","md",{},"service",{"title":665,"description":4569},"experimental","important","CQ2PAo5iyLwvtQtvutzf_WYwOasI3mRgfeYi0ME8qjU",{"data":4578,"body":4579},{},{"type":4580,"children":4581},"root",[4582],{"type":4583,"tag":937,"props":4584,"children":4585},"element",{},[4586],{"type":4583,"tag":943,"props":4587,"children":4589},{"className":4588},[],[4590],{"type":4210,"value":1124},{"data":4592,"body":4593},{},{"type":4580,"children":4594},[4595],{"type":4583,"tag":937,"props":4596,"children":4597},{},[4598],{"type":4583,"tag":943,"props":4599,"children":4601},{"className":4600},[],[4602],{"type":4210,"value":945},{"data":4604,"body":4605},{},{"type":4580,"children":4606},[4607],{"type":4583,"tag":937,"props":4608,"children":4609},{},[4610],{"type":4583,"tag":943,"props":4611,"children":4613},{"className":4612},[],[4614],{"type":4210,"value":4615},"with-formula",1791896585581]