Skip to content

Commit ab4f3d3

Browse files
committed
test: add machine verifier contract
- Add the repo-owned Machine Control Tower verify.commands surface. - Run pytest with documented optional extras and keep cache fixture timestamps fresh. Tests: uv run python -m src.cli report saagpatel --portfolio-truth; uv run --extra dev ruff check .; uv run --extra dev --extra serve --extra semantic --extra config pytest -q; ./bin/mct-verify doctor
1 parent a2f8c09 commit ab4f3d3

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

.codex/verify.commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# codex-os-managed
2+
uv run python -m src.cli report saagpatel --portfolio-truth
3+
uv run --extra dev ruff check .
4+
uv run --extra dev --extra serve --extra semantic --extra config pytest -q

tests/test_suggest_initiatives.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
# ── Factories ─────────────────────────────────────────────────────────────────
3636

3737

38+
def _fresh_cache_ts() -> str:
39+
return f"{date.today().isoformat()}T00:00:00+00:00"
40+
41+
3842
def _make_pt_repo(
3943
name: str = "TestRepo",
4044
has_git: bool = True,
@@ -1318,7 +1322,7 @@ def test_save_writes_file_no_tmp_leftover(self, tmp_path):
13181322

13191323
cache: OrderedDict = OrderedDict()
13201324
key, suggestions, cost = self._make_cache_entry()
1321-
cache[key] = (suggestions, cost, "2026-05-12T00:00:00+00:00")
1325+
cache[key] = (suggestions, cost, _fresh_cache_ts())
13221326
path = suggestion_cache_path(tmp_path)
13231327
save_suggestion_cache(path, cache)
13241328

@@ -1352,7 +1356,7 @@ def test_save_load_round_trip(self, tmp_path):
13521356

13531357
cache: OrderedDict = OrderedDict()
13541358
key, suggestions, cost = self._make_cache_entry("my-key")
1355-
ts = "2026-05-12T00:00:00+00:00"
1359+
ts = _fresh_cache_ts()
13561360
cache[key] = (suggestions, cost, ts)
13571361
path = suggestion_cache_path(tmp_path)
13581362
save_suggestion_cache(path, cache)
@@ -1423,7 +1427,7 @@ def test_clear_suggestion_cache_with_path_deletes_file(self, tmp_path):
14231427

14241428
cache: OrderedDict = OrderedDict()
14251429
key, suggestions, cost = self._make_cache_entry()
1426-
cache[key] = (suggestions, cost, "2026-05-12T00:00:00+00:00")
1430+
cache[key] = (suggestions, cost, _fresh_cache_ts())
14271431
path = suggestion_cache_path(tmp_path)
14281432
save_suggestion_cache(path, cache)
14291433
assert path.exists()
@@ -1511,7 +1515,7 @@ def test_disk_serialization_caps_at_cache_max_size(self, tmp_path, monkeypatch):
15111515
cache: OrderedDict = OrderedDict()
15121516
for i in range(5):
15131517
s = self._make_suggestion(f"Repo{i}")
1514-
cache[f"key-{i}"] = ([s], 0.0, "2026-05-12T00:00:00+00:00")
1518+
cache[f"key-{i}"] = ([s], 0.0, _fresh_cache_ts())
15151519

15161520
path = suggestion_cache_path(tmp_path)
15171521
save_suggestion_cache(path, cache)

0 commit comments

Comments
 (0)