test(observability): document telegram-rag-agent-invoke/-stream spans (fix red contract gate)#2298
Open
yastman wants to merge 1 commit into
Open
test(observability): document telegram-rag-agent-invoke/-stream spans (fix red contract gate)#2298yastman wants to merge 1 commit into
yastman wants to merge 1 commit into
Conversation
… (fixes contract suite drift) The contract suite failed on clean dev (2 failures, reproduced with a stashed worktree) after supervisor agent-loop recovery wrappers were added to telegram_bot/bot.py: - telegram-rag-agent-stream (_astream_supervisor_with_recovery) - telegram-rag-agent-invoke (_ainvoke_supervisor_with_recovery) both @observe(capture_input=False, capture_output=False, as_type='agent') but not registered in tests/observability/trace_contract.yaml. Two contracts were red: - test_span_coverage_contract::test_all_observed_spans_accounted_for (capture_input=False spans must be in sensitive_spans) - test_trace_families_contract::test_no_undocumented_observe_spans (every @observe name must be in the spans: inventory) Fix: register both spans in trace_contract.yaml — - sensitive_spans: (capture disabled), next to telegram-rag-supervisor; - spans.supervisor_recovery: new group so the reverse undocumented-span check passes. No production code changed. Verified: full tests/contract/ now green (1422 passed, was 2 failed); YAML groups intact (history_graph/voice_tools unchanged).
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.
This pull request was created by @kiro-agent on behalf of @yastman 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Summary
Fixes 2 contract-suite failures present on clean
dev—make test/ the contract gate is currently red for everyone.Root cause
Supervisor agent-loop recovery wrappers were added to
telegram_bot/bot.py:telegram-rag-agent-stream(_astream_supervisor_with_recovery)telegram-rag-agent-invoke(_ainvoke_supervisor_with_recovery)Both are
@observe(capture_input=False, capture_output=False, as_type="agent")but were never registered intests/observability/trace_contract.yaml, so two contracts failed:test_span_coverage_contract::test_all_observed_spans_accounted_for— everycapture_input=Falsespan must be insensitive_spans.test_trace_families_contract::test_no_undocumented_observe_spans— every@observename must appear in thespans:inventory.(Confirmed pre-existing: reproduced on clean
devwith my unrelated work stashed.)Fix
Register both spans in
trace_contract.yaml(docs/inventory only, no production code changed):sensitive_spans:— added next totelegram-rag-supervisor(capture disabled).spans.supervisor_recovery:— new group so the reverse undocumented-span check passes.Testing
pytest tests/contract/test_span_coverage_contract.py tests/contract/test_trace_families_contract.py→ 210 passed (was 2 failed).pytest tests/contract/→ 1422 passed, 2 skipped, 3 xfailed (full gate green again).history_graph,voice_tools) intact.verify:repo-only— no Docker/runtime validation required.