From a11c87c4dc9ff387c47a0ef5104358033227ea9c Mon Sep 17 00:00:00 2001 From: claude code agent 227 Date: Sun, 21 Jun 2026 03:40:40 +0300 Subject: [PATCH] docs(page-templates): document that lookupTemplate is flat (no server recursion) (#54) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assessment of the page-embed depth/cycle cap: the server /pages/template/lookup returns FLAT single-level content and does NOT recurse into embedded pages — the recursive expansion + the PAGE_EMBED_MAX_DEPTH cap are entirely client render concerns, and a scripted client is already bounded by the per-user throttle (30/min) + the ArrayMaxSize(50) per-call cap. So no server-side depth guard is needed; documented at lookupTemplate so future readers don't add a redundant one or assume server recursion exists. Co-Authored-By: Claude Opus 4.8 --- .../src/core/page/transclusion/transclusion.service.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/server/src/core/page/transclusion/transclusion.service.ts b/apps/server/src/core/page/transclusion/transclusion.service.ts index 76bb8cfb..4dc0de9c 100644 --- a/apps/server/src/core/page/transclusion/transclusion.service.ts +++ b/apps/server/src/core/page/transclusion/transclusion.service.ts @@ -395,6 +395,15 @@ export class TransclusionService { * pages return `no_access`, missing/deleted pages return `not_found`. Does NOT * require `is_template` — any accessible page can be embedded (the template * flag only affects picker discovery). + * + * FLAT, single-level by design: this returns each requested page's own content + * verbatim and never recurses. If a returned page itself contains a `pageEmbed` + * node pointing at another page, that embed is left unresolved — the client + * issues a follow-up lookup for it. Because there is no server-side recursive + * expansion, there is no server depth/cycle to guard here: the embed depth/cycle + * cap (PAGE_EMBED_MAX_DEPTH) is purely a client RENDER concern. A scripted client + * that walks the graph manually is bounded by the per-user throttle (30/60s) on + * the controller plus the DTO's ArrayMaxSize(50) per call. */ async lookupTemplate( sourcePageIds: string[],