{"_id":"@buildtovalue/replay","name":"@buildtovalue/replay","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@buildtovalue/replay","version":"1.0.0","description":"Headless conformance-checking for BPMN replay (Handoff 7B): streaming XES 2.0 / CSV parsing, one-pass frequency/time pre-aggregation, token-replay fitness with deviation detection, and variant extraction — all over an ABSTRACT injected graph {nodes, edges","license":"Apache-2.0","type":"module","sideEffects":false,"engines":{"node":">=20"},"main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","exports":{".":{"types":"./dist/esm/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"keywords":["bpmn","process-mining","conformance","xes","replay"],"repository":{"type":"git","url":"git+https://github.com/danzeroum/bpmn.git","directory":"packages/replay"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.build.json && tsc -p tsconfig.cjs.json && node ../../scripts/write-cjs-package.mjs dist/cjs","typecheck":"tsc -p tsconfig.json --noEmit"},"_id":"@buildtovalue/replay@1.0.0","bugs":{"url":"https://github.com/danzeroum/bpmn/issues"},"homepage":"https://github.com/danzeroum/bpmn#readme","_integrity":"sha512-JQCfxgIyg5ZQ7/Cq+ZGWbcHrOUCiuJDFCzw2ny6fAQvBHcsGJdEeBEQMzlNhCiYJu46UQurA2CTLzFODyHOnKw==","_resolved":"C:\\Users\\danni\\AppData\\Local\\Temp\\28f3661c7d4df3273d8b3a0dedb3e8f8\\buildtovalue-replay-1.0.0.tgz","_from":"file:buildtovalue-replay-1.0.0.tgz","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-JQCfxgIyg5ZQ7/Cq+ZGWbcHrOUCiuJDFCzw2ny6fAQvBHcsGJdEeBEQMzlNhCiYJu46UQurA2CTLzFODyHOnKw==","shasum":"a8362273d70c8c544a3dec8074b2ba2464556a76","tarball":"https://registry.npmjs.org/@buildtovalue/replay/-/replay-1.0.0.tgz","fileCount":40,"unpackedSize":93761,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDpLx/7BhjMzEEX7wFIy64IhKyc+8BWSmj2cov9GD/8NAiA0N1OpGxa5WYu7FXOKN1Y3dH4DRD3myhFeGLvhOXs28Q=="}]},"_npmUser":{"name":"danzeroum","email":"danzeroum@gmail.com"},"directories":{},"maintainers":[{"name":"danzeroum","email":"danzeroum@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/replay_1.0.0_1784345273940_0.9738623228382566"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-18T03:27:53.802Z","1.0.0":"2026-07-18T03:27:54.089Z","modified":"2026-07-18T03:27:54.297Z"},"maintainers":[{"name":"danzeroum","email":"danzeroum@gmail.com"}],"description":"Headless conformance-checking for BPMN replay (Handoff 7B): streaming XES 2.0 / CSV parsing, one-pass frequency/time pre-aggregation, token-replay fitness with deviation detection, and variant extraction — all over an ABSTRACT injected graph {nodes, edges","homepage":"https://github.com/danzeroum/bpmn#readme","keywords":["bpmn","process-mining","conformance","xes","replay"],"repository":{"type":"git","url":"git+https://github.com/danzeroum/bpmn.git","directory":"packages/replay"},"bugs":{"url":"https://github.com/danzeroum/bpmn/issues"},"license":"Apache-2.0","readme":"# @buildtovalue/replay\r\n\r\nHeadless **conformance checking** for BPMN replay — \"does reality behave the way\r\nthe model says?\". Streaming XES 2.0 / CSV parsing, one-pass frequency/time\r\npre-aggregation, **token-replay fitness** (never alignments), deviation\r\ndetection and variant extraction.\r\n\r\n**Imports nothing from the ecosystem — not even `@buildtovalue/core`.** It replays\r\nover an *abstract graph injected by the caller*, so the same machinery works on\r\na BPMN model, a future DMN DRD, or a fake graph. **Zero dependencies.**\r\n\r\n```ts\r\nimport { parseXes, aggregate } from '@buildtovalue/replay';\r\n\r\nconst traces = parseXes(xesText); // or parseCsv(csvText, { case, activity, timestamp })\r\nconst graph = {\r\n  nodes: [{ id: 'brief', name: 'Coletar briefing' }, /* … */],\r\n  edges: [{ id: 'e1', source: 'brief', target: 'gate' }, /* … */],\r\n};\r\n\r\nconst log = aggregate(graph, traces);\r\nlog.fitness;          // { fitness, conformingCases, totalCases, … }\r\nlog.edges;            // per-edge frequency + avg time (heatmap thickness)\r\nlog.nodes;            // per-node frequency + avg sojourn (⌀ chip)\r\nlog.bottleneckNodeId; // slowest node (GARGALO)\r\nlog.deviations;       // transitions with no model edge (▲ DESVIO · N casos)\r\nlog.variants;         // top sequences by share (▶ Reproduzir)\r\nlog.unmapped;         // log activities with no matching node\r\n```\r\n\r\n## Design constraints (cercas §0)\r\n\r\n- **Token-replay fitness only** — a transition move with no corresponding model\r\n  edge is a deviation; `fitness = fit moves / total moves`. Optimal alignments\r\n  (A\\* over model×log) are process-mining literature and stay **out** (recorded\r\n  in `pendencias.md`).\r\n- **One pass, no DOM** — `aggregate` computes every frequency/time in a single\r\n  O(n) sweep; a 100k-event log aggregates in well under 2s (`tests/benchmark.test.ts`).\r\n  Rendering (Handoff 7B-2) animates only *sampled* variant traces, never one\r\n  token per event.\r\n- **Streaming parse** — XES scans trace-by-trace and CSV reads line-by-line into\r\n  compact tuples; the full log is never materialized as a rich object graph.\r\n\r\n## Matching\r\n\r\nEvents map to nodes by **normalized activity name** (`normalizeName`: trim,\r\nlowercase, collapse whitespace) against each node's `name` (falling back to\r\n`id`). Unmatched activities are reported in `unmapped` and every transition\r\ntouching them counts as a deviation.\r\n\r\n## Decoupling\r\n\r\n`replay` imports only relative paths — pinned by `tests/independence.test.ts` —\r\nand the acid test (`tests/acidez.test.ts`) drives it with a coffee-brewing graph\r\nto prove it knows nothing about BPMN. Integrations with `registry`/`audit`\r\n(bindRun filtering, attaching analysis to a promotion) happen in the host by\r\ninjection, never here.\r\n","readmeFilename":"README.md","_rev":"1-294b58430574e2d233d7b5aa8725899d"}