Fix Terra audit findings across bindings and runtime#25
Merged
Conversation
Continues commit 6e9edc4 with the remaining P1 fixes from the audit roadmap. Terra core (P1-1, P1-2, P1-3, P1-7): - Terra.workflow rootStrategy opt-out for ambient OTel re-parenting - Augmented OpenTelemetry signposts processor now gated by ProcessorGate - _SpanRegistry purged on shutdown to stop closure/handle leaks - TerraSpanEnrichmentProcessor + SessionSpanProcessor scope by tracer instrumentation name, not just hardcoded SpanNames HTTP provider drift (P1-8): - AIRequestParser handles Gemini contents/generationConfig, Bedrock per-model shapes (Claude/Titan/Llama), Cohere chat schema, OpenAI Responses-API input array - AIResponseParser handles Gemini usageMetadata, Bedrock camelCase inputTokens/outputTokens, Cohere meta.tokens - HTTPAIInstrumentation Azure OpenAI deployment-name URL fallback + expanded default host list Profilers (P1-12): - ThermalMonitor registers ProcessInfo.thermalStateDidChangeNotification observer with bounded sliding-window buffer; peak now reflects mid-interval spikes - Reset removes observer and clears buffer TraceKit (P1-14): - Compression honors Task cancellation between chunks; CRC32 verified against zlib reference; declared-size cap enforced before inflation DX / docs (P1-15, P1-16, P1-17, P1-18, P0-9): - DocumentationLintTests + new CookbookSnippetsCompileTests harness compiles every fenced Swift snippet from cookbook/integrations/migration/ README/DocC against the package - Benchmarks/TerraSDKBenchmarks restored from placeholder - Docs/PLATFORM-COMPATIBILITY.md documents macOS-only xcframework slice and libtera/libterra naming split until iOS slices ship - TelemetryEngine-Injection DocC example annotated as in-package only - README updated with platform support note Tooling (P0-8 redo, P0-10, P1-19): - Scripts/validate-telemetry-schema.py: source-key drift scan across all Sources/, registers 44 newly-surfaced keys (121→165 entries) - .github/workflows/ci.yml: SPM/Cargo/Gradle caches, advisory iOS Simulator build job, TerraTracedMacro excluded from API-break diff - Examples/Terra AutoInstrument/main.swift switched to current features/profiling OptionSet API Verification: - python3 Scripts/validate-doc-snippets.py - python3 Scripts/validate-telemetry-schema.py (165 entries) - python3 Scripts/validate-bindings.py - bash Scripts/validate_no_legacy_refs.sh - (cd zig-core && zig build test --summary all): 197 passed - (cd terra-python && python3 -m unittest discover -p 'test*.py'): 4 passed - swift build --target {Terra, TerraCore, TerraTraceKit, TerraSystemProfiler, TerraHTTPInstrument, TerraSDKBenchmarks, TerraTests, TerraTraceKitTests, TerraSystemProfilerTests, TerraHTTPInstrumentTests}: all clean - swift test --filter "ThermalMonitorTests|CompressionTests| TerraLifecycleP1Tests|AIMultiProviderParserTests| CookbookSnippetsCompileTests": 33 tests in 6 suites passed
9760202 to
d4c8c50
Compare
dd3b3d9 to
bd4f3e6
Compare
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.
Summary
SpanContextvalidity and parent propagation so partial contexts no longer leak through bindings.Testing