Skip to content

Releases: WynexLabs/cortex

v1.4.0 — AI-Prioritized Vault Toolchain

13 Apr 09:42
b284330

Choose a tag to compare

Cortex repositioned from "Open Claw companion" to "AI-prioritized vault toolchain for Claude Code". Open Claw becomes one of four equal-weight use case recipes alongside solo dev, multi-machine, and CI/agent workflows.

Highlights

  • Wikilink graph — new `cortex_links` table, queryable via `--backlinks` and `--forward-links`
  • Full-text search — Postgres tsvector with GIN index, ranked snippets via `--search-fts`
  • Section addressing — `cortex_headings` table + `--section PATH HEADING` extracts one section without loading the whole note (token-saver for hub notes)
  • Lint script — `cortex_lint.py` enforces 7 of 10 LLM-first conventions; never modifies files, never blocks indexing
  • Setup matrix in README — shows 5 valid configurations across files+Obsidian, GitHub, Neon, embeddings — proves Cortex works at any layer (no Neon, no VPS, etc.)

What ships

Schema (additive — backwards-compatible)

  • `cortex_notes` columns added: `body`, `summary`, `aliases TEXT[]`, `supersedes`, `body_tsv` (generated tsvector with GIN index)
  • New table `cortex_links(source_path, target_path, target_resolved, link_type, position)`
  • New table `cortex_headings(file_path, level, text, anchor, position)`

Migration

`cortex_migrate.py` now runs 10 idempotent core steps before user schema extensions. All use `IF NOT EXISTS` — safe to re-run on existing dbs.

New parser functions in `cortex_common.py`

  • `extract_wikilinks()` — strips alias/section, skips fenced code blocks, positions match raw body
  • `extract_headings()` — ATX H1-H6, skips code blocks
  • `slugify()` — Obsidian-compatible heading anchors
  • `resolve_link()` — case-insensitive name + path resolution

New query commands in `cortex_query.py`

  • `--backlinks PATH` — what references this note
  • `--forward-links PATH` — what does this note reference
  • `--search-fts QUERY` — Postgres tsvector full-text search
  • `--section PATH HEADING` — extract one section by H2/H3 text
  • `--dangling` — list all unresolved wikilinks

Lint checks (7 deterministic, in `cortex_lint.py`)

  1. Missing `summary:` frontmatter
  2. Missing `## Summary` H2 on long notes (>500 words)
  3. Atomic ceiling exceeded (>3 H2 OR >600 words)
  4. Dangling wikilinks
  5. Pronoun openers at H2 sections (heuristic)
  6. Frontmatter validation (unknown status/priority, missing dates)
  7. Heading slug collision within file

Output formats: human-readable, `--json`, `--ci` (exit 1 on warnings).

Repositioned README

  • "AI-prioritized vault toolchain" headline
  • 5-row setup matrix
  • 4-level progressive setup (Level 4 added for v1.5 embeddings)
  • 4 use case recipes (solo, multi-machine, Open Claw, CI/agent)

Tests

139 passing — 90 pre-existing tests still green + 49 new tests covering v1.4 functions.

Bug fix included

`extract_headings()` and `extract_wikilinks()` originally returned positions from a code-block-stripped body, but `cortex_notes.body` stores the raw body. `--section` queries were slicing mid-word. Fixed by replacing `strip_code_blocks()` with a line-based iterator that tracks fence state.

Breaking changes

None. All schema changes are additive (`ALTER TABLE ADD COLUMN IF NOT EXISTS`, `CREATE TABLE IF NOT EXISTS`). Existing user setups upgrade safely with:

```bash
python scripts/cortex_migrate.py --config
python scripts/cortex_reindex.py --config
```

What's next (v1.5)

  • pgvector embeddings as Setup Level 4 (semantic search)
  • `cortex_bundle.py` — context-bundling script (load all related notes for a project in one shot)
  • `supersedes:` semantic wiring (auto-archive replaced notes)

v1.3.0

08 Apr 22:54

Choose a tag to compare

What's new

  • 90-test suite — pytest coverage for all core logic in `cortex_common.py`. Run with `python -m pytest tests/ -v`.
  • Auto-capture hook — add the Stop hook to `~/.claude/settings.json` and every Claude Code session is silently saved as a `type: log` note. No LLM calls, no latency, always exits 0.
  • Dynamic install version — `install.sh` now fetches the latest release from the GitHub API automatically. No more stale hardcoded versions.

Enable auto-capture

Add to `~/.claude/settings.json`:

```json
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [{ "type": "command", "command": "python3 ~/.claude/plugins/cache/wynexlabs/cortex/1.3.0/scripts/cortex_autosave.py" }]
}
]
}
}
```

v1.2.0

08 Apr 22:27

Choose a tag to compare

What's fixed

  • Plugin now installable via Claude Code marketplace — added .claude-plugin/plugin.json
  • Correct skill pathskills/cortex/SKILL.md at the path Claude Code expects
  • Schema corrected — README now matches the actual scripts: type is open-ended, status expanded to 8 values, priority is P0–P3
  • Install script fixed — installs to ~/.claude/plugins/cache/wynexlabs/cortex/1.2.0/ and auto-registers in ~/.claude/settings.json

Upgrade from v1.1

Re-run the install script or update your ~/.claude/settings.json manually:

{
  "extraKnownMarketplaces": {
    "wynexlabs": {
      "source": { "source": "github", "repo": "WynexLabs/cortex" }
    }
  },
  "enabledPlugins": {
    "cortex@wynexlabs": true
  }
}

Cortex v1.1.0

08 Apr 21:22

Choose a tag to compare

What changed

type is now fully open-ended. No enum, no validation, no auto-repair. Any string is accepted and stored exactly as written — spec, analysis, contact, outreach, qa-journey, whatever fits your vault.

status expanded from 3 values to 7: active | done | ready | planned | draft | waiting | archived

priority switched to P0/P1/P2/P3 convention (from low/normal/high/critical). Omit entirely for notes where priority isn't relevant.

Validation is now warn-only — unrecognised status/priority values produce a warning but are never overwritten.

Migrating from v1.0

Run a full reindex after updating cortex_common.py:

python scripts/cortex_reindex.py --config <vault>/.cortex/config.yaml

No database migration needed — columns are plain TEXT with no constraints.

Cortex v1.0.0

08 Apr 11:34

Choose a tag to compare

Initial release — Cortex v1.0

Long-term memory for Claude Code and Open Claw.
Progressive setup: works with just files, scales to GitHub + Neon.
Includes cortex_init.py for one-command setup and install.sh one-liner.