Repository navigation
feat(cli): devmap_analyze, opt-in auto-refresh, transitive impact, prompts (Phase 2) - #132
Merged
Merged
Conversation
…ase 2 groundwork) - export runAnalyze; AnalyzeOptions.offline skips domain inference, snapshot enrichment and architecture interpretation (static analysis only) - MapOptions/FlowOptions.loaded lets long-lived callers pass an already loaded snapshot so it is not re-read and staleness is not re-scanned per call No behavior change for the CLI; nothing uses these options yet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AgTNRXcqugxRyJfMKL4AJ2
… prompts (Phase 2) - devmap_analyze tool: re-analyze and refresh .devmap/snapshot.json. Returns "unchanged" without analyzing when no file changed (fresh:true forces a rebuild); waits up to timeoutSeconds then returns status "running" while the analysis continues in the background; concurrent calls share one analysis; sends progress notifications so clients do not time out. - Static analysis by default: no AI is used unless the server is started with --allow-ai. aiDataDropped is reported when a static rebuild loses AI-derived data (domain/architecture) from the previous snapshot. - --auto-refresh (off by default): a stale or missing snapshot is rebuilt before answering; a failing refresh falls back to the stale snapshot with snapshot.refreshError and backs off for 30s. - cross-process lock (.devmap/analyze.lock): dead-pid and >15min locks are taken over. - devmap_impact: `depth` (1-5) follows imports transitively, cycle-safe, and reports dependentCount, affectedFeatures, isCritical and criticalDependents. - devmap_map/devmap_flow reuse the provider's cached snapshot instead of re-reading and re-scanning on every call. - prompts: devmap_onboard, devmap_plan_change. - tests: mcp-freshness.test.ts (21), offline-analyze test proving no AI access even with an API key configured, analyze check in the packed-package e2e. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AgTNRXcqugxRyJfMKL4AJ2
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✅ Welcome ke DevMap!Terima kasih sudah buat PR. Pastikan checklist ini terpenuhi sebelum review:
CI akan jalan otomatis pada setiap update. Kalau gagal, akan muncul link run di komentar ini. Kalau DevMap membantu, tolong star ya: https://github.com/itsflaid/devmap Terima kasih kontribusinya! 🙏 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ringkasan
Fase 2: server MCP bisa me-refresh peta proyeknya sendiri, dengan AI mati secara default, dan
devmap_impactjadi jauh lebih berguna sebelum mengedit file.Yang baru
devmap_analyze— analisis ulang dan refresh.devmap/snapshot.json(hanya menulis di dalam.devmap/).unchangedtanpa menganalisis ulang bila tidak ada file berubah;fresh: truememaksa rebuild.timeoutSeconds(default 120). Lewat itu hasilnyarunningdan analisis lanjut di background; panggilan berikutnya bergabung ke analisis yang sama.notifications/progresssupaya client tidak timeout.--allow-ai. Bila rebuild statis menghilangkan data turunan AI (domain/arsitektur) dari snapshot lama, hasil melaporkanaiDataDropped: true+ petunjuk memulihkannya.--auto-refresh(default off) — snapshot stale/hilang dibangun ulang sebelum menjawab. Bila gagal: kembali ke snapshot lama dengansnapshot.refreshError, dan tidak mencoba lagi selama 30 detik..devmap/analyze.lock— lock dari proses yang sudah mati atau lebih dari 15 menit diambil alih.devmap_impact— parameterdepth(1–5) mengikuti import secara transitif (aman dari siklus), plusdependentCount,affectedFeatures,isCritical,criticalDependents.devmap_map/devmap_flowmemakai snapshot yang sudah di-cache provider (tidak lagi baca ulang + scan stale tiap panggilan).devmap_onboard,devmap_plan_change.devmap mcp [--root <path>] [--auto-refresh] [--allow-ai].Catatan keamanan/perilaku
--auto-refreshaktif atau agent memanggildevmap_analyze.devmap_analyzeditandaireadOnlyHint: false,destructiveHint: false,idempotentHint: true;openWorldHinttrue hanya dengan--allow-ai.devmap analyzedi terminal belum memakainya (kemungkinan tabrakan sangat kecil, bisa ditambahkan nanti).Perubahan di luar
src/mcpcommands/analyze.ts:runAnalyzedi-export, opsioffline. Perilaku CLI tidak berubah.commands/map.ts,commands/flow.ts: opsiloaded(snapshot yang sudah dimuat).Verifikasi
pnpm test(typecheck + unit): 474/474 (22 tes baru)pnpm run build✅pnpm run test:package-e2e✅ (smoke test paket kini juga memanggildevmap_analyzedari tarball)Berikutnya: Fase 3 (
devmap_explainBYOK, smoke test CI, rilis 0.9.0), lalu Fase 4 (docs + landing page).Generated by Claude Code