docs: add execution pipeline overview section to README#95
docs: add execution pipeline overview section to README#95FaikAijaz wants to merge 1 commit intoaccordproject:mainfrom
Conversation
Signed-off-by: FaikAijaz <faikaijaz635@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR closes issue #94 by adding a new "Execution Pipeline Overview" section to the README, documenting the internal stages of the Template Engine's evaluation process: type validation, TypeScript-to-JavaScript compilation, user code evaluation, AgreementMark generation, and output validation.
Changes:
- Documents the 5-stage execution pipeline of the template engine with accurate descriptions of each step.
- Introduces the
TemplateMarkToJavaScriptCompilerandJavaScriptEvaluatorclasses (including theirevalDangerously()andevalChildProcess()strategies) to the public-facing README. - Adds a summary sentence about the layered architecture's benefits (type-safety, determinism, isolation).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `evalDangerously()` — Executes JavaScript directly within the current process. | ||
| - `evalChildProcess()` — Executes JavaScript in an isolated Node.js child process for improved safety and isolation. |
There was a problem hiding this comment.
The description of evalDangerously() omits a critical security caveat that is explicitly documented in the source code (src/JavaScriptEvaluator.ts, lines 83–84): this method should only be used with trusted code or within a sandbox (e.g., the browser). Without this warning, developers reading the README may not understand when it is safe to use evalDangerously() versus evalChildProcess(), potentially leading to unsafe usage in server-side production environments with untrusted template content. The description should add a note that evalDangerously() is intended for trusted code or browser/sandbox contexts only.
| - `evalDangerously()` — Executes JavaScript directly within the current process. | |
| - `evalChildProcess()` — Executes JavaScript in an isolated Node.js child process for improved safety and isolation. | |
| - `evalDangerously()` — Executes JavaScript directly within the current process. This should only be used with trusted code or in a sandboxed environment (e.g., the browser). | |
| - `evalChildProcess()` — Executes JavaScript in an isolated Node.js child process for improved safety and isolation and is recommended for untrusted template content on the server. |
Closes #94
Summary
Adds a new "Execution Pipeline Overview" section to the README to clarify the internal evaluation flow of the Template Engine.
Motivation
While the README explains TemplateMark and AgreementMark at a high level, it does not clearly describe how embedded TypeScript expressions are compiled and evaluated at runtime. This addition improves developer onboarding and clarifies the role of the JavaScriptEvaluator in the execution pipeline.