Skip to content

feat(provider): models.dev auto-bootstrap with fingerprint cache#473

Open
quangdang46 wants to merge 5 commits into
masterfrom
feat/A18-models-dev-bootstrap
Open

feat(provider): models.dev auto-bootstrap with fingerprint cache#473
quangdang46 wants to merge 5 commits into
masterfrom
feat/A18-models-dev-bootstrap

Conversation

@quangdang46

Copy link
Copy Markdown
Owner

Summary

Implements A18 — Models.dev auto-bootstrap with cache + fingerprint.

What's Included

  • ModelsDevBootstrap struct with fetch + cache lifecycle
  • Fingerprint: SHA-256 hash of sorted provider IDs
  • Cache file: raw JSON in config dir + companion meta file
  • Stale detection: 24h TTL + fingerprint mismatch triggers re-fetch
  • 6 unit tests: fingerprint computation, caching, cache miss, stale detection, empty state, EOF handling
  • 476 lines in crates/jcode-provider-core/src/models_dev.rs

Verification

  • cargo check -p jcode-provider-core: clean
  • All 6 tests pass

Refs: docs/pr-plans/A18-models-dev-bootstrap.md

Add consolidated PR backlog from 13 reference repos (A-J, ~80 features)
and supporting docs (MASTER_GOAL_PROMPT, GOAL_DRIVEN_PROMPT, CONSOLIDATED_FINDINGS).
Adds core InbandScanner trait, event types, and 3 fully-implemented
dialects (Hermes JSON-tag, Kimi token-delimited, Gemini Python-fence)
with 12 passing tests. 9 remaining dialects fall back to Hermes scanner.

Refs: docs/pr-plans/A6-inband-dialects.md
Adds model-family-aware prompt resolution so the system prompt is tuned
to the active model's instruction-following profile.

- PromptVariant enum with Claude/Gpt/Gemini/Default variants
- resolve_prompt_variant(model_id) prefix-based resolution
- system_prompt_for_model(model_id) convenience function
- Per-model markdown files: system_prompt_claude.md, system_prompt_gpt.md,
  system_prompt_gemini.md
- Wired into prompting.rs via model_id parameter
- Wired into both build_system_prompt_full and build_system_prompt_split

Refs: docs/pr-plans/C3-prompt-variants.md
- Add 'pub mod models_dev' to lib.rs so the new module is compiled
- Replace rand::random() with SystemTime::as_nanos() for temp file nonces,
  avoiding a new Cargo dependency
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