@flowrensic/node 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +52 -16
  2. package/package.json +13 -2
package/README.md CHANGED
@@ -1,26 +1,62 @@
1
1
  # @flowrensic/node
2
2
 
3
- Publishes what a Temporal worker knows about every activity attempt.
3
+ Replay the histories your workflows already produced, against the code you are
4
+ about to ship.
4
5
 
5
- import { createAttemptSink, flowrensicInterceptor } from '@flowrensic/node';
6
+ Flowrensic keeps what a Temporal server recorded. This package fetches a set and
7
+ replays it through Temporal's own replayer, in your tests, against your
8
+ checkout. Histories in a repo go stale on the next deploy and nobody can say
9
+ which are still safe to delete.
6
10
 
7
- const sink = createAttemptSink({ baseUrl: 'https://flowrensic.example' });
11
+ Server: `flowrensic/flowrensic` on Docker Hub. Temporal is the supported engine.
8
12
 
9
- const worker = await Worker.create({
10
- // ...
11
- interceptors: { activity: [flowrensicInterceptor(sink, namespaceId)] },
12
- });
13
+ ## Replay
13
14
 
14
- `namespaceId` is the namespace this worker is pointed at, from `RegisterNamespace`. Prod, staging,
15
- qa and ci report separately because each is its own environment in the catalog.
15
+ docker run --rm -v "$PWD/replay-set:/out" --entrypoint /flowrensic \
16
+ flowrensic/flowrensic replay fetch \
17
+ --server http://flowrensic:8080 --workflow-type OrderWorkflow --out /out
16
18
 
17
- One event per attempt, not per activity: the gap between the two is the retry count. Everything
18
- Temporal's own OpenTelemetry spans throw away is carried here, including the attempt number, the
19
- workflow type, the task queue and the failure classification.
19
+ ```ts
20
+ import { replayFetchedSet } from '@flowrensic/node';
20
21
 
21
- Activity inbound only. Emitting from a workflow interceptor would be non-determinism in the product
22
- that sells determinism analysis.
22
+ const report = await replayFetchedSet({
23
+ dir: 'replay-set',
24
+ workflowsPath: require.resolve('./workflows'),
25
+ codeVersion: process.env.GIT_SHA,
26
+ baseUrl: 'http://flowrensic:8080',
27
+ });
23
28
 
24
- Publishing failures are swallowed. Telemetry must never fail the activity it measures.
29
+ if (report.failed > 0) throw new Error(`${report.failed} histories no longer replay`);
30
+ ```
25
31
 
26
- Not published to npm yet.
32
+ Verdicts go back against the run and the version, so a break points at the
33
+ change that caused it.
34
+
35
+ The server picks the set: recent histories, versions still running somewhere,
36
+ outcomes that differ. Newest-ten on a healthy workflow type is ten completions
37
+ and not one failure.
38
+
39
+ ## Activity telemetry
40
+
41
+ ```ts
42
+ import { createAttemptSink, flowrensicInterceptor } from '@flowrensic/node';
43
+
44
+ const sink = createAttemptSink({ baseUrl: 'http://flowrensic:8080' });
45
+
46
+ const worker = await Worker.create({
47
+ // ...
48
+ interceptors: { activity: [flowrensicInterceptor(sink, namespaceId)] },
49
+ });
50
+ ```
51
+
52
+ One event per attempt, not per activity: the gap between the two is the retry
53
+ count. `namespaceId` comes from `RegisterNamespace`, so each environment reports
54
+ separately.
55
+
56
+ Activity inbound only, and publishing failures are swallowed. Telemetry must
57
+ never fail the activity it measures.
58
+
59
+ ## Peers
60
+
61
+ `@temporalio/worker`, `@temporalio/common`, `@temporalio/activity`, 1.24 or
62
+ newer. The replay has to run on the same SDK your workers do.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowrensic/node",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Replay runner and activity interceptor for Temporal workers, for use with Flowrensic.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,5 +40,16 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "types": "./dist/index.d.ts"
43
+ "types": "./dist/index.d.ts",
44
+ "keywords": [
45
+ "temporal",
46
+ "temporalio",
47
+ "durable-execution",
48
+ "workflow",
49
+ "replay",
50
+ "non-determinism",
51
+ "testing",
52
+ "flowrensic"
53
+ ],
54
+ "homepage": "https://flowrensic.com"
44
55
  }