Skip to content

fix(ai): simplify trace validation and align request status - #118

Merged
ice-black-tea merged 26 commits into
masterfrom
fix/ai-trace-lineage-contract
Sep 23, 2026
Merged

ice-black-tea merged 26 commits into
masterfrom
fix/ai-trace-lineage-contract

Conversation

@ice-black-tea

@ice-black-tea ice-black-tea commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • fix RuntimeHistory.trace() rejecting valid tool events that carry request_sequence without request_purpose
  • remove redundant projection-layer validation while retaining checks required to decode, correlate, or disambiguate persisted data
  • keep trace usage metadata tolerant of missing/additive fields while rejecting malformed present numeric values
  • persist model-request cancellation as model_request_cancelled and expose trace status as CANCELLED, matching ModelInteraction/metrics semantics
  • normalize already-persisted cancellation events from the previous writer without a data migration
  • add regression coverage for real tool-turn trace replay, sparse lineage metadata, usage projection, and cancellation status

Validation ownership

  • writers own completeness of model/tool observability facts
  • history/trace readers validate only values they must parse and identities they must correlate
  • opaque trace strings such as purpose and observation id are forwarded rather than restricted by the reader
  • public ExecutionTraceItem is a transport DTO and no longer duplicates model-specific payload validation
  • cursor bounds, run/segment coordinates, duplicate lifecycle events, malformed numeric metadata, and ambiguous tool correlation remain fail-closed

Compatibility

  • no database schema or migration changes
  • no package or MCP version changes
  • no public API removals
  • existing sequence-only tool events become readable without migration
  • existing cancellation records written as model_request_failed are normalized to CANCELLED when they carry the previous writer's cancellation signature

Validation

  • static review completed against master@0765c40546f4c870055cd063435e0cdae89357c4
  • targeted regression coverage added in the existing test suite
  • latest PR CI passed on 3dc5db727ed846449538702e156c0f53e051bb46

@ice-black-tea ice-black-tea changed the title fix(ai): align trace request lineage contract fix(ai): simplify trace validation and align request status Sep 23, 2026
@ice-black-tea
ice-black-tea merged commit 5897094 into master Sep 23, 2026
12 checks passed
@ice-black-tea
ice-black-tea deleted the fix/ai-trace-lineage-contract branch September 23, 2026 04:32
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.

1 participant