Commit graph

130 commits

Author SHA1 Message Date
Sam Valladares
60a60cf5df ci: drop x86_64-apple-darwin from release workflow
The Intel Mac job failed the v2.0.5 AND v2.0.6 release workflows because
ort-sys 2.0.0-rc.11 (pinned by fastembed 5.13.2) does not ship Intel Mac
prebuilts. ci.yml already dropped the target weeks ago; release.yml is
now in sync.

README documents the build-from-source path for Intel Mac users and
v2.0.6 also removed the Intel Mac download link from the install block,
so no user-facing promise regresses. When ort-sys ships Intel Mac
prebuilts again, restore the matrix entry.
2026-04-19 20:24:22 -05:00
Sam Valladares
45190ff74d fix(export): replace unreachable!() with defensive Err on unknown format
The export format match at the write-out site was `_ => unreachable!()`,
supposedly safe because the early-return gate at the top of the function
rejects anything that isn't "json" or "jsonl". That gate works today,
but `unreachable!()` converts any future gate-vs-match drift (case
sensitivity bug, refactor, new format branch added above but not below)
into a user-visible panic through the MCP dispatcher instead of a clean
error response.

Replace with a typed `Err(format!("unsupported export format: {:?}",
other))` so the defence lives at both layers. Same runtime behaviour
for every valid input; strictly safer for any invalid input that would
have slipped through a future refactor.
2026-04-19 20:23:52 -05:00
Sam Valladares
d4e906ba85 chore(tools): delete dead execute_health_check + execute_stats
Both functions have been `#[allow(dead_code)]` since v1.7 with in-file
comments explicitly routing users to `execute_system_status` instead.
Zero callers anywhere in crates/ (the grep hits on execute_stats in
memory_states.rs, tagging.rs, stats.rs are same-named but different-
module functions — distinct call paths, distinct purposes).

Deleted:
- `health_check_schema` (dead schema helper)
- `stats_schema` (dead schema helper)
- `execute_health_check` (71 LOC)
- `execute_stats` (179 LOC including the FSRS preview + state
  transition + compression group + cognitive health sub-sections that
  `execute_system_status` already reproduces)

Also removed now-orphaned imports: `MemoryLifecycle`, `MemoryState`,
`MemoryForCompression`. `FSRSScheduler`, `CognitiveEngine`,
`tokio::sync::Mutex` remain because other functions still use them.

Net: ~-250 LOC, zero behavior change, existing system_status tests
(6/6) pass, workspace builds clean.
2026-04-19 20:23:05 -05:00
Sam Valladares
f9cdcd59eb test(v2.0.7): cover the new behaviors the branch was shipping blind
The pre-merge audit flagged that 4 of the 5 branch commits shipped
with zero assertions exercising the new code paths — existing tests
would have passed if the fixes were reverted to their broken state.
Close that gap with 7 new tests, each touching one specific
behavior:

migrations.rs (2 tests, crates/vestige-core)
  - test_apply_migrations_advances_to_v11_and_drops_dead_tables:
    end-to-end runs the whole V1..V11 chain on an in-memory DB and
    asserts schema_version=11, knowledge_edges absent,
    compressed_memories absent.
  - test_v11_is_idempotent_on_replay: rewinds schema_version to 10
    after a successful apply and re-runs apply_migrations to prove
    `DROP TABLE IF EXISTS` tolerates the already-dropped state.
    Guards against a future refactor accidentally using `DROP TABLE`
    without the guard.

predict.rs (1 test)
  - test_predict_degraded_false_on_happy_path: asserts the new
    `predict_degraded` JSON field is present and `false` on a fresh
    cognitive engine.

changelog.rs (2 tests)
  - test_changelog_malformed_start_returns_error: asserts a bad
    `start` value produces a helpful `Invalid start ... ISO-8601`
    error instead of panicking or silently dropping the filter.
  - test_changelog_filter_field_echoes_start: asserts the response
    `filter.start` field echoes the applied bound so callers can
    confirm their window was honored.

intention_unified.rs (3 tests)
  - test_check_includes_snoozed_when_flag_set: creates an intention,
    snoozes it, calls check with include_snoozed=true, asserts it
    appears in either triggered or pending.
  - test_check_excludes_snoozed_by_default: same setup, default
    flag, asserts the snoozed intention does NOT appear — locks in
    the pre-v2.0.7 behavior for every non-opt-in caller.
  - test_check_item_exposes_status_field: asserts every item in the
    check response carries the new `status` field.

All tests pass. vestige-core moves 366 -> 368, vestige-mcp moves
419 -> 425. Zero regressions under default or qwen3-embed features.
Clippy still clean on both crates.
2026-04-19 17:02:36 -05:00
Sam Valladares
83902b46dd fix(audit): sanitize graph error paths + expose intention status field
Two fixes surfaced by the pre-merge audit of chore/v2.0.7-clean:

1. Security MEDIUM (audit M2): `graph/+page.svelte` was rendering
   `e.message` verbatim into the DOM. A backend error that carried a
   filesystem path (e.g. a wrapped rusqlite error with the DB path in
   the message) would leak that path to any browser viewer. SvelteKit
   auto-escapes the interpolation so raw XSS is blocked, but the info-
   disclosure is real. Now we strip `/path/to/file.{sqlite,rs,db,toml,
   lock}` patterns and cap the rendered string at 200 chars before it
   hits the DOM. The regex used to gate the empty-state branch still
   runs against the raw message so detection accuracy isn't affected.

2. Correctness nit (audit PATH D): `execute_check` in
   `intention_unified.rs` was dropping `intention.status` and
   `intention.snoozed_until` from the response JSON. When
   `include_snoozed=true` surfaces both active and snoozed intentions
   in the same list, callers cannot distinguish an active-triggered
   intention from a snoozed-overdue one. Expose both fields so the
   consumer (dashboard, CLI, Claude Code) can render them
   appropriately.

Neither change affects the default code path under
`include_snoozed=false`; regression risk is zero.
2026-04-19 17:02:36 -05:00
Sam Valladares
2da0a9a5c5 chore(server): fix stale tool-count comment (23 -> 24)
server.rs:212 was documenting v2.0.4's state (23 tools) but the
handle_tools_list test two functions below asserts 24 tools since
v2.0.5 (when `suppress` landed). Align the comment with the assertion
and point at the assertion as the source of truth so future tool
additions can't introduce comment drift without also tripping a test
failure.
2026-04-19 16:53:10 -05:00
Sam Valladares
ff0324a0e5 fix(schema): honor changelog start/end + intention include_snoozed
Both parameters were advertised in the MCP tool schemas since v1.7+ but
were silently ignored at runtime — a schema-contract violation. Any
caller that set them got unfiltered results with no error or warning,
which is the worst possible failure mode for a public tool surface.

changelog.rs
  - Parse `start` / `end` as ISO-8601/RFC-3339 timestamps; return an
    explicit error on malformed input (previously: silent drop).
  - In system-wide mode, over-fetch 4× limit when a time window is set,
    then apply an inclusive [start, end] filter in Rust before the
    sort+truncate. SQL-level filtering is a v2.1+ optimisation.
  - Response JSON gains a `filter` field echoing the applied bounds so
    callers can confirm the window was honored.
  - Per-memory mode still ignores the window (semantically meaningless
    when scoped to one memory's transition history).

intention_unified.rs
  - `execute_check`: when `include_snoozed=true`, fold snoozed
    intentions back into the check pool so their time/context triggers
    can wake them when a matching condition appears. Previously
    snoozed intentions were invisible to check regardless of the arg.
  - Deduplicates defensively via a HashSet on intention.id in case
    storage ever returns overlap.

Tests: 9 changelog + 37 intention_unified tests continue to pass.
Full vestige-mcp lib suite 419 passing, 0 failures.
2026-04-19 16:53:10 -05:00
Sam Valladares
72e353ae02 fix(predict): surface degraded state instead of silent empty responses
All four PredictiveMemory calls (predict_needed_memories, get_proactive_suggestions,
get_top_interests, prediction_accuracy) return Result, and all four were being
swallowed by `.unwrap_or_default()` / `.unwrap_or(0.0)` — every lock-poisoning or
internal error produced a response indistinguishable from a genuine cold-start
"I have no predictions yet." Callers (dashboard, Claude Code, Cursor) had no way
to tell "the system is broken" from "there genuinely isn't anything to predict."

Now each call uses `unwrap_or_else` to (a) `tracing::warn!` the error with its
source channel for observability, (b) flip a local `degraded` flag. The JSON
response gains a new `predict_degraded: bool` field. Empty + degraded=false =
cold start (expected). Empty + degraded=true = something went wrong, check logs.

6 existing predict tests pass (return shape unchanged on success path).
2026-04-19 16:46:31 -05:00
Sam Valladares
01d2e006dc fix(dashboard): split empty-database from API-failure on the graph page
Before this, any exception from `api.graph()` — network down, dashboard
disabled server-side, 500, 404 — surfaced as "No memories yet. Start
using Vestige to populate your graph." Indistinguishable from a clean
first-run install. Users couldn't tell whether Vestige was empty or
actually broken.

The fix checks both the error message shape (looks for 404 / not found
/ empty / "no memor" patterns) AND the last known graph node count.
Only when both say "empty" do we keep the onboarding message; anything
else surfaces the real error under "Failed to load graph: ..." so
debugging doesn't require guessing.
2026-04-19 16:45:08 -05:00
Sam Valladares
822a7c835b feat(db): V11 migration drops dead knowledge_edges + compressed_memories tables
Both tables were added speculatively in V4 and never received a single
INSERT or SELECT in the codebase. `knowledge_edges` has an elaborate
bi-temporal schema (valid_from, valid_until, confidence) and was marked
DEPRECATED in the same V4 migration that created it — the real edge
table is `memory_connections` (V3). `compressed_memories` was a tiered-
compression feature (compression_ratio, semantic_fidelity, model_used)
but `advanced/compression.rs` operates entirely in-memory and never
touches it.

Both tables are verified single-file references (only migrations.rs).
A grep across crates/ shows zero row reads or writes. Safe to drop
without behaviour change; frees schema space for future migrations.
2026-04-19 16:44:41 -05:00
Sam Valladares
6c24a0ca69 chore(release): v2.0.6 "Composer" — rebuild + version bump + CHANGELOG
Some checks are pending
CI / Test (macos-latest) (push) Waiting to run
CI / Test (ubuntu-latest) (push) Waiting to run
CI / Release Build (aarch64-apple-darwin) (push) Blocked by required conditions
CI / Release Build (x86_64-unknown-linux-gnu) (push) Blocked by required conditions
Test Suite / Unit Tests (push) Waiting to run
Test Suite / MCP E2E Tests (push) Waiting to run
Test Suite / User Journey Tests (push) Blocked by required conditions
Test Suite / Dashboard Build (push) Waiting to run
Test Suite / Code Coverage (push) Waiting to run
Bumps vestige-core + vestige-mcp + @vestige/dashboard +
vestige-mcp-server + @vestige/init from 2.0.5 → 2.0.6, regenerates the
Cargo.lock, rebuilds the dashboard with the new events.ts handlers +
intentions page fix baked in, and writes the v2.0.6 "Composer" entry
to CHANGELOG.md.

Release contents:
- fix(dashboard): intentions page priority + trigger rendering
  (commit 9df63de)
- feat(dashboard): wire 6 graph event handlers — suppress, unsuppress,
  Rac1 cascade, Connected, ConsolidationStarted, ImportanceScored
  (commit f085cfd)
- feat(mcp): opt-in VESTIGE_SYSTEM_PROMPT_MODE=full composition mandate
  (commit 7d7a7c2)
- docs(readme): v2.0.6 header + Intel Mac / Windows build-from-source
  honesty (commit ede0a02)

Pre-push gates green: cargo test --workspace --release, cargo clippy
--all-targets -D warnings, svelte-check (580 files 0 errors), vitest
(171/171). No regressions of merged PRs #18/20/22/24/26/28/29/30/32/33.
2026-04-18 18:33:31 -05:00
Sam Valladares
6be374d115 docs(readme): v2.0.6 "Composer" header + honesty on Intel Mac / Windows
Three changes, all aimed at new-user experience:

1. v2.0.6 "Composer" section up top — explicitly names the three user-
   happiness wins: six live graph reactions (was one), intentions page
   priority + trigger rendering fix, and the opt-in
   `VESTIGE_SYSTEM_PROMPT_MODE=full` composition mandate (default stays
   minimal so nothing gets imposed on users' system prompts).

2. v2.0.5 "Intentional Amnesia" block strengthened — clarifies the
   distinction between passive Ebbinghaus decay, Anderson 1994
   retrieval-induced forgetting, and v2.0.5's top-down active
   suppression (Anderson 2025 + Cervantes-Sandoval 2020). Adds a
   "Forgetting" row to the RAG-vs-Vestige comparison table.

3. Install section honesty on Intel Mac + Windows — the pre-built
   binary download links 404 on those targets because of upstream
   toolchain gaps (`ort-sys` lacks Intel Mac prebuilts in the
   2.0.0-rc.11 release pinned by fastembed 5.13.2; `usearch 2.24.0`
   hit a Windows MSVC compile break tracked as usearch#746). Replaced
   the dead links with a `cargo build --release -p vestige-mcp`
   snippet that works today.
2026-04-18 18:33:31 -05:00
Sam Valladares
5772cdcb19 feat(mcp): opt-in VESTIGE_SYSTEM_PROMPT_MODE=full composition mandate
The MCP `instructions` field is injected into every connecting client's
system prompt on Initialize — Claude Code, Cursor, Zed, Windsurf, and
anyone else running Vestige. That reach demands a default that serves
every user, not the project maintainer's personal workflow.

Default ("minimal", 3 sentences) tells the client how to use Vestige
and how to respond to explicit feedback signals. It is safe for every
audience: competitive coders, hobbyists saving recipes, Rails devs
saving bug fixes, enterprise deployments under system-prompt review.

The full composition mandate — Composing / Never-composed /
Recommendation shape + FSRS-trust blocking phrase + origin case study
— is load-bearing for decision-adjacent work but misfires on trivial
retrievals ("what's my favorite color"). Opt in on your own machine
with `VESTIGE_SYSTEM_PROMPT_MODE=full`; four hundred strangers do not
inherit one maintainer's trauma scar on every session.

Extracted into build_instructions() so the branch is a single env-var
check on Initialize, not a compile-time switch. main.rs --help output
advertises the new variable alongside VESTIGE_DASHBOARD_ENABLED.
2026-04-18 18:33:31 -05:00
Sam Valladares
cc0e70acc8 feat(dashboard): wire 6 graph event handlers (suppress + core cognitive)
Before this commit, six live WebSocket events fired against a silent 3D
graph. v2.0.5 shipped the `suppress` tool but the graph did not react to
MemorySuppressed, MemoryUnsuppressed, or Rac1CascadeSwept. Three more
core events — Connected, ConsolidationStarted, ImportanceScored — have
been silent on the graph since v2.0.0 despite appearing in the live
feed, which made the dashboard feel broken during real cognitive work.

Handlers added, all driven by the existing EffectManager:

- MemorySuppressed: violet implosion + compounding pulse scaled by
  suppression_count (Anderson 2025 SIF visualised).
- MemoryUnsuppressed: rainbow burst + green pulse to mark reversal
  within the 24h labile window.
- Rac1CascadeSwept: violet wave across a random neighbour sample
  (event carries counts, not IDs, until v2.1).
- Connected: gentle cyan ripple from the first node on WS handshake.
- ConsolidationStarted: subtle amber pulses across a 20-node sample
  while FSRS-6 decay runs (colour matches feed entry).
- ImportanceScored: magenta pulse on the scored node with intensity
  proportional to composite_score (novelty/arousal/reward/attention).
2026-04-18 18:33:31 -05:00
Sam Valladares
d58e851af5 fix(dashboard): intentions page priority + trigger rendering
IntentionItem.priority was typed as string but the API returns the
numeric FSRS-style scale (1=low, 2=normal, 3=high, 4=critical), so the
dashboard always rendered 'normal priority' regardless of the real
value. trigger_value was also a plain string but the API actually
returns trigger_data as a JSON-encoded payload (e.g. {"type":"time",
"at":"..."}), so the UI surfaced raw JSON or empty strings for every
non-manual trigger.

Swap to numeric priority + PRIORITY_LABELS map and add a
summarizeTrigger() helper that parses trigger_data and picks the most
human-readable field (condition / topic / formatted at / in_minutes /
codebase/filePattern) before truncating for display.

Extends PR #26 (snake_case in_minutes / file_pattern on TriggerSpec)
end-to-end to the UI layer.
2026-04-18 18:33:31 -05:00
Sam Valladares
e9b2aa6d4d
Clarify AI terminology in README
Some checks failed
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
Test Suite / Unit Tests (push) Has been cancelled
Test Suite / MCP E2E Tests (push) Has been cancelled
Test Suite / Dashboard Build (push) Has been cancelled
Test Suite / Code Coverage (push) Has been cancelled
CI / Release Build (aarch64-apple-darwin) (push) Has been cancelled
CI / Release Build (x86_64-unknown-linux-gnu) (push) Has been cancelled
Test Suite / User Journey Tests (push) Has been cancelled
Updated terminology
2026-04-16 14:27:46 -05:00
Sam Valladares
b4511a7111 fix(ci): unblock Intel Mac + Windows MSVC builds in v2.0.5 release workflow
Some checks failed
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
Test Suite / Unit Tests (push) Has been cancelled
Test Suite / MCP E2E Tests (push) Has been cancelled
Test Suite / Dashboard Build (push) Has been cancelled
Test Suite / Code Coverage (push) Has been cancelled
CI / Release Build (aarch64-apple-darwin) (push) Has been cancelled
CI / Release Build (x86_64-unknown-linux-gnu) (push) Has been cancelled
Test Suite / User Journey Tests (push) Has been cancelled
Two unrelated upstream issues were stopping two of our four release targets.
Root-caused and fixed both so v2.0.5 ships on 100% of supported platforms.

Windows MSVC (new regression in v2.0.5):
  `usearch 2.24.0` introduced a `memory_mapping_allocator_gt` template
  that references the POSIX `MAP_FAILED` macro from <sys/mman.h>, which
  doesn't exist on MSVC. Confirmed upstream as unum-cloud/usearch#746
  (open). The bump from 2.23.0 happened during the v2.0.5 Cargo.lock
  refresh. Pinned `usearch = "=2.23.0"` in crates/vestige-core/Cargo.toml
  with a comment linking the upstream issue. Unpin when the fix lands.

Intel Mac (latent bug exposed by the ci workaround):
  Root cause was feature-propagation, not the release workflow.
  crates/vestige-mcp/Cargo.toml hardcoded
  `features = ["bundled-sqlite", "embeddings", "vector-search"]` on its
  vestige-core dep, which forcibly enabled vestige-core's embeddings
  feature regardless of whether vestige-mcp's own `embeddings` feature
  flag was set. With `--no-default-features` at the top level (the old
  Intel Mac ci workaround), vestige-mcp's feature flags turned off but
  vestige-core's embeddings stayed on through the hardcoded list. That
  pulled in fastembed -> ort-sys, but without any of the flags that
  select ort-sys' backend binaries, so the ort-sys build script failed
  with "does not provide prebuilt binaries for the target
  x86_64-apple-darwin with feature set (no features)".

  Fix:
  - Drop `embeddings` and `vector-search` from the hardcoded features
    list in crates/vestige-mcp/Cargo.toml. Leave only `bundled-sqlite`
    as an always-on base feature. The existing
    `embeddings = ["vestige-core/embeddings"]` /
    `vector-search = ["vestige-core/vector-search"]` flag declarations
    now actually gate those features as intended.
  - Bump the vestige-core dep version ref 2.0.4 -> 2.0.5 (was stale).
  - Drop `cargo_flags: "--no-default-features"` from the Intel Mac
    target in .github/workflows/release.yml. The original reason for
    that workaround was sidestepping the same ort-sys issue, but with
    the feature-propagation bug fixed, Intel Mac now builds with full
    default features the same way aarch64-darwin does on the same
    macos-14 runner.

Verification:
- `cargo tree -p vestige-mcp --no-default-features -i fastembed`
  -> "did not match any packages" (fastembed truly absent now)
- `cargo tree -p vestige-mcp --no-default-features -i ort-sys` -> same
- `cargo build --release -p vestige-mcp` -> clean, 1m 21s, usearch 2.23.0

Same v2.0.5 tag. Rust source code identical to 8178beb. Re-triggering
the release workflow via workflow_dispatch will rebuild all four
platforms and upload to the existing v2.0.5 release page.
2026-04-14 18:03:56 -05:00
Sam Valladares
8178beb961 feat(v2.0.5): Intentional Amnesia — active forgetting via top-down inhibitory control
First AI memory system to model forgetting as a neuroscience-grounded
PROCESS rather than passive decay. Adds the `suppress` MCP tool (#24),
Rac1 cascade worker, migration V10, and dashboard forgetting indicators.

Based on:
- Anderson, Hanslmayr & Quaegebeur (2025), Nat Rev Neurosci — right
  lateral PFC as the domain-general inhibitory controller; SIF
  compounds with each stopping attempt.
- Cervantes-Sandoval et al. (2020), Front Cell Neurosci PMC7477079 —
  Rac1 GTPase as the active synaptic destabilization mechanism.

What's new:
* `suppress` MCP tool — each call compounds `suppression_count` and
  subtracts a `0.15 × count` penalty (saturating at 80%) from
  retrieval scores during hybrid search. Distinct from delete
  (removes) and demote (one-shot).
* Rac1 cascade worker — background sweep piggybacks the 6h
  consolidation loop, walks `memory_connections` edges from
  recently-suppressed seeds, applies attenuated FSRS decay to
  co-activated neighbors. You don't just forget Jake — you fade
  the café, the roommate, the birthday.
* 24h labile window — reversible via `suppress({id, reverse: true})`
  within 24 hours. Matches Nader reconsolidation semantics.
* Migration V10 — additive-only (`suppression_count`, `suppressed_at`
  + partial indices). All v2.0.x DBs upgrade seamlessly on first launch.
* Dashboard: `ForgettingIndicator.svelte` pulses when suppressions
  are active. 3D graph nodes dim to 20% opacity when suppressed.
  New WebSocket events: `MemorySuppressed`, `MemoryUnsuppressed`,
  `Rac1CascadeSwept`. Heartbeat carries `suppressed_count`.
* Search pipeline: SIF penalty inserted into the accessibility stage
  so it stacks on top of passive FSRS decay.
* Tool count bumped 23 → 24. Cognitive modules 29 → 30.

Memories persist — they are INHIBITED, not erased. `memory.get(id)`
returns full content through any number of suppressions. The 24h
labile window is a grace period for regret.

Also fixes issue #31 (dashboard graph view buggy) as a companion UI
bug discovered during the v2.0.5 audit cycle:

* Root cause: node glow `SpriteMaterial` had no `map`, so
  `THREE.Sprite` rendered as a solid-coloured 1×1 plane. Additive
  blending + `UnrealBloomPass(0.8, 0.4, 0.85)` amplified the square
  edges into hard-edged glowing cubes.
* Fix: shared 128×128 radial-gradient `CanvasTexture` singleton used
  as the sprite map. Retuned bloom to `(0.55, 0.6, 0.2)`. Halved fog
  density (0.008 → 0.0035). Edges bumped from dark navy `0x4a4a7a`
  to brand violet `0x8b5cf6` with higher opacity. Added explicit
  `scene.background` and a 2000-point starfield for depth.
* 21 regression tests added in `ui-fixes.test.ts` locking every
  invariant in (shared texture singleton, depthWrite:false, scale
  ×6, bloom magic numbers via source regex, starfield presence).

Tests: 1,284 Rust (+47) + 171 Vitest (+21) = 1,455 total, 0 failed
Clippy: clean across all targets, zero warnings
Release binary: 22.6MB, `cargo build --release -p vestige-mcp` green
Versions: workspace aligned at 2.0.5 across all 6 crates/packages

Closes #31
2026-04-14 17:30:30 -05:00
Sam Valladares
95bde93b49 fix: clippy collapsible-if on hybrid_search type filter
CI failed on macOS + Ubuntu with clippy::collapsible_if on the
else-if branch of the exclude_types filter. Collapse the inner
`if` into the `let Some && ...` guard. Semantics preserved — the
includes branch is left as-is to keep include/exclude mutually
exclusive behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 14:50:03 -05:00
Sam Valladares
27b562d64d
Merge pull request #33 from Unforgettable-93/unforgettable-fixes
fix: keyword-first search (Stage 0) + type filter SQL pushdown
2026-04-14 14:23:35 -05:00
Bot
51195cfb76 fix: add keyword-first search (Stage 0) with reranker bypass
Exact keyword matches (e.g. unique proper nouns like "Valladares") were
buried by semantic scoring in hybrid search. With a small limit, the
exact match could be missing entirely from results.

Adds a dedicated Stage 0 keyword-only pass (keyword_weight=1.0,
semantic_weight=0.0) before the main hybrid search. Results with strong
keyword scores (>= 0.8) are collected and merged into the hybrid results
via dedup. In the reranker stage, these keyword-priority results bypass
the cross-encoder entirely and receive a 2x score boost to survive
downstream pipeline stages (temporal, FSRS, utility, competition).

Bug inherited from Vestige 2.0.1.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:46:21 -05:00
Bot
f3e25f7503 fix: push type filters into SQL WHERE clause + expose in MCP search
Type filtering (include_types/exclude_types) was applied post-fetch after
the database LIMIT, which could return zero results when all top-N
results were of the filtered type. This pushes type filters into the SQL
WHERE clause in keyword_search_with_scores() so they apply before the
limit. Semantic results still get post-fetch filtering as a safety net
since the vector index cannot filter by type.

Also adds hybrid_search_filtered() as the new primary method, with the
original hybrid_search() delegating to it with no filters for backward
compatibility. The MCP search tool now exposes include_types and
exclude_types parameters.

Includes 5 new test cases covering include, exclude, precedence,
empty results, and backward compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 14:42:16 -05:00
Sam Valladares
16fe2674ed
Merge pull request #32 from matthias-Q/dream_eviction
Some checks failed
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Release Build (aarch64-apple-darwin) (push) Has been cancelled
CI / Release Build (x86_64-unknown-linux-gnu) (push) Has been cancelled
Test Suite / Unit Tests (push) Has been cancelled
Test Suite / MCP E2E Tests (push) Has been cancelled
Test Suite / User Journey Tests (push) Has been cancelled
Test Suite / Dashboard Build (push) Has been cancelled
Test Suite / Code Coverage (push) Has been cancelled
feat: dream connection eviction uses composite score instead of FIFO
2026-04-13 13:45:50 -05:00
Matthias Queitsch
df6d819add
feat: dream connection eviction uses composite score instead of FIFO 2026-04-13 19:15:31 +02:00
Sam Valladares
1c924bf47c
Merge pull request #30 from xsa-dev/feat/disable-dashboard-by-default
Some checks failed
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
Test Suite / Unit Tests (push) Has been cancelled
Test Suite / MCP E2E Tests (push) Has been cancelled
Test Suite / Dashboard Build (push) Has been cancelled
Test Suite / Code Coverage (push) Has been cancelled
CI / Release Build (aarch64-apple-darwin) (push) Has been cancelled
CI / Release Build (x86_64-unknown-linux-gnu) (push) Has been cancelled
Test Suite / User Journey Tests (push) Has been cancelled
feat(mcp): add VESTIGE_DASHBOARD_ENABLED with default false
2026-04-11 15:16:14 -05:00
Sam Valladares
4774aa0d49
Merge pull request #29 from matthias-Q/compile_older_systems
Add feature flags to build for older systems with glibc <2.38
2026-04-11 15:15:30 -05:00
Aleksei Savin
5f4f2fe8a6 feat(mcp): add VESTIGE_DASHBOARD_ENABLED with default false
- Dashboard now disabled by default to reduce memory footprint
- Enable with VESTIGE_DASHBOARD_ENABLED=true
- Update --help text to document new env var
2026-04-11 22:44:03 +03:00
Matthias Queitsch
b5892fc723
build: allow building on older glibc versions 2026-04-11 08:21:53 +02:00
Sam Valladares
946b49c95e
Merge pull request #28 from NoahToKnow/fix/deep-reference-query-relevance
Some checks failed
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
Test Suite / Unit Tests (push) Has been cancelled
Test Suite / MCP E2E Tests (push) Has been cancelled
Test Suite / Dashboard Build (push) Has been cancelled
Test Suite / Code Coverage (push) Has been cancelled
CI / Release Build (aarch64-apple-darwin) (push) Has been cancelled
CI / Release Build (x86_64-unknown-linux-gnu) (push) Has been cancelled
Test Suite / User Journey Tests (push) Has been cancelled
fix(deep_reference): incorporate query relevance into recommended/confidence
2026-04-09 21:58:29 -05:00
NoahToKnow
9c022a0f54 fix(deep_reference): incorporate query relevance into recommended/confidence
The Stage 8 `recommended` selector and the evidence sort both rank by
FSRS-6 trust only, discarding the `combined_score` signal that the
upstream hybrid_search + cross-encoder reranker just computed. Confidence
is then derived from `recommended.trust + evidence_count`, neither of
which moves with the query — so any query against the same corpus
returns the same primary memory and the same confidence score.

Empirical reproduction (15 deep_reference probes against an 11-memory
corpus, 9 with a unique correct answer + 6 with no relevant memories):

  - Distinct primary memories returned : 1 / 15
  - Confidence values returned         : 1 distinct (0.82 for all)
  - Ground-truth accuracy on specific queries : 1 / 9 (11.1%)

The single hit is coincidental: the always-returned memory happened to
be the correct answer for one query. Random guessing across the 11-memory
corpus would be ~9% baseline, so the tool is performing at random.

Fix
---

Replace trust-only ranking at three sites with a 50/50 composite of
combined_score (query relevance) and FSRS-6 trust:

    let composite = |s: &ScoredMemory| s.combined_score as f64 * 0.5 + s.trust * 0.5;

Used in:
  - cross_reference.rs:573 — `recommended` max_by
  - cross_reference.rs:589 — `non_superseded` evidence sort_by
  - cross_reference.rs:622 — `base_confidence` formula

The 50/50 weighting is a design choice — see PR body for the knob to
tweak if a different blend is preferred. The pre-existing updated_at
tiebreaker is preserved.

Tests
-----

Two regression tests, both verified to FAIL on `main` and PASS with the
fix via negative control (temporarily set the composite weights to
1.0 trust + 0.0 relevance and confirmed both tests fail again):

  - test_recommended_uses_query_relevance_not_just_trust
      Two-memory corpus, ingested in order so the off-topic memory wins
      the trust tiebreaker. Query targets the on-topic memory. The fix
      ensures `recommended` is the on-topic one.

  - test_confidence_varies_with_query_relevance
      Single-memory corpus. Identical execute() calls with a relevant
      query and an irrelevant query. The fix ensures the relevant
      query produces higher confidence.

Full crate suite: 410 / 410 passing (was 408 + 2 new).

Out of scope
------------

While running the live MCP probes I observed two further inconsistencies
in `cross_reference.rs` that I cannot reproduce in cargo test (the
synthetic test environment with mock embeddings does not trigger the
required combined_score > 0.2 floor condition):

  - The `effective_sim` floor at line 551 fabricates contradictions
    between memories with no real topical overlap when one contains a
    CORRECTION_SIGNALS keyword.
  - The Stage 5 `contradictions` field (strict) and the Stage 7
    `pair_relations` feeding the reasoning text (loose, post-floor)
    disagree, producing responses where `reasoning` claims N
    contradictions while `contradictions` is empty and `status` is
    "resolved".

I have empirical data for both from live MCP usage but no reproducible
cargo test, so they are intentionally not addressed in this PR. Happy to
file them as a separate issue with the raw probe data if useful.
2026-04-09 20:09:56 -06:00
Sam Valladares
17038fccc4
fix(intention): accept snake_case in_minutes / file_pattern on TriggerSpec (#26)
Some checks are pending
CI / Test (macos-latest) (push) Waiting to run
CI / Test (ubuntu-latest) (push) Waiting to run
CI / Release Build (aarch64-apple-darwin) (push) Blocked by required conditions
CI / Release Build (x86_64-unknown-linux-gnu) (push) Blocked by required conditions
Test Suite / Unit Tests (push) Waiting to run
Test Suite / MCP E2E Tests (push) Waiting to run
Test Suite / User Journey Tests (push) Blocked by required conditions
Test Suite / Dashboard Build (push) Waiting to run
Test Suite / Code Coverage (push) Waiting to run
fix(intention): accept snake_case in_minutes / file_pattern on TriggerSpec
2026-04-09 17:39:11 -05:00
Sam Valladares
3239295ab8 fix: resolve clippy collapsible-if errors in explore.rs
Collapsed nested if statements into single conditions using
let-chains (if a && let Ok(b) = ...). Fixes CI clippy failures
on both macOS and Ubuntu.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 17:37:41 -05:00
NoahToKnow
f97dc7d084 fix(intention): accept snake_case in_minutes / file_pattern on TriggerSpec
The public JSON schema in schema() declares `in_minutes` and `file_pattern`
in snake_case, but TriggerSpec uses `#[serde(rename_all = "camelCase")]`
which makes serde expect `inMinutes` / `filePattern`. Snake_case inputs are
silently dropped to None, so time-based intentions with `in_minutes` never
fire (triggerAt becomes null) and file_pattern-only context intentions
never match.

Added `#[serde(alias = ...)]` so both naming conventions deserialize
correctly — purely additive, existing camelCase callers unaffected.

Two regression tests added, verified to FAIL without the aliases
(negative control confirmed the snake_case duration test sees
`triggerAt: null` and the file_pattern test sees an empty `triggered`
array). Both pass with the fix. Full crate suite: 408/408 passing.

Related to #25 (Bug #8 was half-fixed — check-side re-derivation works,
but the set-side was still dropping the value before it could be persisted).
2026-04-09 16:24:17 -06:00
Sam Valladares
5b1127d630 fix: remove vestige-agent from workspace (not shipped), improve reasoning chain output
- Removed vestige-agent and vestige-agent-py from workspace members
  (ARC-AGI-3 code, not part of Vestige release — caused CI failure)
- Improved deep_reference reasoning chain: fuller output with arrows on
  supersession reasoning, longer primary finding preview, fallback message
  when no relations found, boosted relation detection for search results
  with high combined_score

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 17:06:24 -05:00
Sam Valladares
04781a95e2 feat: v2.0.4 "Deep Reference" — cognitive reasoning engine + 10 bug fixes
New features:
- deep_reference tool (#22): 8-stage cognitive reasoning pipeline with FSRS-6
  trust scoring, intent classification (FactCheck/Timeline/RootCause/Comparison/
  Synthesis), spreading activation expansion, temporal supersession, trust-weighted
  contradiction analysis, relation assessment, dream insight integration, and
  algorithmic reasoning chain generation — all without calling an LLM
- cross_reference (#23): backward-compatible alias for deep_reference
- retrieval_mode parameter on search (precise/balanced/exhaustive)
- get_batch action on memory tool (up to 20 IDs per call)
- Token budget raised from 10K to 100K on search + session_context
- Dates (createdAt/updatedAt) on all search results and session_context lines

Bug fixes (GitHub Issue #25 — all 10 resolved):
- state_transitions empty: wired record_memory_access into strengthen_batch
- chain/bridges no storage fallback: added with edge deduplication
- knowledge_edges dead schema: documented as deprecated
- insights not persisted from dream: wired save_insight after generation
- find_duplicates threshold dropped: serde alias fix
- search min_retention ignored: serde aliases for snake_case params
- intention time triggers null: removed dead trigger_at embedding
- changelog missing dreams: added get_dream_history + event integration
- phantom Related IDs: clarified message text
- fsrs_cards empty: documented as harmless dead schema

Security hardening:
- HTTP transport CORS: permissive() → localhost-only
- Auth token panic guard: &token[..8] → safe min(8) slice
- UTF-8 boundary fix: floor_char_boundary on content truncation
- All unwrap() removed from HTTP transport (unwrap_or_else fallback)
- Dream memory_count capped at 500 (prevents O(N²) hang)
- Dormant state threshold aligned (0.3 → 0.4)

Stats: 23 tools, 758 tests, 0 failures, 0 warnings, 0 unwraps in production

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:15:26 -05:00
Sam Valladares
61091e06b9
Merge pull request #24 from xsa-dev/feat-ai/add-codex-integration-docs
Some checks failed
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
Test Suite / Unit Tests (push) Has been cancelled
Test Suite / MCP E2E Tests (push) Has been cancelled
Test Suite / Dashboard Build (push) Has been cancelled
Test Suite / Code Coverage (push) Has been cancelled
CI / Release Build (aarch64-apple-darwin) (push) Has been cancelled
CI / Release Build (x86_64-unknown-linux-gnu) (push) Has been cancelled
Test Suite / User Journey Tests (push) Has been cancelled
[codex] Add Codex integration docs
2026-04-05 13:12:23 -05:00
Aleksei Savin
d10a336ccc Add Codex integration docs 2026-04-05 18:50:57 +03:00
Sam Valladares
0dd010a138
Merge pull request #22 from matthias-Q/fix_fastembed_cache
fix: specify cache location for fastembed_cache
2026-04-02 01:27:01 -05:00
Matthias Queitsch
47f7d4d55a
fix: specify cache location for ORT fastembed_cache 2026-04-01 13:00:50 +02:00
Sam Valladares
d921427106
Merge pull request #20 from xsa-dev/fix/resource-uri-prefix
fix: strip provider prefix from MCP resource URIs
2026-03-30 12:14:28 -06:00
Aleksei Savin
37af5059c9 fix(mcp): strip provider prefix from resource URIs
Handle 'vestige/memory://' and 'vestige/codebase://' URIs by stripping the
provider prefix before scheme matching. This fixes compatibility with
MCP clients like OpenCode that prepend the provider name to resource URIs.

Fixes #19
2026-03-29 16:43:53 +03:00
Sam Valladares
760957f5ac
Merge pull request #18 from alphaleonis/pr/dashboard-nav-base-path 2026-03-26 12:14:10 -07:00
Alphaleonis
b05168ba9d fix: dashboard nav links now include /dashboard base path prefix
All sidebar links, mobile nav links, command palette navigation, logo link,
and the graph page "Explore Connections" link now correctly use SvelteKit's
base path. Also fixes favicon.svg and manifest.json paths in app.html.

Fixes: https://github.com/samvallad33/vestige/issues/17

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 23:41:50 +01:00
Sam Valladares
85fcaedcef fix: resolve CI failures — clippy lint + lockfile sync
- unwrap_or_else → unwrap_or for constant IpAddr (Rust 1.93 clippy)
- Update pnpm-lock.yaml with vitest/playwright dev deps
- Rebuild dashboard build/ artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:20:37 -06:00
Sam Valladares
9bdcc69ce3 feat: live memory materialization — nodes spawn in 3D graph in real-time
When memories are created, promoted, deleted, or dreamed via MCP tools,
the 3D graph now shows spectacular live animations:

- Rainbow particle burst + elastic scale-up on MemoryCreated
- Ripple wave cascading to nearby nodes
- Green pulse + node growth on MemoryPromoted
- Implosion + dissolution on MemoryDeleted
- Edge growth animation on ConnectionDiscovered
- Purple cascade on DreamStarted/DreamProgress/DreamCompleted
- FIFO eviction at 50 live nodes to guard performance

Also: graph center defaults to most-connected node, legacy HTML
redirects to SvelteKit dashboard, CSS height chain fix in layout.

Testing: 150 unit tests (vitest), 11 e2e tests (Playwright with
MCP Streamable HTTP client), 22 proof screenshots.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:04:31 -06:00
Sam Valladares
816b577f69 feat: add MCP Streamable HTTP transport with Bearer auth
Adds a second transport layer alongside stdio — Streamable HTTP on port
3928. Enables Claude.ai, remote clients, and web integrations to connect
to Vestige over HTTP with per-session McpServer instances.

- POST /mcp (JSON-RPC) + DELETE /mcp (session cleanup)
- Bearer token auth with constant-time comparison (subtle crate)
- Auto-generated UUID v4 token persisted with 0o600 permissions
- Per-session McpServer instances with 30-min idle reaper
- 100 max sessions, 50 concurrency limit, 256KB body limit
- --http-port flag + VESTIGE_HTTP_PORT / VESTIGE_HTTP_BIND env vars
- Module exports moved from binary to lib.rs for reusability
- vestige CLI gains `serve` subcommand via shared lib

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 10:51:41 -06:00
Sam Valladares
070889ef26 fix: drop Intel Mac CI target, fix feature-gate dependency chain
ort-sys v2.0.0-rc.11 has no prebuilt ONNX Runtime binaries for
x86_64-apple-darwin, and vestige-mcp requires embeddings to compile.

- Remove x86_64-apple-darwin from CI release matrix (discontinued 2020)
- Fix vestige-mcp Cargo.toml: add default-features=false to vestige-core dep
- Extract sanitize_fts5_query to always-available fts.rs module
- Gate embeddings-only imports in storage/sqlite.rs behind #[cfg]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 22:14:07 -06:00
Sam Valladares
de19ed8dd9 fix: build x86_64-apple-darwin without embeddings (ort-sys has no Intel Mac prebuilts)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 21:40:21 -06:00
Sam Valladares
d98cf6136a feat: dashboard v2.1 glassmorphism + graph decomposition + fix flaky macOS vector test
Dashboard v2.1 "Nuclear" upgrade:
- Dark glassmorphism UI system (4-tier glass utilities, ambient orbs, nav glow)
- Graph3D decomposed from 806-line monolith into 10 focused modules
- Custom GLSL shaders (nebula FBM background, chromatic aberration, film grain, vignette)
- Enhanced dream mode with smooth 2s lerped transitions and aurora cycling
- Cognitive pipeline visualizer (7-stage search cascade animation)
- Temporal playback slider (scrub through memory evolution over time)
- Bioluminescent color palette for node types and events

Fix flaky CI test on macOS:
- vector::tests::test_add_and_search used near-identical test vectors (additive phase shift)
- Changed to multiplicative frequency so each seed produces a distinct vector

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 21:24:10 -06:00
Sam Valladares
2c1f499a8b fix: build macOS Intel without embeddings (ort-sys has no x86_64-apple-darwin prebuilts)
The ort crate no longer ships prebuilt ONNX Runtime binaries for macOS Intel.
Build that target with --no-default-features so it uses keyword-only search
instead of failing the release pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 20:33:01 -06:00