Skip to content

feat: add edge test cases for CostEvaluator and LatencyEvaluator#54

Merged
hidai25 merged 1 commit intohidai25:mainfrom
illbeurs:feature/evaluators-edge-tests
Mar 2, 2026
Merged

feat: add edge test cases for CostEvaluator and LatencyEvaluator#54
hidai25 merged 1 commit intohidai25:mainfrom
illbeurs:feature/evaluators-edge-tests

Conversation

@illbeurs
Copy link
Contributor

@illbeurs illbeurs commented Mar 2, 2026

No description provided.

@hidai25 hidai25 merged commit e2b203d into hidai25:main Mar 2, 2026
@hidai25
Copy link
Owner

hidai25 commented Mar 2, 2026

Hey @illbeurs , thanks for the contribution! Good catch on the edge cases — merging this
in. There are a couple of copy-paste issues in the docstrings (the latency tests
reference "cost" instead of "latency") but nothing blocking. We'll fix the underlying
evaluator behavior for the zero threshold and negative value cases in a follow-up.
Appreciate the work! 🙏 Thanks a lot for the good work

muhammadrashid4587 pushed a commit to muhammadrashid4587/eval-view that referenced this pull request Mar 11, 2026
## Summary

- Refactor `git.py` from closure-based callback to stateful
`GitWriteStrategy` class
- Commits per-write, defers push to background `threading.Timer`
(default 30s idle)
- Startup recovery: pushes any unpushed local commits on first
invocation
- `flush()`/`close()` for explicit push control; `Collection.close()`
wires through
- New env var: `MARKDOWN_VAULT_MCP_GIT_PUSH_DELAY_S` (default 30, 0 =
push on shutdown only)
- Legacy `git_write_strategy()` preserved as thin wrapper

Closes hidai25#54

## Design Conformance

| # | Requirement | Source | Status | Evidence |
|---|---|---|---|---|
| 1 | `GitWriteStrategy` class replacing closure | Issue hidai25#54 |
CONFORMANT | `git.py:52-224` |
| 2 | Per-write: `git add + git commit` (no push) | Issue hidai25#54 |
CONFORMANT | `_stage_and_commit()` |
| 3 | Deferred push via `threading.Timer` | Issue hidai25#54 | CONFORMANT |
`_schedule_push()` |
| 4 | `flush()` method | Issue hidai25#54 | CONFORMANT | `git.py:208-220` |
| 5 | `close()` method | Issue hidai25#54 | CONFORMANT | `git.py:222-225` |
| 6 | Startup recovery | Issue hidai25#54 | CONFORMANT | `_push_if_unpushed()`
|
| 7 | `GIT_PUSH_DELAY_S` env var | Issue hidai25#54 | CONFORMANT | `config.py`
+ design doc table |
| 8 | `collection.close()` dispatches to strategy | Issue hidai25#54 |
CONFORMANT | duck-typed `hasattr` |
| 9 | Legacy wrapper preserved | Issue hidai25#54 | CONFORMANT | Honest
docstring, returns `GitWriteStrategy` |
| 10 | Design doc updated | Design doc | CONFORMANT | Three strategies +
env var table |

Reviewed by @architect-reviewer — all requirements CONFORMANT after
fixup commit.

## Test plan

- [ ] 235 tests pass locally (15 new git tests)
- [ ] Deferred push fires after idle delay
- [ ] `flush()`/`close()` push immediately
- [ ] Startup recovery pushes unpushed commits
- [ ] Token not in command args (GIT_ASKPASS preserved)
- [ ] `Collection.close()` calls strategy `close()`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants