Skip to content

Releases: GottZ/ctx

ctx v2.4.2

27 May 20:53
v2.4.2
0582cfe

Choose a tag to compare

ctx v2.4.2 — dream PickBlock atomic claim + remove embed-deadline

Patch release. Two interrelated fixes for W49 high-parallelism issues.

  1. dream.PickBlock: atomic UPDATE...FROM (subselect FOR UPDATE SKIP LOCKED)
    RETURNING. Sets dream_cooldown_until=now()+5min on pick so sibling
    workers SKIP. Replaces the pool.QueryRow no-tx pattern that allowed
    multiple workers to pick the same block under parallel pressure
    (companion bug to v2.4.1 backfill-tx-fix, different mechanism because
    RunDreamCycle is too long-running for an open tx).

  2. embed.go: removed hardcoded 30s context.WithTimeout in both Ollama
    and OpenAI embed paths. Under parallelism=16 the per-call latency
    exceeded 30s due to single-GPU Ollama queueing; timeout fired
    symptomatically instead of letting calls complete. Parent ctx
    provides the real deadline (cycle-timeout / request-timeout). No
    artificial deadline; per-byte HTTP progress effectively keeps the
    connection alive while server sends headers/body.

Empirical validation deferred to W49-X4 re-run with v2.4.2 binary.

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.4.2

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v2.4.1

27 May 20:33
v2.4.1
c6d4e40

Choose a tag to compare

ctx v2.4.1 — backfill tx-wrap fix (parallelism prerequisite)

Patch release. One critical bugfix in scheduler.go.

backfillOneEmbedding's SELECT FOR UPDATE SKIP LOCKED was running on
s.pool.QueryRow (no tx wrapping) so the row lock released as soon as
the statement returned. With DreamParallelism>1 every worker picked
the same block redundantly. Empirically observed ~70% wasted compute
during W49-X4 first attempt.

Fix: wrap pick→embed→store in BeginTx+Commit so the row lock holds
through the multi-second embed call. UPDATE inlined (store.StoreEmbedding
needs *pgxpool.Pool which doesn't accept pgx.Tx; refactor deferred).

Validation: after restart with this binary, parallelism=16 should achieve
near-linear scaling on embed-backfill (vs effective ~1.3x pre-fix).

Companion to v2.4.0 DreamParallelism feature.

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.4.1

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v2.4.0

27 May 20:11
v2.4.0
553928e

Choose a tag to compare

ctx v2.4.0 — Dream Parallelism + single-object parseLinks tolerance

Minor release. Two additive changes, no breaking changes.

CTX_DREAM_PARALLELISM (default 1): concurrent dream-cycle workers.
Empirically validated on ctx-crag CRAG-corpus n=200 with OpenRouter
qwen/qwen3.6-27b (no-think): 7.7 cycles/min -> 26.7 cycles/min at
parallelism=4 (3.5x). PickBlock's existing FOR UPDATE SKIP LOCKED
ensures workers process distinct blocks without coordination.

parseLinks single-object tolerance: qwen3.6:27b via OpenRouter emits
{target_id,type,confidence} as flat object for 1-link cases (vs
canonical array). Added explicit branch BEFORE the wrapper-map form
to avoid mis-interpreting top-level fields as map-keys. Was breaking
~20% of cycles under parallel load; 0/40 parse-fails in 90s window
post-fix.

Combined with v2.3.1 OpenAI-protocol reasoning.exclude, dream-pass
on CRAG n=200 went from ~25h to ~38min effective (22x speedup).

Welle-49 architectural follow-ups noted in commit body.

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.4.0

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v2.3.1

27 May 20:03
v2.3.1
cf8e4af

Choose a tag to compare

ctx v2.3.1 — OpenAI-protocol reasoning.exclude when think=false

Patch release. One code change in internal/llm/client.go.

Adds OpenRouter-compatible reasoning-disable to chatOpenAI: when the
caller passes think=false (which CTX_DREAM_THINK=false / CTX_CHAT_THINK=false
already trigger), the request body includes 'reasoning':{enabled:false,exclude:true}.
This OpenRouter API extension suppresses chain-of-thought emission and
billing for reasoning-tokens.

Concrete impact:

  • Dream-Pipeline on OpenRouter went from 85s/cycle (with reasoning-token
    bloat + JSON-parse-fails) to 13s/cycle (clean JSON in content field).
  • Cost-per-cycle reduced ~6x by suppressing reasoning_tokens billing.
  • No regression for Ollama-protocol (think still threaded through the
    existing chatOllama path).

Empirically verified during W49-X4 CRAG-Bench Dream-Pass on n=200 corpus.

Known Welle-49-followup: dream pipeline dispatches via DefaultProtocol
(=CHAT_PROTOCOL) instead of DREAM_PROTOCOL. Current workaround documented
in commit body. Architectural fix planned separately.

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.3.1

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v2.3.0

27 May 18:44
v2.3.0
0557110

Choose a tag to compare

ctx v2.3.0 — Welle 48 Empirie komplett (V6-opt-in + Multi-Domain + Korpus-Sweep)

Minor release. Documentation + bench-pointers only. NO code/API changes
to ctx prod since v2.2.0. Bench results live in .project/bench-session-crag/.

Welle-48 results bundle:

W48-01 V6-Prompt: graded-confidence opt-in via CTX_PROMPT_VERSION=v6.
Movie n=10: +0.1pp over V5.2. PARTIALLY CONFIRMED.

W48-02 Multi-Domain CRAG: finance/sports/open n=10 each.
V6 vs V5.2 Δ averaged +0.075pp (+5 wins / -3 losses).
H6 (Domain-Bias): finance FALSIFIED (predicted strength, actual -0.20),
sports PARTIALLY-FALSIFIED, open CONFIRMED (V6 catches false-premise).
Key insight: Generator (qwen3.5:9b) is bottleneck, not Retrieval.

W48-03 Korpus-Sweep n=50/100/200:
Crossover-Point: RRF beats Cosine bereits bei n=50.
Δ (RRF-Cosine): +0.167 (n=50), +0.267 (n=100), +0.267 (n=200).
Counter-intuitive: Slot-Recall lower (RRF 55-75%, Cosine 69-82%),
but End-to-End score higher (RRF +0.167-0.267pp).
Mechanismus: V5.2 Refusal-Disposition profits from RRF diversification
under CRAG-Score (2c+m)/n-1 (Refusal=0 > Hallu=-1).

W48-04 Embedding-Pipeline-Audit: LOW severity. W47-NEU-D Hypothese
('Ollama full vs llama Q4_K_M Drift') FALSIFIZIERT. Both pipelines
use Q4_K_M, Δ-Cosine = 0.001-0.002 (Noise-Floor).

W48-05 Selective Re-Embed: NO-ACTION (W48-04 LOW severity).

Killer-Welle-49-Items derived:

  • W49-A: n≥50 per domain for statistical significance
  • W49-B: Generator-Eskalation qwen3.5:9b → qwen3.6:27b for numeric-extraction
  • W49-C: V6.1 Generic-Examples (domain-agnostic)
  • W49-D: Dream-Pick-Balance (round-robin for multi-domain)
  • W49-E: False-Premise Detection Channel
  • W49-X1: Cosine + V6 re-bench
  • W49-X2: CTX_CONFIDENT_THRESHOLD sweep
  • W49-X4: Dream-mature re-bench at n=200 (planned next)

No new migrations. No breaking changes.

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.3.0

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v2.2.0

27 May 12:57
v2.2.0
f48822d

Choose a tag to compare

ctx v2.2.0 — V6-Prompt opt-in + Embedding-Pipeline-Audit

Minor release. Additive features, no breaking changes.

W48-01: V6 graded-confidence synthesis prompt as opt-in via
CTX_PROMPT_VERSION=v6. Default remains v5.2. CRAG-Bench n=10 movie
showed +0.1pp raw (V6-A1=0.5 vs V5.2-A1=0.4). Direction richtig,
Magnitude unter Spanne (PARTIALLY CONFIRMED). Generator-Side-Effect
aus Phase 6 (A2 < A1 -0.1pp) in V6 neutralisiert (V6-A1 == V6-A2).
8 neue V6-Unit-Tests. Migrations-Plan: bei robust >+0.3pp auf n≥50
in v3.0.0 default umstellen.

W48-04: Embedding-Pipeline-Consistency-Audit. W47-NEU-D-Hypothese
('Ollama full vs llama Q4_K_M Drift') empirisch FALSIFIZIERT.
Ollama nutzt ebenfalls Q4_K_M GGUF (verified via /api/show
model_info: file_type=15). Live-Pipeline-Δ-Cosine = 0.0010-0.0021
(Noise-Floor, weit unter 0.05 LOW-Schwelle). Severity LOW.
20 Sample-Audit mit Per-Era-Statistik in .project submodule.

W48-05: Selective Re-Embed — NO-ACTION resolved durch W48-04
LOW-Severity-Finding. Optional Hygiene: CTX_DREAM_EMBED_* env
unsetten für Single-Pipeline-Convergence.

Backlog für künftige Wellen:

  • W48-02: Multi-Domain CRAG-Bench (finance/sports/open)
  • W48-03: Korpus-Größen-Sweep n=50/100/200 (V6-Robustness statistisch
    signifikant prüfen)
  • W49: Generator-Eskalation falls V6 auf größerem n nicht hält

Artefakte: .project/bench-session-crag/phase7-w48-01/ + phase7-w48-04/

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.2.0

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v2.1.1

27 May 12:09
v2.1.1
8234d7f

Choose a tag to compare

ctx v2.1.1 — pre-commit sanity gate + gold-file moved to .project

Patch release after restoring v2.1.0 to its original signed commit (b7509d3).
v2.1.0 history kept intact with original signatures.

Changes on top of v2.1.0:

  • move: .eval-cyclic-gold.json moved to .project submodule (private)
    (gitignore exception removed, eval-cyclic.sh path updated, submodule
    pointer to .project@2edfeab which contains the gold file)
  • chore: pre-commit sanity gate on new files

Pre-commit Gate 1 blocks newly-added files matching sensitive patterns
(env, credentials, keys, DB dumps, eval gold/baseline files). Plus
content heuristic for large root-level JSON with corpus block-ID markers.
Three resolution paths in error message: move to .project, whitelist as
.example template, or --no-verify bypass.

Background: W47-NEU-B sub-agent committed .eval-cyclic-gold.json into
the public main-repo. Initial response was a filter-branch + force-push
that needlessly re-hashed all tags v1.4.1-v2.0.0 and destroyed commit
signatures. This release restores the original signed history and applies
the cleanup commits as additive changes on top.

Lehre:

  • Sub-Agent-Briefs müssen explizite Sensitive-File-Blacklist enthalten
  • Bei history rewrites: Range (v2.0.0..root) statt --all
  • Original-signed commits sind erhaltenswert — additive cleanup-commits
    bevorzugen statt destructive history-rewrite

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.1.1

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v2.1.0

27 May 11:21
v2.1.0
b7509d3

Choose a tag to compare

ctx v2.1.0 — Welle-47: Code-Hygiene + Issue #4 Fix + Bench-Refinements

Welle-47 bundle nach v2.0.0 Major. Address mehrerer pre-existing bugs
und CRAG-Bench-Findings.

INCLUDED ITEMS:

Bug-Fixes:

  • W47-01: M030 mass-factor Test-Setup-Bug (Test-Pattern-Drift, kein
    Implementation-Bug — production-SQL ist seit M030 byte-identisch)
  • W47-02: RunGuardBatch SAVEPOINT-per-Block (eliminate 25P02-Kaskade
    bei per-block SQL-error)
  • W47-03: guard_integration_test mit pgvector-timescaledb PG18 testcontainer,
    5 Tests inkl. 42P08-Regression für Issue-#3-Fix
  • W47-11: 38 sites scope=ANY($N)::text[] Cast-Harden (defensive PG18+ Konsistenz)
  • W47-NEU-A: ClassifyBlockAfterUpsert covers digest topic-map path
    (was: bypass → block_role='knowledge'; now: block_role='system-meta',
    hard-excluded by M036/M048 ctx_rrf)
  • W47-NEU-E: ctx-crag service profile in docker-compose.yml + env-template
  • W47-NEU-F: eval-cyclic.sh + eval.sh use DNS-name 'ctx' instead of
    hardcoded IP

External Issue:

  • Issue #4 (Damien Moon): digest UTF-8 byte-slice truncation → 22021.
    Fix: rune-aware truncation + new util.TruncateRunes-Helper-Trio.
    4 latente related sites refactored.

Bench:

  • W47-NEU-B: eval-cyclic gold file refresh post-Welle-42/46 drift.
    Score: 0.8856 → 0.9456 (+6.00pp), drift kompensiert vs alte Baseline
    (0.9428 +0.28pp).
  • W47-NEU-D: dream-cache stability audit. 4 hypothesen falsifiziert,
    echter Mechanismus: Dual-Pipeline-Embedding-Heterogeneität (Ollama
    vs llama-embed seit 2026-04-09). Welle-48-Items W48-04/05 für
    Audit+Re-Embed.

CONTRIBUTORS:
Damien Moon zweiter Beitrag (Issue #4).

NO BREAKING CHANGES — diese Welle ist additiv + bug-fixes. v2.0.0
breaking changes bleiben (api-key home_scope required, chk_scope dropped).

BENCH:

  • eval.sh: 43/47 → 43/47 (stable, same failure set: N01/N02/N04 + I04)
  • eval-cyclic: 0.8856 → 0.9456 (+6.00pp via W47-NEU-B gold-refresh)
  • CRAG-Smoke: topic-map block_role='system-meta' verifiziert auf
    prod + ctx-crag (W47-NEU-A live); Issue-#4 22021-Bug nicht reproduzierbar
    bei em-dash-title (rune-aware truncation live)

ACK: Damien Moon (@DamieMoon) — Issue #4 root-cause + standalone-repro + fix-diff

  • latent-site-identification. CONTRIBUTORS.md.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.1.0

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v2.0.0

27 May 08:38
v2.0.0
5ddc2a9

Choose a tag to compare

ctx v2.0.0 — Major: Schema-Generalization + API-Filters + Prompt-Locale

BREAKING CHANGES:

  • API-Key creation requires explicit home_scope parameter (was: default-private)
  • chk_scope constraint dropped: any non-empty string is a valid scope

NEW SCHEMA (M044-M048):

  • M044: context_blocks.title VARCHAR(255) → TEXT (Wikipedia-Titel + Chunk-Suffix Truncation)
  • M045: DROP CONSTRAINT chk_scope (flexible scope names)
  • M046: context_write_log.block_title VARCHAR(500) → TEXT
  • M047: context_blocks.scope VARCHAR(20) → VARCHAR(50)
  • M048: ctx_rrf adds p_categories_exclude + p_block_roles_exclude (DEFAULT NULL)

NEW API:

  • /api/query: optional categories_exclude + block_roles_exclude arrays (Topic-Map-Slot-Stealing fix)
  • POST /api/manage api-key-create: home_scope is required JSON field
  • ENV CTX_READ_SCOPES: comma-separated scheduler scopes (default: private,shared,work)

PROMPT:

  • V5.2 synthesize: IDK-Phrasen English-only ("I don't know based on..."),
    CRAG-Judge-compatible (Session 38c finding O9)

TRIGGER: CRAG-Bench n=10 movie (Session 38c) revealed Schema/API/Prompt-Gaps.

BENCH-DATA:

  • eval.sh: 42/47 → 43/47 (+1 case)
  • eval-cyclic: 0.9428 → 0.8856 (-5.72pp). PRE-v2 Korpus-Drift (+125 retrievable blocks
    seit 21-Tage-alter Baseline) + Welle-46-Dream-Reset. Kein v2-Code-Regression
    (verifiziert via v2-E Investigation: M044-M048 additiv mit DEFAULT NULL,
    C1-C4 im eval-cyclic-Pfad inaktiv).

WELLE-47 FOLGE-ITEMS:

  • eval-cyclic-Gold-File-Refresh (L-007 stale supersedes; M-004/M-012 slot-stealing
    durch Welle-42 Tagesberichte)
  • Baseline-Refresh-Disziplin formalisieren
  • M-006 dream-cache Stability-Audit

ACK: CRAG-Bench (facebookresearch/CRAG, CC BY-NC 4.0) als externer
Benchmark-Mechanismus. Detail: ctx-Blocks 019e680c-* + .project/bench-session-crag/.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v2.0.0

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx

ctx v1.6.6

25 May 19:08
v1.6.6
756f0db

Choose a tag to compare

ctx v1.6.6 — guard 42P08 hotfix (PG18 extended-protocol casts)

The guard scheduler crashed every batch on PostgreSQL 18 with
could not determine data type of parameter $N because
jsonb_build_object(VARIADIC "any") gives pgx nothing to infer types from
at PREPARE time. The else branch additionally hit a mixed-deduction
conflict (varchar from guard_status = $2 vs untyped jsonb cast),
making the failure deterministic on PG18 — guard never completed a
batch on a fresh deploy.

Fix applies explicit $N::text|float8|bool casts inside both
jsonb_build_object calls and on the matching column assignment.
Verified live on PG18.3 and PG18.4.

External issue report from Damien Moon (@DamieMoon, #3) — full root-cause
analysis with reproduction, in-repo precedent identification, and a
correct fix proposal in a single issue. Filed via a Claude instance
running ctx in his environment; the level of detail meant we could land
the patch and verify it without further round-trips.

See CONTRIBUTORS.md.

  • internal/guard/guard.go: $N::type casts in both jsonb_build_object
    branches; guard_status = $2::text on the column assignment

  • CONTRIBUTORS.md: new file

  • guard_integration_test.go missing — Issue #3 regression has no CI
    coverage; add testcontainer-based test exercising all three decision
    paths (near_duplicate / needs_review / clean)

  • 38× scope = ANY($N) without ::text[] cast — currently safe
    (varchar↔text binary-compatible) but brittle under stricter inference

  • pre-existing Tx-abort cascade in RunGuardBatch — continue after a
    per-block SQL error leaves the batch tx aborted; fix with SAVEPOINT
    per block

Installation

With Go:

go install github.com/GottZ/ctx/cmd/ctx@v1.6.6

Binary download:
Download the binary for your platform, make it executable, move to PATH:

chmod +x ctx-*
sudo mv ctx-* /usr/local/bin/ctx