feat(8118,8119): telemetry reads take a closed window, and every enter_project records whether it carried the family line
CI & Build / TypeScript typecheck (push) Successful in 37s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 17s
CI & Build / integration (push) Failing after 2m15s
CI & Build / Python tests (push) Successful in 2m23s
CI & Build / Build & push image (push) Skipped
CI & Build / TypeScript typecheck (push) Successful in 37s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 17s
CI & Build / integration (push) Failing after 2m15s
CI & Build / Python tests (push) Successful in 2m23s
CI & Build / Build & push image (push) Skipped
#8119: retrieval_telemetry and list_rules(with_usage) take `since` and `until` (ISO date or datetime) besides `days`. Every windowed count is bounded at both ends: sources, note/rule/system/moment usage, record reach, judged lines and the floor-moved check. A review read after its period can now keep a later deploy out of its counts. A bad bound is refused rather than widened. #8118: enter_project writes one AppLog row (family / enter_project) per entry: the project, whether the family line was shown, its counts, and whether the readout failed. It is spawned, so the handshake does not wait. retrieval_telemetry gains a `family_line` block: per project, entries, entries that carried the line, first and last shown, and the latest counts. Review #5132's "did the project's sessions see the line" is now answerable from this deploy on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -356,8 +356,43 @@ async def test_enter_project_fires_the_coverage_seed_on_the_owner(
|
||||
))
|
||||
await enter_project(project_id=5)
|
||||
seed.assert_called_once_with(42, 5, cached=None)
|
||||
_no_background_seed.assert_called_once()
|
||||
assert _no_background_seed.call_args.kwargs["site"] == "enter_project.coverage_seed"
|
||||
sites = [c.kwargs["site"] for c in _no_background_seed.call_args_list]
|
||||
assert sites.count("enter_project.coverage_seed") == 1
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_every_enter_records_whether_it_carried_the_family_line(
|
||||
_no_family, _no_background_seed,
|
||||
):
|
||||
"""Review #5132 asks whether a project's sessions saw the family line.
|
||||
Each enter records one entry, with the line or without it (the entries
|
||||
are the denominator), and a failed readout is recorded as failed rather
|
||||
than as an entry with nothing to show."""
|
||||
import contextlib
|
||||
|
||||
line = {"line": "family canon…", "unassessed": 2, "owed": 1, "needs_recheck": 0}
|
||||
|
||||
async def enter():
|
||||
with contextlib.ExitStack() as stack:
|
||||
for cm in _enter_project_stubs(fake_project(id=5)):
|
||||
stack.enter_context(cm)
|
||||
record = stack.enter_context(patch(
|
||||
"grimoire.mcp.tools.projects.family_adoption_svc.record_entry",
|
||||
MagicMock(return_value=object()),
|
||||
))
|
||||
await enter_project(project_id=5)
|
||||
sites = [c.kwargs["site"] for c in _no_background_seed.call_args_list]
|
||||
assert "family_entry_record" in sites
|
||||
return record
|
||||
|
||||
record = await enter()
|
||||
record.assert_called_once_with(7, 5, None, failed=False)
|
||||
_no_family.return_value = line
|
||||
record = await enter()
|
||||
record.assert_called_once_with(7, 5, line, failed=False)
|
||||
_no_family.side_effect = RuntimeError("database down")
|
||||
record = await enter()
|
||||
record.assert_called_once_with(7, 5, None, failed=True)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user