Skip to content

feat: CoMSES Net integration (5 tools + 1 prompt)#2

Merged
Razee4315 merged 8 commits intomainfrom
feat/comses
Apr 18, 2026
Merged

feat: CoMSES Net integration (5 tools + 1 prompt)#2
Razee4315 merged 8 commits intomainfrom
feat/comses

Conversation

@Razee4315
Copy link
Copy Markdown
Owner

@Razee4315 Razee4315 commented Apr 18, 2026

Summary

Implements the full COMSES integration per docs/COMSES_PLAN.md v5 — the trust-building deliverable Serge asked for on 2026-04-17.

  • 5 new tools: search_comses, get_comses_model, download_comses_model, open_comses_model, read_comses_files.
  • 1 new prompt: explore_comses — NetLogo-first, source-introspection, never fabricates commands, stops-and-asks on both empty-discovery and runtime-error cases.
  • Safe extraction: HEAD screen + mid-stream byte cap, zip-slip rejection, zip-bomb guard, atomic temp→final move with .comses_complete marker, race reconciliation.
  • "latest" pinning: resolved to a concrete version BEFORE any cache path is computed; returned to the AI so follow-up read_comses_files calls stay pinned to the same slot.
  • 44 new tests covering the retry matrix, zip safety, cache trust rules, file-selection rule, priority ordering, truncation, zero-match, and prompt-rule drift. 85 tests total, all passing.

Supersedes the auto-closed #1 (branch renamed from feat/comses-integrationfeat/comses).

Commits

  1. 9cc4558 — API client + search/get tools (1/4)
  2. 1eead71 — safe download pipeline (2/4)
  3. bf249c4 — cache-aware open + file reader (3/4)
  4. 50315a8 — explore_comses prompt + docs (4/4)

Test plan

  • 85 unit tests pass (python -m pytest) — 41 existing + 44 new
  • Ruff lint clean
  • Live smoke test against real COMSES with one NetLogo model (manual, pre-merge)
  • Live smoke test against one non-NetLogo model (manual, pre-merge)
  • Verify prompt flow end-to-end with Claude Code (manual, pre-merge)

- ComsesClient: search, get_codebase, get_release, resolve_latest
- Retry policy: 502/503/504 + network errors, max 2 retries, never on 4xx
- search_comses, get_comses_model MCP tools
- httpx>=0.27 dep, COMSES_MAX_DOWNLOAD_MB env var
- download_release: resolve → HEAD → stream → safe extract → inspect
- Zip-slip, zip-bomb, atomic temp-to-final move, .comses_complete marker
- download_comses_model MCP tool
- open_comses_model: loads NetLogo models, returns resolved_version
- read_comses_files: priority ordering, byte-cap truncation, UTF-8 replace
- Zero-match case, errors-when-cache-missing, latest resolution
- Prompt: NetLogo-first, pins resolved_version, stops-and-asks on errors
- README + CHANGELOG + DEVELOPMENT.md updates
@Razee4315 Razee4315 merged commit 62d5df8 into main Apr 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant