// The try covers setup as well as the displayed example. try { // Solving uses the same document-access policy with Alice's two input facts. const engine = keepEngine(await Engine.create({ profile: 'small' })) registerDocuments(engine) const ruleset = engine.loadInlineRuleset(documentDomain, 'reference-context', documentPolicy) const input = ruleset.edb() input.addFact('user', ['alice']) input.addFact('owns', ['alice', 'roadmap.pdf']) /* API_REFERENCE_EXAMPLE */ } finally { // Engine.close cascades to every ruleset, input, session and result it owns. closeEngines() }