Magal
|
30742f1643
|
fix(memtrace): make MCP timeout detection accurate and reliable
- fail() no longer emits MEMTRACE_MCP_ERROR_TIMEOUT (STDERR-only)
- McpClient.spawn() wrapped with withTimeout(spawnPromise, TIMEOUT_MS)
- McpClient.sendRequest() wrapped with withTimeout(requestPromise, TIMEOUT_MS)
- runSingleQuery non-timeout catch uses inline console.error
- Add 7 new timeout-accuracy tests (39/39 pass)
- Fix 6 existing test assertions for non-timeout exit-1 paths
- Story 4.1 complete
|
2026-05-20 15:50:28 -03:00 |
Magal
|
3a94cc4571
|
fix(adapter): apply code review patches for timeout detection reliability
- Add NaN date warning in checkIndexFreshness and queryListRepos
- Add --batch unsupported query pre-flight validation in main()
- Emit JSON error on freshness failure for non-list_repos queries
- Add STDERR warning when resolveRepoId falls back to 'project'
- Fix diagnostic catch block to process.exit(1) on failure
- Handle Windows root drive path in resolveRepoId
- Improve batch empty target expansion error message
- Add 4 new tests: unsupported batch query, env var fallback,
auto-detection, all-failing batch
- 32/32 tests passing
|
2026-05-20 06:54:26 -03:00 |
Magal
|
72e293f346
|
feat(story-3.4): implement server concurrency throttling and freshness check
Add --check-freshness flag (index freshness gate blocking stale data),
--batch flag (sequential for...of query processing, anti-Promise.all),
and freshness metadata in list_repos output.
Code review patches applied:
- Reset 7 patch findings (AC #4 real diagnostic, null guards,
shutdown separation, empty target validation)
- Resolved 3 deferred edge cases (Date.parse NaN, falsy 0, type guard)
- Resolved 4 pre-existing issues (infinite while-loop guard,
resolveRepoId cross-platform, empty fallback, JSON error logging)
Closes story-3.4
|
2026-05-19 19:22:39 -03:00 |
Magal
|
abd758e7ee
|
feat(adapter): add hierarchical summarization via --summarize flag (Story 3.3)
Adds --summarize flag to memtrace-adapter.mjs for token-budgeted
hierarchical summarization of get_impact blast radius responses:
- summarizeBlastRadius(): groups by directory prefix, extracts depth<=2
critical dependents, builds module impact with top symbols, enforces
<=2000 token budget via progressive while-loop trimming
- estimateTokens(): chars/4 * 1.15 buffer safety margin
- Cross-platform path support (/[\\\\/]/ regex), NaN/Infinity depth guards
- Non-object entry guards, JSON.stringify try/catch
- total_critical field added for count transparency
Workflow files updated to use --summarize flag:
- bmad-dev-story/SKILL.md step 5, bmad-quick-dev step files
- bmad-code-review and gds-code-review auditors check for --summarize
6 summarization tests added. 42/42 tests passing (adapter 20 +
qa-memtrace 10 + validate-dead-code 12).
|
2026-05-19 18:41:01 -03:00 |
Magal
|
ffb430ed99
|
feat(adapter): implement MCP query adapter with get_impact, list_repos, and find_dead_code (Stories 3.1-3.2)
- Add memtrace-adapter.mjs: standalone Node.js MCP client over stdio
with 10000ms timeout, MEMTRACE_MCP_ERROR_TIMEOUT token,
structured JSON output matching qa-memtrace.mjs contract
- Support --query get_impact (blast radius), --query find_dead_code
(dead code detection with repo_id + file_path scoping),
--query list_repos (index freshness)
- Add 14 automated tests: 9 CLI arg handling + 5 MCP integration
- Update dev-story SKILL.md step 5 to use adapter for blast radius
and dead-code queries, with empty-results skip for pitfall validation
- Update quick-dev step-03-implement and step-oneshot workflows
- Extend code-review acceptance auditors with adapter usage verification
and dead-code adapter check
- Fix raw memtrace_get_impact reference in SKILL.md (review patch)
|
2026-05-19 17:50:32 -03:00 |