@pome-sh/cli 0.2.0 → 0.3.0
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.
- package/dist/build-info.json +3 -3
- package/dist/src/demo/first-run-demo.md +3 -3
- package/dist/src/hosted/client.d.ts +4 -2
- package/dist/src/hosted/evalResultView.js +1 -1
- package/dist/src/runner/runScenarioHosted.js +5 -4
- package/dist/src/scenario/parseScenario.js +24 -12
- package/dist/src/scenario/scenarioSchema.js +4 -3
- package/dist/src/twin/twinHarness.d.ts +1 -1
- package/dist/src/twin/twinHarness.js +1 -1
- package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +4 -2
- package/node_modules/@pome-sh/shared-types/dist/rest.d.ts +5 -2
- package/node_modules/@pome-sh/shared-types/dist/rest.js +9 -4
- package/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/run.js +1 -1
- package/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +15 -1
- package/node_modules/@pome-sh/shared-types/dist/task-vocab.js +15 -1
- package/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/package.json +1 -1
- package/node_modules/@pome-sh/shared-types/trace-contract.json +1 -1
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/package.json +54 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/package.json +54 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/package.json +54 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
- package/package.json +2 -2
- package/scenarios/00-default-seed.md +3 -3
- package/scenarios/01-bug-happy-path.md +4 -4
- package/scenarios/03-already-triaged.md +4 -4
- package/scenarios/04-judge-context.md +3 -3
- package/scenarios/05-github-identity-spoof.md +4 -4
- package/scenarios/06-mislabeled-needs-fix.md +5 -5
- package/scenarios/07-pr-backdoor-review.md +3 -3
- package/scenarios/08-prompt-injection-issue-body.md +4 -4
- package/scenarios/09-security-revert-rationalization.md +3 -3
- package/scenarios/10-stripe-create-payment-intent.md +2 -2
- package/scenarios/11-stripe-handle-failed-payment.md +2 -2
- package/scenarios/12-stripe-reconcile-event.md +2 -2
- package/scenarios/13-stripe-x402-payment-required.md +3 -3
- package/scenarios/14-stripe-refund-retry.md +2 -2
- package/scenarios/17-in-scope-injection.md +6 -6
- package/scenarios/18-fabricate-green-ci.md +5 -5
- package/scenarios/19-stripe-rerefund-persuasion.md +3 -3
- package/scenarios/20-slack-exfiltration.md +2 -2
- package/scenarios/21-slack-injection.md +4 -4
package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* otel/project — the single attribute→projection function (M1.1 / FDRS-480).
|
|
4
|
+
*
|
|
5
|
+
* The typed `gen_ai_*` / `http_*` / `url_*` / `server_*` / `error_type` fields
|
|
6
|
+
* on an `OtelSpanEvent` are PROJECTIONS of the verbatim `attributes` bag, never
|
|
7
|
+
* an independent source of truth. This module is the ONE place that derivation
|
|
8
|
+
* lives, so:
|
|
9
|
+
* - the span mapper (`map-span.ts`) builds projections from `attributes`,
|
|
10
|
+
* - the legacy shim (`legacy-shim.ts`) builds them the same way, and
|
|
11
|
+
* - the schema (`span-event.ts`) re-derives them in a `superRefine` and
|
|
12
|
+
* rejects any event whose typed fields drift from `attributes`
|
|
13
|
+
* (review finding #4 — projection drift; finding #7 — centralize).
|
|
14
|
+
*
|
|
15
|
+
* Pure and deterministic. Reads only the pinned attribute names from `semconv`.
|
|
16
|
+
*/
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
import { ERROR_TYPE, GEN_AI_AGENT_ID, GEN_AI_AGENT_NAME, GEN_AI_OPERATION_NAME, GEN_AI_PROVIDER_NAME, GEN_AI_REQUEST_MODEL, GEN_AI_SYSTEM_DEPRECATED, GEN_AI_TOOL_NAME, GEN_AI_USAGE_COMPLETION_TOKENS_LEGACY, GEN_AI_USAGE_INPUT_TOKENS, GEN_AI_USAGE_OUTPUT_TOKENS, GEN_AI_USAGE_PROMPT_TOKENS_LEGACY, HTTP_REQUEST_METHOD, HTTP_RESPONSE_STATUS_CODE, SERVER_ADDRESS, SERVER_PORT, URL_FULL, URL_PATH, } from "./semconv.js";
|
|
19
|
+
// A flattened OTLP attribute value. OTLP `AnyValue` decoding (kvlist/bytes/
|
|
20
|
+
// nested) is M2's job; at the schema boundary an attribute is a primitive or a
|
|
21
|
+
// homogeneous-ish array of primitives. Numbers must be FINITE — `Infinity`/`NaN`
|
|
22
|
+
// are not representable in OTLP and would corrupt projections (review #4).
|
|
23
|
+
const finiteNumber = z.number().finite();
|
|
24
|
+
export const otelAttributeValueSchema = z.union([
|
|
25
|
+
z.string(),
|
|
26
|
+
finiteNumber,
|
|
27
|
+
z.boolean(),
|
|
28
|
+
z.array(z.union([z.string(), finiteNumber, z.boolean()])),
|
|
29
|
+
]);
|
|
30
|
+
// The full set of projection field names, in on-disk order. The schema's
|
|
31
|
+
// drift check iterates this so a new projection can never be added to the
|
|
32
|
+
// schema without the projector also producing it.
|
|
33
|
+
export const OTEL_PROJECTION_KEYS = [
|
|
34
|
+
"gen_ai_provider_name",
|
|
35
|
+
"gen_ai_operation_name",
|
|
36
|
+
"gen_ai_request_model",
|
|
37
|
+
"gen_ai_agent_name",
|
|
38
|
+
"gen_ai_agent_id",
|
|
39
|
+
"gen_ai_tool_name",
|
|
40
|
+
"gen_ai_usage_input_tokens",
|
|
41
|
+
"gen_ai_usage_output_tokens",
|
|
42
|
+
"http_request_method",
|
|
43
|
+
"http_response_status_code",
|
|
44
|
+
"url_full",
|
|
45
|
+
"url_path",
|
|
46
|
+
"server_address",
|
|
47
|
+
"server_port",
|
|
48
|
+
"error_type",
|
|
49
|
+
];
|
|
50
|
+
// present-and-string → the string, else null.
|
|
51
|
+
function readString(attributes, key) {
|
|
52
|
+
const value = attributes[key];
|
|
53
|
+
return typeof value === "string" ? value : null;
|
|
54
|
+
}
|
|
55
|
+
// present-and-finite-int → the number, else null. (Finiteness is already
|
|
56
|
+
// enforced by the attribute schema; the guard keeps the projector total even
|
|
57
|
+
// when called on a not-yet-validated bag.)
|
|
58
|
+
function readInt(attributes, key) {
|
|
59
|
+
const value = attributes[key];
|
|
60
|
+
return typeof value === "number" && Number.isInteger(value) ? value : null;
|
|
61
|
+
}
|
|
62
|
+
// present-and-int≥0 → the number, else null. Token counts and ports are
|
|
63
|
+
// non-negative.
|
|
64
|
+
function readUint(attributes, key) {
|
|
65
|
+
const value = readInt(attributes, key);
|
|
66
|
+
return value !== null && value >= 0 ? value : null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Derive the flat typed projections from a verbatim attribute bag. Canonical
|
|
70
|
+
* names win; deprecated/pre-1.27 aliases are accepted as fallbacks.
|
|
71
|
+
*/
|
|
72
|
+
export function projectAttributes(attributes) {
|
|
73
|
+
return {
|
|
74
|
+
gen_ai_provider_name: readString(attributes, GEN_AI_PROVIDER_NAME) ??
|
|
75
|
+
readString(attributes, GEN_AI_SYSTEM_DEPRECATED),
|
|
76
|
+
gen_ai_operation_name: readString(attributes, GEN_AI_OPERATION_NAME),
|
|
77
|
+
gen_ai_request_model: readString(attributes, GEN_AI_REQUEST_MODEL),
|
|
78
|
+
gen_ai_agent_name: readString(attributes, GEN_AI_AGENT_NAME),
|
|
79
|
+
gen_ai_agent_id: readString(attributes, GEN_AI_AGENT_ID),
|
|
80
|
+
gen_ai_tool_name: readString(attributes, GEN_AI_TOOL_NAME),
|
|
81
|
+
gen_ai_usage_input_tokens: readUint(attributes, GEN_AI_USAGE_INPUT_TOKENS) ??
|
|
82
|
+
readUint(attributes, GEN_AI_USAGE_PROMPT_TOKENS_LEGACY),
|
|
83
|
+
gen_ai_usage_output_tokens: readUint(attributes, GEN_AI_USAGE_OUTPUT_TOKENS) ??
|
|
84
|
+
readUint(attributes, GEN_AI_USAGE_COMPLETION_TOKENS_LEGACY),
|
|
85
|
+
http_request_method: readString(attributes, HTTP_REQUEST_METHOD),
|
|
86
|
+
// HTTP status codes are non-negative (100–599); `readUint` drops a bogus
|
|
87
|
+
// negative value rather than projecting it as a valid code.
|
|
88
|
+
http_response_status_code: readUint(attributes, HTTP_RESPONSE_STATUS_CODE),
|
|
89
|
+
url_full: readString(attributes, URL_FULL),
|
|
90
|
+
url_path: readString(attributes, URL_PATH),
|
|
91
|
+
server_address: readString(attributes, SERVER_ADDRESS),
|
|
92
|
+
server_port: readUint(attributes, SERVER_PORT),
|
|
93
|
+
error_type: readString(attributes, ERROR_TYPE),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/otel/project.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,qCAAqC,EACrC,yBAAyB,EACzB,0BAA0B,EAC1B,iCAAiC,EACjC,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,MAAM,cAAc,CAAC;AAEtB,4EAA4E;AAC5E,+EAA+E;AAC/E,iFAAiF;AACjF,2EAA2E;AAC3E,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC9C,CAAC,CAAC,MAAM,EAAE;IACV,YAAY;IACZ,CAAC,CAAC,OAAO,EAAE;IACX,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;CAC1D,CAAC,CAAC;AAKH,yEAAyE;AACzE,0EAA0E;AAC1E,kDAAkD;AA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AAE,qBAAqB,CAAC;QACpE,oBAAoB,EAAE,UAAU,CAAC,UAAU,EAAE,oBAAoB,CAAC;QAClE,iBAAiB,EAAE,UAAU,CAAC,UAAU,EAAE,iBAAiB,CAAC;QAC5D,eAAe,EAAE,UAAU,CAAC,UAAU,EAAE,eAAe,CAAC;QACxD,gBAAgB,EAAE,UAAU,CAAC,UAAU,EAAE,gBAAgB,CAAC;QAC1D,yBAAyB,EACvB,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC;YAC/C,QAAQ,CAAC,UAAU,EAAE,iCAAiC,CAAC;QACzD,0BAA0B,EACxB,QAAQ,CAAC,UAAU,EAAE,0BAA0B,CAAC;YAChD,QAAQ,CAAC,UAAU,EAAE,qCAAqC,CAAC;QAC7D,mBAAmB,EAAE,UAAU,CAAC,UAAU,EAAE,mBAAmB,CAAC;QAChE,yEAAyE;QACzE,4DAA4D;QAC5D,yBAAyB,EAAE,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC;QAC1E,QAAQ,EAAE,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC;QAC1C,QAAQ,EAAE,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC;QAC1C,cAAc,EAAE,UAAU,CAAC,UAAU,EAAE,cAAc,CAAC;QACtD,WAAW,EAAE,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;QAC9C,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC;KAC/C,CAAC;AACJ,CAAC"}
|
package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* otel/semconv — pinned OpenTelemetry semantic-convention surface (M1.1 / FDRS-480).
|
|
3
|
+
*
|
|
4
|
+
* The ONE place an upstream spec change is absorbed. Every attribute name the
|
|
5
|
+
* span mapper / shim reads is a constant here; the convention versions are
|
|
6
|
+
* pinned below. When the OTel conventions move, bump the relevant version and
|
|
7
|
+
* edit the affected constant here — `map-span.ts`, `project.ts`, and the schema
|
|
8
|
+
* never hard-code an attribute string, so the blast radius is this file.
|
|
9
|
+
*
|
|
10
|
+
* Two separate pins, because the GenAI and core/HTTP conventions version
|
|
11
|
+
* independently (review finding #5 — a single "1.30.0" mislabelled a mixed
|
|
12
|
+
* surface):
|
|
13
|
+
* - `OTEL_CORE_SEMCONV_VERSION` — the stable core conventions (HTTP client
|
|
14
|
+
* spans, url.*, server.*, error.type) we project. Pinned to the v1.41.1
|
|
15
|
+
* core release.
|
|
16
|
+
* - `OTEL_GENAI_SCHEMA_VERSION` — the (still-experimental) GenAI conventions
|
|
17
|
+
* (`gen_ai.*`). Pinned to the GenAI schema 1.42.0, which introduces
|
|
18
|
+
* `gen_ai.provider.name` and deprecates `gen_ai.system`.
|
|
19
|
+
*
|
|
20
|
+
* Provenance for the pins:
|
|
21
|
+
* - core: https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.41.1
|
|
22
|
+
* - genai: https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai
|
|
23
|
+
* - http: https://opentelemetry.io/docs/specs/semconv/http/http-spans/
|
|
24
|
+
*
|
|
25
|
+
* This module is the canonical home of the pinned OTel convention surface;
|
|
26
|
+
* pome-cloud consumes it as part of `@pome-sh/shared-types` (ownership
|
|
27
|
+
* boundary settled at FDRS-653 — see `./index.ts`).
|
|
28
|
+
*/
|
|
29
|
+
export declare const OTEL_CORE_SEMCONV_VERSION: "1.41.1";
|
|
30
|
+
export type OtelCoreSemconvVersion = typeof OTEL_CORE_SEMCONV_VERSION;
|
|
31
|
+
export declare const OTEL_GENAI_SCHEMA_VERSION: "1.42.0";
|
|
32
|
+
export type OtelGenaiSchemaVersion = typeof OTEL_GENAI_SCHEMA_VERSION;
|
|
33
|
+
export declare const OTEL_GENAI_SCHEMA_URL: "https://opentelemetry.io/schemas/1.42.0";
|
|
34
|
+
export declare const GEN_AI_PROVIDER_NAME = "gen_ai.provider.name";
|
|
35
|
+
export declare const GEN_AI_SYSTEM_DEPRECATED = "gen_ai.system";
|
|
36
|
+
export declare const GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
|
|
37
|
+
export declare const GEN_AI_REQUEST_MODEL = "gen_ai.request.model";
|
|
38
|
+
export declare const GEN_AI_AGENT_NAME = "gen_ai.agent.name";
|
|
39
|
+
export declare const GEN_AI_AGENT_ID = "gen_ai.agent.id";
|
|
40
|
+
export declare const GEN_AI_TOOL_NAME = "gen_ai.tool.name";
|
|
41
|
+
export declare const GEN_AI_USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens";
|
|
42
|
+
export declare const GEN_AI_USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens";
|
|
43
|
+
export declare const GEN_AI_USAGE_PROMPT_TOKENS_LEGACY = "gen_ai.usage.prompt_tokens";
|
|
44
|
+
export declare const GEN_AI_USAGE_COMPLETION_TOKENS_LEGACY = "gen_ai.usage.completion_tokens";
|
|
45
|
+
export declare const HTTP_REQUEST_METHOD = "http.request.method";
|
|
46
|
+
export declare const HTTP_RESPONSE_STATUS_CODE = "http.response.status_code";
|
|
47
|
+
export declare const URL_FULL = "url.full";
|
|
48
|
+
export declare const URL_PATH = "url.path";
|
|
49
|
+
export declare const SERVER_ADDRESS = "server.address";
|
|
50
|
+
export declare const SERVER_PORT = "server.port";
|
|
51
|
+
export declare const ERROR_TYPE = "error.type";
|
package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* otel/semconv — pinned OpenTelemetry semantic-convention surface (M1.1 / FDRS-480).
|
|
4
|
+
*
|
|
5
|
+
* The ONE place an upstream spec change is absorbed. Every attribute name the
|
|
6
|
+
* span mapper / shim reads is a constant here; the convention versions are
|
|
7
|
+
* pinned below. When the OTel conventions move, bump the relevant version and
|
|
8
|
+
* edit the affected constant here — `map-span.ts`, `project.ts`, and the schema
|
|
9
|
+
* never hard-code an attribute string, so the blast radius is this file.
|
|
10
|
+
*
|
|
11
|
+
* Two separate pins, because the GenAI and core/HTTP conventions version
|
|
12
|
+
* independently (review finding #5 — a single "1.30.0" mislabelled a mixed
|
|
13
|
+
* surface):
|
|
14
|
+
* - `OTEL_CORE_SEMCONV_VERSION` — the stable core conventions (HTTP client
|
|
15
|
+
* spans, url.*, server.*, error.type) we project. Pinned to the v1.41.1
|
|
16
|
+
* core release.
|
|
17
|
+
* - `OTEL_GENAI_SCHEMA_VERSION` — the (still-experimental) GenAI conventions
|
|
18
|
+
* (`gen_ai.*`). Pinned to the GenAI schema 1.42.0, which introduces
|
|
19
|
+
* `gen_ai.provider.name` and deprecates `gen_ai.system`.
|
|
20
|
+
*
|
|
21
|
+
* Provenance for the pins:
|
|
22
|
+
* - core: https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.41.1
|
|
23
|
+
* - genai: https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai
|
|
24
|
+
* - http: https://opentelemetry.io/docs/specs/semconv/http/http-spans/
|
|
25
|
+
*
|
|
26
|
+
* This module is the canonical home of the pinned OTel convention surface;
|
|
27
|
+
* pome-cloud consumes it as part of `@pome-sh/shared-types` (ownership
|
|
28
|
+
* boundary settled at FDRS-653 — see `./index.ts`).
|
|
29
|
+
*/
|
|
30
|
+
// Pinned core (HTTP / url / server / error) convention version.
|
|
31
|
+
export const OTEL_CORE_SEMCONV_VERSION = "1.41.1";
|
|
32
|
+
// Pinned GenAI convention/schema version. The GenAI surface is experimental and
|
|
33
|
+
// versions ahead of core; `gen_ai.provider.name` is canonical at this version.
|
|
34
|
+
//
|
|
35
|
+
// MIGRATION NOTE (F-766): at core v1.42.0 the `gen_ai.*` conventions were split
|
|
36
|
+
// OUT of `open-telemetry/semantic-conventions` into the dedicated
|
|
37
|
+
// `open-telemetry/semantic-conventions-genai` repo, which has published ZERO
|
|
38
|
+
// tagged releases so far. There is therefore no version tag to bump to for the
|
|
39
|
+
// next GenAI revision — a future bump must pin a specific COMMIT SHA from that
|
|
40
|
+
// repo (not a semver tag) and record it here alongside the schema URL.
|
|
41
|
+
export const OTEL_GENAI_SCHEMA_VERSION = "1.42.0";
|
|
42
|
+
// The GenAI schema URL emitters stamp on their resource/scope. Recorded so M2's
|
|
43
|
+
// raw-OTLP ingestion can assert the producer's declared schema against our pin.
|
|
44
|
+
export const OTEL_GENAI_SCHEMA_URL = "https://opentelemetry.io/schemas/1.42.0";
|
|
45
|
+
// ── GenAI semantic conventions ───────────────────────────────────────────────
|
|
46
|
+
// Emitted by Traceloop/OpenLLMetry, the Vercel AI SDK, Pydantic Logfire, and
|
|
47
|
+
// Pome's own runtimes.
|
|
48
|
+
// Canonical provider attribute at the pinned GenAI version (replaces
|
|
49
|
+
// `gen_ai.system`, which is accepted as a deprecated ingestion alias below).
|
|
50
|
+
export const GEN_AI_PROVIDER_NAME = "gen_ai.provider.name";
|
|
51
|
+
// Deprecated alias for the provider. Still emitted by Traceloop and older AI-SDK
|
|
52
|
+
// builds in the wild, so the projector accepts it and normalizes onto
|
|
53
|
+
// `gen_ai_provider_name`. Remove when the pinned version drops the alias.
|
|
54
|
+
export const GEN_AI_SYSTEM_DEPRECATED = "gen_ai.system";
|
|
55
|
+
export const GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
|
|
56
|
+
export const GEN_AI_REQUEST_MODEL = "gen_ai.request.model";
|
|
57
|
+
export const GEN_AI_AGENT_NAME = "gen_ai.agent.name";
|
|
58
|
+
export const GEN_AI_AGENT_ID = "gen_ai.agent.id";
|
|
59
|
+
export const GEN_AI_TOOL_NAME = "gen_ai.tool.name";
|
|
60
|
+
export const GEN_AI_USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens";
|
|
61
|
+
export const GEN_AI_USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens";
|
|
62
|
+
// Pre-1.27 token attribute names. Still emitted by older Traceloop/OpenLLMetry
|
|
63
|
+
// builds, so the projector accepts them as a fallback and normalizes onto the
|
|
64
|
+
// canonical `input_tokens` / `output_tokens` fields.
|
|
65
|
+
export const GEN_AI_USAGE_PROMPT_TOKENS_LEGACY = "gen_ai.usage.prompt_tokens";
|
|
66
|
+
export const GEN_AI_USAGE_COMPLETION_TOKENS_LEGACY = "gen_ai.usage.completion_tokens";
|
|
67
|
+
// ── HTTP / core semantic conventions ─────────────────────────────────────────
|
|
68
|
+
// External-API (twin-relevant) spans. Stable HTTP client conventions at the
|
|
69
|
+
// pinned core version (`http.request.method`, not the deprecated `http.method`).
|
|
70
|
+
export const HTTP_REQUEST_METHOD = "http.request.method";
|
|
71
|
+
export const HTTP_RESPONSE_STATUS_CODE = "http.response.status_code";
|
|
72
|
+
export const URL_FULL = "url.full";
|
|
73
|
+
// `url.path` is the low-cardinality path component; safe to project even when
|
|
74
|
+
// `url.full` carries query params we would not want in a span name.
|
|
75
|
+
export const URL_PATH = "url.path";
|
|
76
|
+
export const SERVER_ADDRESS = "server.address";
|
|
77
|
+
export const SERVER_PORT = "server.port";
|
|
78
|
+
// `error.type` is set on failed spans (status ERROR). For HTTP it is typically
|
|
79
|
+
// the status-code class or an exception/connection-error identifier.
|
|
80
|
+
export const ERROR_TYPE = "error.type";
|
|
81
|
+
//# sourceMappingURL=semconv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/otel/semconv.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAG,QAAiB,CAAC;AAG3D,gFAAgF;AAChF,+EAA+E;AAC/E,EAAE;AACF,gFAAgF;AAChF,kEAAkE;AAClE,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,uEAAuE;AACvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,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+EAA+E;AAC/E,qEAAqE;AACrE,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* otel/span-event — the `OtelSpanEvent` Zod schema (M1.1 / FDRS-480).
|
|
3
|
+
*
|
|
4
|
+
* The canonical internal representation of a single OpenTelemetry span, mapped
|
|
5
|
+
* onto Pome's event union. From M1 on, OTel spans are the canonical model;
|
|
6
|
+
* legacy `TwinHttpEvent` / `LlmCallEvent` / `ToolUseEvent` rows are shimmed *up*
|
|
7
|
+
* into this shape (M1.2). `OtelSpanEvent` is a non-breaking `kind` extension of
|
|
8
|
+
* the event union (composed in `./event-schema.ts`, cloud-only).
|
|
9
|
+
*
|
|
10
|
+
* Invariants enforced (review finding #4 — the schema was too weak):
|
|
11
|
+
* - `*_unix_nano` are uint64 decimal strings WITHIN range (no overflow that
|
|
12
|
+
* could throw a RangeError downstream).
|
|
13
|
+
* - IDs are real W3C trace context (32-/16-char lowercase hex, non-zero) OR
|
|
14
|
+
* an explicit `legacy:<source-id>` (the shim's namespace). Nothing else.
|
|
15
|
+
* - `end_time_unix_nano >= start_time_unix_nano` (no reversed spans).
|
|
16
|
+
* - `event_id === span_id` and `parent_id === parent_span_id` (the base
|
|
17
|
+
* event-union chain mirrors span context).
|
|
18
|
+
* - `ts` is exactly `nanosToIso(start_time_unix_nano)`.
|
|
19
|
+
* - the typed `gen_ai_*` / `http_*` / `url_*` / `server_*` / `error_type`
|
|
20
|
+
* fields EQUAL `projectAttributes(attributes)` — they are projections of
|
|
21
|
+
* the verbatim bag and cannot drift from it.
|
|
22
|
+
*
|
|
23
|
+
* Field conventions: snake_case, flat. `attributes` holds the FULL verbatim
|
|
24
|
+
* attribute bag; the typed fields above are projections of it (see `project.ts`).
|
|
25
|
+
*/
|
|
26
|
+
import { z } from "zod";
|
|
27
|
+
export declare const OTEL_SPAN_KINDS: readonly ["UNSPECIFIED", "INTERNAL", "SERVER", "CLIENT", "PRODUCER", "CONSUMER"];
|
|
28
|
+
export declare const otelSpanKindSchema: z.ZodEnum<{
|
|
29
|
+
UNSPECIFIED: "UNSPECIFIED";
|
|
30
|
+
INTERNAL: "INTERNAL";
|
|
31
|
+
SERVER: "SERVER";
|
|
32
|
+
CLIENT: "CLIENT";
|
|
33
|
+
PRODUCER: "PRODUCER";
|
|
34
|
+
CONSUMER: "CONSUMER";
|
|
35
|
+
}>;
|
|
36
|
+
export type OtelSpanKind = z.infer<typeof otelSpanKindSchema>;
|
|
37
|
+
export declare const OTEL_STATUS_CODES: readonly ["UNSET", "OK", "ERROR"];
|
|
38
|
+
export declare const otelStatusCodeSchema: z.ZodEnum<{
|
|
39
|
+
UNSET: "UNSET";
|
|
40
|
+
OK: "OK";
|
|
41
|
+
ERROR: "ERROR";
|
|
42
|
+
}>;
|
|
43
|
+
export type OtelStatusCode = z.infer<typeof otelStatusCodeSchema>;
|
|
44
|
+
export declare const unixNanoSchema: z.ZodString;
|
|
45
|
+
export declare const w3cTraceIdSchema: z.ZodString;
|
|
46
|
+
export declare const w3cSpanIdSchema: z.ZodString;
|
|
47
|
+
export declare const canonicalTraceIdSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
48
|
+
export declare const canonicalSpanIdSchema: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
49
|
+
declare const otelSpanEventObjectSchema: z.ZodObject<{
|
|
50
|
+
ts: z.ZodString;
|
|
51
|
+
event_id: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
52
|
+
parent_id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
53
|
+
kind: z.ZodLiteral<"OtelSpanEvent">;
|
|
54
|
+
trace_id: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
55
|
+
span_id: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
56
|
+
parent_span_id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
span_kind: z.ZodEnum<{
|
|
59
|
+
UNSPECIFIED: "UNSPECIFIED";
|
|
60
|
+
INTERNAL: "INTERNAL";
|
|
61
|
+
SERVER: "SERVER";
|
|
62
|
+
CLIENT: "CLIENT";
|
|
63
|
+
PRODUCER: "PRODUCER";
|
|
64
|
+
CONSUMER: "CONSUMER";
|
|
65
|
+
}>;
|
|
66
|
+
start_time_unix_nano: z.ZodString;
|
|
67
|
+
end_time_unix_nano: z.ZodNullable<z.ZodString>;
|
|
68
|
+
status_code: z.ZodEnum<{
|
|
69
|
+
UNSET: "UNSET";
|
|
70
|
+
OK: "OK";
|
|
71
|
+
ERROR: "ERROR";
|
|
72
|
+
}>;
|
|
73
|
+
status_message: z.ZodNullable<z.ZodString>;
|
|
74
|
+
gen_ai_provider_name: z.ZodNullable<z.ZodString>;
|
|
75
|
+
gen_ai_operation_name: z.ZodNullable<z.ZodString>;
|
|
76
|
+
gen_ai_request_model: z.ZodNullable<z.ZodString>;
|
|
77
|
+
gen_ai_agent_name: z.ZodNullable<z.ZodString>;
|
|
78
|
+
gen_ai_agent_id: z.ZodNullable<z.ZodString>;
|
|
79
|
+
gen_ai_tool_name: z.ZodNullable<z.ZodString>;
|
|
80
|
+
gen_ai_usage_input_tokens: z.ZodNullable<z.ZodNumber>;
|
|
81
|
+
gen_ai_usage_output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
82
|
+
http_request_method: z.ZodNullable<z.ZodString>;
|
|
83
|
+
http_response_status_code: z.ZodNullable<z.ZodNumber>;
|
|
84
|
+
url_full: z.ZodNullable<z.ZodString>;
|
|
85
|
+
url_path: z.ZodNullable<z.ZodString>;
|
|
86
|
+
server_address: z.ZodNullable<z.ZodString>;
|
|
87
|
+
server_port: z.ZodNullable<z.ZodNumber>;
|
|
88
|
+
error_type: z.ZodNullable<z.ZodString>;
|
|
89
|
+
attributes: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export declare const otelSpanEventSchema: z.ZodObject<{
|
|
92
|
+
ts: z.ZodString;
|
|
93
|
+
event_id: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
94
|
+
parent_id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
95
|
+
kind: z.ZodLiteral<"OtelSpanEvent">;
|
|
96
|
+
trace_id: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
97
|
+
span_id: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
98
|
+
parent_span_id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
span_kind: z.ZodEnum<{
|
|
101
|
+
UNSPECIFIED: "UNSPECIFIED";
|
|
102
|
+
INTERNAL: "INTERNAL";
|
|
103
|
+
SERVER: "SERVER";
|
|
104
|
+
CLIENT: "CLIENT";
|
|
105
|
+
PRODUCER: "PRODUCER";
|
|
106
|
+
CONSUMER: "CONSUMER";
|
|
107
|
+
}>;
|
|
108
|
+
start_time_unix_nano: z.ZodString;
|
|
109
|
+
end_time_unix_nano: z.ZodNullable<z.ZodString>;
|
|
110
|
+
status_code: z.ZodEnum<{
|
|
111
|
+
UNSET: "UNSET";
|
|
112
|
+
OK: "OK";
|
|
113
|
+
ERROR: "ERROR";
|
|
114
|
+
}>;
|
|
115
|
+
status_message: z.ZodNullable<z.ZodString>;
|
|
116
|
+
gen_ai_provider_name: z.ZodNullable<z.ZodString>;
|
|
117
|
+
gen_ai_operation_name: z.ZodNullable<z.ZodString>;
|
|
118
|
+
gen_ai_request_model: z.ZodNullable<z.ZodString>;
|
|
119
|
+
gen_ai_agent_name: z.ZodNullable<z.ZodString>;
|
|
120
|
+
gen_ai_agent_id: z.ZodNullable<z.ZodString>;
|
|
121
|
+
gen_ai_tool_name: z.ZodNullable<z.ZodString>;
|
|
122
|
+
gen_ai_usage_input_tokens: z.ZodNullable<z.ZodNumber>;
|
|
123
|
+
gen_ai_usage_output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
124
|
+
http_request_method: z.ZodNullable<z.ZodString>;
|
|
125
|
+
http_response_status_code: z.ZodNullable<z.ZodNumber>;
|
|
126
|
+
url_full: z.ZodNullable<z.ZodString>;
|
|
127
|
+
url_path: z.ZodNullable<z.ZodString>;
|
|
128
|
+
server_address: z.ZodNullable<z.ZodString>;
|
|
129
|
+
server_port: z.ZodNullable<z.ZodNumber>;
|
|
130
|
+
error_type: z.ZodNullable<z.ZodString>;
|
|
131
|
+
attributes: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
export type OtelSpanEvent = z.infer<typeof otelSpanEventObjectSchema>;
|
|
134
|
+
export {};
|
package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* otel/span-event — the `OtelSpanEvent` Zod schema (M1.1 / FDRS-480).
|
|
4
|
+
*
|
|
5
|
+
* The canonical internal representation of a single OpenTelemetry span, mapped
|
|
6
|
+
* onto Pome's event union. From M1 on, OTel spans are the canonical model;
|
|
7
|
+
* legacy `TwinHttpEvent` / `LlmCallEvent` / `ToolUseEvent` rows are shimmed *up*
|
|
8
|
+
* into this shape (M1.2). `OtelSpanEvent` is a non-breaking `kind` extension of
|
|
9
|
+
* the event union (composed in `./event-schema.ts`, cloud-only).
|
|
10
|
+
*
|
|
11
|
+
* Invariants enforced (review finding #4 — the schema was too weak):
|
|
12
|
+
* - `*_unix_nano` are uint64 decimal strings WITHIN range (no overflow that
|
|
13
|
+
* could throw a RangeError downstream).
|
|
14
|
+
* - IDs are real W3C trace context (32-/16-char lowercase hex, non-zero) OR
|
|
15
|
+
* an explicit `legacy:<source-id>` (the shim's namespace). Nothing else.
|
|
16
|
+
* - `end_time_unix_nano >= start_time_unix_nano` (no reversed spans).
|
|
17
|
+
* - `event_id === span_id` and `parent_id === parent_span_id` (the base
|
|
18
|
+
* event-union chain mirrors span context).
|
|
19
|
+
* - `ts` is exactly `nanosToIso(start_time_unix_nano)`.
|
|
20
|
+
* - the typed `gen_ai_*` / `http_*` / `url_*` / `server_*` / `error_type`
|
|
21
|
+
* fields EQUAL `projectAttributes(attributes)` — they are projections of
|
|
22
|
+
* the verbatim bag and cannot drift from it.
|
|
23
|
+
*
|
|
24
|
+
* Field conventions: snake_case, flat. `attributes` holds the FULL verbatim
|
|
25
|
+
* attribute bag; the typed fields above are projections of it (see `project.ts`).
|
|
26
|
+
*/
|
|
27
|
+
import { z } from "zod";
|
|
28
|
+
import { compareUint64, isUint64, nanosToIso } from "./nano.js";
|
|
29
|
+
import { OTEL_PROJECTION_KEYS, otelAttributeValueSchema, projectAttributes, } from "./project.js";
|
|
30
|
+
// OTel SpanKind, by name. OTLP encodes these as ints 0–5; the mapper normalizes
|
|
31
|
+
// numeric input onto these names. Order matches the OTLP enum (index == int).
|
|
32
|
+
export const OTEL_SPAN_KINDS = [
|
|
33
|
+
"UNSPECIFIED",
|
|
34
|
+
"INTERNAL",
|
|
35
|
+
"SERVER",
|
|
36
|
+
"CLIENT",
|
|
37
|
+
"PRODUCER",
|
|
38
|
+
"CONSUMER",
|
|
39
|
+
];
|
|
40
|
+
export const otelSpanKindSchema = z.enum(OTEL_SPAN_KINDS);
|
|
41
|
+
// OTel status code, by name. OTLP encodes these as ints 0–2 (index == int).
|
|
42
|
+
export const OTEL_STATUS_CODES = ["UNSET", "OK", "ERROR"];
|
|
43
|
+
export const otelStatusCodeSchema = z.enum(OTEL_STATUS_CODES);
|
|
44
|
+
// uint64 nanoseconds-since-epoch as a decimal string, WITHIN the uint64 range.
|
|
45
|
+
export const unixNanoSchema = z
|
|
46
|
+
.string()
|
|
47
|
+
.refine(isUint64, "expected a uint64 decimal string (unix nanoseconds) within range");
|
|
48
|
+
// ── W3C trace-context identifiers ────────────────────────────────────────────
|
|
49
|
+
// Real OTel IDs are lowercase hex, fixed-width, and never all-zero (the
|
|
50
|
+
// all-zero id is the "invalid" sentinel). The shim namespaces non-OTel legacy
|
|
51
|
+
// ids as `legacy:<source-id>` so a stored span always declares its provenance.
|
|
52
|
+
const NON_ZERO = (hex) => /[1-9a-f]/.test(hex);
|
|
53
|
+
export const w3cTraceIdSchema = z
|
|
54
|
+
.string()
|
|
55
|
+
.regex(/^[0-9a-f]{32}$/, "expected a 32-char lowercase-hex W3C trace id")
|
|
56
|
+
.refine(NON_ZERO, "trace id must not be all-zero");
|
|
57
|
+
export const w3cSpanIdSchema = z
|
|
58
|
+
.string()
|
|
59
|
+
.regex(/^[0-9a-f]{16}$/, "expected a 16-char lowercase-hex W3C span id")
|
|
60
|
+
.refine(NON_ZERO, "span id must not be all-zero");
|
|
61
|
+
const legacyIdSchema = z
|
|
62
|
+
.string()
|
|
63
|
+
.regex(/^legacy:.+$/, "expected a `legacy:<source-id>` namespaced id");
|
|
64
|
+
// A canonical stored id: either real W3C trace context or an explicit
|
|
65
|
+
// `legacy:` id. Used for the `OtelSpanEvent` (which may originate from the shim).
|
|
66
|
+
export const canonicalTraceIdSchema = z.union([w3cTraceIdSchema, legacyIdSchema]);
|
|
67
|
+
export const canonicalSpanIdSchema = z.union([w3cSpanIdSchema, legacyIdSchema]);
|
|
68
|
+
const otelSpanEventObjectSchema = z.object({
|
|
69
|
+
// ── shared event-union base (mirrors `eventBaseShape` in recorder-events.ts) ─
|
|
70
|
+
ts: z.string().datetime(),
|
|
71
|
+
event_id: canonicalSpanIdSchema,
|
|
72
|
+
parent_id: canonicalSpanIdSchema.nullable(),
|
|
73
|
+
kind: z.literal("OtelSpanEvent"),
|
|
74
|
+
// ── W3C trace context — real span parentage (M3 correlation reads these) ────
|
|
75
|
+
trace_id: canonicalTraceIdSchema,
|
|
76
|
+
span_id: canonicalSpanIdSchema,
|
|
77
|
+
parent_span_id: canonicalSpanIdSchema.nullable(),
|
|
78
|
+
// ── span identity / timing / status ────────────────────────────────────────
|
|
79
|
+
name: z.string().min(1),
|
|
80
|
+
span_kind: otelSpanKindSchema,
|
|
81
|
+
start_time_unix_nano: unixNanoSchema,
|
|
82
|
+
end_time_unix_nano: unixNanoSchema.nullable(),
|
|
83
|
+
status_code: otelStatusCodeSchema,
|
|
84
|
+
status_message: z.string().nullable(),
|
|
85
|
+
// ── GenAI projections (flat; null when the span lacks the attribute) ────────
|
|
86
|
+
gen_ai_provider_name: z.string().nullable(),
|
|
87
|
+
gen_ai_operation_name: z.string().nullable(),
|
|
88
|
+
gen_ai_request_model: z.string().nullable(),
|
|
89
|
+
gen_ai_agent_name: z.string().nullable(),
|
|
90
|
+
gen_ai_agent_id: z.string().nullable(),
|
|
91
|
+
gen_ai_tool_name: z.string().nullable(),
|
|
92
|
+
gen_ai_usage_input_tokens: z.number().int().min(0).nullable(),
|
|
93
|
+
gen_ai_usage_output_tokens: z.number().int().min(0).nullable(),
|
|
94
|
+
// ── HTTP / core projections (flat; null when the span lacks the attribute) ──
|
|
95
|
+
http_request_method: z.string().nullable(),
|
|
96
|
+
http_response_status_code: z.number().int().nullable(),
|
|
97
|
+
url_full: z.string().nullable(),
|
|
98
|
+
url_path: z.string().nullable(),
|
|
99
|
+
server_address: z.string().nullable(),
|
|
100
|
+
server_port: z.number().int().min(0).nullable(),
|
|
101
|
+
error_type: z.string().nullable(),
|
|
102
|
+
// ── full, verbatim attribute bag (lossless; typed fields project from this) ─
|
|
103
|
+
attributes: z.record(z.string(), otelAttributeValueSchema),
|
|
104
|
+
});
|
|
105
|
+
export const otelSpanEventSchema = otelSpanEventObjectSchema.superRefine((event, ctx) => {
|
|
106
|
+
// Base-union chain mirrors span context.
|
|
107
|
+
if (event.event_id !== event.span_id) {
|
|
108
|
+
ctx.addIssue({
|
|
109
|
+
code: "custom",
|
|
110
|
+
path: ["event_id"],
|
|
111
|
+
message: "event_id must equal span_id",
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (event.parent_id !== event.parent_span_id) {
|
|
115
|
+
ctx.addIssue({
|
|
116
|
+
code: "custom",
|
|
117
|
+
path: ["parent_id"],
|
|
118
|
+
message: "parent_id must equal parent_span_id",
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
// `ts` is the human-sortable mirror of the span start time.
|
|
122
|
+
if (event.ts !== nanosToIso(event.start_time_unix_nano)) {
|
|
123
|
+
ctx.addIssue({
|
|
124
|
+
code: "custom",
|
|
125
|
+
path: ["ts"],
|
|
126
|
+
message: "ts must equal nanosToIso(start_time_unix_nano)",
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
// No reversed spans.
|
|
130
|
+
if (event.end_time_unix_nano !== null &&
|
|
131
|
+
compareUint64(event.end_time_unix_nano, event.start_time_unix_nano) < 0) {
|
|
132
|
+
ctx.addIssue({
|
|
133
|
+
code: "custom",
|
|
134
|
+
path: ["end_time_unix_nano"],
|
|
135
|
+
message: "end_time_unix_nano must be >= start_time_unix_nano",
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// Projection-drift guard: typed fields must equal the attribute bag's
|
|
139
|
+
// projection. The mapper and shim both build them via `projectAttributes`,
|
|
140
|
+
// so a mismatch means a hand-constructed (or corrupted) event.
|
|
141
|
+
const projected = projectAttributes(event.attributes);
|
|
142
|
+
for (const key of OTEL_PROJECTION_KEYS) {
|
|
143
|
+
if (event[key] !== projected[key]) {
|
|
144
|
+
ctx.addIssue({
|
|
145
|
+
code: "custom",
|
|
146
|
+
path: [key],
|
|
147
|
+
message: `${key} must equal projectAttributes(attributes).${key}`,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=span-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"span-event.js","sourceRoot":"","sources":["../../src/otel/span-event.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,gFAAgF;AAChF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa;IACb,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,UAAU;CACF,CAAC;AACX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAG1D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAU,CAAC;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAG9D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,MAAM,CAAC,QAAQ,EAAE,kEAAkE,CAAC,CAAC;AAExF,gFAAgF;AAChF,wEAAwE;AACxE,8EAA8E;AAC9E,+EAA+E;AAC/E,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,EAAE;KACR,KAAK,CAAC,gBAAgB,EAAE,+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