Skip to content

docs: add execution pipeline overview section to README#95

Open
FaikAijaz wants to merge 1 commit intoaccordproject:mainfrom
FaikAijaz:faikaijaz/i94/execution-pipeline-docs
Open

docs: add execution pipeline overview section to README#95
FaikAijaz wants to merge 1 commit intoaccordproject:mainfrom
FaikAijaz:faikaijaz/i94/execution-pipeline-docs

Conversation

@FaikAijaz
Copy link

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.

Signed-off-by: FaikAijaz <faikaijaz635@gmail.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TemplateMarkToJavaScriptCompiler and JavaScriptEvaluator classes (including their evalDangerously() and evalChildProcess() 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.

Comment on lines +36 to +37
- `evalDangerously()` — Executes JavaScript directly within the current process.
- `evalChildProcess()` — Executes JavaScript in an isolated Node.js child process for improved safety and isolation.
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- `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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify internal execution pipeline in README

2 participants