Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ check also refuse to run on `main`.
Opt-in database and authenticated provider proofs require separate isolated
fixtures; skipped proofs are not passing evidence.

### Temporal workflow histories

The worker test suite runs the production workflow bundle in Temporal's
time-skipping test server. To refresh the synthetic replay fixtures, run:

```sh
npm run temporal:record-histories -w @space/worker
```

Only re-record histories in the same change as a replay-safe `patched()`
workflow change. Never replace a failing fixture merely to make replay pass;
first decide whether the workflow change needs a new patch marker and add a
regression test for the behavior.

In the maintainers' source repository, `npm run check:claims` compares the
version, licence, Node requirement, runtime list and key constants stated in
the README and `docs/` with the code, and rejects unqualified latency or
Expand Down
4 changes: 3 additions & 1 deletion apps/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"start": "node dist/worker.js",
"build": "tsc -p tsconfig.json",
"check": "tsc -p tsconfig.json --noEmit",
"test": "vitest run"
"test": "vitest run",
"temporal:record-histories": "node tests/record-temporal-histories.mjs"
},
"dependencies": {
"@space/codex-app-server": "0.2.5",
Expand All @@ -26,6 +27,7 @@
"undici": "8.10.2"
},
"devDependencies": {
"@temporalio/testing": "1.24.0",
"typescript": "^5.9.3",
"vitest": "^4.1.12"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"events": [
{
"eventId": "1",
"eventTime": "2046-10-19T02:54:49.641Z",
"eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_STARTED",
"workflowExecutionStartedEventAttributes": {
"workflowType": {
"name": "codexAppServerTurnWorkflow"
},
"taskQueue": {
"name": "space-real-workflows",
"kind": "TASK_QUEUE_KIND_NORMAL"
},
"input": {
"payloads": [
{
"metadata": {
"encoding": "anNvbi9wbGFpbg=="
},
"data": "eyJyb29tSWQiOiJyb29tLXRlc3QtMSIsInBhbmVJZCI6InBhbmUtdGVzdC0xIiwicHJvbXB0IjoiUnVuIHRoZSBkZXRlcm1pbmlzdGljIHRlc3QuIiwidHJhY2VJZCI6InRyYWNlLXRlc3QtMSIsInByb3ZpZGVySWQiOm51bGx9"
}
]
},
"workflowExecutionTimeout": "315360000s",
"workflowRunTimeout": "315360000s",
"workflowTaskTimeout": "10s",
"originalExecutionRunId": "963667df-21fd-4421-8dce-7e78da573030",
"identity": "identity:fixture",
"firstExecutionRunId": "963667df-21fd-4421-8dce-7e78da573030",
"attempt": 1,
"firstWorkflowTaskBackoff": "0s",
"header": {}
}
},
{
"eventId": "2",
"eventTime": "2046-10-19T02:54:49.641Z",
"eventType": "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED",
"workflowTaskScheduledEventAttributes": {
"taskQueue": {
"name": "space-real-workflows",
"kind": "TASK_QUEUE_KIND_NORMAL"
},
"startToCloseTimeout": "10s",
"attempt": 1
}
},
{
"eventId": "3",
"eventTime": "2046-10-19T02:54:49.641Z",
"eventType": "EVENT_TYPE_WORKFLOW_TASK_STARTED",
"workflowTaskStartedEventAttributes": {
"scheduledEventId": "2",
"identity": "identity:fixture",
"historySizeBytes": "420"
}
},
{
"eventId": "4",
"eventTime": "2046-10-19T02:54:51.856Z",
"eventType": "EVENT_TYPE_WORKFLOW_TASK_COMPLETED",
"workflowTaskCompletedEventAttributes": {
"scheduledEventId": "2",
"identity": "identity:fixture",
"binaryChecksum": "@temporalio/worker@1.24.0+31bfb993235c5a0ab72d09c13910d93f0257b8b47833e90a5400b2cb388007b3",
"sdkMetadata": {
"coreUsedFlags": [
1,
2,
3
],
"sdkName": "temporal-typescript",
"sdkVersion": "1.24.0"
},
"meteringMetadata": {}
}
},
{
"eventId": "5",
"eventTime": "2046-10-19T02:54:51.856Z",
"eventType": "EVENT_TYPE_ACTIVITY_TASK_SCHEDULED",
"activityTaskScheduledEventAttributes": {
"activityId": "1",
"activityType": {
"name": "runCodexAppServerTurn"
},
"taskQueue": {
"name": "space-real-workflows",
"kind": "TASK_QUEUE_KIND_NORMAL"
},
"header": {},
"input": {
"payloads": [
{
"metadata": {
"encoding": "anNvbi9wbGFpbg=="
},
"data": "eyJyb29tSWQiOiJyb29tLXRlc3QtMSIsInBhbmVJZCI6InBhbmUtdGVzdC0xIiwicHJvbXB0IjoiUnVuIHRoZSBkZXRlcm1pbmlzdGljIHRlc3QuIiwidHJhY2VJZCI6InRyYWNlLXRlc3QtMSIsInByb3ZpZGVySWQiOm51bGx9"
}
]
},
"scheduleToCloseTimeout": "315360000s",
"scheduleToStartTimeout": "315360000s",
"startToCloseTimeout": "86400s",
"heartbeatTimeout": "15s",
"workflowTaskCompletedEventId": "3",
"retryPolicy": {
"initialInterval": "1s",
"backoffCoefficient": 2,
"maximumInterval": "100s",
"maximumAttempts": 5
}
}
},
{
"eventId": "6",
"eventTime": "2046-10-19T02:54:51.856Z",
"eventType": "EVENT_TYPE_ACTIVITY_TASK_STARTED",
"activityTaskStartedEventAttributes": {
"scheduledEventId": "5",
"identity": "identity:fixture",
"attempt": 1
}
},
{
"eventId": "7",
"eventTime": "2046-10-19T02:54:51.865Z",
"eventType": "EVENT_TYPE_ACTIVITY_TASK_COMPLETED",
"activityTaskCompletedEventAttributes": {
"result": {
"payloads": [
{
"metadata": {
"encoding": "anNvbi9wbGFpbg=="
},
"data": "eyJ3b3JrZmxvd0lkIjoidHVybi13b3JrZmxvdy0xIiwic3RhdHVzIjoiQ09NUExFVEVEIiwicm9vbUFnZW50T3V0Y29tZSI6eyJzdGF0dXMiOiJWRVJJRklFRCIsImV4ZWN1dGVkQWN0aW9uQ291bnQiOjEsInN0YXR1c1JlYXNvbiI6InN0dWIifX0="
}
]
},
"scheduledEventId": "5",
"startedEventId": "6",
"identity": "identity:fixture"
}
},
{
"eventId": "8",
"eventTime": "2046-10-19T02:54:51.865Z",
"eventType": "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED",
"workflowTaskScheduledEventAttributes": {
"taskQueue": {
"name": "space-real-workflows",
"kind": "TASK_QUEUE_KIND_NORMAL"
},
"startToCloseTimeout": "10s",
"attempt": 1
}
},
{
"eventId": "9",
"eventTime": "2046-10-19T02:54:51.866Z",
"eventType": "EVENT_TYPE_WORKFLOW_TASK_STARTED",
"workflowTaskStartedEventAttributes": {
"scheduledEventId": "8",
"identity": "identity:fixture",
"historySizeBytes": "1254"
}
},
{
"eventId": "10",
"eventTime": "2046-10-19T02:54:51.880Z",
"eventType": "EVENT_TYPE_WORKFLOW_TASK_COMPLETED",
"workflowTaskCompletedEventAttributes": {
"scheduledEventId": "8",
"identity": "identity:fixture",
"binaryChecksum": "@temporalio/worker@1.24.0+31bfb993235c5a0ab72d09c13910d93f0257b8b47833e90a5400b2cb388007b3",
"sdkMetadata": {},
"meteringMetadata": {}
}
},
{
"eventId": "11",
"eventTime": "2046-10-19T02:54:51.880Z",
"eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED",
"workflowExecutionCompletedEventAttributes": {
"result": {
"payloads": [
{
"metadata": {
"encoding": "anNvbi9wbGFpbg=="
},
"data": "eyJ3b3JrZmxvd0lkIjoidHVybi13b3JrZmxvdy0xIiwic3RhdHVzIjoiQ09NUExFVEVEIiwicm9vbUFnZW50T3V0Y29tZSI6eyJzdGF0dXMiOiJWRVJJRklFRCIsImV4ZWN1dGVkQWN0aW9uQ291bnQiOjEsInN0YXR1c1JlYXNvbiI6InN0dWIifX0="
}
]
},
"workflowTaskCompletedEventId": "9"
}
}
]
}
Loading