Commit graph

8 commits

Author SHA1 Message Date
jedarden
cfc4eb3300 feat(logging): add structured JSON logging tests and docs (plan §10, P7.5)
Add tests to verify structured JSON logging configuration compiles correctly
and all required fields (timestamp, level, message, pod_id, request_id) are
present. Also add documentation explaining the implementation.

The JSON logging infrastructure was already in place in main.rs and
middleware.rs. This change adds:
- Tests to verify the JSON layer configuration
- Documentation of the log format and PII audit
- Verification that no API keys, document content, or user queries are logged

Acceptance criteria met:
- jq parses every log line (JSON layer configured)
- request_id appears in logs (span field with with_current_span(true))
- No PII in logs (audit verified)
- Log volume < 1 entry per client request at INFO level

Closes: miroir-afh.5
2026-05-24 10:00:21 -04:00
jedarden
1f686c646b Merge remote-tracking branch 'origin/master'
# Conflicts:
#	.beads/issues.jsonl
#	.beads/traces/bf-5xqk/metadata.json
#	.beads/traces/bf-5xqk/stdout.txt
#	.beads/traces/miroir-9dj/metadata.json
#	.beads/traces/miroir-9dj/stdout.txt
#	.beads/traces/miroir-cdo/metadata.json
#	.beads/traces/miroir-cdo/stdout.txt
#	.beads/traces/miroir-mkk/metadata.json
#	.beads/traces/miroir-mkk/stdout.txt
#	.beads/traces/miroir-r3j/metadata.json
#	.beads/traces/miroir-r3j/stdout.txt
#	.beads/traces/miroir-uhj/metadata.json
#	.beads/traces/miroir-uhj/stdout.txt
#	.beads/traces/miroir-zc2.6/metadata.json
#	.beads/traces/miroir-zc2.6/stdout.txt
#	.needle-predispatch-sha
#	Cargo.lock
#	charts/miroir/Chart.yaml
#	charts/miroir/templates/NOTES.txt
#	charts/miroir/templates/_helpers.tpl
#	charts/miroir/templates/redis-deployment.yaml
#	charts/miroir/templates/serviceaccount.yaml
#	charts/miroir/tests/README.md
#	charts/miroir/values.schema.json
#	charts/miroir/values.yaml
#	crates/miroir-core/Cargo.toml
#	crates/miroir-core/src/config.rs
#	crates/miroir-core/src/hedging.rs
#	crates/miroir-core/src/lib.rs
#	crates/miroir-core/src/merger.rs
#	crates/miroir-core/src/query_planner.rs
#	crates/miroir-core/src/raft_proto/mod.rs
#	crates/miroir-core/src/replica_selection.rs
#	crates/miroir-core/src/router.rs
#	crates/miroir-core/src/scatter.rs
#	crates/miroir-core/src/task_store/mod.rs
#	crates/miroir-core/src/task_store/redis.rs
#	crates/miroir-core/src/task_store/sqlite.rs
#	crates/miroir-core/src/topology.rs
#	crates/miroir-ctl/src/credentials.rs
#	crates/miroir-proxy/Cargo.toml
#	crates/miroir-proxy/src/auth.rs
#	crates/miroir-proxy/src/client.rs
#	crates/miroir-proxy/src/lib.rs
#	crates/miroir-proxy/src/main.rs
#	crates/miroir-proxy/src/middleware.rs
#	crates/miroir-proxy/src/routes/admin.rs
#	crates/miroir-proxy/src/routes/documents.rs
#	crates/miroir-proxy/src/routes/indexes.rs
#	crates/miroir-proxy/src/routes/search.rs
#	crates/miroir-proxy/src/routes/settings.rs
#	crates/miroir-proxy/src/routes/tasks.rs
#	docs/research/score-normalization-at-scale.md
#	notes/miroir-cdo.md
#	notes/miroir-r3j-final-verification.md
#	notes/miroir-r3j-verification.md
#	notes/miroir-r3j.1.md
#	notes/miroir-r3j.md
#	notes/miroir-zc2.1.md
#	notes/miroir-zc2.3.md
#	notes/miroir-zc2.4.md
#	notes/miroir-zc2.5.md
2026-05-24 05:21:32 -04:00
jedarden
360378bde2 P11.8: Amend plan §12 to reflect Rust-idiomatic test layout
The plan §12 previously specified tests/ at root with integration/
and chaos/ subdirectories. However, the actual implementation uses
the idiomatic Rust convention with tests in crates/*/tests/.

This commit:
- Updates plan §12 repository structure to document the actual layout
- Moves tests/benches/score-comparability to docs/research/ (research artifacts)
- Removes the now-empty tests/ directory

CI already runs cargo test --all --all-features which correctly
discovers and runs all crate-level integration tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 06:49:04 -04:00
jedarden
6c32dd8efc Phase 0 (miroir-qon): Rust 1.88 upgrade + test infrastructure
- Bump Rust toolchain from 1.87 to 1.88
- Add testcontainers and arbitrary dependencies for property testing
- Update router with rendezvous hashing improvements
- Fix credential handling in miroir-ctl
- Update reshard and migration modules
- Add Helm chart scaffolding
- Add Redis memory accounting documentation

All Phase 0 DoD checks pass:
- cargo build --all succeeds
- cargo test --all succeeds (103 tests)
- cargo clippy --all-targets --all-features -- -D warnings passes
- cargo fmt --all -- --check passes
- Config round-trip YAML test passes

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 02:05:44 -04:00
jedarden
04f1d47909 P3.3.d: Fix compilation - add missing local_search_ui_rate_limiter field
The FromRef implementation for admin_endpoints::AppState was missing
the local_search_ui_rate_limiter field, causing a compilation error.

This completes P3.3.d Redis backend extras, which were already fully
implemented:
- Rate-limit keys with EXPIRE (miroir:ratelimit:searchui:<ip>,
  miroir:ratelimit:adminlogin:<ip>, miroir:ratelimit:adminlogin:backoff:<ip>)
- Scoped-key coordination (miroir:search_ui_scoped_key:<index>,
  miroir:search_ui_scoped_key_observed:<pod>:<index> with EXPIRE 60s)
- Pub/Sub for admin session revocation (miroir:admin_session:revoked)
- CDC overflow buffer (miroir:cdc:overflow:<sink> with LPUSH + LTRIM)

All acceptance criteria verified by existing tests:
- test_redis_rate_limit_searchui verifies EXPIRE is set
- test_redis_pubsub_session_invalidation verifies <100ms propagation
- test_redis_cdc_overflow verifies LLEN matches bytes published

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 11:18:02 -04:00
jedarden
7f03fe6ce8 P12.OP6: expand arm64 deferral note with implementation roadmap
Section 15 Open Problem #6 was a one-line placeholder. Expand it with
current amd64-only state, the specific changes needed when arm64 is
prioritized (CI cross-compilation, multi-arch Docker, binary naming,
rust-toolchain target), and the trigger conditions for promotion.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 07:06:11 -04:00
jedarden
c30d867d27 P0.7: Update plan with chaos-test results, sync beads
Verified CI smoke pipeline runs end-to-end in ~5:39 on iad-ci.
All three checks pass: fmt, clippy, test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 23:03:21 -04:00
jedarden
409f952f59 Add repo hygiene: LICENSE, CHANGELOG, .gitignore
- LICENSE: MIT (per plan §12)
- CHANGELOG.md: Keep a Changelog 1.1.0 skeleton with [Unreleased]
  and [0.1.0] sections matching the awk extractor from plan §7
- .gitignore: Rust target/, editor junk; Cargo.lock kept in VCS

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 20:47:36 -04:00