Skip to content

Feature/v0 4 0 multitenant weaviate - #156

Open
marlon-costa-dc wants to merge 147 commits into
mainfrom
feature/v0-4-0-multitenant-weaviate
Open

Feature/v0 4 0 multitenant weaviate#156
marlon-costa-dc wants to merge 147 commits into
mainfrom
feature/v0-4-0-multitenant-weaviate

Conversation

@marlon-costa-dc

Copy link
Copy Markdown
Collaborator

No description provided.

marlonsc added 30 commits June 7, 2026 12:20
…ine-tables debug, linker opt-in) for faster local builds
…matched_files) + workflow_dispatch recovery — fixes the v0.3.0 failure mode where one failed build leg blocked the whole GitHub Release
…oss (was 100% cold), isolated ci-coverage key for tarpaulin (no thrash), cache-on-failure:true on all rust-cache jobs
…on save-if:false reusers and only matters where the cache is written (lint, test-cross, coverage), keeping warm deps across failed iterations without poisoning correctness (cargo fingerprinting handles partial caches)
… + cargo-nextest runner with cargo test fallback + sccache opt-in + install both hooks; archive broken .pre-commit-config.yaml
…test-cross/golden jobs — make test auto-detects and uses nextest for faster parallel test runs
…t for the bilingual codebase (Portuguese terms, crate names, fixtures excluded) — gate catches new typos going forward
…NTS.md; add orchestrate skill encoding the coordinator/executor + safety-doctrine loop
…rated export, not source of truth); all bead changes via bd CLI only
…d to beads (v0.3.1 milestone epic mcb-i7o4, v0.3.2 epic mcb-v5an); non-canonical task tracking replaced by bd
…lds/deploys); always monitor or pick up independent non-blocking work
…n only via pull_request — stops duplicate push+PR runs and run cascading on branches with an open PR
…step; one self-paced 5-min loop per session; lane separation + delegate via subagents per sub-bead with quality gates
…— nextest runs a process per test so the shared process-wide OnceLock context inits concurrently and fails ('shared test context init failed'); max-threads=1 restores cargo-test semantics
…rical Decision') so the ADR validator passes — superseded-by-ADR-034 status stays in the header + body
…ans) and allowlist 'flext' — unblocks the lint typos gate on PR #135 (the words came from archived legacy docs, not active source)
…st context instead of swallowing via .ok()? — golden job (cargo test THREADS=2) reported only generic 'shared test context init failed' (mcb-v5an.16); create_shared_test_context now returns Result<_,String> with the true FastEmbed/EdgeVec cause (no hidden failures)
…utes 60->90 — measured: the cold cache-seeding run hit the 60-min cap and was cancelled mid-run before rust-cache could save, creating a deadlock (perpetually cold -> always times out); 90 lets one run complete and seed the cache, after which runs finish well under it (mcb-lcia)
…(.dolt/, .beads-credential-key, .beads/proxieddb/) + opt out the intentional AGENTS.md<->CLAUDE.md doc-divergence (CLAUDE.md is a thin pointer to the AGENTS.md SSOT); reduces bd doctor 11->3 warnings (remaining: shared-server phantom-db restart + optional plugin, tracked in mcb-okxs)
…h into single shared_app_context (AGENTS.md §3.5 no-wrapper, YAGNI/SSOT) — after the Result refactor the two fns became byte-identical aliases; keep one, update real_providers callers; net -9 LOC
…al context

- Changed implementation_status to "Historical snapshot; see bd for live work" in ADRs 008, 009, 010, 012, 014, 015, 016, 017, 018, 019, 021, 022, 023, 027, 028, 031, 032, 033, 035, 038, 039, 040, 041, 042, 043, 044, 045, 047, 049, 051, and 053.
- Updated README.md to clarify that ADR status reflects historical snapshots and not current implementation states.
- Adjusted phase-9/README.md to indicate that original execution notes are historical design context.
- Revised ROADMAP.md to emphasize that current work is tracked in beads and not in the roadmap.
- Enhanced CHANGELOG.md to document changes related to the v0.3.2 release.
- Updated INTEGRATION_TESTS.md to clarify tracking of service availability reporting and conditional test groups in beads.
…te (mcb-xku4) — cargo-tarpaulin's default ptrace engine intermittently aborts with 'Test failed during run' on tokio/multi-threaded test binaries even when every test passes (observed run 27105549947: all tests green, tarpaulin still errored). Coverage is a metric, not a correctness gate; LINT/TEST_LINUX/TEST_CROSS/VALIDATE/AUDIT/GOLDEN/RELEASE_BUILD stay required. Root-cause --engine llvm fix tracked in mcb-xgji
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 461 files, which is 361 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3a9a3ace-2a1c-4722-b549-e4e241256a56

📥 Commits

Reviewing files that changed from the base of the PR and between 507b04a and 04cb8ba.

⛔ Files ignored due to path filters (24)
  • Cargo.lock is excluded by !**/*.lock
  • crates/mcb-server/tests/contract/snapshots/contract__agent_contract_tests__agent_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__agent_contract_tests__agent_invalid_args.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__agent_contract_tests__agent_store_without_session.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__entity_contract_tests__entity_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__entity_contract_tests__entity_invalid_args.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__index_contract_tests__index_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__index_contract_tests__index_invalid_args.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__memory_contract_tests__memory_get_observation_ids_empty.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__memory_contract_tests__memory_get_observation_ids_none.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__memory_contract_tests__memory_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__memory_contract_tests__memory_invalid_args.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__project_contract_tests__project_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__project_contract_tests__project_invalid_args.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__search_contract_tests__search_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__search_contract_tests__search_invalid_args.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__session_contract_tests__session_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__session_contract_tests__session_invalid_args.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__validate_contract_tests__validate_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__validate_contract_tests__validate_invalid_args.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__vcs_contract_tests__vcs_happy_path.snap is excluded by !**/*.snap
  • crates/mcb-server/tests/contract/snapshots/contract__vcs_contract_tests__vcs_invalid_args.snap is excluded by !**/*.snap
  • tests/package-lock.json is excluded by !**/package-lock.json
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (491)
  • .agents/INSTRUCTION_SURFACE.md
  • .agents/provider.toml
  • .agents/skills/async-python-patterns
  • .agents/skills/code-navigation
  • .agents/skills/coding-standards
  • .agents/skills/flext-agent-integration
  • .agents/skills/flext-agent-strict-rules
  • .agents/skills/flext-architecture-layers
  • .agents/skills/flext-automation-skill-pattern
  • .agents/skills/flext-beads-coordination
  • .agents/skills/flext-cli-ssot-enforcement
  • .agents/skills/flext-constants-discipline
  • .agents/skills/flext-context-routing
  • .agents/skills/flext-continuation
  • .agents/skills/flext-development-workflow
  • .agents/skills/flext-docs-pointer-policy
  • .agents/skills/flext-enforcement-catalog
  • .agents/skills/flext-import-rules
  • .agents/skills/flext-mro-namespace-rules
  • .agents/skills/flext-namespace-rewrite-guard
  • .agents/skills/flext-patterns
  • .agents/skills/flext-plan-hygiene
  • .agents/skills/flext-pyrefly-typecheck-fix
  • .agents/skills/flext-quality-gates
  • .agents/skills/flext-refactoring-workflow
  • .agents/skills/flext-scope-bootstrap
  • .agents/skills/flext-strict-refactoring
  • .agents/skills/flext-strict-typing
  • .agents/skills/flext-type-system
  • .agents/skills/lib-dependency-injector
  • .agents/skills/lib-orjson
  • .agents/skills/lib-pydantic-settings
  • .agents/skills/lib-pydantic-v2
  • .agents/skills/lib-pyyaml
  • .agents/skills/lib-returns
  • .agents/skills/lib-structlog
  • .agents/skills/pydantic-v2-governance
  • .agents/skills/pydantic-v2-patterns
  • .agents/skills/readme-standardization
  • .agents/skills/rules-cmd
  • .agents/skills/rules-cmd.bak-20260725T214243/SKILL.md
  • .agents/skills/rules-docker
  • .agents/skills/rules-docs
  • .agents/skills/rules-examples
  • .agents/skills/rules-flext-core
  • .agents/skills/rules-github
  • .agents/skills/rules-pkg
  • .agents/skills/rules-scripts
  • .agents/skills/rules-src
  • .agents/skills/rules-typings
  • .agents/skills/scripts-architecture
  • .agents/skills/scripts-dependencies
  • .agents/skills/scripts-infra
  • .agents/skills/scripts-maintenance
  • .agents/skills/scripts-security
  • .agents/skills/scripts-testing
  • .agents/skills/scripts-validation
  • .agents/skills/skill-format-universal
  • .agents/skills/testing-patterns
  • .agents/skills/using-flext-cli
  • .agents/skills/using-flext-core
  • .agents/skills/using-flext-tests
  • .agents/skills/workspace-maintenance
  • .aider.conf.yml
  • .clinerules
  • .code-review-graphignore
  • .config/nextest.toml
  • .continue/rules/mcb.md
  • .cursor/rules/mcb.mdc
  • .gemini/config.yaml
  • .gemini/styleguide.md
  • .github/actions/native-deps/action.yml
  • .github/actions/warm-fastembed/action.yml
  • .github/copilot-instructions.md
  • .github/setup-ci.sh
  • .github/workflows/ci.yml
  • .github/workflows/docs-build.yml
  • .github/workflows/release.yml
  • .gitignore
  • .gitmodules
  • .markdownlintignore
  • .mise.toml
  • .planning/STATE.md
  • .planning/phases/01-unblock-build-merge-pr-116/01-CONTEXT.md
  • .planning/phases/01-unblock-build-merge-pr-116/01-DISCUSSION-LOG.md
  • .pr_agent.toml
  • .pre-commit-config.yaml
  • .python-version
  • .scope/.gitignore
  • .scope/config.toml
  • .serena/.gitignore
  • .serena/memories/architecture.md
  • .serena/memories/build_test_guide.md
  • .serena/memories/coding_standards.md
  • .serena/memories/memory_maintenance.md
  • .serena/memories/project_overview.md
  • .serena/project.yml
  • .superpowers/sdd/progress.md
  • .waza.yaml
  • .windsurfrules
  • AGENTS.md
  • CLAUDE.md
  • CONVENTIONS.md
  • Cargo.toml
  • FLEXT_TO_MCB_MAPPING.md
  • Makefile
  • ONBOARDING.md
  • README.md
  • codex.md
  • config/conversions.toml
  • config/test.yaml
  • config/tests.toml
  • crates/mcb-domain/src/entities/observation.rs
  • crates/mcb-domain/src/macros/registry.rs
  • crates/mcb-domain/src/ports/mod.rs
  • crates/mcb-domain/src/ports/repositories/memory.rs
  • crates/mcb-domain/src/ports/repositories/mod.rs
  • crates/mcb-domain/src/ports/repositories/project.rs
  • crates/mcb-domain/src/ports/services/memory.rs
  • crates/mcb-domain/src/utils/tests/assertions.rs
  • crates/mcb-domain/src/utils/tests/collection.rs
  • crates/mcb-domain/src/utils/tests/service_detection.rs
  • crates/mcb-domain/src/utils/text.rs
  • crates/mcb-domain/tests/unit/entities/memory_tests.rs
  • crates/mcb-domain/tests/unit/utils/assertions_tests.rs
  • crates/mcb-domain/tests/unit/utils/collection_tests.rs
  • crates/mcb-domain/tests/unit/utils/mod.rs
  • crates/mcb-domain/tests/unit/utils/service_detection_tests.rs
  • crates/mcb-infrastructure/src/config/loader.rs
  • crates/mcb-infrastructure/src/services/highlight_service.rs
  • crates/mcb-infrastructure/src/services/highlight_sync_service.rs
  • crates/mcb-infrastructure/src/services/memory_service/helpers.rs
  • crates/mcb-infrastructure/src/services/memory_service/interface.rs
  • crates/mcb-infrastructure/src/services/memory_service/observation.rs
  • crates/mcb-infrastructure/src/services/memory_service/search.rs
  • crates/mcb-infrastructure/src/services/mod.rs
  • crates/mcb-infrastructure/tests/unit/events/events_tests.rs
  • crates/mcb-infrastructure/tests/unit/validation/validation_service_tests.rs
  • crates/mcb-providers/Cargo.toml
  • crates/mcb-providers/src/database/seaorm/constraints.rs
  • crates/mcb-providers/src/database/seaorm/conversions/mod.rs
  • crates/mcb-providers/src/database/seaorm/conversions/observation.rs
  • crates/mcb-providers/src/database/seaorm/entities/observations.rs
  • crates/mcb-providers/src/database/seaorm/migration/m20260301_000001_initial_schema.rs
  • crates/mcb-providers/src/database/seaorm/repos/common.rs
  • crates/mcb-providers/src/database/seaorm/repos/common/pub_crud_macros.rs
  • crates/mcb-providers/src/database/seaorm/repos/common/repo_macros.rs
  • crates/mcb-providers/src/database/seaorm/repos/common/trait_impl_macros.rs
  • crates/mcb-providers/src/database/seaorm/repos/observation.rs
  • crates/mcb-providers/src/database/seaorm/repos/project.rs
  • crates/mcb-providers/src/vcs/git.rs
  • crates/mcb-providers/src/vcs/submodule.rs
  • crates/mcb-providers/src/vector_store/mod.rs
  • crates/mcb-providers/src/vector_store/weaviate/admin.rs
  • crates/mcb-providers/src/vector_store/weaviate/browser.rs
  • crates/mcb-providers/src/vector_store/weaviate/client.rs
  • crates/mcb-providers/src/vector_store/weaviate/mod.rs
  • crates/mcb-providers/src/vector_store/weaviate/provider.rs
  • crates/mcb-providers/src/vector_store/weaviate/registry.rs
  • crates/mcb-providers/tests/integration/agent_repo_integration.rs
  • crates/mcb-providers/tests/integration/index_repo_integration.rs
  • crates/mcb-providers/tests/integration/observation_repo_integration.rs
  • crates/mcb-providers/tests/integration/project_repo_integration.rs
  • crates/mcb-providers/tests/migration/mod.rs
  • crates/mcb-providers/tests/unit/database/conversions/observation_tests.rs
  • crates/mcb-providers/tests/unit/database/dashboard_tests.rs
  • crates/mcb-providers/tests/unit/database/mod.rs
  • crates/mcb-providers/tests/unit/database/seaorm_repos_layout_tests.rs
  • crates/mcb-server/Cargo.toml
  • crates/mcb-server/src/args/memory.rs
  • crates/mcb-server/src/args/mod.rs
  • crates/mcb-server/src/auth.rs
  • crates/mcb-server/src/composition.rs
  • crates/mcb-server/src/controllers/admin.rs
  • crates/mcb-server/src/controllers/admin_config.rs
  • crates/mcb-server/src/controllers/collections_api.rs
  • crates/mcb-server/src/controllers/mod.rs
  • crates/mcb-server/src/controllers/routes.rs
  • crates/mcb-server/src/controllers/web/browse.rs
  • crates/mcb-server/src/controllers/web/config.rs
  • crates/mcb-server/src/exports.rs
  • crates/mcb-server/src/handlers/entities/common.rs
  • crates/mcb-server/src/handlers/index.rs
  • crates/mcb-server/src/handlers/memory/common.rs
  • crates/mcb-server/src/handlers/memory/execution.rs
  • crates/mcb-server/src/handlers/memory/handler.rs
  • crates/mcb-server/src/handlers/memory/inject.rs
  • crates/mcb-server/src/handlers/memory/list_timeline.rs
  • crates/mcb-server/src/handlers/memory/observation.rs
  • crates/mcb-server/src/handlers/memory/quality_gate.rs
  • crates/mcb-server/src/handlers/memory/session.rs
  • crates/mcb-server/src/handlers/search.rs
  • crates/mcb-server/src/handlers/session/common.rs
  • crates/mcb-server/src/handlers/session/create.rs
  • crates/mcb-server/src/handlers/session/get.rs
  • crates/mcb-server/src/handlers/session/list.rs
  • crates/mcb-server/src/handlers/session/summarize.rs
  • crates/mcb-server/src/handlers/session/update.rs
  • crates/mcb-server/src/handlers/vcs/analyze_impact.rs
  • crates/mcb-server/src/handlers/vcs/compare_branches.rs
  • crates/mcb-server/src/handlers/vcs/index_repo.rs
  • crates/mcb-server/src/handlers/vcs/responses.rs
  • crates/mcb-server/src/handlers/vcs/search_branch.rs
  • crates/mcb-server/src/hooks/processor.rs
  • crates/mcb-server/src/lib.rs
  • crates/mcb-server/src/macros/dispatch.rs
  • crates/mcb-server/src/macros/handlers.rs
  • crates/mcb-server/src/mcp_server.rs
  • crates/mcb-server/src/tools/validation.rs
  • crates/mcb-server/src/transport/http_client.rs
  • crates/mcb-server/src/utils/args.rs
  • crates/mcb-server/src/utils/mcp/fields.rs
  • crates/mcb-server/src/utils/mcp/helpers.rs
  • crates/mcb-server/src/utils/mod.rs
  • crates/mcb-server/tests/e2e/gap_fixes_e2e.rs
  • crates/mcb-server/tests/e2e/golden_e2e_complete.rs
  • crates/mcb-server/tests/e2e/golden_highlight_service_e2e.rs
  • crates/mcb-server/tests/e2e/golden_memory_project_e2e.rs
  • crates/mcb-server/tests/e2e/golden_tools_e2e.rs
  • crates/mcb-server/tests/e2e/mod.rs
  • crates/mcb-server/tests/e2e/test_project_operations.rs
  • crates/mcb-server/tests/e2e/validation_fixes_e2e.rs
  • crates/mcb-server/tests/integration/admin_api_tests_integration.rs
  • crates/mcb-server/tests/integration/admin_http_tests_integration.rs
  • crates/mcb-server/tests/integration/auto_context_tests_integration.rs
  • crates/mcb-server/tests/integration/error_shape_tests_integration.rs
  • crates/mcb-server/tests/integration/form_deserialization_test_integration.rs
  • crates/mcb-server/tests/integration/handlers/memory_tests.rs
  • crates/mcb-server/tests/integration/handlers/real_persistence_tests.rs
  • crates/mcb-server/tests/integration/http_mcp_tests_integration.rs
  • crates/mcb-server/tests/integration/mod.rs
  • crates/mcb-server/tests/unit/mcp_server/mcp_contract_tests.rs
  • crates/mcb-server/tests/unit/tools/tool_invariant_matrix_tests.rs
  • crates/mcb-server/tests/utils/domain_services.rs
  • crates/mcb-server/tests/utils/mod.rs
  • crates/mcb-server/tests/utils/real_providers.rs
  • crates/mcb-server/tests/utils/test_fixtures.rs
  • crates/mcb-server/tests/utils/test_server.rs
  • crates/mcb-utils/Cargo.toml
  • crates/mcb-utils/src/constants/http.rs
  • crates/mcb-utils/src/constants/testing.rs
  • crates/mcb-utils/src/constants/vector_store.rs
  • crates/mcb-utils/src/utils/crypto.rs
  • crates/mcb-utils/src/utils/retry.rs
  • crates/mcb-utils/tests/unit/constants/mod.rs
  • crates/mcb-utils/tests/unit/constants/validate/mod.rs
  • crates/mcb-utils/tests/unit/constants/validate/patterns_tests.rs
  • crates/mcb-utils/tests/unit/macros_tests.rs
  • crates/mcb-utils/tests/unit/mod.rs
  • crates/mcb-utils/tests/unit/utils/mod.rs
  • crates/mcb-utils/tests/unit/utils/retry_tests.rs
  • crates/mcb-validate/rules/organization/ORG022_scattered-config.yml
  • crates/mcb-validate/rules/testing/TEST001_organization.yml
  • crates/mcb-validate/src/ast/selector_engine.rs
  • crates/mcb-validate/src/config/file_config.rs
  • crates/mcb-validate/src/config/mod.rs
  • crates/mcb-validate/src/config/schema.rs
  • crates/mcb-validate/src/engines/hybrid_engine.rs
  • crates/mcb-validate/src/engines/mod.rs
  • crates/mcb-validate/src/engines/rule_violation.rs
  • crates/mcb-validate/src/engines/rusty_cargo_deps.rs
  • crates/mcb-validate/src/engines/rusty_rules_engine.rs
  • crates/mcb-validate/src/lib.rs
  • crates/mcb-validate/src/pattern_registry/helpers.rs
  • crates/mcb-validate/src/pattern_registry/mod.rs
  • crates/mcb-validate/src/rules/mod.rs
  • crates/mcb-validate/src/rules/rule_types.rs
  • crates/mcb-validate/src/rules/templates.rs
  • crates/mcb-validate/src/rules/yaml_loader.rs
  • crates/mcb-validate/src/validators/declarative_validator.rs
  • crates/mcb-validate/src/validators/declarative_validator/ast_rules.rs
  • crates/mcb-validate/src/validators/declarative_validator/lint_rules.rs
  • crates/mcb-validate/src/validators/declarative_validator/metrics_rules.rs
  • crates/mcb-validate/src/validators/declarative_validator/mod.rs
  • crates/mcb-validate/src/validators/declarative_validator/regex_rules.rs
  • crates/mcb-validate/src/validators/hygiene/function_naming.rs
  • crates/mcb-validate/src/validators/hygiene/inline_tests.rs
  • crates/mcb-validate/src/validators/hygiene/naming.rs
  • crates/mcb-validate/src/validators/hygiene/quality.rs
  • crates/mcb-validate/src/validators/kiss/mod.rs
  • crates/mcb-validate/src/validators/naming/checks/ca.rs
  • crates/mcb-validate/src/validators/naming/validator.rs
  • crates/mcb-validate/src/validators/pattern_validator/violation.rs
  • crates/mcb-validate/src/validators/ssot.rs
  • crates/mcb-validate/tests/integration/ca009_tests_integration.rs
  • crates/mcb-validate/tests/integration/ca016_ca018_ca019_tests_integration.rs
  • crates/mcb-validate/tests/integration/integration_engines.rs
  • crates/mcb-validate/tests/integration/integration_tests.rs
  • crates/mcb-validate/tests/integration/mod.rs
  • crates/mcb-validate/tests/integration/test_individual_integration.rs
  • crates/mcb-validate/tests/unit/config_tests.rs
  • crates/mcb-validate/tests/unit/mod.rs
  • crates/mcb-validate/tests/unit/util_tests/yaml_loader_tests.rs
  • crates/mcb-validate/tests/unit/validators/declarative_validator_tests.rs
  • crates/mcb-validate/tests/unit/validators/hygiene/hygiene_tests.rs
  • crates/mcb-validate/tests/unit/validators/mod.rs
  • crates/mcb-validate/tests/unit/validators/naming/mod.rs
  • crates/mcb-validate/tests/unit/validators/naming/naming_tests.rs
  • crates/mcb/Cargo.toml
  • crates/mcb/src/cli/mod.rs
  • crates/mcb/src/cli/serve.rs
  • crates/mcb/src/cli/validate.rs
  • crates/mcb/src/initializers/mcp_server.rs
  • crates/mcb/src/loco_app.rs
  • crates/mcb/src/main.rs
  • crates/mcb/tests/integration/mcp_commands/common.rs
  • crates/mcb/tests/integration/mcp_commands/mod.rs
  • crates/mcb/tests/integration/mcp_commands/workflow_tests.rs
  • crates/mcb/tests/integration/mod.rs
  • crates/mcb/tests/integration/process_lock_integration.rs
  • crates/mcb/tests/unit/mod.rs
  • crates/mcb/tests/unit/validate_tests.rs
  • docs/MCP_TOOLS.md
  • docs/README.md
  • docs/adr/001-modular-crates-architecture.md
  • docs/adr/003-unified-provider-architecture.md
  • docs/adr/008-git-aware-semantic-indexing-v0.2.0.md
  • docs/adr/009-persistent-session-memory-v0.2.0.md
  • docs/adr/010-hooks-subsystem-agent-backed.md
  • docs/adr/011-http-transport-request-response-pattern.md
  • docs/adr/012-di-strategy-two-layer-approach.md
  • docs/adr/013-clean-architecture-crate-separation.md
  • docs/adr/014-multi-domain-architecture.md
  • docs/adr/015-workspace-shared-libraries.md
  • docs/adr/016-integration-points-adapter-pattern.md
  • docs/adr/017-phased-feature-integration.md
  • docs/adr/018-hybrid-caching-strategy.md
  • docs/adr/019-error-handling-strategy.md
  • docs/adr/021-dependency-management.md
  • docs/adr/022-ci-integration-strategy.md
  • docs/adr/023-inventory-to-linkme-migration.md
  • docs/adr/024-simplified-dependency-injection.md
  • docs/adr/027-architecture-evolution-v013.md
  • docs/adr/028-advanced-code-browser-v020.md
  • docs/adr/030-multi-provider-strategy.md
  • docs/adr/031-documentation-excellence.md
  • docs/adr/032-agent-quality-domain-extension.md
  • docs/adr/033-mcp-handler-consolidation.md
  • docs/adr/034-workflow-core-fsm.md
  • docs/adr/035-context-scout.md
  • docs/adr/036-enforcement-policies.md
  • docs/adr/037-workflow-orchestrator.md
  • docs/adr/038-multi-tier-execution-model.md
  • docs/adr/039-context-persistence-boundary.md
  • docs/adr/040-unified-tool-execution-gate.md
  • docs/adr/041-integrated-context-system-architecture.md
  • docs/adr/042-knowledge-graph-code-context.md
  • docs/adr/043-hybrid-search-discovery.md
  • docs/adr/044-lightweight-discovery-models.md
  • docs/adr/045-context-versioning-freshness.md
  • docs/adr/047-project-architecture.md
  • docs/adr/048-observability-strategy.md
  • docs/adr/049-axum-return-rmcp-tower-compatibility.md
  • docs/adr/050-manual-composition-root-dill-removal.md
  • docs/adr/051-seaql-loco-platform-rebuild.md
  • docs/adr/052-schema-resolution-seaorm.md
  • docs/adr/053-shared-provider-resolution.md
  • docs/adr/055-constants-ssot-enforcement.md
  • docs/adr/056-multitenant-isolation-and-oidc-boundary.md
  • docs/adr/057-multi-agent-coordination-ssot-consolidation.md
  • docs/adr/README.md
  • docs/adr/phase-9/README.md
  • docs/architecture/ARCHITECTURE.md
  • docs/architecture/ARCHITECTURE_BOUNDARIES.md
  • docs/architecture/PATTERNS.md
  • docs/archive/k8s/README.md
  • docs/archive/k8s/legacy-manifests.bak/README.md
  • docs/archive/k8s/legacy-manifests.bak/configmap.yaml
  • docs/archive/k8s/legacy-manifests.bak/deploy.sh
  • docs/archive/k8s/legacy-manifests.bak/deployment.yaml
  • docs/archive/k8s/legacy-manifests.bak/hpa.yaml
  • docs/archive/k8s/legacy-manifests.bak/ingress.yaml
  • docs/archive/k8s/legacy-manifests.bak/kustomization.yaml
  • docs/archive/k8s/legacy-manifests.bak/networkpolicy.yaml
  • docs/archive/k8s/legacy-manifests.bak/poddisruptionbudget.yaml
  • docs/archive/k8s/legacy-manifests.bak/rbac.yaml
  • docs/archive/k8s/legacy-manifests.bak/secrets.yaml
  • docs/archive/k8s/legacy-manifests.bak/service.yaml
  • docs/archive/k8s/legacy-manifests.bak/servicemonitor.yaml
  • docs/archive/operations/INTEGRATION_TEST_SKIPPING.md.bak
  • docs/archive/operations/README.md
  • docs/archive/plans/README.md
  • docs/beads-sql-schema.sql
  • docs/configuration/ENVIRONMENT_VARIABLES.md
  • docs/developer/BENCHMARK.md
  • docs/developer/CONTRIBUTING.md
  • docs/developer/FLEXT_TO_MCB_MAPPING.md
  • docs/developer/QUICK_REFERENCE.md
  • docs/developer/ROADMAP.md
  • docs/developer/SERENA.md
  • docs/developer/SKILL_INDEX.md
  • docs/modules/README.md
  • docs/modules/project-cli.md
  • docs/modules/project.md
  • docs/modules/validate.md
  • docs/operations/CHANGELOG.md
  • docs/operations/CI_OPTIMIZATION.md
  • docs/operations/CI_PR_POLICIES.md
  • docs/operations/CI_RELEASE.md
  • docs/operations/CODEQL_SETUP.md
  • docs/operations/DEPLOYMENT.md
  • docs/templates/README.md
  • docs/testing/E2E_INTEGRATION.md
  • docs/testing/GOLDEN_TESTS_CONTRACT.md
  • docs/testing/INTEGRATION_TESTS.md
  • docs/user-guide/README.md
  • k8s/README.md
  • makefiles/dispatch.mk
  • makefiles/ui.mk
  • nextest.toml
  • pyproject.toml
  • scripts/analyze_qlty.py
  • scripts/cache-maintenance.sh
  • scripts/check/all.sh
  • scripts/check/gitops.py
  • scripts/check/surface.py
  • scripts/codegen-conversions.py
  • scripts/codegen-post-process.py
  • scripts/context/validate-beads-policy.sh
  • scripts/dev-env-optimize.sh
  • scripts/dispatch.py
  • scripts/docs/README.md
  • scripts/docs/__init__.py
  • scripts/docs/create-adr.sh
  • scripts/docs/inject-metrics.sh
  • scripts/docs/lib/common.sh
  • scripts/docs/py/__init__.py
  • scripts/docs/py/check_links.py
  • scripts/docs/py/check_outdated.py
  • scripts/docs/py/check_source_refs.py
  • scripts/docs/py/utils.py
  • scripts/docs/validate.sh
  • scripts/download-admin-frontend.sh
  • scripts/extract-migration-sql.py
  • scripts/fix_report.py
  • scripts/hooks/pre-commit
  • scripts/hooks/pre-push
  • scripts/lib/__init__.py
  • scripts/lib/agent_pointers.py
  • scripts/lib/cli.py
  • scripts/lib/constants.py
  • scripts/lib/core.py
  • scripts/lib/cosmos_command.py
  • scripts/lib/external_services_check.py
  • scripts/lib/gitops.py
  • scripts/lib/logger.py
  • scripts/lib/mcb.sh
  • scripts/lib/result.py
  • scripts/lib/service.py
  • scripts/lib/settings.py
  • scripts/lib/tests/__init__.py
  • scripts/lib/tests/_fixtures/__init__.py
  • scripts/lib/tests/_utilities/__init__.py
  • scripts/lib/tests/_utilities/matchers.py
  • scripts/lib/tests/conftest.py
  • scripts/lib/tests/test_agent_pointers.py
  • scripts/lib/tests/test_cli.py
  • scripts/lib/tests/test_core.py
  • scripts/lib/tests/test_external_services_check.py
  • scripts/lib/tests/test_gitops.py
  • scripts/lib/tests/test_make_surface.py
  • scripts/lib/tests/test_mcb_sh.py
  • scripts/qlty/__init__.py
  • scripts/qlty/main.py
  • scripts/qlty/model.py
  • scripts/qlty/parser.py
  • scripts/qlty/report.py
  • scripts/qlty/runner.py
  • scripts/qlty/strategies.py
  • scripts/rename-project.sh
  • scripts/setup/install-adr-tools.sh
  • scripts/update-actions.sh
  • tests/e2e/admin-functional.spec.ts
  • tests/e2e/admin-ui-routes.spec.ts
  • tests/e2e/browse-ui.spec.ts
  • tests/e2e/helpers/mcp-auth.ts
  • tests/package.json
  • tests/playwright-report/index.html
  • tests/playwright.config.ts
  • third-party/edgevec
  • third-party/loco
  • third-party/milvus-sdk-rust
  • third-party/rust-code-analysis
  • third-party/sea-orm
  • third-party/sea-orm-pro
  • third-party/sea-query
  • third-party/sea-schema
  • third-party/sea-streamer
  • third-party/seaography
  • typos.toml
  • workspace_custom.mk

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/v0-4-0-multitenant-weaviate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

qodo-code-review Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

v0.4.0: Weaviate vector store + org-scoped multitenancy + route/bootstrap refactor

✨ Enhancement ⚙️ Configuration changes 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add a Weaviate vector store provider (REST + GraphQL) and register it for runtime selection.
• Enforce org-scoped isolation in persistence/search (schema + handler/service plumbing).
• Refactor server route/bootstrap wiring and expand CI/tooling/docs for v0.4.0 release readiness.
Diagram

graph TD
  A["HTTP router"] --> B["Admin auth"] --> C["Handlers"] --> D["Domain services"] --> E["Vector store port"] --> F["Weaviate provider"] --> G{{"Weaviate API"}}
  C --> H[("SQL DB")]
  subgraph Legend
    direction LR
    _svc(["Service/Module"]) ~~~ _db[("Database")] ~~~ _ext{{"External"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Adopt Weaviate native multi-tenancy (tenant-per-org)
  • ➕ Hard isolation enforced by the vector DB rather than naming conventions
  • ➕ Avoids class/schema proliferation if scaling to many orgs
  • ➖ Requires tenant lifecycle management (create/delete/assign) and migrations
  • ➖ More complex operational behavior and testing matrix
2. Introduce a typed filter DSL across providers (instead of JSON string filters)
  • ➕ Prevents invalid filter shapes at boundaries and improves ergonomics
  • ➕ Enables provider-specific compilation (Weaviate where, Qdrant filter, etc.)
  • ➖ Broader domain API change touching all vector store providers
  • ➖ Larger refactor than this incremental PR
3. Generate a typed Weaviate client (OpenAPI/GraphQL schema)
  • ➕ More compile-time safety than ad-hoc serde_json parsing
  • ➕ Easier upgrades as API changes are surfaced by compilation
  • ➖ Adds codegen/build complexity and maintenance overhead
  • ➖ Still needs custom retry/auth/backoff and domain mapping glue

Recommendation: The current approach (thin reqwest-based provider + strict filter validation + existing retry utilities) is a pragmatic integration step for v0.4.0. If tenant isolation becomes a strong requirement at the vector layer, the most meaningful next step is migrating toward Weaviate native multi-tenancy (tenant-per-org), paired with a typed filter abstraction to reduce JSON-string boundary risk.

Files changed (28) +1713 / -2287 · 1 not counted

Enhancement (7) +630 / -0
mod.rsAdd Weaviate provider module and exports +18/-0

Add Weaviate provider module and exports

• Introduces the Weaviate vector store module and re-exports the provider and factory entrypoints. Documents the REST/GraphQL split and the class/collection mapping model.

crates/mcb-providers/src/vector_store/weaviate/mod.rs

client.rsImplement Weaviate HTTP client + GraphQL helpers +253/-0

Implement Weaviate HTTP client + GraphQL helpers

• Adds an authenticated reqwest-based client with retry/backoff integration. Implements class-name sanitization, strict JSON filter ($eq) translation into Weaviate where clauses, and GraphQL Get query parsing.

crates/mcb-providers/src/vector_store/weaviate/client.rs

provider.rsImplement VectorStoreProvider for Weaviate +175/-0

Implement VectorStoreProvider for Weaviate

• Implements collection creation/deletion, batched vector insertion, similarity search via GraphQL, and object CRUD via Weaviate REST endpoints. Adds argument invariants (empty vectors/ids, vectors/metadata mismatch).

crates/mcb-providers/src/vector_store/weaviate/provider.rs

admin.rsAdd Weaviate VectorStoreAdmin support +84/-0

Add Weaviate VectorStoreAdmin support

• Implements collection existence checks and collection stats (vector count) using GraphQL Aggregate. Treats missing schema resources as a non-fatal 'does not exist' signal.

crates/mcb-providers/src/vector_store/weaviate/admin.rs

browser.rsAdd Weaviate VectorStoreBrowser support +58/-0

Add Weaviate VectorStoreBrowser support

• Adds collection listing via /v1/schema and file chunk browsing via a where-clause filtered GraphQL Get. Sorts chunks by start line for stable presentation.

crates/mcb-providers/src/vector_store/weaviate/browser.rs

registry.rsRegister Weaviate provider factory +39/-0

Register Weaviate provider factory

• Adds a factory that validates required config (uri), builds a default HTTP client, and returns a Weaviate provider instance. Registers the provider under the name "weaviate".

crates/mcb-providers/src/vector_store/weaviate/registry.rs

mod.rsExpose Weaviate vector store as a supported provider +3/-0

Expose Weaviate vector store as a supported provider

• Adds the weaviate module to the provider set and re-exports the Weaviate provider type for callers.

crates/mcb-providers/src/vector_store/mod.rs

Bug fix (4) +58 / -580
m20260301_000001_initial_schema.rsOrg-scope observations and FTS for multitenancy +8/-5

Org-scope observations and FTS for multitenancy

• Adds org_id to observations, includes org_id in the FTS virtual table for tenant-scoped full-text queries, and shifts content_hash uniqueness to an org-scoped unique index.

crates/mcb-providers/src/database/seaorm/migration/m20260301_000001_initial_schema.rs

common.rsAlign organization slug with org id +8/-555

Align organization slug with org id

• Adjusts org/project bootstrap creation to use org_id as the organization slug, avoiding default-name collisions in multi-org scenarios.

crates/mcb-providers/src/database/seaorm/repos/common.rs

auth.rsIntroduce typed AuthError for admin authorization +29/-11

Introduce typed AuthError for admin authorization

• Replaces loco_rs error usage with a local thiserror-based AuthError and updates API-key extraction/verification to return typed unauthorized/internal results. Improves separation between server auth concerns and framework errors.

crates/mcb-server/src/auth.rs

search.rsPropagate org_id and normalize limit resolution in search handler +13/-9

Propagate org_id and normalize limit resolution in search handler

• Improves validation error shape/message, centralizes limit resolution, and resolves org_id for memory search requests. Updates memory search invocation to be explicitly org-scoped.

crates/mcb-server/src/handlers/search.rs

Refactor (6) +405 / -304
project.rsSplit project repository into sub-traits and refactor traversal +50/-21

Split project repository into sub-traits and refactor traversal

• Refactors the project repository to implement finer-grained project sub-traits and extracts dependency traversal queueing into a helper/state struct for readability and reuse.

crates/mcb-providers/src/database/seaorm/repos/project.rs

routes.rsCentralize Axum route building for reuse in tests +176/-0

Centralize Axum route building for reuse in tests

• Adds reusable route builders for public assets, admin UI/API, and MCP HTTP service, plus a canonical full router with a fallback 404. Enables integration tests to run against the same middleware/route table as production.

crates/mcb-server/src/controllers/routes.rs

mcp_server.rsRefactor Loco MCP initializer to reuse server routes and tighten config +96/-214

Refactor Loco MCP initializer to reuse server routes and tighten config

• Moves route construction responsibility into mcb-server routes, improves provider config validation (fail fast when not configured), and adds a watch-based shutdown signal to coordinate stdio-only mode.

crates/mcb/src/initializers/mcp_server.rs

composition.rsBundle bootstrap providers into McpBootstrapProviders +18/-13

Bundle bootstrap providers into McpBootstrapProviders

• Introduces a single struct to pass resolved embedding/vector/hybrid providers and execution flow into server bootstrap, reducing parameter sprawl and clarifying composition boundaries.

crates/mcb-server/src/composition.rs

memory.rsRestructure memory tool args via flattened sub-structs +63/-36

Restructure memory tool args via flattened sub-structs

• Extracts timeline-depth and injection options into dedicated structs and flattens them into MemoryArgs for cleaner schema organization and easier evolution.

crates/mcb-server/src/args/memory.rs

index.rsUse shared workspace path resolver for indexing +2/-20

Use shared workspace path resolver for indexing

• Replaces duplicated path validation logic with a shared resolve_workspace_path helper to keep argument handling consistent across handlers.

crates/mcb-server/src/handlers/index.rs

Tests (1) +8 / -8
Cargo.tomlRename integration test targets to explicit *_integration +8/-8

Rename integration test targets to explicit *_integration

• Updates test binary names and paths to match the integration test directory layout, improving clarity and reducing ambiguity in CI logs.

crates/mcb-providers/Cargo.toml

Documentation (3) +230 / -1154
056-multitenant-isolation-and-oidc-boundary.mdADR: multitenant isolation and auth boundary +149/-0

ADR: multitenant isolation and auth boundary

• Adds an ADR documenting tenant/org isolation requirements and the intended boundary with auth/OIDC concerns, providing rationale for org-scoped schema/query changes.

docs/adr/056-multitenant-isolation-and-oidc-boundary.md

CI_RELEASE.mdExpand release process documentation +0/-738

Expand release process documentation

• Adds or significantly expands operational documentation for CI-driven releases, including failure recovery and workflow behavior expectations.

docs/operations/CI_RELEASE.md

INTEGRATION_TESTS.mdExpand integration testing documentation +81/-416

Expand integration testing documentation

• Adds or significantly expands guidance for integration test execution, configuration, and CI behavior to support the updated workflow and new provider coverage.

docs/testing/INTEGRATION_TESTS.md

Other (7) +382 / -241
vector_store.rsAdd Weaviate constants +16/-0

Add Weaviate constants

• Introduces Weaviate-specific constants (distance metric, batch size, class prefix, auth scheme) used by the new provider implementation.

crates/mcb-utils/src/constants/vector_store.rs

Cargo.tomlBump workspace to 0.4.0 and switch patch overrides to pinned forks +40/-29

Bump workspace to 0.4.0 and switch patch overrides to pinned forks

• Bumps the workspace version to 0.4.0, tunes dev profile settings for faster local builds, and switches multiple [patch.crates-io] overrides from local paths to pinned Git forks.

Cargo.toml

Cargo.lockLockfile refresh for v0.4.0 dependencies +54/-25

Lockfile refresh for v0.4.0 dependencies

• Updates dependency lock entries to match the new workspace version and patched Git fork revisions.

Cargo.lock

ci.ymlCI hardening: sccache, cache fixes, typos gate, and agent pointer check +131/-141

CI hardening: sccache, cache fixes, typos gate, and agent pointer check

• Avoids duplicate push runs for feature branches, enables sccache with bounded cache size, and adds typos + generated agent pointer verification to lint/doc change flows. Adjusts rust-cache behavior to keep dependencies warm across failed iterations.

.github/workflows/ci.yml

typos.tomlAdd typos configuration and baseline allowlist +55/-0

Add typos configuration and baseline allowlist

• Introduces typos configuration to support the new CI spell-check gate and reduce false positives via an allowlist/baseline.

typos.toml

nextest.tomlAdd/adjust nextest configuration for parallel test execution not counted

Add/adjust nextest configuration for parallel test execution

• Adds nextest configuration to improve test execution speed and stability under CI by controlling retries, profiles, and/or test grouping behavior.

config/nextest.toml

MakefileDeveloper workflow updates (hooks/nextest integration) +86/-46

Developer workflow updates (hooks/nextest integration)

• Updates Make targets to better support faster local workflows (pre-commit vs pre-push tiers) and integrate cargo-nextest where available with fallback behavior.

Makefile

@qodo-code-review

qodo-code-review Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (11) 📘 Rule violations (15) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 36 rules

Grey Divider


Action required

1. Weaviate tenants never applied 🐞 Bug ⛨ Security
Description
The new Weaviate provider creates ordinary shared classes and performs inserts, searches, and
deletes without any tenant identifier. Organizations using the same collection therefore share
vectors, enabling cross-tenant code search and mutation despite the provider advertising native
multi-tenancy.
Code

crates/mcb-providers/src/vector_store/weaviate/provider.rs[R26-29]

+        let body = serde_json::json!({
+            "class": class,
+            "vectorizer": "none",
+            "vectorIndexConfig": { "distance": WEAVIATE_DISTANCE_METRIC },
Relevance

●●● Strong

Tenant isolation is central to the PR and ADR; the omission creates severe cross-organization
exposure.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The schema body has no multi-tenant configuration, and all provider operations accept only a
collection without an organization tenant. The code-search handler similarly calls the search
service without propagating any organization, while the registry claims native multi-tenancy and the
ADR mandates tenant-per-org isolation.

crates/mcb-providers/src/vector_store/weaviate/provider.rs[18-173]
crates/mcb-providers/src/vector_store/weaviate/registry.rs[35-38]
crates/mcb-server/src/handlers/search.rs[114-130]
crates/mcb-domain/src/ports/providers/vector_store.rs[59-98]
docs/adr/056-multitenant-isolation-and-oidc-boundary.md[84-96]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Weaviate implementation does not configure multi-tenant classes or provide an organization tenant on vector operations. Add authenticated tenant context throughout the vector-store API and apply it to every Weaviate request.

## Issue Context
Code search currently ignores `SearchArgs.org_id`, while the provider API accepts only a collection identifier. Tenant identity must originate from the authenticated principal, not caller input.

## Fix Focus Areas
- crates/mcb-domain/src/ports/providers/vector_store.rs[10-98]
- crates/mcb-providers/src/vector_store/weaviate/provider.rs[18-173]
- crates/mcb-providers/src/vector_store/weaviate/browser.rs[14-57]
- crates/mcb-server/src/handlers/search.rs[114-130]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Manual releases build wrong ref 🐞 Bug ≡ Correctness
Description
The new dispatch input determines the published release tag, but release-build checks out the
workflow dispatch SHA rather than that tag. Re-running a historical release can therefore publish
binaries built from the current branch under the historical version.
Code

.github/workflows/release.yml[R22-27]

+  workflow_dispatch:
+    inputs:
+      tag:
+        description: Existing tag to (re)publish a GitHub Release for (e.g. v0.3.2)
+        required: true
+        type: string
Relevance

●●● Strong

Wrong-ref release builds are deterministic and severe; release workflow correctness fixes have been
accepted.

PR-#105

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The dispatch event introduces a required tag input, but the build checkout has no ref and
therefore uses the dispatch revision. Later steps independently use the input tag to name and
publish the release, creating two different revision sources.

.github/workflows/release.yml[20-27]
.github/workflows/release.yml[37-77]
.github/workflows/release.yml[132-189]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Manual release runs publish under the requested tag while building the dispatch branch revision. Make the requested tag the single source of truth for both checkout and release metadata.

## Issue Context
For `workflow_dispatch`, the checkout action defaults to `github.sha`. The input tag is only consumed later by release creation, so artifacts and their release tag can represent different commits.

## Fix Focus Areas
- .github/workflows/release.yml[20-27]
- .github/workflows/release.yml[37-77]
- .github/workflows/release.yml[132-189]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Auto-init failures block tools 🐞 Bug ☼ Reliability
Description
Session and project repository failures are now converted to McpError and propagated through
handle_call_tool, even though auto-initialization is documented as non-fatal. A transient database
failure consequently rejects the requested tool operation instead of only skipping automatic
initialization.
Code

crates/mcb-server/src/mcp_server.rs[R403-410]

+    services
+        .agent_session
+        .create_session(session)
+        .await
+        .map_err(|e| {
+            tracing::warn!("Auto-session creation failed (non-fatal): {e}");
+            McpError::internal_error(format!("Auto-session creation failed: {e}"), None)
+        })?;
Relevance

●●● Strong

Propagating explicitly non-fatal initialization failures contradicts documented behavior and
deterministically blocks tools.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The call path now applies ? to auto_create_session_and_project, and the session and project
helpers return mapped repository errors. This contradicts the adjacent documented policy that
database failures are logged and swallowed.

crates/mcb-server/src/mcp_server.rs[290-295]
crates/mcb-server/src/mcp_server.rs[367-410]
crates/mcb-server/src/mcp_server.rs[454-503]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Automatic session and project creation now propagates repository failures into tool dispatch. Preserve validation errors where required, but log and swallow repository failures as the documented non-fatal policy specifies.

## Issue Context
`handle_call_tool` uses `?` on the combined auto-initialization routine. Both creation helpers currently map database failures into `McpError`, causing unrelated tools to become unavailable during persistence failures.

## Fix Focus Areas
- crates/mcb-server/src/mcp_server.rs[290-295]
- crates/mcb-server/src/mcp_server.rs[367-410]
- crates/mcb-server/src/mcp_server.rs[454-503]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (10)
4. Dependency scan hides I/O failures 📘 Rule violation ☼ Reliability
Description
The new dependency scanner silently skips directories when read_dir fails, treating an incomplete
scan as if no forbidden dependency was found. Permission and filesystem failures can therefore
produce false-negative compliance results.
Code

crates/mcb-validate/src/engines/rusty_cargo_deps.rs[R19-20]

+        let Ok(entries) = std::fs::read_dir(&dir) else {
+            continue;
Relevance

●●● Strong

Team previously accepted exposing filesystem failures that silently caused skipped validation
behavior.

PR-#87

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 1208751 requires errors to be propagated, logged, or explicitly handled. The `let Ok(entries) =
... else { continue; } branch discards read_dir` errors and continues with an incomplete scan.

Rule 1208751: Errors must not be silently swallowed or hidden
crates/mcb-validate/src/engines/rusty_cargo_deps.rs[18-23]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Cargo dependency scanner silently continues after directory-read failures.

## Issue Context
A failed directory read means the scanner cannot reliably conclude that forbidden dependencies are absent. Return a typed result and propagate or explicitly report the I/O error.

## Fix Focus Areas
- crates/mcb-validate/src/engines/rusty_cargo_deps.rs[12-43]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. chunks hides provider failures 📘 Rule violation ☼ Reliability
Description
The all-collections path converts a list_collections() failure into an empty collection list with
unwrap_or_default(). Clients consequently receive a successful empty response during vector-store
outages instead of an error or observable handling.
Code

crates/mcb-server/src/controllers/collections_api.rs[R59-63]

+        let collections = state
+            .vector_store
+            .list_collections()
+            .await
+            .unwrap_or_default();
Relevance

●●● Strong

Close accepted precedent favors surfacing silently hidden failures instead of returning misleading
empty results.

PR-#87

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 1208751 prohibits silently ignored errors. The added unwrap_or_default() discards the error
from the asynchronous list_collections() operation without propagation or logging.

Rule 1208751: Errors must not be silently swallowed or hidden
crates/mcb-server/src/controllers/collections_api.rs[59-63]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `chunks` handler silently turns a vector-store listing error into an empty successful response.

## Issue Context
The handler already returns `Result<Response>`, so the provider error can be mapped and propagated; alternatively, explicitly log and justify degraded behavior.

## Fix Focus Areas
- crates/mcb-server/src/controllers/collections_api.rs[59-71]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Caller controls tenant scope 🐞 Bug ⛨ Security
Description
The new isolation path takes org_id directly from caller-controlled MCP arguments and uses it for
scoped memory reads and writes. An authenticated client can therefore select another organization
and access or modify that tenant's memory instead of using an organization bound to its principal.
Code

crates/mcb-server/src/handlers/memory/observation.rs[55]

+    let org_id = resolve_org_id(args.org_id.as_deref());
Relevance

●●● Strong

Caller-selected tenant scope directly contradicts the PR’s isolation policy and creates cross-tenant
access.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
MemoryArgs exposes org_id as request input, resolve_org_id returns that explicit value
unchanged, and the modified observation handler feeds it directly into org-scoped persistence. The
new ADR explicitly requires handlers to derive the tenant from RequestPrincipal, never from
arguments.

crates/mcb-server/src/args/memory.rs[79-101]
crates/mcb-server/src/utils/mcp/helpers.rs[32-39]
crates/mcb-server/src/handlers/memory/observation.rs[52-94]
docs/adr/056-multitenant-isolation-and-oidc-boundary.md[71-89]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Memory handlers trust the caller-provided `org_id`, allowing clients to select another tenant's storage scope. Resolve the organization exclusively from an authenticated request principal and reject conflicting tenant arguments.

## Issue Context
`MemoryArgs.org_id` is untrusted tool input, and `resolve_org_id` returns explicit input unchanged. The architecture requires handlers to use the principal's organization rather than request arguments.

## Fix Focus Areas
- crates/mcb-server/src/handlers/memory/observation.rs[52-94]
- crates/mcb-server/src/utils/mcp/helpers.rs[32-39]
- crates/mcb-server/src/args/memory.rs[79-101]
- crates/mcb-server/src/handlers/search.rs[232-256]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. sccache install failure suppressed 📘 Rule violation ☼ Reliability
Description
The Makefile suppresses every cargo install sccache failure with redirected stderr and || true,
despite configuring sccache as mandatory. Setup proceeds without explaining why the required build
wrapper is unavailable.
Code

Makefile[57]

+$(shell cargo install sccache --locked 2>/dev/null || true)
Relevance

●● Moderate

Fail-fast precedent is mixed: similar hidden failures were accepted, but an exact || true removal
was rejected.

PR-#90
PR-#105

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 1208751 prohibits silently swallowed errors. The added command redirects installation errors to
/dev/null and uses || true, guaranteeing that installation failure is ignored.

Rule 1208751: Errors must not be silently swallowed or hidden
Makefile[54-58]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The automatic `sccache` installation suppresses command failures and diagnostic output.

## Issue Context
Because `RUSTC_WRAPPER` is unconditionally set to `sccache`, installation failure should stop setup with an actionable error or be explicitly handled without hiding its cause.

## Fix Focus Areas
- Makefile[44-58]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Moved batch vector reused 🐞 Bug ≡ Correctness
Description
WeaviateVectorStoreProvider::insert_vectors moves objects into serde_json::json! and then
calls objects.clear(), which is a use-after-move compile error that prevents the crate from
building.
Code

crates/mcb-providers/src/vector_store/weaviate/provider.rs[R83-90]

+            if objects.len() >= WEAVIATE_BATCH_SIZE || i == vectors.len() - 1 {
+                self.request(
+                    reqwest::Method::POST,
+                    "/v1/batch/objects",
+                    Some(serde_json::json!({ "objects": objects })),
+                )
+                .await?;
+                objects.clear();
Evidence
The diff shows objects being moved into the JSON payload and then reused via objects.clear(),
which Rust rejects because Vec<Value> is moved by value into json!.

crates/mcb-providers/src/vector_store/weaviate/provider.rs[73-91]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
In `insert_vectors`, the code constructs the batch JSON payload with `serde_json::json!({ "objects": objects })`, which moves `objects` into the JSON value. Immediately after the request, it calls `objects.clear()`, which is a compile-time use-after-move error.

## Issue Context
This is inside the batching loop for `/v1/batch/objects` inserts.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/provider.rs[73-91]

### Suggested fix
Use a temporary batch value and leave `objects` usable, e.g.:
- `let batch = std::mem::take(&mut objects);` then `json!({"objects": batch})` (no need to `clear()`), or
- `json!({"objects": objects.clone()})` (less efficient), or
- build the JSON from an iterator without moving the original vec.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Liveness route not registered 🐞 Bug ☼ Reliability
Description
The new Axum router builder does not register any route for the existing health_api::alive
handler, so /alive is not served by the router that the app merges into the top-level route table.
Code

crates/mcb-server/src/controllers/routes.rs[R21-55]

+/// Public routes — no auth required (static assets + redirect).
+pub fn build_public_routes() -> AxumRouter {
+    axum::Router::new()
+        .route(
+            "/",
+            axum::routing::get(|| async { axum::response::Redirect::temporary("/ui/") }),
+        )
+        .route(
+            "/favicon.ico",
+            axum::routing::get(|| async {
+                (
+                    [(axum::http::header::CONTENT_TYPE, "image/svg+xml")],
+                    include_str!("../../../../assets/admin/favicon.svg"),
+                )
+            }),
+        )
+        .route(
+            "/ui/theme.css",
+            axum::routing::get(|| async {
+                (
+                    [(axum::http::header::CONTENT_TYPE, "text/css")],
+                    include_str!("../../../../assets/admin/ui/theme.css"),
+                )
+            }),
+        )
+        .route(
+            "/ui/shared.js",
+            axum::routing::get(|| async {
+                (
+                    [(axum::http::header::CONTENT_TYPE, "application/javascript")],
+                    include_str!("../../../../assets/admin/ui/shared.js"),
+                )
+            }),
+        )
+}
Evidence
health_api::alive() is implemented but not referenced by the new Axum router construction; the app
initializer merges that router at the top level, so the missing route is externally visible.

crates/mcb-server/src/controllers/health_api.rs[38-53]
crates/mcb-server/src/controllers/routes.rs[19-55]
crates/mcb-server/src/controllers/routes.rs[149-161]
crates/mcb/src/initializers/mcp_server.rs[238-247]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`health_api::alive()` exists, but the new Axum router builder never routes to it. As a result, `/alive` requests will not match and will return 404 through the assembled router.

## Issue Context
- `health_api::alive()` is intended as a lightweight liveness probe.
- `build_public_routes()` currently only serves `/` and static UI assets.
- The Loco initializer merges `build_router_without_fallback()` directly into the app router, so whatever is missing here is missing in production.

## Fix Focus Areas
- crates/mcb-server/src/controllers/routes.rs[21-55]
- crates/mcb-server/src/controllers/health_api.rs[38-53]
- crates/mcb/src/initializers/mcp_server.rs[238-247]

### Suggested fix
In `build_public_routes()`, add a public GET route for liveness, e.g.:
- `.route("/alive", axum::routing::get(super::health_api::alive))`
Optionally also add an alias for environments that hit `/api/alive` without rewrite:
- `.route("/api/alive", axum::routing::get(super::health_api::alive))`

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. StdioServerShutdown swallows errors 📘 Rule violation ☼ Reliability
Description
StdioServerShutdown::wait() discards the watch::Receiver::changed() result and
spawn_stdio_server() discards the shutdown_tx.send(true) result, hiding shutdown-channel
failures. This can make shutdown logic silently stop working and be hard to diagnose.
Code

crates/mcb/src/initializers/mcp_server.rs[R32-36]

+impl StdioServerShutdown {
+    /// Wait for the stdio server to terminate.
+    pub async fn wait(mut self) {
+        let _ = self.0.changed().await;
+    }
Evidence
PR Compliance ID 1208751 forbids silently discarding errors. The added shutdown watcher ignores the
changed() result and the shutdown signal sender ignores the send(true) result, meaning failures
(e.g., channel closed) are silently dropped.

Rule 1208751: Errors must not be silently swallowed or hidden
crates/mcb/src/initializers/mcp_server.rs[32-36]
crates/mcb/src/initializers/mcp_server.rs[203-211]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New shutdown signaling code ignores errors via `let _ = ...`, which silently hides failures.

## Issue Context
Compliance requires errors not be swallowed; they must be propagated, logged, or explicitly handled.

## Fix Focus Areas
- crates/mcb/src/initializers/mcp_server.rs[32-36]
- crates/mcb/src/initializers/mcp_server.rs[203-211]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. Weaviate collection ID mismatch 🐞 Bug ≡ Correctness
Description
WeaviateVectorStoreProvider::list_collections returns Weaviate schema class names and passes them
into CollectionInfo::new, which derives a CollectionId from that string; this does not round-trip
back to the CollectionId used by class_name(). Server code later reconstructs CollectionId from
collection.name to call list_vectors, causing it to query a different Weaviate class and return
empty/incorrect results.
Code

crates/mcb-providers/src/vector_store/weaviate/browser.rs[R20-37]

+        let collections = response
+            .get("classes")
+            .and_then(Value::as_array)
+            .map(|arr| {
+                arr.iter()
+                    .filter_map(|c| c.get("class").and_then(Value::as_str))
+                    .map(|name| CollectionInfo::new(name, 0, 0, None, self.provider_name()))
+                    .collect()
+            })
+            .unwrap_or_default();
+        Ok(collections)
+    }
+
+    async fn list_file_paths(
+        &self,
+        collection: &CollectionId,
+        limit: usize,
+    ) -> Result<Vec<FileInfo>> {
Evidence
Weaviate lists schema classes and uses them as CollectionInfo names, but CollectionInfo::new derives
its CollectionId from that name. Server browse/controllers then derive a CollectionId from
collection.name and call list_vectors(), which (for Weaviate) re-derives a class name from that
CollectionId—producing a different class name than the one returned by /v1/schema.

crates/mcb-providers/src/vector_store/weaviate/browser.rs[15-31]
crates/mcb-providers/src/vector_store/weaviate/client.rs[61-72]
crates/mcb-domain/src/value_objects/browse/collection.rs[25-42]
crates/mcb-server/src/controllers/web/browse.rs[38-52]
crates/mcb-server/src/controllers/collections_api.rs[59-73]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`list_collections()` currently emits Weaviate *class* names as `CollectionInfo.name`, which the server later feeds into `CollectionId::from_string(...)` and then back into provider methods. Because `class_name(CollectionId)` is not invertible via `CollectionId::from_string(class_name)`, the browse/list-all code will call `list_vectors()` with the wrong CollectionId and therefore query the wrong Weaviate class.

## Issue Context
Weaviate class names are derived from `CollectionId` by prefixing and sanitizing the UUID string. `CollectionInfo::new()` derives `id` from the provided name, and server browse APIs reconstruct `CollectionId` from `collection.name`.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/browser.rs[15-31]
- crates/mcb-providers/src/vector_store/weaviate/client.rs[61-72]
- crates/mcb-domain/src/value_objects/browse/collection.rs[25-42]
- crates/mcb-server/src/controllers/web/browse.rs[38-52]
- crates/mcb-server/src/controllers/collections_api.rs[59-73]

## Suggested fix
In `WeaviateVectorStoreProvider::list_collections`, only include classes that match the provider’s naming scheme, and convert them back to the *underlying* collection identifier string (UUID) used elsewhere.

Example approach:
1. For each returned class name:
  - Verify it starts with `WEAVIATE_CLASS_PREFIX`.
  - Strip the prefix.
  - Replace `_` back to `-` (since the source is a UUID string).
  - Validate it parses as a UUID.
2. Construct `CollectionInfo` such that:
  - `CollectionInfo.name` is that UUID string (so `CollectionId::from_string(&name)` round-trips).
  - `CollectionInfo.id` is `CollectionId::from_string(&uuid_str)` (construct the struct directly rather than using `CollectionInfo::new` if needed).

This aligns Weaviate behavior with providers like Qdrant that use the UUID string as the backend collection name.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. TestServer::start swallows errors 📘 Rule violation ☼ Reliability
Description
TestServer::start() converts multiple fallible operations to Option via .ok()?, discarding the
underlying error details without logging/propagating them. This can hide real failures and make test
failures/CI flakes harder to diagnose.
Code

crates/mcb-server/tests/utils/test_server.rs[R83-93]

+    /// Start the Axum application on an ephemeral loopback port.
+    async fn start(router: AxumRouter, state: McbState, temp_dir: TempDir) -> Option<Self> {
+        let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.ok()?;
+        let addr: SocketAddr = listener.local_addr().ok()?;
+        let base_url = format!("http://{addr}");
+
+        let client = Client::builder()
+            .timeout(std::time::Duration::from_secs(30))
+            .build()
+            .ok()?;
+
Evidence
PR Compliance ID 1208751 disallows silently discarding errors. In TestServer::start(),
.await.ok()? and .build().ok()? drop error details without propagation/logging.

Rule 1208751: Errors must not be silently swallowed or hidden
crates/mcb-server/tests/utils/test_server.rs[83-93]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Fallible calls in `TestServer::start()` are converted with `.ok()?`, which silently discards error information.

## Issue Context
The compliance rule requires errors to be propagated, logged, or explicitly handled with justification.

## Fix Focus Areas
- crates/mcb-server/tests/utils/test_server.rs[83-93]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. #[allow(dead_code)] in TestServer 📘 Rule violation ⚙ Maintainability
Description
The new TestServer struct adds #[allow(dead_code)], bypassing dead-code enforcement instead of
removing/using the unused items. This violates the requirement to avoid dead code and not suppress
dead_code.
Code

crates/mcb-server/tests/utils/test_server.rs[R47-54]

+    /// Router handle, kept to ensure the service remains valid.
+    #[allow(dead_code)]
+    router: AxumRouter,
+    /// Abort handle for the background serve task.
+    abort_handle: tokio::task::AbortHandle,
+    /// Temp directory with the isolated database.
+    #[allow(dead_code)]
+    temp_dir: TempDir,
Evidence
PR Compliance ID 1208459 forbids introducing dead code and explicitly calls out adding
#[allow(dead_code)] as a violation. The new TestServer struct includes #[allow(dead_code)] on
fields.

Rule 1208459: No dead code (unused functions, structs, constants)
crates/mcb-server/tests/utils/test_server.rs[42-57]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`#[allow(dead_code)]` was introduced on fields in `TestServer`, which bypasses dead-code enforcement.

## Issue Context
The compliance rule requires no dead code and disallows adding `#[allow(dead_code)]` to bypass the lint.

## Fix Focus Areas
- crates/mcb-server/tests/utils/test_server.rs[47-54]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

14. client.rs imports misordered 📘 Rule violation ⚙ Maintainability
Description
The new Weaviate client places mcb_domain imports between external-crate imports, splitting the
external group and violating the required std → external → mcb_* → local order.
Code

crates/mcb-providers/src/vector_store/weaviate/client.rs[R7-9]

+use mcb_domain::error::{Error, Result};
+use mcb_domain::value_objects::{CollectionId, SearchResult};
+use reqwest::Client;
Relevance

●●● Strong

This is a trivial, deterministic import-order compliance fix.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 1207880 requires external-crate imports to precede all mcb_* imports. Here,
mcb_domain appears after dashmap but before the external reqwest and serde_json imports.

Rule 1207880: Enforce grouped and ordered Rust imports: std, external crates, mcb_*, then local modules
crates/mcb-providers/src/vector_store/weaviate/client.rs[6-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Weaviate client imports do not follow the required Rust import-group order.

## Issue Context
All external crates, including `dashmap`, `reqwest`, and `serde_json`, must appear before imports from `mcb_*` crates.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/client.rs[3-23]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


15. Failed validation poisons guard 🐞 Bug ☼ Reliability
Description
auto_create_session records the session ID in init_sessions before the newly fallible model
validation and session construction. If validation fails, later calls with that ID skip
initialization and validation, leaving the session absent or invalid for the process lifetime.
Code

crates/mcb-server/src/mcp_server.rs[402]

+    let session = build_auto_session(ctx, session_id, ide_label)?;
Relevance

●●● Strong

This is a concrete retry-state bug caused by recording success before fallible initialization
completes.

PR-#87

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The session ID is inserted into the DashSet before build_auto_session runs. That builder now
fails for an absent model or clock error, while every subsequent attempt sees the existing ID and
returns without retrying validation or creation.

crates/mcb-server/src/mcp_server.rs[387-410]
crates/mcb-server/src/mcp_server.rs[415-450]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The session initialization guard is committed before fallible validation and persistence complete. Insert the completed guard only after successful creation, or remove it on every failure while preserving concurrency safety.

## Issue Context
A missing `model_id`, clock failure, or repository failure can occur after the `DashSet` insertion. Subsequent calls then take the early-return path and never retry initialization.

## Fix Focus Areas
- crates/mcb-server/src/mcp_server.rs[387-410]
- crates/mcb-server/src/mcp_server.rs[415-450]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


16. Highlight service exceeds size limit 📘 Rule violation ⚙ Maintainability
Description
The newly introduced synchronous highlight service is 304 lines, substantially exceeding the
approximately 200-line source-file limit. Language configuration and highlight-event parsing can be
extracted into focused submodules.
Code

crates/mcb-infrastructure/src/services/highlight_sync_service.rs[304]

+}
Relevance

●● Moderate

The explicit size rule supports splitting, but this is a substantial architectural refactor without
close precedent.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 1208563 requires oversized new source files to be split into submodules. The entirely new
highlight service extends through line 304.

Rule 1208563: Source files must not exceed ~200 lines
crates/mcb-infrastructure/src/services/highlight_sync_service.rs[1-304]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new synchronous highlight service contains 304 lines and exceeds the project source-file size guideline.

## Issue Context
Language-to-tree-sitter configuration and event parsing are distinct responsibilities that can be moved to dedicated submodules.

## Fix Focus Areas
- crates/mcb-infrastructure/src/services/highlight_sync_service.rs[1-304]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (9)
17. client.rs exceeds size limit 📘 Rule violation ⚙ Maintainability
Description
The newly introduced Weaviate client is 253 lines, exceeding the approximately 200-line source-file
limit. Its request handling, GraphQL construction, response validation, and result conversion should
be separated into focused modules.
Code

crates/mcb-providers/src/vector_store/weaviate/client.rs[253]

+}
Relevance

●● Moderate

The file exceeds the stated limit, but module boundaries are subjective and lack close precedent.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 1208563 requires new or modified source files over approximately 200 lines to be split into
submodules. This newly added file ends at line 253.

Rule 1208563: Source files must not exceed ~200 lines
crates/mcb-providers/src/vector_store/weaviate/client.rs[1-253]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new Weaviate client source file contains 253 lines and exceeds the project size guideline.

## Issue Context
GraphQL query construction and response conversion are natural candidates for extraction while retaining the provider client in `client.rs`.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/client.rs[1-253]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


18. External .agents symlinks 🐞 Bug ☼ Reliability
Description
The PR adds new .agents/* and .agents/skills/* entries that resolve to ../../flext/...
(outside this repository), so in any checkout without that sibling flext directory these links
will be dangling and the referenced agent/workspace configuration won’t load. Any consumer that
dereferences these paths will also traverse outside the workspace, which is commonly blocked in
CI/sandbox environments and can cause unexpected failures.
Code

.agents/provider.toml[1]

+../../flext/.agents/provider.toml
Evidence
The repo documents .agents/skills/... as an entrypoint for workspace behavior, and the FLEXT
documentation explicitly references flext as living outside this repo, matching the new
../../flext/... external-link approach.

AGENTS.md[201-207]
docs/developer/FLEXT_TO_MCB_MAPPING.md[7-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New `.agents/*` entries are being introduced as external links (e.g. `../../flext/...`) that depend on a sibling `flext` checkout existing outside this repository. This makes the `.agents` surface non-portable and brittle across environments.

## Issue Context
`AGENTS.md` directs workflows to start from `.agents/skills/...`, so if these linked configs/skills aren’t resolvable, agent/tooling setup becomes inconsistent across machines/CI.

## Fix Focus Areas
- .agents/provider.toml[1-1]
- .agents/INSTRUCTION_SURFACE.md[1-1]
- .agents/skills/flext-context-routing[1-1]

## Suggested fix
- Prefer committing the needed `.agents` files directly into this repo (copy/vendor), OR add `flext` as an in-repo submodule/subtree and point links within the repo (no `..` traversal outside the repo).
- If external links are intentional for local-only workflows, gate them behind a documented bootstrap step (that creates links locally) and keep repo-committed `.agents` entries as valid defaults.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


19. highlight_sync_service imports misordered 📘 Rule violation ⚙ Maintainability
Description
use statements are not grouped/ordered as required: mcb_* imports appear before external crates
and then mcb_* imports reappear after externals. This violates the mandated std → external →
mcb_* → local grouping.
Code

crates/mcb-infrastructure/src/services/highlight_sync_service.rs[R7-15]

+use std::sync::Mutex;
+
+use mcb_domain::ports::HighlightError;
+use mcb_domain::value_objects::browse::{HighlightSpan, HighlightedCode};
+use tree_sitter::Language;
+use tree_sitter_highlight::{Highlight, HighlightConfiguration, HighlightEvent, Highlighter};
+
+use mcb_domain::value_objects::browse::{HIGHLIGHT_NAMES, map_highlight_to_category};
+
Evidence
PR Compliance ID 1207880 requires ordered and contiguous import groups. In this file, mcb_domain
imports appear before tree_sitter (external) and another mcb_domain import appears after
external imports.

Rule 1207880: Enforce grouped and ordered Rust imports: std, external crates, mcb_*, then local modules
crates/mcb-infrastructure/src/services/highlight_sync_service.rs[7-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Import groups are out of order / non-contiguous, violating the enforced Rust import grouping convention.

## Issue Context
Imports must be contiguous by group and ordered: std, external crates, mcb_* crates, then local modules.

## Fix Focus Areas
- crates/mcb-infrastructure/src/services/highlight_sync_service.rs[7-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


20. collection_exists masks outages 🐞 Bug ☼ Reliability
Description
WeaviateVectorStoreProvider::collection_exists returns Ok(false) for any request error, not just
404, so timeouts/5xx/auth failures are misreported as “collection missing.” This can trigger
incorrect create attempts and makes operational problems appear as empty state.
Code

crates/mcb-providers/src/vector_store/weaviate/admin.rs[R20-30]

+    async fn collection_exists(&self, name: &CollectionId) -> Result<bool> {
+        let class = Self::class_name(name);
+        match self
+            .request(reqwest::Method::GET, &format!("/v1/schema/{class}"), None)
+            .await
+        {
+            Ok(_) => Ok(true),
+            // A missing class is a legitimate "does not exist" answer, not a
+            // transport failure: Weaviate returns 404 for unknown classes.
+            Err(_) => Ok(false),
+        }
Evidence
collection_exists treats any Err from request() as false. The HTTP helper returns Err for any
non-2xx status, so 5xx and other failures will be misclassified as “missing”.

crates/mcb-providers/src/vector_store/weaviate/admin.rs[20-30]
crates/mcb-providers/src/utils/http_response.rs[31-58]
crates/mcb-infrastructure/src/services/context_service.rs[38-51]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`collection_exists()` currently maps *all* request failures to `Ok(false)`. This conflates “collection does not exist” (expected 404) with connectivity errors, authentication errors, and server-side failures.

## Issue Context
`request()` uses shared HTTP helpers that return an error for any non-2xx response. As a result, 401/500/timeouts all become `Err(...)` and are treated as “does not exist”.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/admin.rs[20-30]
- crates/mcb-providers/src/vector_store/weaviate/client.rs[79-107]
- crates/mcb-providers/src/utils/http_response.rs[31-58]

## Suggested fix
Implement `collection_exists` in a way that can distinguish 404 from other failures:
- Option A (preferred): perform the GET using `reqwest` directly (reusing auth headers logic) and inspect `status()`:
 - `200..299` => `Ok(true)`
 - `404` => `Ok(false)`
 - otherwise => return `Err(Error::vector_db(...))`
- Option B: extend the shared HTTP utility to surface HTTP status codes in the error type for vector-db requests, then branch on 404 here.

Do not swallow transport/timeouts/5xx; those should propagate so callers can retry/alert appropriately.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


21. Unjustified #[allow(clippy::print_stdout)] 📘 Rule violation ⚙ Maintainability
Description
A clippy suppression directive is used without an inline justification comment. This reduces
auditability of why the suppression is necessary.
Code

crates/mcb-domain/src/utils/tests/service_detection.rs[R126-128]

+/// Print the service availability summary to stdout.
+#[allow(clippy::print_stdout)]
+pub fn print_service_availability_summary() {
Evidence
PR Compliance ID 1206895 requires an inline justification for each suppression directive.
#[allow(clippy::print_stdout)] appears without any justification comment adjacent to it.

Rule 1206895: Require inline justification comments for all static-analysis suppression directives
crates/mcb-domain/src/utils/tests/service_detection.rs[126-128]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A static-analysis suppression (`#[allow(...)]`) is missing an inline justification comment.

## Issue Context
Suppressions must have a specific, non-empty justification on the same line or immediately following line.

## Fix Focus Areas
- crates/mcb-domain/src/utils/tests/service_detection.rs[126-128]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


22. Edits under third-party/ 📘 Rule violation § Compliance
Description
The PR removes vendored submodules under third-party/ without any explicit request authorizing
changes in that directory. This violates the rule prohibiting modifications under third-party/
unless explicitly requested.
Code

third-party/sea-orm[1]

-Subproject commit c1b8409a45c5dc20de91e331ee0cbb86fb9a72d0
Evidence
The rule forbids touching third-party/ unless explicitly requested (PR Compliance ID 1207169). The
PR includes removal of third-party/ submodules, indicated by the updated .gitmodules content.

Rule 1207169: Do not modify files under third-party/ unless explicitly requested
.gitmodules[1-2]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Files under `third-party/` were modified (submodules removed) without an explicit request authorizing changes there.

## Issue Context
The compliance rule forbids any modifications under `third-party/` unless the PR/request explicitly calls for it.

## Fix Focus Areas
- .gitmodules[1-2]

ⓘ Copy this prompt and use it t

[Comment truncated to fit github's 65,536-char limit.]

Comment thread third-party/sea-orm
@@ -1 +0,0 @@
Subproject commit c1b8409a45c5dc20de91e331ee0cbb86fb9a72d0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

1. Edits under third-party/ 📘 Rule violation § Compliance

The PR removes vendored submodules under third-party/ without any explicit request authorizing
changes in that directory. This violates the rule prohibiting modifications under third-party/
unless explicitly requested.
Agent Prompt
## Issue description
Files under `third-party/` were modified (submodules removed) without an explicit request authorizing changes there.

## Issue Context
The compliance rule forbids any modifications under `third-party/` unless the PR/request explicitly calls for it.

## Fix Focus Areas
- .gitmodules[1-2]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 29 to +33
pub fn load_app_config() -> Result<AppConfig> {
let env_name = std::env::var("LOCO_ENV").unwrap_or_else(|_| "test".to_owned());
let env_name = std::env::var("LOCO_ENV").unwrap_or_else(|_| {
tracing::warn!("LOCO_ENV not set; defaulting to 'test'");
"test".to_owned()
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

2. loco_env defaulted to test 📘 Rule violation ☼ Reliability

load_app_config() continues startup/config initialization when LOCO_ENV is missing by defaulting
to test, rather than failing fast. This can lead to running with the wrong environment
configuration.
Agent Prompt
## Issue description
`load_app_config()` treats missing `LOCO_ENV` as non-fatal and falls back to `test`.

## Issue Context
Per the compliance rule, required external configuration must cause an explicit startup failure when missing.

## Fix Focus Areas
- crates/mcb-infrastructure/src/config/loader.rs[29-33]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +47 to +54
/// Router handle, kept to ensure the service remains valid.
#[allow(dead_code)]
router: AxumRouter,
/// Abort handle for the background serve task.
abort_handle: tokio::task::AbortHandle,
/// Temp directory with the isolated database.
#[allow(dead_code)]
temp_dir: TempDir,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

3. #[allow(dead_code)] in testserver 📘 Rule violation ⚙ Maintainability

The new TestServer struct adds #[allow(dead_code)], bypassing dead-code enforcement instead of
removing/using the unused items. This violates the requirement to avoid dead code and not suppress
dead_code.
Agent Prompt
## Issue description
`#[allow(dead_code)]` was introduced on fields in `TestServer`, which bypasses dead-code enforcement.

## Issue Context
The compliance rule requires no dead code and disallows adding `#[allow(dead_code)]` to bypass the lint.

## Fix Focus Areas
- crates/mcb-server/tests/utils/test_server.rs[47-54]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +126 to +128
/// Print the service availability summary to stdout.
#[allow(clippy::print_stdout)]
pub fn print_service_availability_summary() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

4. Unjustified #[allow(clippy::print_stdout)] 📘 Rule violation ⚙ Maintainability

A clippy suppression directive is used without an inline justification comment. This reduces
auditability of why the suppression is necessary.
Agent Prompt
## Issue description
A static-analysis suppression (`#[allow(...)]`) is missing an inline justification comment.

## Issue Context
Suppressions must have a specific, non-empty justification on the same line or immediately following line.

## Fix Focus Areas
- crates/mcb-domain/src/utils/tests/service_detection.rs[126-128]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +9 to +22
use std::net::SocketAddr;
use std::sync::Arc;

use anyhow::Result;
use axum::Router as AxumRouter;
use mcb_domain::entities::ApiKey;
use mcb_domain::utils::tests::utils::{create_test_admin_user, create_test_organization};
use mcb_server::axum_routes;
use mcb_server::state::McbState;
use mcb_utils::constants::auth::API_KEY_HEADER;
use reqwest::Client;
use tempfile::TempDir;

use crate::utils::domain_services::create_real_domain_services;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

5. Rust imports mis-grouped 📘 Rule violation ⚙ Maintainability

The use statements are not grouped/ordered as required: an external crate import (reqwest,
tempfile) appears after mcb_* imports. This violates the required std → external → mcb_* →
local ordering.
Agent Prompt
## Issue description
Rust `use` imports are not grouped/ordered per the required std, external, mcb_*, local sequence.

## Issue Context
Mixed grouping increases diff churn and reduces readability.

## Fix Focus Areas
- crates/mcb-server/tests/utils/test_server.rs[9-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +240 to +274
fn drop(&mut self) {
self.abort_handle.abort();
}
}

/// Test helper: assert that a response body contains the expected substring.
///
/// # Errors
/// Returns the underlying `reqwest` error if reading the response body fails.
///
/// # Panics
/// Panics if the body does not contain `expected`.
pub async fn assert_body_contains(response: reqwest::Response, expected: &str) -> Result<()> {
let text = response.text().await?;
assert!(
text.contains(expected),
"expected body to contain {expected:?}; got: {text}"
);
Ok(())
}

#[cfg(test)]
mod tests {
use super::*;

#[tokio::test]
async fn test_server_starts_and_serves_public_asset() -> Result<()> {
let Some(server) = TestServer::new().await else {
return Ok(());
};
let response = server.get("/ui/theme.css").await?;
assert_eq!(response.status(), reqwest::StatusCode::OK);
Ok(())
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

6. test_server.rs exceeds 200 lines 📘 Rule violation ⚙ Maintainability

The newly added source file is ~274 lines long, exceeding the ~200 line guideline. This should be
split into smaller modules/helpers to keep files maintainable.
Agent Prompt
## Issue description
A new/modified source file exceeds the ~200 line limit.

## Issue Context
Large files become harder to review and maintain; the rule expects refactoring into submodules.

## Fix Focus Areas
- crates/mcb-server/tests/utils/test_server.rs[240-274]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +83 to +93
/// Start the Axum application on an ephemeral loopback port.
async fn start(router: AxumRouter, state: McbState, temp_dir: TempDir) -> Option<Self> {
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.ok()?;
let addr: SocketAddr = listener.local_addr().ok()?;
let base_url = format!("http://{addr}");

let client = Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
.ok()?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

7. testserver::start swallows errors 📘 Rule violation ☼ Reliability

TestServer::start() converts multiple fallible operations to Option via .ok()?, discarding the
underlying error details without logging/propagating them. This can hide real failures and make test
failures/CI flakes harder to diagnose.
Agent Prompt
## Issue description
Fallible calls in `TestServer::start()` are converted with `.ok()?`, which silently discards error information.

## Issue Context
The compliance rule requires errors to be propagated, logged, or explicitly handled with justification.

## Fix Focus Areas
- crates/mcb-server/tests/utils/test_server.rs[83-93]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +20 to +37
let collections = response
.get("classes")
.and_then(Value::as_array)
.map(|arr| {
arr.iter()
.filter_map(|c| c.get("class").and_then(Value::as_str))
.map(|name| CollectionInfo::new(name, 0, 0, None, self.provider_name()))
.collect()
})
.unwrap_or_default();
Ok(collections)
}

async fn list_file_paths(
&self,
collection: &CollectionId,
limit: usize,
) -> Result<Vec<FileInfo>> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

8. Weaviate collection id mismatch 🐞 Bug ≡ Correctness

WeaviateVectorStoreProvider::list_collections returns Weaviate schema class names and passes them
into CollectionInfo::new, which derives a CollectionId from that string; this does not round-trip
back to the CollectionId used by class_name(). Server code later reconstructs CollectionId from
collection.name to call list_vectors, causing it to query a different Weaviate class and return
empty/incorrect results.
Agent Prompt
## Issue description
`list_collections()` currently emits Weaviate *class* names as `CollectionInfo.name`, which the server later feeds into `CollectionId::from_string(...)` and then back into provider methods. Because `class_name(CollectionId)` is not invertible via `CollectionId::from_string(class_name)`, the browse/list-all code will call `list_vectors()` with the wrong CollectionId and therefore query the wrong Weaviate class.

## Issue Context
Weaviate class names are derived from `CollectionId` by prefixing and sanitizing the UUID string. `CollectionInfo::new()` derives `id` from the provided name, and server browse APIs reconstruct `CollectionId` from `collection.name`.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/browser.rs[15-31]
- crates/mcb-providers/src/vector_store/weaviate/client.rs[61-72]
- crates/mcb-domain/src/value_objects/browse/collection.rs[25-42]
- crates/mcb-server/src/controllers/web/browse.rs[38-52]
- crates/mcb-server/src/controllers/collections_api.rs[59-73]

## Suggested fix
In `WeaviateVectorStoreProvider::list_collections`, only include classes that match the provider’s naming scheme, and convert them back to the *underlying* collection identifier string (UUID) used elsewhere.

Example approach:
1. For each returned class name:
   - Verify it starts with `WEAVIATE_CLASS_PREFIX`.
   - Strip the prefix.
   - Replace `_` back to `-` (since the source is a UUID string).
   - Validate it parses as a UUID.
2. Construct `CollectionInfo` such that:
   - `CollectionInfo.name` is that UUID string (so `CollectionId::from_string(&name)` round-trips).
   - `CollectionInfo.id` is `CollectionId::from_string(&uuid_str)` (construct the struct directly rather than using `CollectionInfo::new` if needed).

This aligns Weaviate behavior with providers like Qdrant that use the UUID string as the backend collection name.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +20 to +30
async fn collection_exists(&self, name: &CollectionId) -> Result<bool> {
let class = Self::class_name(name);
match self
.request(reqwest::Method::GET, &format!("/v1/schema/{class}"), None)
.await
{
Ok(_) => Ok(true),
// A missing class is a legitimate "does not exist" answer, not a
// transport failure: Weaviate returns 404 for unknown classes.
Err(_) => Ok(false),
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

9. Collection_exists masks outages 🐞 Bug ☼ Reliability

WeaviateVectorStoreProvider::collection_exists returns Ok(false) for any request error, not just
404, so timeouts/5xx/auth failures are misreported as “collection missing.” This can trigger
incorrect create attempts and makes operational problems appear as empty state.
Agent Prompt
## Issue description
`collection_exists()` currently maps *all* request failures to `Ok(false)`. This conflates “collection does not exist” (expected 404) with connectivity errors, authentication errors, and server-side failures.

## Issue Context
`request()` uses shared HTTP helpers that return an error for any non-2xx response. As a result, 401/500/timeouts all become `Err(...)` and are treated as “does not exist”.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/admin.rs[20-30]
- crates/mcb-providers/src/vector_store/weaviate/client.rs[79-107]
- crates/mcb-providers/src/utils/http_response.rs[31-58]

## Suggested fix
Implement `collection_exists` in a way that can distinguish 404 from other failures:
- Option A (preferred): perform the GET using `reqwest` directly (reusing auth headers logic) and inspect `status()`:
  - `200..299` => `Ok(true)`
  - `404` => `Ok(false)`
  - otherwise => return `Err(Error::vector_db(...))`
- Option B: extend the shared HTTP utility to surface HTTP status codes in the error type for vector-db requests, then branch on 404 here.

Do not swallow transport/timeouts/5xx; those should propagate so callers can retry/alert appropriately.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +32 to +36
impl StdioServerShutdown {
/// Wait for the stdio server to terminate.
pub async fn wait(mut self) {
let _ = self.0.changed().await;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

1. stdioservershutdown swallows errors 📘 Rule violation ☼ Reliability

StdioServerShutdown::wait() discards the watch::Receiver::changed() result and
spawn_stdio_server() discards the shutdown_tx.send(true) result, hiding shutdown-channel
failures. This can make shutdown logic silently stop working and be hard to diagnose.
Agent Prompt
## Issue description
New shutdown signaling code ignores errors via `let _ = ...`, which silently hides failures.

## Issue Context
Compliance requires errors not be swallowed; they must be propagated, logged, or explicitly handled.

## Fix Focus Areas
- crates/mcb/src/initializers/mcp_server.rs[32-36]
- crates/mcb/src/initializers/mcp_server.rs[203-211]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +7 to +15
use std::sync::Mutex;

use mcb_domain::ports::HighlightError;
use mcb_domain::value_objects::browse::{HighlightSpan, HighlightedCode};
use tree_sitter::Language;
use tree_sitter_highlight::{Highlight, HighlightConfiguration, HighlightEvent, Highlighter};

use mcb_domain::value_objects::browse::{HIGHLIGHT_NAMES, map_highlight_to_category};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

2. highlight_sync_service imports misordered 📘 Rule violation ⚙ Maintainability

use statements are not grouped/ordered as required: mcb_* imports appear before external crates
and then mcb_* imports reappear after externals. This violates the mandated std → external →
mcb_* → local grouping.
Agent Prompt
## Issue description
Import groups are out of order / non-contiguous, violating the enforced Rust import grouping convention.

## Issue Context
Imports must be contiguous by group and ordered: std, external crates, mcb_* crates, then local modules.

## Fix Focus Areas
- crates/mcb-infrastructure/src/services/highlight_sync_service.rs[7-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +83 to +90
if objects.len() >= WEAVIATE_BATCH_SIZE || i == vectors.len() - 1 {
self.request(
reqwest::Method::POST,
"/v1/batch/objects",
Some(serde_json::json!({ "objects": objects })),
)
.await?;
objects.clear();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

3. Moved batch vector reused 🐞 Bug ≡ Correctness

WeaviateVectorStoreProvider::insert_vectors moves objects into serde_json::json! and then
calls objects.clear(), which is a use-after-move compile error that prevents the crate from
building.
Agent Prompt
## Issue description
In `insert_vectors`, the code constructs the batch JSON payload with `serde_json::json!({ "objects": objects })`, which moves `objects` into the JSON value. Immediately after the request, it calls `objects.clear()`, which is a compile-time use-after-move error.

## Issue Context
This is inside the batching loop for `/v1/batch/objects` inserts.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/provider.rs[73-91]

### Suggested fix
Use a temporary batch value and leave `objects` usable, e.g.:
- `let batch = std::mem::take(&mut objects);` then `json!({"objects": batch})` (no need to `clear()`), or
- `json!({"objects": objects.clone()})` (less efficient), or
- build the JSON from an iterator without moving the original vec.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +21 to +55
/// Public routes — no auth required (static assets + redirect).
pub fn build_public_routes() -> AxumRouter {
axum::Router::new()
.route(
"/",
axum::routing::get(|| async { axum::response::Redirect::temporary("/ui/") }),
)
.route(
"/favicon.ico",
axum::routing::get(|| async {
(
[(axum::http::header::CONTENT_TYPE, "image/svg+xml")],
include_str!("../../../../assets/admin/favicon.svg"),
)
}),
)
.route(
"/ui/theme.css",
axum::routing::get(|| async {
(
[(axum::http::header::CONTENT_TYPE, "text/css")],
include_str!("../../../../assets/admin/ui/theme.css"),
)
}),
)
.route(
"/ui/shared.js",
axum::routing::get(|| async {
(
[(axum::http::header::CONTENT_TYPE, "application/javascript")],
include_str!("../../../../assets/admin/ui/shared.js"),
)
}),
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

4. Liveness route not registered 🐞 Bug ☼ Reliability

The new Axum router builder does not register any route for the existing health_api::alive
handler, so /alive is not served by the router that the app merges into the top-level route table.
Agent Prompt
## Issue description
`health_api::alive()` exists, but the new Axum router builder never routes to it. As a result, `/alive` requests will not match and will return 404 through the assembled router.

## Issue Context
- `health_api::alive()` is intended as a lightweight liveness probe.
- `build_public_routes()` currently only serves `/` and static UI assets.
- The Loco initializer merges `build_router_without_fallback()` directly into the app router, so whatever is missing here is missing in production.

## Fix Focus Areas
- crates/mcb-server/src/controllers/routes.rs[21-55]
- crates/mcb-server/src/controllers/health_api.rs[38-53]
- crates/mcb/src/initializers/mcp_server.rs[238-247]

### Suggested fix
In `build_public_routes()`, add a public GET route for liveness, e.g.:
- `.route("/alive", axum::routing::get(super::health_api::alive))`
Optionally also add an alias for environments that hit `/api/alive` without rewrite:
- `.route("/api/alive", axum::routing::get(super::health_api::alive))`

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 2b32f7c

Comment thread .agents/provider.toml
@@ -0,0 +1 @@
../../flext/.agents/provider.toml No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

1. External .agents symlinks 🐞 Bug ☼ Reliability

The PR adds new .agents/* and .agents/skills/* entries that resolve to ../../flext/...
(outside this repository), so in any checkout without that sibling flext directory these links
will be dangling and the referenced agent/workspace configuration won’t load. Any consumer that
dereferences these paths will also traverse outside the workspace, which is commonly blocked in
CI/sandbox environments and can cause unexpected failures.
Agent Prompt
## Issue description
New `.agents/*` entries are being introduced as external links (e.g. `../../flext/...`) that depend on a sibling `flext` checkout existing outside this repository. This makes the `.agents` surface non-portable and brittle across environments.

## Issue Context
`AGENTS.md` directs workflows to start from `.agents/skills/...`, so if these linked configs/skills aren’t resolvable, agent/tooling setup becomes inconsistent across machines/CI.

## Fix Focus Areas
- .agents/provider.toml[1-1]
- .agents/INSTRUCTION_SURFACE.md[1-1]
- .agents/skills/flext-context-routing[1-1]

## Suggested fix
- Prefer committing the needed `.agents` files directly into this repo (copy/vendor), OR add `flext` as an in-repo submodule/subtree and point links within the repo (no `..` traversal outside the repo).
- If external links are intentional for local-only workflows, gate them behind a documented bootstrap step (that creates links locally) and keep repo-committed `.agents` entries as valid defaults.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit d5dcf1c

@marlon-costa-dc
marlon-costa-dc enabled auto-merge (squash) July 29, 2026 03:03
Comment on lines +7 to +9
use mcb_domain::error::{Error, Result};
use mcb_domain::value_objects::{CollectionId, SearchResult};
use reqwest::Client;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

1. client.rs imports misordered 📘 Rule violation ⚙ Maintainability

The new Weaviate client places mcb_domain imports between external-crate imports, splitting the
external group and violating the required std → external → mcb_* → local order.
Agent Prompt
## Issue description
The Weaviate client imports do not follow the required Rust import-group order.

## Issue Context
All external crates, including `dashmap`, `reqwest`, and `serde_json`, must appear before imports from `mcb_*` crates.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/client.rs[3-23]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +59 to +63
let collections = state
.vector_store
.list_collections()
.await
.unwrap_or_default();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

2. chunks hides provider failures 📘 Rule violation ☼ Reliability

The all-collections path converts a list_collections() failure into an empty collection list with
unwrap_or_default(). Clients consequently receive a successful empty response during vector-store
outages instead of an error or observable handling.
Agent Prompt
## Issue description
The `chunks` handler silently turns a vector-store listing error into an empty successful response.

## Issue Context
The handler already returns `Result<Response>`, so the provider error can be mapped and propagated; alternatively, explicitly log and justify degraded behavior.

## Fix Focus Areas
- crates/mcb-server/src/controllers/collections_api.rs[59-71]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +19 to +20
let Ok(entries) = std::fs::read_dir(&dir) else {
continue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

3. Dependency scan hides i/o failures 📘 Rule violation ☼ Reliability

The new dependency scanner silently skips directories when read_dir fails, treating an incomplete
scan as if no forbidden dependency was found. Permission and filesystem failures can therefore
produce false-negative compliance results.
Agent Prompt
## Issue description
The Cargo dependency scanner silently continues after directory-read failures.

## Issue Context
A failed directory read means the scanner cannot reliably conclude that forbidden dependencies are absent. Return a typed result and propagate or explicitly report the I/O error.

## Fix Focus Areas
- crates/mcb-validate/src/engines/rusty_cargo_deps.rs[12-43]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread Makefile
# Verify sccache is installed; if not, warn and attempt install.
ifeq ($(shell command -v sccache 2>/dev/null),)
$(warning sccache not found in PATH. Attempting install...)
$(shell cargo install sccache --locked 2>/dev/null || true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

4. sccache install failure suppressed 📘 Rule violation ☼ Reliability

The Makefile suppresses every cargo install sccache failure with redirected stderr and || true,
despite configuring sccache as mandatory. Setup proceeds without explaining why the required build
wrapper is unavailable.
Agent Prompt
## Issue description
The automatic `sccache` installation suppresses command failures and diagnostic output.

## Issue Context
Because `RUSTC_WRAPPER` is unconditionally set to `sccache`, installation failure should stop setup with an actionable error or be explicitly handled without hiding its cause.

## Fix Focus Areas
- Makefile[44-58]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

.map(|distance| 1.0 - distance)
})
.unwrap_or(0.0)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

5. client.rs exceeds size limit 📘 Rule violation ⚙ Maintainability

The newly introduced Weaviate client is 253 lines, exceeding the approximately 200-line source-file
limit. Its request handling, GraphQL construction, response validation, and result conversion should
be separated into focused modules.
Agent Prompt
## Issue description
The new Weaviate client source file contains 253 lines and exceeds the project size guideline.

## Issue Context
GraphQL query construction and response conversion are natural candidates for extraction while retaining the provider client in `client.rs`.

## Fix Focus Areas
- crates/mcb-providers/src/vector_store/weaviate/client.rs[1-253]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

None,
None,
);
let org_id = resolve_org_id(args.org_id.as_deref());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

7. Caller controls tenant scope 🐞 Bug ⛨ Security

The new isolation path takes org_id directly from caller-controlled MCP arguments and uses it for
scoped memory reads and writes. An authenticated client can therefore select another organization
and access or modify that tenant's memory instead of using an organization bound to its principal.
Agent Prompt
## Issue description
Memory handlers trust the caller-provided `org_id`, allowing clients to select another tenant's storage scope. Resolve the organization exclusively from an authenticated request principal and reject conflicting tenant arguments.

## Issue Context
`MemoryArgs.org_id` is untrusted tool input, and `resolve_org_id` returns explicit input unchanged. The architecture requires handlers to use the principal's organization rather than request arguments.

## Fix Focus Areas
- crates/mcb-server/src/handlers/memory/observation.rs[52-94]
- crates/mcb-server/src/utils/mcp/helpers.rs[32-39]
- crates/mcb-server/src/args/memory.rs[79-101]
- crates/mcb-server/src/handlers/search.rs[232-256]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +26 to +29
let body = serde_json::json!({
"class": class,
"vectorizer": "none",
"vectorIndexConfig": { "distance": WEAVIATE_DISTANCE_METRIC },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

8. Weaviate tenants never applied 🐞 Bug ⛨ Security

The new Weaviate provider creates ordinary shared classes and performs inserts, searches, and
deletes without any tenant identifier. Organizations using the same collection therefore share
vectors, enabling cross-tenant code search and mutation despite the provider advertising native
multi-tenancy.
Agent Prompt
## Issue description
The Weaviate implementation does not configure multi-tenant classes or provide an organization tenant on vector operations. Add authenticated tenant context throughout the vector-store API and apply it to every Weaviate request.

## Issue Context
Code search currently ignores `SearchArgs.org_id`, while the provider API accepts only a collection identifier. Tenant identity must originate from the authenticated principal, not caller input.

## Fix Focus Areas
- crates/mcb-domain/src/ports/providers/vector_store.rs[10-98]
- crates/mcb-providers/src/vector_store/weaviate/provider.rs[18-173]
- crates/mcb-providers/src/vector_store/weaviate/browser.rs[14-57]
- crates/mcb-server/src/handlers/search.rs[114-130]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +403 to +410
services
.agent_session
.create_session(session)
.await
.map_err(|e| {
tracing::warn!("Auto-session creation failed (non-fatal): {e}");
McpError::internal_error(format!("Auto-session creation failed: {e}"), None)
})?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

9. Auto-init failures block tools 🐞 Bug ☼ Reliability

Session and project repository failures are now converted to McpError and propagated through
handle_call_tool, even though auto-initialization is documented as non-fatal. A transient database
failure consequently rejects the requested tool operation instead of only skipping automatic
initialization.
Agent Prompt
## Issue description
Automatic session and project creation now propagates repository failures into tool dispatch. Preserve validation errors where required, but log and swallow repository failures as the documented non-fatal policy specifies.

## Issue Context
`handle_call_tool` uses `?` on the combined auto-initialization routine. Both creation helpers currently map database failures into `McpError`, causing unrelated tools to become unavailable during persistence failures.

## Fix Focus Areas
- crates/mcb-server/src/mcp_server.rs[290-295]
- crates/mcb-server/src/mcp_server.rs[367-410]
- crates/mcb-server/src/mcp_server.rs[454-503]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +22 to +27
workflow_dispatch:
inputs:
tag:
description: Existing tag to (re)publish a GitHub Release for (e.g. v0.3.2)
required: true
type: string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

10. Manual releases build wrong ref 🐞 Bug ≡ Correctness

The new dispatch input determines the published release tag, but release-build checks out the
workflow dispatch SHA rather than that tag. Re-running a historical release can therefore publish
binaries built from the current branch under the historical version.
Agent Prompt
## Issue description
Manual release runs publish under the requested tag while building the dispatch branch revision. Make the requested tag the single source of truth for both checkout and release metadata.

## Issue Context
For `workflow_dispatch`, the checkout action defaults to `github.sha`. The input tag is only consumed later by release creation, so artifacts and their release tag can represent different commits.

## Fix Focus Areas
- .github/workflows/release.yml[20-27]
- .github/workflows/release.yml[37-77]
- .github/workflows/release.yml[132-189]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

.unwrap_or(mcb_utils::constants::ide::IDE_MCB_STDIO);
let session = AgentSession {
id: session_id.clone(),
let session = build_auto_session(ctx, session_id, ide_label)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remediation recommended

11. Failed validation poisons guard 🐞 Bug ☼ Reliability

auto_create_session records the session ID in init_sessions before the newly fallible model
validation and session construction. If validation fails, later calls with that ID skip
initialization and validation, leaving the session absent or invalid for the process lifetime.
Agent Prompt
## Issue description
The session initialization guard is committed before fallible validation and persistence complete. Insert the completed guard only after successful creation, or remove it on every failure while preserving concurrency safety.

## Issue Context
A missing `model_id`, clock failure, or repository failure can occur after the `DashSet` insertion. Subsequent calls then take the early-return path and never retry initialization.

## Fix Focus Areas
- crates/mcb-server/src/mcp_server.rs[387-410]
- crates/mcb-server/src/mcp_server.rs[415-450]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 0e535ae

@cubic-dev-ai cubic-dev-ai 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.

40 issues found across 479 files

Confidence score: 1/5

  • crates/mcb-server/src/handlers/search.rs uses caller-supplied org_id as the tenant boundary, which can enable cross-tenant memory reads and data exposure—derive tenant scope only from authenticated server context and ignore/validate client-provided org fields.
  • crates/mcb-server/src/hooks/processor.rs, crates/mcb-domain/src/ports/services/memory.rs, and the session summary handlers (crates/mcb-server/src/handlers/session/summarize.rs, crates/mcb-server/src/handlers/memory/session.rs) are inconsistent on org scoping, so data can be written to the wrong tenant, become unreadable, or be deleted across tenants—thread org_id through create/read/delete paths and standardize default-org resolution.
  • crates/mcb-providers/src/vector_store/weaviate/admin.rs collapses auth/network/malformed-response failures into “collection absent,” allowing health_check to pass while Weaviate is actually unavailable—treat only true 404 as absent and surface other failures as unhealthy.
  • .github/setup-ci.sh can fail to install sccache because RUSTC_WRAPPER remains set to a missing executable, making CI bootstrap fragile—unset RUSTC_WRAPPER for the install fallback and re-export it after successful installation.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/mcb-server/src/handlers/search.rs">

<violation number="1" location="crates/mcb-server/src/handlers/search.rs:250">
P0: Memory search can be switched to another tenant by supplying an `org_id` argument, because this line treats the caller-controlled hidden field as the tenant boundary. Tenant scope should come from authenticated server context and overwrite or reject any request-provided `org_id` before dispatch.</violation>
</file>

<file name="crates/mcb-providers/src/vector_store/weaviate/admin.rs">

<violation number="1" location="crates/mcb-providers/src/vector_store/weaviate/admin.rs:29">
P1: Authentication failures, outages, and malformed responses are reported as “collection absent,” and the default `health_check` consequently succeeds while Weaviate is unavailable. Only the documented 404 case should become `Ok(false)`; other errors should propagate.</violation>

<violation number="2" location="crates/mcb-providers/src/vector_store/weaviate/admin.rs:56">
P2: GraphQL errors are exposed as an active collection with zero vectors because any HTTP-success payload selects `STATUS_ACTIVE`. Treat a non-empty top-level `errors` array as `STATUS_UNKNOWN` before parsing the aggregate result.</violation>
</file>

<file name="crates/mcb-server/src/hooks/processor.rs">

<violation number="1" location="crates/mcb-server/src/hooks/processor.rs:80">
P1: Non-default tenants' tool observations are stored under the bootstrap organization, so their own org-scoped searches cannot retrieve them and multiple tenants' hook data is co-located. `ToolExecutionContext` already carries `org_id`; propagate it into `PostToolUseContext` and require/use that value here instead of `DEFAULT_ORG_ID`.</violation>

<violation number="2" location="crates/mcb-server/src/hooks/processor.rs:128">
P2: Session starts for any non-default tenant search the bootstrap org, so tenant-specific prior context is never found. Carry the resolved organization in `SessionStartContext` (or a request principal) and pass it to `memory_search` rather than silently falling back.</violation>
</file>

<file name=".github/setup-ci.sh">

<violation number="1" location=".github/setup-ci.sh:151">
P1: CI cannot bootstrap sccache on a runner where it is absent: the workflow already sets `RUSTC_WRAPPER=sccache`, so the `cargo install` fallback attempts to compile through the missing executable. Clear `RUSTC_WRAPPER` for this installation.</violation>
</file>

<file name="crates/mcb-validate/src/engines/rusty_cargo_deps.rs">

<violation number="1" location="crates/mcb-validate/src/engines/rusty_cargo_deps.rs:16">
P1: Crate-scoped dependency rules can report violations caused by unrelated manifests because this recursively scans every `Cargo.toml` under `workspace_root` and ignores the rule's `target`. Scope lookup to the target package/workspace member (and avoid excluded/generated trees) before testing its dependencies.</violation>

<violation number="2" location="crates/mcb-validate/src/engines/rusty_cargo_deps.rs:57">
P2: Platform-specific forbidden dependencies bypass this rule because only the top-level `[dependencies]` table is inspected. Include each `[target.<cfg>.dependencies]` table when evaluating architecture boundaries.</violation>
</file>

<file name="docs/MCP_TOOLS.md">

<violation number="1" location="docs/MCP_TOOLS.md:216">
P1: Clients can still receive unresolved provenance, and failures occur when an applicable tool is called rather than at server boot; `model_id` also silently defaults to `UNKNOWN`. This overview should describe boot-time best-effort defaults plus per-request validation instead of guaranteeing complete discovery and fast-fail initialization.</violation>

<violation number="2" location="docs/MCP_TOOLS.md:220">
P2: The documented default `session_id` format/source does not match runtime behavior: boot discovery always generates a UUID and does not promote `CURSOR_TRACE_ID` or `CLAUDE_SESSION_ID` into this field. Document the UUID default so consumers do not rely on IDE IDs or parse the advertised format.</violation>

<violation number="3" location="docs/MCP_TOOLS.md:221">
P1: A server launched from a plain filesystem workspace does not get the promised CWD `repo_path`; discovery returns `None` and provenance validation rejects affected tools. Remove the filesystem guarantee or implement it before advertising non-VCS workspaces as supported.</violation>

<violation number="4" location="docs/MCP_TOOLS.md:222">
P1: The table marks `repo_id` as conditionally required, but every index/search/memory call requires it even when `repo_path` is present. This contract mismatch can make requests documented as valid fail with `Missing execution provenance`.</violation>

<violation number="5" location="docs/MCP_TOOLS.md:224">
P2: `worktree_id` is not auto-discovered or always resolved; it remains `None` unless metadata supplies it. Document the actual override-only behavior rather than a nonexistent Git fallback cascade.</violation>

<violation number="6" location="docs/MCP_TOOLS.md:228">
P1: Setting any listed model environment variable has no effect, while an unset model silently becomes `UNKNOWN` and passes validation instead of producing the documented fast-fail error. This row should reflect metadata override plus the current placeholder, or the implementation must add the advertised discovery and failure behavior.</violation>

<violation number="7" location="docs/MCP_TOOLS.md:237">
P2: The server does not try the listed backend stubs or fall back to the filesystem; it only asks the configured `VcsProvider` while walking CWD ancestors. Replace this sequence with the implemented behavior so users do not expect unsupported workspace types to initialize successfully.</violation>

<violation number="8" location="docs/MCP_TOOLS.md:242">
P2: Not every provenance field can be overridden through `meta`: `timestamp` is always regenerated from the server clock. Exclude it from this guarantee so callers do not assume their supplied event timestamp is preserved.</violation>
</file>

<file name="crates/mcb-server/src/handlers/session/summarize.rs">

<violation number="1" location="crates/mcb-server/src/handlers/session/summarize.rs:26">
P1: Create and fetch can use different default org IDs in this handler, so a summary created without `org_id` can be immediately unreadable (`Session summary not found`). The fetch path now uses `resolve_org_id`, but `create_summary` still persists with `DEFAULT_ORG_ID` fallback.</violation>
</file>

<file name="crates/mcb-server/src/handlers/memory/session.rs">

<violation number="1" location="crates/mcb-server/src/handlers/memory/session.rs:91">
P1: Calls that omit `org_id` now store/query summaries under a derived UUID instead of the repository's literal `DEFAULT_ORG_ID`, so existing default-tenant summaries become invisible and new rows land in a different tenant. Consider making `resolve_org_id` return `DEFAULT_ORG_ID` or otherwise using the same canonical default across both paths.</violation>
</file>

<file name="crates/mcb-domain/src/ports/services/memory.rs">

<violation number="1" location="crates/mcb-domain/src/ports/services/memory.rs:39">
P1: Observation deletion remains cross-tenant: after observations gain `org_id`, `delete_observation` still accepts only an ID and the SeaORM implementation deletes solely by primary key. Thread `org_id` through both delete ports and filter the delete by organization and ID.</violation>

<violation number="2" location="crates/mcb-domain/src/ports/services/memory.rs:117">
P1: Semantic search can miss valid tenant memories when another org's vectors occupy the shared top-N candidate set. `search_memories_impl` queries `MEMORY_COLLECTION_NAME` with no filter and vector metadata omits `org_id`; scope vector insertion/search by org before applying the limit.</violation>
</file>

<file name=".serena/memories/architecture.md">

<violation number="1" location=".serena/memories/architecture.md:1">
P1: Current architecture guidance added under `.serena/memories/` will be treated as historical rather than authoritative, so contributors and agents can miss or distrust these rules. This content belongs in the canonical `docs/`/configuration source instead of a Serena memory projection.</violation>

<violation number="2" location=".serena/memories/architecture.md:17">
P2: The documented server dependency rule rejects an allowed and currently used `mcb-domain` dependency. Keeping this projection aligned with `config/mcb-validate-internal.toml` avoids sending contributors toward an incorrect boundary.</violation>

<violation number="3" location=".serena/memories/architecture.md:37">
P2: Following this validation instruction fails with “No rule to make target 'validate'” instead of running architecture checks. Use the canonical `check` dispatcher invocation documented by the Makefile.</violation>
</file>

<file name=".github/actions/native-deps/action.yml">

<violation number="1" location=".github/actions/native-deps/action.yml:43">
P1: The downloaded ONNX Runtime DLL is loaded by later build/test steps without any integrity verification. Pinning and checking the Windows archive's SHA-256 before `Expand-Archive` would match the Unix installer and prevent a compromised download from becoming executable code.</violation>
</file>

<file name="crates/mcb/src/loco_app.rs">

<violation number="1" location="crates/mcb/src/loco_app.rs:170">
P1: Config-driven `stdio_only` processes remain alive after the MCP client closes stdin because this branch ignores `StdioServerShutdown` and waits only for Ctrl+C/SIGTERM. Waiting on either the stored shutdown receiver or an OS signal would make this mode terminate like the `--stdio` path.</violation>
</file>

<file name="crates/mcb-utils/src/constants/vector_store.rs">

<violation number="1" location="crates/mcb-utils/src/constants/vector_store.rs:122">
P1: `get_chunks_by_file` returns at most 100 chunks because this “pagination” size is used as a one-shot GraphQL limit without any pagination loop. This should either paginate until all matching objects are fetched or avoid presenting the value as a page size.</violation>

<violation number="2" location="crates/mcb-utils/src/constants/vector_store.rs:125">
P1: Listed collection names are not usable in subsequent provider operations: this prefix is added on lookup, while `list_collections` returns prefixed schema names without removing it. The listing should filter to managed classes and map them back to their original `CollectionId` values (with a reversible naming scheme).</violation>
</file>

<file name="crates/mcb-server/src/handlers/memory/handler.rs">

<violation number="1" location="crates/mcb-server/src/handlers/memory/handler.rs:176">
P1: Error-pattern search is not tenant-scoped at the vector candidate stage despite passing `org_id` here. Other organizations' nearest vectors can crowd out this tenant's matches, so tenant scope should be propagated through vector insertion and search, including the Weaviate provider.</violation>
</file>

<file name=".waza.yaml">

<violation number="1" location=".waza.yaml:6">
P2: These limits bypass the repository's canonical-source workflow, so regenerating `.waza.yaml` can discard the entire configuration. Please define them in the owning config/template and generate this projection through the canonical Make target.</violation>
</file>

<file name=".continue/rules/mcb.md">

<violation number="1" location=".continue/rules/mcb.md:9">
P2: Continue agents now lose project-specific architecture and development rules because this pointer claims `AGENTS.md` contains them, while the supplied `AGENTS.md` does not. Move the omitted rules into `AGENTS.md` (or retain a pointer to their actual authority) before regenerating this file.</violation>
</file>

<file name="crates/mcb/src/cli/serve.rs">

<violation number="1" location="crates/mcb/src/cli/serve.rs:52">
P2: Stdio startup or service failures now terminate `mcb serve --stdio` with a successful exit status because this notification carries no result and the spawned task only logs errors. Consider propagating the stdio task's `Result` through the shutdown handle so `execute` returns the failure while preserving normal EOF as success.</violation>
</file>

<file name="crates/mcb-validate/src/validators/naming/checks/ca.rs">

<violation number="1" location="crates/mcb-validate/src/validators/naming/checks/ca.rs:47">
P2: Bare role files such as `handler.rs` outside `handlers/` and `module.rs` outside `di/` now produce no CA naming violation because `file_name != role` rejects them before directory validation. Consider scoping the exact-name exemption to the `repository.rs` entity case instead of applying it to every `RoleWord` matcher.</violation>
</file>

<file name="crates/mcb-validate/rules/testing/TEST001_organization.yml">

<violation number="1" location="crates/mcb-validate/rules/testing/TEST001_organization.yml:14">
P2: Valid inline test modules are missed when the attribute/module shares its line with the item, a trailing comment, or module contents because both patterns now require the declaration to occupy the whole line. Keeping the new start anchors but dropping the end anchors preserves protection from embedded matches without excluding valid Rust formatting.</violation>
</file>

<file name=".config/nextest.toml">

<violation number="1" location=".config/nextest.toml:22">
P2: Tests running longer than 180 seconds will be terminated, so this is not the warning-only slow-test reporting described above it and can turn legitimate long integration tests into failures. Removing `terminate-after` from both profiles keeps the intended warnings without killing tests.</violation>
</file>

<file name=".superpowers/sdd/progress.md">

<violation number="1" location=".superpowers/sdd/progress.md:9">
P2: The progress tracker now asserts task and commit state without the required verification record, so readers cannot distinguish current Beads state from aspiration. Add the exact canonical command, working directory, decisive output/exit code, and bounded scope supporting these claims.</violation>
</file>

<file name="crates/mcb-server/src/handlers/memory/inject.rs">

<violation number="1" location="crates/mcb-server/src/handlers/memory/inject.rs:42">
P2: Truncated observations are reported as injected because their IDs are appended before the token-budget check. Append the ID only after the corresponding entry is accepted into `context` so count, IDs, and context remain consistent.</violation>
</file>

<file name=".serena/memories/coding_standards.md">

<violation number="1" location=".serena/memories/coding_standards.md:26">
P2: Agents reading this as the Cargo lint policy will miss many checks that fail or warn in the workspace. The generated projection should include the full lists or clearly label them as non-exhaustive.</violation>
</file>

<file name="CLAUDE.md">

<violation number="1" location="CLAUDE.md:14">
P2: Validation guidance is weaker than the repository’s required gate and may let changes pass without full checks. Pointing to `make check` as primary keeps contributor behavior aligned with enforced policy.</violation>
</file>

<file name="crates/mcb-providers/src/vector_store/weaviate/registry.rs">

<violation number="1" location="crates/mcb-providers/src/vector_store/weaviate/registry.rs:22">
P2: An empty or whitespace-only `uri` passes factory validation, then produces invalid request URLs for every Weaviate operation. Treat blank values as missing (and normalize surrounding whitespace) before constructing the provider.</violation>
</file>

<file name=".agents/skills/rules-docker">

<violation number="1" location=".agents/skills/rules-docker:1">
P2: The Docker rules cannot be loaded from a standalone clone because this symlink depends on an undeclared sibling `flext` checkout. Consider tracking the skill in this repository or adding a reproducible dependency/bootstrap mechanism that creates the target.</violation>
</file>

Note: This PR contains a large number of files. cubic only reviews up to 200 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
Shadow auto-approve: would not auto-approve because issues were found.
Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

..Default::default()
};
let limit = args.limit.unwrap_or(DEFAULT_SEARCH_LIMIT as u32) as usize;
let org_id = resolve_org_id(args.org_id.as_deref());

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0: Memory search can be switched to another tenant by supplying an org_id argument, because this line treats the caller-controlled hidden field as the tenant boundary. Tenant scope should come from authenticated server context and overwrite or reject any request-provided org_id before dispatch.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/mcb-server/src/handlers/search.rs, line 250:

<comment>Memory search can be switched to another tenant by supplying an `org_id` argument, because this line treats the caller-controlled hidden field as the tenant boundary. Tenant scope should come from authenticated server context and overwrite or reject any request-provided `org_id` before dispatch.</comment>

<file context>
@@ -244,11 +247,12 @@ impl SearchHandler {
             ..Default::default()
         };
-        let limit = args.limit.unwrap_or(DEFAULT_SEARCH_LIMIT as u32) as usize;
+        let org_id = resolve_org_id(args.org_id.as_deref());
+        let limit = resolve_limit(args.limit, DEFAULT_SEARCH_LIMIT as u32);
 
</file context>
Fix with cubic

Ok(_) => Ok(true),
// A missing class is a legitimate "does not exist" answer, not a
// transport failure: Weaviate returns 404 for unknown classes.
Err(_) => Ok(false),

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Authentication failures, outages, and malformed responses are reported as “collection absent,” and the default health_check consequently succeeds while Weaviate is unavailable. Only the documented 404 case should become Ok(false); other errors should propagate.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/mcb-providers/src/vector_store/weaviate/admin.rs, line 29:

<comment>Authentication failures, outages, and malformed responses are reported as “collection absent,” and the default `health_check` consequently succeeds while Weaviate is unavailable. Only the documented 404 case should become `Ok(false)`; other errors should propagate.</comment>

<file context>
@@ -0,0 +1,84 @@
+            Ok(_) => Ok(true),
+            // A missing class is a legitimate "does not exist" answer, not a
+            // transport failure: Weaviate returns 404 for unknown classes.
+            Err(_) => Ok(false),
+        }
+    }
</file context>
Fix with cubic

.store_observation(StoreObservationInput {
project_id,
// ADR-056 (bead mcb-6pjx.1.2): org_id deferred; hooks do not yet carry org context.
org_id: mcb_utils::constants::values::DEFAULT_ORG_ID.to_owned(),

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Non-default tenants' tool observations are stored under the bootstrap organization, so their own org-scoped searches cannot retrieve them and multiple tenants' hook data is co-located. ToolExecutionContext already carries org_id; propagate it into PostToolUseContext and require/use that value here instead of DEFAULT_ORG_ID.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/mcb-server/src/hooks/processor.rs, line 80:

<comment>Non-default tenants' tool observations are stored under the bootstrap organization, so their own org-scoped searches cannot retrieve them and multiple tenants' hook data is co-located. `ToolExecutionContext` already carries `org_id`; propagate it into `PostToolUseContext` and require/use that value here instead of `DEFAULT_ORG_ID`.</comment>

<file context>
@@ -76,6 +76,8 @@ impl HookProcessor {
             .store_observation(StoreObservationInput {
                 project_id,
+                // ADR-056 (bead mcb-6pjx.1.2): org_id deferred; hooks do not yet carry org context.
+                org_id: mcb_utils::constants::values::DEFAULT_ORG_ID.to_owned(),
                 content,
                 r#type: ObservationType::Execution,
</file context>
Fix with cubic

Comment thread .github/setup-ci.sh
# Ensure sccache is available (mandatory compilation cache)
if ! command -v sccache &>/dev/null; then
echo "Installing sccache (mandatory compilation cache)..." >&2
_mcb_install_crate sccache

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: CI cannot bootstrap sccache on a runner where it is absent: the workflow already sets RUSTC_WRAPPER=sccache, so the cargo install fallback attempts to compile through the missing executable. Clear RUSTC_WRAPPER for this installation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/setup-ci.sh, line 151:

<comment>CI cannot bootstrap sccache on a runner where it is absent: the workflow already sets `RUSTC_WRAPPER=sccache`, so the `cargo install` fallback attempts to compile through the missing executable. Clear `RUSTC_WRAPPER` for this installation.</comment>

<file context>
@@ -133,18 +133,35 @@ Darwin)
+# Ensure sccache is available (mandatory compilation cache)
+if ! command -v sccache &>/dev/null; then
+	echo "Installing sccache (mandatory compilation cache)..." >&2
+	_mcb_install_crate sccache
+fi
+
</file context>
Suggested change
_mcb_install_crate sccache
RUSTC_WRAPPER= _mcb_install_crate sccache
Fix with cubic

workspace_root: &std::path::Path,
pattern_prefix: &str,
) -> bool {
let mut stack = vec![workspace_root.to_path_buf()];

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Crate-scoped dependency rules can report violations caused by unrelated manifests because this recursively scans every Cargo.toml under workspace_root and ignores the rule's target. Scope lookup to the target package/workspace member (and avoid excluded/generated trees) before testing its dependencies.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/mcb-validate/src/engines/rusty_cargo_deps.rs, line 16:

<comment>Crate-scoped dependency rules can report violations caused by unrelated manifests because this recursively scans every `Cargo.toml` under `workspace_root` and ignores the rule's `target`. Scope lookup to the target package/workspace member (and avoid excluded/generated trees) before testing its dependencies.</comment>

<file context>
@@ -0,0 +1,98 @@
+    workspace_root: &std::path::Path,
+    pattern_prefix: &str,
+) -> bool {
+    let mut stack = vec![workspace_root.to_path_buf()];
+
+    while let Some(dir) = stack.pop() {
</file context>
Fix with cubic

Comment thread docs/MCP_TOOLS.md
| `repo_path` | string | **yes** | Plugin-based workspace discovery: Git → Mercury → CVS → SVN → … → **Filesystem (CWD canonical)** | — (CWD is the ultimate happy path) |
| `repo_id` | string | if `repo_path` absent | Git remote `origin` URL hash; absent for plain filesystem workspaces | — |
| `project_id` | string | no | Git remote `origin` (`owner/repo`); absent for plain filesystem workspaces | — |
| `worktree_id` | string | no | `git rev-parse --git-dir` → `git worktree list` → `.git` dir → `"main"` → **CWD path** | — (always resolved) |

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: worktree_id is not auto-discovered or always resolved; it remains None unless metadata supplies it. Document the actual override-only behavior rather than a nonexistent Git fallback cascade.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/MCP_TOOLS.md, line 224:

<comment>`worktree_id` is not auto-discovered or always resolved; it remains `None` unless metadata supplies it. Document the actual override-only behavior rather than a nonexistent Git fallback cascade.</comment>

<file context>
@@ -213,21 +213,33 @@ Unified entity CRUD (vcs/plan/issue/org resources).
+| `repo_path` | string | **yes** | Plugin-based workspace discovery: Git → Mercury → CVS → SVN → … → **Filesystem (CWD canonical)** | — (CWD is the ultimate happy path) |
+| `repo_id` | string | if `repo_path` absent | Git remote `origin` URL hash; absent for plain filesystem workspaces | — |
+| `project_id` | string | no | Git remote `origin` (`owner/repo`); absent for plain filesystem workspaces | — |
+| `worktree_id` | string | no | `git rev-parse --git-dir` → `git worktree list` → `.git` dir → `"main"` → **CWD path** | — (always resolved) |
+| `operator_id` | string | **yes** | `$USER` env var | — |
+| `machine_id` | string | **yes** | Hostname (`hostname::get()` or `$HOSTNAME`) | — |
</file context>
Suggested change
| `worktree_id` | string | no | `git rev-parse --git-dir``git worktree list``.git` dir → `"main"`**CWD path** | (always resolved) |
| `worktree_id` | string | no | Explicit request metadata override; no boot-time default ||
Fix with cubic

Comment thread docs/MCP_TOOLS.md

| Field | Type | Required | Auto-filled source | Fast-fail message |
|-------|------|----------|-------------------|-------------------|
| `session_id` | string | **yes** | IDE session ID (`CURSOR_TRACE_ID`, `CLAUDE_SESSION_ID`, …) or traceable ID `<agent>-<host>-<pid>-<timestamp>` | — (always traceable) |

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The documented default session_id format/source does not match runtime behavior: boot discovery always generates a UUID and does not promote CURSOR_TRACE_ID or CLAUDE_SESSION_ID into this field. Document the UUID default so consumers do not rely on IDE IDs or parse the advertised format.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/MCP_TOOLS.md, line 220:

<comment>The documented default `session_id` format/source does not match runtime behavior: boot discovery always generates a UUID and does not promote `CURSOR_TRACE_ID` or `CLAUDE_SESSION_ID` into this field. Document the UUID default so consumers do not rely on IDE IDs or parse the advertised format.</comment>

<file context>
@@ -213,21 +213,33 @@ Unified entity CRUD (vcs/plan/issue/org resources).
+
+| Field | Type | Required | Auto-filled source | Fast-fail message |
+|-------|------|----------|-------------------|-------------------|
+| `session_id` | string | **yes** | IDE session ID (`CURSOR_TRACE_ID`, `CLAUDE_SESSION_ID`, …) or traceable ID `<agent>-<host>-<pid>-<timestamp>` | — (always traceable) |
+| `repo_path` | string | **yes** | Plugin-based workspace discovery: Git → Mercury → CVS → SVN → … → **Filesystem (CWD canonical)** | — (CWD is the ultimate happy path) |
+| `repo_id` | string | if `repo_path` absent | Git remote `origin` URL hash; absent for plain filesystem workspaces | — |
</file context>
Suggested change
| `session_id` | string | **yes** | IDE session ID (`CURSOR_TRACE_ID`, `CLAUDE_SESSION_ID`, …) or traceable ID `<agent>-<host>-<pid>-<timestamp>` | (always traceable) |
| `session_id` | string | **yes** | UUID generated once at server boot, unless explicitly overridden ||
Fix with cubic

Comment thread CLAUDE.md
keep only project-specific notes below.

- **Task tracking:** `bd` (beads). Run `bd prime`.
- **Validation:** prefer `make` targets (`make lint` / `make typecheck` / `make test`).

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Validation guidance is weaker than the repository’s required gate and may let changes pass without full checks. Pointing to make check as primary keeps contributor behavior aligned with enforced policy.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At CLAUDE.md, line 14:

<comment>Validation guidance is weaker than the repository’s required gate and may let changes pass without full checks. Pointing to `make check` as primary keeps contributor behavior aligned with enforced policy.</comment>

<file context>
@@ -1,3 +1,17 @@
+keep only project-specific notes below.
+
+- **Task tracking:** `bd` (beads). Run `bd prime`.
+- **Validation:** prefer `make` targets (`make lint` / `make typecheck` / `make test`).
+- **Tools:** `ast-grep` (`sg`) for structural search; never `rm` / `sed -i` (use the Edit tool or `trash-put`).
+
</file context>
Suggested change
- **Validation:** prefer `make` targets (`make lint` / `make typecheck` / `make test`).
- **Validation:** run `make check` (or the corresponding `make` subtargets only when intentionally scoping work).
Fix with cubic

Comment on lines +22 to +25
.uri
.clone()
.ok_or_else(|| Error::configuration("Weaviate requires uri (http://host:8080)"))?;
let http_client = create_default_client()?;

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: An empty or whitespace-only uri passes factory validation, then produces invalid request URLs for every Weaviate operation. Treat blank values as missing (and normalize surrounding whitespace) before constructing the provider.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/mcb-providers/src/vector_store/weaviate/registry.rs, line 22:

<comment>An empty or whitespace-only `uri` passes factory validation, then produces invalid request URLs for every Weaviate operation. Treat blank values as missing (and normalize surrounding whitespace) before constructing the provider.</comment>

<file context>
@@ -0,0 +1,39 @@
+    use crate::utils::http::{DEFAULT_HTTP_TIMEOUT, create_default_client};
+
+    let uri = config
+        .uri
+        .clone()
+        .ok_or_else(|| Error::configuration("Weaviate requires uri (http://host:8080)"))?;
</file context>
Suggested change
.uri
.clone()
.ok_or_else(|| Error::configuration("Weaviate requires uri (http://host:8080)"))?;
let http_client = create_default_client()?;
.uri
.as_deref()
.map(str::trim)
.filter(|uri| !uri.is_empty())
.map(str::to_owned)
.ok_or_else(|| Error::configuration("Weaviate requires uri (http://host:8080)"))?;
Fix with cubic

@@ -0,0 +1 @@
../../../flext/.agents/skills/rules-docker No newline at end of file

@cubic-dev-ai cubic-dev-ai Bot Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The Docker rules cannot be loaded from a standalone clone because this symlink depends on an undeclared sibling flext checkout. Consider tracking the skill in this repository or adding a reproducible dependency/bootstrap mechanism that creates the target.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .agents/skills/rules-docker, line 1:

<comment>The Docker rules cannot be loaded from a standalone clone because this symlink depends on an undeclared sibling `flext` checkout. Consider tracking the skill in this repository or adding a reproducible dependency/bootstrap mechanism that creates the target.</comment>

<file context>
@@ -0,0 +1 @@
+../../../flext/.agents/skills/rules-docker
\ No newline at end of file
</file context>
Fix with cubic

Test User added 7 commits July 30, 2026 00:15
- Box CallToolResult in handler Result types to reduce Err variant size
- Box loco_rs::Error in config and MCP server initializers
- Unbox errors at call sites where protocol expects concrete type
- Add kubernetes-validate dependency for Python test suite
…Result

- pyproject: flext-core/flext-cli now come from the GitHub 0.12.0-dev
  branch (operator directive: the venv always carries the pushed branch,
  never stale local snapshots); uv.lock regenerated.
- annotate analyze_issues/analyze/summarize/generate and the
  register_result_command handler contract as p.Result[T]: the canonical
  flext factory protocol now that FlextResultConstruction.ok/fail declare
  p.Result[V]. Concrete FlextResult return annotations rejected the
  protocol values (mypy).
- remove the lib.agent_pointers/lib.gitops mypy ignore_errors override:
  the root cause is fixed, suppression no longer needed.

Validated: make check WHAT=python (ruff + mypy + 64 pytest + guard) green
with flext-core git@acae76c72.
Same serde field-ordering refresh as the earlier snapshot updates, now
covering every remaining domain (index, memory, project, search, session,
validate, vcs, entity invalid_args). Verified: full mcb-server contract
suite 28/28 green.
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 04cb8ba

@cubic-dev-ai cubic-dev-ai 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.

8 issues found across 58 files (changes from recent commits).

Confidence score: 2/5

  • In scripts/qlty/parser.py, SARIF root parsing is validating the document as a single run instead of reading the runs array, so valid qlty reports can be treated as empty and downstream findings are effectively dropped — parse from the SARIF root runs collection and add a regression test with multi-run input.
  • In scripts/lib/settings.py, BaseMcbSettings no longer honors MCB_ENV_FILE because copied model_config keeps flext-core’s resolved .env, which can load the wrong environment and cause configuration drift at runtime — ensure resolve_env_file() is actually applied when building settings config.
  • In pyproject.toml, using 0.12.0-dev branch refs for both FLEXT dependencies leaves resolution mutable versus uv.lock, so builds can change underneath the same PR and introduce non-reproducible behavior — pin immutable commit SHAs/tags and refresh lockfiles in CI.
  • In pyproject.toml, stricter annotation checks are configured but not in the canonical gates, so type-annotation regressions may merge unnoticed — add the pyrefly check (and configured Pyright gate) to required CI checks.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="pyproject.toml">

<violation number="1" location="pyproject.toml:11">
P2: Dependency resolution is not actually pinned here because `0.12.0-dev` is a mutable branch in both FLEXT repositories. This is already observable for `flext-core`: the branch now points at `e089981…`, while `uv.lock` resolved the same ref to `acae76c…`. Direct installs and future lock refreshes can therefore pick up unreviewed/incompatible changes. Using the tested commit SHAs (or immutable release tags) in `pyproject.toml` would make the dependency reproducible.</violation>

<violation number="2" location="pyproject.toml:135">
P2: This stricter `invalid-annotation` setting is never enforced by the canonical checks, so annotation failures can still merge unnoticed. Consider adding `uv run --no-sync pyrefly check` (and the configured Pyright gate) to `MCB_PYTHON_CHECK` rather than leaving this configuration effective only for manual runs.</violation>
</file>

<file name="scripts/lib/logger.py">

<violation number="1" location="scripts/lib/logger.py:20">
P3: An explicitly empty logger name is silently relabeled as `__main__`, bypassing `FlextUtilitiesLogging`'s non-empty-name validation and misattributing those logs. Distinguishing `None` from `""` preserves the default without masking invalid input.</violation>

<violation number="2" location="scripts/lib/logger.py:21">
P3: Each fetch constructs two `McbLogger` wrappers even though `super().fetch_logger()` already instantiates the dynamic `cls`. Returning that instance with the narrower cast avoids duplicate work and reliance on the wrapped `.logger` detail.</violation>
</file>

<file name="crates/mcb-server/src/handlers/vcs/responses.rs">

<violation number="1" location="crates/mcb-server/src/handlers/vcs/responses.rs:141">
P3: The public `repo_path` documentation now describes the wrong error type: it still promises `Err(CallToolResult)`, while the signature returns `Err(Box<CallToolResult>)`. Updating the rustdoc alongside this boxing change would keep generated API documentation accurate.</violation>
</file>

<file name="scripts/lib/settings.py">

<violation number="1" location="scripts/lib/settings.py:28">
P2: `MCB_ENV_FILE` no longer controls the env file loaded by `BaseMcbSettings`: copying `FlextSettings.model_config` retains flext-core's already-resolved `.env` value, while this class's `resolve_env_file()` is never wired into Pydantic settings. As a result, commands silently use defaults/`.env` even when an operator supplies a custom MCB env file. Consider assigning `model_config["env_file"]` from the MCB resolver (ideally via a module-level resolver usable while constructing the class config) and covering the custom-file path with a settings test.</violation>
</file>

<file name="scripts/qlty/parser.py">

<violation number="1" location="scripts/qlty/parser.py:59">
P0: Valid qlty SARIF reports now parse as empty because the document root is being validated as a single `SarifRun`. The actual results are inside the root `runs` array, while `SarifRun.results` defaults to an empty list and the root `runs` field is ignored. Iterating every root run before converting its results would preserve all findings.</violation>
</file>

<file name="crates/mcb-server/src/controllers/admin_config.rs">

<violation number="1" location="crates/mcb-server/src/controllers/admin_config.rs:1">
P3: This module still uses only `Result` from the Loco prelude, and Loco's `Result<T, E = Error>` alias accepts the newly added boxed error parameter. Keeping the import explicit would avoid bringing the prelude's many controller, extractor, routing, and model names into this small config module.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.
Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread scripts/qlty/parser.py
Comment on lines +59 to +67
run = SarifRun.model_validate(data)

issues: list[SarifIssue] = []
for result in run.results:
issue = _result_to_issue(result)
if issue is not None:
issues.append(issue)

return r[list[SarifIssue]].ok(issues)

@cubic-dev-ai cubic-dev-ai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0: Valid qlty SARIF reports now parse as empty because the document root is being validated as a single SarifRun. The actual results are inside the root runs array, while SarifRun.results defaults to an empty list and the root runs field is ignored. Iterating every root run before converting its results would preserve all findings.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/qlty/parser.py, line 59:

<comment>Valid qlty SARIF reports now parse as empty because the document root is being validated as a single `SarifRun`. The actual results are inside the root `runs` array, while `SarifRun.results` defaults to an empty list and the root `runs` field is ignored. Iterating every root run before converting its results would preserve all findings.</comment>

<file context>
@@ -28,48 +56,12 @@ def parse_sarif_file(path: Path) -> r[list[SarifIssue]]:
     except OSError as exc:
         return r[list[SarifIssue]].fail(f"cannot read {path}: {exc}")
 
+    run = SarifRun.model_validate(data)
+
     issues: list[SarifIssue] = []
</file context>
Suggested change
run = SarifRun.model_validate(data)
issues: list[SarifIssue] = []
for result in run.results:
issue = _result_to_issue(result)
if issue is not None:
issues.append(issue)
return r[list[SarifIssue]].ok(issues)
runs = [SarifRun.model_validate(value) for value in data.get("runs", [])]
issues: list[SarifIssue] = []
for run in runs:
for result in run.results:
issue = _result_to_issue(result)
if issue is not None:
issues.append(issue)
return r[list[SarifIssue]].ok(issues)
Fix with cubic

Comment thread pyproject.toml
use-ignore-files = false

[tool.pyrefly.errors]
invalid-annotation = "error"

@cubic-dev-ai cubic-dev-ai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This stricter invalid-annotation setting is never enforced by the canonical checks, so annotation failures can still merge unnoticed. Consider adding uv run --no-sync pyrefly check (and the configured Pyright gate) to MCB_PYTHON_CHECK rather than leaving this configuration effective only for manual runs.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pyproject.toml, line 135:

<comment>This stricter `invalid-annotation` setting is never enforced by the canonical checks, so annotation failures can still merge unnoticed. Consider adding `uv run --no-sync pyrefly check` (and the configured Pyright gate) to `MCB_PYTHON_CHECK` rather than leaving this configuration effective only for manual runs.</comment>

<file context>
@@ -134,11 +128,11 @@ project-excludes = [
 
 [tool.pyrefly.errors]
-annotation-mismatch = "error"
+invalid-annotation = "error"
 bad-argument-type = "error"
 bad-assignment = "error"
</file context>
Fix with cubic

Comment thread scripts/lib/settings.py
"""

model_config: ClassVar[SettingsConfigDict] = (
FlextSettings.model_config.copy()

@cubic-dev-ai cubic-dev-ai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: MCB_ENV_FILE no longer controls the env file loaded by BaseMcbSettings: copying FlextSettings.model_config retains flext-core's already-resolved .env value, while this class's resolve_env_file() is never wired into Pydantic settings. As a result, commands silently use defaults/.env even when an operator supplies a custom MCB env file. Consider assigning model_config["env_file"] from the MCB resolver (ideally via a module-level resolver usable while constructing the class config) and covering the custom-file path with a settings test.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/lib/settings.py, line 28:

<comment>`MCB_ENV_FILE` no longer controls the env file loaded by `BaseMcbSettings`: copying `FlextSettings.model_config` retains flext-core's already-resolved `.env` value, while this class's `resolve_env_file()` is never wired into Pydantic settings. As a result, commands silently use defaults/`.env` even when an operator supplies a custom MCB env file. Consider assigning `model_config["env_file"]` from the MCB resolver (ideally via a module-level resolver usable while constructing the class config) and covering the custom-file path with a settings test.</comment>

<file context>
@@ -10,22 +10,22 @@
 
     model_config: ClassVar[SettingsConfigDict] = (
-        FlextSettingsBase.model_config.copy()
+        FlextSettings.model_config.copy()
     )
     model_config["env_prefix"] = c.ENV_PREFIX
</file context>
Fix with cubic

Comment thread pyproject.toml
Comment on lines +11 to +12
"flext-core @ git+https://github.com/flext-sh/flext-core.git@0.12.0-dev",
"flext-cli @ git+https://github.com/flext-sh/flext-cli.git@0.12.0-dev",

@cubic-dev-ai cubic-dev-ai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Dependency resolution is not actually pinned here because 0.12.0-dev is a mutable branch in both FLEXT repositories. This is already observable for flext-core: the branch now points at e089981…, while uv.lock resolved the same ref to acae76c…. Direct installs and future lock refreshes can therefore pick up unreviewed/incompatible changes. Using the tested commit SHAs (or immutable release tags) in pyproject.toml would make the dependency reproducible.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pyproject.toml, line 11:

<comment>Dependency resolution is not actually pinned here because `0.12.0-dev` is a mutable branch in both FLEXT repositories. This is already observable for `flext-core`: the branch now points at `e089981…`, while `uv.lock` resolved the same ref to `acae76c…`. Direct installs and future lock refreshes can therefore pick up unreviewed/incompatible changes. Using the tested commit SHAs (or immutable release tags) in `pyproject.toml` would make the dependency reproducible.</comment>

<file context>
@@ -8,8 +8,8 @@ version = "0.4.0"
 dependencies = [
-    "flext-core @ file:///home/marlonsc/flext/flext-core",
-    "flext-cli @ file:///home/marlonsc/flext/flext-cli",
+    "flext-core @ git+https://github.com/flext-sh/flext-core.git@0.12.0-dev",
+    "flext-cli @ git+https://github.com/flext-sh/flext-cli.git@0.12.0-dev",
     "pydantic>=2.13.4",
</file context>
Suggested change
"flext-core @ git+https://github.com/flext-sh/flext-core.git@0.12.0-dev",
"flext-cli @ git+https://github.com/flext-sh/flext-cli.git@0.12.0-dev",
"flext-core @ git+https://github.com/flext-sh/flext-core.git@acae76c72cc7396efc681d54cde9222f4292c5bb",
"flext-cli @ git+https://github.com/flext-sh/flext-cli.git@9c834db4c25755f6b17281f08fc734af849af7fa",
Fix with cubic

Comment thread scripts/lib/logger.py
Comment on lines +21 to +22
base = cast(FlextUtilitiesLogging, super().fetch_logger(resolved_name))
return cls(resolved_name, _bound_logger=base.logger)

@cubic-dev-ai cubic-dev-ai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Each fetch constructs two McbLogger wrappers even though super().fetch_logger() already instantiates the dynamic cls. Returning that instance with the narrower cast avoids duplicate work and reliance on the wrapped .logger detail.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/lib/logger.py, line 21:

<comment>Each fetch constructs two `McbLogger` wrappers even though `super().fetch_logger()` already instantiates the dynamic `cls`. Returning that instance with the narrower cast avoids duplicate work and reliance on the wrapped `.logger` detail.</comment>

<file context>
@@ -8,17 +8,18 @@
-        base = cast(FlextLogger, super().fetch_logger(name))
-        return cls(name, _bound_logger=base.logger)
+        resolved_name = name or "__main__"
+        base = cast(FlextUtilitiesLogging, super().fetch_logger(resolved_name))
+        return cls(resolved_name, _bound_logger=base.logger)
 
</file context>
Suggested change
base = cast(FlextUtilitiesLogging, super().fetch_logger(resolved_name))
return cls(resolved_name, _bound_logger=base.logger)
return cast(McbLogger, super().fetch_logger(resolved_name))
Fix with cubic

Comment thread scripts/lib/logger.py
@classmethod
def fetch_logger(cls, name: str | None = None) -> McbLogger:
"""Fetch the canonical logger for a module as an ``McbLogger``."""
resolved_name = name or "__main__"

@cubic-dev-ai cubic-dev-ai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: An explicitly empty logger name is silently relabeled as __main__, bypassing FlextUtilitiesLogging's non-empty-name validation and misattributing those logs. Distinguishing None from "" preserves the default without masking invalid input.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/lib/logger.py, line 20:

<comment>An explicitly empty logger name is silently relabeled as `__main__`, bypassing `FlextUtilitiesLogging`'s non-empty-name validation and misattributing those logs. Distinguishing `None` from `""` preserves the default without masking invalid input.</comment>

<file context>
@@ -8,17 +8,18 @@
         """Fetch the canonical logger for a module as an ``McbLogger``."""
-        base = cast(FlextLogger, super().fetch_logger(name))
-        return cls(name, _bound_logger=base.logger)
+        resolved_name = name or "__main__"
+        base = cast(FlextUtilitiesLogging, super().fetch_logger(resolved_name))
+        return cls(resolved_name, _bound_logger=base.logger)
</file context>
Suggested change
resolved_name = name or "__main__"
resolved_name = "__main__" if name is None else name
Fix with cubic

/// * `Ok(PathBuf)` - The resolved filesystem path to the repository.
/// * `Err(CallToolResult)` - Error if the repository cannot be found or arguments are missing.
pub fn repo_path(args: &VcsArgs) -> Result<PathBuf, CallToolResult> {
pub fn repo_path(args: &VcsArgs) -> Result<PathBuf, Box<CallToolResult>> {

@cubic-dev-ai cubic-dev-ai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The public repo_path documentation now describes the wrong error type: it still promises Err(CallToolResult), while the signature returns Err(Box<CallToolResult>). Updating the rustdoc alongside this boxing change would keep generated API documentation accurate.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/mcb-server/src/handlers/vcs/responses.rs, line 141:

<comment>The public `repo_path` documentation now describes the wrong error type: it still promises `Err(CallToolResult)`, while the signature returns `Err(Box<CallToolResult>)`. Updating the rustdoc alongside this boxing change would keep generated API documentation accurate.</comment>

<file context>
@@ -138,14 +138,14 @@ pub struct ImpactResponse {
 /// * `Ok(PathBuf)` - The resolved filesystem path to the repository.
 /// * `Err(CallToolResult)` - Error if the repository cannot be found or arguments are missing.
-pub fn repo_path(args: &VcsArgs) -> Result<PathBuf, CallToolResult> {
+pub fn repo_path(args: &VcsArgs) -> Result<PathBuf, Box<CallToolResult>> {
     if let Some(path) = args.repo_path.as_ref() {
         return Ok(PathBuf::from(path));
</file context>
Fix with cubic

@@ -1,4 +1,4 @@
use loco_rs::prelude::Result;
use loco_rs::prelude::*;

@cubic-dev-ai cubic-dev-ai Bot Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This module still uses only Result from the Loco prelude, and Loco's Result<T, E = Error> alias accepts the newly added boxed error parameter. Keeping the import explicit would avoid bringing the prelude's many controller, extractor, routing, and model names into this small config module.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/mcb-server/src/controllers/admin_config.rs, line 1:

<comment>This module still uses only `Result` from the Loco prelude, and Loco's `Result<T, E = Error>` alias accepts the newly added boxed error parameter. Keeping the import explicit would avoid bringing the prelude's many controller, extractor, routing, and model names into this small config module.</comment>

<file context>
@@ -1,4 +1,4 @@
-use loco_rs::prelude::Result;
+use loco_rs::prelude::*;
 
 /// Default config directory when `MCB_PRO_ADMIN_CONFIG_DIR` is not set.
</file context>
Suggested change
use loco_rs::prelude::*;
use loco_rs::prelude::Result;
Fix with cubic

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.

2 participants