Skip to content

Add reporting, retry lifecycle, and dry-run functionality#231

Merged
timkpaine merged 2 commits into
mainfrom
tkp/rep
Jul 14, 2026
Merged

Add reporting, retry lifecycle, and dry-run functionality#231
timkpaine merged 2 commits into
mainfrom
tkp/rep

Conversation

@timkpaine

Copy link
Copy Markdown
Member

Introduce a structured reporting layer that captures evaluation metadata, timing, topology, retries, and failures without consuming result payloads, mirroring the existing evaluator/policy architecture.

  • ReportingPolicy shared core with span/run ContextVars for nested, thread/async-local isolation
  • ReportEvent model plus NoOp/InMemory/Logging/Composite/UI reporters and a bounded UI polling buffer
  • Tracing/metrics/alerts policies and OpenTelemetry tracing/metrics integration (exposed via otel/full/develop/test extras)
  • Structural reporting models and a Reporting{Evaluator,Model} taxonomy with placeholder vendor classes
  • Refactor LoggingEvaluator onto LoggingPolicy to share formatting and enable LoggingModel while preserving the existing import path and log output
  • Retry lifecycle events now carry run_id and child depth via current_span_depth(); reporter failures are isolated on reporting/retry paths
  • DryRunEvaluator with context-local planning guard; synthetic mode is non-transparent so results are not cached under real-run keys; node_key strips the dry-run evaluator layer while preserving non-evaluator options so it matches cache_key() for the logical node
  • ReportingStateStore preserves terminal outcomes while allowing retry streams to progress
  • Docs: reporting workflow, reporter options, OpenTelemetry install, reserved run/graph phases, extra payload keys, and dry-run synthetic-result warnings
  • Tests across utils/evaluators/models covering success/error flows, dry-run override recursion, cache composition, concurrent dry-run reuse, node-key semantics, retry event nesting, reporter failure isolation, and state folding

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Test Results

    1 files  ± 0      1 suites  ±0   2m 32s ⏱️ -23s
1 309 tests +84  1 307 ✅ +84  2 💤 ±0  0 ❌ ±0 
1 315 runs  +84  1 313 ✅ +84  2 💤 ±0  0 ❌ ±0 

Results for commit 4a5b5e8. ± Comparison against base commit daa4c40.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.99054% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.31%. Comparing base (daa4c40) to head (94d0d1b).

Files with missing lines Patch % Lines
ccflow/utils/reporting.py 93.57% 17 Missing and 8 partials ⚠️
ccflow/evaluators/reporting.py 95.12% 2 Missing and 2 partials ⚠️
ccflow/tests/evaluators/test_reporting.py 98.07% 4 Missing ⚠️
ccflow/tests/models/test_reporting.py 97.01% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #231      +/-   ##
==========================================
+ Coverage   93.09%   93.31%   +0.21%     
==========================================
  Files         169      175       +6     
  Lines       18748    19850    +1102     
  Branches     1235     1276      +41     
==========================================
+ Hits        17454    18523    +1069     
- Misses       1066     1089      +23     
- Partials      228      238      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timkpaine timkpaine marked this pull request as ready for review June 23, 2026 22:34
Introduce a structured reporting layer that captures evaluation metadata,
timing, topology, retries, and failures without consuming result payloads,
mirroring the existing evaluator/policy architecture.

- ReportingPolicy shared core with span/run ContextVars for nested,
  thread/async-local isolation
- ReportEvent model plus NoOp/InMemory/Logging/Composite/UI reporters and
  a bounded UI polling buffer
- Tracing/metrics/alerts policies and OpenTelemetry tracing/metrics
  integration (exposed via otel/full/develop/test extras)
- Structural reporting models and a <Vendor><Signal>Reporting{Evaluator,Model}
  taxonomy with placeholder vendor classes
- Refactor LoggingEvaluator onto LoggingPolicy to share formatting and
  enable LoggingModel while preserving the existing import path and log output
- Retry lifecycle events now carry run_id and child depth via
  current_span_depth(); reporter failures are isolated on reporting/retry paths
- DryRunEvaluator with context-local planning guard; synthetic mode is
  non-transparent so results are not cached under real-run keys; node_key
  strips the dry-run evaluator layer while preserving non-evaluator options
  so it matches cache_key() for the logical node
- ReportingStateStore preserves terminal outcomes while allowing retry streams
  to progress
- Docs: reporting workflow, reporter options, OpenTelemetry install, reserved
  run/graph phases, extra payload keys, and dry-run synthetic-result warnings
- Tests across utils/evaluators/models covering success/error flows, dry-run
  override recursion, cache composition, concurrent dry-run reuse, node-key
  semantics, retry event nesting, reporter failure isolation, and state folding

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>

@ptomecek ptomecek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a pass through this. I really like how the reporting policy/evaluator/model split mirrors the retry trio (RetryPolicy/RetryEvaluator/RetryModel) - it slots in cleanly and reads exactly the way I'd expect. A few things I'd like to sort out before it goes in, left inline.

One non-code note: the description has a "Docs: reporting workflow, reporter options, ..." bullet, but I don't see any docs/ changes in the diff. Did those get dropped, or is the description just ahead of the code? Given how much public API this adds, I think we'll want the docs to land with it.

Comment thread ccflow/evaluators/reporting.py Outdated
Comment thread ccflow/evaluators/reporting.py Outdated
Comment thread ccflow/utils/reporting.py
Move dry-run planning to a composed evaluator, remove unimplemented backend exports, skip event allocation without a reporter, and document the reporting API.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine

Copy link
Copy Markdown
Member Author

Addressed review feedback in 4a5b5e8:

  • moved dry-run planning to its own evaluator module and composed reporting
  • removed unimplemented public backend placeholders, retaining future work as comments
  • skipped structured event construction when no reporter is configured
  • added reporting API reference documentation and navigation
  • removed separator-style comment markers from the changed reporting code

Validation: 75 focused reporting tests pass; Ruff, mdformat, codespell, and diff checks pass.

@timkpaine timkpaine merged commit 378eb39 into main Jul 14, 2026
18 checks passed
@timkpaine timkpaine deleted the tkp/rep branch July 14, 2026 23:33
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