<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Engine Functionality on Porch Documentation</title><link>/docs/5_architecture_and_components/engine/functionality/</link><description>Recent content in Engine Functionality on Porch Documentation</description><generator>Hugo</generator><language>en-us</language><atom:link href="/docs/5_architecture_and_components/engine/functionality/index.xml" rel="self" type="application/rss+xml"/><item><title>Validation &amp; Business Rules</title><link>/docs/5_architecture_and_components/engine/functionality/validation-business-rules/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/5_architecture_and_components/engine/functionality/validation-business-rules/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&lt;p&gt;The Engine enforces validation and business rules to ensure package revisions are created and modified correctly. These rules prevent invalid operations, enforce naming constraints, and maintain referential integrity across packages and revisions.&lt;/p&gt;
&lt;h3 id="high-level-architecture"&gt;High-Level Architecture&lt;/h3&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────┐
│ Validation &amp;amp; Business Rules │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Pre-Operation │ │ Constraint │ │
│ │ Validation │ ───&amp;gt; │ Enforcement │ │
│ │ │ │ │ │
│ │ • Lifecycle │ │ • Uniqueness │ │
│ │ • Tasks │ │ • Path Overlap │ │
│ │ • Resources │ │ • Clone Rules │ │
│ └──────────────────┘ └──────────────────┘ │
│ │ │ │
│ └────────┬────────────────┘ │
│ ↓ │
│ ┌──────────────────┐ │
│ │ Optimistic │ │
│ │ Locking │ │
│ │ │ │
│ │ • Resource Ver │ │
│ │ • Conflict Det │ │
│ └──────────────────┘ │
└─────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="lifecycle-validation"&gt;Lifecycle Validation&lt;/h2&gt;&lt;p&gt;The Engine validates lifecycle values during package revision creation and updates:&lt;/p&gt;</description></item><item><title>Draft-Commit Workflow Orchestration</title><link>/docs/5_architecture_and_components/engine/functionality/draft-commit-orchestration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/5_architecture_and_components/engine/functionality/draft-commit-orchestration/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&lt;p&gt;The Engine orchestrates a draft-commit workflow for all package revision modifications. This pattern ensures atomicity - either all changes succeed and are persisted, or none are. The workflow uses mutable drafts for changes and immutable package revisions for storage.&lt;/p&gt;
&lt;h3 id="high-level-architecture"&gt;High-Level Architecture&lt;/h3&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────┐
│ Draft-Commit Workflow Orchestration │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Draft Phase │ │ Commit Phase │ │
│ │ │ ───&amp;gt; │ │ │
│ │ • Open Draft │ │ • Close Draft │ │
│ │ • Apply Changes │ │ • Persist │ │
│ │ • Validate │ │ • Immutable │ │
│ └──────────────────┘ └──────────────────┘ │
│ │ │ │
│ └────────┬────────────────┘ │
│ ↓ │
│ ┌──────────────────┐ │
│ │ Rollback │ │
│ │ Mechanism │ │
│ │ │ │
│ │• Trigger On Error│ │
│ │• Does Cleanup │ │
│ └──────────────────┘ │
└─────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="draft-commit-pattern"&gt;Draft-Commit Pattern&lt;/h2&gt;&lt;p&gt;The Engine uses a two-phase workflow for all package revision modifications:&lt;/p&gt;</description></item><item><title>Lifecycle Management</title><link>/docs/5_architecture_and_components/engine/functionality/lifecycle-management/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/5_architecture_and_components/engine/functionality/lifecycle-management/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&lt;p&gt;The Engine enforces a strict lifecycle state machine for package revisions that governs their mutability, visibility, and progression from draft to published state. The lifecycle system ensures that package revisions follow a controlled workflow from creation through approval to deployment, with appropriate constraints at each stage.&lt;/p&gt;
&lt;h3 id="high-level-architecture"&gt;High-Level Architecture&lt;/h3&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────┐
│ Lifecycle Management System │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ State Machine │ │ Validation │ │
│ │ │ ───&amp;gt; │ &amp;amp; Enforcement │ │
│ │ • Draft │ │ │ │
│ │ • Proposed │ │ • Creation │ │
│ │ • Published │ │ • Transition │ │
│ │ • Deletion │ │ • Mutation │ │
│ └──────────────────┘ └──────────────────┘ │
│ │ │ │
│ └────────┬────────────────┘ │
│ ↓ │
│ ┌──────────────────┐ │
│ │ State-Based │ │
│ │ Constraints │ │
│ │ │ │
│ │ • Mutability │ │
│ │ • Operations │ │
│ │ • Audit Trail │ │
│ └──────────────────┘ │
└─────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="lifecycle-state-machine"&gt;Lifecycle State Machine&lt;/h2&gt;&lt;p&gt;The lifecycle state machine defines four states that a package revision can be in:&lt;/p&gt;</description></item><item><title>Task Coordination</title><link>/docs/5_architecture_and_components/engine/functionality/task-coordination/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/5_architecture_and_components/engine/functionality/task-coordination/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&lt;p&gt;The Engine coordinates task execution by delegating to the Task Handler. Tasks represent operations that transform package content (init, clone, edit, upgrade, render). The Engine orchestrates when and how tasks are executed, while the Task Handler implements the actual transformations.&lt;/p&gt;
&lt;h3 id="high-level-architecture"&gt;High-Level Architecture&lt;/h3&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────┐
│ Task Coordination System │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Engine │ │ Task Handler │ │
│ │ Orchestration │ ───&amp;gt; │ Execution │ │
│ │ │ │ │ │
│ │ • When to Run │ │ • Init │ │
│ │ • Draft Mgmt │ │ • Clone │ │
│ │ • Error Handle │ │ • Edit │ │
│ └──────────────────┘ │ • Upgrade │ │
│ │ │ • Render │ │
│ │ └──────────────────┘ │
│ ↓ │ │
│ ┌──────────────────┐ ↓ │
│ │ Function │ ┌──────────────────┐ │
│ │ Runtime │ &amp;lt;─── │ Builtin Funcs │ │
│ │ │ │ │ │
│ │ • gRPC │ │ • set-namespace │ │
│ │ • Builtin │ │ • ensure-context│ │
│ └──────────────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="task-handler-integration"&gt;Task Handler Integration&lt;/h2&gt;&lt;p&gt;The Engine integrates with the Task Handler through three main operations:&lt;/p&gt;</description></item></channel></rss>