> ## Documentation Index
> Fetch the complete documentation index at: https://dapplets.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Universal LifeCycle

> In the Mutable Web, every interaction with applications, mutations, and objects follows a consistent workflow, ensuring a seamless and efficient user experience. This universal lifecycle comprises three key stages: Local Change, Publish, and Pull Request.

<img alt="Lifecycle Hero Light" class="block dark:hidden" src="https://mintcdn.com/dapplets/wRdVJXf87WLT473Y/images/lifecycle-light.png?fit=max&auto=format&n=wRdVJXf87WLT473Y&q=85&s=09fee9539b96a98b767c690c6950674c" width="823" height="380" data-path="images/lifecycle-light.png" />

<img alt="Lifecycle Hero Dark" class="hidden dark:block" src="https://mintcdn.com/dapplets/wRdVJXf87WLT473Y/images/lifecycle-dark.png?fit=max&auto=format&n=wRdVJXf87WLT473Y&q=85&s=884a4ae49cca5432fdf1c0cbc6a09877" width="823" height="380" data-path="images/lifecycle-dark.png" />

## Semantic Context

The Mutable Web introduces a structure where each object—whether it’s a **mutation** or a **document**—follows a consistent lifecycle involving **local edits** and **potential publication**.

The process applies universally across all applications, mutations, or objects:

```text theme={null}
LocalChange => Publish (as Fork, as Update) => Pull Request
```

## Key Stages of the Lifecycle

### **1. Local Change**

When a user initiates an interaction, such as creating or editing an object, changes occur **locally** in their environment. This approach allows users to make multiple adjustments before deciding to make them public.

**Visibility Settings During Local Changes:**

* **`Private`:** Accessible only via ID; not visible in search results or public lists.

* **`Devel`:** Visible only in **developer mode**, ideal for testing and iteration.

* **`Public`:** Fully visible and searchable by others.

This local-first approach ensures flexibility without risking unintended public exposure.

### **2. Publish (as Fork or Update)**

Once satisfied with local changes, users can **publish** their modifications. The method of publication depends on **ownership**:

* **Fork:** If the object was created by someone else, the user forks it to create an independent version.

* **Update:** If the object is the user’s original creation, they can directly publish it as an **update**.

**Context-Sensitive Publish Button:**
The **Publish** button dynamically adapts based on the object’s origin and state, offering the option to **notify the original author** via a `notify origin` checkbox.

<Accordion title="Example of Forking" defaultOpen={false}>
  `Forking a Foreign Mutation:` Fork another author’s mutation, make adjustments, and publish it independently.&#x20;

  `Forking Your Own Mutation:` Fork your mutation to branch into separate versions (e.g., testing vs. production).
</Accordion>

### **Creating a Mutation from Scratch**

Users can also create a **new mutation** without forking an existing one. In this scenario:

* The mutation starts with a **null ID**.

* Once published, it generates a **unique ID**.

### **3. Pull Request**

Integrated into the **Publish** action, the **Pull Request** mechanism allows users to propose changes to the original author.

* By selecting the **`notify origin`** option during publication, the original author is alerted about the proposed modifications.

* This facilitates **collaboration** and **iterative improvements**.

This structured workflow ensures **systematic interaction management**, fostering a collaborative and user-centric environment.

## Special Cases in the LifeCycle

<img alt="Lifecycle Special Cases Light" class="block dark:hidden" src="https://mintcdn.com/dapplets/wRdVJXf87WLT473Y/images/cycle-special-cases-light.png?fit=max&auto=format&n=wRdVJXf87WLT473Y&q=85&s=ad0cd2dc1b2ea9426766118fc9269259" width="1646" height="760" data-path="images/cycle-special-cases-light.png" />

<img alt="Lifecycle Special Cases Dark" class="hidden dark:block" src="https://mintcdn.com/dapplets/wRdVJXf87WLT473Y/images/cycle-special-cases-dark.png?fit=max&auto=format&n=wRdVJXf87WLT473Y&q=85&s=12e2d2bd88e2af4671971389e7de6a76" width="1646" height="760" data-path="images/cycle-special-cases-dark.png" />

### **Editing Your Own Mutation Without an Origin**

When editing a mutation **without an origin** (not forked from another mutation):

* Changes are treated as **updates**.

* No local copy is created.

* The **ID remains unchanged**.

### **Editing a Mutation with an Origin (Foreign Author)**

When editing a **forked mutation** based on another author’s work:

* Changes remain **local** until published.

* **Origin metadata** is preserved.

* A **`Publish as Fork`** operation is required to maintain the mutation's history.

### **Publishing a Fork**

When publishing a fork:

* The **original mutation remains unaltered**.

* The forked version receives a **unique ID**.

* Forks can be further **edited, published, or forked again**.

## Fork and Edit Lifecycle

Each mutation follows a lifecycle based on its origin and editing context:

<Steps>
  <Step title="Forking Someone Else’s Mutation">
    Create a new branch from an existing mutation for independent development.
  </Step>

  <Step title="Forking Your Own Mutation">
    Branch out versions of your mutation for different use cases (e.g., production vs. testing).
  </Step>

  <Step title="Creating a Mutation from Scratch">
    Start fresh with a new mutation, generating a unique ID upon publication.
  </Step>

  <Step title="Editing Your Own Mutation (No Origin)">
    Directly update your original mutation without creating a separate fork.
  </Step>

  <Step title="Editing Your Own Mutation (With Origin)">
    Modify a forked mutation, maintaining origin metadata for clarity and traceability.
  </Step>
</Steps>

This systematic approach ensures clarity and consistency across different mutation workflows.

<Tip>
  The **Mutable Web Lifecycle** provides a robust structure for managing changes, fostering collaboration, and ensuring adaptability across diverse use cases.
</Tip>

Whether you’re an **end-user**, **developer**, or **community contributor**, understanding and following these workflows is key to building an efficient, decentralized, and adaptive internet.

**Let’s create, share, and innovate—together.**
