Skip to content

feat(server): improve operational diagnostics and writer tuning - #337

Merged
XiNian-dada merged 10 commits into
mainfrom
claude/g2-ops
Jul 26, 2026
Merged

feat(server): improve operational diagnostics and writer tuning#337
XiNian-dada merged 10 commits into
mainfrom
claude/g2-ops

Conversation

@XiNian-dada

@XiNian-dada XiNian-dada commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • clarify that audit degradation is diagnostic while history and registry remain readiness hard dependencies
  • expose production token-cache hit, miss, and capacity-eviction counters through Prometheus
  • make history and audit writer batch limits and flush intervals configurable end to end

Details

Readiness semantics (#313)

  • keep HTTP 200 and ready: true when only audit/write diagnostics are degraded
  • keep HTTP 503 for history or registry hard-dependency failures
  • return explicit status: degraded and problems details
  • document probe behavior in docs/readiness.md and add both HTTP/JSON regression combinations

Token cache diagnostics (#306, Phase 1 only)

  • export nodelite_token_cache_hits_total
  • export nodelite_token_cache_misses_total
  • export nodelite_token_cache_evictions_total
  • count both initial and post-semaphore lookups as hits, count only actual Argon2 work as misses, and count only capacity-driven LRU removals as evictions
  • cover warm hits, cold misses, capacity pressure, and concurrent verification semantics

This PR intentionally implements instrumentation only. It does not close the remaining #306 benchmark, root-cause analysis, or hit-rate follow-up work.

This supersedes PR #307: it carries the diagnostic intent into production Prometheus metrics, adds eviction accounting and concurrency coverage, and is fully formatted. PR #307 only exposed test/load-test hit and miss counters and its Lint and Test job stopped at cargo fmt --check.

Writer scheduling configuration (#235)

  • add history and audit batch/flush settings across raw config, defaults, public config, validation, example TOML, installer install/upgrade paths, and fixtures
  • preserve defaults of 128 records and 100ms
  • allow batch sizes from 1 through 4096 and reject values outside that range
  • reject flush intervals below 10ms
  • defensively clamp both writer batch thresholds and vector reservations even when callers bypass parsed configuration
  • wire configured values into both writer contexts
  • verify batch-triggered and timer-triggered persistence directly through SQLite without query/shutdown forced flushes

Verification

  • cargo test --workspace
  • cargo +stable fmt --all --check
  • cargo clippy --all-targets -- -D warnings
  • sh scripts/test-install-server-config.sh

Closes #313
Refs #306
Closes #235

XiNian-dada and others added 5 commits July 27, 2026 02:17
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 566d8e45a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread nodelite-proto/src/config/raw.rs Outdated
@XiNian-dada
XiNian-dada merged commit 49b6ba4 into main Jul 26, 2026
11 checks passed
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.

[P3][ops] 明确 readyz 对 audit degraded 的 HTTP 状态语义 [P3][performance] 历史与审计写入器 batch 大小和 flush 间隔不可配置

1 participant