Skip to content

feat: dashboard Input/Output Format controls#133

Open
rajkumarsakthivel wants to merge 4 commits into
mainfrom
fix/dashboard-format-controls
Open

feat: dashboard Input/Output Format controls#133
rajkumarsakthivel wants to merge 4 commits into
mainfrom
fix/dashboard-format-controls

Conversation

@rajkumarsakthivel

Copy link
Copy Markdown
Member

Dashboard format controls from #118 with fixes applied.

What's added

  • "Input / Output Format" panel in the dashboard with compact / balanced / deep / custom input presets
  • GET /api/format and POST /api/format endpoints persisting top_k, max_tokens, and output_level in state.json
  • MCP server reads dashboard defaults on each context_search call — changes apply without a restart; explicit tool arguments still take precedence
  • Compression panel label clarified to "Quick output-only presets"

Fixes applied over #118

  • POST /api/format now uses atomic_write_text (non-atomic write_text introduced the same race condition set_compression was fixed for in fix: full-project review findings + retrieval precision (26% fewer tokens served) #123)
  • _make_server test helper in test_mcp_server.py now sets _state_path, _default_top_k, and _default_max_tokens — required by the new _handle_context_search code path; absence caused CI failures
  • Removed hasattr(self, "_state_path") guard in _apply_output_compression — the attribute is always initialised in __init__ and now always present in test helpers

Closes #118

zerone0x and others added 4 commits July 10, 2026 09:46
* docs: add confidence scoring explanation page

* docs: fix confidence scoring doc accuracy and default threshold value

---------

Co-authored-by: ahfoysal <ahfoysal30@gmail.com>
…kens served) (#123)

* docs: token-savings program design spec

* fix: resolve 2026-07-03 full-project review findings

Config writers (data loss):
- string-aware JSONC comment stripping; URLs in values no longer corrupt configs
- parse failures skip the file with a warning instead of overwriting user MCP configs
- non-dict server sections handled; uninstall matches CCE markers only, never bare "cce"
- uninstall strips only the CCE block from shared git hooks

Memory (index desync):
- bootstrap without sqlite-vec no longer stamps CURRENT_VERSION; vec tables created on later connect
- turn re-compression uses DELETE+INSERT so FTS/vec delete triggers fire
- compression queue dead-letters after 5 attempts; savings recorded only on success
- rollup enqueue dedup via -1 sentinel; PII scrub applied to prompt/tool-payload writes
- non-numeric started_at no longer 500s

Retrieval/storage (ranking + consistency):
- FTS-only chunks get worst-case vector distance instead of perfect 0.0
- FTS queries tokenized per-term (OR-joined, stopwords dropped) instead of one phrase
- chunks_vec created with distance_metric=cosine; legacy L2 tables detected and rebuilt
- vector/FTS/graph stores roll back on mid-batch failure; FTS re-ingest no longer duplicates

Indexer (correctness + secrets):
- tree-sitter byte offsets slice bytes, not str; non-ASCII files chunk correctly
- single-file target path (watcher) now honors is_secret_file and .cceignore
- project_dir resolved once; symlinked roots no longer crash targeted reindex
- deleted-but-tracked targets prune index + manifest
- unquoted credential assignments redacted; *.env suffix files skipped
- Stripe/GitHub vendor regexes fixed (capturing groups leaked full key values)

Dashboard (XSS):
- all API-sourced strings escaped (sessions, decisions, file paths, chart labels)
- inline onclick handlers replaced with data attributes + listeners
- state.json written atomically

1040 tests pass (~60 new regression tests, all confirmed failing pre-fix).

* docs: Phase 1 retrieval-precision implementation plan

* feat(retrieval): persist chunk modified_ts through vector store

* feat(indexer): stamp chunks with source file mtime for recency scoring

* fix(indexer): stamp git commit chunks with commit-time modified_ts

* feat(retrieval): collapse overlapping same-file chunks before packing

* feat(retrieval): marginal-utility stop with top-1 guarantee, config-driven

* docs: correct omitted-results note design in Phase 1 plan (truthful dropped-count signal)

* fix(retrieval): truthful dropped-results signal for the omitted-results note

* feat(benchmarks): A/B mode for retrieval precision; tune Phase 1 defaults from evidence

Adds --ab flag to run_benchmark.py: indexes the repo once, then runs each
query twice (baseline retrieve() vs tuned with threshold+marginal_ratio) and
reports per-query token deltas plus aggregate reduction%.

Evidence from 6 A/B runs on this repo shows marginal_ratio=0.75 achieves
26.1% token-served reduction with hit rate unchanged (4/8→4/8), clearing the
≥25% gate. confidence_threshold had no effect (all scores 0.70–0.95).

Updates retrieval_marginal_ratio default: 0.5 → 0.75.
Results committed as benchmarks/results/cce-phase1-ab.{json,md}.

* docs(benchmarks): disclose cliff shape and sample-size limits in Phase 1 A/B evidence

* fix: point omitted-results note at marginal_ratio; document new retrieval config

* fix(indexer): repopulate index after cosine-metric migration

The cosine rebuild in VectorStore._ensure_tables wipes on-disk chunks but
left manifest.json claiming every file was still indexed, so an incremental
reindex (the default for cce index and the watcher) skipped every unchanged
file and left context_search returning nothing until cce index --full.

VectorStore now flags metric_rebuilt; run_indexing clears the manifest when
set, forcing the scan to re-ingest. Mirrors the existing dim-migration guard.
Regression test confirms an incremental reindex repopulates post-migration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants