Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/colony-package-namespace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"colony": patch
"@colony/compress": patch
"@colony/config": patch
"@colony/core": patch
"@colony/embedding": patch
"@colony/hooks": patch
"@colony/installers": patch
"@colony/storage": patch
---

Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`.
6 changes: 3 additions & 3 deletions .changeset/colony-session-cwd-binding.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"@cavemem/hooks": patch
"@cavemem/storage": patch
"cavemem": patch
"@colony/hooks": patch
"@colony/storage": patch
"colony": patch
---

Bind hook-created sessions back to their repository cwd so colony views can see live Codex/Claude work instead of orphan `cwd: null` sessions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [["@cavemem/*", "cavemem"]],
"linked": [["@colony/*", "colony"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
Expand Down
2 changes: 1 addition & 1 deletion .changeset/hivemind-mcp-tool.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@cavemem/mcp-server": minor
"@colony/mcp-server": minor
---

Add a compact `hivemind` MCP tool that maps active proxy-runtime agent sessions to their current tasks.
6 changes: 3 additions & 3 deletions .changeset/pheromone-trails.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
'@cavemem/storage': minor
'@cavemem/core': minor
'@cavemem/hooks': minor
'@colony/storage': minor
'@colony/core': minor
'@colony/hooks': minor
---

Add pheromone trails: ambient decaying activity signal per (task, file, session). `PostToolUse` deposits pheromone on every write-tool invocation; strength decays exponentially (10-minute half-life, cap 10.0). The new `UserPromptSubmit` preface warns when another session has a strong trail on a file the current session has also touched, complementing the existing claim-based preface with a graded intensity signal that doesn't fire for stale collisions. Schema bumped to version 4 — adds `pheromones` table with FK cascade on sessions and tasks.
8 changes: 4 additions & 4 deletions .changeset/proposal-system.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
'@cavemem/storage': minor
'@cavemem/core': minor
'@cavemem/hooks': minor
'@cavemem/mcp-server': minor
'@colony/storage': minor
'@colony/core': minor
'@colony/hooks': minor
'@colony/mcp-server': minor
---

Add proposal system: pre-tasks that auto-promote via collective reinforcement. Agents call `task_propose` to surface a candidate improvement; other agents call `task_reinforce` (kind `explicit` or `rediscovered`), and PostToolUse adds weak `adjacent` reinforcement whenever an edit touches a file listed in a pending proposal's `touches_files`. Total decayed strength (1-hour half-life, weights 1.0 / 0.7 / 0.3 by kind) is recomputed on every read; when it crosses `PROMOTION_THRESHOLD` (2.5), the proposal is auto-promoted to a real `TaskThread` on a synthetic branch `{branch}/proposal-{id}`. The new `task_foraging_report` MCP tool lists pending (above the 0.3 noise floor) and promoted proposals; `SessionStart` surfaces the same report in-preface. Schema bumped 4 → 5: adds `proposals` and `proposal_reinforcements`.
8 changes: 4 additions & 4 deletions .changeset/response-thresholds.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
'@cavemem/storage': minor
'@cavemem/core': minor
'@cavemem/hooks': minor
'@cavemem/mcp-server': minor
'@colony/storage': minor
'@colony/core': minor
'@colony/hooks': minor
'@colony/mcp-server': minor
---

Add response-threshold routing for broadcast (`to_agent: 'any'`) handoffs. Each agent identity (Claude, Codex, …) can register a capability profile (`ui_work`, `api_work`, `test_work`, `infra_work`, `doc_work`, each `0..1`) via the new `agent_upsert_profile` MCP tool; unknown agents default to `0.5` across all dimensions. When `TaskThread.handOff` runs with `to_agent: 'any'`, it snapshots a keyword-weighted ranking of every non-sender participant into `HandoffMetadata.suggested_candidates`. `SessionStart` preface surfaces the top match and the viewing agent's own score inline with each pending broadcast handoff, so receivers can see at a glance whether they are the best fit. New `agent_get_profile` MCP tool exposes read-only inspection. Schema bumped 5 → 6: adds `agent_profiles` table.
16 changes: 8 additions & 8 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# cavemem — Agent Playbook
# colony — Agent Playbook

This file is the source of truth for AI coding assistants working on this repository. Follow it before generating code, tests, or documentation. If a request conflicts with this file, pause and ask.

## Project identity

cavemem is a cross-agent persistent memory system for coding assistants. It captures observations from editor sessions, compresses prose using the project's deterministic caveman grammar, stores entries in a local SQLite + vector index, and exposes them to agents through a Model Context Protocol (MCP) server and a local web viewer.
colony is a cross-agent persistent memory system for coding assistants. It captures observations from editor sessions, compresses prose using the project's deterministic caveman grammar, stores entries in a local SQLite + vector index, and exposes them to agents through a Model Context Protocol (MCP) server and a local web viewer.

The signature property of the project is that **memory is stored compressed**. Every write path runs text through `@cavemem/compress`. Every human-facing read path runs it back through `@cavemem/compress#expand`. Model-facing reads may keep content compressed when the caller requests it.
The signature property of the project is that **memory is stored compressed**. Every write path runs text through `@colony/compress`. Every human-facing read path runs it back through `@colony/compress#expand`. Model-facing reads may keep content compressed when the caller requests it.

## Non-negotiable rules

1. **All persisted prose must pass through `packages/compress` before hitting storage.** Writing raw prose to SQLite is a defect. If you add a new write path, it must use `MemoryStore`, which enforces this.
2. **Never compress technical tokens.** Code blocks, inline code, URLs, file paths, shell commands, version numbers, dates, numeric literals, and quoted identifiers are preserved byte-for-byte. The tokenizer in `packages/compress/src/tokenize.ts` is the single authority.
3. **Round-trip tests must pass.** Any change to the compressor, the lexicon, or the tokenizer requires `pnpm --filter @cavemem/compress test` green, including the technical-token preservation suite.
3. **Round-trip tests must pass.** Any change to the compressor, the lexicon, or the tokenizer requires `pnpm --filter @colony/compress test` green, including the technical-token preservation suite.
4. **Progressive disclosure in MCP.** `search` and `timeline` return compact results (IDs + snippets). Full observation bodies are only returned by `get_observations(ids[])`. Do not bloat the compact shapes.
5. **Hot-path hooks are fast.** Hook handlers in `packages/hooks` must complete under 150 ms p95. Summarization, embedding, and indexing are handed off to the worker. No network calls in hooks.
6. **Privacy is enforced at the write boundary.** Content inside `<private>…</private>` tags is stripped. Paths matching `settings.excludePatterns` are never read. Neither appears in logs.
Expand All @@ -23,8 +23,8 @@ The signature property of the project is that **memory is stored compressed**. E
## Architectural rules

- Monorepo with pnpm workspaces. Dependency direction is strictly downward: `apps/*` may depend on `packages/*`; `packages/*` may depend on each other only in the order `config → compress → storage → { core, embedding } → hooks → installers`. (`core` and `embedding` are siblings — both consume `config` and `storage`, neither depends on the other.) No upward or sideways imports that break this order.
- All database I/O goes through `@cavemem/storage`. No other package opens the DB directly.
- Settings access goes through `@cavemem/config`. No direct reads from `~/.cavemem/settings.json` elsewhere.
- All database I/O goes through `@colony/storage`. No other package opens the DB directly.
- Settings access goes through `@colony/config`. No direct reads from `~/.colony/settings.json` elsewhere.
- All user-visible strings default to the caveman intensity from settings (default `full`).
- Public package exports are listed in each package's `package.json#exports`. Internal files are not imported across package boundaries.

Expand All @@ -50,7 +50,7 @@ evals token-savings and round-trip harness
## Development workflow

- `pnpm install` once. Node ≥ 20.
- `pnpm dev` runs the CLI and worker in watch mode against `.cavemem-dev/` in the repo root (isolated data dir).
- `pnpm dev` runs the CLI and worker in watch mode against `.colony-dev/` in the repo root (isolated data dir).
- The four required gates before merging:
- `pnpm typecheck`
- `pnpm lint`
Expand All @@ -75,7 +75,7 @@ Unit tests cover handlers, storage, and protocol contracts in isolation. They ca
- **New compression rule**: update `packages/compress/src/lexicon.json`, add at least one round-trip fixture under `packages/compress/test/fixtures/`, and re-run the benchmark in `evals/`.
- **New embedding provider**: add a module in `packages/embedding/src/providers/`, wire it into the `createEmbedder` switch in `packages/embedding/src/index.ts`, and extend the `EmbeddingProvider` enum in `packages/config/src/schema.ts`. Each provider must expose `{ model, dim, embed(text) }` — `dim` must be correct before the first `embed()` call completes (warm-up probe).
- **New storage migration**: add a numbered SQL file in `packages/storage/src/migrations/`. Migrations are forward-only.
- **New CLI setting**: add the field to `SettingsSchema` with a `.describe(…)` string. `cavemem config show` and `settingsDocs()` pick it up automatically — no parallel docs to maintain.
- **New CLI setting**: add the field to `SettingsSchema` with a `.describe(…)` string. `colony config show` and `settingsDocs()` pick it up automatically — no parallel docs to maintain.

## Performance budgets

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 Julius Brussee
Copyright (c) 2026 Imdeadpool

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading