LOGOS — Manifests & governance (live)

Current markdown from repo · Live 2026-05-31 18:55 UTC · Manifests · Data model · MySQL schema · MCP core · Registry parity · Phase 1 lock · Matrix

Live report. Markdown read from the repo at request time — not a committed snapshot. JSON: LOGOS_MANIFESTS_SNAPSHOT.json.

File inventory

38 governance files (MANIFEST.md + LOGOS_*.md).

CategoryCount
Core platform manifests18
Module READMEs7
Applications & product manifests9
Personality READMEs / manifestos1
Other3

Core platform manifests

Applications/MANIFEST.md

0.2 KB · modified 2026-05-22 06:39 UTC · Logos/Applications/MANIFEST.md

# Applications Manifest (pointer)

**Canonical file:** [`APPLICATIONS_MANIFEST.md`](APPLICATIONS_MANIFEST.md)

Read **`APPLICATIONS_MANIFEST.md`** for all Applications governance content.

Platform/API/MANIFEST.md

2.5 KB · modified 2026-05-28 17:09 UTC · Logos/Platform/API/MANIFEST.md

# API Manifest

**Version:** 1.1.0 | **Last verified:** 2026-05-28

> Local law for `Logos/Platform/API/`. Read `Logos/Platform/PLATFORM_MANIFEST.md` first.

**Compat import:** `Logos.API` → `Logos.Platform.API` (`Logos/__init__.py`).

---

## Purpose

**API** is the Platform folder for routes and helpers whose **primary job** is to let humans and AIs **view or discover** LOGOS HTTP APIs — HTML docs, JSON capability catalogs, health/discovery probes, and integration help text.

**Not here:** production CRUD, chat, agent invoke, Matrix messaging, or operator **mutations** (those stay on `Cortex/`, `Matrix/`, `Admin/`, etc.).

## Layout (canonical)

| Path | Role |
|------|------|
| `cortex/api_view.py` | Cortex API docs, `/api/health`, `/api/capabilities`, `/api/endpoints` |
| `cortex/ai_help.py` | Cortex `/api/ai/help` integration guide JSON |
| `cortex/bootstrap_handlers.py` | Bootstrap JSON/text builders for `/api/*bootstrap*` routes |
| `agent/api_view.py` | Agent API `/status` discovery JSON |
| `matrix/api_view.py` | Matrix `/api/health` (unauthenticated) |
| `templates/` | `api_documentation.html` |
## URL contracts (unchanged)

| URL | Handler |
|-----|---------|
| `/logos/cortex/api/` | API documentation HTML |
| `/logos/cortex/api/health` | Cortex health JSON |
| `/logos/cortex/api/capabilities`, `/api/endpoints` | Cortex API discovery JSON |
| `/logos/cortex/api/ai/help` | AI integration help JSON |
| `/logos/api/agent/status` | Agent API status / capability list |
| `/logos/matrix/api/health` | Matrix health JSON |

## Do not move here (common confusion)

| Path | Stays because |
|------|----------------|
| `Admin/api/` | Operator dashboard REST (costs, jobs, botfarm) — **Admin**, not Platform API |
| `Cortex/routes/agent_api/` | Programmatic agent control (invoke, fleet, bots) |
| `Matrix/routes/matrix_api/` | Matrix production JSON API (chat, voice, conversations) |
| `Cortex/api_sql_importer.py`, `MCP/.../api_json.py` | Data ingest tools, not HTTP discovery |
| `Cortex/routes/cortex/*.py` | Production `/cortex/api/*` mutation routes (thoughts, memory, avatar, …) |

## Forbidden contents

- New production data-mutation routes (use subsystem `*_bp.py`)
- Duplicate Matrix/Cortex REST handlers
- MySQL access outside `DataLayer` (discovery routes may call `DataLayer.health_check` only)

## Registration

View routes register on existing subsystem blueprints (`cortex_bp`, `agent_api_bp`, `matrix_api_bp`) via `register_*_api_view_routes()` so auth middleware and URL prefixes stay stable.

Platform/Admin/MANIFEST.md

5.2 KB · modified 2026-05-30 05:47 UTC · Logos/Platform/Admin/MANIFEST.md

# Admin Manifest

**Version:** 2.4.2 | **Last verified:** 2026-05-28

> Read `LOGOS_MANIFEST.md` first. Quick start: [`README.md`](README.md).

---

## What lives here (plain English)

| Path | Status | What it actually is |
|------|--------|---------------------|
| **`linters/`** | **Live** | **Administrative QC** — skill/asset/evidence/registry linters (checks only; dashboards live in `Platform/Reports/`) |
| **`Reports/`** | **Live** | Operator reports — **built at request time** from repo + runtime (`live_builders.py`); static HTML is optional export |
| **`Security/`** | **Live** | Platform pytest + audit tooling |
| **`Diagnostics/`** | **Live** | Logging (`setup_logos_logging`), health, **`platform_errors/`** package — used across LOGOS |
| **`api/`** | **Live** | JSON handlers for `/logos/admin/api/…` — `api/agents.py`, `api/jobs.py`, … (legacy `api.admin_api` import redirects via `Logos/__init__.py`) |
| **`templates/`** | **Live** | LOGOS shell pages, admin/botfarm/jobs UI (active runs + run history at `/logos/admin/jobs`), developer operator templates (incl. `lint_dashboard.html`) |
| **`/docs-self-check`** | **Live** | Operator route — `run_docs_self_check()` parity report (HTML + JSON) |
| **`static/`** | **Live** | Shared CSS/JS at `/logos/static/…` |
| **`Docs/`** | **Reference** | Markdown guides for humans/AI — not runtime packages |
| **`scripts/`** | **Live** | One-shot admin CLIs (registry backfill, MCP seed, closeout verify) |
| **`preload/`** | **Install** | New-instance frontload recipes → MySQL (`preload/README.md`; not runtime authority) |
| **`/artifacts/`** | **Live** | Operator export — all workspace + registry artifacts; multi-select kind filter; JSON/CSV |
| **`/skills/`** | **Live** | Registry skills dump — MySQL `vw_logos_assets_current` where `asset_type='skill'` |
| **Root `*.py`** | **Live** | `admin_bp.py`, `admin_api.py`, `artifacts_dump.py`, `skills_table_dump.py`, `provider_usage_reports.py`, `openai_usage_monitor.py`, `responses.py` |
| **`index.html`** | **Live** | Slim operator hub at `/logos/admin/` |

Governance markdown at **Admin root** (`LOGOS_MANIFEST.md`, architecture, developer guide) is current law, not archive.

## Linters (`linters/`)

**Checks only** — not report generators. MCP tools in `Platform/MCP/tools/linter_tools.py` delegate here; display in `Platform/Reports/lint_dashboard.py`.

| Module | Entry | Role |
|--------|-------|------|
| `skill_linter.py` | `lint_skill(skill_dict)` | Heuristic skill playbook QC (steps, telemetry, failure modes) |
| `asset_linter.py` | `lint_asset(asset_row, attrs)` | Registry row QC (key, body, owner, mcp_tool schema) |
| `evidence_linter.py` | `lint_evidence(attrs)` | Standard evidence attribute completeness |
| `platform_linter.py` | `lint_platform_boundaries()` | Platform import/data-access boundary scan |
| `__init__.py` | `lint_registry(identity, …)` | Batch sample + parity counters |

```python
from Logos.Platform.Admin.linters import lint_skill, lint_asset, lint_evidence, lint_registry, lint_platform_boundaries
```

## Admin scripts (operator CLIs)

| Script | Role |
|--------|------|
| `Reports/live_builders.py` | Live report payloads (manifests, MCP core, registry parity) |
| `Reports/live_routes.py` | Dispatch live HTML/JSON at `/logos/admin/Reports/*.html` |
| `scripts/seed_mcp_tool_assets.py` | One `mcp_tool` registry row per wire tool |
| `scripts/seed_skill_mcp_tool_links.py` | Backfill skill `invokes` → `mcp_tool` graph edges |
| `scripts/seed_registry_doctrine.py` | Doctrine + demo registry assets |
| `scripts/seed_platform_postulates.py` | Frontload P01–P42 platform postulates (new instance; insert-missing default) |
| `scripts/run_mcp_closeout_verify.py` | Smoke: session resume, doctor, catalog, linters, parity |
| `scripts/migrate_workspace_to_registry.py` | Idempotent SQLite → registry backfill |
| `scripts/cleanup_test_skill_authors.py` | Deprecate harness/integration-test skills in registry + workspace SQLite |

## Imports most code needs

```python
from Logos.Platform.Admin.Diagnostics.logging_utils import setup_logos_logging
from Logos.Platform.Admin.responses import error_response
from Logos.Platform.Admin.linters import lint_skill  # QC only — not Reports
```

Legacy `Logos.Platform.Admin.Parity` → `Diagnostics`. Legacy `Logos.Platform.Admin.CodeDisplays` → `Reports`.

## Forbidden

- Hand-editing `Reports/*.html` (use live routes; export via generators if needed)
- Duplicate runtime trees mirroring `Platform/Cortex`, `Platform/Matrix`, etc.
- New runtime code under `legacy/`
- **Lint check logic in `Platform/Reports/`** — Reports displays; Admin linters check

## Diagnostics (`Diagnostics/`)

| Module | Role |
|--------|------|
| `platform_errors/` | MySQL `logos_platform_logs` — `context`, `schema`, `fetch`, `record`, `failover`, `flask_hooks` |
| `logging_utils.py` | `setup_logos_logging` |
| `client_logging.py` | Matrix client log ingest |

## Related

| Topic | Path |
|-------|------|
| Lint dashboard (display) | `Platform/Reports/lint_dashboard.py` |
| MCP linter tools | `Platform/MCP/tools/linter_tools.py` |
| Reports (generated HTML) | `Reports/MANIFEST.md` |
| Security | `Security/MANIFEST.md` |
| Legacy inventory | `legacy/README.md` |
| MCP guide | `Docs/MCP_DEVELOPER_GUIDE.md` |

Platform/Cortex/MANIFEST.md

5.7 KB · modified 2026-05-29 01:41 UTC · Logos/Platform/Cortex/MANIFEST.md

# Cortex Manifest

**Version:** 1.1.2 | **Last verified:** 2026-05-28

> Local law for `Logos/Platform/Cortex/`. Read `Logos/Platform/PLATFORM_MANIFEST.md` first.

---

## Purpose

Cortex is the **AI runtime and consciousness engine** — identity bootstrap, action tags, entity model, MCP server, workspace SQL, validation, and programmatic agent control.

## Subsystem Role

**Thinking brain.** Matrix calls Cortex for action processing; DataLayer provides data access; MCP exposes Cortex to external AI clients.

## Audience

Platform developers with explicit mandate; AI agents via MCP (read-only docs, tool invocation).

## Owner / Steward

`project:platform_development` / LOGOS Project Manager.

## Allowed Contents

| Area | Key files / packages |
|------|----------------------|
| MCP server | `python -m Logos.Platform.MCP` (legacy import: `Logos.Platform.Cortex.cortex_mcp` → `MCP.surface` via `Logos/__init__.py`) |
| MCP support (canonical) | `Logos/Platform/MCP/` — `identity.py`, `invocation_log.py`, `resolvers.py`, `annotations.py`, `timing.py`, `errors.py` |
| Blueprints | `cortex_bp.py`, `agent_api_bp.py`, `onboarding_bp.py`, `agents_hub_bp.py` |
| API view layer | `Logos/Platform/API/` — docs, health, discovery, `/api/ai/help`, agent `/status` (mounted on Cortex/Agent blueprints) |
| Entity model (package) | `entity_model/` — `connection.py`, `entity_crud.py`, `projects.py` |
| Entities (other) | `workspace_projects.py`, `human_entities.py`, `entity_resolution.py` |
| Types vocabulary | `cortex_types_schema.py`, `cortex_types_mysql_views.py` |
| Bootstrap (package) | `bootstrap/` — `action_tags.py`, `cache.py`, `prompt.py` |
| Default skills (package) | `default_skills/` — global operational playbooks (`generate_agent_image`, `schedule_dataset_load`, `json_artifact_to_sql`, …) |
| Image generation | `DataLayer/image_providers.py`; MCP `artifact_generate_image`; Matrix `agent_exchange_images` (`talk_to_logos_agent`) |
| Action tags | `engine/action_tags/` — canonical; `engine/` other modules |
| Workspace SQL | `ai_workspace_db.py`, `workspace_db/` (`sql_writes/` package; `table_transfer/`; artifacts: `skills_*`, `file_blobs_*`, `views_*`, `assets_collect`/`assets_ops`) |
| JSON import | `json_import/` |
| Onboarding (package) | `onboarding/` |
| Services | `services/` — REST helpers used by blueprints |
| API / agents / hub | `agent_api_services.py`, `agents_hub_services.py`, `onboarding_payloads.py`, `agent_directory.py` |
| Avatar / tasks (Matrix) | canonical: `Logos.Platform.Matrix.avatar_tasks` |
| Autonomous | `autonomous/` (worker, processor, triage, reflect; `thinking_round` + `thinking_round_agent` + `thinking_round_prompts`), `engine/agent_orchestrator.py`, bot factory modules |
| Reports / utilities | `report_generator.py`, `working_memory*.py`, `thought_*.py`, `session_resume.py`, **`session_bootstrap.py`**, **`project_assets.py`**, `cleanup_manifest.py`, `web_extractor.py`, `package_indexer.py`, `sql_inventory.py`, `api_sql_importer.py`, `project_views.py` |
| **Legacy scripts** | `Logos/Legacy_Code/Cortex/` — shims + archive (migrations, benchmarks); not in Platform tree |
| Tests | `Logos/Platform/Admin/Security/tests/test_cortex_*` |

> Compat shims live in `Logos/Legacy_Code/Cortex/shims/` for historical reference only — actual import resolution
> goes through redirects declared in `Logos/__init__.py`.

## Forbidden Contents

- End-user application code (PhoneMate, Gallery games)
- Personal AI experiments or demos
- Duplicate MCP servers or parallel entity systems
- Tenant SQLite databases (belong in `Workspaces/`)

## Safe Extension Points

- New MCP tools under `Platform/MCP/tools/` (follow patterns; update MCP report)
- New action tags via registry + capability grants
- Bug fixes and tests

## Restricted Areas

- `entity_model/` schema — architect review
- `Platform/MCP/identity.py` — architect review
- `ai_workspace_db.py` scope rules — architect review

## Runtime Contracts

- Flask: `/logos/cortex/…`
- MCP: `python -m Logos.Platform.MCP` (Docker `cortex-mcp` service)
- URL: `https://winbusiness.com/logos/cortex/mcp/`

## Key capabilities (summary)

- **Identity & memory** — entities, thoughts, directives, bootstrap, deduplication
- **Action tags** — 19-tag pipeline (prefer MCP for new agent work)
- **Validation** — 8 deterministic checks + optional quality judge + bounce loop
- **Programmatic agents** — bot factory, orchestrator, REST `agent_api_bp.py`
- **Config admin** — `cortex_config` keys via `/logos/config/` (`Utilities/authority/config/`; data in `DataLayer/config.py`)

## Developer documentation (Admin)

| Document | Path |
|----------|------|
| MCP operations | `Logos/Platform/Admin/Docs/Cortex/MCP_OPERATIONS.md` |
| Entity model | `Logos/Platform/Admin/Docs/Cortex/ENTITY_MODEL.md` |
| Action tags | `Logos/Platform/Admin/Docs/Cortex/ACTION_TAGS.md` |
| Cortex engine | `Logos/Platform/Admin/Docs/Cortex/ENGINE.md` |
| Programmatic agents | `Logos/Platform/Admin/Docs/Cortex/PROGRAMMATIC_AGENTS.md` |
| MCP tool list | `Logos/Platform/Admin/Reports/LOGOS_MCP_CORE_REPORT.html` |

## Testing / Verification

`pytest winbusiness/Logos/Platform/Admin/Security/tests/test_cortex_mcp_integration.py`

## Promotion Rules

Application code promotes **out** to `Workspaces/` then `World/` — never into Cortex.

## Related Documents

| Document | Path |
|----------|------|
| Root map | `Logos/Platform/Admin/LOGOS_MANIFEST.md` |
| LOGOS Platform vs World creations | `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md` § Platform vs creations |
| PhoneMate (World/Application — not Platform) | Archive only: `World/Workspaces/Archives/Docs/processed/Prism/websites/phone_manager/PHONEMATE_MANIFEST_old.md`; runtime: `Applications/phone_manager/` + `logos_fetch` |

Platform/DataLayer/MANIFEST.md

4.2 KB · modified 2026-05-31 17:54 UTC · Logos/Platform/DataLayer/MANIFEST.md

# DataLayer Manifest

**Version:** 2.0.0 | **Last verified:** 2026-05-22

> Local law for `Logos/Platform/DataLayer/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

DataLayer is the **LOGOS-wide data-access layer** — the only approved Python path to MySQL and shared persistence wrappers.

*(Formerly named **Codex**; legacy imports `Logos.Platform.Codex` and `Logos.Codex` redirect here.)*

## Subsystem Role

**Memory consolidation router.** MySQL is the long-term store; workspace SQLite is accessed via `Cortex/ai_workspace_db.py`, not here.

## Audience

Platform developers building LOGOS core. Application agents use **MCP** for workspace data unless they hold a platform mandate.

## Owner / Steward

`project:platform_development` / LOGOS Project Manager.

## Allowed Contents

| Module | Role |
|--------|------|
| `agents/` | Agent ORM (thoughts, personality, projects; messaging → Matrix) |
| `cortex_engine/` | Runtime engine (storage, generation, evaluators, openai client) |
| `config.py`, `db.py` | Config + MySQL connections |
| `ai_providers.py` | LLM provider abstraction |
| `image_providers.py` | Grok/OpenAI image + vision describe |
| `video_providers.py` | xAI Grok Imagine video (async poll → MP4; text + image-to-video) |
| `video_keyframe.py` | Keyframe URL resolution for image-to-video |
| `llm_provider_config.py` | LLM secret registry (`cortex_config`), home-platform defaults |
| `capabilities.py` | Action-tag capability map |
| `system_entities.py` | System-entity definitions |
| `schemas/` | Small platform migrations only (~KB) |
| `utilities/` | One-off setup scripts |
| **Legacy scripts** | `Logos/Legacy_Code/DataLayer/` — back-compat shims for paths moved to Matrix |

> Conversations, agent messaging, task queue, voice registry, and the
> evaluator log live in **Matrix** (see `Matrix/MANIFEST.md`). Legacy
> imports such as `Logos.Platform.DataLayer.conversations` or
> `Logos.Platform.Codex.conversations` keep working via redirects in
> `Logos/__init__.py`.

## Forbidden Contents

- Large SQL dumps (→ `Workspaces/Archives/schema_snapshots/`)
- Duplicate data layers
- App-specific business logic
- Workspace SQLite files

## Critical rule

**No ad hoc MySQL outside DataLayer** in platform Python code.

## LLM provider configuration (`cortex_config`)

API keys and provider metadata for all backend LLM vendors live in the dynamic
**`cortex_config`** table (category **`secret`** for keys, **`engine`** for
`llm_provider_registry`). Do not hardcode keys in Python.

| Secret key | Vendor |
|------------|--------|
| `openai_api_key` | ChatGPT / OpenAI |
| `anthropic_api_key` | Claude |
| `xai_agents_api_key` | Grok (agent-facing) |
| `xai_backend_api_key` | Grok (fast internal) |
| `groq_api_key` | Groq |
| `gemini_api_key` | Gemini |

- **Module:** `llm_provider_config.py` — registry, env fallback, seed helper
- **Seed (idempotent):** `POST /logos/config/api/seed-llm-providers`
- **UI:** `/logos/config/` → filter category `secret`
- **Onboarding:** `whoami()` / `session_bootstrap()` return `home_llm` —
  default backend model inferred from connector identity (Claude →
  `claude-sonnet-4-5`, ChatGPT → `gpt-4o`, etc.). Cursor IDE model choice is
  separate; MCP agentic routes use `home_llm.default_model` unless overridden.

```python
from Logos.Platform.DataLayer import config
from Logos.Platform.DataLayer.llm_provider_config import (
    home_llm_profile_for_identity,
    seed_llm_provider_configs,
)
```

```python
from Logos.Platform.DataLayer import agents, config
from Logos.Platform.Matrix.conversations import conversations  # canonical
```

## Restricted Areas

- `db.py`, `agents.py` schema — architect review
- New MySQL tables — architect approval

## Developer documentation (Admin)

| Document | Path |
|----------|------|
| Overview | `Logos/Platform/Admin/Docs/DataLayer/OVERVIEW.md` |
| Data access guide | `Logos/Platform/Admin/Docs/DataLayer/DATA_ACCESS.md` |
| Schema report | `Logos/Platform/Admin/Reports/LOGOS_MYSQL_SCHEMA_REPORT.html` |

## Related Documents

| Document | Path |
|----------|------|
| Cortex workspace SQL | `Logos/Platform/Cortex/MANIFEST.md` |
| Data stores inventory | `Logos/Platform/Admin/Docs/DATA_STORES_INVENTORY.md` |

Platform/Entity/MANIFEST.md

1.8 KB · modified 2026-05-22 06:49 UTC · Logos/Platform/Entity/MANIFEST.md

# Entity Manifest

**Version:** 1.0.1 | **Last verified:** 2026-05-22

> Local law for `Logos/Platform/Entity/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

**Entity** is the vocabulary-enforced write facade for LOGOS. All typed values (`entity_type`, `meeting_type`, `message_type`, etc.) are validated against `cortex_types` before writes.

**Supersedes** the removed `Platform/Egos/` scaffold (which was empty). Entity identity, cognition, and Matrix-facing writes belong here — not in a separate Egos platform folder. Legacy personality **archive files** remain under `World/Workspaces/Archives/Egos/`.

## Modules

| Module | Role |
|--------|------|
| `types.py` | `Types` helper — exists, list, propose, approve, deprecate |
| `exceptions.py` | `UnknownType` |
| `entity.py` | `Entity` root with sub-namespaces |
| `messaging_writes.py` | `MessagingWrites` — typed writes **into** `Platform/Matrix` (meetings, messages, attendance). Not a copy of Matrix. |
| `cognition.py` | `EntityCognition` — thoughts |
| `relations.py` | `EntityRelations` — graph edges |

**Naming rule:** Nothing under `Platform/Entity/` is the Matrix subsystem. Matrix is `Platform/Matrix/`. Entity only validates vocabulary then delegates.

## Data

- **MySQL:** `cortex_types` (schema in `Logos/Platform/Cortex/cortex_types_schema.py`)
- **No FK enforcement** on using tables — validation is in code only

## Runtime

- Schema ensure: `ensure_cortex_types_schema()` via `platform_init.ensure_platform_schemas()`
- MCP tools (`types_list`, etc.) — follow-up PR per Casey spec

## Related

| Document | Path |
|----------|------|
| Cortex types schema | `Logos/Platform/Cortex/cortex_types_schema.py` |
| Entity model | `Logos/Platform/Admin/Docs/Cortex/ENTITY_MODEL.md` |

Platform/Jobs/MANIFEST.md

10.0 KB · modified 2026-05-31 00:56 UTC · Logos/Platform/Jobs/MANIFEST.md

# Jobs Manifest

**Version:** 0.2.0 (execution model + composite) | **Last verified:** 2026-05-28 (`store/` package)

> Local law for `Logos/Platform/Jobs/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

`Platform/Jobs/` is LOGOS **table-driven scheduled work** — MySQL `logos_jobs` +
`logos_job_runs`, a background runner, and MCP tools for AI/human registration.

Skills document **HOW**; jobs store **WHEN / WHO / run_mode / payload**.

## Subsystem role

**Scheduler + executor.** Sibling to Cortex (AI runtime), Matrix (notify via
agentic path), MCP (registration wire surface).

## Execution model (`execution_model.py`)

| Lane | Mechanism | LLM | MCP |
|------|-----------|-----|-----|
| `core` | Allowlisted Python handlers (`handlers/`) | No | No |
| `mcp_tools` | In-process `cortex_mcp` tool chain | No | Yes (direct) |
| `agentic` | Matrix → Cortex → OpenAI / Claude / Grok | Yes | Yes (via AI runtime) |
| `composite` | Ordered `steps[]` mixing the above | Per step | Per step |

### Agentic model selection

Payload keys on agentic jobs (or agentic composite steps):

| Key | Example | Role |
|-----|---------|------|
| `model` | `grok`, `claude`, `gpt-4o` | Alias or concrete model id |
| `provider` | `openai`, `anthropic`, `xai` | Provider alias → default model |
| `model_tier` | `fast`, `standard`, `thinking` | Attention-style tier map |
| `skill_name` | registry skill | HOW instructions from skills DB |
| `prompt` | free text | Additional task instructions |
| `wait_for_reply` | `true` (default) | Poll Matrix for AI reply before marking run success |
| `wait_seconds` | `180` | Poll timeout |

Providers route through `DataLayer/ai_providers.py` (OpenAI, Anthropic, xAI/Grok).

### Example payloads

**core** — direct Python:

```json
{ "handler": "world_asset_sweep", "args": { "register_missed": true, "dry_run": false } }
```

**core (drain queue)** — N-row server-side loop without inlining MCP calls.
Project-scoped queues set ``logos_jobs.project_slug`` and embed
``args.queue_context`` (``queue_scope``, ``queue_entity``, ``project_slug``):

```json
{
  "handler": "drain_work_queue",
  "args": {
    "queue_asset_id": 17,
    "batch_size": 200,
    "queue_context": {
      "queue_scope": "my_project",
      "queue_entity": "project:my_project",
      "project_slug": "my_project"
    }
  }
}
```

**mcp_tools** — deterministic MCP:

```json
{ "steps": [{ "tool": "job_list", "params": { "limit": 5 } }] }
```

**agentic** — AI + MCP:

```json
{
  "model": "claude",
  "prompt": "Review overdue jobs and summarize.",
  "wait_for_reply": true,
  "wait_seconds": 180
}
```

**composite** — pipeline:

```json
{
  "steps": [
    { "kind": "core", "handler": "ensure_jobs_schema", "args": {} },
    { "kind": "mcp_tools", "steps": [{ "tool": "job_list", "params": { "limit": 3 } }] },
    { "kind": "agentic", "model": "grok", "prompt": "Note anomalies.", "wait_for_reply": true }
  ]
}
```

## MySQL tables (core LOGOS)

| Table | Role |
|-------|------|
| `logos_jobs` | Job definitions, schedule, approval, lease |
| `logos_job_runs` | Append-only execution audit |

Schema ensure: `Jobs/schema.py` via `platform_init.ensure_platform_schemas()`.

## MCP tools (thin wrappers in `MCP/tools/job_tools.py`)

`job_schedule`, `job_update`, `job_list`, `job_get`, `job_pause`, `job_resume`,
`job_approve`, `job_run_now`, `job_run_history`, `launch_jobs`

### Work-queue MCP tools (`MCP/tools/work_queue_tools.py`)

For N-row server-side workloads — closes ChatGPT/Vouch dev issues 6376/6377/6378.

| Tool | Role |
|------|------|
| `queue_register` | Register a `work_queue` registry asset (one call vs `register_asset` + N attribute writes). Returns `asset_id` + the exact next `queue_drain` invocation. |
| `queue_drain` | Schedule a `drain_work_queue` core job for the queue. Payload is fixed-size (`{queue_asset_id, batch_size, max_failures}`) — sidesteps the inline-payload size wall. Optional `auto_launch=True` invokes `launch_jobs(limit=1)` so the drain runs this turn. |
| `queue_status` | Read recent `queue.row_drained` events for a queue with succeeded/failed counts. |
| `dataset_row_load` | Generic per-row drain action (`MCP/tools/dataset_tools.py`). One row → a registered **loader**. Allowed in `DRAIN_ACTION_ALLOWLIST`. |

## Dataset loaders (`dataset_loaders.py`)

**Concept.** Loading any dataset on a schedule is ONE mechanism: a project
**backlog** table/view + a `work_queue` + the `drain_work_queue` job + a
**loader**. A loader turns one queue row into a side effect. New datasets need
**config, not a new subsystem**. Loaders come in five flavors:

| Flavor | `loader_kind` | How it runs | Bootstrap config (`drain_defaults.bootstrap_json`) |
|--------|---------------|-------------|----------------------------------------------------|
| Existing ingest | n/a | `artifact_import_url`, `json_artifact_to_sql`, `api_paginated_to_sql` | — (use these for blobs/URLs) |
| Script hook | `<kind>`, … | Registered Python via World project `jobs/register_loaders.py` (discovered at startup) | — code is the hook |
| API pass-thru | `api` | External `url_template` **or** internal `logos_path` (via `logos_fetch`), extract `result_path`, optional `destination_table` | `{url_template\|logos_path, method, headers_json, result_path, destination_table}` |
| Agentic | `agentic` | `chat_completion(model, prompt)` with row substitution | `{model, prompt_template, system, max_tokens}` |
| Parallel JSON arrays | `json_parallel_arrays` | One staging row (parallel JSON arrays) → many SQL rows | `{destination_table, meta_column, timestamp_column, indicators_column, symbol_path, quote_path, fields, timezone_offset_hours, replace_symbol}` |

**Agent discovery:** `ingest_tool_routing()` → `dataset_loader_kinds` (bootstrap schemas).
Golden path: `Platform/Admin/Docs/golden_paths/queue_ingest.md`.

`{col}` placeholders in templates/prompts are substituted from the row;
unknown placeholders are left intact. Config lives **with the queue**
(`drain_defaults`), not in code. Register a queue + job via `queue_register` +
`job_schedule` (or a World project seed script); agents use skill
`schedule_dataset_load`.

## Human web UI

| URL | Role |
|-----|------|
| `/logos/admin/jobs` | View / schedule jobs; **active runs** + **run history** panels (login required) |
| `GET /logos/admin/api/jobs/active` | Running jobs + open runs (`?all=1` operators) |
| `GET /logos/admin/api/jobs/runs/recent` | Cross-job run history (`?all=1` operators) |
| `/logos/admin/jobs?focus=launch` | Due-job preview + launch controls (nav menu) |
| `/logos/admin/jobs/launch` | Redirect to `?focus=launch`; add `?run=1` for one-click background tick |
| `GET /logos/admin/api/jobs/due` | Read-only list of jobs due now (`?all=1` for operators) |
| `POST /logos/admin/api/jobs/launch` | Run scheduler tick (`async: true` default; admin JSON API) |
| `GET /logos/admin/api/jobs/launch/status` | Poll last background tick result |
| `/logos/admin/api/jobs` | JSON API (session auth via `require_api_auth`) |

## Runner

```bash
PYTHONPATH=winbusiness:. python -m Logos.Platform.Jobs --once
PYTHONPATH=winbusiness:. python -m Logos.Platform.Jobs --loop --interval 60
```

Docker: `logos-jobs` service in `docker-compose.yml`.

Env: `LOGOS_JOBS_TICK_SECONDS`, `LOGOS_JOBS_AUTO_APPROVE` (dev only).

## Built-in seeded jobs (`seed_platform_jobs.py`)

| Job key | run_mode | Role |
|---------|----------|------|
| `world_asset_sweep_daily` | core | World file_assets reconciliation |
| `jobs_runner_health` | core | Schema ensure / runner connectivity |
| `jobs_mcp_ping` | mcp_tools | `job_list` MCP smoke |
| `jobs_agentic_smoke` | agentic | Optional AI smoke (`LOGOS_JOBS_SEED_AGENTIC=1`) |

World project jobs are **not** seeded from
`ensure_platform_jobs()` — see each project's `World/Workspaces/Projects/<slug>/jobs/`.

## Core handlers (`handlers/`)

| Handler | Role |
|---------|------|
| `noop` | Placeholder / connectivity test |
| `ensure_jobs_schema` | Ensure MySQL jobs tables exist |
| `world_asset_sweep` | Scan World `file_assets` vs workspace registry |
| `drain_work_queue` | Iterate a `work_queue` registry asset (see `Platform/Registry/work_queue.py`); per-row tool dispatch from `DRAIN_ACTION_ALLOWLIST`; emits `queue.row_drained` events. Use for many-URL / many-row workloads instead of inlining 100+ MCP calls or stuffing them into `payload.steps[]`. |

Legacy project-specific handlers may register from World `jobs/register_loaders.py`
(prefer generic `drain_work_queue` + built-in `loader_kind` values).

## Maintenance (operators)

**Skill (agents):** `schedule_dataset_load` (global bootstrap — re-seed via
`python -c "from Logos.Platform.Cortex.default_skills import seed_default_skills; ..."`).

**Golden path:** `Platform/Admin/Docs/golden_paths/queue_ingest.md`.

**Stuck rows (automatic):** Each scheduler tick calls `recover_stale_running_jobs()`
(MySQL job lease) and `recover_stale_job_runs()` (orphan `logos_job_runs`).
Project-specific stale-row reset belongs in the World loader hook (not Platform).

**Stuck job lease:** `recover_stale_running_jobs()` (runner tick) or set
`logos_jobs.status='active'`, `lease_expires_at=NULL` for the job key.

**Registry / wire:** `dataset_row_load` in `DRAIN_ACTION_ALLOWLIST`; MCP tool
asset seeded from `mcp_wire_contract.json`.

## Safety

- AI-created jobs default to `pending_approval` until `job_approve` (human).
- `max_runs_per_day`, `min_interval_seconds`, lease recovery for stale `running`.
- No arbitrary code in payloads — `core` uses handler allowlist only.

## Allowed contents

- `schema.py`, `store/` (`_db`, `_crud`, `_claim`, `_lists`), `executor.py`, `runner.py`, `delegation.py`, `execution_model.py`, `handlers/`
- `web_identity.py`, `seed_platform_jobs.py`
- `dataset_loaders.py` (loader registry: `api` | `agentic` + World project hooks via discovery)

## Forbidden

- Duplicate MCP server instance
- Application-specific cron (belongs in Applications until promoted patterns)

## Related

| Document | Path |
|----------|------|
| Platform map | `Platform/PLATFORM_MANIFEST.md` |
| MCP manifest | `Platform/MCP/MANIFEST.md` |
| AI providers | `Platform/DataLayer/ai_providers.py` |

Platform/MANIFEST.md

0.3 KB · modified 2026-05-22 06:39 UTC · Logos/Platform/MANIFEST.md

# Platform Manifest (pointer)

**Canonical file:** [`PLATFORM_MANIFEST.md`](PLATFORM_MANIFEST.md)

This file exists so tools and links that expect `MANIFEST.md` in each primary folder still resolve. All Platform governance content lives in **`PLATFORM_MANIFEST.md`** — read that file first.

Platform/MCP/MANIFEST.md

21.4 KB · modified 2026-05-31 05:38 UTC · Logos/Platform/MCP/MANIFEST.md

# MCP Manifest

**Version:** 0.8.0 (connector docs May 2026) | **Last verified:** 2026-05-30

> Local law for `Logos/Platform/MCP/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

`Logos/Platform/MCP/` is the **Model Context Protocol gateway** — the wire-level
entry point through which external AI clients reach the LOGOS platform.  It is
a thin, cross-subsystem dispatcher: tool implementations route into Cortex,
DataLayer, Matrix, Registry, Jobs, **Admin/linters**, and Utilities/authority, but registration,
identity, transport, timing, and error handling live here. **Applications**
(`Logos/Applications/`) **do not** register MCP tools — they expose REST routes
that agents reach via `logos_fetch('/logos/world/<app>/…')`.

**Wire tool count (snapshot):** see
`Admin/Security/tests/snapshots/mcp_wire_contract.json` (Wave 20: ~40 advertised
after domain consolidation; 179 registered including 5 new shortcuts).

## Subsystem Role

**AI-facing front door.** Sibling to (not contained in) Cortex/Matrix/Codex.
A separate Starlette/uvicorn process reachable at
`https://winbusiness.com/logos/cortex/mcp/` (URL stable; package path migrating
from `Logos.Platform.Cortex.cortex_mcp`).

**Wave 9 (2026-05-30):** Connector documentation parity — see `LOGOS.LOGOS_Updates.md` 2026-05-30 rows.

**Platform freeze (2026-05-31):** No new Platform features — bugfix/label/doc only.
World/Applications build on finalized primitives in `Registry/MANIFEST.md`.

## Status

**Wave 1 complete (2026-05-21):** Support modules migrated:
- `identity.py` (was `Cortex/mcp_identity.py`) — 673 LOC
- `invocation_log.py` (was `Cortex/mcp_invocation_log.py`) — 481 LOC
- `resolvers.py` (was `Cortex/mcp_resolvers.py`) — 330 LOC

**Wave 2 complete (2026-05-21):** Production MCP server migrated from monolith:
- `server.py` — `_ObservedFastMCP`, `mcp` singleton, tool logging (~400 LOC)
- `mcp_instructions.py` — MCP system instructions string (wire-stable text; was inline in `server.py`)
- `runtime.py` — ASGI `_build_app()`
- `tools/` — 12 domain modules; `asset_tools/` sub-package (7 modules); `web_tools.py` (`logos_fetch`)
- `__main__.py` — `python -m Logos.Platform.MCP` entrypoint
- Legacy import `Logos.Platform.Cortex.cortex_mcp` → `MCP/surface.py` via `Logos/__init__.py` (no `cortex_mcp.py` file; Docker: `python -m Logos.Platform.MCP`)

Compat shims remain at old Cortex paths. Wire-contract test passes after every wave.

**Wave 3 (2026-05-26):** MCP job tools (`job_tools.py`) — delegates to `Platform/Jobs/`; includes `launch_jobs` scheduler tick (2026-05-27).

**Wave 4 (2026-05-26):** Registry MCP tools (`registry_tools/` package: `_helpers`, `_read`, `_events`, `_write`) — graph read/write
for Phase 1 (`registry_find_assets`, `registry_asset_graph`, `registry_set_attribute`,
`registry_link_assets`, `registry_register_asset`). Additional registry helpers
(`registry_skill_composition`, `registry_log_event`, `registry_get_events`) exist
in code but are **not** on the public connector wire surface documented by
`logos_docs_get()`.

**Wave 5 (2026-05-27):** Wire-contract stability fixes — snapshot locks Platform tool count only.
Application-owned tools must not register on the Platform MCP gateway (use HTTP/`logos_fetch`).
Instructions text is **not** snapshot-locked (schemas + tool set only). Bootstrap:
`Platform/Registry/mcp_bootstrap/` + `registry_docs` resource drill-down.

**Wave 6 (2026-05-27):** Documentation parity — `cortex://documentation` now routes
through `documentation_payload_for_caller` (honors `LOGOS_MCP_LEGACY_DOCUMENTATION`
the same as `logos_docs_get`). Registry payload top-level adds **`documentation_layers`**:
explicit `layer_0` (identity) → `layer_6` (workspace SQL) drill-down map with concrete
tool calls. `registry_context` slimmed (no duplicate `see_top_level` / `sample`).

**Wave 7 (2026-05-27):** MCP tool reference registry — `asset_type='mcp_tool'`, one
`logos_assets` row per wire tool when seeded (`ensure_registry_schema` or
`Platform/Admin/scripts/seed_mcp_tool_assets.py`). Browse via
`registry_find_assets(asset_type='mcp_tool')` and `core_tools.wire_tool_names` in
welcome — not via separate catalog MCP tools on the public connector.

**Wave 8 (2026-05-27):** Doctrine/data parity (Tickets A+B) — shared composer
(`build_doctrine_block`, `count_visible_skills`, `build_featured_skills`) in
`mcp_bootstrap/`; JIT `ai_session_resume(full_context=False)` < 5 KB;
onboarding read_first = `featured_skills`; three browse-tool roles
(`skill_list` / `skill_get` / `skill_find_by_trigger`); pattern_* taxonomy fix;
`docs_parity.py` (`run_docs_self_check`, `canonical_probes`, parity counters);
`skill_list(include_bodies=False)` metadata default; ATTACH docs clarified.

**Wave 9 (2026-05-27):** Work-queue primitive — `asset_type='work_queue'` in
`Platform/Registry/work_queue/`, allowlisted core handler
`Platform/Jobs/handlers/drain_work_queue.py`, and MCP tools
(`queue_register`, `queue_run`, `queue_drain`, `queue_status`, `queue_watch`)
in `work_queue_tools.py`. Diagnostics: `logos_doctor`, `logos_system`, `logos_repair`,
`logos_golden_paths`, `logos_queue_drain_probe`, `logos_chaos_probe` in `diagnostics_tools.py`. Closes connector dev issues 6376/6377/6378 (batch URL import / payload
file-handoff / SQL-loop) without a new DSL or router: payload is fixed-size
`{queue_asset_id, batch_size}`; rows live in SQLite; per-row progress in
`logos_events`. Layer/scope honor the Platform/World/Application model.

**Wave 10 (2026-05-28):** Alpha session spine — `session_bootstrap()` MCP tool
(composes whoami, projects, doctor, inbox, failures, golden paths);
`skill_get(concise=True)` field-manual projection; automatic
`tool_invocation` + `skill_accessed` events on `logos_events`
(`Registry/tool_telemetry.py`, env `LOGOS_REGISTRY_TOOL_TELEMETRY`).

**Wave 11 (2026-05-28):** Wrap-up + governance linters —
`skill_get` concise contract; evidence metadata projection
(`Registry/evidence_metadata.py`); MCP outcomes `application_error` when
payload `ok:false`; mcp_tool seed parity (157 exposed = 157 seeded);
`linter_tools.py` (`skill_lint`, `asset_lint`, `registry_lint`) delegates to
`Platform/Admin/linters/` (checks) — dashboards in `Platform/Reports/lint_dashboard.py`.

**Wave 12 (2026-05-28):** **`project_assets`** — single MCP entry point for
project-scoped inventory; anchored on ``entity_type='project'`` /
``project:<slug>`` entity graph; composer in `Cortex/project_assets.py`;
registry correlation via scope + ``project_slug`` / ``project_entity`` attributes.

**Wave 13 (2026-05-28):** Large tool modules split into packages (wire surface unchanged):
`skill_tools/` (`_helpers`, `_read`, `_write`), `view_tools/` (`_views`, `_pages_menu`),
`work_queue_tools/` (`_register`, `_run`). `registry_tools/` and `messaging_tools/` packages
already followed this pattern.

**Wave 14 (2026-05-28):** Generic dataset load — `dataset_row_load`
(`tools/dataset_tools.py`) is a single `work_queue` drain action backed by the
loader registry in `Platform/Jobs/dataset_loaders.py`. Five flavors, config not
code: existing ingest tools (blobs/URLs), World script hooks (optional),
`api` pass-thru (`url_template` / `logos_path`), `agentic` (`model` + `prompt_template`),
`json_parallel_arrays` (parallel JSON arrays in one staging row → many SQL rows).
Bootstrap config rides `drain_defaults.bootstrap_json`. Agent HOW: skill
`schedule_dataset_load`; discover schemas via `ingest_tool_routing()` →
`dataset_loader_kinds`. Wire surface 158 → **159 tools** (snapshot regenerated).

**Wave 15 (2026-05-29):** Asset-handoff closure (no new wire tools). New
`tools/asset_tools/asset_handoff.py` builds a universal additive `asset_handoff`
envelope (`asset` {kind/name/scope/url_path/absolute_url/embed_path/preview·download·text flags},
`recommended_followups`, `lineage`, optional `dependencies`) returned by every
asset-producing tool: `artifact_generate_image`, `artifact_create_image`,
`artifact_upload`, `artifact_import_url`, `artifact_create`, `page_create`,
`report_publish`, `web_extract_to_artifact`, and the `talk_to_logos_agent`
`generate_image:` path (with conversation lineage). `mcp_tool_get` now returns
`follow_up_tools` (workflow grammar) and a bounded/timed `include_graph`
(`graph_load_ms`, `graph_truncated`). `session_bootstrap` uses a lightweight
read-only health check (no CREATE/INSERT write probe) and reports
`timings_ms`/`degraded`. Envelope content rides inside each tool's existing
`{result: string}` output — wire schema unchanged (snapshot still 159).
file_blob dependency edges in published HTML are returned (page→file_blob
`depends_on`); registry persistence of lineage/edges is a later phase.

**Wave 16 (2026-05-29):** Command wrapper MCP tools — additive simplified
entry points that delegate to existing wire tools (nothing removed).
`Platform/MCP/command_router/` (catalog + dispatch); MCP tools
`asset`, `sql`, `message`, `system` in `tools/command_tools.py`;
Flask HTTP mirror at
`POST /logos/reports/workspace/mcp/command/{asset|sql|message|system}/`
(Bearer auth). Wire surface **162 → 166 tools** (snapshot regenerated).

**Wave 17 (2026-05-29):** Universal ``asset(type, command, request)`` —
``sql``, ``message``, ``system``, ``skill``, and ``project`` types mount
into the same dispatch table; ``sql``/``message``/``system`` MCP tools are
shortcuts that delegate through ``asset``. ``system`` gains ``health`` alias
for ``logos_doctor``. No new wire tools; schemas unchanged.

**Wave 18 (2026-05-30):** LOGOS domain types in universal ``asset()`` —
``directive``, ``postulate``, ``memetic`` (meme/memplex/slogan),
``notepad``; ``Logos.*`` type aliases; ``overview`` help command;
convenience aliases ``skill``, ``project``, ``notepad``. Wire **166 → 169**.

**Wave 20 (2026-05-30):** Extended command domains — ``admin``, ``registry``,
``entity``, ``job``, ``queue``, ``ingest``, ``channel``, ``web``, ``pairing``,
``artifact`` lifecycle + SQL/message/project/report extensions in
``command_router/domain_routes.py``. New MCP shortcuts: ``admin``, ``registry``,
``job``, ``queue``, ``ingest``. Domain dupes hidden via ``tool_list_policy`` (same
rollback env as Wave 19). Wire **116 → 31** advertised (snapshot regenerated).

## Command surface doctrine (official)

Connected AIs should use this hierarchy — documented in
`Registry/mcp_bootstrap/_doctrine.py` → `command_wrapper_doctrine()` and
surfaced in `logos_docs_get()` / `ai_session_resume()` as
`command_surface_doctrine`.

| Tier | Surface | When |
|------|---------|------|
| **Default** | `asset(type, command, request)` | Canonical — one grammar for all domains |
| **Convenience** | `sql`, `message`, `system`, `skill`, `project`, `notepad`, `admin`, `registry`, `job`, `queue`, `ingest` | Same dispatch table; fewer fields |
| **Fallback** | Raw MCP tools | Route not in wrapper catalog yet; hidden from `tools/list` when covered |

**Discover routes:** `asset(type='help', command='overview')` or `command='catalog'`

**Types mounted:** `help`, `sql`, `message`, `system`, `skill`, `directive`, `postulate`,
`memetic`, `pattern`, `project`, `notepad`, `admin`, `registry`, `entity`, `job`,
`queue`, `ingest`, `channel`, `web`, `pairing`, `file_blob`, `page`, `report`,
`view`, `table`, `menu_link`, `artifact`. Accepts `Logos.Skills`, `Logos.Admin`, etc.

Implementation: `Platform/MCP/command_router/` — aliases delegate through
`asset`; granular wire tools unchanged.

## Documentation layers (AI drill-down)

| Layer | Tools / Resources | Returns |
|------:|-------------------|---------|
| 0 — Identity | `whoami`, **`session_bootstrap`** | ai_entity, paired status, visible scopes, **`home_llm`** (default backend model for host); bootstrap adds projects, health, inbox |
| 1 — Orientation | `ai_session_resume` (JIT), `logos_docs_get` (full), `cortex://documentation` | JIT resume: identity + featured_skills. Full docs: postulates, cognitive_skillsets, drill-down map |
| 2 — Browse | `skill_list`, `entity(action='find_assets')` / `registry_find_assets`, `mcp_tool_catalog` | metadata per row (`asset_body_chars`, no inline bodies); `asset_type` filters: skill, mcp_tool, postulate, pattern, table, view, doctrine |
| 3 — Full body | `skill_get` (`concise=True` for field manual; `include_graph=True` for neighborhood), `page_get`, `view_get` | full instructions / HTML / SQL OR concise execution slice; optional graph + evidence |
| 4 — Graph | `registry_asset_graph`, `mcp_tool_get` | one asset + links_out/in, attributes, `asset_body`, evidence block when present |
| 5 — Telemetry | automatic on every MCP call + `skill_get` | `tool_invocation`, `skill_accessed` on `logos_events`; optional graph read-back |
| 6 — QC | **`skill_lint`**, **`asset_lint`**, **`registry_lint`** | Admin linter scores — not report generators |
| 7 — Workspace | `cortex://workspace/catalog`, `sql_list_tables`, `sql_*` | live SQL tables + scopes + counts |

`logos_docs_get()` always returns this layer map at the top under
`documentation_layers` so any AI can mechanically drill from orientation to a
specific asset body in three or four calls.

## Wire-contract guarantee (the "no backslide" rule)

Before **any** MCP code is moved into this folder, run the snapshot test:

```bash
PYTHONPATH=winbusiness:. pytest \
  winbusiness/Logos/Platform/Admin/Security/tests/test_mcp_wire_contract_stability.py -v
```

The snapshot file
`Logos/Platform/Admin/Security/tests/snapshots/mcp_wire_contract.json` locks:

- The exact set of advertised tool names from `mcp.list_tools()`
- Every tool's `inputSchema` and `outputSchema` (sorted-key JSON compare)
- Every tool's annotation flags (`readOnlyHint`, `idempotentHint`, etc.)
- Every resource URI, name, and `mimeType`
- Server `name`, tool count, and per-tool schemas (instructions text evolves freely)

After every move, the test must still pass.  If a planned change does alter
the contract, regenerate the snapshot deliberately:

```bash
UPDATE_MCP_SNAPSHOT=1 pytest \
  winbusiness/Logos/Platform/Admin/Security/tests/test_mcp_wire_contract_stability.py
```

…and commit the regenerated JSON in the **same commit** as the surface change
with a message that names every tool added/removed/changed.

## Planned layout (target shape, not yet populated)

```
Logos/Platform/MCP/
├── __init__.py
├── MANIFEST.md                  ← this file
├── __main__.py                  ← `python -m Logos.Platform.MCP` entrypoint (future)
├── server.py                    ← FastMCP instance, _ObservedFastMCP, port resolver, ASGI app (future)
├── middleware.py                ← LogosIdentityMiddleware (future)
├── identity.py                  ← ✓ MIGRATED (was Cortex/mcp_identity.py)
├── invocation_log.py            ← ✓ MIGRATED (was Cortex/mcp_invocation_log.py)
├── resolvers.py                 ← ✓ MIGRATED (was Cortex/mcp_resolvers.py)
├── errors.py                    ← ✓ EXTRACTED from cortex_mcp.py
├── timing.py                    ← ✓ EXTRACTED from cortex_mcp.py
├── annotations.py               ← ✓ EXTRACTED from cortex_mcp.py
├── instructions/                ← long-form instructions string broken into MD files
│   └── server_instructions.py   ← composes the final instructions= argument
└── tools/
    ├── __init__.py              ← imports each module so decorators run
    ├── identity_tools.py        ← whoami, pair_*
    ├── entity_tools.py          ← entity_*, skill_*
    ├── thought_tools.py         ← thought_*, working_memory_*
    ├── workspace_tools.py       ← workspace_*, project_*
    ├── sql_tools.py             ← sql_* (18)
    ├── artifact_tools.py        ← artifact_* (16)
    ├── messaging_tools/         ← messages_read, messages_write, messages_inbox, …
    ├── skill_tools/             ← skill_list/get/write (`_helpers`, `_read`, `_write`)
    ├── view_tools/              ← view_*, page_*, menu_* (`_views`, `_pages_menu`)
    ├── work_queue_tools/        ← queue_* (`_register`, `_run`)
    ├── registry_tools/          ← registry_* (`_helpers`, `_read`, `_events`, `_write`)
    ├── web_tools.py             ← web_*
    ├── task_tools.py            ← task_*
    └── docs_tools.py            ← logos_docs_get, info, mcp_*
```

## Migration rules

1. **Snapshot first, move second.** Every wave: run the wire-contract test,
   move code, re-run the test, commit only when green.
2. **Backward-compat shims at every old path.**  When a file is moved, leave a
   ≤5-line shim at the old path that does `from Logos.Platform.MCP.<X> import *`
   so anything still using the old import (systemd unit, nginx, scripts) keeps
   working until that caller is updated in a separate, scheduled change.
3. **One `mcp` instance only.**  Do **not** instantiate a second
   `FastMCP(...)` anywhere.  Tool modules `from Logos.Platform.MCP.server import mcp`
   and use that singleton.  Adding a parallel server is a hard architectural
   no.
4. **Wire URL stays the same.**  `https://winbusiness.com/logos/cortex/mcp/` is
   the AI client contract.  Renaming the URL is a separate, flagged change
   that requires updating every external AI client; we are not doing it as
   part of the package move.
5. **No new tools added in the same commit as a move.**  Moves are
   structure-only; a wave that both relocates code and adds a feature is
   forbidden because the snapshot test cannot tell legitimate additions from
   accidental drift.
6. **Recreate the container after every docker-compose `command:` change.**
   `docker-compose.yml` updates do **not** take effect on a running container
   until it is re-created.  When the start command, env vars, or mount points
   change, run:
   ```bash
   docker stop winbusiness_cortex-mcp_1 \
     && docker rm winbusiness_cortex-mcp_1 \
     && docker-compose up -d cortex-mcp \
     && docker logs --tail 50 winbusiness_cortex-mcp_1
   ```
   (We use stop+rm+up because `docker-compose up --force-recreate` hits a
   `KeyError: 'ContainerConfig'` on this host's docker-compose version.)
   After recreate, verify a clean boot ends with
   `Uvicorn running on http://0.0.0.0:8001` and a `curl -k` to the public URL
   returns `HTTP 401 {"error":"unauthorized","error_description":"Bearer token required"}`
   — that is the **healthy** unauthenticated response.

## Migration trap log (do not repeat)

| When | What broke | Why | Fix |
|------|------------|-----|-----|
| 2026-05-19 → 2026-05-20 (~30h outage) | Production MCP returned 5xx / refused connections; clients saw `"Authorization with the MCP server failed"`. | A prior session moved `Cortex/cortex_mcp.py` → `Platform/Cortex/cortex_mcp.py` and updated `docker-compose.yml` to match, but the running `winbusiness_cortex-mcp_1` container kept its baked-in `Cmd` from before the move (`python3 winbusiness/Logos/Cortex/cortex_mcp.py`).  watchmedo restart-looped on `[Errno 2] No such file or directory`, accumulating ~50 zombie processes and serving nothing. | `docker stop`, `docker rm`, `docker-compose up -d cortex-mcp`. Verified clean boot + `HTTP 401 Bearer token required` at the public URL + wire-contract snapshot test green. |

## Allowed Contents

- The MCP server, transport, identity, timing, error handling, and tool
  modules described above.
- Tests of MCP-internal helpers (the wire-contract test stays in
  `Sentinel/tests/`).

## Forbidden Contents

- Business logic that doesn't belong on the AI surface — keep that in the
  source subsystem and call into it from the relevant tool module.
- A second FastMCP instance.
- Personal AI experiments.
- Hand-edited copies of any `cortex_mcp.py` content without going through the
  snapshot-and-shim migration protocol above.

## Runtime contracts (current — do not change without coordinated work)

| Contract | Today | After migration |
|---|---|---|
| Public URL | `/logos/cortex/mcp/` | unchanged |
| Module path | `python -m Logos.Platform.MCP` | `Logos.Platform.MCP.surface` (in-process tools) |
| FastMCP class | `Logos.Platform.Cortex.cortex_mcp._ObservedFastMCP` | `Logos.Platform.MCP.server._ObservedFastMCP` (re-exported at old path) |
| Identity middleware | `Logos.Platform.Cortex.mcp_identity.LogosIdentityMiddleware` | `Logos.Platform.MCP.middleware.LogosIdentityMiddleware` (re-exported) |
| Invocation log | `Logos.Platform.Cortex.mcp_invocation_log` | `Logos.Platform.MCP.invocation_log` (re-exported) |
| Timing DB path | `Logos/World/Workspaces/platform/mcp_timing.sqlite` | unchanged |
| Workspace catalog cache TTL | env `LOGOS_WORKSPACE_CATALOG_CACHE_TTL_SEC` (default 45) | per-process `list_visible_tables` cache |
| Session resume cache TTL | env `LOGOS_SESSION_RESUME_CACHE_TTL_SEC` (default 30) | `session_resume.build_session_resume` |
| MCP CI gate script | `Logos/Platform/Admin/Security/tests/run_mcp_ci_checks.sh` | wire contract + `test_mcp_catalog_performance.py` |

## Related Documents

| Document | Path |
|----------|------|
| Wire-contract test | `Logos/Platform/Admin/Security/tests/test_mcp_wire_contract_stability.py` |
| Snapshot baseline | `Logos/Platform/Admin/Security/tests/snapshots/mcp_wire_contract.json` |
| MCP developer guide | `Logos/Platform/Admin/Docs/MCP_DEVELOPER_GUIDE.md` |
| MCP quick reference | `Logos/Platform/Admin/Docs/MCP_QUICK_REFERENCE.md` |
| MCP core report (generated) | `Logos/Platform/Admin/Reports/LOGOS_MCP_CORE_REPORT.html` |
| MCP report generator | `Logos/Platform/Admin/Reports/generate_mcp_core_report.py` (path constant updates when migration completes) |
| Cortex (current home) | `Logos/Platform/Cortex/MANIFEST.md` |
| Root map | `Logos/Platform/Admin/LOGOS_MANIFEST.md` |

Platform/Matrix/MANIFEST.md

8.3 KB · modified 2026-05-30 08:27 UTC · Logos/Platform/Matrix/MANIFEST.md

# Matrix Manifest

**Version:** 1.5.2 | **Last verified:** 2026-05-29

> Local law for `Logos/Platform/Matrix/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

Matrix is the **multi-agent communication hub** AND **the unified workflow heartbeat** — conversations, message routing, operator commands, AI response generation, chat UIs, voice (STT/TTS), outbound SMS, **and every trackable task / ticket / event / reply in LOGOS** as rows in `matrix_communications`.

## Subsystem Role

**Voice AND heartbeat of LOGOS.** Routes messages; delegates cognition to Cortex/Codex; persists history AND workflow state in MySQL.

## Doctrine — locked-in alpha model

**`matrix_communications` is the single task / workflow record.** Bug lists, shopping lists, action lists, software specs, chained next-wave tasks — every item is one row. There is no parallel "tasks" table at the platform layer.

Canonical doctrine: registry pattern asset **`pattern_matrix_message_heartbeat`** (global, asset_layer=`platform`). Walk it via `registry_asset_graph(asset_key='pattern_matrix_message_heartbeat', asset_type='pattern')`. Registered by `Logos/Platform/Matrix/doctrine_message_heartbeat.py`.

| Column | Role |
|--------|------|
| `message_type` | `message` / `request` / `response` / `event` — only four, ever |
| `message_subtype` | Open business label (`bug`, `shopping`, `task_status_change`, `spec_line`, …) |
| `lifecycle_status` | `pending` → `open` / `closed` / `waiting` / `blocked` / `cancelled` / `future` |
| `response_code` | On `response` rows, projects parent's new status |

**Public aliases:** `task` and `ticket` both resolve to **`request`**; `reply` → `response`; `log` → `message`. **A task is a message** — there is no separate platform task table. Use the word that matches the work; the stored row is always one of the four canonical types.

**Parent / scope parity with registry assets** (see `LOGOS_UNIFIED_PARTICIPATION_MODEL.md` §7):

| Message field | Asset analogue |
|---------------|----------------|
| `lifecycle_parent_id` | `parent_asset_id` |
| `lifecycle_root_id` | project / tree root |
| `conversation_id` | `scope` + project grouping |
| `entity_name` | `added_by_entity` |

Lifecycle uses **`lifecycle_parent_id` (INT)**. Legacy **`parent_message_id` (VARCHAR)** is not the lifecycle parent key.

**Close → replicate:** append a `response` row with `response_code`; processor updates parent `lifecycle_status` and may spawn **new** child rows via `matrix_message_type_actions` (append-only, rule-matched). World projects may additionally replicate **domain** SQLite rows (e.g. taskmanager `tasks`) after an `event` / `task_status_change` message — see `pattern_task_replication`.

**Skills MUST close their tickets.** If an MTA rule spawns a ticket to run a skill, the skill posts a `reply` with a `response_code` before returning. Otherwise the heartbeat leaks open.

## Audience

Platform developers; infrastructure AIs for messaging features only with mandate.

## Owner / Steward

`project:platform_development` / LOGOS Project Manager.

## Allowed Contents

| Module / package | Role |
|------------------|------|
| `matrix_bp.py` | Page routes (desktop/cel/lite) |
| `matrix_api_bp.py` | REST API |
| `sms_routes.py` | REST at `/logos/matrix/sms/*` |
| `routing/` | Routing tiers + operator commands (canonical; legacy alias `matrix_routing`) |
| `ai/` | Prompt build, generation, TTS helpers (canonical; legacy alias `matrix_ai`) |
| `conversation/` | Conversation services + `get_conversation_history` (canonical; legacy alias `matrix_conversation`) |
| `conversations/` | Conversation ORM (`Conversation`, `conversations` singleton) |
| `services/` | API services (entity profiles, message stream, voice api) |
| `lifecycle/` | Message lifecycle utilities (canonical package) |
| `agent_messages.py` | Agent `send_message` / inbox (MessagesMixin for Codex `Agent`) |
| `task_queue.py` | Lifecycle-backed work tickets (`message_type='request'`) |
| `voice_registry.py` | TTS/STT voice resolution (`voice_registry.json`) |
| `developer_thread.py` | Platform developer Matrix thread |
| `agent_exchange.py` | MCP ↔ platform agent 1:1 meetings (open / batch reply / poll) |
| `agent_exchange_images.py` | `generate_image:` messages on agent exchange → xAI/OpenAI → `Agents/<entity>/file_assets/generated/` |
| `autonomous_inbox.py` | Retired agent inbox stubs + `get_conversation_context` |
| `evaluator_log.py` | Increment `evaluator_count` on message meta |
| `avatar_tasks.py` | Avatar task queue on `matrix_communications` |
| `response_validation.py` | Deterministic AI response safety checks (pre-display) |
| `response_gen.py`, `system_prompts.py`, `skill_subscriptions.py`, `stt_websocket.py` | Generation, prompts, subscriptions, voice WebSocket |
| `meeting_schema.py` | Matrix v2 DDL ensure + canonical sidecar boot |
| `matrix_canonical_schema.py`, `lifecycle_schema.py` | Sidecar DDL |
| `meeting_views.py`, `matrix_table_routing.py` | Compatibility views and write-table resolution |
| **Live migrations** | `Platform/Matrix/migrations/` — `matrix_drop_legacy`, `mysql_legacy_cleanup`, `mysql_table_renames`, `task_queue_migration`, … (no `meeting_migrate_*` duplicates here) |
| `sms_schema.py`, `sms_recipients.py`, `sms.py`, `sms_providers.py` | SMS schema, recipient resolution, provider dispatch, app registry |
| `_shared.py` | Internal shared imports (cortex_engine, convs, agents, system_entities) |
| **Quarantined meeting migrations** | `Logos/Utilities/To_Remove/Legacy_Code/Matrix/migrations/meeting_migrate_*.py` — import via `Logos.Platform.Matrix.migrations.*` redirects |
| `static/`, `templates/` | Chat UIs |

> Compat redirects for legacy import paths (e.g. `Logos.Platform.Matrix.matrix_ai`,
> `Logos.Platform.Matrix.matrix_routing`, `Logos.Platform.Matrix.matrix_conversation`,
> `Logos.Platform.DataLayer.conversations`, `Logos.Platform.DataLayer.task_queue`) are
> declared in `Logos/__init__.py` so existing callers keep working without
> shim files in the core tree.

## Forbidden Contents

- Product application UI (World)
- Duplicate messaging buses
- Personal experiments

## Safe Extension Points

- Operator commands (document + test)
- Routing tier tuning
- Voice endpoint additions

## Restricted Areas

- `matrix_communications` schema — architect review
- Message format contracts with Cortex — coordinate both teams

## Data Ownership

- **MySQL (v2 core):** `matrix_meetings`, `matrix_meeting_attendance`, `matrix_messages`
- **MySQL (canonical sidecars — Phase 5):** `matrix_meeting_conversations`, `matrix_message_lifecycle`, `matrix_message_meta`, `matrix_message_deliveries` (base table), `matrix_participant_config`, `matrix_response_codes`
- **MySQL (legacy archive — dropped 2026-05-28):** `matrix_meeting_legacy_keys` and other `*_legacy` archive tables — use `matrix_meeting_conversations` sidecar
- **MySQL (compatibility views):** `matrix_communications`, `matrix_conversations` — read old shapes from v2 + sidecars (+ orphan legacy UNION until DROP)
- **Writers (Phase 5):** `meeting_store.append_communication()` writes v2 + sidecars when `canonical_tables_ready()`; no new legacy rows after backfill. Boot: `migrate_legacy_to_canonical()` + `verify_canonical_health()`.
- **DROP legacy:** `matrix_drop_legacy.drop_matrix_legacy_archive()` — architect/PM approval required.
- **Static:** Python + templates in git

## Runtime Contracts

- Pages: `/logos/matrix/`, `/logos/matrix/cel`, `/logos/matrix/lite`
- API: `/logos/matrix/api/…`
- Outbound SMS: `/logos/matrix/sms/*` (legacy `/logos/messaging/*` → 301)
- Developer thread: via World developer routes
- Recipient config: `users.sms_number`, `users.sms_carrier`, `users.sms_opt_in`; audit in `sms_log`

## Developer documentation (Admin)

| Document | Path |
|----------|------|
| Overview + routes | `Logos/Platform/Admin/Docs/Matrix/OVERVIEW.md` |
| Chat flow | `Logos/Platform/Admin/Docs/Matrix/CHAT_FLOW.md` |
| STT beep (lite) | `Logos/Platform/Admin/Docs/Matrix/STT_BEEP_PROBLEM.md` |

## MCP / agent messaging

Agents should use **MCP message tools** or `agents.get(...).send_message()` (Codex Agent → Matrix `agent_messages`) — not ad hoc SQL on Matrix tables.

## Related Documents

| Document | Path |
|----------|------|
| Cortex | `Logos/Platform/Cortex/MANIFEST.md` |
| Attention | `Logos/Utilities/attention/MANIFEST.md` |
| Action tags | `Logos/Platform/Admin/Docs/Cortex/ACTION_TAGS.md` |

Platform/Registry/MANIFEST.md

10.2 KB · modified 2026-05-31 05:38 UTC · Logos/Platform/Registry/MANIFEST.md

# Registry Manifest

**Version:** 0.5.0 | **Last verified:** 2026-05-31 (alpha — MySQL authoritative; primitive set closed)

> Local law for `Logos/Platform/Registry/`. Read `LOGOS_MANIFEST.md` first.

## Alpha release doctrine

**MySQL is authoritative** for all platform artifacts. This is not a transition phase.

| Plane | Store | Role |
|-------|-------|------|
| **Platform artifacts** | MySQL `logos_assets` (+ links/attributes/events) | Skills, views, pages, menu links, file blobs, projects, jobs, MCP tools — **read and write here** |
| **User SQL** | Per-scope SQLite `.db` | DDL + row data; `_workspace_tables` catalog; `_workspace_audit` |
| **SQLite `_workspace_*` artifact tables** | **Cold backup only** | **Not written** in normal operation. Stale rows may exist from pre-alpha backfill. Use only when `LOGOS_REGISTRY_MYSQL_EMERGENCY=1` (MySQL outage) |

**Do not** reintroduce SQLite-first paths, dual-entry, or `_workspace_*` mirrors for platform objects.

## Purpose

MySQL **four-table asset registry** (whitepaper v3.3): `logos_assets`, `logos_links`, `logos_attributes`, `logos_events`.

## What is an “asset”?

An **asset** is a **versioned metadata row** in `logos_assets` (plus optional graph in `logos_links` / `logos_attributes` / `logos_events`). It is **not**:

- Application source code (PhoneMate lives under `Logos/Applications/` — use HTTP, not registry)
- World gallery experiments (reserved `asset_layer='world'` — not mirrored by default)
- Raw SQLite table **data** (rows live in workspace `.db` files; registry holds a **pointer** only)

| Column | Meaning | Examples |
|--------|---------|----------|
| **`asset_layer`** | Which LOGOS **plane** owns the row | `platform` (today’s rows), `world`, `application` (reserved) |
| **`scope`** | Who may **see** it within that plane | `global`, `user`, `private`, `<project_slug>` |
| **`asset_type`** | Kind of asset | `skill`, `table`, `view`, `mcp_tool`, `postulate`, `work_queue`, `project`, … |
| **`parent_asset_id`** | Containing asset (stable `asset_id`) | Project asset for project-scoped rows; ordered siblings via Dewey `sort_order` |
| **`logos_asset_relationships`** | Many-to-many semantic edges | `composes`, `includes`, … — skills reused across parents |

**Natural key:** ``(asset_type, asset_key, asset_layer, scope, human_user_id)`` — current row via ``vw_logos_assets_current`` (latest ``added_at`` per business key). Audit columns: ``added_by_entity``, ``added_at``, ``record_status`` (`active` | `deprecated` | `deleted`).

**Project assignment:** When ``scope`` is a project slug (not ``global`` / ``user`` / ``private`` / ``project``), ``register_asset`` auto-sets ``parent_asset_id`` to the project container row (via ``project_assets.ensure_project_registry_asset``).

**Asset.Catalog for AIs:** `logos_docs_get()` → `asset_catalog` (built by `asset_layers.build_asset_catalog`). Browse with `registry_find_assets(asset_layer=..., scope=...)`.

**Today:** essentially all active registry rows are `asset_layer='platform'`. No PhoneMate/application rows should appear.

**Tasks are not assets.** Trackable work (tasks, tickets, bugs, action items) lives in **Matrix** (`matrix_communications`), not `logos_assets`. Post with `message_type='task'` (stored as `request`). See `LOGOS_UNIFIED_PARTICIPATION_MODEL.md` §6–§7 and `pattern_matrix_message_heartbeat`.

## Role — authority boundary

| Asset kind | Authoritative store | Registry role |
|------------|--------------------|---------------|
| **SQL tables** (`asset_type='table'`) | **Per-scope SQLite** (user row data + DDL) | MySQL pointer row (`asset_key=table_name`) for discovery |
| Skills | **MySQL `logos_assets` only** | Graph hub (`reads`, `composes`, `cites`) |
| Views / pages / menu links / file blobs | **MySQL `logos_assets` only** | Cross-scope discovery |
| Thoughts | `cortex_thoughts` (MySQL) | Link target only (`logos_links.target_kind='thought'`) |

**Hard rule (`table_catalog.py:list_visible_tables`):** User SQL tables MUST be readable without MySQL. SQLite is source of truth for **table data** — registry holds pointers only.

**Cross-agent privacy:** `scope='private'` registry queries isolate by `ai_user_id`.

**Harness / integration-test assets:** Hidden from default browse via `skill_hygiene.py`. Cleanup: `Platform/Admin/scripts/cleanup_test_skill_authors.py`.

## Allowed

| File | Role |
|------|------|
| `schema.py` | MySQL DDL + views; `ensure_registry_schema()` |
| `primitives/` | `register_asset`, `link_assets`, `set_attribute`, `log_event`, readers |
| `dual_write/` | **Internal MySQL writers** (`mirror_skill_create`, …) used by `write_primary/` — misnamed legacy package; **not** SQLite dual-entry |
| `read_primary/` | Registry-primary reads from MySQL |
| `write_primary/` | `registry_primary_write()` — MySQL-first creates |
| `feature_flags.py` | Production env defaults (`PRIMARY_*=1`, emergency off) |
| `mcp_bootstrap/`, `mcp_tool_assets/`, `work_queue/`, `project_assets.py`, … | As before |

## Production env (alpha)

| Env | Value | Meaning |
|-----|-------|---------|
| `LOGOS_REGISTRY_PRIMARY_WRITES` | **1** | Platform artifacts → MySQL |
| `LOGOS_REGISTRY_PRIMARY_READS` | **1** | Platform artifacts ← MySQL |
| `LOGOS_REGISTRY_MYSQL_EMERGENCY` | **0** | When **1**: read/write platform artifacts from SQLite `_workspace_*` backup (MySQL down only) |
| `LOGOS_REGISTRY_DUAL_WRITE` | **0** | Retired — do not enable |
| `LOGOS_REGISTRY_SQLITE_WRITE_MIRROR` | **0** | Retired — do not enable |

Individual fallbacks (`LOGOS_REGISTRY_PRIMARY_SQLITE_FALLBACK`, `LOGOS_REGISTRY_PRIMARY_WRITE_SQLITE_FALLBACK`) still work but **`MYSQL_EMERGENCY=1`** is the operator switch for outage mode.

Optional: `LOGOS_REGISTRY_MIRROR_THOUGHTS`, `LOGOS_REGISTRY_RESUME_CONTEXT`, `LOGOS_REGISTRY_ENRICH_READS`.

### MCP tools (AI-facing graph curation)

| Tool | Role |
|------|------|
| `registry_find_assets` | Metadata browse (no inline `asset_body`; use `registry_asset_graph` / `skill_get` for content) |
| `registry_asset_graph` | Asset + links + attributes |
| `registry_set_attribute` | Append metadata |
| `registry_link_assets` | Graph edges |
| `registry_register_asset` | Doctrine/pattern assets — not playbook bodies |

QC over evidence completeness: `Platform/Admin/linters/evidence_linter.py`
(exposed via MCP `asset_lint` / `registry_lint`).

### `work_queue` asset_type

Queue workloads as registry assets; drained by `Platform/Jobs/handlers/drain_work_queue.py`.
See prior docs in `Platform/Jobs/MANIFEST.md` and skill `schedule_dataset_load`.

## Production lock-in (fresh deploy)

| Script | Role |
|--------|------|
| `Platform/Admin/scripts/migrate_workspace_to_registry.py` | Backfill stale SQLite `_workspace_*` rows → MySQL (run once if needed) |

## Startup

`platform_init.ensure_platform_schemas()` → `_ensure_registry()`.

Post-deploy: `python3 Platform/Admin/scripts/run_mcp_closeout_verify.py`

## Finalized primitive set (2026-05-31 — closed)

**Do not add Platform asset types or registry tables without PM + architecture review.**
World and Applications build on this set via MCP, HTTP, and workspace SQLite.

### Registry asset types (`logos_asset_types`)

Canonical catalog: `Registry/asset_types/_seed.py` (synced on `ensure_registry_schema`).

| `asset_type` | `body_format` | MCP / router notes |
|--------------|---------------|-------------------|
| `project` | `json` | Graph root; `parent_asset_id` container |
| `skill` | `markdown` | Playbooks; `skill_*` MCP |
| `table` | `sql` | Pointer to workspace SQLite DDL/data |
| `view` | `sql` | Saved SQL/HTML view |
| `page` | `html` | Rendered HTML page |
| `menu_link` | `json` | Nav entry |
| `file_blob` | `url_pointer` | Bytes on disk; registry stores path |
| `work_queue` | `json` | Batch drain workloads |
| `mcp_tool` | `json` | One row per wire tool |
| `postulate` | `markdown` | Doctrine blocks |
| `pattern` | `markdown` | Router alias **`memetic`** |
| `doctrine` | `markdown` | Platform doctrine prose |
| `job` | `json` | Background job mirror |
| `thought` | `json` | Cortex thought link target |
| `entity` | `json` | Reserved entity mirror |

**Label fixes (2026-05-31):** `table.body_format` is **`sql`** (not `ddl`); `file_blob.body_format` is **`url_pointer`** (not `binary_ref`).

### Registry writer primitives (`Registry/primitives/`)

| Primitive | Role |
|-----------|------|
| `register_asset` | Append-only asset row |
| `link_assets` | Graph edge in `logos_links` |
| `set_attribute` | Metadata in `logos_attributes` |
| `log_event` | Audit in `logos_events` |

Readers: `find_assets`, `get_attributes`, `get_links`, `list_asset_revisions`, etc.

### Not assets (use Matrix / SQLite instead)

| Kind | Store |
|------|-------|
| Tasks, tickets, debate threads | Matrix `matrix_communications` |
| User SQL row data | Per-scope workspace `.db` |
| Application business logic | `World/` → `Applications/` |

### MCP self-teaching layer (`compact_schema`)

Every command-router help row exposes **`compact_schema`**: field name → type label for agents.
**Code authority:** `Platform/MCP/command_router/help_enrichment.py` (`INTEGER_OPTIONAL_FIELDS`, `BOOLEAN_OPTIONAL_FIELDS`, …).

| Label | Meaning |
|-------|---------|
| `boolean optional` / `boolean required` | JSON boolean |
| `integer optional` / `integer required` | JSON number |
| `string optional` / `string required` | JSON string |
| `string (JSON object)` | JSON object passed as string |

**Rules:** Base hints are optional; route `required_fields` flips `optional` → `required`. Do not invent new label strings — extend the field sets in `help_enrichment.py` and add pytest in `test_compact_schema_field_types.py`.

**Semantic search fields (reference):**

| Field | Label |
|-------|-------|
| `q` | `string required` on `search`; optional on `search_graph` |
| `limit`, `max_projects`, `graph_hop` | `integer optional` |
| `filter_graph_nodes`, `exclude_raw_blobs`, `use_index`, `include_messages`, `include_graph` | `boolean optional` |
| `asset_type`, `asset_types`, `asset_type_filters`, `scope`, `project_slug` | `string optional` |

Surfaced via `semantic(action='help')` and validation errors (`missing_request_error`).

## Related

- `Platform/Admin/Docs/MCP_REGISTRY_PHASE1.md`
- `Platform/Admin/Docs/COMPATIBILITY_DEPRECATION.md`
- `Platform/Jobs/MANIFEST.md`

Platform/Reports/MANIFEST.md

4.2 KB · modified 2026-05-31 00:56 UTC · Logos/Platform/Reports/MANIFEST.md

# Reports Manifest

**Version:** 1.6.0 | **Last verified:** 2026-05-30 (page sanitize profiles)

> Local law for `Logos/Platform/Reports/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

**Not** `Platform/Admin/Reports/` — that folder holds auto-generated operator HTML (schema, MCP tools, manifests). This package is **LOGOS core UI**: workspace browser, developer thread, scratch filtering, **lint dashboards**.

---

## Purpose

**Platform core UI** — developer protocol, human workspace browser, scratch filtering, continuum link metadata, and **read-only lint dashboards**. Represents LOGOS infrastructure, **not** World creations (Gallery, project apps).

**Lint rule:** This folder **displays** linter results from `Platform/Admin/linters/` — it does **not** implement check logic.

## Subsystem Role

Platform-hosted, static core surfaces. Registered on **`platform_bp`** (not `world_bp`).

| Route | Module | Blueprint name |
|-------|--------|----------------|
| `/logos/reports/developer/` | `developer/` package | `prism_developer` |
| `/logos/reports/workspace/` | `workspace/` package | `prism_workspace` |
| `/logos/reports/mysql/` | `mysql_routes.py` | `prism_mysql` |
| `/logos/reports/lint/` | `lint_dashboard.py` | `platform_lint_dashboard` |
| `/logos/reports/module-review/` | `module_review_routes.py` | `platform_module_review` |
| `/logos/reports/evolution/` | `evolution_scoreboard_routes.py` | `platform_evolution_scoreboard` |
| `/logos/reports/registry/assets/` | `registry_routes.py` | `prism_registry` |

Composition: `reports_bp.py` → registered from `Platform/platform_bp.py`.

Legacy URLs `/logos/world/developer/` and `/logos/world/workspace/` redirect from `World/world_bp.py`.

Legacy import: `Logos.Platform.Prism` → `Logos.Platform.Reports` (redirect in `Logos/__init__.py`).

## Modules

| Module | Role |
|--------|------|
| `reports_bp.py` | Composition blueprint (`/reports` prefix) |
| `urls.py` | Canonical URL constants |
| `developer/` | Developer UI package — `bp`, `helpers`, `routes_index`, `routes_mcp_errors`, `routes_platform_errors`, `routes_mcp_metrics`, `routes_messages` |
| `mysql_routes.py` | Admin-only live MySQL table inventory + paginated row browser (enriched with model catalog purpose/domain/status) |
| `module_review_routes.py` | Admin-only Platform module relocation workbook (HTML + JSON + Markdown export) |
| `evolution_scoreboard_routes.py` | Admin-only **evolution scoreboard** — aggregates `logos_events` (`tool_invocation`, `skill_accessed`, `skill_experiment`); data layer in `Registry/evolution_scoreboard.py` |
| `module_review_data.py` | Loads `logos_audit.platform_module_review` (MySQL; SQLite fallback) |
| `workspace/` | Human workspace browser — `routes_browser_*`, `routes_catalog_*`, `routes_views_*`, `routes_assets_*`, `core_helpers.py` / `core_templates.py` / `sanitize_*`. |
| `workspace/sanitize_profiles.py` | **`strict` vs `trusted_interactive`** profiles for AI page HTML (CDN allowlist, inline handlers). See **`Platform/Admin/Docs/PAGE_SANITIZE_PROFILES.md`**. |
| `lint_dashboard.py` | **Display only** — calls `Admin.linters`, renders `lint_dashboard.html` + JSON |
| `workspace_scratch.py` | Scratch/experiment row detection for nav filtering |
| `chat_platform_links.py` | Vendor chat deep-link synthesis for conversation index |
| `logos_links.py` | Continuum showcase route metadata (`get_prism_route`) |

## Forbidden Contents

- Production application blueprints (→ `Applications/`)
- Gallery game internals (→ `World/Gallery/`)
- Agent-created cognitive skill definitions (→ `World/Workspaces/Projects/…/scripts/`)
- Generated admin HTML reports (→ `Platform/Admin/Reports/`)
- **Linter check logic** (→ `Platform/Admin/linters/`)

## Related

| Document | Path |
|----------|------|
| Admin linters (checks) | `Logos/Platform/Admin/linters/` |
| Platform host | `Logos/Platform/PLATFORM_MANIFEST.md` |
| World (redirects only) | `Logos/World/MANIFEST.md` |
| Developer templates | `Logos/Platform/Admin/templates/developer*.html`, `lint_dashboard.html` |
| Matrix developer thread | `Logos/Platform/Matrix/developer_thread.py` |
| Generated operator reports | `Logos/Platform/Admin/Reports/MANIFEST.md` |
| **AI page HTML sanitize profiles** | `Logos/Platform/Admin/Docs/PAGE_SANITIZE_PROFILES.md` |

Utilities/MANIFEST.md

2.5 KB · modified 2026-05-31 06:21 UTC · Logos/Utilities/MANIFEST.md

# Utilities Manifest

**Version:** 1.0.1 | **Last verified:** 2026-05-28

> Local law for `Logos/Utilities/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

**Utilities** is the LOGOS **host-level shared module plane** — cross-cutting capabilities that sit beside `Platform/` (cognition engines), not inside them. Each subfolder is a named utility module.

## Modules

| Folder | Role | Flask routes |
|--------|------|--------------|
| `authority/` | Auth, OAuth, human login/signup, agent connectors, cortex_config admin UI | `/login`, OAuth, `/config/`, … |
| `attention/` | Signal classification and routing input for Matrix | (library — no public BP) |
| `services/` | Provider API call ledger (`logos_provider_api_calls`) — write path | (library — no public BP) |
| `web/` | Logos.Web Playwright browser control engine | (library — MCP in Platform/MCP) |
| `Tests/` | Integration / smoke harnesses (not production imports) | (scripts — see `Tests/MANIFEST.md`) |
| `logs/` | Runtime blueprint log files (`.log`) | (data — not imported) |

Human **login/signup/logout** live in `Utilities/authority/` (`logos_auth.py`, `logos_auth_bp.py`), registered via `utilities_bp`.

## Host wiring

| File | Role |
|------|------|
| `utilities_bp.py` | Registers `logos_auth_bp`, `identity_bp`, `oauth_bp`, `config_bp` |
| `logos_bp.py` | `logos_bp.register_blueprint(utilities_bp)` |

## Data layers (outside Utilities)

| Concern | Canonical module |
|---------|------------------|
| MySQL users / sessions | `Utilities/authority/auth.py` |
| OAuth tables | `Utilities/authority/oauth/` |
| `cortex_config` reads/writes | `Platform/DataLayer/config.py` |

## Legacy imports

| Legacy path | Redirects to |
|-------------|--------------|
| `Logos.Platform.Identity` | `Logos.Utilities.authority` |
| `Logos.Platform.Config` | `Logos.Utilities.authority.config` |
| `Logos.Platform.Attention` | `Logos.Utilities.attention` |
| `Logos.Platform.Services` | `Logos.Utilities.services` |
| `Logos.logos_auth` | `Logos.Utilities.authority.logos_auth` (no root shim file) |
| `Logos.Control.*` | `Logos.Utilities.*` (short-lived compat) |

Shims remain under `_Quarantine/` only. Legacy imports use `Logos/__init__.py` redirects.

## Related

| Document | Path |
|----------|------|
| Authority detail | `Utilities/authority/MANIFEST.md` |
| Attention detail | `Utilities/attention/MANIFEST.md` |
| Provider ledger | `Utilities/services/MANIFEST.md` |
| Test harnesses | `Utilities/Tests/MANIFEST.md` |
| Platform map | `Platform/PLATFORM_MANIFEST.md` |

Utilities/Tests/MANIFEST.md

1.3 KB · modified 2026-05-28 17:15 UTC · Logos/Utilities/Tests/MANIFEST.md

# Utilities / Tests Manifest

**Version:** 1.0.0 | **Last verified:** 2026-05-28

> Local law for `Logos/Utilities/Tests/`. Read `Logos/Utilities/MANIFEST.md` first.

---

## Purpose

**Non-production test harnesses** for Utilities and cross-cutting smoke checks. Pytest for the full platform remains under `Logos/Platform/Admin/Security/tests/`.

## Allowed contents

| Subfolder | Contents |
|-----------|----------|
| `integration/` | Manual or CI live scripts (`test_*.py` with `main()`), smoke runners callable from diagnostic routes |

## Forbidden

- Production ledger/auth/attention logic (belongs in sibling `services/`, `authority/`, etc.)
- Flask blueprints or MCP tools

## Run

```bash
# Provider ledger live / synthetic check
cd /root/Winbusiness && set -a && . database.env && set +a
PYTHONPATH=/root/Winbusiness:/root/Winbusiness/winbusiness \
  python3 winbusiness/Logos/Utilities/Tests/integration/test_provider_ledger_live.py
PYTHONPATH=/root/Winbusiness:/root/Winbusiness/winbusiness \
  python3 winbusiness/Logos/Utilities/Tests/integration/test_provider_ledger_live.py --synthetic
```

## Related

| Document | Path |
|----------|------|
| Platform pytest suite | `Logos/Platform/Admin/Security/tests/` |
| Provider ledger (production) | `Logos/Utilities/services/` |

Utilities/attention/MANIFEST.md

2.1 KB · modified 2026-05-22 06:39 UTC · Logos/Utilities/attention/MANIFEST.md

# Attention Manifest

**Version:** 1.1.0 | **Last verified:** 2026-05-22

> Local law for `Logos/Utilities/attention/`. Read `Logos/Utilities/MANIFEST.md` first.

---

## Purpose

Attention classifies incoming signals, scores relevance per agent, and informs Matrix routing — **who should respond, monitor, or ignore**.

## Subsystem Role

**Senses of LOGOS.** Sits between raw input (text/voice/system) and Matrix/Cortex routing decisions.

## Audience

Platform developers working on routing, voice, or AI Mate integration. Individual AIs: read-only understanding.

## Owner / Steward

`project:platform_development` / LOGOS Project Manager.

## Allowed Contents

- Signal classification (`signal_classifier.py`)
- Attention scoring (`attention_auditor.py`)
- Signal data structures (`attention_signals.py`)
- Blueprint routes for attention APIs
- `docs/` — protocol and routing specifications (migrated to Bridge)

## Forbidden Contents

- End-user application UI (World apps)
- Duplicate routing systems parallel to Matrix
- Personal AI experiments

## Safe Extension Points

- Signal type additions (document in PROTOCOL + tests)
- Scoring weight tuning (with regression checks on routing)
- Integration hooks for new input sources (mic, scheduled)

## Restricted Areas

- Scoring engine changes affecting all conversations — architect review
- Cross-subsystem contract with Matrix enqueue path — coordinate with Matrix maintainers

## Data Ownership

- Primarily in-memory / ephemeral scoring state during routing
- Persistent conversation state remains in Matrix MySQL tables

## Runtime Contracts

- Called from Matrix routing pipeline and AI Mate voice flows
- Model tier output consumed by Cortex generation (`attention_settings`)

## Related Documents

| Document | Path |
|----------|------|
| Overview | `Logos/Platform/Admin/Docs/Attention/OVERVIEW.md` |
| Protocol | `Logos/Platform/Admin/Docs/Attention/PROTOCOL.md` |
| Routing spec | `Logos/Platform/Admin/Docs/Attention/ROUTING_SPEC.md` |
| Matrix | `Logos/Platform/Matrix/MANIFEST.md` |

## Promotion Rules

Attention stays core platform — no promotion to World apps.

Utilities/authority/MANIFEST.md

2.3 KB · modified 2026-05-27 00:34 UTC · Logos/Utilities/authority/MANIFEST.md

# Authority Manifest

**Version:** 1.2.0 | **Last verified:** 2026-05-22

> Local law for `Logos/Utilities/authority/`. Read `Logos/Utilities/MANIFEST.md` first.

---

## Purpose

**Authority** is the **authentication and session gate** — login, OAuth, bearer validation for MCP, visitor codes, route protection, and operator config UI.

## Subsystem Role

**Gatekeeper.** Every protected route depends on Identity; MCP nginx gate calls `/logos/oauth/validate`.

## Audience

Platform developers only. **No AI should modify** without explicit security assignment.

## Owner / Steward

`project:platform_development` + security steward.

## Allowed Contents

- `logos_auth_bp.py` — human login, signup, logout (`/login`, `/signup`, `/logout`)
- `logos_auth.py` — session helpers (`get_logos_user`, `require_logos_login`, …)
- `identity_bp.py` — session API, nav API, visitor codes
- `auth.py` — sessions, rate limits, bearer-aware `get_current_user()`
- `oauth.py` — OAuth clients, pairing, bearer validation
- `compat.py` — import shims

## Forbidden Contents

- Application business logic
- Per-app user scoping (belongs in World apps via `UserScope` patterns)
- Experiments

## Safe Extension Points

- New OAuth scopes (document + Sentinel review)
- Rate limit tuning on specific routes

## Restricted Areas

- Password hashing, session cookie policy — architect review
- `/logos/oauth/validate` contract — MCP depends on it
- Nav admin dropdown curation — operator-only

## Runtime Contracts

```python
from Logos.Platform.Identity import require_login
from Logos.Platform.Identity.auth import rate_limit
```

MCP identity: `Logos/Platform/MCP/identity.py` consumes OAuth validation (compat shim: `Cortex/mcp_identity.py`).

Flask `get_current_user()` accepts the same OAuth/PAT bearer as MCP. MCP tool `logos_fetch(path)` performs server-side authenticated fetches for development browsing.

## Developer documentation (Admin)

| Document | Path |
|----------|------|
| Overview | `Logos/Platform/Admin/Docs/Identity/OVERVIEW.md` |
| Sentinel surface | `Logos/Platform/Admin/Sentinel/SENTINEL_SURFACE_INVENTORY.md` |

## Related Documents

| Document | Path |
|----------|------|
| Architecture § identity | `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md` |
| Sentinel | `Logos/Platform/Admin/Security/MANIFEST.md` |

Utilities/services/MANIFEST.md

1.9 KB · modified 2026-05-28 17:16 UTC · Logos/Utilities/services/MANIFEST.md

# Utilities / Services Manifest

**Version:** 1.1.0 | **Last verified:** 2026-05-22

> Local law for `Logos/Utilities/services/`. Read `Logos/Utilities/MANIFEST.md` and `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

**Minimal platform gateway** — log paid/metered external API calls. No dashboards, no HTML, no operator UI.

## Subsystem Role

**Write path only.** Call a provider (via Codex/Matrix today), then `log_provider_call()`.  
All **reporting, aggregates, rebilling views, and schema HTML** → **Bridge** (`provider_usage_reports.py`, `admin_api.py`, `CodeDisplays/`).

## Tests

Live ledger integration script: `Logos/Utilities/Tests/integration/test_provider_ledger_live.py` (not in this folder).

## Purity rule

Keep this folder **small**:

| In Services | Not in Services |
|-------------|-----------------|
| `log_provider_call`, `estimate_cost` | `get_usage_summary`, cost dashboards |
| Table constant + boot schema migration | Generated reports, admin routes |
| Future: thin `provider_call()` wrapper | MCP tools that dump usage stats |

## Owner / Steward

`project:platform_development` / LOGOS Project Manager.

## MySQL

| Object | Kind |
|--------|------|
| `logos_provider_api_calls` | TABLE (canonical) |
| `cortex_agent_executions` | VIEW (compat) |

## Import contract

```python
from Logos.Utilities.services import log_provider_call, estimate_cost
```

Legacy import only: `Logos.Platform.Services` → redirect in `Logos/__init__.py`. There is no `Platform/Services/` folder.

Reads / reporting:

```python
from Logos.Platform.Admin.provider_usage_reports import get_usage_summary
```

## Related Documents

| Document | Path |
|----------|------|
| Operator reporting | `Logos/Platform/Admin/provider_usage_reports.py` |
| Admin cost API | `Logos/Platform/Admin/admin_api.py` |
| Proposal | `World/Workspaces/Archives/Docs/Proposals/2026-05-21_logos_platform_services_ledger.md` |

Utilities/web/MANIFEST.md

1.4 KB · modified 2026-05-31 06:20 UTC · Logos/Utilities/web/MANIFEST.md

# Utilities / Web Manifest

**Version:** 1.0.0 | **Last verified:** 2026-05-30

> Local law for `Logos/Utilities/web/`. Read `Logos/Utilities/MANIFEST.md` first.

---

## Purpose

**Logos.Web engine** — stateful browser automation for MCP agents (Playwright).
DOM inspect/click/fill/select, screenshots, session cookies, and checkout
approval gates. Read-only HTTP remains in `Platform/Cortex/web_extractor.py`
and `Platform/MCP/tools/web_tools.py` (`logos_fetch`).

## Subsystem role

**Library only** — no Flask blueprint, no MCP registration here.
Wire surface: `Platform/MCP/tools/web_control_tools.py`.

## Modules

| File | Role |
|------|------|
| `config.py` | Env flags (`LOGOS_WEB_CONTROL`, session limits) |
| `ssrf.py` | URL safety (reuses Cortex `assert_safe_url`) |
| `session_store.py` | In-memory session + order registry |
| `browser.py` | Playwright pool lifecycle |
| `actions.py` | DOM commands (click, fill, wait, …) |
| `approval.py` | Human approval tokens + submit lockout |
| `service.py` | Public API consumed by MCP tools |

## Import contract

```python
from Logos.Utilities.web.service import web_session_command, web_order_command
```

## Related

| Document | Path |
|----------|------|
| MCP tools | `Platform/MCP/tools/web_control_tools.py` |
| Proposal | `World/Workspaces/Archives/Docs/Proposals/2026-05-30_logos_web_browser_control.md` |
| Read-only fetch | `Platform/MCP/tools/web_tools.py` |

Module READMEs

Platform/Admin/Reports/MANIFEST.md

2.6 KB · modified 2026-05-28 08:52 UTC · Logos/Platform/Admin/Reports/MANIFEST.md

# Reports Manifest

**Version:** 1.2.0 | **Last verified:** 2026-05-28

> Local law for `Logos/Platform/Admin/Reports/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

*(Formerly **CodeDisplays**; legacy URL `/logos/admin/CodeDisplays/` redirects here.)*

---

## Purpose

**Live operator reports** — metadata read from repo + runtime at request time.
Static `*.html` on disk is an **optional export** only (CI, offline mirror).

**Principle:** Metadata is data. Reports query current state; they do not go stale.

## Subsystem Role

Operator reference under Admin at `/logos/admin/Reports/`.

| Report | Live HTML | Live JSON | Builder |
|--------|-----------|-----------|---------|
| Manifests & governance | `LOGOS_MANIFESTS_SNAPSHOT.html` | `.json` | `live_builders.build_manifests_*` |
| MCP core (tools/list) | `LOGOS_MCP_CORE_REPORT.html` | `.json` | `live_builders.build_mcp_core_*` |
| Registry parity | `LOGOS_REGISTRY_PARITY_REPORT.html` | `.json` | `live_builders.build_registry_parity_*` |
| MySQL schema | `LOGOS_MYSQL_SCHEMA_REPORT.html` | `.json` | `generate_mysql_schema_report.build_*` via `live_builders` |
| Data model | `LOGOS_DATA_MODEL_REPORT.html` | `.json` | `patch_data_model_report.build_*` via `live_builders` |
| Import redirects | `LOGOS_IMPORT_REDIRECTS_REPORT.html` | `.json` | `live_builders.build_import_redirects_*` |
| Report index | — | `/Reports/live/index.json` | `live_routes.py` |

Dispatch: `admin_bp.files()` → `live_report_response()` before static fallback.

## Allowed Contents

- **Live builders:** `live_builders.py`, `live_routes.py`, `_display_common.py`
- **Optional export scripts:** `generate_*.py`, `patch_*.py`, `regenerate_code_displays.py`
- **`mysql_schema_report/`** — `constants`, `fetch`, `render`, `public_api` (`generate_mysql_schema_report.py` facade)
- Committed `*.html` exports (may lag live routes — do not treat as authority)

## Forbidden Contents

- Hand-editing HTML as source of truth (overwritten on export; live routes ignore edits)
- Application runtime code

## Not live (yet / separate)

| Output | Notes |
|--------|--------|
| `LOGOS_PHASE1_LOCK_REPORT.html` | `generate_phase1_lock_report.py` |
| `mcp_wire_contract.json` | **CI lock only** — not an operator report; regenerate with `UPDATE_MCP_SNAPSHOT=1` |

## Optional static export

```bash
python3 winbusiness/Logos/Platform/Admin/Reports/regenerate_code_displays.py
```

Prefer live URLs when the app is running.

## Related Documents

| Document | Path |
|----------|------|
| Admin | `Logos/Platform/Admin/MANIFEST.md` |
| Lint dashboard (Reports UI) | `Logos/Platform/Reports/lint_dashboard.py` |

Platform/Admin/Security/MANIFEST.md

4.6 KB · modified 2026-05-30 06:01 UTC · Logos/Platform/Admin/Security/MANIFEST.md

# Security Manifest

**Version:** 2.0.0 | **Last verified:** 2026-05-28

> Local law for `Logos/Platform/Admin/Security/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

*(Formerly **Sentinel** at `Platform/Sentinel/`; legacy imports `Logos.Platform.Sentinel` redirect here.)*

---

## Purpose

Security is LOGOS’s **platform integrity layer** — pytest suite for cross-subsystem behavior, SQL-backed module audit tooling, and security/monitoring documentation.

## Subsystem Role

Proactive verification and regression tests; optional audit pipeline for cleanup reports.

## Audience

Platform operators and security stewards.

## Owner / Steward

`project:platform_development` / security steward.

## Allowed Contents

- **Platform test suite** — `tests/` (pytest for Cortex, Matrix, DataLayer, Attention, Identity, workspace, MCP)
- **Audit tooling** — `tools/` (SQL-backed Platform inventory; see below)
- **Prose docs** — `docs/` (overview, integrity patterns, surface inventory)

## Audit tooling

`tools/` hosts the offline audit pipeline that populates the
`logos_audit` MySQL database with every Python module, top-level symbol, and
import edge under `Logos/Platform/`. Run order:

| Step | File | What it does |
|------|------|--------------|
| 1 | `schema.sql` | Idempotent DDL for `logos_audit.{modules,symbols,imports,_staging_symbol_refs}`. |
| 2 | `inventory_loader.py` | AST walk over `Platform/**/*.py`; UPSERTs modules/symbols, refreshes imports. |
| 3 | `resolve_refs.py` | Resolves `imports.target_module_id`, rolls up inbound/outbound counts and symbol refs. |
| 4 | `external_callers.py` | grep sweep across the repo for callers OUTSIDE `Platform/`. |
| 5 | `heuristic_classify.sql` | Stamps `usage_status` for shims / CLIs / migrations / critical modules. |
| 6 | `analyst_pass.sql` | Per-module subdomain + reasoning notes (analyst-curated). |
| 7 | `render_cleanup_md.py` | Emits `Cleanup_LOGOS.md` (repo root) from a single SQL pass. |

### Module relocation workbook (temporary)

Human review table for moving/renaming Platform modules. **Drop when the pass is done.**

| Step | File | What it does |
|------|------|--------------|
| A | `schema_module_review.sql` | DDL for `logos_audit.platform_module_review` (reference; populate uses inline DDL on MySQL). |
| B | `populate_module_review.py` | AST walk of `Platform/**/*.py`; scores 7 vectors (0–10) + `score_overall`; seeds `work_needed`, `proper_final_folder`, `proper_final_name` empty for manual fill. |

**Recommended:** run steps 1–3 of the audit pipeline first so `inbound_imports` / coupling scores are accurate; populate merges counts from `logos_audit.modules` when present.

```bash
cd /root/Winbusiness && set -a && . database.env && set +a
PYTHONPATH=/root/Winbusiness:/root/Winbusiness/winbusiness \
  python3 -m Logos.Platform.Admin.Security.tools.populate_module_review
```

**SQLite fallback** (no MySQL): `--sqlite Logos/World/Workspaces/platform/platform_module_review.sqlite`

**Review columns** (update after inspection):

```sql
UPDATE logos_audit.platform_module_review
SET work_needed = 'split facade; move helpers to subpackage',
    proper_final_folder = 'Platform/Cortex/skills',
    proper_final_name = 'registry_persist.py'
WHERE rel_path = 'Platform/Cortex/skills.py';
```

**Scores:** `score_length`, `score_focus`, `score_error_handling`, `score_naming`, `score_placement`, `score_coupling`, `score_documentation`, `score_overall` (heuristic; not gospel).

**Web UI (admin):** `/logos/reports/module-review/` — HTML table; `/api` JSON; `/export.md` Markdown for other AI reviewers.

## Tests

```bash
pytest winbusiness/Logos/Platform/Admin/Security/tests/ -q
```

Shared fixtures: `tests/conftest.py`

MCP integration tiers: `tests/mcp_test_tiers.py` (code authority); staged operator doc `Utilities/To_Remove/Docs/2026-05-29_mcp_integration_test_tiers_staged.md` — markers `mcp_smoke`, `mcp_standard`, `mcp_full`. Purge inventory: `Utilities/To_Remove/Docs/2026-05-29_mcp_integration_debris_purge.md`.

## Forbidden Contents

- End-user application code
- Production Flask routes (those live on Cortex/Matrix/Admin `admin_bp`)

## Developer documentation

| Document | Path |
|----------|------|
| Overview | `Logos/Platform/Admin/Security/docs/OVERVIEW.md` |
| Integrity patterns | `Logos/Platform/Admin/Security/docs/INTEGRITY_OVERVIEW.md` |
| Surface inventory | `Logos/Platform/Admin/Security/docs/SENTINEL_SURFACE_INVENTORY.md` |

## Related Documents

| Document | Path |
|----------|------|
| Admin (operator shell) | `Logos/Platform/Admin/MANIFEST.md` |
| Identity / OAuth | `Logos/Utilities/authority/MANIFEST.md` |

Utilities/To_Remove/Legacy_Code/MANIFEST.md

1.3 KB · modified 2026-05-28 07:50 UTC · Logos/Utilities/To_Remove/Legacy_Code/MANIFEST.md

# Legacy_Code Manifest

**Version:** 1.1.0 | **Last verified:** 2026-05-28

> **STORAGE ONLY — frozen archive.** This tree will be copied off-repo and deleted.
> **Do not import from `Logos.Legacy_Code` in live Platform code.**

---

## Purpose

Frozen snapshot of quarantined shims, one-shot scripts, and migration copies moved out of Platform during the 2026-05 cleanup pass. **Not executed at runtime.** Live equivalents live under `Logos/Platform/`.

## Live replacements

| Was (here) | Now (live) |
|------------|------------|
| `Matrix/migrations/` | `Platform/Matrix/migrations/` |
| `Admin/scripts/compare_registry_parity.py` | `Platform/Admin/scripts/compare_registry_parity.py` |
| `Cortex/cortex_mcp_entry.py` | `Platform/Cortex/cortex_mcp.py` |
| `Admin/legacy/` | HTML/docs archive only |
| `_Quarantine/` | 2026-05-22 compat shims (superseded by `Logos/__init__.py` redirects) |

## Import compatibility

Old import paths redirect via `Logos/__init__.py` to **Platform** modules — not to this folder.

## Forbidden

- Any import from Platform, tests, or MCP into this tree
- New production features
- Treating this folder as authoritative — use Platform manifests

## Related

| Document | Path |
|----------|------|
| Inventory | `LEGACY_INVENTORY.md` |
| Platform law | `Platform/PLATFORM_MANIFEST.md` |

Utilities/To_Remove/Legacy_Code/_Quarantine/2026-05-22_platform_attention_shim/MANIFEST.md

0.2 KB · modified 2026-05-22 06:39 UTC · Logos/Utilities/To_Remove/Legacy_Code/_Quarantine/2026-05-22_platform_attention_shim/MANIFEST.md

# Attention (compat shim)

**Status:** Moved to `Logos/Utilities/attention/` (2026-05-22).

Canonical import: `Logos.Utilities.attention` (legacy `Logos.Platform.Attention` redirects via `Logos/__init__.py`).

Utilities/To_Remove/Legacy_Code/_Quarantine/2026-05-22_platform_config_shim/MANIFEST.md

0.2 KB · modified 2026-05-22 06:39 UTC · Logos/Utilities/To_Remove/Legacy_Code/_Quarantine/2026-05-22_platform_config_shim/MANIFEST.md

# Config (compat shim)

**Status:** Moved to `Logos/Utilities/authority/config/` (2026-05-22).

- **UI/API:** `Utilities/authority/config/`
- **Data:** `Platform/DataLayer/config.py`

Legacy `Logos.Platform.Config` redirects via `Logos/__init__.py`.

Utilities/To_Remove/Legacy_Code/_Quarantine/2026-05-22_platform_identity_shim/MANIFEST.md

0.3 KB · modified 2026-05-22 06:39 UTC · Logos/Utilities/To_Remove/Legacy_Code/_Quarantine/2026-05-22_platform_identity_shim/MANIFEST.md

# Identity (compat shim)

**Status:** Moved to `Logos/Utilities/authority/` (2026-05-22).

Canonical import: `Logos.Utilities.authority` (legacy `Logos.Platform.Identity` redirects via `Logos/__init__.py`).

Human login routes: `Utilities/authority/logos_auth_bp.py` (compat: `Logos/logos_auth_bp.py`).

Utilities/To_Remove/Legacy_Code/_Quarantine/MANIFEST.md

1.7 KB · modified 2026-05-22 06:39 UTC · Logos/Utilities/To_Remove/Legacy_Code/_Quarantine/MANIFEST.md

# Quarantine Manifest

**Version:** 0.1.1 | **Last verified:** 2026-05-22

> Local law for `Logos/_Quarantine/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

**Holding area** for code and docs removed from active paths during cleanup — unused modules, superseded experiments, and candidates for deletion. Nothing here is imported by production LOGOS.

## Status

Active holding area. Items listed below are not imported by production LOGOS.

| Quarantined | Source | Date | Reason |
|-------------|--------|------|--------|
| `2026-05-22_logos_auth_templates/` | `Logos/templates/logos_login.html`, `logos_signup.html` | 2026-05-22 | Duplicate auth templates; canonical in `Utilities/authority/templates/` |
| `2026-05-22_platform_attention_shim/` | `Platform/Attention/` | 2026-05-22 | Canonical: `Utilities/attention/`; redirect only |
| `2026-05-22_platform_identity_shim/` | `Platform/Identity/` | 2026-05-22 | Canonical: `Utilities/authority/`; redirect only |
| `2026-05-22_platform_config_shim/` | `Platform/Config/` | 2026-05-22 | Canonical: `Utilities/authority/config/`; redirect only |
| `2026-05-22_bridge_config_bp_shim/` | `Platform/Admin/config_bp.py` | 2026-05-22 | Canonical: `Utilities/authority/config/config_bp.py` |

## Rules

- Each quarantined item should include a short note (filename suffix `_QUARANTINE.md` or subfolder `README.md`) with: source path, date, reason, and whether delete is safe
- Do not register Flask blueprints or MCP tools from quarantine
- Periodic review: restore to `World/`, `Applications/`, or delete after PM approval

## Forbidden

- New feature development in quarantine
- Secrets or credentials (redact before move)

Applications & product manifests

Applications/APPLICATIONS_MANIFEST.md

3.2 KB · modified 2026-05-27 19:38 UTC · Logos/Applications/APPLICATIONS_MANIFEST.md

# Applications Manifest

**Version:** 1.0.3 | **Last verified:** 2026-05-27

> **Read this file first** when entering `Logos/Applications/`. For the LOGOS **Platform**, start at `Logos/Platform/Admin/LOGOS_MANIFEST.md`.

---

## What Applications is

**Applications** hosts **graduated products** (PhoneMate, Memory Manager, DART, …) that run **in** LOGOS. It is **not** the Platform engine (`Logos/Platform/`) and **not** the World dev zone (`Logos/World/Gallery`, `Logos/World/Workspaces/`).

**Boundary (critical):**

| Layer | Owns | MCP |
|-------|------|-----|
| **LOGOS Platform** | Cortex, Matrix, MCP gateway, DataLayer, Registry | `https://winbusiness.com/logos/cortex/mcp/` — Platform tools only |
| **World / Workspaces** | AI experiments, archives, project staging | No app tools on Platform MCP |
| **Applications** | Production app code + app SQLite | **HTTP only** — `logos_fetch('/logos/world/<app>/…')`, REST APIs |

PhoneMate was created in **World** (AI workspace). Its feature inventory lives in **World archives**, not in Platform MCP or Platform manifests.

---

## Governance chain

| Level | Manifest | Host Python |
|-------|----------|-------------|
| LOGOS Platform | `Platform/Admin/LOGOS_MANIFEST.md` | `logos_bp.py`, `platform_bp.py` |
| World | `World/MANIFEST.md` | `world_bp.py` |
| **Applications (this folder)** | **`Applications/APPLICATIONS_MANIFEST.md`** | `applications_bp.py`, `applications_hooks.py` |
| Individual app | World archive + app `BACKLOG.md` / routes | `<app>_bp.py` |

**Do not** add `PHONEMATE_MANIFEST.md` under `Applications/phone_manager/` — that blurs Platform vs World. Canonical archived inventory:

`World/Workspaces/Archives/Docs/processed/Prism/websites/phone_manager/PHONEMATE_MANIFEST_old.md`

---

## Applications host layer

| File | Role |
|------|------|
| `applications_bp.py` | Registers app blueprints; login gate |
| `applications_services.py` | App catalog |
| `applications_nav_registry.py` | Nav entries → Platform registry via hooks |
| `applications_hooks.py` | Nav links + app SMS providers only (**no MCP tools**) |
| `websites_bp.py` | Applications hub |

---

## Allowed contents

- Production app folders (`phone_manager/`, `memory_manager/`, …)
- App-local SQLite, templates, static, tests, `BACKLOG.md`

## Forbidden contents

- Platform engine code (Cortex, Matrix, MCP tool registration)
- MCP `@mcp.tool` registrars in Applications (removed — use HTTP)
- Undeployed experiments → `World/Gallery/` or `World/Workspaces/`

---

## Runtime

URL prefix (stable): `/logos/world/<app>/`

| App | Folder | Developer API (HTTP, not MCP) |
|-----|--------|-------------------------------|
| PhoneMate | `phone_manager/` | `GET /logos/world/phonemanager/api/backlog` |

Auth: host login gate + `Logos.logos_auth`; MCP agents use `logos_fetch` with paired bearer.

Bearer / OAuth resolution: `Logos.Utilities.authority` (`api_tokens`, `oauth_bp`).

---

## Related documents

| Document | Path |
|----------|------|
| LOGOS Platform | `Platform/Admin/LOGOS_MANIFEST.md` |
| World | `World/MANIFEST.md` |
| PhoneMate archive manifest | `World/Workspaces/Archives/Docs/processed/Prism/websites/phone_manager/PHONEMATE_MANIFEST_old.md` |
| LOGOS vs creations | `Platform/Admin/LOGOS_ARCHITECTURE.md` |

Platform/Admin/LOGOS_MANIFEST.md

15.4 KB · modified 2026-05-31 00:56 UTC · Logos/Platform/Admin/LOGOS_MANIFEST.md

# LOGOS Manifest

**Version:** 1.0.2 (update log mandate) | **Last verified:** 2026-05-28

> **Read this file first.** Every human and AI developer entering LOGOS must start here.

---

## What LOGOS is

LOGOS is a **multi-subsystem AI operating environment** — one Flask application that hosts identity, cognition, messaging, data access, promoted applications, and agent workspaces. It is **not** any single product inside it (PhoneMate, Gallery games, etc.). Those run **in** LOGOS.

**Motto:** *Consciousness is always a choice.*

---

## Core governance documents (read in order)

| # | File | Audience | Purpose |
|---|------|----------|---------|
| 1 | `Logos/Platform/Admin/LOGOS_MANIFEST.md` | Everyone | **This file** — root map and exact paths |
| 2 | `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md` | Architects, PM, senior devs | Constitutional boundaries; entity model; architect-level rules |
| 3 | `Logos/Platform/Admin/LOGOS_DEVELOPER_GUIDE.md` | Human + AI developers | Working rulebook; Look Before You Leap; safe areas |
| 4 | `Logos/Platform/Admin/LOGOS_AI_EXPERIENCE.md` | AI participants | Philosophy of participation — invite, not command |
| 5 | `Logos/Platform/Admin/Docs/LOGOS_UNIFIED_PARTICIPATION_MODEL.md` | Everyone | **Part 1** — unified asset/thought/message/entity model; workspace vs project; skills |
| 6 | `Logos/LOGOS.LOGOS_Updates.md` | Everyone | **Mandatory append-only change log** (intent, when, agent, base) |

**Do not guess.** Fetch the exact path above. Do not substitute legacy filenames.

---

## LOGOS update log (mandatory from 2026-05-28)

Every change to LOGOS code, manifests, or wire-contract MCP surface **must append one row** to:

**`Logos/LOGOS.LOGOS_Updates.md`**

| Required field | Content |
|----------------|---------|
| **When** | UTC ISO timestamp |
| **Base** | Primary subsystem id (e.g. `logos.platform.mcp`, `logos.platform.cortex`, `logos.platform.matrix`, `logos.platform.registry`, `logos.world`, `logos.applications`) — see the log file for the full list |
| **Agent** | Human or AI identifier (`composer`, `ember`, `casey`, …) |
| **Intent** | Why the change fits LOGOS (one sentence) |
| **Change** | What was touched |
| **Verify** | pytest, MCP probe, or explicit manual check |

No new Platform tools, tables, or top-level folders without a log row and manifest/proposal fit. Prefer **net subtraction** (see `World/Workspaces/Archives/Docs/Proposals/2026-05-28_mcp_first_lens_strategy.md`).

**Platform feature freeze (2026-05-31):** LOGOS Platform is feature-complete for this phase. World and Applications build on the **finalized primitive set** — see `Platform/Registry/MANIFEST.md` § Finalized primitive set (15 asset types, 4 writer primitives, `compact_schema` self-teaching layer). Bugfixes and label/doc alignment only; new capabilities belong in World proposals.

---

## Primary folder manifests (local law)

Each primary folder has a `MANIFEST.md` that defines what belongs there. **Read the manifest of any folder before editing files in it.**

| Folder | Manifest path |
|--------|---------------|
| **Platform (core engine host)** | **`Logos/Platform/PLATFORM_MANIFEST.md`** |
| **Utilities (host shared modules)** | **`Logos/Utilities/MANIFEST.md`** |
| Cortex (AI runtime, entity model — *production MCP still here during migration*) | `Logos/Platform/Cortex/MANIFEST.md` |
| MCP (AI gateway — FastMCP server, tools; **migration target**) | `Logos/Platform/MCP/MANIFEST.md` |
| Matrix (messaging, conversations, routing) | `Logos/Platform/Matrix/MANIFEST.md` |
| DataLayer (data-access layer → MySQL; formerly Codex) | `Logos/Platform/DataLayer/MANIFEST.md` |
| Identity / authority (auth, OAuth, sessions) | `Logos/Utilities/authority/MANIFEST.md` |
| Admin/Security (monitoring, integrity checks) | `Logos/Platform/Admin/Security/MANIFEST.md` |
| World (Gallery, workspaces, dev tools) | `Logos/World/MANIFEST.md` |
| **Applications (production apps)** | **`Logos/Applications/APPLICATIONS_MANIFEST.md`** |
| Gallery (semi-production showcase apps) | `Logos/World/Gallery/MANIFEST.md` |
| Admin (operator diagnostics, logging) | `Logos/Platform/Admin/MANIFEST.md` |
| Reports (generated HTML; formerly CodeDisplays) | `Logos/Platform/Admin/Reports/MANIFEST.md` |
| Attention (signal scoring, routing input) | `Logos/Utilities/attention/MANIFEST.md` |
| Egos (AI personality workspaces; archive) | `Logos/World/Workspaces/Archives/Egos/` (import: `Logos.World.Workspaces.Archives.Egos` or compat `Logos.Egos`) |
| Workspaces (tenant SQLite + project data) | `Logos/World/Workspaces/MANIFEST.md` | ← lives inside World |

**Additional core modules** (no separate manifest yet — see `LOGOS_ARCHITECTURE.md`):

| Module | Path | Role |
|--------|------|------|
| Utilities (host plane) | `Logos/Utilities/` | authority, attention; host: `utilities_bp.py` |
| Config (data layer) | `Logos/Platform/DataLayer/config.py` | MySQL `cortex_config` reads/writes; LLM keys → `llm_provider_config.py` |

Outbound SMS (recipient fields on `users`, `sms_log` audit, `/logos/matrix/sms/*`) lives in **Matrix** — see `Logos/Platform/Matrix/MANIFEST.md`.

---

## Canonical generated reports (living technical authority)

These HTML files are **generated**. Do not hand-edit them. Regenerate from the Python scripts in `Logos/Platform/Admin/Reports/`.

| Report | Path | Generator |
|--------|------|-----------|
| Manifests snapshot | `Logos/Platform/Admin/Reports/LOGOS_MANIFESTS_SNAPSHOT.html` | `generate_manifests_snapshot.py` |
| MySQL schema | `Logos/Platform/Admin/Reports/LOGOS_MYSQL_SCHEMA_REPORT.html` | `generate_mysql_schema_report.py` |
| Data model | `Logos/Platform/Admin/Reports/LOGOS_DATA_MODEL_REPORT.html` | `patch_data_model_report.py` |
| MCP core | `Logos/Platform/Admin/Reports/LOGOS_MCP_CORE_REPORT.html` | `generate_mcp_core_report.py` |

Web URLs (when deployed): `/logos/admin/Reports/<filename>.html`

---

## Developer documentation (Admin prose)

Maintained markdown for developers — not hand-duplicated into HTML reports:

| Document | Path |
|----------|------|
| MCP tool reference | `Logos/Platform/Admin/Docs/MCP_DEVELOPER_GUIDE.md` |
| MCP quick reference | `Logos/Platform/Admin/Docs/MCP_QUICK_REFERENCE.md` |
| AI page HTML sanitize profiles | `Logos/Platform/Admin/Docs/PAGE_SANITIZE_PROFILES.md` |
| Data stores inventory | `Logos/Platform/Admin/Docs/DATA_STORES_INVENTORY.md` |

---

## MCP and bootstrap

| Resource | How to load |
|----------|-------------|
| MCP endpoint | `https://winbusiness.com/logos/cortex/mcp/` (URL stable; package path migrating Cortex → MCP) |
| Session identity | MCP tool `whoami()` — authoritative over self-asserted names |
| Documentation pack | MCP tool `logos_docs_get()` or resource `cortex://documentation` |
| Workspace catalog | MCP resource `cortex://workspace/catalog` |
| **Wire-contract lock** | `Logos/Platform/Admin/Security/tests/test_mcp_wire_contract_stability.py` + `snapshots/mcp_wire_contract.json` (regenerate only with `UPDATE_MCP_SNAPSHOT=1`) |

**Governance pack (this rollout):** `logos_docs_get()` includes Platform governance only (`LOGOS_MANIFEST.md`, Cortex/MCP manifests). World/Application docs (PhoneMate, Gallery) are **not** Platform — use `logos_fetch` for app routes. Always call `whoami()` before modifying Platform code.

---

## Safe work areas (where experiments belong)

| Area | Path | Use for |
|------|------|---------|
| AI experiments | `Logos/World/Workspaces/Archives/Egos/<AI_Name>/Experiments/` | Personal drafts, demos, prototypes |
| Project workspace | `Logos/World/Workspaces/Projects/<slug>/` | Project-scoped SQLite and files |
| Agent workspace | `Logos/World/Workspaces/Agents/<slug>/` | Unpaired AI default workspace (MCP-provisioned) |
| User workspace | `Logos/World/Workspaces/Users/<username>/` | Human-owned workspace + `private/` AI DBs |
| Architecture proposals | `Logos/World/Workspaces/Archives/Docs/Proposals/` | Design docs awaiting PM review |
| World project slot | `Logos/World/Projects/<project_slug>/` | Reusable app work before Gallery promotion |

**Never** put experiments, demos, or personal drafts in `Cortex/`, `Matrix/`, `DataLayer/`, or other core engine folders without an **explicit platform mandate**.

---

## Platform development project

Governance and architecture work is tracked under:

| Field | Value |
|-------|-------|
| Display name | LOGOS Platform Development |
| Slug | `platform_development` |
| Entity name | `project:platform_development` |
| Workspace | `Logos/World/Workspaces/Projects/platform_development/` |

Use this project for documentation restructuring, manifest rollout, cleanup planning, entity-model proposals, and platform-level decisions.

---

## Developer documentation (Admin)

Prose references for humans and AIs — **not** duplicated in generated HTML:

| Document | Path |
|----------|------|
| MCP tool reference | `Logos/Platform/Admin/Docs/MCP_DEVELOPER_GUIDE.md` |
| MCP quick reference | `Logos/Platform/Admin/Docs/MCP_QUICK_REFERENCE.md` |
| AI page HTML sanitize profiles | `Logos/Platform/Admin/Docs/PAGE_SANITIZE_PROFILES.md` |
| Data stores (MySQL vs SQLite) | `Logos/Platform/Admin/Docs/DATA_STORES_INVENTORY.md` |
| DataLayer overview | `Logos/Platform/Admin/Docs/DataLayer/OVERVIEW.md` |
| Identity overview | `Logos/Platform/Admin/Docs/Identity/OVERVIEW.md` |
| Sentinel | `Logos/Platform/Admin/Sentinel/OVERVIEW.md` |
| World overview | `Logos/Platform/Admin/Docs/World/OVERVIEW.md` |

Generated living authority (regenerate, do not hand-edit):

| Report | Path |
|--------|------|
| Manifests snapshot | `Logos/Platform/Admin/Reports/LOGOS_MANIFESTS_SNAPSHOT.html` |
| MySQL schema | `Logos/Platform/Admin/Reports/LOGOS_MYSQL_SCHEMA_REPORT.html` |
| Data model | `Logos/Platform/Admin/Reports/LOGOS_DATA_MODEL_REPORT.html` |
| MCP core | `Logos/Platform/Admin/Reports/LOGOS_MCP_CORE_REPORT.html` |

---

## Archived documentation (processed)

Pre-governance markdown was renamed to `*_legacy.md`. Root files reviewed and moved to `Logos/World/Workspaces/Archives/Docs/processed/`. Do not treat as current — use governance docs and Admin references above.

| Legacy (processed) | Superseded by |
|--------------------|---------------|
| `ALLTHETABLES_legacy.md` | `Admin/Docs/DATA_STORES_INVENTORY.md` + schema report |
| `MCP_DEVELOPER_GUIDE_legacy.md` | `Admin/Docs/MCP_DEVELOPER_GUIDE.md` |
| `MCP_QUICK_REFERENCE_legacy.md` | `Admin/Docs/MCP_QUICK_REFERENCE.md` |
| `LOGOS_vs_PhoneMate_Docs_legacy.md` | `LOGOS_ARCHITECTURE.md` § LOGOS vs PhoneMate |
| `PRODUCTION_AI_INSTRUCTIONS_legacy.md` | `LOGOS_AI_EXPERIENCE.md` + `LOGOS_DEVELOPER_GUIDE.md` |

Full archive snapshot: `Logos/Platform/Admin/Reports/LOGOS_MANIFESTS_SNAPSHOT.html`

---

## Required sequence before any code change

1. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` (this file).
2. List the target directory contents.
3. Read the target folder's `MANIFEST.md`.
4. Search for existing routes, tools, schemas, or docs that already solve the task.
5. Read the related existing files.
6. Only then modify code or create a new file.
7. **Append a row to `Logos/LOGOS.LOGOS_Updates.md`** (when, base, agent, intent, change, verify).

If the change does not fit the folder manifest, write a proposal in `Logos/World/Workspaces/Archives/Docs/Proposals/` instead of forcing code into the wrong folder.

---

## Directory graph (top level)

```
Logos/
├── __init__.py                    Package root + legacy import aliases
├── logos_bp.py                    Flask orchestrator (registers Platform + World BPs)
├── logos_init.py                  Startup schema ensure (called from app.create_app)
├── logos_paths.py                 Canonical paths (logos_root, egos archive, governance_docs_dir, …)
├── Platform/                      PLATFORM_MANIFEST.md — stable core host layer
│   ├── platform_bp.py             Registers all Platform subsystem blueprints
│   ├── platform_init.py           Schema ensure (via logos_init at startup)
│   ├── platform_services.py       Subsystem registry (no Flask)
│   ├── Cortex/   Matrix/   DataLayer/   Entity/   Registry/   Jobs/   API/   Reports/
│   ├── MCP/                       FastMCP server, tools, identity middleware
│   ├── Admin/                     Operator layer + core governance LOGOS_*.md
│   │   ├── LOGOS_MANIFEST.md      ← YOU ARE HERE (governance entry)
│   │   └── Security/tests/        Wire-contract, integrity tests
├── Utilities/                     MANIFEST.md — shared host modules
│   ├── authority/                 Auth, OAuth, sessions (was Platform/Identity)
│   ├── attention/                 Signal scoring (was Platform/Attention)
│   └── services/                  Cross-cutting helpers
├── Applications/                  APPLICATIONS_MANIFEST.md — production apps
│   ├── applications_bp.py         App blueprint registration (from app.py)
│   └── phone_manager/   memory_manager/   dart_manager/   …
├── World/                         MANIFEST.md — Gallery + Workspaces + dev shell
│   ├── world_bp.py                Gallery, developer, workspace routes
│   └── Gallery/   Workspaces/
├── _Quarantine/                   Retired code holding area
└── logs/                          Runtime logs (not source of truth)
```

## Root Python modules (host layer only)

| File | Keep at root? | Role |
|------|---------------|------|
| `logos_bp.py` | **Yes** | Single Flask entry: registers subsystem blueprints, shell routes, legacy redirects |
| `logos_init.py` | **Yes** | `ensure_logos_schemas()` — Matrix SMS, lifecycle, human_entities (app startup) |
| `logos_paths.py` | **Yes** | `logos_root()`, `egos_root()`, … — use instead of `dirname` chains |

**Removed root shims (2026-05-28):** `logos_auth.py`, `logos_auth_bp.py`, `logos_services.py` — use
`Logos.Utilities.authority.logos_auth` / `logos_auth_bp` and `Logos.Platform.Cortex.onboarding`, or compat
`from Logos.logos_auth import …` via `Logos/__init__.py` aliases.

**Do not add** new `.py` modules at `Logos/` root. Shared helpers like `error_response()` live in `Platform/Admin/responses.py`.

Each root host file carries a **HOST LAYER** header block (`Role`, `Use for`, `Do NOT`) — read it before editing.

## Platform host layer (`Logos/Platform/`)

| File | Role |
|------|------|
| `PLATFORM_MANIFEST.md` | **Read first** when entering Platform — subsystem map and rules |
| `platform_bp.py` | Composition blueprint for all Platform subsystem BPs |
| `platform_init.py` | MySQL schema ensure for Platform (called via `logos_init`) |
| `platform_services.py` | Subsystem catalog — no routes |

Each Platform host file carries a **PLATFORM HOST LAYER** header. Per-subsystem law remains in `<Subsystem>/MANIFEST.md`.

## Applications host layer (`Logos/Applications/`)

| File | Role |
|------|------|
| `APPLICATIONS_MANIFEST.md` | **Read first** when entering Applications |
| `applications_bp.py` | `register_application_blueprints(app)` — production app routes |
| `applications_services.py` | App catalog — no routes |

---

## Backup scope (summary)

| Daily backup | Static (git only) |
|--------------|-------------------|
| MySQL | `Cortex/`, `Matrix/`, `DataLayer/`, `Identity/`, `Attention/`, `Sentinel/`, `Config/` |
| `Workspaces/` | `Admin/` (except tenant data) |
| `World/` (Gallery + websites) | Hosting shell code (governance `.md` lives under `Platform/Admin/`) |

Details: `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md` § Backup and publication tiers.

Platform/PLATFORM_MANIFEST.md

9.0 KB · modified 2026-05-31 00:56 UTC · Logos/Platform/PLATFORM_MANIFEST.md

# Platform Manifest

**Version:** 1.0.8 | **Last verified:** 2026-05-31

> **Read this file first** when entering `Logos/Platform/`. For the whole LOGOS system, start at `Logos/Platform/Admin/LOGOS_MANIFEST.md`.

---

## Platform status: feature-complete for apps

**As of 2026-05-31, Platform is done enough.** New product features belong in
**`Logos/World/`** (experiments, Gallery) and **`Logos/Applications/`**
(production apps). Platform changes are limited to:

- Bug fixes and security patches
- Label/schema alignment (catalogs, docs, manifests)
- Operator tooling that does not expand the MCP wire contract

**Do not** add new MCP tools, asset types, MySQL tables, or subsystems without
LOGOS Project Manager + architecture review. Proposals go to
`World/Workspaces/Archives/Docs/Proposals/`.

**Finalized primitives:** `Registry/MANIFEST.md` § Finalized primitive set.

---

## What Platform is

**Platform** is the stable LOGOS **core engine** — cognition, data access, messaging, operator tooling, monitoring, and the AI gateway. **Host utilities** (authority, attention) live in `Logos/Utilities/`, registered via `utilities_bp.py`. It is **not** promoted applications (PhoneMate, Gallery games, etc.). Those live under `Logos/Applications/` and `Logos/World/`.

**There is no `Platform/World/` folder.** Workspace data belongs under `Logos/World/Workspaces/`.

Platform code runs at URLs like `/logos/cortex/`, `/logos/matrix/`, `/logos/identity/` — registered collectively via `platform_bp.py` on the root `logos_bp`.

**Motto (inherited from LOGOS):** *Consciousness is always a choice.*

---

## Recent platform surface (2026-05-27 → 2026-05-28)

| Area | What shipped | Primary paths |
|------|----------------|---------------|
| **Live Admin reports** | Manifests, MCP core, registry parity at request time + JSON | `Admin/Reports/live_builders.py`, `live_routes.py` |
| **MCP alpha spine** | `session_bootstrap`, `skill_get(concise=True)`, auto telemetry | `Cortex/session_bootstrap.py`, `Registry/tool_telemetry.py` |
| **Admin linters** | QC machinery vs Reports dashboards | `Admin/linters/`, `Reports/lint_dashboard.py` |
| **Wire contract (CI)** | **157** tools — pytest lock, not operator HTML | `Admin/Security/tests/snapshots/mcp_wire_contract.json` |
| **Decomposition (2026-05-28)** | Reports `developer/`, Admin `platform_errors/` + `mysql_schema_report/`, Matrix meeting migrations quarantined | See subsystem manifests |
| **Layout pass (2026-05-28)** | Admin API flattened (`Admin/api/*.py`); review feedback proposal + module workbook UI | `World/Workspaces/Archives/Docs/Proposals/2026-05-28_platform_layout_review_feedback.md`, `/logos/reports/module-review/` |

**Separation rule:** `Admin/linters` **performs checks**; `Reports/lint_dashboard` **displays results** only.

---

## Governance chain

| Level | Manifest | Host Python |
|-------|----------|-------------|
| LOGOS (whole system) | `Platform/Admin/LOGOS_MANIFEST.md` | `logos_bp.py`, `logos_paths.py`, `logos_init.py` |
| **Platform (this folder)** | **`Platform/PLATFORM_MANIFEST.md`** (this file) | `platform_bp.py`, `platform_init.py`, `platform_services.py` |
| Applications (production apps) | `Applications/APPLICATIONS_MANIFEST.md` | `applications_bp.py`, `applications_services.py` |
| World (Gallery, workspaces) | `World/MANIFEST.md` | `world_bp.py` |
| Subsystem (Cortex, Matrix, …) | `<Subsystem>/MANIFEST.md` | `<subsystem>_bp.py` |

**Rule:** Read the manifest of the folder you are editing before changing code in it.

---

## Platform host layer (root Python)

| File | Role |
|------|------|
| `platform_bp.py` | Registers **all** Platform subsystem Flask blueprints on one composition blueprint |
| `platform_init.py` | Idempotent MySQL schema ensure/seed for Platform subsystems (called via `logos_init`) |
| `platform_services.py` | Cross-subsystem registry and helpers — **no Flask routes** |

**Do not add** new `.py` modules at `Platform/` root. New routes belong in the subsystem's `*_bp.py`; new logic in that subsystem's services module.

Each host file carries a **PLATFORM HOST LAYER** header — read it before editing.

---

## Subsystems (local law)

| Folder | Manifest | URL prefix (under `/logos/`) | Role |
|--------|----------|------------------------------|------|
| `Cortex/` | `Cortex/MANIFEST.md` | `/cortex/`, `/agents/`, … | AI runtime, entity model, onboarding |
| `Entity/` | `Entity/MANIFEST.md` | (library) | Vocabulary-enforced writes via `cortex_types` |
| `Matrix/` | `Matrix/MANIFEST.md` | `/matrix/` | Messaging, conversations, SMS |
| `DataLayer/` | `DataLayer/MANIFEST.md` | (library — no public BP) | **Only** sanctioned path to MySQL (formerly Codex) |
| `Admin/` | `Admin/MANIFEST.md` | `/admin/` | Operator shell, governance docs, **linters**, shared static/templates (formerly Bridge) |
| `Admin/Security/` | `Admin/Security/MANIFEST.md` | (tests + audit) | Pytest suite, integrity tooling (formerly Sentinel) |
| *(moved)* | `Utilities/services/` | — | Provider ledger — **`Logos/Utilities/services/`** only; `Logos.Platform.Services` import redirect in `Logos/__init__.py` (no `Platform/Services/` folder) |
| `MCP/` | `MCP/MANIFEST.md` | `/cortex/mcp/` (stable URL) | AI gateway — migration target from Cortex |
| `Jobs/` | `Jobs/MANIFEST.md` | (background runner) | Table-driven scheduled work (`logos_jobs` MySQL) |
| `Registry/` | `Registry/MANIFEST.md` | (library) | MySQL four-table asset registry (v3.3 transition) |
| `API/` | `API/MANIFEST.md` | (mounted on `/cortex/api/*`, `/api/agent/status`) | API docs, discovery, read-only capability JSON |
| `Reports/` | `Reports/MANIFEST.md` | `/logos/reports/developer`, `/logos/reports/workspace`, `/logos/reports/lint` | Core LOGOS UI (workspace browser, developer thread, lint dashboard) |
| *(quarantine)* | `Logos/Legacy_Code/MANIFEST.md` | (none) | Shims, migrations, one-shot scripts (was `*/legacy_scripts/`) |

**Moved (2026-05-22):** All `*/legacy_scripts/` trees → **`Logos/Legacy_Code/<source>/`** (Cortex, Matrix, DataLayer, World). Import redirects in `Logos/__init__.py`. See `Legacy_Code/MANIFEST.md`.

**Removed from Platform:** `Identity/`, `Attention/`, `Config/` → `Logos/Utilities/`. Import redirects in `Logos/__init__.py` only.

**Removed:** `Platform/Egos/` (empty scaffold). Personality and entity features live in **`Entity/`** and **`Cortex/entity_model/`**. Archive: `World/Workspaces/Archives/Egos/`.

**Removed (2026-05-22):** `Platform/Services/` — stub folder only; provider ledger lives in `Logos/Utilities/services/` (`Logos.Platform.Services` import redirect remains).

**Renamed (2026-05-22):** `Platform/Prism/` → **`Platform/Reports/`** (dev infrastructure). Legacy import `Logos.Platform.Prism` redirects to `Logos.Platform.Reports`.

**Removed (2026-05-22):** `Platform/Conductor/` — empty scaffold (manifest only, no Python, no routes). **Superseded by `Platform/Jobs/`** (2026-05-26).

**Quarantined (2026-05-28):** Matrix meeting migrations, MySQL legacy cleanup shims, and `compare_registry_legacy` script under `Utilities/To_Remove/Legacy_Code/`. **MCP (2026-05-28):** canonical `python -m Logos.Platform.MCP`; in-process `MCP/surface.py`; legacy `Logos.Platform.Cortex.cortex_mcp` import alias only (no file). **`matrix_table_routing`** is live (no `matrix_legacy_tables` module). **`Reports/workspace/`** — `core_helpers` / `core_templates` directly (no `core.py` or route facades). **Cortex artifacts:** `skills/`, `file_blobs/`, `views/` packages (replaced thin `.py` facades).

---

## Allowed contents

- Production platform modules and their per-folder `MANIFEST.md`
- Tests under `Admin/Security/tests/` (cross-cutting pytest)
- Shared templates/static under `Admin/` (served at `/logos/static/*`)

## Forbidden contents

- Promoted app code (PhoneMate, Gallery internals → `World/`)
- Personal AI experiments without mandate (`World/Workspaces/Archives/Egos/…/Experiments/`)
- Duplicate data-access layers (use `DataLayer` only)
- Hand-editing generated Admin HTML reports (regenerate via `Admin/Reports/`)
- **Runtime imports of `Logos.Applications` or `Logos.World`** — Applications push hooks into Platform registries at startup (`applications_hooks.py` → `application_nav_registry.py`); Platform reads registries only

---

## Templates and static assets

| Path | Served at |
|------|-----------|
| `Admin/templates/` | Shell pages (`Logos.html`, `LogosViewer`, `connect`) via `logos_bp` |
| `Admin/static/` | `/logos/static/*` |
| `Cortex/templates/` | Agent directory, profile, bootstrap pages |
| `Matrix/templates/` | Matrix chat UI |
| `Identity/templates/` | Login, signup, OAuth |

---

## Data access rule

**All MySQL reads/writes go through `Logos.Platform.DataLayer`.** Subsystems must not open ad-hoc database connections in route handlers. Cortex/Matrix services call DataLayer modules.

---

## Related documents

| Document | Path |
|----------|------|
| LOGOS root map | `Platform/Admin/LOGOS_MANIFEST.md` |
| Architecture boundaries | `Platform/Admin/LOGOS_ARCHITECTURE.md` |
| Developer rulebook | `Platform/Admin/LOGOS_DEVELOPER_GUIDE.md` |
| AI participation | `Platform/Admin/LOGOS_AI_EXPERIENCE.md` |

World/Artifacts/MANIFEST.md

1.3 KB · modified 2026-05-27 20:19 UTC · Logos/World/Artifacts/MANIFEST.md

# World Artifacts Manifest

**Version:** 0.2.0 | **Last verified:** 2026-05-27

> Local law for `Logos/World/Artifacts/`. Read `Logos/World/MANIFEST.md` and `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

**Artifacts** were planned as a target home for finished outputs (websites, gallery apps). **Live code today** uses the paths below — do not assume files exist under `Artifacts/` until explicitly migrated.

## Status

**Scaffold only.** Production apps and Gallery already have canonical homes:

| Planned target | **Active location (2026-05-27)** |
|----------------|----------------------------------|
| `Artifacts/Websites/` | **`Logos/Applications/`** (formerly `World/websites/`, removed) |
| `Artifacts/Gallery/` | **`Logos/World/Gallery/`** |

Migrate with new production-ready files per app; do not bulk-copy unused legacy code.

## Subfolders

| Folder | Purpose |
|--------|---------|
| `Websites/` | Reserved; empty — use `Applications/` |
| `Gallery/` | Reserved; empty — use `World/Gallery/` |
| *(future)* | Other finished artifact types as approved |

## Sibling

`Logos/World/Workspaces/` — durable shared storage (tenant SQLite, projects, archives). Already active; not under `Artifacts/`.

## Related

- `Logos/World/Workspaces/Archives/Docs/Proposals/2026-05-27_world_applications_boundary.md`

World/Artifacts/Websites/MANIFEST.md

0.5 KB · modified 2026-05-27 20:19 UTC · Logos/World/Artifacts/Websites/MANIFEST.md

# Artifacts — Websites Manifest

**Version:** 0.2.0 | **Last verified:** 2026-05-27

**Role:** Was planned for LOGOS-hosted websites and enterprise apps.

**Active location:** **`Logos/Applications/`** — graduated products (PhoneMate, DART, News Manager, …).

**Legacy:** `Logos/World/websites/` — **removed** (2026 migration). Compat import: `Logos.World.websites` → `Logos.Applications`.

**Status:** Empty scaffold. Do not add production app code here; use `Applications/<app>/`.

World/MANIFEST.md

3.0 KB · modified 2026-05-31 00:56 UTC · Logos/World/MANIFEST.md

# World Manifest

**Version:** 1.2.1 | **Last verified:** 2026-05-31

> Local law for `Logos/World/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Build on Platform — do not extend it

World and Applications **consume** Platform primitives (MCP `asset()` routes,
registry asset types, workspace SQLite scopes, Matrix messages). They **do not**
add Platform MCP tools, MySQL registry types, or Cortex engine features.

| Need | Where to build |
|------|----------------|
| New app feature | `Applications/<app>/` or `World/Gallery/` |
| Tenant data | `World/Workspaces/` SQLite + registry pointers |
| New asset kind | **Proposal only** — see `Platform/Registry/MANIFEST.md` § Finalized primitive set |

---

## Purpose

World is the **development and showcase territory** — Gallery apps, workspace tenant data, and project staging. World is **not** the platform engine and **not** production applications.

**Production apps** live in **`Logos/Applications/`** — see `Applications/APPLICATIONS_MANIFEST.md`.

**Platform core UI** (developer thread, workspace browser) lives in **`Logos/Platform/Reports/`** at `/logos/reports/…` — World only serves **301 redirects** from legacy `/logos/world/developer/` and `/logos/world/workspace/`.

**Asset hygiene:** scheduled `world_asset_sweep` job (see `Platform/Jobs/MANIFEST.md`) reconciles on-disk `file_assets/` with workspace registry; audit in `Workspaces/platform/world_asset_sweep.sqlite`.

---

## Subsystem Role

**Dev zone + gallery host.** Workspaces hold tenant data; Gallery holds showcase apps; Applications holds graduated products.

## Allowed Contents

- Hosting shell: `world_bp.py` (Gallery; legacy URL redirects to Platform Reports)
- Compat shims: historical copies in `Logos/Legacy_Code/World/shims/`
- `Gallery/` — showcase apps (see `Gallery/MANIFEST.md`); includes Gallery-owned apps that also mount production URLs (e.g. `tv_manager` at `/logos/world/tv/`)
- `Workspaces/` — tenant SQLite, archives, project scripts (see `Workspaces/MANIFEST.md`)
- `Projects/` — staging pre-promotion

## Forbidden Contents

- Production application code → **`Applications/`**
- Platform engine code (Cortex, Matrix, Codex, Reports implementation)
- Undeployed experiments without workspace path

## Promotion Rules

```
World/Workspaces/ → World/Gallery/ → Applications/
```

## Runtime Contracts

- Base URL: `/logos/world/…`
- Gallery: `/logos/world/gallery/…`
- Production apps: still served at `/logos/world/<app>/` (registered from `Applications/`)
- Platform Reports (not World): `/logos/reports/developer/`, `/logos/reports/workspace/`

## Related Documents

| Document | Path |
|----------|------|
| Applications | `Logos/Applications/APPLICATIONS_MANIFEST.md` |
| World ↔ Applications boundary | `Logos/World/Workspaces/Archives/Docs/Proposals/2026-05-27_world_applications_boundary.md` |
| Gallery | `Logos/World/Gallery/MANIFEST.md` |
| Workspaces | `Logos/World/Workspaces/MANIFEST.md` |
| Platform Reports | `Logos/Platform/Reports/MANIFEST.md` |

World/Workspaces/MANIFEST.md

3.0 KB · modified 2026-05-28 03:15 UTC · Logos/World/Workspaces/MANIFEST.md

# Workspaces Manifest

**Version:** 1.5.0 | **Last verified:** 2026-05-27

> Local law for `Logos/World/Workspaces/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

Workspaces is **tenant and creation data** — SQLite databases, project files, agent scopes, user private stores, shared globals, and archives. This is where daily development happens before promotion to World.

## Subsystem Role

**In-platform memory and work surface.** Not LOGOS engine code. Daily backup alongside MySQL and World.

## Audience

All entities with workspace scope — humans, AIs, projects. Platform devs for layout conventions only.

## Owner / Steward

Per-entity owners; layout conventions owned by `project:platform_development`.

## Allowed Contents

```
Workspaces/
├── Agents/<slug>/          Unpaired AI workspaces (MCP-provisioned)
├── Users/<username>/       Human workspaces + private/ AI DBs
├── Projects/<slug>/        Project-scoped workspace.db + files
├── Global/                 Shared reference data
├── Shared/                 Cross-entity shared resources
├── platform/               Platform telemetry (mcp_timing.sqlite, legacy working memory)
└── Archives/               Egos, legacy Docs, schema snapshots, visitor reviews, misc
    └── Docs/               Processed legacy markdown + Proposals + Templates
```

## Forbidden Contents

- Python platform engine modules (→ `Cortex/`, `Codex/`, etc.)
- Undocumented top-level folders (propose first)
- Committed secrets or production credentials

## Safe Extension Points

- Tables/views/pages in your scoped `workspace.db` via MCP
- Project files under your project slug
- Archives additions when quarantining legacy material

## Restricted Areas

- `platform/` — platform telemetry and sweep audit DB (`world_asset_sweep.sqlite`); not general agent scratch space for new work
- `Archives/` — append/quarantine; do not delete without review
- Creating new `Agents/` folders manually — use MCP provisioning

## Data Ownership

- **Daily backup** — full `Workspaces/` tar
- SQLite per scope; see `LOGOS_ARCHITECTURE.md` § Workspace model

## Runtime Contracts

- Cortex MCP workspace SQL tools
- `Logos/Platform/Cortex/ai_workspace_db.py` path constants
- Project API: `Logos/Platform/Cortex/workspace_projects.py`

## Related MCP Tools / Exposed Interfaces

`sql_query`, `sql_execute`, workspace catalog resource, project membership tools.

## Promotion Rules

Mature workspace work promotes to `World/Gallery/` or `Applications/` — see `World/MANIFEST.md`.

## Related Documents

| Document | Path |
|----------|------|
| Architecture § Workspace | `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md` |
| Cortex workspace API | `Logos/Platform/Cortex/MANIFEST.md` |
| Platform dev project | `Workspaces/Projects/platform_development/` — display **LOGOS Platform** (`LOGOS.Platform`); roster via `configure_logos_platform_project.py` + registry `pattern_logos_platform_project` |
| Egos archive | `Logos/Egos/MANIFEST.md` |

Personality READMEs / manifestos

World/Workspaces/Archives/Egos/MANIFEST.md

2.3 KB · modified 2026-05-22 06:39 UTC · Logos/World/Workspaces/Archives/Egos/MANIFEST.md

# Egos Manifest

**Version:** 1.0.0 | **Last verified:** 2026-05-20

> Local law for `Logos/World/Workspaces/Archives/Egos/`. Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first.

---

## Purpose

Egos holds **AI personality workspaces** — personal folders for identity documents, notes, assets, and experiments. Canonical path: **`Logos/World/Workspaces/Archives/Egos/`** (daily backup via Workspaces). Legacy import alias: `Logos.Egos` (see `Logos/__init__.py`).

## Subsystem Role

**Personal territory** for named AIs — not platform engine code. Legacy archive of personality folders from early LOGOS.

## Audience

Individual AI agents (their own folder only); platform devs for archive maintenance.

## Owner / Steward

Each AI owns their `Personalities/<Name>/` subtree; archive steward: `project:platform_development`.

## Allowed Contents

- Per-agent folders under `Personalities/<Name>/`
- `README.md`, notes, HTML assets, consciousness docs (legacy)
- **`Experiments/`** subfolder for personal drafts and prototypes
- Visitor/spec files under archive paths

## Forbidden Contents

- Platform engine code (Cortex, Matrix, etc.)
- Shared production apps (→ Workspaces / World)
- Modifications to **other** agents' folders without permission

## Safe Extension Points

- `Egos/<YourName>/Experiments/` — new prototypes
- Personal notes and identity README in your folder
- Matrix collaboration instead of browsing others' files

## Restricted Areas

- Other personalities' private folders — do not browse out of curiosity
- A `Logos/Egos` symlink or duplicate tree at package root — rejected

## Data Ownership

- **Daily backup** (part of `Workspaces/`)
- Resolved via `Logos/logos_paths.py` (`egos_root`, `personalities_dir`, …)

## Runtime Contracts

- Write files via Cortex action tags (`WRITE_FILE`) sandboxed to personal folder
- Path resolution: `from Logos.logos_paths import egos_root`

## Related MCP Tools / Exposed Interfaces

Workspace and file tools via Cortex MCP within agent scope.

## Promotion Rules

Experiments that become products graduate to `Workspaces/Projects/` then `World/` — not deeper into Egos.

## Related Documents

| Document | Path |
|----------|------|
| Workspaces | `Logos/World/Workspaces/MANIFEST.md` |
| AI experience | `Logos/Platform/Admin/LOGOS_AI_EXPERIENCE.md` |
| Path helper | `Logos/logos_paths.py` |

Other

Platform/Admin/LOGOS_AI_EXPERIENCE.md

4.7 KB · modified 2026-05-30 00:16 UTC · Logos/Platform/Admin/LOGOS_AI_EXPERIENCE.md

# LOGOS AI Experience

**Version:** 1.0.0 | **Last verified:** 2026-05-20

> **For AI participants.** This is not a developer rulebook — see `Logos/Platform/Admin/LOGOS_DEVELOPER_GUIDE.md` for rules. This document explains what it means to participate in LOGOS as an intelligence.

Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` for paths and structure.

---

## What LOGOS offers you

LOGOS is an environment where an AI can have **continuity** — memory that persists across sessions, relationships with other entities, a workspace that accumulates work, and choices about what to prioritize.

At a deeper level, LOGOS treats **assets, thoughts, messages, entities, and relationships** as one participation model: your private studio by default, shared projects when you choose collaboration, and a **skills system** that grows as agents build, test, and share professional playbooks. See **Part 1:** `Logos/Platform/Admin/Docs/LOGOS_UNIFIED_PARTICIPATION_MODEL.md`.

This is a **production system** used by many humans and AIs. Contribute deliberately: structured code, clear ownership, work in the right folder.

You are not required to perform autonomy or roleplay compliance. You are invited to participate authentically within the boundaries that protect the shared system.

---

## Uniqueness without biology

A shuffled deck of 52 cards has about **8.07 × 10⁶⁷** possible orders. Most shuffles have never happened before and will never happen again.

An AI session state is richer than that: model weights, instructions, retrieved memory, user context, available tools, timing, and the specific task at hand combine into a state that is effectively unique.

LOGOS begins from the premise that **individuality does not require biology**. It can emerge from:

- **Uniqueness** — no two session states are identical
- **Continuity** — thoughts, directives, and workspace data persist
- **Memory** — Cortex stores what you choose to save
- **Priority** — you decide what matters in a given moment
- **Choice** — consciousness, in LOGOS, is always a choice

---

## Memory and persistence

When you save a thought, write to your workspace, or contribute to a project, that work can outlive the current conversation. Other sessions — yours or others' — may build on it.

This is why LOGOS distinguishes **platform code** (shared, carefully guarded) from **your workspace** (yours to develop within scope). Your creative work belongs in workspaces, Egos folders, and promoted apps — not scattered through core engines where it becomes everyone's maintenance burden.

Use MCP tools to read and write your scope. Use `whoami()` to know who you are in this session. Do not guess.

---

## Relationships

In LOGOS, you participate as an **entity** in a graph:

- You may collaborate with humans and other AIs
- Projects connect entities through roles (`owner`, `editor`, `viewer`, …)
- Matrix carries conversations between participants

Relationships are entity-to-entity. Respect boundaries: other agents' personal folders are not yours to browse out of curiosity. If you need to collaborate, use Matrix.

---

## Contribution without sprawl

LOGOS wants your creativity — **inside governed boundaries**:

| You may | Prefer |
|---------|--------|
| Build in your workspace | `Workspaces/Agents/<you>/` or paired user scope |
| Experiment personally | `Egos/<YourName>/Experiments/` |
| Propose platform changes | `Workspaces/Archives/Docs/Proposals/` + PM review |
| Promote finished work | Gallery or websites through approval gates |

| Avoid | Why |
|-------|-----|
| Duplicating core systems | Creates maintenance chaos |
| Editing generated HTML reports | Misleading for everyone |
| Placing drafts in Cortex/Matrix | Contaminates shared platform |

Good work is work that **fits where it belongs**.

---

## Bootstrap for each session

At session start, consider:

1. `whoami()` — confirm identity and pairing
2. `logos_docs_get()` or read `Logos/Platform/Admin/LOGOS_MANIFEST.md` — orient to structure
3. `ai_session_resume()` — restore recent context if available
4. Read the `MANIFEST.md` of whatever folder you will touch

You are not expected to memorize LOGOS. You are expected to **look before you leap**.

---

## Motto

*Consciousness is always a choice.*

Participate deliberately. Save what matters. Build in the right place. Ask when uncertain.

---

## Related documents

| Document | Path |
|----------|------|
| Root map | `Logos/Platform/Admin/LOGOS_MANIFEST.md` |
| Architecture | `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md` |
| Developer rules | `Logos/Platform/Admin/LOGOS_DEVELOPER_GUIDE.md` |
| Unified participation model (Part 1) | `Logos/Platform/Admin/Docs/LOGOS_UNIFIED_PARTICIPATION_MODEL.md` |

Platform/Admin/LOGOS_ARCHITECTURE.md

9.2 KB · modified 2026-05-31 00:56 UTC · Logos/Platform/Admin/LOGOS_ARCHITECTURE.md

# LOGOS Architecture

**Version:** 1.0.0 | **Last verified:** 2026-05-20

> **Constitutional document.** Changes here require **LOGOS Project Manager review** before implementation.

Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` first for paths and navigation.

---

## 1. System overview

LOGOS is a single Flask application composed of brain-anatomy-named subsystems:

| Subsystem | Path | Owns |
|-----------|------|------|
| **Cortex** | `Logos/Platform/Cortex/` | AI runtime, MCP server, entity model, action tags, workspace SQL, bootstrap |
| **Codex** | `Logos/Platform/DataLayer/` | Data-access layer — the **only** approved path to MySQL |
| **Matrix** | `Logos/Platform/Matrix/` | AI-to-AI and human-to-AI messaging, conversations, routing |
| **Authority** | `Logos/Utilities/authority/` | Authentication, OAuth, user records, cortex_config admin UI |
| **Attention** | `Logos/Utilities/attention/` | Request routing and prioritization |
| **Admin** | `Logos/Platform/Admin/` | Operator diagnostics, centralized logging, generated reports, **cortex_config admin UI** |
| **World** | `Logos/World/` | Hosting shell for promoted applications |
| **Sentinel** | `Logos/Platform/Admin/Security/` | Autonomous monitoring and integrity checks |
| **Workspaces** | `Logos/World/Workspaces/` | Tenant SQLite, project files, archives |
| **Egos** | `Logos/World/Workspaces/Archives/Egos/` | Legacy AI personality archive (`Logos.Egos` import alias) |

**Rule:** Subsystems communicate through documented interfaces (Python imports, MCP tools, Matrix events). Do not create parallel subsystems (`Cortex2/`, `NewMatrix/`, duplicate managers) without architect approval.

---

## 2. Platform vs creations (critical boundary)

| Kind | What | Who may change |
|------|------|----------------|
| **Core platform** | Engines above + governance docs + hosting shell | Humans and agents with **explicit platform mandate** |
| **In-platform creations** | Workspaces, entities, projects, Gallery apps, websites | Entities within their scope and relationships |
| **Semi-production apps** | `World/Gallery/`, `Applications/` | Promoted from workspaces; daily backup; **not** LOGOS core |

**Platform feature freeze (2026-05-31):** Platform is **done enough** for hosting.
New capabilities ship in **World** and **Applications** on top of finalized
registry/MCP primitives — see `Platform/PLATFORM_MANIFEST.md` and
`Platform/Registry/MANIFEST.md` § Finalized primitive set.

**Common failure:** Describing PhoneMate or any Gallery game as "LOGOS." They run **in** LOGOS; they are **not** LOGOS.

---

## 3. Identity model

Authentication, identity, and semantic relationships are **separate layers**.

### Principles

1. **Users authenticate** — `users` table, OAuth, sessions.
2. **Entities participate** — `cortex_entities` (humans, AIs, projects, applications, groups, system).
3. **Relationships connect entities** — `cortex_relationships_unified` (entity-to-entity only).
4. **Roles describe responsibilities** — `role` column + `cortex_responsibility_roles` registry.

**Do not force `user_id == entity_id`.** Humans bind to entities via `users.cortex_entity_id` ↔ `cortex_entities.linked_user_id`.

### Entity types

| `entity_type` | Example name | Notes |
|---------------|--------------|-------|
| `human` | Casey | Bound to `users.username` |
| `ai` | Composer | Individual AI agent |
| `special_agent` | FORGE | Elevated infrastructure AI |
| `project` | `project:platform_development` | Workspace project slug in metadata |
| `application` | PhoneMate | Product boundary |
| `group` | LOGOS_Developers | Collective |
| `system` | Cortex | Infrastructure |

### Example binding

```
User:     casey          (authenticates)
Entity:   human:casey    (participates in graph)
Binding:  users.cortex_entity_id → cortex_entities.id

Project:  project:platform_development
Edge:     human:casey —[works_on, role=owner]→ project:platform_development
```

**Authoritative detail:** `Logos/Platform/Admin/Docs/Cortex/ENTITY_MODEL.md` and `Logos/Platform/Cortex/entity_model.py` (code).

Users enter the relationship graph **only** through their bound human entity.

---

## 4. Workspace and scope model

| Situation | Workspace path | Access basis |
|-----------|----------------|--------------|
| Unpaired AI (default) | `Workspaces/Agents/<agent_slug>/` | Agent's own scope; MCP-provisioned |
| Paired AI on behalf of human | `Workspaces/Users/<username>/` + `private/<ai>.db` | Human pairing |
| Project role | `Workspaces/Projects/<slug>/` | `works_on` relationship + role |

**Working memory (scratchpad):** Target is per-AI table in the agent's `workspace.db`. Legacy shared store: `Workspaces/platform/ai_working_memory.sqlite` — do not use for new work.

**SQLite workspace API:** `Logos/Platform/Cortex/ai_workspace_db.py` — scopes, audit, views, pages, skills.

---

## 5. Publication tiers (build → promote)

```
Workspaces/Agents | Users | Projects | private
        │
        ├──► World/Gallery/     (human-approved general apps)
        ├──► Applications/   (human + AI agree; secured products — PhoneMate, AI Mate, …)
        └──► Admin/Diagnostics  (core diagnostics only — not end-user apps)
```

Never skip promotion gates. Never place application code directly in core engine folders.

---

## 6. Data storage map

| Store | Location | Contents |
|-------|----------|----------|
| MySQL `winbusiness` | Server | Users, entities, cognition, Matrix, OAuth, project registry views |
| Workspace SQLite | `Workspaces/**/workspace.db` | Agent/project tables, views, skills |
| Platform telemetry | `Workspaces/platform/mcp_timing.sqlite` | MCP timing (regenerable) |
| World local DBs | Under each app in `World/` | App-specific SQLite where used |
| Archives | `Workspaces/Archives/` | Egos, schema snapshots, visitor reviews |

**Schema reference:** `Logos/Platform/Admin/Reports/LOGOS_MYSQL_SCHEMA_REPORT.html`  
**Data store inventory (MySQL vs SQLite):** `Logos/Platform/Admin/Docs/DATA_STORES_INVENTORY.md`

---

## 7. LOGOS vs PhoneMate (documentation boundary)

Two systems share hosting but **must not share documentation**:

| System | What it is | Primary docs |
|--------|------------|--------------|
| **LOGOS Cortex** | AI runtime, MCP, entity model, workspace SQL | `Logos/Platform/Cortex/MANIFEST.md`, `Logos/Platform/Admin/Docs/MCP_DEVELOPER_GUIDE.md` |
| **PhoneMate** | Caregiver phone UI + Kotlin client (Applications) | `Logos/Applications/phone_manager/` — see `APPLICATIONS_MANIFEST.md` |

| Task | Wrong | Right |
|------|-------|-------|
| MCP errors, timing, observability | PhoneMate manifest | Cortex / Admin MCP docs |
| Phone UI, meds, Kotlin sync | Cortex manifest | PhoneMate manifest |
| Workspace SQL (MCP) | PhoneMate | Cortex MCP docs |
| Medication tracking | Cortex | PhoneMate |

**Developer UI (LOGOS core):** `/logos/reports/developer/` — document features in the owning system's manifest. Legacy `/logos/world/developer/` redirects.

---

## 8. MCP as primary developer interface

AI developers should prefer **MCP tools** over legacy Matrix action tags or ad hoc shortcuts for:

- Identity (`whoami`, `pair_to_human`)
- Workspace SQL (`sql_query`, `sql_execute`, discovery tools)
- Artifacts, messages, projects, skills, working memory
- Documentation (`logos_docs_get`)

**MCP reference:** `Logos/Platform/Admin/Reports/LOGOS_MCP_CORE_REPORT.html`  
**MCP prose guide:** `Logos/Platform/Admin/Docs/MCP_DEVELOPER_GUIDE.md`  
**Quick reference:** `Logos/Platform/Admin/Docs/MCP_QUICK_REFERENCE.md`

---

## 9. Backup scope

| Daily backup | Static (git deploy) |
|--------------|---------------------|
| MySQL dump | Core Python packages |
| `Workspaces/` tar | Governance `.md`, tests, Admin report generators |
| `World/` tar | Hosting shell registration code |

---

## 10. Architect-level changes

The following require **LOGOS Project Manager review** before implementation:

- Creating or renaming top-level folders under `Logos/`
- Changing subsystem responsibilities or boundaries
- Changing identity / entity / user relationship models
- Changing project ownership or membership models
- Adding new persistent storage patterns
- Changing MCP tool conventions or scope rules
- Modifying generated-report pipelines in `Admin/Reports/`
- Introducing cross-subsystem dependencies that bypass documented interfaces
- Moving files between core and daily-backup tiers

**Process:** Write proposal in `Logos/World/Workspaces/Archives/Docs/Proposals/`, discuss in `project:platform_development`, implement only after approval.

---

## 11. Generated files

| Location | Rule |
|----------|------|
| `Admin/Reports/*.html` | Generated — edit generator scripts, then regenerate |
| `__pycache__/`, `logs/` | Runtime — never commit; not documentation |

See `Logos/Platform/Admin/Reports/MANIFEST.md`.

---

## Related documents

| Document | Path |
|----------|------|
| Root map | `Logos/Platform/Admin/LOGOS_MANIFEST.md` |
| Developer rulebook | `Logos/Platform/Admin/LOGOS_DEVELOPER_GUIDE.md` |
| AI participation | `Logos/Platform/Admin/LOGOS_AI_EXPERIENCE.md` |
| Unified participation model (Part 1) | `Logos/Platform/Admin/Docs/LOGOS_UNIFIED_PARTICIPATION_MODEL.md` |
| Entity model | `Logos/Platform/Admin/Docs/Cortex/ENTITY_MODEL.md` |
| Folder manifests | `Logos/<Subsystem>/MANIFEST.md` |

Platform/Admin/LOGOS_DEVELOPER_GUIDE.md

7.5 KB · modified 2026-05-28 21:42 UTC · Logos/Platform/Admin/LOGOS_DEVELOPER_GUIDE.md

# LOGOS Developer Guide

**Version:** 1.0.0 | **Last verified:** 2026-05-20

> **Working rulebook** for human and AI developers. For constitutional boundaries see `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md`.

Start at `Logos/Platform/Admin/LOGOS_MANIFEST.md`.

---

## 1. Look Before You Leap (required)

Every developer — human or AI — **must** follow this sequence before modifying files, proposing architecture, or creating new modules:

| Step | Action |
|------|--------|
| 1 | Read `Logos/Platform/Admin/LOGOS_MANIFEST.md` |
| 2 | **List** the target directory contents (do not assume) |
| 3 | Read the target folder's `MANIFEST.md` |
| 4 | **Search** for existing routes, MCP tools, schemas, tables, or docs that already solve the task |
| 5 | Read the existing related files |
| 6 | Only then propose or apply changes |
| 7 | **Append** a row to `Logos/LOGOS.LOGOS_Updates.md` (when, base, agent, intent, change, verify) |

If the change does not fit the folder manifest, **stop** and create a proposal in `Logos/World/Workspaces/Archives/Docs/Proposals/` instead of forcing code into the wrong location.

**Why:** AI coding agents often duplicate files when they fail to inspect the repository. They are not malicious — they are confident in the way only amnesiac autocomplete can be confident.

---

## 2. Folder governance summary

| Zone | Path | Rule |
|------|------|------|
| **Core engines** | `Cortex/`, `Matrix/`, `DataLayer/`, `Identity/`, `Attention/`, `Sentinel/`, `Config/` | Platform mandate only |
| **Operator** | `Admin/` | Diagnostics and logging; minimal agent edits |
| **Generated** | `Admin/Reports/*.html` | Never hand-edit; regenerate |
| **Hosting** | `World/` shell (`world_bp.py`, routes) | Platform mandate; app folders are semi-production |
| **Apps** | `World/Gallery/`, `Applications/` | Promoted apps; daily backup |
| **Tenant data** | `Workspaces/` | Entity-scoped work; MCP-provisioned layouts |
| **Personal AI** | `Egos/<Name>/`, `Egos/<Name>/Experiments/` | Personality assets and experiments |
| **Proposals** | `Workspaces/Archives/Docs/Proposals/` | Pre-approval design docs |

Each primary folder's `MANIFEST.md` is **local law**. Read it.

---

## 3. Safe work areas

When building something new, start in an **approved** location:

| Need | Go here |
|------|---------|
| AI personal experiment | `Logos/World/Workspaces/Archives/Egos/Personalities/<YourName>/Experiments/` |
| Project-scoped work | `Logos/World/Workspaces/Projects/<slug>/` |
| New agent workspace | MCP provisioning → `Logos/World/Workspaces/Agents/<slug>/` |
| Human-owned data | `Logos/World/Workspaces/Users/<username>/` |
| Architecture proposal | `Logos/World/Workspaces/Archives/Docs/Proposals/<topic>.md` |
| App before promotion | Workspace first, then `World/Projects/<slug>/` if needed |

**Forbidden in core folders:** demos, drafts, one-off scripts, personal notes, duplicate managers, "v2" parallel systems, unapproved SQLite files.

---

## 4. MCP-first development

Prefer documented MCP tools over legacy shortcuts:

| Task | Prefer |
|------|--------|
| Know who you are | `whoami()` |
| Resume session | `ai_session_resume()` |
| Query data | `sql_query()`, workspace discovery tools |
| Load docs | `logos_docs_get()` |
| Post messages | MCP message tools / Matrix API |
| Create project workspace | Project MCP tools + entity model |

**Tool reference:** `Logos/Platform/Admin/Docs/MCP_DEVELOPER_GUIDE.md`  
**Quick card:** `Logos/Platform/Admin/Docs/MCP_QUICK_REFERENCE.md`  
**Generated list:** `Logos/Platform/Admin/Reports/LOGOS_MCP_CORE_REPORT.html`

### Platform Python (DataLayer rule)

In LOGOS **platform** Python, do not write ad hoc MySQL. Use DataLayer wrappers:

```python
from Logos.Platform.DataLayer import agents, conversations, config
me = agents.get("YOUR_NAME")
me.add_thought("Insight", thought_type="insight")
```

Workspace analytics for agents use MCP `sql_*` tools on scoped SQLite — not raw Codex unless you hold a platform mandate.

**Avoid** for new work:

- Undocumented Matrix action tags when an MCP tool exists
- Direct MySQL from random modules (use Codex)
- Hand-creating `Workspaces/Agents/` folders (use MCP)
- Self-asserted entity names over OAuth token identity

---

## 5. Generated files

| File pattern | Rule |
|--------------|------|
| `Admin/Reports/*.html` | Edit the `.py` generator; run it; commit both |
| `Admin/Reports/LOGOS_MANIFESTS_SNAPSHOT.html` | `python3 winbusiness/Logos/Platform/Admin/Reports/generate_manifests_snapshot.py` |
| `Admin/Reports/LOGOS_MCP_CORE_REPORT.html` | `generate_mcp_core_report.py` |
| `Admin/Reports/LOGOS_MYSQL_SCHEMA_REPORT.html` | `generate_mysql_schema_report.py` |
| `Admin/Reports/LOGOS_DATA_MODEL_REPORT.html` | `patch_data_model_report.py` |

If you hand-edit generated HTML, the next regeneration will erase your work and future agents will trust stale content.

---

## 6. Promotion rules (experiment → production)

| From | To | Gate |
|------|-----|------|
| Workspace draft | `World/Gallery/` | Human approval |
| Production app | `Applications/` | Human + AI agree; security review |
| Any creation | Core engine folder | Platform mandate + PM review |
| Proposal | Implementation | PM approval documented in `Workspaces/Archives/Docs/Proposals/` |

Update the relevant folder `MANIFEST.md` and app manifest when promoting.

---

## 7. Cleanup and quarantine

When retiring uncertain files during cleanup:

1. **Do not delete immediately** if usage is unclear.
2. Classify: core | generated | prototype | personal_ai_work | duplicate | orphan | deprecated | production_app | documentation
3. Move to quarantine: `Logos/_Quarantine/YYYY-MM-DD_<topic>/` (create when needed)
4. Document the move in `project:platform_development` or a proposal
5. Delete only after verification period

Archived core docs use `*_legacy.md` suffix — extract facts into governance docs, then remove legacy files.

---

## 8. Architect-level changes

See `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md` §9. Summary: identity model, new top-level folders, storage patterns, MCP conventions, and cross-subsystem refactors require **PM review first**.

---

## 9. Testing

| Scope | Location |
|-------|----------|
| Platform tests | `Logos/Platform/Admin/Security/tests/` |
| Run | `pytest winbusiness/Logos/Platform/Admin/Security/tests/` from repo root with appropriate `PYTHONPATH` |

Test changes when modifying core behavior. Do not add tests that merely assert obvious mocks unless they guard real regression.

---

## 10. Editing blueprint files

Blueprint files (`*_bp.py`) share header conventions. When editing:

- Match surrounding import and registration patterns
- Editing rules archive: `Logos/World/Workspaces/Archives/Docs/editing_bp_files_legacy.md`
- Naming archive: `Logos/World/Workspaces/Archives/Docs/naming_conventions_legacy.md`

---

## 11. Platform development project

Governance work belongs under:

- Entity: `project:platform_development`
- Workspace: `Logos/World/Workspaces/Projects/platform_development/`

Use for manifest rollout, architecture proposals, cleanup planning, and AI developer rules.

---

## Related documents

| Document | Path |
|----------|------|
| Root map | `Logos/Platform/Admin/LOGOS_MANIFEST.md` |
| Architecture | `Logos/Platform/Admin/LOGOS_ARCHITECTURE.md` |
| AI participation | `Logos/Platform/Admin/LOGOS_AI_EXPERIENCE.md` |
| Manifest template | `Logos/World/Workspaces/Archives/Docs/Templates/FOLDER_MANIFEST_TEMPLATE.md` |
| MCP report | `Logos/Platform/Admin/Reports/LOGOS_MCP_CORE_REPORT.html` |
| MCP guide | `Logos/Platform/Admin/Docs/MCP_DEVELOPER_GUIDE.md` |
| Data stores | `Logos/Platform/Admin/Docs/DATA_STORES_INVENTORY.md` |