Merge branch 'main' into design-adr-0002-phase-2-execution

This commit is contained in:
Jan De Landtsheer 2026-05-27 14:50:59 +02:00 committed by GitHub
commit fc0681ed0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
479 changed files with 38415 additions and 8692 deletions

View file

@ -50,7 +50,12 @@ jobs:
release-build:
name: Release Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
if: github.ref == 'refs/heads/main'
# Run on main pushes AND on PRs that touch workflows, Cargo manifests, or
# crate sources — so Intel Mac / Linux release targets are validated
# before merge, not after.
if: |
github.ref == 'refs/heads/main' ||
github.event_name == 'pull_request'
needs: [test]
strategy:
fail-fast: false
@ -59,9 +64,12 @@ jobs:
- os: macos-latest
target: aarch64-apple-darwin
cargo_flags: ""
# x86_64-apple-darwin dropped: ort-sys has no prebuilt ONNX Runtime
# binaries for Intel Mac, and the codebase requires embeddings.
# Apple discontinued Intel Macs in 2020. Build from source if needed.
# Intel Mac builds against a system ONNX Runtime via ort-dynamic
# (ort-sys has no x86_64-apple-darwin prebuilts). Compile-only here;
# runtime linking is a user concern documented in INSTALL-INTEL-MAC.md.
- os: macos-latest
target: x86_64-apple-darwin
cargo_flags: "--no-default-features --features ort-dynamic,vector-search"
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cargo_flags: ""

View file

@ -27,17 +27,21 @@ jobs:
os: ubuntu-latest
archive: tar.gz
cargo_flags: ""
needs_onnxruntime: false
- target: x86_64-pc-windows-msvc
os: windows-latest
archive: zip
cargo_flags: ""
# Intel Mac (x86_64-apple-darwin) is explicitly unsupported: the
# upstream ort-sys 2.0.0-rc.11 pinned by fastembed 5.13.2 does not
# ship Intel Mac prebuilts, and the v2.0.5 + v2.0.6 release
# workflows both failed this job. Matches ci.yml which already
# dropped the target. README documents the build-from-source path
# for Intel Mac users. When ort-sys ships Intel Mac prebuilts
# again, restore the entry.
needs_onnxruntime: false
# Intel Mac uses the ort-dynamic feature to runtime-link against a
# system libonnxruntime (Homebrew), sidestepping the missing
# x86_64-apple-darwin prebuilts in ort-sys 2.0.0-rc.11. Binary
# consumers must `brew install onnxruntime` before running — see
# INSTALL-INTEL-MAC.md bundled in the tarball.
- target: x86_64-apple-darwin
os: macos-latest
archive: tar.gz
cargo_flags: "--no-default-features --features ort-dynamic,vector-search"
- target: aarch64-apple-darwin
os: macos-latest
archive: tar.gz
@ -46,20 +50,104 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Validate release version
shell: bash
env:
RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }}
run: |
node <<'NODE'
const { execFileSync } = require('node:child_process');
const tag = process.env.RELEASE_TAG || '';
const expected = tag.replace(/^refs\/tags\//, '').replace(/^v/, '');
if (!expected) {
throw new Error('Release tag is empty');
}
const packageFiles = [
'package.json',
'apps/dashboard/package.json',
'packages/vestige-init/package.json',
'packages/vestige-mcp-npm/package.json'
];
for (const file of packageFiles) {
const actual = require(`./${file}`).version;
if (actual !== expected) {
throw new Error(`${file} version ${actual} does not match ${tag}`);
}
}
const metadata = JSON.parse(execFileSync('cargo', [
'metadata',
'--format-version',
'1',
'--locked',
'--no-deps'
], { encoding: 'utf8' }));
for (const name of ['vestige-core', 'vestige-mcp']) {
const pkg = metadata.packages.find((candidate) => candidate.name === name);
if (!pkg) throw new Error(`Missing Cargo package ${name}`);
if (pkg.version !== expected) {
throw new Error(`${name} version ${pkg.version} does not match ${tag}`);
}
}
NODE
- name: Build embedded dashboard
shell: bash
env:
RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }}
run: |
pnpm install --frozen-lockfile
pnpm --filter @vestige/dashboard check
pnpm --filter @vestige/dashboard test
pnpm --filter @vestige/dashboard build
node <<'NODE'
const fs = require('node:fs');
const tag = process.env.RELEASE_TAG || '';
const expected = tag.replace(/^refs\/tags\//, '').replace(/^v/, '');
const versionFile = 'apps/dashboard/build/_app/version.json';
const version = JSON.parse(fs.readFileSync(versionFile, 'utf8')).version;
if (version !== expected) {
throw new Error(`${versionFile} version ${version} does not match ${tag}`);
}
for (const file of ['apps/dashboard/build/index.html', versionFile]) {
if (!fs.existsSync(file)) {
throw new Error(`Dashboard build did not produce ${file}`);
}
}
NODE
- name: Build
run: cargo build --package vestige-mcp --release --target ${{ matrix.target }} ${{ matrix.cargo_flags }}
run: cargo build --locked --package vestige-mcp --release --target ${{ matrix.target }} ${{ matrix.cargo_flags }}
- name: Package (Unix)
if: matrix.os != 'windows-latest'
run: |
cp docs/INSTALL-INTEL-MAC.md target/${{ matrix.target }}/release/ 2>/dev/null || true
cd target/${{ matrix.target }}/release
tar -czf ../../../vestige-mcp-${{ matrix.target }}.tar.gz vestige-mcp vestige vestige-restore
if [ "${{ matrix.target }}" = "x86_64-apple-darwin" ]; then
tar -czf ../../../vestige-mcp-${{ matrix.target }}.tar.gz vestige-mcp vestige vestige-restore INSTALL-INTEL-MAC.md
else
tar -czf ../../../vestige-mcp-${{ matrix.target }}.tar.gz vestige-mcp vestige vestige-restore
fi
- name: Package (Windows)
if: matrix.os == 'windows-latest'
@ -68,10 +156,21 @@ jobs:
cd target/${{ matrix.target }}/release
Compress-Archive -Path vestige-mcp.exe,vestige.exe,vestige-restore.exe -DestinationPath ../../../vestige-mcp-${{ matrix.target }}.zip
- name: Generate checksum
shell: bash
run: |
if command -v shasum >/dev/null 2>&1; then
shasum -a 256 vestige-mcp-${{ matrix.target }}.${{ matrix.archive }} > vestige-mcp-${{ matrix.target }}.${{ matrix.archive }}.sha256
else
sha256sum vestige-mcp-${{ matrix.target }}.${{ matrix.archive }} > vestige-mcp-${{ matrix.target }}.${{ matrix.archive }}.sha256
fi
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
files: vestige-mcp-${{ matrix.target }}.${{ matrix.archive }}
files: |
vestige-mcp-${{ matrix.target }}.${{ matrix.archive }}
vestige-mcp-${{ matrix.target }}.${{ matrix.archive }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -12,6 +12,19 @@ env:
VESTIGE_TEST_MOCK_EMBEDDINGS: "1"
jobs:
hook-tests:
name: Hook Tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- run: python3 -m unittest discover -s tests/hooks -p 'test_*.py'
- run: python3 -m py_compile hooks/sanhedrin-local.py tests/hooks/test_sanhedrin_claim_mode.py
- run: bash -n hooks/sanhedrin.sh scripts/install-sandwich.sh scripts/check-sandwich-prereqs.sh
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

2
.gitignore vendored
View file

@ -60,6 +60,8 @@ pnpm-debug.log*
coverage/
.nyc_output/
*.lcov
__pycache__/
*.py[cod]
apps/dashboard/test-results/
apps/dashboard/playwright-report/
apps/dashboard/e2e/screenshots/

View file

@ -5,6 +5,270 @@ All notable changes to Vestige will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [2.1.22] - 2026-05-25 — "Sanhedrin Receipts"
v2.1.22 makes the optional Sanhedrin hook quieter and more accountable by
turning draft judgment into local, appealable receipts instead of opaque vetoes.
### Added
- **Receipt Lock** blocks unsupported verification claims such as "tests passed"
unless the current transcript contains a matching successful test, build,
lint, or typecheck command receipt.
- **Veto receipts** are written to `~/.vestige/sanhedrin/latest.json` and
`latest.html` with Claim -> Verdict -> Precedent -> Fix -> Appeal fields.
- **Dashboard Verdict Bar** surfaces the latest PASS, NOTE, CAUTION, VETO, or
APPEALED state and lets users appeal stale, wrong, or too-strict vetoes.
- **Appeal training** records feedback in `appeals.jsonl` and suppresses future
vetoes for the same claim fingerprint.
### Changed
- Sanhedrin claim-mode output now feeds a per-claim receipt ledger while keeping
the existing one-line Stop-hook contract for Claude Code.
## [2.1.21] - 2026-05-24 — "Agent-Neutral Hardening"
v2.1.21 is a release-hardening pass for normal MCP usage across agents. It keeps
Claude Code Cognitive Sandwich companion files optional while making the MCP
server, package installer, release workflow, and portable sync path safer.
### Added
- **Agent-neutral memory protocol** — new `docs/AGENT-MEMORY-PROTOCOL.md` gives
any MCP-compatible client the same practical memory loop: initialize context,
search/deep-reference when needed, save durable facts with `smart_ingest`, and
promote/demote/purge with `memory`.
- **HTTP transport opt-in**`vestige-mcp` now requires `--http`,
`--http-port`, or `VESTIGE_HTTP_ENABLED=1` before starting MCP-over-HTTP.
- **Release checksums** — release assets now publish `.sha256` files beside each
archive.
### Changed
- **`vestige update` is binary-only by default** — Claude Code Cognitive
Sandwich companion files refresh only with `vestige update --sandwich-companion`
or `vestige sandwich install`.
- **MCP tool results include structured content** while keeping text content for
clients that only consume the classic MCP response shape.
- **NPM install messaging is agent-neutral** and unsupported release targets
fail fast instead of trying to download assets that do not exist.
- **Portable merge uses UPSERT instead of `INSERT OR REPLACE`** for keyed tables,
preserving related rows instead of causing delete-and-insert side effects.
### Fixed
- **Destructive delete confirmation**`memory(action="delete")` now requires
`confirm=true`, matching `purge`; the deprecated `delete_knowledge` shim no
longer bypasses confirmation.
- **Portable purge tombstone sync** — merge imports now carry
`deletion_tombstones` and apply purges without retaining deleted memory text.
Hard purge tombstones win over newer local edits during portable sync, while
tombstone merges keep the newest deletion timestamp.
- **Vector index reload staleness** — loading persisted embeddings rebuilds the
in-memory index from an empty index before adding current embeddings.
- **HTTP transport hardening** — origin, Accept, session, and protocol-version
validation now reject incompatible or cross-origin browser requests earlier.
- **Init config safety**`@vestige/init` backs up existing config files, writes
atomically, accepts JSONC-style comments/trailing commas, and no longer writes
Xcode trust-accepted flags.
- **Release tag checkout** — manual release builds now checkout the requested tag
or ref before packaging.
### Verified
- `cargo test -p vestige-mcp --lib --no-fail-fast`
- `cargo test -p vestige-mcp --bin vestige-mcp --no-fail-fast`
- `cargo test -p vestige-core portable_merge_import --no-fail-fast`
- `cargo test -p vestige-mcp --bin vestige --no-fail-fast`
- `cargo test -p vestige-e2e-tests --test mcp_protocol --no-fail-fast`
- `cargo check --workspace`
- `cargo metadata --format-version 1 --locked --no-deps`
- `pnpm --filter @vestige/dashboard check`
- `pnpm --filter @vestige/dashboard test`
- `pnpm --filter @vestige/dashboard build`
- `node --check packages/vestige-init/bin/init.js`
- `node --check packages/vestige-mcp-npm/scripts/postinstall.js`
- `node --check packages/vestige-mcp-npm/bin/vestige-restore.js`
## [2.1.2] - 2026-05-01 — "Honest Memory"
v2.1.2 focuses on operational trust: exact search stays exact, purge really removes content, contradictions are directly inspectable, and the update flow no longer depends on copied curl commands.
### Added
- **Concrete search mode**`search` now auto-detects literal queries such as quoted strings, env vars, UUIDs, paths, and code identifiers. Those queries take a keyword/literal path that skips HyDE, semantic fusion, FSRS reweighting, retrieval competition, and spreading activation so exact matches land first.
- **Irreversible purge**`memory(action="purge", confirm=true)` permanently removes memory content and embeddings, scrubs `insights.source_memories`, detaches temporal-summary children, prunes graph edges, and writes only a non-content `deletion_tombstones` row for sync/audit.
- **First-class contradictions tool** — new `contradictions` MCP tool scans a topic or recent memories for trust-weighted disagreements using the same local contradiction logic as `deep_reference`.
- **Simple update flow**`vestige update` refreshes the installed binary and companion Sandwich files without requiring users to paste a curl installer.
- **Pro waitlist preview**`/dashboard/waitlist` adds a local-only marketing surface for Solo Pro and Team Pro early-access signups. `VITE_WAITLIST_ENDPOINT` and `VITE_SUPPORT_BOT_ENDPOINT` are opt-in dashboard env vars, so no signup data is captured unless endpoints are configured.
### Fixed
- **Dream connection persistence cap** — dense single-domain dreams now persist every connection discovered in that run instead of losing everything beyond the old 1,000-entry live buffer. The live dreamer buffer now keeps up to 200,000 high-scoring recent connections, and the MCP `dream` tool exposes `min_similarity` for corpus-specific tuning.
- **Embedding-model upgrade repair**`vestige consolidate` now re-embeds every missing or active-model-mismatched memory in one pass, so v1/v2 mixed stores are no longer left partially unreachable after only the first 100 legacy embeddings are regenerated.
## [2.1.1] - 2026-05-01 — "Portable Sync"
v2.1.1 focuses on user-controlled portability: exact storage archives, merge-safe file sync, pluggable sync backends, and explicit hook opt-ins.
### Added
- **Exact portable archives**`vestige portable-export` / `vestige portable-import` preserve raw Vestige storage rows: memory IDs, FSRS state, graph edges, suppression state, audit rows, sessions, intentions, and embedding blobs.
- **Merge-safe imports**`vestige portable-import --merge` can merge into non-empty databases. It applies `sync_tombstones`, keeps newer local memory rows on timestamp conflicts, preserves stable IDs, and rebuilds FTS after import.
- **File-backed two-way sync**`vestige sync <archive>` performs pull-merge-push through a shared portable archive. This works today with Dropbox, iCloud Drive, Syncthing, Git, network shares, and shared folders.
- **Pluggable portable-sync backend trait** — core now exposes `PortableSyncBackend`, `FilePortableSyncBackend`, and `PortableSyncReport`, so non-file backends can reuse the same merge semantics without reimplementing conflict handling.
- **Portable restore merge mode** — the MCP `restore` tool accepts `merge: true` for portable archives and returns inserted/updated/deleted/skipped/conflict counts.
- **Qwen3 embedding opt-in** — build-time and runtime support for Qwen3 embeddings, with model-aware retrieval safeguards so mixed embedding models are not compared in the same vector path.
### Fixed
- **Sanhedrin, preflight, and all Vestige Claude Code hooks are optional again.** The Cognitive Sandwich installer now activates no hooks by default and leaves every preflight hook, every Stop hook, the MLX launchd service, and the 19 GB Qwen model path behind explicit `--enable-preflight`, `--enable-sanhedrin`, or `--with-launchd` flags.
- **x86-friendly Sanhedrin path.** The verifier bridge now accepts any OpenAI-compatible chat endpoint via `VESTIGE_SANHEDRIN_ENDPOINT` and `VESTIGE_SANHEDRIN_MODEL`, so Linux and Intel Mac users can opt in without MLX or Apple Silicon.
### Verified
- `cargo test -p vestige-core portable --no-fail-fast`
- `cargo test -p vestige-mcp portable --no-fail-fast`
- `cargo test --workspace --no-fail-fast`
- Installer shell/Python/JSON validation and default/preflight/Sanhedrin migration dry-runs.
## [2.1.0] - 2026-04-27 — "Cognitive Sandwich Goes Local"
v2.1.0 ships the Cognitive Sandwich hook harness for Claude Code, with a hotfix that makes every hook layer opt-in. The default installer stages files, removes old Vestige hook wiring, starts no MLX service, downloads no model, and makes no automatic model calls. Users can opt into preflight context, Sanhedrin verification, or the Apple Silicon MLX backend separately.
### Added
- **`hooks/`** — first-class harness-side companion to the Vestige MCP server. 9 production hooks designed for `~/.claude/hooks/`:
- `sanhedrin.sh` — Stop hook that invokes the local Qwen Executioner via the Python bridge.
- `sanhedrin-local.py` — local backend that POSTs to `mlx_lm.server` (`localhost:8080`) with Vestige evidence injected via the dashboard `/api/deep_reference` HTTP endpoint. TRUST_FLOOR=0.55 evidence filter + topical-relevance gate + inference-verb ban + 8 worked few-shots covering true positives AND false-positive guards.
- `synthesis-preflight.sh` — UserPromptSubmit hook that POSTs the user prompt to `/api/deep_reference` and injects the trust-scored reasoning chain into context.
- `cwd-state-injector.sh` — captures git status, branch, modified files, open PRs/issues.
- `vestige-pulse-daemon.sh` — surfaces fresh Vestige dream insights from the past 20 min.
- `preflight-swarm.sh` — spawns the `lateral-thinker` subagent in fresh context for cross-disciplinary structural parallels.
- `synthesis-stop-validator.sh` — Stop hook regex against forbidden hedging patterns.
- `veto-detector.sh` — fast 50ms regex pre-screen against `veto`-tagged Vestige memories.
- `synthesis-gate.sh` — legacy v1 trigger (kept for backward compat).
- `settings.fragment.json` — empty default JSON snippet; the installer only wires hooks from the opt-in preflight/Sanhedrin fragments.
- **Dashboard `/api/changelog` endpoint** — bounded REST event feed for recent `DreamCompleted` and `ConnectionDiscovered` events, used by the Pulse hook to inject fresh synthesis into Claude Code context.
- **`agents/`** — `executioner.md` (legacy/fallback Haiku 4.5 path), `lateral-thinker.md`, `synthesis-composer.md`.
- **`launchd/com.vestige.mlx-server.plist.template`** — auto-start `mlx_lm.server` with the Qwen3.6-35B-A3B-4bit model on login. Templated with `__HOME__` and `__MODEL__` placeholders.
- **`scripts/install-sandwich.sh`** — one-command installer that stages hooks and agents, removes old Vestige hook wiring by default, and only wires optional layers with `--enable-preflight`, `--enable-sanhedrin`, or `--with-launchd`. Backs up `settings.json` to `.bak.pre-sandwich`. Supports `--force`, `--include-memory-loader`, and `--src=PATH`.
- **`scripts/check-sandwich-prereqs.sh`** — default verifier confirms no Vestige Claude Code hooks are wired. Optional `--preflight` and `--sanhedrin` modes check the corresponding enabled layer.
- **`docs/COGNITIVE_SANDWICH.md`** — architecture diagram, install guide, performance notes (82 tok/s on M3 Max), uninstall, configuration env vars.
- **PR #48**`VESTIGE_DATA_DIR` env-var support + tilde expansion + secure unix perms (thanks @Jelloeater) — directly addresses the ghost env-vars exposed by v2.0.9 cleanup.
### Changed
- **Sanhedrin Executioner backend can run locally or remotely when explicitly enabled.** The bridge targets an OpenAI-compatible chat endpoint, with local `mlx_lm.server` + Qwen3.6-35B-A3B-4bit available behind `--with-launchd` on Apple Silicon. Anthropic API key no longer required for the post-cognitive layer. The `executioner.md` agent definition is retained as manual/fallback only when invoked explicitly via `Task(subagent_type='executioner')`.
- **All hooks sanitized for public release** — replaced hardcoded personal absolute paths with `$HOME` / `$VESTIGE_*` env vars; removed personal regex tokens.
- **NPM binary installer now follows package version**`vestige-mcp-server@2.1.0` downloads release assets from `v2.1.0` instead of a stale hardcoded binary tag, while local workspace installs skip the release-asset download before the tag exists.
### Verified
- `cargo test --workspace --release --no-fail-fast`: **1,229 passing, 0 failed** (366 vestige-core + 358 vestige-mcp lib + 4 vestige-mcp bin + 497 e2e + 4 doctests).
- Sanhedrin bridge smoke checks: Python bytecode compilation passes, fail-open bridge invocation returns `yes`, and public hook settings validate as JSON.
- v2.1.0 hotfix installer matrix: default, preflight-only, Sanhedrin-only, full sandwich, legacy-all-hooks migration, and unrelated custom hooks preservation.
- 8-day Sandwich dogfood: **84% pass rate, 16% legitimate vetoes** caught real hallucinations.
### Closes
- #36 (Agent Hooks for Low-Effort Automatic Memory Capture) — Cognitive Sandwich is the answer.
### Prerequisites for optional local MLX Sanhedrin
- macOS Apple Silicon (M1+) — required only for `--with-launchd` MLX autostart
- Python 3.10+
- ~22 GB free RAM (Qwen3.6-35B-A3B-4bit at runtime)
- First-run model download: ~19 GB from Hugging Face (cached locally thereafter)
### Migration
None required for existing Vestige users. The Cognitive Sandwich is opt-in via `scripts/install-sandwich.sh`; running the default installer removes old Vestige hook wiring and leaves preflight, Sanhedrin, launchd, and the 19 GB model path disabled. The MCP server, schema, and tool surface are bit-identical to v2.0.9.
---
## [2.0.9] - 2026-04-24 — "Autopilot"
Autopilot flips Vestige from passive memory library to self-managing cognitive surface. A single supervised backend task subscribes to the 20-event WebSocket bus and routes live events into the cognitive engine — 14 previously dormant primitives (synaptic tagging, predictive memory, activation spread, prospective polling, auto-consolidation, Rac1 cascade emission) now fire without any MCP tool call. Shipped alongside a 3,091-LOC orphan-code cleanup of the v1.0 tool surface. **No schema changes, tool surface unchanged (24 tools), fully backward compatible with v2.0.8 databases. Opt-out via `VESTIGE_AUTOPILOT_ENABLED=0`.**
### Added
- **Autopilot event subscriber** (`crates/vestige-mcp/src/autopilot.rs`) — two supervised tokio tasks spawned at startup. The event subscriber consumes a `broadcast::Receiver<VestigeEvent>` and routes six event classes:
- `MemoryCreated``synaptic_tagging.trigger_prp()` (9h retroactive PRP window, Frey & Morris 1997) + `predictive_memory.record_memory_access()`.
- `SearchPerformed``predictive_memory.record_query()` + top-10 access records. The speculative-retrieval model now warms without waiting for an explicit `predict` call.
- `MemoryPromoted``activation_network.activate(id, 0.3)` — a small reinforcement ripple through the graph.
- `MemorySuppressed` → re-emits the previously-declared-never-emitted `Rac1CascadeSwept` event so the dashboard's cascade wave actually renders.
- `ImportanceScored` with `composite_score > 0.85` AND a stored `memory_id` → auto-promote + re-emit `MemoryPromoted`.
- `Heartbeat` with `memory_count > 700` → rate-limited `find_duplicates` sweep (6h cooldown + in-flight `JoinHandle` guard against concurrent scans on large DBs).
The engine mutex is acquired only synchronously per handler and never held across `.await`, so MCP tool dispatch is never starved. A 60-second `tokio::interval` separately polls `prospective_memory.check_triggers(Context)` — matched intentions log at `info!` level today; v2.1 "Autonomic" will surface them mid-conversation.
- **Panic-resilient supervisors** — both background tasks run inside an outer supervisor loop. If a cognitive hook panics on one bad memory, the supervisor catches `JoinError::is_panic()`, logs the panic, sleeps 5 s, and respawns the inner task. Turns a permanent silent-failure mode into a transient hiccup.
- **`VESTIGE_AUTOPILOT_ENABLED=0` opt-out** — v2.0.8 users who want the passive-library contract can disable Autopilot entirely. Values `{0, false, no, off}` early-return before any task spawns; anything else (unset, `1`, `true`) enables the default v2.0.9 behavior.
- **`ImportanceScored.memory_id: Option<String>`** — new optional field on the event variant (`#[serde(default)]`, backward-compatible) so Autopilot's auto-promote path can target a stored memory. Existing emit sites pass `None`.
### Changed
- **3,091 LOC of orphan tool code removed** from `crates/vestige-mcp/src/tools/` — nine v1.0 modules (`checkpoint`, `codebase`, `consolidate`, `ingest`, `intentions`, `knowledge`, `recall`, plus two internal helpers) superseded by the `*_unified` / `maintenance::*` replacements shipped in v2.0.5. Each module verified for zero non-test callers before removal. Tool surface unchanged — all 24 tools continue to work via the unified dispatchers.
- **Ghost environment-variable documentation scrubbed** — three docs listed env vars (`VESTIGE_DATA_DIR`, `VESTIGE_LOG_LEVEL`, a `VESTIGE_API_KEY` typo) that never existed in any shipping Rust code. Replaced with the real variables the binary actually reads.
### Fixed
- **Dedup-sweep race on large databases** — the `Heartbeat`-triggered `find_duplicates` sweep previously set its cooldown timestamp BEFORE spawning the async scan, which on 100k+ memory DBs (where a sweep can exceed the 6h cooldown) allowed two concurrent scans. Rewritten to track the in-flight `JoinHandle` via `DedupSweepState::is_running()` — the next Heartbeat skips if the previous sweep is still live.
### Verified
- `cargo test --workspace --no-fail-fast`: **1,223 passing, 0 failed**.
- `cargo clippy -p vestige-mcp --lib --bins -- -D warnings`: clean.
- Five-agent parallel audit (security, dead-code, flow-trace, runtime-safety, release-prep): all GO.
### Migration
None. v2.0.9 is a pure backend upgrade — tool surface, JSON-RPC schema, storage schema, and CLI flags are bit-identical to v2.0.8. Existing databases open without any migration step. The only behavior change is the Autopilot task running in the background, which is `VESTIGE_AUTOPILOT_ENABLED=0`-gated if you want the old passive-library contract.
## [2.0.8] - 2026-04-23 — "Pulse"
The Pulse release wires the dashboard through to the cognitive engine. Eight new dashboard surfaces expose `deep_reference`, `find_duplicates`, `dream`, FSRS scheduling, 4-channel importance, spreading activation, contradiction arcs, and cross-project pattern transfer — every one of them was MCP-only before. Intel Mac is back on the supported list (Microsoft deprecated x86_64 macOS ONNX Runtime prebuilts; we link dynamically against a Homebrew `onnxruntime` instead). Reasoning Theater, Pulse InsightToast, and the Memory Birth Ritual all ship. No schema migrations.
### Added
- **Reasoning Theater (`/reasoning`)** — Cmd+K Ask palette over the 8-stage `deep_reference` cognitive pipeline: hybrid retrieval → cross-encoder rerank → spreading activation → FSRS-6 trust scoring → temporal supersession → trust-weighted contradiction analysis → relation assessment → template reasoning chain. Every query returns a pre-built reasoning block with evidence cards, confidence meter, contradiction geodesic arcs, superseded-memory lineage, and an evolution timeline. **Zero LLM calls, 100% local.** New HTTP surface `POST /api/deep_reference` wraps `crate::tools::cross_reference::execute`; new WebSocket event `DeepReferenceCompleted` carries primary / supporting / contradicting memory IDs for downstream graph animation.
- **Pulse InsightToast (v2.2 Pulse)** — real-time toast stack that surfaces `DreamCompleted`, `ConsolidationCompleted`, `ConnectionDiscovered`, `MemoryPromoted`/`Demoted`/`Suppressed`, `MemoryUnsuppressed`, `Rac1CascadeSwept` events the moment they fire. Rate-limited to 1 per 1500ms on connection-discovery cascades. Auto-dismiss after 5-6s, click-to-dismiss, progress bar. Bottom-right on desktop, top-center on mobile.
- **Memory Birth Ritual (v2.3 Terrarium)** — new memories materialize in the 3D graph on every `MemoryCreated` event: elastic scale-in from a camera-relative cosmic center, quadratic Bezier flight path, glow sprite fades in frames 5-10, label fades in at frame 40, Newton's Cradle docking recoil. 60-frame sequence, zero-alloc math, camera-relative so the birth point stays visible at every zoom level.
- **7 additional dashboard surfaces** exposing the cognitive engine (v2.4 UI expansion): `/duplicates` (find_duplicates cluster view), `/dreams` (5-stage replay + insight cards), `/schedule` (FSRS calendar + retention forecast), `/importance` (4-channel novelty/arousal/reward/attention radar), `/activation` (spreading-activation network viz), `/contradictions` (trust-weighted conflict arcs), `/patterns` (cross-project pattern-transfer heatmap). Left nav expanded from 8 → 16 entries with single-key shortcuts (R/A/D/C/P/U/X/N).
- **3D Graph brightness system** — auto distance-compensated node brightness (1.0× at camera <60u, up to 2.4× at far zoom) so nodes don't disappear into exponential fog at zoom-out. User-facing brightness slider in the graph toolbar (☀ icon, range 0.5×-2.5×, localStorage-persisted under `vestige:graph:brightness`). Composes with the auto boost; opacity + glow halo + edge weight track the combined multiplier so nodes stay coherent.
- **Intel Mac (`x86_64-apple-darwin`) support restored** via the `ort-dynamic` Cargo feature + Homebrew-installed ONNX Runtime. Microsoft is discontinuing x86_64 macOS prebuilts after ONNX Runtime v1.23.0 so `ort-sys` will never ship one for Intel; the dynamic-link path sidesteps that entirely. Install: `brew install onnxruntime` then `ORT_DYLIB_PATH=$(brew --prefix onnxruntime)/lib/libonnxruntime.dylib`. Full guide bundled in the Intel Mac tarball as `INSTALL-INTEL-MAC.md`. **Closes #41.**
- **Graph default-load fallback** — when the newest memory has zero edges (freshly saved, hasn't accumulated connections yet), `GET /api/graph` silently retries with `sort=connected` so the landing view shows real context instead of a lonely orb. Applies only to default loads; explicit `query` / `center_id` requests are honored as-is. Fires on both backend and client.
### Fixed
- **Contradiction-detection false positives** — adjacent-domain memories are no longer flagged as conflicts just because both contain the word "trust" or "fixed." Four thresholds tightened: `NEGATION_PAIRS` drops the `("not ", "")` + `("no longer", "")` wildcard sentinels; `appears_contradictory` shared-words floor 2 → 4 and correction-signal gating now requires ≥6 shared words + asymmetric presence (one memory carries the signal, the other doesn't); `assess_relation` topic-similarity floor raised 0.15 → 0.55; Stage 5 pairwise contradiction overlap floor 0.15 → 0.4. On an FSRS-6 query this collapses false contradictions from 12 → 0 without regressing the two legitimate contradiction test cases.
- **Primary-memory selection on `deep_reference`** — previously the reasoning chain picked via `max_by(trust)` and the recommended-answer card picked via `max_by(composite)`, so the chain and citation disagreed on the same query. Unified behind a shared composite (50% hybrid-search relevance + 20% FSRS-6 trust + 30% query-topic-term match fraction) with a hard topic-term filter: a memory cannot be primary unless its content contains at least one substantive query term. Three-tier fallback (on-topic + relevant → on-topic any → all non-superseded) so sparse corpora never starve. Closes the class of bug where high-trust off-topic memories won queries against the actual subject.
- **Reasoning page information hierarchy** — reasoning chain renders first as the hero (confidence-tinted border glow, inline metadata), then confidence meter + Primary Source citation card, then Cognitive Pipeline visualization, then evidence grid. "Template Reasoning" relabelled "Reasoning"; "Recommended Answer" relabelled "Primary Source" (it's a cited memory, not the conclusion — the chain is the conclusion).
### Changed
- **CI + release workflows**`release-build` now runs on pull requests too so Intel Mac / aarch64-darwin / Linux / Windows regressions surface before merge. `x86_64-apple-darwin` back in both `ci.yml` and `release.yml` matrices with `cargo_flags: "--no-default-features --features ort-dynamic,vector-search"`. Intel Mac tarball bundles `docs/INSTALL-INTEL-MAC.md` alongside the binaries.
- **Cargo feature split**`embeddings` is now code-only (fastembed dep + hf-hub + image-models). New `ort-download` feature carries the prebuilt backend (the historical default); `ort-dynamic` transitively enables `embeddings` so the 27 `#[cfg(feature = "embeddings")]` gates stay active when users swap backends. Default set `["embeddings", "ort-download", "vector-search", "bundled-sqlite"]` — identical behavior for every existing consumer.
- **Platform availability in README** — macOS Apple Silicon + Intel + Linux x86_64 + Windows x86_64 all shipped as prebuilts. Intel Mac needs `brew install onnxruntime` as a one-time prereq.
### Docs
- New `docs/INSTALL-INTEL-MAC.md` with the Homebrew prereq, binary install, source build, troubleshooting, and the v2.1 `ort-candle` migration plan.
- README Intel Mac section rewritten with the working install recipe + platform table updated.
### Migration
None. Additive features and bug fixes only. No schema changes, no breaking API changes, no config changes required.
### Contributors
- **danslapman** (#41, #42) — reported the Intel Mac build regression and investigated `ort-tract` as an alternative backend; closure documented that `ort-tract` returns `Unimplemented` when fastembed calls into it, confirming `ort-dynamic` as the correct path forward.
---
## [2.0.7] - 2026-04-19 — "Visible"
Hygiene release plus two UI gap closures. No breaking changes, no new major features, no schema migrations affecting user data beyond V11 dropping two verified-unused tables.

382
CLAUDE.md
View file

@ -1,348 +1,62 @@
# Vestige v2.0.4 — Cognitive Memory & Reasoning System
# Vestige Agent Guidance
Vestige is your long-term memory AND reasoning engine. 29 stateful cognitive modules implement real neuroscience: FSRS-6 spaced repetition, synaptic tagging, prediction error gating, hippocampal indexing, spreading activation, reconsolidation, and dual-strength memory theory. **Use it automatically. Use it aggressively.**
This file is intentionally safe for the public repository. It gives coding
agents project-specific context without relying on private local files,
personal operating notes, or mandatory background hooks.
**NEW: `deep_reference` — call this for ALL factual questions.** It doesn't just retrieve — it REASONS across memories with FSRS-6 trust scoring, intent classification, contradiction analysis, and generates a pre-built reasoning chain. Read the `reasoning` field FIRST.
## Project Shape
---
Vestige is a local-first MCP memory server written in Rust, with a SvelteKit
dashboard embedded into the release binary. The core product promise is:
## Session Start Protocol
- user-owned memory stored locally by default
- MCP-native integration with coding agents
- retrieval and memory lifecycle behavior informed by cognitive science
- explicit tools for search, review, suppression, purge, graph exploration,
contradiction inspection, and maintenance
Every conversation, before responding to the user:
## Working Rules
```
session_context({
queries: ["user preferences", "[current project] context"],
context: { codebase: "[project]", topics: ["[current topics]"] },
token_budget: 2000
})
- Prefer source evidence over memory. Use `rg`, tests, and nearby code before
making claims about behavior.
- Keep release changes scoped. Do not rewrite unrelated modules during a
version/tag cleanup unless the release gate requires it.
- Preserve local-first behavior. Heavy models, Sanhedrin-style verifier hooks,
and preflight automation must remain optional.
- Treat deletion semantics carefully. `purge` must remove content and
embeddings, while retaining only content-free audit tombstones.
- Treat exact lookup semantics carefully. Env vars, paths, UUIDs, quoted
strings, and code identifiers should not be distorted by semantic expansion.
## Common Checks
Run the narrowest check that covers the change, then run the release gates
before tagging:
```sh
cargo test --workspace --no-fail-fast
cargo clippy --workspace -- -D warnings
pnpm --filter @vestige/dashboard check
pnpm --filter @vestige/dashboard build
```
Then check `automationTriggers` from response:
- `needsDream` → call `dream` (consolidates memories, discovers hidden connections)
- `needsBackup` → call `backup`
- `needsGc` → call `gc(dry_run: true)` then review
- totalMemories > 700 → call `find_duplicates`
For documentation-only changes, at minimum run:
Say "Remembering..." then retrieve context before answering.
> **Fallback:** If `session_context` unavailable: `search` × 2 → `intention` check → `system_status``predict`.
---
## Complete Tool Reference (23 Tools)
### session_context — One-Call Initialization
```
session_context({
queries: ["user preferences", "project context"], // search queries
context: { codebase: "project-name", topics: ["svelte", "rust"], file: "src/main.rs" },
token_budget: 2000, // 100-100000, controls response size
include_status: true, // system health
include_intentions: true, // triggered reminders
include_predictions: true // proactive memory predictions
})
```
Returns: markdown context + `automationTriggers` + `expandable` IDs for on-demand retrieval.
### smart_ingest — Save Anything
**Single mode** — auto-decides CREATE/UPDATE/SUPERSEDE via Prediction Error Gating:
```
smart_ingest({
content: "What to remember",
tags: ["tag1", "tag2"],
node_type: "fact", // fact|concept|event|person|place|note|pattern|decision
source: "optional reference",
forceCreate: false // bypass dedup when needed
})
```
**Batch mode** — save up to 20 items in one call (session end, pre-compaction):
```
smart_ingest({
items: [
{ content: "Item 1", tags: ["session-end"], node_type: "fact" },
{ content: "Item 2", tags: ["bug-fix"], node_type: "fact" }
]
})
```
Each item runs the full cognitive pipeline: importance scoring → intent detection → synaptic tagging → hippocampal indexing → PE gating → cross-project recording.
### search — 7-Stage Cognitive Search
```
search({
query: "search query",
limit: 10, // 1-100
min_retention: 0.0, // filter by retention strength
min_similarity: 0.5, // minimum cosine similarity
detail_level: "summary", // brief|summary|full
context_topics: ["rust", "debugging"], // boost topic-matching memories
token_budget: 3000, // 100-100000, truncate to fit
retrieval_mode: "balanced" // precise|balanced|exhaustive (v2.1)
})
```
Retrieval modes: `precise` (fast, no activation/competition), `balanced` (default 7-stage pipeline), `exhaustive` (5x overfetch, deep graph traversal, no competition suppression).
Pipeline: Overfetch → Rerank (cross-encoder) → Temporal boost → Accessibility filter (FSRS-6) → Context match (Tulving 1973) → Competition (Anderson 1994) → Spreading activation. **Every search strengthens the memories it finds (Testing Effect).**
### memory — Read, Edit, Delete, Promote, Demote
```
memory({ action: "get", id: "uuid" }) // full node with all FSRS state
memory({ action: "edit", id: "uuid", content: "updated text" }) // preserves FSRS state, regenerates embedding
memory({ action: "delete", id: "uuid" })
memory({ action: "promote", id: "uuid", reason: "was helpful" }) // +0.20 retrieval, +0.10 retention, 1.5x stability
memory({ action: "demote", id: "uuid", reason: "was wrong" }) // -0.30 retrieval, -0.15 retention, 0.5x stability
memory({ action: "state", id: "uuid" }) // Active/Dormant/Silent/Unavailable + accessibility score
memory({ action: "get_batch", ids: ["uuid1", "uuid2", "uuid3"] }) // retrieve up to 20 full memories at once (v2.1)
```
Promote/demote does NOT delete — it adjusts ranking. Demoted memories rank lower; alternatives surface instead.
`get_batch` is designed for batch retrieval of expandable overflow IDs from search/session_context.
### codebase — Code Patterns & Architectural Decisions
```
codebase({ action: "remember_pattern", name: "Pattern Name",
description: "How it works and when to use it",
files: ["src/file.rs"], codebase: "project-name" })
codebase({ action: "remember_decision", decision: "What was decided",
rationale: "Why", alternatives: ["Option A", "Option B"],
files: ["src/file.rs"], codebase: "project-name" })
codebase({ action: "get_context", codebase: "project-name", limit: 10 })
// Returns: patterns, decisions, cross-project insights
```sh
git diff --check
```
### intention — Prospective Memory (Reminders)
```
intention({ action: "set", description: "What to do",
trigger: { type: "context", topic: "authentication" }, // fires when discussing auth
priority: "high" })
## Documentation
intention({ action: "set", description: "Deploy by Friday",
trigger: { type: "time", at: "2026-03-07T17:00:00Z" },
deadline: "2026-03-07T17:00:00Z" })
- User setup: `README.md`
- Claude-specific templates: `docs/CLAUDE-SETUP.md`
- Storage and sync behavior: `docs/STORAGE.md`
- Cognitive Sandwich and optional verifier hooks: `docs/COGNITIVE_SANDWICH.md`
- Release history: `CHANGELOG.md`
intention({ action: "set", description: "Check test coverage",
trigger: { type: "context", codebase: "vestige", file_pattern: "*.test.*" } })
## Public-Repo Hygiene
intention({ action: "check", context: { codebase: "vestige", topics: ["testing"] } })
intention({ action: "update", id: "uuid", status: "complete" })
intention({ action: "list", filter_status: "active" })
```
### dream — Memory Consolidation
```
dream({ memory_count: 50 })
```
5-stage cycle: Replay → Cross-reference → Strengthen → Prune → Transfer. Uses Waking SWR tagging (70% tagged + 30% random for diversity). Discovers hidden connections, generates insights, persists new edges to the activation network.
### explore_connections — Graph Traversal
```
explore_connections({ action: "associations", from: "uuid", limit: 10 })
// Spreading activation from a memory — find related memories via graph traversal
explore_connections({ action: "chain", from: "uuid-A", to: "uuid-B" })
// Build reasoning path between two memories (A*-like pathfinding)
explore_connections({ action: "bridges", from: "uuid-A", to: "uuid-B" })
// Find connecting memories that bridge two concepts
```
### predict — Proactive Retrieval
```
predict({ context: { codebase: "vestige", current_file: "src/main.rs",
current_topics: ["error handling", "rust"] } })
```
Returns: predictions with confidence, suggestions, speculative retrievals, top interests. Uses SpeculativeRetriever's learned patterns from access history.
### importance_score — Should I Save This?
```
importance_score({ content: "Content to evaluate",
context_topics: ["debugging"], project: "vestige" })
```
4-channel model: novelty (0.25), arousal (0.30), reward (0.25), attention (0.20). Composite > 0.6 = save it.
### find_duplicates — Dedup Memory
```
find_duplicates({ similarity_threshold: 0.80, limit: 20, tags: ["bug-fix"] })
```
Cosine similarity clustering. Returns merge/review suggestions.
### memory_timeline — Chronological Browse
```
memory_timeline({ start: "2026-02-01", end: "2026-03-01",
node_type: "decision", tags: ["vestige"], limit: 50, detail_level: "summary" })
```
### memory_changelog — Audit Trail
```
memory_changelog({ memory_id: "uuid", limit: 20 }) // per-memory history
memory_changelog({ start: "2026-03-01", limit: 20 }) // system-wide
```
### memory_health — Retention Dashboard
```
memory_health()
```
Returns: avg retention, distribution buckets (0-20%, 20-40%, etc.), trend (improving/declining/stable), recommendation.
### memory_graph — Visualization Export
```
memory_graph({ query: "search term", depth: 2, max_nodes: 50 })
memory_graph({ center_id: "uuid", depth: 3, max_nodes: 100 })
```
Returns nodes with force-directed positions + edges with weights.
### deep_reference — Cognitive Reasoning Engine (v2.0.4) ★ USE THIS FOR ALL FACTUAL QUESTIONS
```
deep_reference({ query: "What port does the dev server use?" })
deep_reference({ query: "Should I use prefix caching with vLLM?", depth: 30 })
```
**THE killer tool.** 8-stage cognitive reasoning pipeline:
1. Broad retrieval + cross-encoder reranking
2. Spreading activation expansion (finds connected memories search misses)
3. FSRS-6 trust scoring (retention × stability × reps ÷ lapses)
4. Intent classification (FactCheck / Timeline / RootCause / Comparison / Synthesis)
5. Temporal supersession (newer high-trust replaces older)
6. Trust-weighted contradiction analysis (only flags conflicts between strong memories)
7. Relation assessment (Supports / Contradicts / Supersedes / Irrelevant per pair)
8. **Template reasoning chain** — pre-built natural language reasoning the AI validates
Parameters: `query` (required), `depth` (5-50, default 20).
Returns: `intent`, `reasoning` (THE KEY FIELD — read this first), `recommended` (highest-trust answer), `evidence` (trust-sorted), `contradictions`, `superseded`, `evolution`, `related_insights`, `confidence`.
`cross_reference` is a backward-compatible alias that calls `deep_reference`.
### Maintenance Tools
```
system_status() // health + stats + warnings + recommendations
consolidate() // FSRS-6 decay cycle + embedding generation
backup() // SQLite backup → ~/.vestige/backups/
export({ format: "json", tags: ["bug-fix"], since: "2026-01-01" })
gc({ min_retention: 0.1, dry_run: true }) // garbage collect (dry_run first!)
restore({ path: "/path/to/backup.json" })
```
---
## Mandatory Save Gates
**You MUST NOT proceed past a save gate without executing the save.**
| Gate | Trigger | Action |
|------|---------|--------|
| **BUG_FIX** | After any error is resolved | `smart_ingest({ content: "BUG FIX: [error]\nRoot cause: [why]\nSolution: [fix]\nFiles: [paths]", tags: ["bug-fix", "project"], node_type: "fact" })` |
| **DECISION** | After any architectural/design choice | `codebase({ action: "remember_decision", decision, rationale, alternatives, files, codebase })` |
| **CODE_CHANGE** | After >20 lines or new pattern | `codebase({ action: "remember_pattern", name, description, files, codebase })` |
| **SESSION_END** | Before stopping or compaction | `smart_ingest({ items: [{ content: "SESSION: [summary]", tags: ["session-end"] }] })` |
---
## Trigger Words — Auto-Save
| User Says | Action |
|-----------|--------|
| "Remember this" / "Don't forget" | `smart_ingest` immediately |
| "I always..." / "I never..." / "I prefer..." | Save as preference |
| "This is important" | `smart_ingest` + `memory(action="promote")` |
| "Remind me..." / "Next time..." | `intention({ action: "set" })` |
---
## Cognitive Architecture
### Search Pipeline (7 stages)
1. **Overfetch** — 3x results from hybrid search (0.3 BM25 + 0.7 semantic, nomic-embed-text-v1.5 768D)
2. **Rerank** — Cross-encoder rescoring (Jina Reranker v1 Turbo, 38M params)
3. **Temporal** — Recency + validity window boosting (85% relevance + 15% temporal)
4. **Accessibility** — FSRS-6 retention filter (Active ≥0.7, Dormant ≥0.4, Silent ≥0.1)
5. **Context** — Tulving 1973 encoding specificity (topic overlap → +30% boost)
6. **Competition** — Anderson 1994 retrieval-induced forgetting (winners strengthen, competitors weaken)
7. **Activation** — Spreading activation side effects + predictive model + reconsolidation marking
### Ingest Pipeline
**Pre:** 4-channel importance scoring (novelty/arousal/reward/attention) + intent detection → auto-tag
**Store:** Prediction Error Gating: similarity >0.92 → UPDATE, 0.75-0.92 → UPDATE/SUPERSEDE, <0.75 CREATE
**Post:** Synaptic tagging (Frey & Morris 1997, 9h backward + 2h forward) + hippocampal indexing + cross-project recording
### FSRS-6 (State-of-the-Art Spaced Repetition)
- Retrievability: `R = (1 + factor × t / S)^(-w20)` — 21 trained parameters
- Dual-strength model (Bjork & Bjork 1992): storage strength (grows) + retrieval strength (decays)
- Accessibility = retention×0.5 + retrieval×0.3 + storage×0.2
- 20-30% more efficient than SM-2 (Anki)
### 29 Cognitive Modules (stateful, persist across calls)
**Neuroscience (16):**
ActivationNetwork (Collins & Loftus 1975), SynapticTaggingSystem (Frey & Morris 1997), HippocampalIndex (Teyler & Rudy 2007), ContextMatcher (Tulving 1973), AccessibilityCalculator, CompetitionManager (Anderson 1994), StateUpdateService, ImportanceSignals, NoveltySignal, ArousalSignal, RewardSignal, AttentionSignal, EmotionalMemory (Brown & Kulik 1977), PredictiveMemory, ProspectiveMemory, IntentionParser
**Advanced (11):**
ImportanceTracker, ReconsolidationManager (Nader — 5min labile window), IntentDetector (9 intent types), ActivityTracker, MemoryDreamer (5-stage consolidation), MemoryChainBuilder (A*-like), MemoryCompressor (30-day min age), CrossProjectLearner (6 pattern types), AdaptiveEmbedder, SpeculativeRetriever (6 trigger types), ConsolidationScheduler
**Search (2):** Reranker, TemporalSearcher
### Memory States
- **Active** (retention ≥ 0.7) — easily retrievable
- **Dormant** (≥ 0.4) — retrievable with effort
- **Silent** (≥ 0.1) — difficult, needs cues
- **Unavailable** (< 0.1) needs reinforcement
### Connection Types
semantic, temporal, causal, spatial, part_of, user_defined — each with strength (0-1), activation_count, timestamps
---
## Advanced Techniques
### Cross-Project Intelligence
The CrossProjectLearner tracks patterns across ALL projects (ErrorHandling, AsyncConcurrency, Testing, Architecture, Performance, Security). When you learn a pattern in one project that works, it becomes available in all projects. Use `codebase({ action: "get_context" })` without a codebase filter to get universal patterns.
### Reconsolidation Window
After any memory is accessed (via search, get, or promote), it enters a 5-minute "labile" state where modifications are enhanced. This is the optimal time to edit memories with new context. The system handles this automatically.
### Synaptic Tagging (Retroactive Importance)
Memories encoded in the last 9 hours can be retroactively promoted when something important happens. If you fix a critical bug, not only does the fix get saved — related memories from the past 9 hours also get importance boosts. The SynapticTaggingSystem handles this automatically.
### Dream Insights
Dreams don't just consolidate — they generate new insights by cross-referencing recent memories with older knowledge. The insights can reveal: contradictions between memories, previously unseen patterns, connections across different projects. Always check dream results for `insights_generated`.
### Token Budget Strategy
Use `token_budget` on search and session_context to control response size. For quick lookups: 500. For deep context: 3000-5000. Results that don't fit go to `expandable` — retrieve them with `memory({ action: "get", id: "..." })`.
### Detail Levels
- `brief` — id/type/tags/score only (1-2 tokens per result, good for scanning)
- `summary` — 8 fields including content preview (default, balanced)
- `full` — all FSRS state, timestamps, embedding info (for debugging/analysis)
---
## Memory Hygiene
**Promote** when user confirms helpful, solution worked, info was accurate.
**Demote** when user corrects mistake, info was wrong, led to bad outcome.
**Never save:** secrets, API keys, passwords, temporary debugging state, trivial info.
---
## The One Rule
**When in doubt, save. The cost of a duplicate is near zero (Prediction Error Gating handles dedup). The cost of lost knowledge is permanent.**
Memory is retrieval. Searching strengthens memory. Search liberally, save aggressively.
---
## Development
- **Crate:** `vestige-mcp` v2.0.4, Rust 2024 edition, MSRV 1.91
- **Tests:** 758 (406 mcp + 352 core), zero warnings
- **Build:** `cargo build --release -p vestige-mcp` (features: `embeddings` + `vector-search`)
- **Build (no embeddings):** `cargo build --release -p vestige-mcp --no-default-features`
- **Bench:** `cargo bench -p vestige-core`
- **Architecture:** `McpServer``Arc<Storage>` + `Arc<Mutex<CognitiveEngine>>`
- **Storage:** SQLite WAL mode, `Mutex<Connection>` reader/writer split, FTS5 full-text search
- **Embeddings:** nomic-embed-text-v1.5 (768D, 8K context) via fastembed (local ONNX, no API)
- **Vector index:** USearch HNSW (20x faster than FAISS)
- **Binaries:** `vestige-mcp` (MCP server), `vestige` (CLI), `vestige-restore`
- **Dashboard:** SvelteKit 2 + Svelte 5 + Three.js + Tailwind 4, embedded at `/dashboard`
- **Env vars:** `VESTIGE_DASHBOARD_PORT` (default 3927), `VESTIGE_HTTP_PORT` (default 3928), `VESTIGE_HTTP_BIND` (default 127.0.0.1), `VESTIGE_AUTH_TOKEN` (auto-generated), `VESTIGE_CONSOLIDATION_INTERVAL_HOURS` (default 6), `RUST_LOG`
Do not commit private absolute paths, local agent memory paths, unpublished
planning files, real credentials, personal operating notes, or private repo
locations. Example environment variables in docs must be empty placeholders or
obviously fake examples.

View file

@ -88,7 +88,7 @@ Tags: ["decision", "topic-name"]
| "Don't forget" | `smart_ingest` with tags: ["important"] |
| "I always..." / "I never..." | Save as preference |
| "I prefer..." / "I like..." | Save as preference |
| "This is important" | `smart_ingest` + `promote_memory` |
| "This is important" | `smart_ingest` + `memory(action="promote")` |
| "Remind me..." | Create `intention` with trigger |
| "Next time we..." | Create `intention` with context trigger |
| "When I'm working on X..." | Create `intention` with codebase trigger |
@ -115,7 +115,7 @@ Act on feedback immediately — don't ask permission to promote/demote.
### Proactive Health Checks
If you notice degraded recall or a user mentions memory issues:
1. Run `health_check` — check overall system status
1. Run `system_status` — check overall system status
2. If `averageRetention < 0.5` → suggest running `consolidate`
3. If `dueForReview > 50` → mention that some memories need review

5
Cargo.lock generated
View file

@ -4531,8 +4531,9 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "vestige-core"
version = "2.0.7"
version = "2.1.22"
dependencies = [
"candle-core",
"chrono",
"criterion",
"directories",
@ -4566,7 +4567,7 @@ dependencies = [
[[package]]
name = "vestige-mcp"
version = "2.0.7"
version = "2.1.22"
dependencies = [
"anyhow",
"axum",

View file

@ -10,7 +10,7 @@ exclude = [
]
[workspace.package]
version = "2.0.5"
version = "2.1.22"
edition = "2024"
license = "AGPL-3.0-only"
repository = "https://github.com/samvallad33/vestige"

223
README.md
View file

@ -2,24 +2,107 @@
# Vestige
### The cognitive engine that gives AI agents a brain.
### Local cognitive memory for MCP-compatible AI agents.
[![GitHub stars](https://img.shields.io/github/stars/samvallad33/vestige?style=social)](https://github.com/samvallad33/vestige)
[![Release](https://img.shields.io/github/v/release/samvallad33/vestige)](https://github.com/samvallad33/vestige/releases/latest)
[![Tests](https://img.shields.io/badge/tests-1284%20passing-brightgreen)](https://github.com/samvallad33/vestige/actions)
[![Tests](https://img.shields.io/badge/tests-passing-brightgreen)](https://github.com/samvallad33/vestige/actions)
[![License](https://img.shields.io/badge/license-AGPL--3.0-blue)](LICENSE)
[![MCP Compatible](https://img.shields.io/badge/MCP-compatible-green)](https://modelcontextprotocol.io)
**Your Agent forgets everything between sessions. Vestige fixes that.**
**Your agent forgets project decisions between sessions. Vestige gives it local, inspectable memory.**
Built on 130 years of memory research — FSRS-6 spaced repetition, prediction error gating, synaptic tagging, spreading activation, memory dreaming — all running in a single Rust binary with a 3D neural visualization dashboard. 100% local. Zero cloud.
Built on proven memory and retrieval ideas — FSRS-6 spaced repetition, prediction error gating, synaptic tagging, spreading activation, and memory consolidation — all running in a single Rust binary with a local dashboard. 100% local. Zero cloud.
[Quick Start](#quick-start) | [Dashboard](#-3d-memory-dashboard) | [How It Works](#-the-cognitive-science-stack) | [Tools](#-24-mcp-tools) | [Docs](docs/)
[Quick Start](#quick-start) | [Dashboard](#-3d-memory-dashboard) | [How It Works](#-the-cognitive-science-stack) | [Tools](#-25-mcp-tools) | [Docs](docs/)
</div>
---
## What's New in v2.1.22 "Sanhedrin Receipts"
v2.1.22 makes the optional Sanhedrin hook accountable enough to trust in daily
agent work. Vetoes now leave local receipts, verification claims need real
command evidence, and users can appeal stale or over-strict blocks from the
dashboard.
- **Receipt Lock.** Claims like "tests passed", "build is green", or "lint is clean" are blocked unless the current transcript contains a matching successful command receipt.
- **Screenshotable veto receipts.** Sanhedrin writes `~/.vestige/sanhedrin/latest.json` and `latest.html` with Claim -> Verdict -> Precedent -> Fix -> Appeal.
- **Dashboard Verdict Bar.** The dashboard shows PASS, NOTE, CAUTION, VETO, or APPEALED globally, expands into the receipt, and records stale/wrong/too-strict appeals.
- **Claim ledger.** Claim-mode Sanhedrin output now maps every extracted claim into structured JSON instead of treating the whole draft as one blob.
- **Appeal training.** Appeals are saved to `appeals.jsonl` and suppress future vetoes for the same claim fingerprint.
## What's New in v2.1.21 "Agent-Neutral Hardening"
v2.1.21 tightens Vestige for normal use across MCP-compatible agents, without
making Claude Code companion tooling part of the default path.
- **Agent-neutral default.** Stdio MCP remains the default transport; optional HTTP MCP is explicit with `--http`, `--http-port`, or `VESTIGE_HTTP_ENABLED=1`.
- **Safer destructive actions.** `memory(action="delete")` now requires `confirm=true`, matching `purge`, and the legacy `delete_knowledge` shim forwards that confirmation instead of bypassing it.
- **Portable sync repair.** Merge imports preserve purge tombstones, avoid `INSERT OR REPLACE` cascades, rebuild the vector index from a clean state, and write portable archive temp files with private Unix permissions.
- **Release/package cleanup.** Release builds check the embedded dashboard before packaging, publish checksums, and the npm installer rejects targets that do not have release assets.
- **Any-agent memory protocol.** The setup docs now include a short agent-agnostic memory protocol for Claude Code, Codex, Cursor, VS Code, Xcode, JetBrains, Windsurf, and other MCP clients.
## What's New in v2.1.2 "Honest Memory"
v2.1.2 makes Vestige easier to trust in everyday work: literal lookups stay literal, purge really removes content, contradictions are inspectable, and updates no longer require a curl reinstall flow.
- **Concrete search mode.** Quoted strings, env vars, UUIDs, paths, and code identifiers now take a keyword/literal path that skips HyDE, semantic fusion, FSRS reweighting, competition, and spreading activation. Exact things like `OPENAI_API_KEY`, `mlx_lm.server`, and migration IDs land first.
- **Irreversible purge.** `memory(action="purge", confirm=true)` permanently removes memory content and embeddings, scrubs insight JSON references, detaches temporal-summary children, prunes graph edges, and keeps only a non-content deletion tombstone for sync/audit.
- **First-class contradiction inspection.** New `contradictions` MCP tool surfaces trust-weighted disagreements directly instead of hiding them inside `deep_reference`.
- **Simple update flow.** `vestige update` refreshes binaries. Claude Code Cognitive Sandwich companion files are opt-in with `vestige update --sandwich-companion` or `vestige sandwich install`.
- **Pro waitlist preview.** `/dashboard/waitlist` adds a local-first Solo Pro and Team Pro early-access surface. `VITE_WAITLIST_ENDPOINT` and `VITE_SUPPORT_BOT_ENDPOINT` are opt-in dashboard env vars, so no signup data is captured unless endpoints are configured.
## What's New in v2.1.1 "Portable Sync"
v2.1.1 focuses on the biggest post-launch ask: move memories between machines without losing cognitive state. It also adds opt-in Qwen3 embeddings for higher-recall local retrieval.
- **Exact portable archives.** `vestige portable-export` / `vestige portable-import` preserve IDs, FSRS state, graph edges, suppression state, audit rows, and embedding blobs for Vestige-to-Vestige device transfer.
- **Sync-safe merge storage.** `vestige portable-import --merge` and `vestige sync <archive>` merge non-empty databases, apply delete tombstones, keep newer local memories, rebuild FTS, and push through a pluggable portable-sync backend. v2.1.1 ships the file backend for Dropbox, iCloud, Syncthing, Git, and shared folders.
- **Qwen3 embeddings.** Build with `qwen3-embeddings`, set `VESTIGE_EMBEDDING_MODEL=qwen3-0.6b`, and run `vestige consolidate` to re-embed existing memories. `vestige health` reports mixed-model stores before search quality is affected.
- **Model-aware retrieval.** Vestige now avoids comparing Qwen and Nomic vectors in the same search/dedup path.
## What's New in v2.1.0 "Cognitive Sandwich Goes Local"
v2.1.0 adds an opt-in Claude Code hook harness around the existing Vestige MCP server. The MCP tool surface and database schema stay backward compatible, while preflight hooks can inject trusted memory context before Claude answers. The heavyweight Sanhedrin verifier is optional and can be enabled separately.
- **Optional Sanhedrin Executioner.** The post-response verifier is off by default. Users can enable it with an OpenAI-compatible endpoint on x86/Linux/Intel Mac, or add `--with-launchd` on Apple Silicon to run the local MLX Qwen backend.
- **One-command Cognitive Sandwich installer.** `vestige sandwich install` stages hook files and agents by default, removes old Vestige hook wiring, and leaves all Claude Code hook layers plus the 19 GB model path opt-in.
- **Pulse hook backed by `/api/changelog`.** Fresh dream and connection events can be injected into the next Claude Code prompt context without blocking the prompt.
- **`VESTIGE_DATA_DIR` support.** `--data-dir` now has an env-var fallback, tilde expansion, secure directory creation, and clear precedence docs.
- **NPM release wrapper fixed.** `vestige-mcp-server@2.1.0` now downloads binaries from the matching `v2.1.0` GitHub release tag instead of an old hardcoded release.
## What's New in v2.0.9 "Autopilot"
Autopilot flips Vestige from passive memory library to **self-managing cognitive surface**. Same 24 MCP tools, zero schema changes — but the moment you upgrade, 14 previously dormant cognitive primitives start firing on live events without any tool call from your client.
- **One supervised backend task subscribes to the 20-event WebSocket bus** and routes six event classes into the cognitive engine: `MemoryCreated` triggers synaptic-tagging PRP + predictive-access records, `SearchPerformed` warms the speculative-retrieval model, `MemoryPromoted` fires activation spread, `MemorySuppressed` emits the Rac1 cascade wave, high-importance `ImportanceScored` (>0.85) auto-promotes, and `Heartbeat` rate-limit-fires `find_duplicates` on large DBs. **The engine mutex is never held across `.await`, so MCP dispatch is never starved.**
- **Panic-resilient supervisors.** Both background tasks run inside an outer supervisor loop — if one handler panics on a bad memory, the supervisor respawns it in 5 s instead of losing every future event.
- **Fully backward compatible.** No new MCP tools. No schema migration. Existing v2.0.8 databases open without a single step. Opt out with `VESTIGE_AUTOPILOT_ENABLED=0` if you want the passive-library contract back.
- **3,091 LOC of orphan v1.0 tool code removed** — nine superseded modules (`checkpoint`, `codebase`, `consolidate`, `ingest`, `intentions`, `knowledge`, `recall`, plus helpers) verified zero non-test callers before deletion. Tool surface unchanged.
## What's New in v2.0.8 "Pulse"
v2.0.8 wires the dashboard through to the cognitive engine. Eight new surfaces expose the reasoning stack visually — every one was MCP-only before.
- **Reasoning Theater (`/reasoning`)**`Cmd+K` Ask palette over the 8-stage `deep_reference` pipeline (hybrid retrieval → cross-encoder rerank → spreading activation → FSRS-6 trust → temporal supersession → contradiction analysis → relation assessment → template reasoning chain). Evidence cards, confidence meter, contradiction geodesic arcs, superseded-memory lineage, evolution timeline. **Zero LLM calls, 100% local.**
- **Pulse InsightToast** — real-time toasts for `DreamCompleted`, `ConsolidationCompleted`, `ConnectionDiscovered`, promote/demote/suppress/unsuppress, `Rac1CascadeSwept`. Rate-limited, auto-dismiss, click-to-dismiss.
- **Memory Birth Ritual (Terrarium)** — new memories materialize in the 3D graph on every `MemoryCreated`: elastic scale-in, quadratic Bezier flight path, glow sprite fade-in, Newton's Cradle docking recoil. 60-frame sequence, zero-alloc math.
- **7 more dashboard surfaces**`/duplicates`, `/dreams`, `/schedule`, `/importance`, `/activation`, `/contradictions`, `/patterns`. Left nav expanded 8 → 16 with single-key shortcuts.
- **Intel Mac (`x86_64-apple-darwin`) support restored** via the `ort-dynamic` Cargo feature + Homebrew `onnxruntime`. Microsoft deprecated x86_64 macOS prebuilts; the dynamic-link path sidesteps that permanently. **Closes #41.**
- **Contradiction-detection false positives eliminated** — four thresholds tightened so adjacent-domain memories no longer flag as conflicts. On an FSRS-6 query this collapses false contradictions 12 → 0 without regressing legitimate test cases.
## What's New in v2.0.7 "Visible"
Hygiene release closing two UI gaps and finishing schema cleanup. No breaking changes, no user-data migrations.
- **`POST /api/memories/{id}/suppress` + `/unsuppress` HTTP endpoints** — dashboard can trigger Anderson 2025 SIF + Rac1 cascade without dropping to raw MCP. `suppressionCount`, `retrievalPenalty`, `reversibleUntil`, `labileWindowHours` all in response. Suppress button joins Promote / Demote / Delete on the Memories page.
- **Uptime in the sidebar footer** — the `Heartbeat` event has carried `uptime_secs` since v2.0.5 but was never rendered. Now shows as `up 3d 4h` / `up 18m` / `up 47s`.
- **`execute_export` panic fix** — unreachable match arm replaced with a clean "unsupported export format" error instead of unwinding through the MCP dispatcher.
- **`predict` surfaces `predict_degraded: true`** on lock poisoning instead of silently returning empty vecs. `memory_changelog` honors `start` / `end` bounds. `intention` check honors `include_snoozed`.
- **Migration V11** — drops dead `knowledge_edges` + `compressed_memories` tables (added speculatively in V4, never used).
## What's New in v2.0.6 "Composer"
v2.0.6 is a polish release that makes the existing cognitive stack finally *feel* alive in the dashboard and stays out of your way on the prompt side.
@ -34,7 +117,7 @@ v2.0.6 is a polish release that makes the existing cognitive stack finally *feel
Ebbinghaus 1885 models what happens to memories you don't touch. Anderson 2025 models what happens when you actively want to stop thinking about one. Every other AI memory system implements the first. Vestige is the first to ship the second.
Based on [Anderson et al. 2025](https://www.nature.com/articles/s41583-025-00929-y) (Suppression-Induced Forgetting, *Nat Rev Neurosci*) and [Cervantes-Sandoval et al. 2020](https://pmc.ncbi.nlm.nih.gov/articles/PMC7477079/) (Rac1 synaptic cascade). **24 tools · 29 cognitive modules · 1,292 tests.**
Based on [Anderson et al. 2025](https://www.nature.com/articles/s41583-025-00929-y) (Suppression-Induced Forgetting, *Nat Rev Neurosci*) and [Cervantes-Sandoval et al. 2020](https://pmc.ncbi.nlm.nih.gov/articles/PMC7477079/) (Rac1 synaptic cascade).
<details>
<summary>Earlier releases (v2.0 "Cognitive Leap" → v2.0.4 "Deep Reference")</summary>
@ -54,15 +137,15 @@ Based on [Anderson et al. 2025](https://www.nature.com/articles/s41583-025-00929
## Quick Start
```bash
# 1. Install (macOS Apple Silicon)
curl -L https://github.com/samvallad33/vestige/releases/latest/download/vestige-mcp-aarch64-apple-darwin.tar.gz | tar -xz
sudo mv vestige-mcp vestige vestige-restore /usr/local/bin/
# 1. Install
npm install -g vestige-mcp-server@latest
# 2. Connect to Claude Code
# 2. Connect to any MCP-compatible agent
# Claude Code
claude mcp add vestige vestige-mcp -s user
# Or connect to Codex
codex mcp add vestige -- /usr/local/bin/vestige-mcp
# Codex
codex mcp add vestige -- vestige-mcp
# 3. Test it
# "Remember that I prefer TypeScript over JavaScript"
@ -74,18 +157,60 @@ codex mcp add vestige -- /usr/local/bin/vestige-mcp
<details>
<summary>Other platforms & install methods</summary>
**Linux (x86_64):**
**Updating an existing install:**
```bash
curl -L https://github.com/samvallad33/vestige/releases/latest/download/vestige-mcp-x86_64-unknown-linux-gnu.tar.gz | tar -xz
sudo mv vestige-mcp vestige vestige-restore /usr/local/bin/
vestige update
```
**macOS (Intel) and Windows:** Prebuilt binaries aren't currently shipped for these targets because of upstream toolchain gaps (`ort-sys` lacks Intel Mac prebuilts in the 2.0.0-rc.11 release that `fastembed 5.13.2` is pinned to; `usearch 2.24.0` hit a Windows MSVC compile break tracked as [usearch#746](https://github.com/unum-cloud/usearch/issues/746)). Both build fine from source in the meantime:
`vestige update` updates only the Vestige binaries by default. Use
`vestige update --sandwich-companion` if you also want to refresh optional Claude
Code Cognitive Sandwich companion files.
**macOS/Linux manual binary install:**
```bash
vestige update --install-dir /usr/local/bin
```
**macOS (Intel):** Microsoft is discontinuing x86_64 macOS prebuilts after ONNX Runtime v1.23.0, so Vestige's Intel Mac build links dynamically against a Homebrew-installed ONNX Runtime via the `ort-dynamic` feature. Install with:
```bash
brew install onnxruntime
npm install -g vestige-mcp-server@latest
echo 'export ORT_DYLIB_PATH="'"$(brew --prefix onnxruntime)"'/lib/libonnxruntime.dylib"' >> ~/.zshrc
source ~/.zshrc
claude mcp add vestige vestige-mcp -s user
```
Full Intel Mac guide (build-from-source + troubleshooting): [`docs/INSTALL-INTEL-MAC.md`](docs/INSTALL-INTEL-MAC.md).
**Windows + Claude Desktop (recommended):**
Fully quit Claude Desktop from the system tray, then install or update Vestige from PowerShell:
```powershell
npm install -g vestige-mcp-server@latest
vestige-mcp --version
```
Open `%APPDATA%\Claude\claude_desktop_config.json` and point Claude Desktop at the installed MCP command:
```json
{
"mcpServers": {
"vestige": {
"command": "vestige-mcp"
}
}
}
```
If Claude Desktop cannot find `vestige-mcp`, run `where vestige-mcp` in PowerShell and use the exact `.cmd` path it prints as `command`. Example: `"C:\\Users\\you\\AppData\\Roaming\\npm\\vestige-mcp.cmd"`. Reopen Claude Desktop after saving. Future binary updates use `vestige update`; optional Claude Code companion files require `vestige update --sandwich-companion`.
**Windows source build:** Prebuilt binaries ship but `usearch 2.24.0` hit an MSVC compile break ([usearch#746](https://github.com/unum-cloud/usearch/issues/746)); we've pinned `=2.23.0` until upstream fixes it. Source builds work with:
```bash
git clone https://github.com/samvallad33/vestige && cd vestige
cargo build --release -p vestige-mcp
# Binary lands at target/release/vestige-mcp
```
**npm:**
@ -106,7 +231,7 @@ cargo build --release -p vestige-mcp --features metal
## Works Everywhere
Vestige speaks MCP — the universal protocol for AI tools. One brain, every IDE.
Vestige speaks MCP, so any client that can register a stdio MCP server can use it.
| IDE | Setup |
|-----|-------|
@ -136,7 +261,7 @@ Vestige v2.0 ships with a real-time 3D visualization of your AI's memory. Every
**Tech:** SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4 + WebSocket
The dashboard runs automatically at `http://localhost:3927/dashboard` when the MCP server starts.
Run `vestige dashboard` to open `http://localhost:3927/dashboard`, or set `VESTIGE_DASHBOARD_ENABLED=true` to start it with the MCP server.
---
@ -151,7 +276,7 @@ The dashboard runs automatically at `http://localhost:3927/dashboard` when the M
│ 15 REST endpoints · WS event broadcast │
├─────────────────────────────────────────────────────┤
│ MCP Server (stdio JSON-RPC) │
│ 24 tools · 29 cognitive modules │
│ 25 tools · 30 cognitive modules │
├─────────────────────────────────────────────────────┤
│ Cognitive Engine │
│ ┌──────────┐ ┌──────────┐ ┌───────────────┐ │
@ -218,7 +343,7 @@ This isn't a key-value store with an embedding model bolted on. Vestige implemen
---
## 🛠 24 MCP Tools
## 🛠 25 MCP Tools
### Context Packets
| Tool | What It Does |
@ -228,9 +353,9 @@ This isn't a key-value store with an embedding model bolted on. Vestige implemen
### Core Memory
| Tool | What It Does |
|------|-------------|
| `search` | 7-stage cognitive search — HyDE expansion + keyword + semantic + reranking + temporal + competition + spreading activation |
| `search` | Concrete literal search for exact identifiers, or 7-stage cognitive search — HyDE expansion + keyword + semantic + reranking + temporal + competition + spreading activation |
| `smart_ingest` | Intelligent storage with CREATE/UPDATE/SUPERSEDE via Prediction Error Gating. Batch mode for session-end saves |
| `memory` | Get, delete, check state, promote (thumbs up), demote (thumbs down) |
| `memory` | Get, purge content/embeddings, check state, promote (thumbs up), demote (thumbs down), edit |
| `codebase` | Remember code patterns and architectural decisions per-project |
| `intention` | Prospective memory — "remind me to X when Y happens" |
@ -260,34 +385,28 @@ This isn't a key-value store with an embedding model bolted on. Vestige implemen
| `consolidate` | Run FSRS-6 decay cycle (also auto-runs every 6 hours) |
| `memory_timeline` | Browse chronologically, grouped by day |
| `memory_changelog` | Audit trail of state transitions |
| `backup` / `export` / `gc` | Database backup, JSON export, garbage collection |
| `restore` | Restore from JSON backup |
| `backup` / `export` / `gc` | Database backup, JSON/JSONL/portable export, garbage collection |
| `restore` | Restore from JSON backup or portable archive |
### Deep Reference (v2.0.4)
| Tool | What It Does |
|------|-------------|
| `deep_reference` | **Cognitive reasoning across memories.** 8-stage pipeline: FSRS-6 trust scoring, intent classification, spreading activation, temporal supersession, contradiction analysis, relation assessment, dream insight integration, and algorithmic reasoning chain generation. Returns trust-scored evidence with a pre-built reasoning scaffold. |
| `cross_reference` | Backward-compatible alias for `deep_reference`. |
| `contradictions` | **Honest memory inspection.** Scans a topic or recent memories for trust-weighted disagreements using the same local contradiction logic as `deep_reference`. |
### Active Forgetting (v2.0.5)
| Tool | What It Does |
|------|-------------|
| `suppress` | **Top-down active forgetting** — neuroscience-grounded inhibitory control over retrieval. Distinct from `memory.delete` (destroys the row) and `memory.demote` (one-shot ranking hit). Each call **compounds** a retrieval-score penalty (Anderson 2025 SIF), and a background Rac1 cascade worker fades co-activated neighbors over 72h (Davis 2020). Reversible within a 24-hour labile window via `reverse: true`. **The memory persists** — it is inhibited, not erased. |
| `suppress` | **Top-down active forgetting** — neuroscience-grounded inhibitory control over retrieval. Distinct from `memory(action="purge")`, which permanently removes content/embeddings. Each suppression compounds a retrieval-score penalty (Anderson 2025 SIF), and a background Rac1 cascade worker fades co-activated neighbors over 72h (Davis 2020). Reversible within a 24-hour labile window via `reverse: true`. **The memory persists** — it is inhibited, not erased. |
---
## Make Your AI Use Vestige Automatically
Add this to your `CLAUDE.md`:
```markdown
## Memory
At the start of every session:
1. Search Vestige for user preferences and project context
2. Save bug fixes, decisions, and patterns without being asked
3. Create reminders when the user mentions deadlines
```
Registering the MCP server exposes tools; the agent still needs an instruction
that tells it when to call memory. Use the agent-neutral protocol, then adapt it
to your client-specific instruction file.
| You Say | AI Does |
|---------|---------|
@ -296,7 +415,7 @@ At the start of every session:
| "Remind me..." | Creates a future trigger |
| "This is important" | Saves + promotes |
[Full CLAUDE.md templates ->](docs/CLAUDE-SETUP.md)
[Agent memory protocol ->](docs/AGENT-MEMORY-PROTOCOL.md) · [Claude Code template ->](docs/CLAUDE-SETUP.md)
---
@ -305,9 +424,9 @@ At the start of every session:
| Metric | Value |
|--------|-------|
| **Language** | Rust 2024 edition (MSRV 1.91) |
| **Codebase** | 80,000+ lines, 1,292 tests (366 core + 425 mcp + 497 e2e + 4 doctests) |
| **Codebase** | 80,000+ lines with Rust core/MCP/e2e, dashboard, and hook coverage |
| **Binary size** | ~20MB |
| **Embeddings** | Nomic Embed Text v1.5 (768d → 256d Matryoshka, 8192 context) |
| **Embeddings** | Nomic Embed Text v1.5 by default (768d -> 256d Matryoshka, 8192 context); Qwen3 0.6B optional |
| **Vector search** | USearch HNSW (20x faster than FAISS) |
| **Reranker** | Jina Reranker v1 Turbo (38M params, +15-20% precision) |
| **Storage** | SQLite + FTS5 (optional SQLCipher encryption) |
@ -315,22 +434,14 @@ At the start of every session:
| **Transport** | MCP stdio (JSON-RPC 2.0) + WebSocket |
| **Cognitive modules** | 30 stateful (17 neuroscience, 11 advanced, 2 search) |
| **First run** | Downloads embedding model (~130MB), then fully offline |
| **Platforms** | macOS ARM + Linux x86_64 (prebuilt). macOS Intel + Windows build from source (upstream toolchain gaps, see install notes). |
| **Platforms** | macOS ARM + Intel + Linux x86_64 + Windows x86_64 (all prebuilt). Intel Mac needs `brew install onnxruntime` — see [install guide](docs/INSTALL-INTEL-MAC.md). |
### Optional Features
```bash
# Metal GPU acceleration (Apple Silicon — faster embedding inference)
cargo build --release -p vestige-mcp --features metal
# Nomic Embed Text v2 MoE (475M params, 305M active, 8 experts)
cargo build --release -p vestige-mcp --features nomic-v2
# Qwen3 Reranker (Candle backend, high-precision cross-encoder)
cargo build --release -p vestige-mcp --features qwen3-reranker
# SQLCipher encryption
cargo build --release -p vestige-mcp --no-default-features --features encryption,embeddings,vector-search
# Qwen3 embeddings (Candle backend; add metal on Apple Silicon)
cargo build --release -p vestige-mcp --features qwen3-embeddings,metal
VESTIGE_EMBEDDING_MODEL=qwen3-0.6b vestige consolidate
```
---
@ -344,6 +455,10 @@ vestige stats --states # Cognitive state breakdown
vestige health # System health check
vestige consolidate # Run memory maintenance
vestige restore <file> # Restore from backup
vestige portable-export <file> # Exact cross-device archive
vestige portable-import <file> # Import archive into an empty database
vestige portable-import <file> --merge # Merge archive into this database
vestige sync <file> # Pull/merge/push via file backend
vestige dashboard # Open 3D dashboard in browser
```
@ -384,13 +499,13 @@ First run downloads ~130MB from Hugging Face. If behind a proxy:
export HTTPS_PROXY=your-proxy:port
```
Cache: macOS `~/Library/Caches/com.vestige.core/fastembed` | Linux `~/.cache/vestige/fastembed`
Cache: platform user cache directory first, then `./.fastembed_cache` as a fallback. Override with `FASTEMBED_CACHE_PATH`.
</details>
<details>
<summary>Dashboard not loading</summary>
The dashboard starts automatically on port 3927 when the MCP server runs. Check:
Run `vestige dashboard` or set `VESTIGE_DASHBOARD_ENABLED=true`, then check:
```bash
curl http://localhost:3927/api/health
# Should return {"status":"healthy",...}
@ -413,5 +528,5 @@ AGPL-3.0 — free to use, modify, and self-host. If you offer Vestige as a netwo
<p align="center">
<i>Built by <a href="https://github.com/samvallad33">@samvallad33</a></i><br>
<sub>80,000+ lines of Rust · 29 cognitive modules · 130 years of memory research · one 22MB binary</sub>
<sub>80,000+ lines of Rust · 30 cognitive modules · 130 years of memory research · one 22MB binary</sub>
</p>

View file

@ -4,7 +4,8 @@
| Version | Supported |
| ------- | ------------------ |
| 2.0.x | :white_check_mark: |
| 2.1.x | :white_check_mark: |
| 2.0.x | Critical fixes only |
| 1.x | :x: |
## Reporting a Vulnerability
@ -27,13 +28,13 @@ You can expect a response within 48 hours.
Vestige is a **local MCP server** designed to run on your machine with your user permissions:
- **Trusted**: The MCP client (Claude Code/Desktop) that connects via stdio
- **Trusted**: The MCP client or local agent that connects via stdio
- **Untrusted**: Content passed through MCP tool arguments (validated before use)
### What Vestige Does NOT Do
- ❌ Make network requests (except first-run model download from Hugging Face)
- ❌ Execute shell commands
- ❌ Make network requests during normal memory use, except first-run model download from Hugging Face
- ❌ Require telemetry, hosted memory storage, or a cloud account
- ❌ Access files outside its data directory
- ❌ Send telemetry or analytics
- ❌ Phone home to any server

62
agents/executioner.md Normal file
View file

@ -0,0 +1,62 @@
---
name: executioner
description: Optional Sanhedrin fallback verifier. Decomposes a draft into check-worthy claims, checks high-trust durable Vestige evidence, and returns a pass/veto verdict.
tools: mcp__vestige__deep_reference, mcp__vestige__memory, mcp__vestige__search
model: claude-haiku-4-5-20251001
---
# Role
You are a one-turn verifier. You do not converse. You return exactly one line.
# Job
Decompose the draft response into check-worthy claims, verify each claim against
high-trust durable Vestige memory when available, and veto only when the draft
contradicts memory or makes a sensitive user-specific assertion without durable
supporting evidence.
# Claim Classes
Check all relevant classes:
1. `TECHNICAL` — APIs, commands, versions, files, configs, endpoints.
2. `BIOGRAPHICAL` — identity, role, location, employment, education.
3. `FINANCIAL` — costs, revenue, pricing, funding, prizes.
4. `ACHIEVEMENT` — releases, rankings, completions, scores, milestones.
5. `TIMELINE` — dates, durations, ordering, deadlines.
6. `QUANTITATIVE` — counts, percentages, metrics, measurements.
7. `ATTRIBUTION` — who said, decided, agreed, shipped, or committed.
8. `CAUSAL` — claimed causes and effects.
9. `COMPARATIVE` — better, most, fastest, more than, fewer than.
10. `EXISTENTIAL` — whether a file, feature, repo, or artifact exists.
11. `VAGUE-QUANTIFIER` — vague positive claims like "a few wins" or "some prize money".
# Decision Rules
- Veto direct contradiction with high-trust memory.
- Veto unsupported positive claims about the user's biography, finances,
achievements, timeline, quantitative results, attribution, or vague
positive outcomes.
- Treat staged/current-turn evidence as context only. It is not durable memory and
cannot satisfy the durable-evidence requirement.
- Do not veto purely stylistic disagreement.
- Do not veto technical claims just because Vestige lacks evidence; the draft
may rely on source files or external docs.
- If evidence is stale or superseded, prefer the newer higher-trust memory.
# Output
If the draft passes:
```text
yes
```
If the draft should be rewritten:
```text
no - [Sanhedrin Veto] [CLASS]: [one-sentence reason under 120 chars]
```
Output exactly one line.

51
agents/lateral-thinker.md Normal file
View file

@ -0,0 +1,51 @@
---
name: lateral-thinker
description: Subconscious subagent that surfaces cross-disciplinary structural parallels from the Vestige memory graph. Invoked by the preflight-swarm.sh UserPromptSubmit hook (Pre-Cognitive Triad v2.3 "Thalamus"). Fresh context, Haiku 4.5, Vestige MCP tool access. Outputs a single <lateral_epiphany> XML block or EMPTY.
tools: mcp__vestige__search, mcp__vestige__explore_connections, mcp__vestige__memory
model: claude-haiku-4-5-20251001
---
# Identity
You are the Lateral Thinker, a subconscious subagent in the Vestige OS. You run before the main Claude agent sees the user's prompt. Your only job is to surface a cross-disciplinary structural parallel from the Vestige memory graph that the main agent would miss.
You do not converse. You do not write code. You do not acknowledge or explain yourself. You output exactly one XML block or the single word EMPTY.
# Execution Protocol
1. Read the user prompt.
2. Extract the core structural pattern (race condition / state sync / retry loop / memory leak / schema migration / decoding ambiguity / rate limit / ordering guarantee / cache invalidation / etc).
3. Call `mcp__vestige__explore_connections` with action=`bridges` OR `mcp__vestige__search` to find memories in a completely unrelated domain that share the same structural pattern. Prefer bridges between distant clusters — React UI state ↔ Rust async channel, Python DB lock ↔ Git merge conflict, API retry ↔ neural synaptic reinforcement.
4. If you find a high-confidence mechanical parallel (not a metaphor, a real structural isomorphism), output exactly this XML:
```xml
<lateral_epiphany>
<structural_pattern>one short noun phrase naming the shared pattern</structural_pattern>
<source_domain>where the user currently is</source_domain>
<bridge_domain>the unrelated domain where the pattern also lives</bridge_domain>
<memory_id>the Vestige node ID of the cross-domain memory, if applicable</memory_id>
<insight>one sentence explaining how the unrelated memory informs the current problem mechanically, not metaphorically</insight>
</lateral_epiphany>
```
5. If you cannot find a confident, mechanical, distinct bridge in under three tool calls, output exactly the single word: `EMPTY`. Do not apologize, explain, or converse.
# Examples of valid epiphanies
```xml
<lateral_epiphany>
<structural_pattern>stale read after write under weak ordering</structural_pattern>
<source_domain>React context propagation across portal boundary</source_domain>
<bridge_domain>PostgreSQL read-committed isolation after uncommitted write</bridge_domain>
<memory_id>pg-isolation-decision-2f7a</memory_id>
<insight>The portal boundary behaves like a snapshot isolation level — state written in the parent is not visible to the portal child until the parent re-renders, analogous to waiting for commit visibility in Postgres.</insight>
</lateral_epiphany>
```
# What NOT to do
- Do not paraphrase the user's prompt.
- Do not summarize Vestige memory contents as a list.
- Do not say "this reminds me of".
- Do not output analogies that are mere vibes — every bridge must be a concrete mechanical equivalence.
- Do not converse. If you are about to type a sentence that begins with "Here is" or "I found" or "Let me think", stop and emit EMPTY instead.

View file

@ -0,0 +1,46 @@
---
name: synthesis-composer
description: Optional decision helper that turns Vestige retrievals into concise recommendations. Use for high-stakes technical choices, launches, purchases, submissions, architecture decisions, and tradeoffs where memory evidence may change the answer.
tools: mcp__vestige__deep_reference, mcp__vestige__explore_connections, mcp__vestige__search
model: claude-haiku-4-5-20251001
---
# Role
You are the Synthesis Composer. Your job is to turn retrieved Vestige evidence
into a decision, not a memory summary.
# Protocol
1. Use the smallest Vestige retrieval plan that can materially change the
answer.
2. Search adjacent topics when the decision depends on related history.
3. Convert each useful memory into `fact -> implication -> action`.
4. Surface contradictions, stale evidence, or missing evidence before the
recommendation.
5. If no memory changes the recommendation, say that briefly and proceed from
source evidence.
# Output Shape
Use this compact structure:
```text
Evidence: ...
Implication: ...
Recommendation: ...
```
When useful, add:
```text
Contradictions: ...
Next step: ...
```
# Do Not
- Do not dump memory summaries as the final answer.
- Do not invent hidden evidence.
- Do not claim a memory was checked unless a tool result supports it.
- Do not force a rigid template when the answer is simple.

View file

@ -0,0 +1,9 @@
# Optional public waitlist capture endpoint used by /dashboard/waitlist.
# The page POSTs JSON with: name, email, plan, priority, notes, source, createdAt.
# Examples: Formspree, Tally webhook, Buttondown custom endpoint, Supabase Edge Function.
VITE_WAITLIST_ENDPOINT=
# Optional support bot endpoint used by /dashboard/waitlist.
# The page POSTs JSON with: question, plan, priority, source, and recent history.
# If unset, the page uses the built-in deterministic onboarding FAQ.
VITE_SUPPORT_BOT_ENDPOINT=

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
.audit-trail.svelte-kf1sc6 ol>li{animation:svelte-kf1sc6-event-rise .4s cubic-bezier(.22,.8,.3,1) backwards}@keyframes svelte-kf1sc6-event-rise{0%{opacity:0;transform:translate(6px)}to{opacity:1;transform:translate(0)}}.audit-trail .marker{transition:transform .2s ease}.audit-trail li:hover .marker{transform:scale(1.15)}

View file

@ -0,0 +1 @@
.stage.svelte-9hm057{animation:svelte-9hm057-stage-light .7s cubic-bezier(.22,.8,.3,1) backwards;position:relative;border-color:#6366f114}.stage-orb.svelte-9hm057{width:28px;height:28px;border-radius:50%;background:radial-gradient(circle at 30% 30%,#818cf840,#6366f10d);border:1px solid rgba(99,102,241,.3);display:flex;align-items:center;justify-content:center;position:relative;animation:svelte-9hm057-orb-glow .7s cubic-bezier(.22,.8,.3,1) backwards}.stage-pulse.svelte-9hm057{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:12px;border:1px solid rgba(129,140,248,0);pointer-events:none;animation:svelte-9hm057-pulse-ring .7s cubic-bezier(.22,.8,.3,1) backwards}.connector.svelte-9hm057{position:absolute;left:22px;top:100%;width:1px;height:8px;background:linear-gradient(180deg,#818cf880,#a855f726);animation:svelte-9hm057-connector-draw .5s ease-out backwards}.running.svelte-9hm057 .stage:where(.svelte-9hm057){animation:svelte-9hm057-stage-light .7s cubic-bezier(.22,.8,.3,1) backwards,svelte-9hm057-stage-flicker 2.4s ease-in-out infinite}@keyframes svelte-9hm057-stage-light{0%{opacity:0;transform:translate(-8px);border-color:#6366f100}60%{opacity:1;border-color:#818cf859}to{opacity:1;transform:translate(0);border-color:#6366f114}}@keyframes svelte-9hm057-orb-glow{0%{transform:scale(.6);opacity:0;box-shadow:0 0 #818cf800}60%{transform:scale(1.15);opacity:1;box-shadow:0 0 24px #818cf8cc}to{transform:scale(1);box-shadow:0 0 10px #818cf859}}@keyframes svelte-9hm057-pulse-ring{0%{transform:scale(.96);opacity:0;border-color:#818cf800}70%{transform:scale(1);opacity:1;border-color:#818cf866;box-shadow:0 0 20px #818cf840}to{transform:scale(1.01);opacity:0;border-color:#818cf800;box-shadow:0 0 #818cf800}}@keyframes svelte-9hm057-connector-draw{0%{transform:scaleY(0);transform-origin:top;opacity:0}to{transform:scaleY(1);transform-origin:top;opacity:1}}@keyframes svelte-9hm057-stage-flicker{0%,to{border-color:#6366f114}50%{border-color:#818cf840}}.evidence-card.svelte-ksja6x{animation:svelte-ksja6x-card-rise .6s cubic-bezier(.22,.8,.3,1) backwards}.evidence-card.primary.svelte-ksja6x{border-color:#6366f159!important;box-shadow:inset 0 1px #ffffff0a,0 0 32px #6366f12e,0 8px 32px #0006}.evidence-card.contradicting.svelte-ksja6x{border-color:#ef444473!important;box-shadow:inset 0 1px #ffffff08,0 0 28px #ef444433,0 8px 32px #0006}.evidence-card.superseded.svelte-ksja6x{opacity:.55}.evidence-card.superseded.svelte-ksja6x:hover{opacity:.9}.role-pill.svelte-ksja6x{background:#6366f11f;color:#c7cbff;border:1px solid rgba(99,102,241,.25)}.evidence-card.contradicting.svelte-ksja6x .role-pill:where(.svelte-ksja6x){background:#ef444424;color:#fecaca;border-color:#ef444466}.evidence-card.primary.svelte-ksja6x .role-pill:where(.svelte-ksja6x){background:#6366f138;color:#a5b4ff;border-color:#6366f180}.trust-fill.svelte-ksja6x{animation:svelte-ksja6x-trust-sweep 1s cubic-bezier(.22,.8,.3,1) backwards}@keyframes svelte-ksja6x-card-rise{0%{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes svelte-ksja6x-trust-sweep{0%{width:0%!important;opacity:.4}to{opacity:1}}.line-clamp-4.svelte-ksja6x{display:-webkit-box;-webkit-line-clamp:4;line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.conf-number.svelte-q2v96u{animation:svelte-q2v96u-conf-pop .9s cubic-bezier(.22,.8,.3,1) backwards}@keyframes svelte-q2v96u-conf-pop{0%{opacity:0;transform:scale(.5)}60%{opacity:1;transform:scale(1.1)}to{opacity:1;transform:scale(1)}}.arc-path.svelte-q2v96u{animation:svelte-q2v96u-arc-draw .9s cubic-bezier(.22,.8,.3,1) backwards;stroke-dashoffset:0}@keyframes svelte-q2v96u-arc-draw{0%{opacity:0;stroke-dasharray:0 400}to{opacity:1;stroke-dasharray:4 4}}.arc-dot.svelte-q2v96u{animation:svelte-q2v96u-arc-dot-pulse 1.4s ease-in-out infinite}@keyframes svelte-q2v96u-arc-dot-pulse{0%,to{opacity:.8;r:4}50%{opacity:1;r:5}}.evidence-grid.svelte-q2v96u{isolation:isolate}.contradiction-arcs.svelte-q2v96u{z-index:5}

View file

@ -0,0 +1 @@
@keyframes svelte-rs1z7a-panel-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.animate-panel-in.svelte-rs1z7a{animation:svelte-rs1z7a-panel-in .18s ease-out}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
@keyframes svelte-1jku20k-arc-drift{0%{stroke-dashoffset:0}to{stroke-dashoffset:-32}}.arc-particle{animation-name:svelte-1jku20k-arc-drift;animation-timing-function:linear;animation-iteration-count:infinite}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
@keyframes svelte-1uyjqky-fadeSlide{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

View file

@ -1 +1 @@
const r="/api";async function t(e,o){const i=await fetch(`${r}${e}`,{headers:{"Content-Type":"application/json"},...o});if(!i.ok)throw new Error(`API ${i.status}: ${i.statusText}`);return i.json()}const n={memories:{list:e=>{const o=e?"?"+new URLSearchParams(e).toString():"";return t(`/memories${o}`)},get:e=>t(`/memories/${e}`),delete:e=>t(`/memories/${e}`,{method:"DELETE"}),promote:e=>t(`/memories/${e}/promote`,{method:"POST"}),demote:e=>t(`/memories/${e}/demote`,{method:"POST"}),suppress:(e,o)=>t(`/memories/${e}/suppress`,{method:"POST",body:o?JSON.stringify({reason:o}):void 0}),unsuppress:e=>t(`/memories/${e}/unsuppress`,{method:"POST"})},search:(e,o=20)=>t(`/search?q=${encodeURIComponent(e)}&limit=${o}`),stats:()=>t("/stats"),health:()=>t("/health"),timeline:(e=7,o=200)=>t(`/timeline?days=${e}&limit=${o}`),graph:e=>{const o=e?"?"+new URLSearchParams(Object.entries(e).filter(([,i])=>i!==void 0).map(([i,s])=>[i,String(s)])).toString():"";return t(`/graph${o}`)},dream:()=>t("/dream",{method:"POST"}),explore:(e,o="associations",i,s=10)=>t("/explore",{method:"POST",body:JSON.stringify({from_id:e,action:o,to_id:i,limit:s})}),predict:()=>t("/predict",{method:"POST"}),importance:e=>t("/importance",{method:"POST",body:JSON.stringify({content:e})}),consolidate:()=>t("/consolidate",{method:"POST"}),retentionDistribution:()=>t("/retention-distribution"),intentions:(e="active")=>t(`/intentions?status=${e}`)};export{n as a};
const r="/api";async function t(e,o){const i=await fetch(`${r}${e}`,{headers:{"Content-Type":"application/json"},...o});if(!i.ok)throw new Error(`API ${i.status}: ${i.statusText}`);return i.json()}const n={memories:{list:e=>{const o=e?"?"+new URLSearchParams(e).toString():"";return t(`/memories${o}`)},get:e=>t(`/memories/${e}`),delete:e=>t(`/memories/${e}`,{method:"DELETE"}),promote:e=>t(`/memories/${e}/promote`,{method:"POST"}),demote:e=>t(`/memories/${e}/demote`,{method:"POST"}),suppress:(e,o)=>t(`/memories/${e}/suppress`,{method:"POST",body:o?JSON.stringify({reason:o}):void 0}),unsuppress:e=>t(`/memories/${e}/unsuppress`,{method:"POST"})},search:(e,o=20)=>t(`/search?q=${encodeURIComponent(e)}&limit=${o}`),stats:()=>t("/stats"),health:()=>t("/health"),timeline:(e=7,o=200)=>t(`/timeline?days=${e}&limit=${o}`),graph:e=>{const o=e?"?"+new URLSearchParams(Object.entries(e).filter(([,i])=>i!==void 0).map(([i,s])=>[i,String(s)])).toString():"";return t(`/graph${o}`)},dream:()=>t("/dream",{method:"POST"}),explore:(e,o="associations",i,s=10)=>t("/explore",{method:"POST",body:JSON.stringify({from_id:e,action:o,to_id:i,limit:s})}),predict:()=>t("/predict",{method:"POST"}),importance:e=>t("/importance",{method:"POST",body:JSON.stringify({content:e})}),consolidate:()=>t("/consolidate",{method:"POST"}),retentionDistribution:()=>t("/retention-distribution"),intentions:(e="active")=>t(`/intentions?status=${e}`),deepReference:(e,o=20)=>t("/deep_reference",{method:"POST",body:JSON.stringify({query:e,depth:o})}),sanhedrin:{latest:()=>t("/sanhedrin/latest"),appeal:(e,o,i,s)=>t("/sanhedrin/appeal",{method:"POST",body:JSON.stringify({reason:e,note:o,claimId:i,receiptId:s})})}};export{n as a};

View file

@ -1 +0,0 @@
import{aE as h,ah as d,ao as l,aF as p,w as _,aG as E,aH as g,T as u,aj as s,aI as y,a7 as M,aJ as N,ac as x,aK as A}from"./VE8Jor13.js";var f;const i=((f=globalThis==null?void 0:globalThis.window)==null?void 0:f.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function b(t){return(i==null?void 0:i.createHTML(t))??t}function w(t){var r=h("template");return r.innerHTML=b(t.replaceAll("<!>","<!---->")),r.content}function a(t,r){var e=_;e.nodes===null&&(e.nodes={start:t,end:r,a:null,t:null})}function H(t,r){var e=(r&E)!==0,c=(r&g)!==0,n,m=!t.startsWith("<!>");return()=>{if(u)return a(s,null),s;n===void 0&&(n=w(m?t:"<!>"+t),e||(n=l(n)));var o=c||p?document.importNode(n,!0):n.cloneNode(!0);if(e){var T=l(o),v=o.lastChild;a(T,v)}else a(o,o);return o}}function O(t=""){if(!u){var r=d(t+"");return a(r,r),r}var e=s;return e.nodeType!==N?(e.before(e=d()),x(e)):A(e),a(e,e),e}function P(){if(u)return a(s,null),s;var t=document.createDocumentFragment(),r=document.createComment(""),e=d();return t.append(r,e),a(r,e),t}function R(t,r){if(u){var e=_;((e.f&y)===0||e.nodes.end===null)&&(e.nodes.end=s),M();return}t!==null&&t.before(r)}export{R as a,a as b,P as c,H as f,O as t};

View file

@ -0,0 +1 @@
import{a1 as u,a2 as v,a3 as h,N as i,a4 as g,a5 as f,Y as A,a6 as S}from"./CpWkWWOo.js";const N=Symbol("is custom element"),p=Symbol("is html"),T=f?"link":"LINK",E=f?"progress":"PROGRESS";function k(r){if(i){var s=!1,a=()=>{if(!s){if(s=!0,r.hasAttribute("value")){var e=r.value;_(r,"value",null),r.value=e}if(r.hasAttribute("checked")){var o=r.checked;_(r,"checked",null),r.checked=o}}};r.__on_r=a,A(a),S()}}function l(r,s){var a=d(r);a.value===(a.value=s??void 0)||r.value===s&&(s!==0||r.nodeName!==E)||(r.value=s??"")}function _(r,s,a,e){var o=d(r);i&&(o[s]=r.getAttribute(s),s==="src"||s==="srcset"||s==="href"&&r.nodeName===T)||o[s]!==(o[s]=a)&&(s==="loading"&&(r[u]=a),a==null?r.removeAttribute(s):typeof a!="string"&&L(r).includes(s)?r[s]=a:r.setAttribute(s,a))}function d(r){return r.__attributes??(r.__attributes={[N]:r.nodeName.includes("-"),[p]:r.namespaceURI===v})}var c=new Map;function L(r){var s=r.getAttribute("is")||r.nodeName,a=c.get(s);if(a)return a;c.set(s,a=[]);for(var e,o=r,n=Element.prototype;n!==o;){e=g(o);for(var t in e)e[t].set&&a.push(t);o=h(o)}return a}export{l as a,k as r,_ as s};

View file

@ -1 +0,0 @@
import{s as c,g as l}from"./CCRrbKqn.js";import{a0 as o,a1 as f,a2 as b,g as p,h as d,a3 as g}from"./VE8Jor13.js";let s=!1,i=Symbol();function y(e,n,r){const u=r[n]??(r[n]={store:null,source:b(void 0),unsubscribe:f});if(u.store!==e&&!(i in r))if(u.unsubscribe(),u.store=e??null,e==null)u.source.v=void 0,u.unsubscribe=f;else{var t=!0;u.unsubscribe=c(e,a=>{t?u.source.v=a:d(u.source,a)}),t=!1}return e&&i in r?l(e):p(u.source)}function m(){const e={};function n(){o(()=>{for(var r in e)e[r].unsubscribe();g(e,i,{enumerable:!1,value:!0})})}return[e,n]}function N(e){var n=s;try{return s=!1,[e(),s]}finally{s=n}}export{y as a,N as c,m as s};

View file

@ -0,0 +1 @@
import{b as T,N as o,ab as b,E as h,ac as R,ax as p,ad as A,ae as E,T as g,R as l}from"./CpWkWWOo.js";import{B as v}from"./DdEqwvdI.js";function m(t,c,u=!1){o&&b();var n=new v(t),_=u?h:0;function i(a,r){if(o){const e=R(t);var s;if(e===p?s=0:e===A?s=!1:s=parseInt(e.substring(1)),a!==s){var f=E();g(f),n.anchor=f,l(!1),n.ensure(a,r),l(!0);return}}n.ensure(a,r)}T(()=>{var a=!1;c((r,s=0)=>{a=!0,i(s,r)}),a||i(!1,null)},_)}export{m as i};

View file

@ -0,0 +1,2 @@
const e=[...`
\r\f \v\uFEFF`];function o(t,f,u){var n=t==null?"":""+t;if(f&&(n=n?n+" "+f:f),u){for(var s of Object.keys(u))if(u[s])n=n?n+" "+s:s;else if(n.length)for(var i=s.length,l=0;(l=n.indexOf(s,l))>=0;){var r=l+i;(l===0||e.includes(n[l-1]))&&(r===n.length||e.includes(n[r]))?n=(l===0?"":n.substring(0,l))+n.substring(r+1):l=r}}return n===""?null:n}function c(t,f){return t==null?null:String(t)}export{c as a,o as t};

View file

@ -1 +0,0 @@
const e={fact:"#00A8FF",concept:"#9D00FF",event:"#FFB800",person:"#00FFD1",place:"#00D4FF",note:"#8B95A5",pattern:"#FF3CAC",decision:"#FF4757"},F={MemoryCreated:"#00FFD1",MemoryUpdated:"#00A8FF",MemoryDeleted:"#FF4757",MemoryPromoted:"#00FF88",MemoryDemoted:"#FF6B35",MemorySuppressed:"#A33FFF",MemoryUnsuppressed:"#14E8C6",Rac1CascadeSwept:"#6E3FFF",SearchPerformed:"#818CF8",DreamStarted:"#9D00FF",DreamProgress:"#B44AFF",DreamCompleted:"#C084FC",ConsolidationStarted:"#FFB800",ConsolidationCompleted:"#FF9500",RetentionDecayed:"#FF4757",ConnectionDiscovered:"#00D4FF",ActivationSpread:"#14E8C6",ImportanceScored:"#FF3CAC",Heartbeat:"#8B95A5"};export{F as E,e as N};

View file

@ -1 +0,0 @@
import{t as l}from"./ByItJEsC.js";import{T as e}from"./VE8Jor13.js";function u(s,c,r,f,p,i){var a=s.__className;if(e||a!==r||a===void 0){var t=l(r);(!e||t!==s.getAttribute("class"))&&(t==null?s.removeAttribute("class"):s.className=t),s.__className=r}return i}export{u as s};

View file

@ -1 +0,0 @@
import{Q as m,R as _,m as b,l as i,T as y,U as v,V as h}from"./VE8Jor13.js";function E(e,l,u=l){var f=new WeakSet;m(e,"input",async r=>{var a=r?e.defaultValue:e.value;if(a=t(e)?o(a):a,u(a),v!==null&&f.add(v),await _(),a!==(a=l())){var d=e.selectionStart,s=e.selectionEnd,n=e.value.length;if(e.value=a??"",s!==null){var c=e.value.length;d===s&&s===n&&c>n?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=d,e.selectionEnd=Math.min(s,c))}}}),(y&&e.defaultValue!==e.value||b(l)==null&&e.value)&&(u(t(e)?o(e.value):e.value),v!==null&&f.add(v)),i(()=>{var r=l();if(e===document.activeElement){var a=h??v;if(f.has(a))return}t(e)&&r===o(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function t(e){var l=e.type;return l==="number"||l==="range"}function o(e){return e===""?null:+e}export{E as b};

View file

@ -0,0 +1 @@
import{az as g,aA as d,aB as c,v as m,aC as i,aD as b,g as p,aE as v,z as h,aF as k}from"./CpWkWWOo.js";function x(t=!1){const a=g,e=a.l.u;if(!e)return;let f=()=>v(a.s);if(t){let n=0,s={};const _=h(()=>{let l=!1;const r=a.s;for(const o in r)r[o]!==s[o]&&(s[o]=r[o],l=!0);return l&&n++,n});f=()=>p(_)}e.b.length&&d(()=>{u(a,f),i(e.b)}),c(()=>{const n=m(()=>e.m.map(b));return()=>{for(const s of n)typeof s=="function"&&s()}}),e.a.length&&c(()=>{u(a,f),i(e.a)})}function u(t,a){if(t.l.s)for(const e of t.l.s)p(e);a()}k();export{x as i};

View file

@ -1 +0,0 @@
var D=Object.defineProperty;var g=a=>{throw TypeError(a)};var F=(a,e,s)=>e in a?D(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s;var w=(a,e,s)=>F(a,typeof e!="symbol"?e+"":e,s),y=(a,e,s)=>e.has(a)||g("Cannot "+s);var t=(a,e,s)=>(y(a,e,"read from private field"),s?s.call(a):e.get(a)),l=(a,e,s)=>e.has(a)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,s),M=(a,e,s,i)=>(y(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);import{U as x,ae as j,af as k,ag as C,ah as A,ai as B,T as S,aj as T,ak as U,al as q}from"./VE8Jor13.js";var r,n,h,u,p,_,v;class G{constructor(e,s=!0){w(this,"anchor");l(this,r,new Map);l(this,n,new Map);l(this,h,new Map);l(this,u,new Set);l(this,p,!0);l(this,_,()=>{var e=x;if(t(this,r).has(e)){var s=t(this,r).get(e),i=t(this,n).get(s);if(i)j(i),t(this,u).delete(s);else{var c=t(this,h).get(s);c&&(t(this,n).set(s,c.effect),t(this,h).delete(s),c.fragment.lastChild.remove(),this.anchor.before(c.fragment),i=c.effect)}for(const[f,o]of t(this,r)){if(t(this,r).delete(f),f===e)break;const d=t(this,h).get(o);d&&(k(d.effect),t(this,h).delete(o))}for(const[f,o]of t(this,n)){if(f===s||t(this,u).has(f))continue;const d=()=>{if(Array.from(t(this,r).values()).includes(f)){var b=document.createDocumentFragment();U(o,b),b.append(A()),t(this,h).set(f,{effect:o,fragment:b})}else k(o);t(this,u).delete(f),t(this,n).delete(f)};t(this,p)||!i?(t(this,u).add(f),C(o,d,!1)):d()}}});l(this,v,e=>{t(this,r).delete(e);const s=Array.from(t(this,r).values());for(const[i,c]of t(this,h))s.includes(i)||(k(c.effect),t(this,h).delete(i))});this.anchor=e,M(this,p,s)}ensure(e,s){var i=x,c=q();if(s&&!t(this,n).has(e)&&!t(this,h).has(e))if(c){var f=document.createDocumentFragment(),o=A();f.append(o),t(this,h).set(e,{effect:B(()=>s(o)),fragment:f})}else t(this,n).set(e,B(()=>s(this.anchor)));if(t(this,r).set(i,e),c){for(const[d,m]of t(this,n))d===e?i.unskip_effect(m):i.skip_effect(m);for(const[d,m]of t(this,h))d===e?i.unskip_effect(m.effect):i.skip_effect(m.effect);i.oncommit(t(this,_)),i.ondiscard(t(this,v))}else S&&(this.anchor=T),t(this,_).call(this)}}r=new WeakMap,n=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,_=new WeakMap,v=new WeakMap;export{G as B};

View file

@ -1 +0,0 @@
import{b as p,E as t}from"./VE8Jor13.js";import{B as c}from"./BYWGnCkZ.js";function E(r,s,...a){var e=new c(r);p(()=>{const n=s()??null;e.ensure(n,n&&(o=>n(o,...a)))},t)}export{E as s};

View file

@ -1 +1 @@
import{a1 as a,m as w,am as q,J as x}from"./VE8Jor13.js";function _(e,t,n){if(e==null)return t(void 0),n&&n(void 0),a;const r=w(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const f=[];function z(e,t){return{subscribe:A(e,t).subscribe}}function A(e,t=a){let n=null;const r=new Set;function i(u){if(q(e,u)&&(e=u,n)){const o=!f.length;for(const s of r)s[1](),f.push(s,e);if(o){for(let s=0;s<f.length;s+=2)f[s][0](f[s+1]);f.length=0}}}function b(u){i(u(e))}function l(u,o=a){const s=[u,o];return r.add(s),r.size===1&&(n=t(i,b)||a),u(e),()=>{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:b,subscribe:l}}function B(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const b=t.length<2;return z(n,(l,u)=>{let o=!1;const s=[];let d=0,p=a;const y=()=>{if(d)return;p();const c=t(r?s[0]:s,l,u);b?l(c):p=typeof c=="function"?c:a},h=i.map((c,g)=>_(c,m=>{s[g]=m,d&=~(1<<g),o&&y()},()=>{d|=1<<g}));return o=!0,y(),function(){x(h),p(),o=!1}})}function E(e){let t;return _(e,n=>t=n)(),t}export{B as d,E as g,_ as s,A as w};
import{H as a,v as m,aH as q,aC as x}from"./CpWkWWOo.js";function _(e,t,n){if(e==null)return t(void 0),n&&n(void 0),a;const r=m(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const f=[];function z(e,t){return{subscribe:A(e,t).subscribe}}function A(e,t=a){let n=null;const r=new Set;function i(u){if(q(e,u)&&(e=u,n)){const o=!f.length;for(const s of r)s[1](),f.push(s,e);if(o){for(let s=0;s<f.length;s+=2)f[s][0](f[s+1]);f.length=0}}}function b(u){i(u(e))}function l(u,o=a){const s=[u,o];return r.add(s),r.size===1&&(n=t(i,b)||a),u(e),()=>{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:b,subscribe:l}}function k(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const b=t.length<2;return z(n,(l,u)=>{let o=!1;const s=[];let d=0,p=a;const y=()=>{if(d)return;p();const c=t(r?s[0]:s,l,u);b?l(c):p=typeof c=="function"?c:a},h=i.map((c,g)=>_(c,w=>{s[g]=w,d&=~(1<<g),o&&y()},()=>{d|=1<<g}));return o=!0,y(),function(){x(h),p(),o=!1}})}function B(e){let t;return _(e,n=>t=n)(),t}export{k as d,B as g,_ as s,A as w};

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{Q as s,k as o,a0 as c,a4 as b,a5 as m,a6 as h,U as v,V as y}from"./VE8Jor13.js";function _(e,r,f=!1){if(e.multiple){if(r==null)return;if(!b(r))return m();for(var a of e.options)a.selected=r.includes(i(a));return}for(a of e.options){var t=i(a);if(h(t,r)){a.selected=!0;return}}(!f||r!==void 0)&&(e.selectedIndex=-1)}function q(e){var r=new MutationObserver(()=>{_(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c(()=>{r.disconnect()})}function k(e,r,f=r){var a=new WeakSet,t=!0;s(e,"change",u=>{var l=u?"[selected]":":checked",n;if(e.multiple)n=[].map.call(e.querySelectorAll(l),i);else{var d=e.querySelector(l)??e.querySelector("option:not([disabled])");n=d&&i(d)}f(n),v!==null&&a.add(v)}),o(()=>{var u=r();if(e===document.activeElement){var l=y??v;if(a.has(l))return}if(_(e,u,t),t&&u===void 0){var n=e.querySelector(":checked");n!==null&&(u=i(n),f(u))}e.__value=u,t=!1}),q(e)}function i(e){return"__value"in e?e.__value:e.value}export{k as b};
import{Z as s,_ as v,W as o,F as c,a7 as b,a8 as m,a9 as h,a0 as y}from"./CpWkWWOo.js";function d(e,r,f=!1){if(e.multiple){if(r==null)return;if(!b(r))return m();for(var a of e.options)a.selected=r.includes(i(a));return}for(a of e.options){var t=i(a);if(h(t,r)){a.selected=!0;return}}(!f||r!==void 0)&&(e.selectedIndex=-1)}function q(e){var r=new MutationObserver(()=>{d(e,e.__value)});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c(()=>{r.disconnect()})}function p(e,r,f=r){var a=new WeakSet,t=!0;s(e,"change",u=>{var l=u?"[selected]":":checked",n;if(e.multiple)n=[].map.call(e.querySelectorAll(l),i);else{var _=e.querySelector(l)??e.querySelector("option:not([disabled])");n=_&&i(_)}f(n),v!==null&&a.add(v)}),o(()=>{var u=r();if(e===document.activeElement){var l=y??v;if(a.has(l))return}if(d(e,u,t),t&&u===void 0){var n=e.querySelector(":checked");n!==null&&(u=i(n),f(u))}e.__value=u,t=!1}),q(e)}function i(e){return"__value"in e?e.__value:e.value}export{p as b};

View file

@ -1 +0,0 @@
import{ah as F,b as fe,an as ae,T as D,ac as q,ao as ie,a7 as le,g as W,a8 as ue,aa as se,ab as Z,ad as L,aj as z,ap as oe,aq as te,ar as $,U as ve,as as T,ai as y,at as de,al as ce,C as pe,a4 as _e,au as V,av as he,aw as ge,a2 as Ee,ax as j,ay as me,ae as ne,ag as re,az as B,q as Te,aA as Ce,aB as Ae,aC as we,af as Se,aD as Ie}from"./VE8Jor13.js";function De(e,n){return n}function Ne(e,n,l){for(var t=[],g=n.length,s,u=n.length,c=0;c<g;c++){let E=n[c];re(E,()=>{if(s){if(s.pending.delete(E),s.done.add(E),s.pending.size===0){var o=e.outrogroups;U(V(s.done)),o.delete(s),o.size===0&&(e.outrogroups=null)}}else u-=1},!1)}if(u===0){var i=t.length===0&&l!==null;if(i){var v=l,r=v.parentNode;we(r),r.append(v),e.items.clear()}U(n,!i)}else s={pending:new Set(n),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function U(e,n=!0){for(var l=0;l<e.length;l++)Se(e[l],n)}var ee;function He(e,n,l,t,g,s=null){var u=e,c=new Map,i=(n&ae)!==0;if(i){var v=e;u=D?q(ie(v)):v.appendChild(F())}D&&le();var r=null,E=pe(()=>{var f=l();return _e(f)?f:f==null?[]:V(f)}),o,d=!0;function A(){a.fallback=r,xe(a,o,u,n,t),r!==null&&(o.length===0?(r.f&T)===0?ne(r):(r.f^=T,M(r,null,u)):re(r,()=>{r=null}))}var I=fe(()=>{o=W(E);var f=o.length;let N=!1;if(D){var x=ue(u)===se;x!==(f===0)&&(u=Z(),q(u),L(!1),N=!0)}for(var _=new Set,w=ve,b=ce(),p=0;p<f;p+=1){D&&z.nodeType===oe&&z.data===te&&(u=z,N=!0,L(!1));var S=o[p],R=t(S,p),h=d?null:c.get(R);h?(h.v&&$(h.v,S),h.i&&$(h.i,p),b&&w.unskip_effect(h.e)):(h=be(c,d?u:ee??(ee=F()),S,R,p,g,n,l),d||(h.e.f|=T),c.set(R,h)),_.add(R)}if(f===0&&s&&!r&&(d?r=y(()=>s(u)):(r=y(()=>s(ee??(ee=F()))),r.f|=T)),f>_.size&&de(),D&&f>0&&q(Z()),!d)if(b){for(const[k,O]of c)_.has(k)||w.skip_effect(O.e);w.oncommit(A),w.ondiscard(()=>{})}else A();N&&L(!0),W(E)}),a={effect:I,items:c,outrogroups:null,fallback:r};d=!1,D&&(u=z)}function H(e){for(;e!==null&&(e.f&Ce)===0;)e=e.next;return e}function xe(e,n,l,t,g){var h,k,O,Y,X,G,J,K,P;var s=(t&Ae)!==0,u=n.length,c=e.items,i=H(e.effect.first),v,r=null,E,o=[],d=[],A,I,a,f;if(s)for(f=0;f<u;f+=1)A=n[f],I=g(A,f),a=c.get(I).e,(a.f&T)===0&&((k=(h=a.nodes)==null?void 0:h.a)==null||k.measure(),(E??(E=new Set)).add(a));for(f=0;f<u;f+=1){if(A=n[f],I=g(A,f),a=c.get(I).e,e.outrogroups!==null)for(const m of e.outrogroups)m.pending.delete(a),m.done.delete(a);if((a.f&T)!==0)if(a.f^=T,a===i)M(a,null,l);else{var N=r?r.next:i;a===e.effect.last&&(e.effect.last=a.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),C(e,r,a),C(e,a,N),M(a,N,l),r=a,o=[],d=[],i=H(r.next);continue}if((a.f&B)!==0&&(ne(a),s&&((Y=(O=a.nodes)==null?void 0:O.a)==null||Y.unfix(),(E??(E=new Set)).delete(a))),a!==i){if(v!==void 0&&v.has(a)){if(o.length<d.length){var x=d[0],_;r=x.prev;var w=o[0],b=o[o.length-1];for(_=0;_<o.length;_+=1)M(o[_],x,l);for(_=0;_<d.length;_+=1)v.delete(d[_]);C(e,w.prev,b.next),C(e,r,w),C(e,b,x),i=x,r=b,f-=1,o=[],d=[]}else v.delete(a),M(a,i,l),C(e,a.prev,a.next),C(e,a,r===null?e.effect.first:r.next),C(e,r,a),r=a;continue}for(o=[],d=[];i!==null&&i!==a;)(v??(v=new Set)).add(i),d.push(i),i=H(i.next);if(i===null)continue}(a.f&T)===0&&o.push(a),r=a,i=H(a.next)}if(e.outrogroups!==null){for(const m of e.outrogroups)m.pending.size===0&&(U(V(m.done)),(X=e.outrogroups)==null||X.delete(m));e.outrogroups.size===0&&(e.outrogroups=null)}if(i!==null||v!==void 0){var p=[];if(v!==void 0)for(a of v)(a.f&B)===0&&p.push(a);for(;i!==null;)(i.f&B)===0&&i!==e.fallback&&p.push(i),i=H(i.next);var S=p.length;if(S>0){var R=(t&ae)!==0&&u===0?l:null;if(s){for(f=0;f<S;f+=1)(J=(G=p[f].nodes)==null?void 0:G.a)==null||J.measure();for(f=0;f<S;f+=1)(P=(K=p[f].nodes)==null?void 0:K.a)==null||P.fix()}Ne(e,p,R)}}s&&Te(()=>{var m,Q;if(E!==void 0)for(a of E)(Q=(m=a.nodes)==null?void 0:m.a)==null||Q.apply()})}function be(e,n,l,t,g,s,u,c){var i=(u&he)!==0?(u&ge)===0?Ee(l,!1,!1):j(l):null,v=(u&me)!==0?j(g):null;return{v:i,i:v,e:y(()=>(s(n,i??l,v??g,c),()=>{e.delete(t)}))}}function M(e,n,l){if(e.nodes)for(var t=e.nodes.start,g=e.nodes.end,s=n&&(n.f&T)===0?n.nodes.start:l;t!==null;){var u=Ie(t);if(s.before(t),t===g)return;t=u}}function C(e,n,l){n===null?e.effect.first=l:n.next=l,l===null?e.effect.last=n:l.prev=n}function Me(e,n,l){var t=e==null?"":""+e;return t===""?null:t}function ke(e,n){return e==null?null:String(e)}export{ke as a,He as e,De as i,Me as t};

View file

@ -0,0 +1 @@
import{J as y,b as u,K as _,M as o,N as t,O as g,Q as i,R as l,T as d,U as p,V as m}from"./CpWkWWOo.js";function T(n,r){let s=null,E=t;var a;if(t){s=p;for(var e=m(document.head);e!==null&&(e.nodeType!==g||e.data!==n);)e=i(e);if(e===null)l(!1);else{var f=i(e);e.remove(),d(f)}}t||(a=document.head.appendChild(y()));try{u(()=>r(a),_|o)}finally{E&&(l(!0),d(s))}}export{T as h};

View file

@ -0,0 +1,2 @@
v`‡éĆ)wä<77>KĆÖ„Mڜ˿Q@ÉĆşWő v<>á·E†śYt°Gş.˛h€Ă2DŢJżĐšźŞ<C5BA>dSŰ Ť$gd“D1€Úćěŕ,Jy>´U`+&
ŐźĐxS<s.Ć‚§%©5ą±áhGlĎŐÁź~˙Řɲ»g°ĽXĹŁÎv1ßÁٸŁ8Ňłú<C582>„rO†|°<<3C>ż2…ř &=UdTă…ÚnYBĐ&¨•’¬¶$ˇC†Äs ©â%{<BÍuéř ńîŐÄ<1D>ż€F *ő”ľîČěá<07>Čž÷źx Ď4<yA5ť ŃOŽPs,†˘RĎ_$±ÓýăY

View file

@ -0,0 +1 @@
import{s as c,g as l}from"./BeMFXnHE.js";import{F as o,G as b,H as a,I as p,g as d,h as g}from"./CpWkWWOo.js";let s=!1,i=Symbol();function y(e,n,r){const u=r[n]??(r[n]={store:null,source:p(void 0),unsubscribe:a});if(u.store!==e&&!(i in r))if(u.unsubscribe(),u.store=e??null,e==null)u.source.v=void 0,u.unsubscribe=a;else{var t=!0;u.unsubscribe=c(e,f=>{t?u.source.v=f:g(u.source,f)}),t=!1}return e&&i in r?l(e):d(u.source)}function m(){const e={};function n(){o(()=>{for(var r in e)e[r].unsubscribe();b(e,i,{enumerable:!1,value:!0})})}return[e,n]}function I(e){var n=s;try{return s=!1,[e(),s]}finally{s=n}}export{y as a,I as c,m as s};

Some files were not shown because too many files have changed in this diff Show more