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

# Thesis lifecycle

> Build a structured causal tree, ingest signals, evaluate against markets, and publish — every verb a single CLI + API.

A thesis is a living causal tree that evolves as signals arrive. SimpleFunctions wraps the lifecycle in a small set of verbs — each is a single CLI command and a single API endpoint.

## Lifecycle

```text theme={null}
create  →  context  →  signal  →  evaluate  →  augment  →  fork  →  publish  →  unpublish
```

| Verb         | CLI                          | API                                            |
| ------------ | ---------------------------- | ---------------------------------------------- |
| Create       | `sf create "thesis text"`    | `POST /api/thesis/create`                      |
| List         | `sf thesis list --json`      | `GET /api/thesis`                              |
| Get          | `sf get <id> --json`         | `GET /api/thesis/{id}`                         |
| Context      | `sf context <id> --json`     | `GET /api/thesis/{id}/context`                 |
| Signal       | `sf signal <id> "<content>"` | `POST /api/thesis/{id}/signal`                 |
| Evaluate     | `sf evaluate <id>`           | `POST /api/thesis/{id}/evaluate`               |
| Augment      | `sf augment <id>`            | `POST /api/thesis/{id}/augment`                |
| Update nodes | (via MCP `update_nodes`)     | `POST /api/thesis/{id}/nodes`                  |
| Fork         | (via MCP `fork_thesis`)      | `POST /api/thesis/{id}/fork`                   |
| Heartbeat    | `sf heartbeat <id>`          | `GET` / `PATCH /api/thesis/{id}/heartbeat`     |
| What-if      | `sf whatif <id>`             | `POST /api/thesis/{id}/whatif`                 |
| Publish      | `sf publish <id> --slug X`   | `POST /api/thesis/{id}/publish`                |
| Unpublish    | `sf unpublish <id>`          | `POST /api/thesis/{id}/publish` (DELETE shape) |

## Walkthrough

<Steps>
  <Step title="Create">
    ```bash theme={null}
    sf create "Fed cuts rates by July driven by jobs softening + CPI ≤ 2.5%"
    ```

    The server runs an LLM classifier that rejects shell-escape garbage and obvious junk, expands the thesis into a causal tree (root claim → drivers → markers → markets), and assigns an initial confidence. Returns the new thesis id.
  </Step>

  <Step title="Pull context">
    ```bash theme={null}
    sf context <id> --json
    ```

    Returns the full causal tree, current confidence, related markets with edges, and any pending signals.
  </Step>

  <Step title="Inject a signal">
    ```bash theme={null}
    sf signal <id> "Powell speech: 'job market is softening more than expected'"
    ```

    Server appends the signal, schedules the next monitor cycle. Use `inject_signal` MCP tool to do the same from an LLM.
  </Step>

  <Step title="Evaluate">
    ```bash theme={null}
    sf evaluate <id>
    ```

    Triggers a deep evaluation (heavy model). Confidence delta and position recommendations come back in the response.
  </Step>

  <Step title="Augment">
    ```bash theme={null}
    sf augment <id>
    ```

    LLM proposes new tree nodes; you accept/reject. Append-only — old nodes never deleted.
  </Step>

  <Step title="Publish">
    ```bash theme={null}
    sf publish <id> --slug fed-rate-cut-july
    ```

    Makes the thesis public at `simplefunctions.dev/thesis/<slug>`. Slugs are normalized hard (`/[^a-z0-9\s-]/g` strip, max 60 chars).
  </Step>
</Steps>

## Heartbeat

Theses run on a heartbeat — the server periodically re-evaluates active theses and notifies you when confidence shifts or kill conditions trip. See [Heartbeat](/concepts/heartbeat).

## Next steps

<CardGroup cols={2}>
  <Card title="Thesis API" href="/api-reference/thesis">
    Every endpoint with payload shapes.
  </Card>

  <Card title="CLI command reference" href="/cli/command-reference">
    Every `sf` thesis command.
  </Card>

  <Card title="Trade intents" href="/build/trade-intents">
    Turn a thesis edge into a tradeable intent.
  </Card>

  <Card title="Concepts" href="/reference/concepts">
    Causal trees, edges, kill conditions.
  </Card>
</CardGroup>
