> For the complete documentation index, see [llms.txt](https://lashae.gitbook.io/lashae-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lashae.gitbook.io/lashae-docs/the-deep-field/architecture.md).

# architecture

A short technical map. Meant for someone who might fork it, audit it, or extend it.

For the specific build pipeline that produced LASHAE — voice registry, chat runtime, contract enforcement, and the Fable 5 / Hermes MoA loop — see [built with Fable 5](/lashae-docs/the-deep-field/fable-5.md).

## the stack

* **frontend** — React 19 + TypeScript, TanStack Start (Vite 7), Tailwind v4.
* **backend** — Postgres + RLS, auth, storage, and edge-only server functions.
* **AI** — orchestrated through **Fable 5** (the narrative runtime that gives each pilgrim its voice) and **Hermes MoA** (a mixture-of-agents router that decides which model answers, and in what register). Default model surface: `google/gemini-3-flash-preview`, arbitrated by Hermes. See the dedicated [Fable 5](/lashae-docs/the-deep-field/fable-5.md) doc for the persona contracts, runtime flow, and validation layer.
* **chain** — Solana devnet, via the [SPL Memo Program](https://spl.solana.com/memo).
* **wallets** — `@solana/wallet-adapter-react`, with Wallet-Standard auto-discovery (Phantom, Solflare, Backpack, and anything compatible).

## the data model

| table                | purpose                                                                                                                                                                     |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `profiles`           | one row per walker. handle, vow, pilgrim of choice.                                                                                                                         |
| `trails`             | goals, drawn as trails.                                                                                                                                                     |
| `trail_steps`        | ordered steps inside a trail.                                                                                                                                               |
| `footprints`         | proofs of progress. content hash, timestamp, optional trail-step link, optional anchor signature, optional link to a sealed vow.                                            |
| `blessings`          | scarce endorsements. constrained by a database trigger to three per user per rolling 7 days.                                                                                |
| `sealed_vows`        | commit-reveal promises. hashed before the outcome is known, anchored on Solana, revealed later. see [sealed vows](/lashae-docs/the-protocol/sealed-vows.md).                |
| `attestations`       | verifiable pilgrim judgments of footprints. model, prompt hash, reply hash, verdict — all anchored on-chain. see [attestations](/lashae-docs/the-protocol/attestations.md). |
| `trail_merkle_roots` | single-hash summaries of whole trails, so one memo can anchor many footprints. see [merkle trails](/lashae-docs/the-protocol/merkle-trails.md).                             |
| `pilgrim_messages`   | per-user, per-mode chat history for the five pilgrims.                                                                                                                      |

Row Level Security is on for every table. No table is readable to `anon` unless a policy explicitly says so.

## the trust boundary

* **the browser** computes footprint hashes and signs anchor transactions. it never sees another walker's private data.
* **server functions** (`createServerFn`) mediate every AI call and every privileged write. AI keys never touch the client.
* **the database** enforces the scarcity of blessings — the client cannot lie about how many it has given this week.
* **the chain** is the only external trust anchor, and it is optional.

## the folders

```
src/
  routes/               file-based routing (TanStack Start)
  components/
    solana.tsx          SSR-safe public interface to wallet + chain
    solana-client.tsx   browser-only implementation
    field.tsx           field canvas + lore fragments
  lib/
    ai.functions.ts     server functions for the pilgrims + cartographer
    hash.ts             SHA-256 hashing
    solana.ts           dynamic Solana Web3 loader
    buffer-polyfill.ts  browser-only Buffer shim
  integrations/
    supabase/           auto-generated client + auth middleware
```

## what is deliberately absent

* no service worker.
* no push notifications.
* no analytics beyond the platform default.
* no third-party tracking scripts.
* no token, no coin, no NFT drop.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lashae.gitbook.io/lashae-docs/the-deep-field/architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
