Metadata-Version: 2.4
Name: cosmos-platform
Version: 1.6.0.dev5
Summary: Semantic Operating Environment for Interchangeable Intelligence
Author: Cosmos Platform Contributors
License: Apache-2.0
Project-URL: Homepage, https://github.com/cosmos-semantic/cosmos
Project-URL: Repository, https://github.com/cosmos-semantic/cosmos
Project-URL: Issues, https://github.com/cosmos-semantic/cosmos/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jsonschema>=4.0.0
Provides-Extra: desktop
Requires-Dist: pywebview>=4.0.0; extra == "desktop"
Provides-Extra: all
Requires-Dist: pywebview>=4.0.0; extra == "all"
Requires-Dist: cryptography>=41.0.0; extra == "all"
Requires-Dist: watchdog>=3.0.0; extra == "all"
Dynamic: license-file

# Cosmos Platform

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
[![Release](https://img.shields.io/badge/Release-Developer_Preview-orange.svg)](docs/VERSIONING.md)
[![Python](https://img.shields.io/badge/Python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue.svg)](pyproject.toml)

**A durable World for whatever coding agent and model you use.**

Cosmos is a **Semantic Operating Environment for Interchangeable Intelligence**. It is not another coding agent. It gives the agent you already use a **World**: the durable `.cosmos/` state attached to a Git repository. The World holds the project graph, decisions, rules, task context and provenance, so a new session, a different model, or a different harness starts from the same ground truth instead of a blank chat.

> *"Use whatever agent or model you want. Cosmos gives it a World."*

The model may disappear. Cosmos persists.

## What you get

| Capability | What it does | How to use it |
|---|---|---|
| **Guard** | Enforces write boundaries and TaskContracts before an agent edit or command runs. | Installed as a harness hook by `cosmos setup`. |
| **Watchdog** | Catches an agent that is stuck, looping, or drifting away from the task. | `cosmos watchdog status --project .` |
| **Cross-harness continuity & MCP** | Serves one World to Claude Code, OpenCode, and Codex through MCP, so work continues across tools and sessions. | `cosmos setup` once per machine; `cosmos status .` to inspect the World. |
| **Brain / Hands** | Produces dependency-aware execution briefs, write-allowlist TaskContracts, and an honest diff/command verification. | `cosmos packet brief`, `cosmos packet contract`, `cosmos packet verify`. |
| **Health & Delta** | Reports World health, self-checks the install, and attributes what Cosmos contributed. | `cosmos status .`, `cosmos doctor .`, `cosmos delta`. |

## Install

### Option A: one-line installer (tracks `main`)

**macOS / Linux:**
```bash
curl -fsSL https://raw.githubusercontent.com/cosmos-semantic/cosmos/main/install.sh | sh
```

**Windows (PowerShell):**
```powershell
irm https://raw.githubusercontent.com/cosmos-semantic/cosmos/main/install.ps1 | iex
```

The installer installs from the `main` branch of this repository, runs `cosmos setup` for you, and only reports success after the installed `cosmos` command has run. If it prints an error, nothing was installed. Set `COSMOS_PYTHON` to choose a specific interpreter (for example `C:\Python312\python.exe`).

### Option B: PyPI Developer Preview

```bash
pip install --pre cosmos-platform
cosmos setup
```

`pip install` only installs the `cosmos` CLI. It does not edit repositories, agent settings, hooks, or MCP configuration. **`cosmos setup` is the one machine-wide activation step**: it registers the Cosmos MCP server with Claude Code, OpenCode, and Codex when they are installed, and installs the Guard and Watchdog hooks. Run it once per machine.

### Option C: from a clone

```bash
git clone https://github.com/cosmos-semantic/cosmos.git
cd Cosmos
```

Then run `sh install.sh` (macOS / Linux) or `.\install.ps1` (Windows PowerShell) from inside the clone. This installs your checkout in editable mode and runs `cosmos setup`.

## The two-layer model

1. **Once per machine:** `cosmos setup` registers Cosmos with the agent tools you have and installs the Guard and Watchdog hooks. Every project you open afterwards uses that one registration.
2. **Per repository:** the World attaches on first use, with nothing to run. You can also prepare it explicitly:
   - `cosmos init .` pre-creates the World (`cosmos.environment.json`, `.cosmos/graph.json`, the first inspection, the retrieval index). It writes no per-project tool configuration and installs **no Git hooks**.
   - `cosmos init . --pin` additionally writes project-local configs: `.mcp.json`, `CLAUDE.local.md`, `opencode.json`, `.codex/config.toml`, `.cosmos/CURRENT.md`, and `.cosmos/AGENT-RULES.md`. Use this when you want the project to carry its own connection instead of relying on the global one.

```bash
cd /path/to/my-project
cosmos init .
cosmos open .
```

## Tool compatibility

| Tool | How Cosmos connects |
|---|---|
| **Claude Code** | Automatic: `cosmos setup` registers the MCP server and hooks. |
| **OpenCode** | Automatic: `cosmos setup` registers the MCP server and watchdog plugin. |
| **Codex** | Automatic: `cosmos setup` registers the MCP server; `cosmos init --pin` can also write `.codex/config.toml`. |
| **Cursor** | File-based: point it at the project's `AGENTS.md` when present and the World files (`cosmos.environment.json`, `.cosmos/graph.json`). |
| **Cline / Roo / VS Code** | File-based: read the project's `AGENTS.md` when present, plus the World files. |
| **Aider** | File-based: read the project's `AGENTS.md` when present, plus the World files. |

## Repository map

| Path | What lives there |
|---|---|
| `tools/` | The `cosmos` CLI, hooks, MCP server, merge gate, Studio, and Observatory. |
| `runtime/` | The execution runtime and its tests. |
| `docs/` | Product, operator, architecture, and governance documentation. |
| `governance/` | Policies, decisions, and obligations. |
| `spec/` | Interface and contract specifications. |
| `fixtures/` | Reference Worlds for developer, personal, company, and execution-stack use. |
| `catalogs/` | Capability and model catalogs. |
| `releases/` | Immutable release baselines. |
| `research/` | Background research and design notes. |

## Documentation

- [2-Minute Quickstart](docs/QUICKSTART.md) — install, activate, and get a first win.
- [Operator Guide](docs/OPERATOR-GUIDE.md) — the practical first-project workflow.
- [Architecture](docs/ARCHITECTURE.md) — how the runtime, World, Guard, and gate fit together.
- [Vision](docs/VISION.md) and [Principles](docs/PRINCIPLES.md) — why Cosmos exists and the rules it holds itself to.
- [Universe and World model](docs/UNIVERSE-AND-WORLD-MODEL.md) — the vocabulary behind Worlds, Cosmos Prime, and world families.
- [Versioning](docs/VERSIONING.md) — release policy and the current Developer Preview line.
- [Original plan](docs/ORIGINAL-PLAN.md) — the immutable record of the approved original plan.
- [Runtime entry point](runtime/README.md) and [read-only Observatory](tools/observatory/README.md).
- [Contributing](CONTRIBUTING.md) and [Security](SECURITY.md).

## The Tripartite Attribution Doctrine

Cosmos enforces an explicit separation of roles:

1. **Environment (Cosmos):** Sovereign semantic operating environment providing durable memory, ground truth, and capability envelopes.
2. **Harness (IDE / CLI Shell):** Client interface (Cursor, Claude Code, Cline, Codex CLI, OpenCode) executing processes and managing tool I/O.
3. **Model (Cognitive Runtime):** Ephemeral reasoning engine (Gemini, Claude, DeepSeek, local models) synthesizing language and logic.

*Principle: Cosmos persists. The model reasons. The harness bridges.*

## Core equation

**Intelligence = Model + Bound Context + Capabilities + Current Objective**

Cosmos externalizes durable memory, semantic structure, task context, provenance, execution boundaries, artifacts, and learning so that intelligence does not depend on one model session retaining everything.

## License

Cosmos is licensed under the [Apache License 2.0](LICENSE). The Community tier is free and open source; trust features such as the merge gate, the vault, the watchdog, and the scorecard are never paywalled.
