feat: add createdAt/updatedAt/completedAt to OperationStatus#17
feat: add createdAt/updatedAt/completedAt to OperationStatus#17khaliqgant merged 1 commit intomainfrom
Conversation
997bf47 to
46dbfe7
Compare
| CreatedAt string `json:"createdAt,omitempty"` | ||
| UpdatedAt string `json:"updatedAt,omitempty"` | ||
| CompletedAt *string `json:"completedAt,omitempty"` |
There was a problem hiding this comment.
🔴 OpenAPI spec has additionalProperties: false but new fields were not added, breaking API contract
The OperationStatusResponse schema in openapi/relayfile-v1.openapi.yaml:2076-2109 declares additionalProperties: false, but the new createdAt, updatedAt, and completedAt JSON fields added to the Go struct (internal/relayfile/store.go:152-154) are not declared in the OpenAPI spec. Because additionalProperties: false is set, any strict OpenAPI validator (including the project's own conformance suite at scripts/conformance.ts) will reject API responses that include these new fields. The spec must be updated to list createdAt, updatedAt, and completedAt as properties of OperationStatusResponse.
Prompt for agents
Add the three new timestamp fields to the OperationStatusResponse schema in openapi/relayfile-v1.openapi.yaml. After the existing correlationId property (around line 2109), add:
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
completedAt:
type: string
format: date-time
nullable: true
This is needed because the schema uses additionalProperties: false (line 2078), so any fields returned in the JSON response that are not declared in the schema will cause conformance test failures and strict validator rejections.
Was this helpful? React with 👍 or 👎 to provide feedback.
Go server (internal/relayfile/store.go): - createdAt: set on operation creation - updatedAt: set on every status change - completedAt: set when status reaches succeeded/failed/dead_lettered, cleared on replay TypeScript SDK (packages/sdk/typescript/src/types.ts): - Added createdAt?, updatedAt?, completedAt? to OperationStatusResponse Python SDK (packages/sdk/python/src/relayfile/types.py): - Added created_at, updated_at, completed_at to OperationStatusResponse OpenAPI spec (openapi/relayfile-v1.openapi.yaml): - Added createdAt, updatedAt, completedAt fields to OperationStatusResponse Contract checks (scripts/check-contract-surface.sh): - Python SDK parity: verifies core types exist in Python - Cross-SDK field parity: verifies timestamp fields in both TS and Python - Runs in CI on every PR via contract.yml
46dbfe7 to
1995df9
Compare
khaliqgant
left a comment
There was a problem hiding this comment.
Already addressed — createdAt, updatedAt, and completedAt were added to the OpenAPI spec's OperationStatusResponse schema in the same commit (see openapi/relayfile-v1.openapi.yaml). The contract CI check passes, which validates these fields against both the spec and the SDKs.
Adds timestamp fields to
OperationStatusso consumers can track operation lifecycle timing.Go server (
internal/relayfile/store.go):createdAt— set on operation creationupdatedAt— set on every status change (ack, replay, writeback)completedAt— set when status reaches succeeded/failed/dead_lettered, cleared on replayTypeScript SDK (
packages/sdk/typescript/src/types.ts):createdAt?,updatedAt?,completedAt?toOperationStatusResponseThis unblocks MSD's review-audit service which needs operation timing for audit reports.
2 files changed. No new dependencies.