FREY_QUERY_FLOW.md

# FREY · QUERY FLOW SPEC (UI‑only) v0.1

Status: CANON DRAFT  
Scope: bhrigu-portal `/frey` + `/reading` (UI-only v0.1)

## 1) Purpose
We need a stable user flow for the “Query Bar” that:
- feels alive and usable today (no backend dependency),
- is **safe** (no public endpoints, no tokens, no fetch),
- is **observable** (probes + markers + artifacts),
- becomes the hard interface later when Frey runtime is ready.

## 2) Hard Constraints (UI‑only v0.1)
- **No `fetch()`** and no network calls from `/frey` (or other UI-only surfaces).
- No public API URLs, no env tokens, no embedded secrets.
- Surface must remain static-friendly and deterministic.

## 3) UX Surface (what user sees)
**/frey**
- Query Bar (input) is always readable:
  - typed text must be visible on dark background,
  - placeholder must be visible but dim.
- Live Preview block is readable and non-interactive:
  - shows sanitized echo of the query,
  - shows “templates” as UI hints (not executed logic).

**/reading**
- Receives the query via URL param, e.g. `?q=...`
- Displays “Incoming Query” card (read-only), with:
  - copy-to-clipboard button (optional later),
  - link back to `/frey` (“Refine query”),
  - link to `/access` (“Request consult”).

## 4) Data Flow (no backend)
Input → URL param → Render
- On submit (Enter):
  - navigate to `/reading?q=<encoded>`
- No storage required (no localStorage needed in v0.1).
- Optional: preserve `q` when returning back to `/frey` later.

## 5) Template Pack (UI hints only)
Templates are textual frames that help a user express intent.
They are not executed — only displayed.

Minimal set (v0.1):
- “Cosmography scan”
- “Consultation request”
- “Research / reading list”
- “Signal / pattern check”

## 6) Observability (Truth Layer)
We treat truth as: **gates + artifacts + prod probes**.

Mandatory:
- UI-only guard (strict forbidden strings)
- Build gate (`next build`)
- Prod verify on both domains with cache-busting:
  - headers: `age`, `x-vercel-cache`, `x-matched-path`, `x-vercel-id`
  - markers on `/frey`:
    - `FREY_SURFACE_CANON_V0_3`
    - `PHI_SURFACE_V0_3`

Probes:
- `scripts/phi_check.sh` (route status + `/api`=410)
- `scripts/phi_lupa_portal.sh` (surface token scan across routes)
- `scripts/phi_lupa_frey.sh` (frey-specific verify across both domains)

## 7) Next Implementation Atom (after this spec)
- Implement `/reading?q=` “Incoming Query” module (UI-only, no fetch).
- Extend `phi_lupa_frey` to confirm `/reading` preserves markers (optional).

F_CANON.md

# Φ‑CANON · Frey / Cosmography Development Standard (v0.1)

This repo follows **Φ‑protocol**: artifact‑first, deterministic atoms, and provable production state.

## 0) Roles
- **Operator** = human (time/attention is highest non‑recoverable value).
- **Frey** = epistemic navigation layer (no authority, no “confidence by tone”).
- Work is done in **ATOMS**: 1 atom → 1 commit → 1 verified deploy → 1 crystal.

## 1) Truth model (what counts as “true”)
A statement is “true” only if it is backed by artifacts:
- `OPS_RUNLOG_*` (what was executed)
- `OPS_STATUS_CRYSTAL_*` + `.sha256` (final state snapshot)
- `PATCH_*.diff` (exact code delta)
- `PROD_PROBE_*` (headers + markers + cache‑busting proof)

No artifact → no truth.

## 2) Daily order (deterministic)
1. **RECON**: repo+branch+HEAD+clean + `git pull --ff-only`.
2. **Minimal patch** (single purpose).
3. **GATES** (in order):
   - **UI‑ONLY guard** (strict forbidden‑token string checks for UI pages).
   - **Build gate**: `next build` + lint/types.
4. **Commit+push** only if all gates PASS.
5. **Prod verify** on both domains (`bhrigu.io` and `www`) with cache‑buster:
   - record headers: `age`, `x-vercel-cache`, `x-matched-path`, `x-vercel-id`
   - check HTML markers (surface tokens)
6. **Crystal** (+sha) + hard‑copy to Windows Downloads.
7. **Uploadpack**: zip range/day to stay within upload limits.

## 3) UI‑ONLY guard (strict)
The UI‑only page must not contain literal forbidden tokens (even in comments).
Typical forbidden needles:
- `fetch`, `endpoint`, `endpoints`, `token`, `authorization`, `bearer`, `api key`
Rule: if UI‑only guard FAIL → STOP, sanitize strings, re-run gate.

## 4) Probes (Φ‑lupa toolkit)
- `phi_lupa_portal` — fast portal probe (non‑blocking; helps prevent “terminal crash loops”).
- `phi_lupa_frey` — fast `/frey` surface probe (markers + headers + cache).
These are the **epistemic instruments**: they tell us what prod really serves.

## 5) Surface markers (verification anchors)
`/frey` must include stable markers used by probes:
- `FREY_SURFACE_CANON_V0_3`
- `PHI_SURFACE_V0_3`
- `PHI surface v0.3`

## 6) Packaging / upload optimization
Preferred upload set (4 files):
- `UPLOADPACK_*.zip` + `.sha256`
- matching `OPS_STATUS_CRYSTAL_*.md` + `.sha256`
Runlogs/patches live inside the zip.

## 7) STOP / FAIL gates (hard)
- repo not clean before patch/commit
- ff-only sync fails
- UI‑only guard FAIL
- build gate FAIL
- prod verify FAIL
On STOP/FAIL: still emit crystal (+sha) and do **not** push.


boundaries.md

# System Boundaries

## EN
This system is intentionally divided into independent layers:

– ORION: analytical core
– Φ-Cosmography: scientific layer
– Frey: interaction interface
– DAO: governance and economics
– BHRIGU: public portal

No layer has implicit authority over another.

Boundaries are enforced by design.

## RU
Система намеренно разделена на независимые слои:

– ORION: аналитическое ядро
– Φ-Космография: научный слой
– Frey: интерфейс взаимодействия
– DAO: управление и экономика
– BHRIGU: публичный портал

Ни один слой не обладает неявной властью над другим.

Границы заданы архитектурно.

chronicle.md

# Chronicle

## EN
This chronicle records states, not events.

### 2025-12-13 — Phase A · Portal Launch
State: Canon  
Mode: Hold  
Contour: Closed  
Note: BHRIGU was deployed as a structural portal. No cores were touched.

### 2025-12-13 — Phase B · Meaning Layer
State: Stable  
Mode: Read  
Contour: Self-contained  
Note: Semantic layers (Start, Reading, Map, Services, Access, Signal) assembled.
The portal reached readable completeness without activation.

Further actions imply observation only.

## RU
Эта хроника фиксирует состояния, а не события.

### 2025-12-13 — Фаза A · Запуск портала
Состояние: Канон  
Режим: Удержание  
Контур: Закрыт  
Примечание: BHRIGU развёрнут как структурный портал. Ядра не затронуты.

### 2025-12-13 — Фаза B · Слой смысла
Состояние: Стабильно  
Режим: Чтение  
Контур: Самодостаточный  
Примечание: Семантические слои собраны.
Портал завершён как читаемая структура без активации.

Дальнейшие действия — только наблюдение.

cosmography.md

# Φ-Cosmography

## EN
Φ-Cosmography is a scientific and visual exploration layer.

It focuses on:
– harmonic spatial structures
– golden-ratio based cycles
– cosmographic resonance patterns

Φ-Cosmography is strictly separated from:
– DAO governance
– economic logic
– access control systems

This separation is intentional and permanent.

## RU
Φ-Космография — это научный и визуальный исследовательский слой.

Он изучает:
– гармонические пространственные структуры
– циклы, основанные на золотом сечении
– космографические резонансные паттерны

Φ-Космография строго отделена от:
– управления DAO
– экономической логики
– систем доступа

Это разделение осознанное и постоянное.

dao.md

# DAO Layer

## EN
The DAO represents the governance and economic coordination layer.

DAO responsibilities include:
– access policies
– economic flows
– participation rules

The DAO explicitly does NOT control:
– ORION Core
– Φ-Cosmography
– analytical logic

## RU
DAO представляет слой управления и экономической координации.

В зону ответственности DAO входят:
– политики доступа
– экономические потоки
– правила участия

DAO явно НЕ управляет:
– ядром ORION
– Φ-Космографией
– аналитической логикой

frey.md

# Frey

## EN
Frey is a communication and interaction interface.

Its role includes:
– human × AI interaction
– semantic navigation
– contextual mediation

Frey has:
– no authority over ORION
– no access to core algorithms
– no governance control

## RU
Frey — это интерфейс коммуникации и взаимодействия.

Его роль:
– взаимодействие человек × AI
– семантическая навигация
– контекстное посредничество

Frey не имеет:
– власти над ORION
– доступа к алгоритмам ядра
– функций управления

map.md

# System Map

## EN
Layers:
1) BHRIGU — portal and gateway
2) DAO — governance and economics
3) Frey — interaction interface
4) Φ-Cosmography — scientific layer
5) ORION — analytical core

Reading follows this order.

## RU
Слои:
1) BHRIGU — портал и шлюз
2) DAO — управление и экономика
3) Frey — интерфейс взаимодействия
4) Φ-Космография — научный слой
5) ORION — аналитическое ядро

Чтение следует этому порядку.

orion-core.md

# ORION Core

## EN
ORION is an isolated analytical engine.

It operates as:
– a multi-layer cycle system
– a resonance-based analytical core
– a φ-structured computation engine

ORION has:
– no user interface
– no governance layer
– no economic authority

Access to ORION is restricted and API-only.

## RU
ORION — это изолированное аналитическое ядро.

Он функционирует как:
– многослойная система циклов
– резонансный аналитический движок
– вычислительное ядро, структурированное по φ

ORION не имеет:
– пользовательского интерфейса
– слоя управления
– экономической власти

Доступ к ORION осуществляется только через API и ограничен.

phase-a-canon.md

# Phase A — Canon

## EN
Phase A establishes:
– portal deployment
– canonical structure
– domain ownership
– strict layer separation

Phase A is frozen.
No functional expansion is performed at this stage.

## RU
Фаза A зафиксировала:
– развёртывание портала
– каноническую структуру
– владение доменом
– строгое разделение слоёв

Фаза A заморожена.
Функциональное расширение на этом этапе не производится.

portal-intro.md

# BHRIGU Portal

## EN
BHRIGU is not a product, not a landing page, and not a marketplace.

It is a structural portal:
– a showcase of system layers
– a gateway to analytical and economic contours
– a public interface without core authority

BHRIGU exposes structure without exposing the core.

## RU
BHRIGU — это не продукт, не лендинг и не маркетплейс.

Это структурный портал:
– витрина слоёв системы
– шлюз к аналитическим и экономическим контурам
– публичный интерфейс без власти над ядром

BHRIGU показывает структуру, не раскрывая ядро.

reading.md

# How to Read the Portal

## EN
Do not search.
Do not click.
Do not expect answers.

Read sequentially.
Hold the axis.

## RU
Не ищи.
Не кликай.
Не жди ответов.

Читай последовательно.
Удерживай ось.

start.md

# Start

## EN
The portal is open.

This is not an interface.
This is an axis.

Presence precedes interaction.
Structure precedes explanation.

## RU
Портал открыт.

Это не интерфейс.
Это ось.

Присутствие предшествует взаимодействию.
Структура предшествует объяснению.

work-done.md

# Work Completed

## EN
Completed milestones include:
– multi-phase engine development
– hierarchical cycle modeling
– resonance mapping
– infrastructure stabilization
– portal deployment

Some layers are publicly visible.
Some layers are intentionally undisclosed.

## RU
Выполненные этапы включают:
– многофазную разработку движка
– моделирование иерархий циклов
– резонансное картирование
– стабилизацию инфраструктуры
– развёртывание портала

Часть слоёв публична.
Часть слоёв намеренно не раскрыта.