# QIS Ecosystem

Institutional reference platform for **Quantitative Investment Strategies (QIS)**.
Three domains are served from **one** Cloudflare Pages project, split by hostname
at the edge:

| Domain          | Layer         | Served from | Pillar accent |
|-----------------|---------------|-------------|---------------|
| `qisfund.com`   | Capital       | `/` (root)  | Gold          |
| `qisagent.com`  | Intelligence  | `/agent/`   | Blue          |
| `qistrust.com`  | Governance    | `/trust/`   | Violet        |

`functions/_middleware.js` performs the hostname routing (silent rewrite, not a
redirect — each domain keeps its own address bar), enforces the apex host
(`www.*` and `*.pages.dev` → apex), and serves each host its own
`robots.txt` / `sitemap.xml`.

## Deploying

This repo is connected to Cloudflare Pages (project: **qisfund**) via Git.
**Any commit to the `main` branch auto-deploys.** No build step.

- Build command: *(none)*
- Build output directory: `/`

To change the site: edit a file, commit, done. Cloudflare rebuilds in ~30s.

## Everyday edits

- **Text / a page:** edit the relevant `.html` file and commit.
- **Design (all pages at once):** edit `styles.css` — then **bump the cache
  version**: every page links `styles.css?v=7`; change `?v=7` → `?v=8`
  site-wide so browsers pick up the new CSS. (Same rule for `app.js`.)
- **A new Atlas entry / strategy / page:** copy an existing file in that folder
  as a template, edit it, add its URL to the matching `sitemap-*.xml`, commit.
- **Affiliate links:** all live in `partner-links.js` — one file, one place.
- **Newsletter storage:** bind a KV namespace named `SIGNALS` to the Pages
  project (Settings → Bindings). Until then the form soft-succeeds.
- **Daily snapshot:** `.github/workflows/daily-snapshot.yml` refreshes
  `snapshot.json` each weekday (needs Actions write permission — see below).

## One-time settings after connecting Git

1. Pages project → **Custom domains**: `qisfund.com`, `qisagent.com`,
   `qistrust.com` (+ their `www.`) — already attached.
2. GitHub repo → **Settings → Actions → General → Workflow permissions →
   Read and write** (lets the daily snapshot commit).
3. Verify (incognito): `qisagent.com/robots.txt` returns the **agent** robots
   (references `sitemap-agent.xml`), and `qisagent.com` serves the Agent home
   while staying on `qisagent.com`.

## File map

```
/                    qisfund.com   (capital layer)
/agent/              qisagent.com  (intelligence layer)
/trust/              qistrust.com  (governance layer)
/functions/          edge routing middleware + /api/subscribe
/strategies/         QIS strategy taxonomy
/glossary/           canonical QIS glossary
/signals/            newsletter
styles.css           the entire design system (dark, Cormorant, tri-accent)
partner-links.js     ALL affiliate URLs, one place
robots-*.txt         per-host robots (served as /robots.txt by middleware)
sitemap-*.xml        per-host sitemaps (served as /sitemap.xml by middleware)
```

© 2026 QIS Ecosystem · qisfund.com · qisagent.com · qistrust.com
