Cordis Redesign — Baseline Gates (Phase -1, Steps 1–2)

Branch: cordis-redesign forked from main at e4f3bcca2397f25b237246faef0d10bbceb234de Date: 2026-08-20 Toolchain: rustc 1.95.0, cargo 1.95.0, clippy 0.1.95

Step 1 — rust-doctor Baseline

Command: npx rust-doctor@latest . --json from /opt/ares (no rust-doctor.toml, defaults)

MetricValue
audit.score.value86
audit.score.labelGreat
audit.score.modelcore-v2
audit.score.authoritativefalse
worst_tierP2
applied_ceilingnull
projected_after_top_threenull
projected_rule_ids[]
gate.blockingerror
gate.statuspassed
gate.blocking_diagnostics0
statuscomplete
completetrue

Per-Dimension Sub-Scores

DimensionScore
security (×2)100
reliability (×1.5)75
maintainability72
performance99
dependencies75

Category Breakdown (audit.categories)

Categorywarningsdistinct
Bugs225225
Performance11
Dependencies5151
Maintainability1683717
Other543543
Total diagnostics2503

Tier Distribution (mapped via policy rules)

TierCount
P00
P10
P253
P3941
unknown (missing_docs, dead_code, etc.)543

No P0/P1 means ceiling not applied — applied_ceiling=null. This is the ceiling to raise.

Top P2 diagnostics are all rust_doctor::cargo::duplicate_major_versions (http-body, http, hyper, toml, thiserror, etc.) — dependency duplication, not logic bugs. No disabled_tls_verification, hardcoded_credential, unpinned_git_dependency, arc_with_non_send_sync etc.

Source files: 143


Step 2 — Build/Test Baseline (on main @ e4f3bcc)

cargo check --no-default-features --features openai,postgres,mcp

Result: PASSED

  • Finished dev profile in 30.02s
  • 528 warnings (missing_docs for src/cli/rag.rs, src/middleware/*, src/skill_engine.rs etc.) — not errors
  • cargo fix --lib -p ares-server suggests 2 auto-fixes

Note: ares-vector excluded per CLAUDE.md build gate (cargo build --release --no-default-features --features openai,postgres,mcp). The workspace builds with this feature set.

cargo clippy -- -D warnings

Result: FAILED — 4 errors

error: function `cosine_similarity_scalar` is never used --> crates/ares-vector/src/distance.rs:344:4
error: function `l2_distance_scalar` is never used --> crates/ares-vector/src/distance.rs:353:4
error: function `dot_product_scalar` is never used --> crates/ares-vector/src/distance.rs:369:4
  = note: `-D dead-code` implied by `-D warnings`

error: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
  --> crates/ares-types/src/models/tenant.rs:13:5
  = help: consider implementing the trait `std::str::FromStr`
  = note: `-D clippy::should-implement-trait` implied by `-D warnings`

So cargo clippy -- -D warnings is red on main — verification matrix will require fixing dead_code (add #[allow] or remove) and should_implement_trait.

cargo test (default features, ares-server lib + crates)

Result: 521 passed, 21 failed, 0 ignored

Failures grouped:

  1. DB auth failures (10 tests)Failed to connect to ares_test. Ensure it exists and migrations are applied.: Database("Failed to connect to Postgres: error returned from database: password authentication failed for user \"dirmacs\"")

    • middleware::api_key_auth::tests::* (8 tests: daily_quota, daily_usage_db_error, invalid_api_key_rejected, invalid_auth_header_bytes, monthly_quota_exceeded, monthly_usage_db_error, valid_api_key_passes, verify_api_key_db_error)
    • workflows::engine::tests::* (6 tests: available_workflows, execute_workflow_orchestrator_single_step, router_invalid_route_uses_fallback, router_routes_to_product, unknown_name, get_workflow_config, workflow_engine_creation) — all panic at src/workflows/engine.rs:327:14 with same DB auth error
    • Indicates test env lacks DATABASE_URL or ares_test DB role — not code regression
  2. Env lock poisoned (2 tests):

    • api::handlers::document_upload::tests::verify_webhook_secret_empty_env_allows_allenv lock poisoned: PoisonError
    • api::handlers::document_upload::tests::verify_webhook_secret_rejects_mismatch — same
    • Caused by first verify_webhook_secret_accepts_match failure poisoning the shared env lock, cascading.
  3. Webhook secret logic (1 test):

    • api::handlers::document_upload::tests::verify_webhook_secret_accepts_matchassertion failed: verify_webhook_secret(&headers).is_ok()
  4. CLI init template (3 tests):

    • cli::init::tests::test_generate_ares_toml_bothassertion failed: content.contains("[providers.ollama-local]")
    • test_generate_ares_toml_ollama — same
    • test_generate_ares_toml_openaiassertion failed: content.contains("[providers.openai]")
    • These expect Ollama/OpenAI templates that were removed in the NVIDIA-only migration (37f6c6e) — tests stale.
  5. Coverage: Many subsystems green: scheduler, skill_engine, pipeline_engine, trigger_engine, observability, middleware usage, rag, tools all ok.

cargo test --doc

Result: 0 passed, 0 failed, 10 ignored

  • 528 warnings (same missing_docs)
  • All 10 doc-tests are ignored (annotated with ignore in lib.rs line 24,46,59 etc.)
  • No doc-test failures — but also no doc-test coverage.

Summary

GateResult
cargo check (openai,postgres,mcp)✅ passes
cargo check --no-default-featuresnot yet run — required in Phase 7 (proves cfg cleanup)
cargo clippy -D warnings❌ 4 errors
cargo test⚠️ 521/542 (21 DB/env/template failures)
cargo test --doc✅ 0/0/10 ignored
cargo miri testnot run — Phase 7 only, leaf crates
rust-doctor✅ 86/Great/P2/passed, 0 blocking

Action for redesign: Fix clippy dead_code + should_implement_trait before Phase 7 gate; fix or remove stale cli::init provider template tests; fix webhook secret env isolation; ensure test DB available for CI.