Separate manifest expansion events from transformation (#344)#375
Separate manifest expansion events from transformation (#344)#375leynos wants to merge 1 commit into
Conversation
`expand_foreach` mutated the manifest while `when_allows` emitted debug telemetry directly (guarded by a subscriber check), embedding observability policy in the domain transformation path. Expansion is now telemetry-free. `when_allows` returns an optional `FilteredEntry` (section, bounded name hash, iteration index, expression length — the same privacy-preserving fields as before), `expand_section` accumulates them, and `expand_foreach` returns an `ExpansionReport` carrying both the per-section counts and the per-entry events. The caller owns the tracing policy: `manifest::from_str_named` passes the report to the new `trace_expansion_report`, which emits the same filtered-entry and summary debug events as before. Tests updated to the new boundary: the stats test asserts the report's events as well as its counts, and the tracing-capture test verifies expansion emits nothing itself before exercising the orchestrator-side emitter.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideSeparates manifest expansion from telemetry by having expansion return structured filtering data instead of emitting tracing events directly, and introduces an orchestrator-side tracer that logs the same privacy-preserving information based on the expansion report. Sequence diagram for manifest expansion and telemetry separationsequenceDiagram
participant from_str_named
participant expand_foreach
participant trace_expansion_report
participant tracing
from_str_named->>expand_foreach: expand_foreach(doc, jinja) : ExpansionReport
expand_foreach-->>from_str_named: ExpansionReport
from_str_named->>trace_expansion_report: trace_expansion_report(report)
loop per FilteredEntry
trace_expansion_report->>tracing: debug(filtered manifest entry by when expression)
end
trace_expansion_report->>tracing: debug(expanded manifest foreach and when directives)
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary
Closes #344
Manifest expansion no longer emits tracing side effects from the transformation path; it reports filtering through returned data and the caller owns the telemetry policy, as proposed.
Changes
src/manifest/expand.rs:when_allowsreturns an optionalFilteredEntry(section, bounded entry-name hash, iteration index,whenexpression length — the same privacy-preserving fields the old inline event logged);expand_foreachreturns anExpansionReport(counts + events). Alltracingusage (including thehas_subscriberguard) is gone from the module.src/manifest/mod.rs: new orchestrator-sidetrace_expansion_reportemits the same filtered-entry and summary debug events as before;from_str_namedcalls it after expansion.Testing
expand_foreach_returns_filtering_statsnow also asserts the report carries one event per removed entry with correct sections.trace_expansion_report_emits_debug_event_for_filtered_entry) first asserts expansion emits nothing itself, then verifies the orchestrator-side emitter produces the previous event shape (hash present, raw name/expression absent).Validation
make check-fmt/make lint/make test— pass (37 suites)🤖 Generated with Claude Code
Summary by Sourcery
Separate manifest expansion from telemetry by returning structured filtering reports instead of emitting traces directly.
New Features:
Enhancements:
Tests: