Skip to content

Fix #1340: use unique temp path in mcp_tool_index save_and_load test#869

Closed
AlexMikhalev wants to merge 16 commits into
mainfrom
task/1340-fix-mcp-test-static-path
Closed

Fix #1340: use unique temp path in mcp_tool_index save_and_load test#869
AlexMikhalev wants to merge 16 commits into
mainfrom
task/1340-fix-mcp-test-static-path

Conversation

@AlexMikhalev
Copy link
Copy Markdown
Contributor

Summary

  • Replace static /tmp/test-mcp-index.json with a per-run unique filename using systemTime::subsec_nanos()
  • Eliminates parallel test interference when cargo test --workspace runs concurrent test binaries

Root Cause

crates/terraphim_agent/src/mcp_tool_index.rs:283 used a hard-coded temp path. Under concurrent execution another test run could delete or overwrite the file between save() and load().

Test Plan

  • cargo test -p terraphim_agent --lib mcp_tool_index passes (9/9)
  • cargo clippy -p terraphim_agent -- -D warnings clean
  • cargo fmt --all -- --check clean

Refs terraphim/terraphim-ai#1340 (Gitea)

forge-admin and others added 16 commits May 7, 2026 05:47
Extended doc scan methodology to include pub fn/pub async fn.
395 total gaps identified (vs 307 struct/enum-only morning scan).
New critical findings: terraphim_Service and terraphim_Database
public API entry points undocumented. Updated issue #1289 with findings.

Co-Authored-By: Terraphim AI Sonnet 4.6 <noreply@anthropic.com>
- Add spec validation report 2026-05-07 (FAIL: 2 persistent gaps)
- Generate doc gap v3 (afternoon): 395 gaps unchanged, no new Rust code
- CHANGELOG: add spec validation entry for 2026-05-07

Theme-ID: doc-gap

Co-Authored-By: Terraphim AI <noreply@terraphim.ai>
Traceability review of PR #1291 (meta_coordinator module wiring fix).
Verdict: pass -- closes META-001 blocker, two pre-existing follow-up
items noted (missing plans/ spec doc, last_cleanup mutation bug).

Co-Authored-By: Terraphim AI <noreply@terraphim.cloud>
Two persistent gaps: meta_coordinator absent from lib.rs (blocker,
PR #1291 open and unmerged despite issue #1275 closure), guard.rs
absent (medium, #1274 open). New process finding: issue #1275 was
closed prematurely without the fix landing on main.

Co-Authored-By: Terraphim AI <noreply@terraphim.ai>
Carthos spec-validator v4 run (18:10 CEST). Verdict: FAIL.
Two persistent gaps: meta_coordinator orphaned (blocker, PR #1291
unmerged) and guard.rs absent (Phase H, issue #1274). Probe fix
#446 landed correctly; noted as unspecified boundary crossing.

Co-Authored-By: Terraphim AI <noreply@terraphim.ai>
Formally documents the System decision to bind Ollama to
127.0.0.1:11434 (localhost only). Provides GDPR Article 32 evidence
artefact required by the compliance gate on #1318.

Co-Authored-By: Vigil security_checklist Engineer <noreply@anthropic.com>
…checked Refs #1313

Add SHA-256 integrity checking to the UMLS artifact format to establish
a verified safety precondition for daachorse's deserialize_unchecked.

- ArtifactHeader gains shard_checksums: Vec<[u8; 32]>
- save_umls_artifact computes SHA-256 of each shard and stores digests
- load_umls_artifact verifies every shard against its stored digest
  before returning bytes to the caller; mismatch is a hard error
- sharded_extractor computes checksums from serialized bytes at save time
- Tests: round-trip, tamper-detection (checksum mismatch rejected), exists

Addresses P1-1 from the 2026-05-07 security_checklist sentinel report (#1313).
daachorse 1.0.x exposes only deserialize_unchecked with no checked
variant; checksum verification is the correct mitigation strategy.
… #1313

The SHA-256 checksum verification tests (medical_artifact module) were not
running in CI because the medical feature is optional. Without it the
test binary compiles without daachorse/sha2/zstd and the test functions
are excluded, leaving the deserialize_unchecked safety precondition
untested in automated builds.

Add terraphim_automata/medical to the --features flag on the workspace
cargo test invocation in ci-main.yml.
Carthos spec-validator run 02:33 CEST. Verdict: FAIL.
Two persistent gaps: meta_coordinator orphaned (blocker, PR #1291
unmerged) and guard.rs absent (Phase H, issue #1274). SHA-256
checksum fix for P1-1 landed correctly; issue #1322 process
discrepancy noted.

Co-Authored-By: Terraphim AI <noreply@terraphim.ai>
- crate overviews for persistence, mcp_server, config, rolegraph, middleware
- DeviceStorage struct doc explaining singleton and cache write-back
- TerraphimMcpError enum doc describing four failure domains
- CHANGELOG updated with recent security/CI commits

Co-Authored-By: Terraphim AI <noreply@terraphim.cloud>
Merge the two-line let binding back to one line to satisfy cargo fmt
on line 258 of medical_artifact.rs.

Co-Authored-By: Terraphim AI <noreply@terraphim.ai>
All workspace crates now carry //! crate-level documentation:
terraphim_service, terraphim_settings, terraphim_agent,
terraphim_file_search, terraphim_kg_linter, terraphim_ccusage,
terraphim_usage, terraphim_build_args, terraphim_lsp,
terraphim_automata_py, terraphim_rolegraph_py,
terraphim-markdown-parser, core, atlassian, discourse,
grepapp, jmap haystack integrations.
CHANGELOG updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- terraphim_dsm/src/main.rs: CLI tool description
- terraphim_github_runner_server/src/main.rs: http server description
- CHANGELOG.md: note that all workspace crates are now documented

All 50+ crates in the workspace now carry a crate-level //! comment.

Co-Authored-By: Ferrox <noreply@anthropic.com>
…1331

Resolve 14 broken rustdoc intra-doc links and 5 unclosed HTML tag
warnings across terraphim_orchestrator, terraphim_types, and
terraphim_tracker. cargo doc now produces zero warnings on all
core crates.

Key fixes:
- pr_poller: qualify DispatchTask::AutoMerge and poll_pending_reviews
  with full crate paths
- lib.rs: fix GateConfig path, remove private reconcile_tick link,
  fix nonexistent handle_post_merge_test_gate_for_project reference
- mention.rs: replace [MENTION_RE] private-item link with inline code
- handoff.rs + executor.rs: wrap angle-bracket generics in backticks
- tracker: convert bare URLs and ambiguous method links to inline code
- types: guard feature-gated HgncGene/HgncNormalizer links

Also add doc gap report 2026-05-08 and CHANGELOG entries.

Co-Authored-By: Terraphim AI Sonnet 4.6 <noreply@anthropic.com>
Resolve all unresolved intra-doc links, unclosed HTML tags, and bare
URL hyperlink warnings surfaced by cargo doc --no-deps.

Changes per crate:
- terraphim_config: path reference -> inline code
- terraphim_file_search: ScoringContext -> inline code
- terraphim_middleware: bare URLs -> <url>, Vec<Message> -> backtick,
  redundant explicit link removed
- terraphim_router: with_change_notifications -> inline code
- terraphim_service: kg:term markdown link format -> backtick
- terraphim_tinyclaw: example URL in string -> backtick
- terraphim_tracker: unresolved method links -> inline code,
  bare URL -> backtick
- terraphim_types: HgncGene/HgncNormalizer feature-gated links ->
  inline code with note, schema.org URL -> backtick

Result: cargo doc --no-deps emits zero doc-comment warnings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… #1340

Replace static /tmp/test-mcp-index.json with a per-run unique filename
derived from systemTime subsec_nanos to eliminate parallel test interference
when cargo test --workspace runs multiple test binaries concurrently.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Documentation Preview

Your documentation changes have been deployed to:
https://88abc653.terraphim-docs.pages.dev

This preview will be available until the PR is closed.

@AlexMikhalev
Copy link
Copy Markdown
Contributor Author

Cherry-picked into main (commits 444ec07, c80b4c7, ea15643, 16e46d3, 9cd2593, 87b83a7, ec6fd17, 211dffb, dd5ec68). Closing.

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.

1 participant