Skip to content

feat: add createdAt/updatedAt/completedAt to OperationStatus#17

Merged
khaliqgant merged 1 commit intomainfrom
feat/operation-timestamps-clean
Mar 28, 2026
Merged

feat: add createdAt/updatedAt/completedAt to OperationStatus#17
khaliqgant merged 1 commit intomainfrom
feat/operation-timestamps-clean

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Mar 28, 2026

Adds timestamp fields to OperationStatus so consumers can track operation lifecycle timing.

Go server (internal/relayfile/store.go):

  • createdAt — set on operation creation
  • updatedAt — set on every status change (ack, replay, writeback)
  • 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

This unblocks MSD's review-audit service which needs operation timing for audit reports.

2 files changed. No new dependencies.


Open with Devin

@khaliqgant khaliqgant force-pushed the feat/operation-timestamps-clean branch from 997bf47 to 46dbfe7 Compare March 28, 2026 10:47
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines +152 to +154
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
CompletedAt *string `json:"completedAt,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 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.
Open in Devin Review

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
@khaliqgant khaliqgant force-pushed the feat/operation-timestamps-clean branch from 46dbfe7 to 1995df9 Compare March 28, 2026 10:50
Copy link
Copy Markdown
Member Author

@khaliqgant khaliqgant left a comment

Choose a reason for hiding this comment

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

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.

@khaliqgant khaliqgant merged commit 29dc954 into main Mar 28, 2026
6 checks passed
@khaliqgant khaliqgant deleted the feat/operation-timestamps-clean branch March 28, 2026 10:56
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