@pikku/core 0.12.84 → 0.12.86
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/CHANGELOG.md +424 -0
- package/dist/bootstrap-compat/root.d.ts +20 -0
- package/dist/classification/column-form.d.ts +32 -0
- package/dist/classification/column-form.js +42 -0
- package/dist/classification/data-classification.d.ts +64 -0
- package/dist/classification/index.d.ts +13 -0
- package/dist/classification/index.js +2 -0
- package/dist/classification/secret-value.d.ts +56 -0
- package/dist/classification/secret-value.js +46 -0
- package/dist/crypto-utils.d.ts +1 -1
- package/dist/ecosystem/agent-scorer.d.ts +1 -1
- package/dist/ecosystem/agent.d.ts +4 -1
- package/dist/ecosystem/channel/local.d.ts +2 -0
- package/dist/ecosystem/channel/local.js +2 -0
- package/dist/ecosystem/channel/serverless.d.ts +9 -0
- package/dist/ecosystem/channel/serverless.js +1 -0
- package/dist/ecosystem/channel.d.ts +3 -0
- package/dist/ecosystem/channel.js +1 -0
- package/dist/ecosystem/cli.d.ts +1 -1
- package/dist/ecosystem/cli.js +1 -1
- package/dist/ecosystem/credential.d.ts +1 -0
- package/dist/ecosystem/crypto-utils.d.ts +8 -0
- package/dist/ecosystem/crypto-utils.js +1 -0
- package/dist/ecosystem/dev.d.ts +1 -0
- package/dist/ecosystem/dev.js +1 -0
- package/{src/ecosystem/testing.ts → dist/ecosystem/errors.d.ts} +3 -3
- package/dist/ecosystem/errors.js +2 -0
- package/dist/ecosystem/function.d.ts +1 -1
- package/dist/ecosystem/function.js +1 -1
- package/dist/ecosystem/http.d.ts +3 -1
- package/dist/ecosystem/http.js +3 -1
- package/dist/ecosystem/mcp.d.ts +1 -1
- package/dist/ecosystem/mcp.js +1 -1
- package/dist/ecosystem/middleware.d.ts +2 -1
- package/dist/ecosystem/middleware.js +2 -1
- package/dist/ecosystem/persona.d.ts +4 -2
- package/dist/ecosystem/persona.js +2 -1
- package/dist/ecosystem/queue.d.ts +4 -2
- package/dist/ecosystem/queue.js +3 -1
- package/dist/ecosystem/role.d.ts +1 -0
- package/dist/ecosystem/rpc.d.ts +2 -0
- package/dist/ecosystem/rpc.js +1 -0
- package/dist/ecosystem/scenario.d.ts +8 -2
- package/dist/ecosystem/scenario.js +5 -1
- package/dist/ecosystem/scheduler.d.ts +2 -1
- package/dist/ecosystem/scheduler.js +2 -1
- package/dist/ecosystem/schema.d.ts +2 -1
- package/dist/ecosystem/schema.js +1 -1
- package/dist/ecosystem/scope.d.ts +2 -0
- package/dist/ecosystem/scope.js +1 -0
- package/dist/ecosystem/secret.d.ts +2 -0
- package/dist/ecosystem/secret.js +1 -0
- package/dist/ecosystem/services/local-content.d.ts +2 -1
- package/dist/ecosystem/services/local-content.js +1 -1
- package/dist/ecosystem/services/local-meta.d.ts +1 -0
- package/dist/ecosystem/services/local-meta.js +1 -0
- package/dist/ecosystem/services.d.ts +11 -3
- package/dist/ecosystem/services.js +7 -1
- package/dist/ecosystem/trigger.d.ts +1 -0
- package/dist/ecosystem/trigger.js +1 -1
- package/dist/ecosystem/types.d.ts +6 -3
- package/dist/ecosystem/types.js +3 -2
- package/dist/ecosystem/variable.d.ts +1 -0
- package/dist/ecosystem/virtual-user.d.ts +3 -0
- package/dist/ecosystem/virtual-user.js +3 -0
- package/dist/ecosystem/workflow.d.ts +2 -0
- package/dist/ecosystem/workflow.js +2 -0
- package/dist/errors/index.d.ts +8 -0
- package/dist/errors/index.js +1 -0
- package/dist/errors/serialized-error.d.ts +7 -0
- package/dist/function/function-meta.types.d.ts +139 -0
- package/dist/function/function-runner.d.ts +3 -2
- package/dist/function/function-runner.js +31 -11
- package/dist/function/functions.types.d.ts +10 -2
- package/dist/function/index.d.ts +8 -2
- package/dist/function/index.js +4 -1
- package/dist/function/pikku-request.d.ts +8 -0
- package/dist/function/pikku-request.js +15 -0
- package/dist/middleware/auth-apikey.d.ts +2 -10
- package/dist/middleware/auth-apikey.js +1 -1
- package/dist/middleware/auth-bearer.d.ts +2 -10
- package/dist/middleware/auth-bearer.js +1 -1
- package/dist/middleware/auth-cookie.d.ts +2 -10
- package/dist/middleware/auth-cookie.js +1 -1
- package/dist/middleware/cors.d.ts +5 -11
- package/dist/middleware/cors.js +13 -6
- package/dist/middleware/index.d.ts +3 -0
- package/dist/middleware/index.js +1 -0
- package/dist/middleware/middleware-factories.d.ts +9 -0
- package/dist/middleware/middleware-factories.js +19 -0
- package/dist/middleware/middleware.types.d.ts +27 -0
- package/dist/middleware/middleware.types.js +1 -0
- package/dist/middleware/remote-auth.d.ts +2 -2
- package/dist/middleware/remote-auth.js +1 -1
- package/dist/middleware/telemetry.d.ts +4 -20
- package/dist/middleware/telemetry.js +1 -1
- package/dist/middleware-runner.d.ts +2 -1
- package/dist/pikku-state.d.ts +2 -1
- package/dist/services/audit-service.d.ts +1 -1
- package/dist/services/credential-wire-service.js +1 -1
- package/dist/services/email-service.d.ts +1 -1
- package/dist/services/file-scenario-run-store.d.ts +58 -0
- package/dist/services/file-scenario-run-store.js +214 -0
- package/dist/services/in-memory-workflow-service.d.ts +1 -1
- package/dist/services/index.d.ts +5 -1
- package/dist/services/index.js +3 -0
- package/dist/services/local-secrets.d.ts +1 -1
- package/dist/services/local-secrets.js +1 -1
- package/dist/services/logger.d.ts +7 -7
- package/dist/services/meta-service.d.ts +2 -1
- package/dist/services/scoped-secret-service.d.ts +1 -1
- package/dist/services/secret-service.d.ts +1 -1
- package/dist/services/typed-secret-service.d.ts +16 -2
- package/dist/services/typed-secret-service.js +5 -0
- package/dist/services/webhook-service.d.ts +1 -1
- package/dist/services/workflow-service.d.ts +2 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +1 -0
- package/dist/types/core.types.d.ts +30 -180
- package/dist/types/core.types.js +1 -19
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +1 -0
- package/dist/types/state.types.d.ts +3 -1
- package/dist/utils.d.ts +13 -0
- package/dist/utils.js +2 -0
- package/dist/wirings/addon/addon-runner.d.ts +17 -0
- package/dist/wirings/addon/addon-runner.js +150 -0
- package/dist/wirings/addon/index.d.ts +6 -0
- package/dist/wirings/addon/index.js +3 -0
- package/dist/wirings/addon/remote-addon-auth.d.ts +16 -0
- package/dist/wirings/addon/remote-addon-auth.js +39 -0
- package/dist/wirings/addon/wire-addon.d.ts +80 -0
- package/dist/wirings/addon/wire-addon.js +120 -0
- package/dist/wirings/addon/wire-remote-addon.d.ts +22 -0
- package/dist/wirings/addon/wire-remote-addon.js +11 -0
- package/dist/wirings/agent/agent-prepare.d.ts +3 -3
- package/dist/wirings/agent/agent-prepare.js +1 -1
- package/dist/wirings/agent/agent-runner.js +2 -3
- package/dist/wirings/agent/agent-stream.js +2 -2
- package/dist/wirings/agent/agent-utils.d.ts +13 -0
- package/dist/wirings/agent/agent-utils.js +16 -0
- package/dist/wirings/agent/agent.types.d.ts +3 -2
- package/dist/wirings/agent/index.d.ts +1 -1
- package/dist/wirings/agent/voice-input.js +1 -1
- package/dist/wirings/agent/voice-output.js +1 -1
- package/dist/wirings/agent-scorer/agent-scorer-judge.d.ts +13 -0
- package/dist/wirings/agent-scorer/agent-scorer-judge.js +52 -0
- package/dist/wirings/agent-scorer/agent-scorer.d.ts +7 -1
- package/dist/wirings/agent-scorer/agent-scorer.js +1 -0
- package/dist/wirings/agent-scorer/agent-scorer.types.d.ts +20 -0
- package/dist/wirings/agent-scorer/index.d.ts +1 -1
- package/dist/wirings/channel/channel-common.d.ts +2 -1
- package/dist/wirings/channel/channel-middleware-runner.d.ts +2 -1
- package/dist/wirings/channel/channel.types.d.ts +1 -1
- package/dist/wirings/channel/serverless/index.d.ts +1 -0
- package/dist/wirings/cli/channel/index.d.ts +1 -1
- package/dist/wirings/cli/cli-runner.d.ts +2 -1
- package/dist/wirings/cli/cli-runner.js +4 -1
- package/dist/wirings/cli/cli.types.d.ts +21 -2
- package/dist/wirings/cli/command-parser.js +157 -23
- package/dist/wirings/gateway/gateway.types.d.ts +2 -1
- package/dist/wirings/http/http-runner.d.ts +1 -1
- package/dist/wirings/http/http-runner.js +1 -1
- package/dist/wirings/http/http.types.d.ts +2 -2
- package/dist/wirings/http/index.d.ts +1 -0
- package/dist/wirings/http/index.js +1 -0
- package/dist/wirings/http/pikku-fetch-http-request.js +1 -1
- package/dist/wirings/http/pikku-fetch-http-response.js +2 -2
- package/dist/wirings/mcp/mcp.types.d.ts +1 -1
- package/dist/wirings/persona/index.d.ts +1 -1
- package/dist/wirings/persona/index.js +1 -1
- package/dist/wirings/persona/persona.types.d.ts +14 -0
- package/dist/wirings/queue/queue.types.d.ts +1 -1
- package/dist/wirings/queue/signed-queue-service.d.ts +1 -1
- package/dist/wirings/rpc/index.d.ts +0 -6
- package/dist/wirings/rpc/index.js +0 -3
- package/dist/wirings/rpc/remote-addon-auth.d.ts +1 -1
- package/dist/wirings/rpc/remote-addon-auth.js +1 -1
- package/dist/wirings/rpc/rpc-runner.js +2 -2
- package/dist/wirings/rpc/wire-addon.d.ts +1 -1
- package/dist/wirings/scheduler/scheduler.types.d.ts +2 -1
- package/dist/wirings/scope/index.d.ts +1 -0
- package/dist/wirings/scope/index.js +1 -0
- package/dist/wirings/secret/secret.types.d.ts +10 -0
- package/dist/wirings/secret/validate-secret-definitions.js +2 -0
- package/dist/wirings/variable/validate-variable-definitions.js +2 -0
- package/dist/wirings/variable/variable.types.d.ts +9 -0
- package/dist/wirings/virtual-user/index.d.ts +1 -1
- package/dist/wirings/virtual-user/index.js +1 -1
- package/dist/wirings/virtual-user/prepare-virtual-user-run.d.ts +1 -1
- package/dist/wirings/virtual-user/virtual-user-derive.d.ts +1 -1
- package/dist/wirings/workflow/graph/graph-node.d.ts +9 -2
- package/dist/wirings/workflow/graph/graph-node.js +2 -0
- package/dist/wirings/workflow/graph/graph-runner.d.ts +1 -0
- package/dist/wirings/workflow/graph/graph-runner.js +283 -31
- package/dist/wirings/workflow/graph/workflow-graph.types.d.ts +16 -1
- package/dist/wirings/workflow/index.d.ts +2 -0
- package/dist/wirings/workflow/index.js +1 -0
- package/dist/wirings/workflow/pikku-scenario-service.d.ts +14 -4
- package/dist/wirings/workflow/pikku-scenario-service.js +44 -16
- package/dist/wirings/workflow/pikku-workflow-service.d.ts +2 -1
- package/dist/wirings/workflow/pikku-workflow-service.js +3 -4
- package/dist/wirings/workflow/run-timeline.d.ts +1 -1
- package/dist/wirings/workflow/scenario-run.types.d.ts +171 -0
- package/dist/wirings/workflow/scenario-run.types.js +1 -0
- package/dist/wirings/workflow/scenario-step-guards.d.ts +1 -2
- package/dist/wirings/workflow/scenario-step-guards.js +0 -8
- package/dist/wirings/workflow/scenario-step.types.d.ts +27 -12
- package/dist/wirings/workflow/workflow-approval.js +2 -1
- package/dist/wirings/workflow/workflow-run-engine.types.d.ts +2 -1
- package/dist/wirings/workflow/workflow.types.d.ts +2 -1
- package/knowledge/decisions/index.md +2 -0
- package/knowledge/decisions/internals/a-scenario-step-template-is-offered-unfilled.md +1 -1
- package/knowledge/decisions/internals/a-secret-that-fails-to-decrypt-fails-the-whole-read.md +1 -1
- package/knowledge/decisions/internals/a-virtual-user-run-is-not-a-workflow-and-not-a-queued-job.md +2 -2
- package/knowledge/decisions/internals/a-wall-clock-threshold-is-a-load-test-in-disguise.md +6 -6
- package/knowledge/decisions/internals/a-workflow-wire-is-built-from-the-run-not-from-the-rpc-service.md +1 -1
- package/knowledge/decisions/internals/addon-singleton-services-are-cached-per-namespace-not-per-package.md +1 -1
- package/knowledge/decisions/internals/addon-workflow-names-are-prefixed-with-the-consumer-namespace.md +1 -1
- package/knowledge/decisions/internals/an-addon-scope-root-loses-to-a-root-the-host-already-declares.md +1 -1
- package/knowledge/decisions/internals/channel-message-handlers-accept-three-config-shapes.md +1 -1
- package/knowledge/decisions/internals/channel-middleware-caches-only-statically-resolved-middleware.md +1 -1
- package/knowledge/decisions/internals/channel-user-id-is-persisted-after-onconnect-middleware-runs.md +1 -1
- package/knowledge/decisions/internals/cli-option-names-are-camelcase-in-state-and-kebab-on-the-command-line.md +1 -1
- package/knowledge/decisions/internals/cli-parse-errors-are-routed-by-message-prefix.md +1 -1
- package/knowledge/decisions/internals/cli-unknown-long-options-warn-instead-of-failing.md +1 -1
- package/knowledge/decisions/internals/core-column-form-is-an-axis-of-its-own.md +4 -4
- package/knowledge/decisions/internals/core-data-classification-brand-is-an-optional-property.md +1 -1
- package/knowledge/decisions/internals/core-function-runner-restores-the-wire-fields-it-overwrites.md +3 -3
- package/knowledge/decisions/internals/core-hot-reload-merges-generated-meta-never-replaces-it.md +2 -2
- package/knowledge/decisions/internals/core-hot-reload-owns-its-module-registry.md +2 -2
- package/knowledge/decisions/internals/core-middleware-order-is-scope-then-priority.md +1 -1
- package/knowledge/decisions/internals/core-schema-defaults-apply-on-every-transport.md +1 -1
- package/knowledge/decisions/internals/core-scopes-are-an-and-gate-separate-from-permissions.md +3 -3
- package/knowledge/decisions/internals/gateway-adapters-resolve-lazily-and-are-promise-cached.md +1 -1
- package/knowledge/decisions/internals/gateway-listener-middleware-runs-without-an-rpc-on-the-wire.md +4 -4
- package/knowledge/decisions/internals/gateway-wiring-is-a-meta-wiring-over-http-and-channels.md +1 -1
- package/knowledge/decisions/internals/http-router-matches-normalized-paths-but-returns-registered-ones.md +1 -1
- package/knowledge/decisions/internals/in-a-scenario-a-4xx-is-data-not-an-exception.md +1 -1
- package/knowledge/decisions/internals/in-memory-workflow-history-aliases-the-live-step-object.md +1 -1
- package/knowledge/decisions/internals/index.md +4 -2
- package/knowledge/decisions/internals/istanbul-statement-counts-attach-to-the-start-line-only.md +1 -1
- package/knowledge/decisions/internals/one-project-shape-check-two-validators.md +1 -1
- package/knowledge/decisions/internals/queue-jobs-always-carry-an-explicit-attempts-count.md +1 -1
- package/knowledge/decisions/internals/remote-addons-dispatch-over-http-instead-of-local-meta.md +1 -1
- package/knowledge/decisions/internals/rpc-names-resolve-through-package-scope-before-root.md +1 -1
- package/knowledge/decisions/internals/scenario-given-and-when-are-sugar-but-then-is-not.md +2 -2
- package/knowledge/decisions/internals/scenarios-live-in-files-named-for-them.md +5 -5
- package/knowledge/decisions/internals/the-actor-prompt-says-json-because-of-json-object-mode.md +1 -1
- package/knowledge/decisions/internals/the-api-report-pins-members-not-just-names.md +1 -1
- package/knowledge/decisions/internals/the-ecosystem-entry-point-carries-the-adapter-surface.md +43 -19
- package/knowledge/decisions/internals/the-persona-runtime-is-exported-from-the-persona-entry-point.md +1 -1
- package/knowledge/decisions/internals/the-worker-disposition-is-the-one-that-is-not-testing.md +1 -1
- package/knowledge/decisions/internals/validate-runs-checks-by-precondition.md +3 -3
- package/knowledge/decisions/internals/virtual-user-step-order-comes-from-insertion-order.md +1 -1
- package/knowledge/decisions/internals/webhook-delivery-history-records-every-attempt-best-effort.md +1 -1
- package/knowledge/decisions/internals/wiring-registries-erase-the-generics-their-wire-functions-capture.md +1 -1
- package/knowledge/decisions/internals/workflow-approval-expiry-is-decided-from-a-recorded-deadline.md +1 -1
- package/knowledge/decisions/internals/workflow-core-never-imports-a-browser-driver.md +1 -1
- package/knowledge/decisions/internals/workflow-inline-runs-report-their-run-id-before-they-can-fail.md +1 -1
- package/knowledge/decisions/internals/workflow-invocation-id-is-the-dedupe-key-not-step-id.md +1 -1
- package/knowledge/decisions/internals/workflow-run-capabilities-are-extensions-not-subclasses.md +1 -1
- package/knowledge/decisions/internals/workflow-run-timeline-is-a-pure-fold-over-durable-history.md +1 -1
- package/knowledge/decisions/internals/workflow-scenario-assertions-never-retry-and-record-one-step.md +9 -5
- package/knowledge/decisions/internals/workflow-scenario-hooks-are-a-scenario-only-affordance.md +1 -1
- package/knowledge/decisions/internals/workflow-step-rpc-name-is-provenance-only.md +2 -2
- package/knowledge/decisions/internals/workflow-suspend-and-approval-reasons-are-durable-step-identities.md +1 -1
- package/knowledge/decisions/security/a-function-never-receives-the-secret-service.md +1 -1
- package/knowledge/decisions/security/a-step-runs-the-function-the-workflow-dispatched-it-with.md +1 -1
- package/knowledge/decisions/security/a-virtual-user-is-never-offered-a-step-that-would-forge-its-own-oracle.md +2 -3
- package/knowledge/decisions/security/actor-sign-in-is-proven-by-set-cookie-not-a-non-empty-jar.md +1 -1
- package/knowledge/decisions/security/addon-auth-and-tags-only-tighten.md +1 -1
- package/knowledge/decisions/security/agent-gate-requires-a-session-only-when-auth-is-true.md +1 -1
- package/knowledge/decisions/security/an-approval-answer-outlives-the-run-it-answered.md +3 -3
- package/knowledge/decisions/security/console-addon-privileged-functions-gate-themselves.md +4 -3
- package/knowledge/decisions/security/core-safe-fetch-blocks-ssrf-by-host-literal-not-dns.md +1 -1
- package/knowledge/decisions/security/gateway-middleware-sessions-must-be-bridged-onto-the-wire.md +2 -2
- package/knowledge/decisions/security/global-permissions-and-function-permissions-are-independent-gates.md +1 -1
- package/knowledge/decisions/security/http-request-bodies-are-bounded-before-they-are-buffered.md +2 -2
- package/knowledge/decisions/security/index.md +2 -0
- package/knowledge/decisions/security/mcp-internal-error-details-are-double-gated-on-production.md +1 -1
- package/knowledge/decisions/security/queue-jobs-carry-the-producers-pikku-user-id.md +3 -3
- package/knowledge/decisions/security/remote-addon-tokens-are-client-credentials-not-mesh-trust.md +1 -1
- package/knowledge/decisions/security/scaffold-features-are-authenticated-unless-opted-out.md +2 -2
- package/knowledge/decisions/security/self-authentication-is-declared-not-detected.md +1 -1
- package/knowledge/decisions/security/signed-content-urls-bind-the-request-path.md +2 -2
- package/knowledge/index.md +3 -1
- package/knowledge/questions/channel-middleware-accepts-bare-factories-that-nothing-resolves.md +1 -1
- package/knowledge/questions/index.md +2 -0
- package/package.json +14 -13
- package/run-tests.sh +0 -0
- package/scripts/generate-api-report.d.mts +1 -1
- package/scripts/generate-api-report.mjs +67 -60
- package/scripts/generate-api-report.mts +11 -45
- package/src/api-report.test.ts +70 -1
- package/src/app-alias-surface.test.ts +179 -0
- package/src/app-leaf-surface.test.ts +217 -0
- package/src/bootstrap-compat/root.ts +20 -0
- package/src/{column-form.test.ts → classification/column-form.test.ts} +2 -2
- package/src/{data-classification.ts → classification/data-classification.ts} +1 -5
- package/src/classification/index.ts +38 -0
- package/src/{secret-value.test.ts → classification/secret-value.test.ts} +2 -2
- package/src/{secret-value.ts → classification/secret-value.ts} +1 -6
- package/src/crypto-utils.ts +1 -1
- package/src/dev/reload-meta.test.ts +1 -1
- package/src/errors/index.ts +9 -0
- package/src/errors/serialized-error.ts +9 -0
- package/src/factory-functions.test.ts +4 -2
- package/src/function/function-meta.types.ts +151 -0
- package/src/function/function-runner.test.ts +4 -2
- package/src/function/function-runner.ts +47 -14
- package/src/function/functions.types.ts +11 -7
- package/src/function/index.ts +24 -5
- package/src/function/list.types.ts +1 -3
- package/src/middleware/auth-apikey.ts +4 -2
- package/src/middleware/auth-bearer.test.ts +1 -1
- package/src/middleware/auth-bearer.ts +4 -2
- package/src/middleware/auth-cookie.ts +4 -1
- package/src/middleware/cors.test.ts +126 -5
- package/src/middleware/cors.ts +19 -8
- package/src/middleware/index.ts +16 -0
- package/src/middleware/middleware-factories.ts +62 -0
- package/src/middleware/middleware.types.ts +61 -0
- package/src/middleware/remote-auth.test.ts +1 -1
- package/src/middleware/remote-auth.ts +1 -1
- package/src/middleware/telemetry.ts +4 -2
- package/src/middleware-runner.test.ts +2 -3
- package/src/middleware-runner.ts +2 -2
- package/src/no-root-barrel.test.ts +114 -0
- package/src/permissions.ts +2 -4
- package/src/pikku-state.ts +3 -1
- package/src/public-surface.json +56 -241
- package/src/public-surface.json.README +3 -3
- package/src/public-surface.test.ts +5 -5
- package/src/remote.test.ts +1 -1
- package/src/removed-legacy-exports.test.ts +5 -1
- package/src/services/audit-service.ts +1 -1
- package/src/services/credential-wire-service.ts +1 -1
- package/src/services/email-service.ts +2 -4
- package/src/services/file-scenario-run-store.test.ts +349 -0
- package/src/services/file-scenario-run-store.ts +282 -0
- package/src/services/in-memory-workflow-service.ts +1 -1
- package/src/services/index.ts +13 -1
- package/src/services/local-content-request-handler.ts +1 -2
- package/src/services/local-secrets.ts +1 -1
- package/src/services/logger.ts +7 -7
- package/src/services/meta-service.ts +2 -2
- package/src/services/queue-webhook-service.test.ts +1 -1
- package/src/services/scoped-secret-service.ts +1 -1
- package/src/services/secret-service.ts +1 -1
- package/src/services/typed-secret-service.test.ts +52 -0
- package/src/services/typed-secret-service.ts +26 -2
- package/src/services/webhook-service.ts +1 -1
- package/src/services/workflow-service.ts +2 -1
- package/src/template-alias-surface.test.ts +240 -0
- package/src/testing/index.ts +1 -0
- package/src/types/core.types.ts +33 -285
- package/src/types/index.ts +2 -0
- package/src/types/state.types.ts +6 -5
- package/src/types/typed-credentials.test.ts +72 -0
- package/src/utils.ts +34 -0
- package/src/wirings/{rpc → addon}/addon-scopes.test.ts +1 -1
- package/src/wirings/addon/index.ts +12 -0
- package/src/wirings/{rpc → addon}/remote-addon-auth.ts +4 -1
- package/src/wirings/{rpc → addon}/wire-addon.ts +37 -2
- package/src/wirings/agent/agent-prepare.ts +8 -5
- package/src/wirings/agent/agent-runner.ts +2 -3
- package/src/wirings/agent/agent-stream.ts +2 -3
- package/src/wirings/agent/agent-utils.ts +19 -0
- package/src/wirings/agent/agent.types.ts +3 -3
- package/src/wirings/agent/index.ts +1 -0
- package/src/wirings/agent/voice-input.ts +1 -1
- package/src/wirings/agent/voice-output.test.ts +2 -4
- package/src/wirings/agent/voice-output.ts +1 -1
- package/src/wirings/agent-scorer/agent-scorer-judge.test.ts +145 -0
- package/src/wirings/agent-scorer/agent-scorer-judge.ts +60 -0
- package/src/wirings/agent-scorer/agent-scorer.ts +8 -0
- package/src/wirings/agent-scorer/agent-scorer.types.ts +21 -0
- package/src/wirings/agent-scorer/index.ts +1 -0
- package/src/wirings/channel/channel-common.ts +4 -2
- package/src/wirings/channel/channel-handler.ts +2 -5
- package/src/wirings/channel/channel-middleware-runner.ts +1 -1
- package/src/wirings/channel/channel-rpc.types.ts +1 -5
- package/src/wirings/channel/channel.types.ts +1 -2
- package/src/wirings/channel/local/local-channel-runner.test.ts +1 -2
- package/src/wirings/channel/serverless/index.ts +1 -0
- package/src/wirings/cli/channel/cli-raw-channel-runner.ts +2 -2
- package/src/wirings/cli/channel/index.ts +1 -3
- package/src/wirings/cli/cli-runner.test.ts +1 -1
- package/src/wirings/cli/cli-runner.ts +11 -7
- package/src/wirings/cli/cli.types.ts +24 -3
- package/src/wirings/cli/command-parser.test.ts +388 -1
- package/src/wirings/cli/command-parser.ts +189 -29
- package/src/wirings/gateway/gateway-runner.test.ts +1 -2
- package/src/wirings/gateway/gateway-runner.ts +3 -6
- package/src/wirings/gateway/gateway.types.ts +5 -4
- package/src/wirings/http/http-routes.test.ts +1 -2
- package/src/wirings/http/http-runner-addon-ref.test.ts +238 -0
- package/src/wirings/http/http-runner.test.ts +3 -8
- package/src/wirings/http/http-runner.ts +9 -3
- package/src/wirings/http/http.types.ts +3 -12
- package/src/wirings/http/index.ts +1 -0
- package/src/wirings/http/pikku-fetch-http-request.ts +1 -1
- package/src/wirings/http/pikku-fetch-http-response.ts +3 -2
- package/src/wirings/mcp/mcp-runner.test.ts +1 -1
- package/src/wirings/mcp/mcp.types.ts +1 -2
- package/src/wirings/persona/index.ts +1 -4
- package/src/wirings/persona/persona.types.ts +14 -0
- package/src/wirings/queue/queue-identity.test.ts +1 -1
- package/src/wirings/queue/queue.types.ts +2 -6
- package/src/wirings/queue/signed-queue-service.ts +1 -1
- package/src/wirings/rpc/index.ts +0 -12
- package/src/wirings/rpc/rpc-runner.test.ts +4 -4
- package/src/wirings/rpc/rpc-runner.ts +3 -3
- package/src/wirings/scheduler/scheduler.types.ts +2 -5
- package/src/wirings/scope/index.ts +1 -0
- package/src/wirings/secret/secret.types.ts +10 -0
- package/src/wirings/secret/validate-secret-definitions.test.ts +23 -0
- package/src/wirings/secret/validate-secret-definitions.ts +2 -0
- package/src/wirings/variable/validate-variable-definitions.test.ts +23 -0
- package/src/wirings/variable/validate-variable-definitions.ts +2 -0
- package/src/wirings/variable/variable.types.ts +9 -0
- package/src/wirings/virtual-user/index.ts +1 -4
- package/src/wirings/virtual-user/prepare-virtual-user-run.ts +1 -1
- package/src/wirings/virtual-user/virtual-user-derive.test.ts +1 -1
- package/src/wirings/virtual-user/virtual-user-derive.ts +1 -1
- package/src/wirings/virtual-user/virtual-user.types.ts +1 -5
- package/src/wirings/workflow/graph/graph-foreach-queued.test.ts +569 -0
- package/src/wirings/workflow/graph/graph-foreach.test.ts +626 -0
- package/src/wirings/workflow/graph/graph-node.ts +16 -1
- package/src/wirings/workflow/graph/graph-runner.ts +387 -61
- package/src/wirings/workflow/graph/workflow-graph.types.ts +28 -3
- package/src/wirings/workflow/index.ts +8 -0
- package/src/wirings/workflow/pikku-scenario-service.ts +59 -19
- package/src/wirings/workflow/pikku-workflow-service.ts +6 -8
- package/src/wirings/workflow/run-timeline.ts +1 -1
- package/src/wirings/workflow/scenario-expectations.test.ts +28 -13
- package/src/wirings/workflow/scenario-run.types.ts +186 -0
- package/src/wirings/workflow/scenario-step-guards.ts +1 -14
- package/src/wirings/workflow/scenario-step.test.ts +32 -7
- package/src/wirings/workflow/scenario-step.types.ts +27 -12
- package/src/wirings/workflow/workflow-approval-policy.test.ts +117 -47
- package/src/wirings/workflow/workflow-approval.ts +2 -1
- package/src/wirings/workflow/workflow-run-engine.types.ts +2 -1
- package/src/wirings/workflow/workflow.types.ts +4 -12
- package/src/wirings-stay-decoupled.test.ts +6 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/tsconfig.type-tests.json +3 -2
- package/dist/ecosystem/ai-agent.d.ts +0 -18
- package/dist/ecosystem/ai-agent.js +0 -6
- package/dist/ecosystem/ai-scorer.d.ts +0 -12
- package/dist/ecosystem/ai-scorer.js +0 -5
- package/dist/services/ai-agent-runner-service.d.ts +0 -220
- package/dist/services/ai-run-state-service.d.ts +0 -29
- package/dist/services/ai-storage-service.d.ts +0 -18
- package/dist/services/in-memory-ai-run-state-service.d.ts +0 -19
- package/dist/services/in-memory-ai-run-state-service.js +0 -54
- package/dist/testing/service-tests/ai-storage-service-tests.d.ts +0 -3
- package/dist/testing/service-tests/ai-storage-service-tests.js +0 -302
- package/dist/wirings/ai-agent/agent-rpc.d.ts +0 -15
- package/dist/wirings/ai-agent/agent-rpc.js +0 -53
- package/dist/wirings/ai-agent/ai-agent-agui.d.ts +0 -79
- package/dist/wirings/ai-agent/ai-agent-agui.js +0 -327
- package/dist/wirings/ai-agent/ai-agent-finalize.d.ts +0 -58
- package/dist/wirings/ai-agent/ai-agent-finalize.js +0 -138
- package/dist/wirings/ai-agent/ai-agent-helpers.d.ts +0 -35
- package/dist/wirings/ai-agent/ai-agent-helpers.js +0 -47
- package/dist/wirings/ai-agent/ai-agent-interrupt.d.ts +0 -153
- package/dist/wirings/ai-agent/ai-agent-interrupt.js +0 -257
- package/dist/wirings/ai-agent/ai-agent-memory.d.ts +0 -42
- package/dist/wirings/ai-agent/ai-agent-memory.js +0 -333
- package/dist/wirings/ai-agent/ai-agent-model-config.d.ts +0 -16
- package/dist/wirings/ai-agent/ai-agent-model-config.js +0 -51
- package/dist/wirings/ai-agent/ai-agent-prepare.d.ts +0 -117
- package/dist/wirings/ai-agent/ai-agent-prepare.js +0 -728
- package/dist/wirings/ai-agent/ai-agent-registry.d.ts +0 -16
- package/dist/wirings/ai-agent/ai-agent-registry.js +0 -51
- package/dist/wirings/ai-agent/ai-agent-runner.d.ts +0 -7
- package/dist/wirings/ai-agent/ai-agent-runner.js +0 -580
- package/dist/wirings/ai-agent/ai-agent-stream.d.ts +0 -41
- package/dist/wirings/ai-agent/ai-agent-stream.js +0 -1029
- package/dist/wirings/ai-agent/ai-agent-turn.d.ts +0 -57
- package/dist/wirings/ai-agent/ai-agent-turn.js +0 -82
- package/dist/wirings/ai-agent/ai-agent-utils.d.ts +0 -1
- package/dist/wirings/ai-agent/ai-agent-utils.js +0 -1
- package/dist/wirings/ai-agent/ai-agent.types.d.ts +0 -625
- package/dist/wirings/ai-agent/index.d.ts +0 -12
- package/dist/wirings/ai-agent/index.js +0 -10
- package/dist/wirings/ai-agent/voice-input.d.ts +0 -69
- package/dist/wirings/ai-agent/voice-input.js +0 -150
- package/dist/wirings/ai-agent/voice-output.d.ts +0 -85
- package/dist/wirings/ai-agent/voice-output.js +0 -196
- package/dist/wirings/ai-scorer/ai-scorer-grade.d.ts +0 -26
- package/dist/wirings/ai-scorer/ai-scorer-grade.js +0 -33
- package/dist/wirings/ai-scorer/ai-scorer-judge.d.ts +0 -17
- package/dist/wirings/ai-scorer/ai-scorer-judge.js +0 -92
- package/dist/wirings/ai-scorer/ai-scorer-live.d.ts +0 -15
- package/dist/wirings/ai-scorer/ai-scorer-live.js +0 -38
- package/dist/wirings/ai-scorer/ai-scorer-registry.d.ts +0 -18
- package/dist/wirings/ai-scorer/ai-scorer-registry.js +0 -46
- package/dist/wirings/ai-scorer/ai-scorer-sampling.d.ts +0 -8
- package/dist/wirings/ai-scorer/ai-scorer-sampling.js +0 -31
- package/dist/wirings/ai-scorer/ai-scorer-snapshots.d.ts +0 -10
- package/dist/wirings/ai-scorer/ai-scorer-snapshots.js +0 -40
- package/dist/wirings/ai-scorer/ai-scorer-worker.d.ts +0 -15
- package/dist/wirings/ai-scorer/ai-scorer-worker.js +0 -58
- package/dist/wirings/ai-scorer/ai-scorer.d.ts +0 -39
- package/dist/wirings/ai-scorer/ai-scorer.js +0 -40
- package/dist/wirings/ai-scorer/ai-scorer.types.d.ts +0 -90
- package/dist/wirings/ai-scorer/ai-scorer.types.js +0 -4
- package/dist/wirings/ai-scorer/index.d.ts +0 -6
- package/dist/wirings/ai-scorer/index.js +0 -5
- package/src/ecosystem/agent-scorer.ts +0 -24
- package/src/ecosystem/agent.ts +0 -42
- package/src/ecosystem/channel/local.ts +0 -1
- package/src/ecosystem/channel.ts +0 -22
- package/src/ecosystem/cli/channel.ts +0 -25
- package/src/ecosystem/cli.ts +0 -21
- package/src/ecosystem/credential.ts +0 -10
- package/src/ecosystem/dev.ts +0 -12
- package/src/ecosystem/function.ts +0 -28
- package/src/ecosystem/gateway.ts +0 -4
- package/src/ecosystem/hmac.ts +0 -1
- package/src/ecosystem/http.ts +0 -22
- package/src/ecosystem/mcp.ts +0 -17
- package/src/ecosystem/middleware.ts +0 -27
- package/src/ecosystem/node-host-resolver.ts +0 -1
- package/src/ecosystem/node.ts +0 -5
- package/src/ecosystem/oauth2.ts +0 -4
- package/src/ecosystem/persona.ts +0 -30
- package/src/ecosystem/queue.ts +0 -23
- package/src/ecosystem/remote.ts +0 -9
- package/src/ecosystem/role.ts +0 -13
- package/src/ecosystem/rpc.ts +0 -7
- package/src/ecosystem/safe-fetch.ts +0 -8
- package/src/ecosystem/scenario.ts +0 -32
- package/src/ecosystem/scheduler.ts +0 -5
- package/src/ecosystem/schema.ts +0 -1
- package/src/ecosystem/scope.ts +0 -14
- package/src/ecosystem/secret.ts +0 -15
- package/src/ecosystem/services/istanbul-coverage.ts +0 -1
- package/src/ecosystem/services/local-content-request-handler.ts +0 -16
- package/src/ecosystem/services/local-content.ts +0 -1
- package/src/ecosystem/services/v8-coverage.ts +0 -1
- package/src/ecosystem/services.ts +0 -82
- package/src/ecosystem/trigger.ts +0 -7
- package/src/ecosystem/types.ts +0 -34
- package/src/ecosystem/variable.ts +0 -14
- package/src/ecosystem/virtual-user.ts +0 -48
- package/src/ecosystem/workflow.ts +0 -68
- package/src/ecosystem.ts +0 -40
- package/src/index.ts +0 -244
- /package/dist/{services/ai-agent-runner-service.js → bootstrap-compat/root.js} +0 -0
- /package/dist/{services/ai-run-state-service.js → classification/data-classification.js} +0 -0
- /package/dist/{services/ai-storage-service.js → errors/serialized-error.js} +0 -0
- /package/dist/{wirings/ai-agent/ai-agent.types.js → function/function-meta.types.js} +0 -0
- /package/src/{column-form.ts → classification/column-form.ts} +0 -0
- /package/src/{pikku-request.test.ts → function/pikku-request.test.ts} +0 -0
- /package/src/{pikku-request.ts → function/pikku-request.ts} +0 -0
- /package/src/wirings/{rpc → addon}/addon-auth-tags.test.ts +0 -0
- /package/src/wirings/{rpc → addon}/addon-runner.ts +0 -0
- /package/src/wirings/{rpc → addon}/addon-secrets.test.ts +0 -0
- /package/src/wirings/{rpc → addon}/wire-addon.test.ts +0 -0
- /package/src/wirings/{rpc → addon}/wire-remote-addon.ts +0 -0
|
@@ -21,7 +21,7 @@ generated TypeScript type declares as present — the worst shape a mismatch can
|
|
|
21
21
|
take: validation permits the omission, the type promises the value, the body
|
|
22
22
|
reads `undefined`.
|
|
23
23
|
|
|
24
|
-
It is deliberately
|
|
24
|
+
It is deliberately _not_ gated on the `coerceDataFromSchema` flag that guards
|
|
25
25
|
`coerceTopLevelDataFromSchema`. That flag is about decoding transport-encoded
|
|
26
26
|
values — a query string's `"1,2"` into an array, an ISO string into a `Date` —
|
|
27
27
|
and is set only by transports that need it. Defaults are a property of the
|
package/knowledge/decisions/internals/core-scopes-are-an-and-gate-separate-from-permissions.md
CHANGED
|
@@ -14,8 +14,8 @@ closed: a session without a `scopes` field, or no session at all, satisfies
|
|
|
14
14
|
nothing. An empty `required` is the only thing anything satisfies.
|
|
15
15
|
|
|
16
16
|
This is deliberately the opposite composition from `permissions`, whose groups OR
|
|
17
|
-
together. Because permissions OR, adding a permission group can only
|
|
18
|
-
access; because scopes AND, adding a scope can only
|
|
17
|
+
together. Because permissions OR, adding a permission group can only _widen_
|
|
18
|
+
access; because scopes AND, adding a scope can only _narrow_ it. That is the
|
|
19
19
|
whole reason the two are separate mechanisms and separate code paths rather than
|
|
20
20
|
one merged authorization step, and it is why a passing global or function
|
|
21
21
|
permission must never be allowed to satisfy a scope.
|
|
@@ -24,7 +24,7 @@ Satisfaction itself is hierarchical, computed by `satisfyingGrants`: a grant
|
|
|
24
24
|
matches when it is the scope itself, a plain ancestor (`admin` covers
|
|
25
25
|
`admin:invoices:create`), a wildcard at or above it (`admin:*`, or the bare `*`),
|
|
26
26
|
or a wildcard directly beneath it. Narrower never satisfies broader —
|
|
27
|
-
`admin:invoices` does not grant `admin`. Core only ever
|
|
27
|
+
`admin:invoices` does not grant `admin`. Core only ever _reads_
|
|
28
28
|
`session.scopes`; whoever builds the session populates it (better-auth's
|
|
29
29
|
`mapSession` resolving through a `ScopeService`, for instance), and the runner
|
|
30
30
|
never fetches. `hasScopes` is the non-throwing counterpart of `verifyScopes`, for
|
package/knowledge/decisions/internals/gateway-adapters-resolve-lazily-and-are-promise-cached.md
CHANGED
|
@@ -13,7 +13,7 @@ platform adapters (WhatsApp Cloud API, Slack, …) need both, so
|
|
|
13
13
|
`resolveGatewayAdapter` in
|
|
14
14
|
`packages/core/src/wirings/gateway/gateway-runner.ts` invokes the factory on the
|
|
15
15
|
first inbound request (webhook/websocket) or on gateway start (listener). The
|
|
16
|
-
`resolvedAdapters` WeakMap caches the
|
|
16
|
+
`resolvedAdapters` WeakMap caches the _promise_, not the resolved adapter, so
|
|
17
17
|
concurrent first requests share one construction instead of racing to build two
|
|
18
18
|
adapters — which for a stateful adapter would mean two platform connections.
|
|
19
19
|
|
package/knowledge/decisions/internals/gateway-listener-middleware-runs-without-an-rpc-on-the-wire.md
CHANGED
|
@@ -10,8 +10,8 @@ tags: core, gateway
|
|
|
10
10
|
`runPikkuFunc` in `packages/core/src/function/function-runner.ts` attaches `rpc`
|
|
11
11
|
to the invocation wire with `Object.defineProperty`, as a lazy getter that
|
|
12
12
|
replaces itself on first read — and restores the previous descriptor in its
|
|
13
|
-
`finally`. `rpc` therefore exists on a wire
|
|
14
|
-
|
|
13
|
+
`finally`. `rpc` therefore exists on a wire _only for the duration of a function
|
|
14
|
+
invocation_. That is why `PikkuRawWire` is `Omit<PikkuWire, 'rpc'>`: it is the
|
|
15
15
|
wire as a runner constructs it, before the function runner adds `rpc`.
|
|
16
16
|
|
|
17
17
|
The three gateway transports reach middleware differently:
|
|
@@ -22,7 +22,7 @@ The three gateway transports reach middleware differently:
|
|
|
22
22
|
same invocation — `wire.rpc` is live.
|
|
23
23
|
- **listener** has no such wrapper. `createListenerMessageHandler` is handed
|
|
24
24
|
straight to `adapter.init()` by the `GatewayService`, builds
|
|
25
|
-
`const wire: PikkuRawWire = {}` itself, and runs `config.middleware`
|
|
25
|
+
`const wire: PikkuRawWire = {}` itself, and runs `config.middleware` _before_
|
|
26
26
|
`invoke()` reaches `runPikkuFunc`. There is no invocation in progress, so
|
|
27
27
|
`wire.rpc` is `undefined`.
|
|
28
28
|
|
|
@@ -34,7 +34,7 @@ off `CorePikkuMiddleware`, whose wire parameter is `PikkuWire`.
|
|
|
34
34
|
**What this rules out:** treating the assertion at that call as noise to be
|
|
35
35
|
deleted. It is naming a real gap. It also rules out "just widen
|
|
36
36
|
`CorePikkuMiddleware` to accept `PikkuRawWire`" as a free fix — that would make
|
|
37
|
-
`rpc` optional for
|
|
37
|
+
`rpc` optional for _every_ middleware in the framework, pushing the problem onto
|
|
38
38
|
every consumer to satisfy one transport.
|
|
39
39
|
|
|
40
40
|
**Still open:** whether the listener path should wrap its handler in a
|
package/knowledge/decisions/internals/gateway-wiring-is-a-meta-wiring-over-http-and-channels.md
CHANGED
|
@@ -18,7 +18,7 @@ followed by `httpRouter.reset()` because the router caches its match table.
|
|
|
18
18
|
The wrapper functions and routes created here look like they are missing their
|
|
19
19
|
metadata. They are not: the inspector projects a `wireGateway` call into the
|
|
20
20
|
generated HTTP and function meta at build time, so only the handler
|
|
21
|
-
|
|
21
|
+
_implementations_ register at runtime — the same split every other wire uses.
|
|
22
22
|
This is why `wireWebhookGateway` writes route entries but no `CommonWireMeta`,
|
|
23
23
|
and why the websocket path sets `channels.set(name, …)` with empty
|
|
24
24
|
`onConnect`/`onMessage` stubs while the real handlers live under the
|
|
@@ -11,7 +11,7 @@ tags: http
|
|
|
11
11
|
normalizes every route and every incoming path to a leading `/` before matching,
|
|
12
12
|
so a route registered as `'todos'` still answers a request for `/todos`. The
|
|
13
13
|
`route` field it stores alongside each matcher and static entry is the
|
|
14
|
-
|
|
14
|
+
_un-normalized_ original, and that is what `MatchResult.route` returns.
|
|
15
15
|
|
|
16
16
|
That asymmetry is load-bearing. `getMatchingRoute` in `http-runner.ts` takes the
|
|
17
17
|
returned route and uses it as a key into `pikkuState(null, 'http', 'routes')` and
|
|
@@ -12,7 +12,7 @@ tags: services
|
|
|
12
12
|
`invoke` throws, and it throws with a truncated body — which is why a scenario
|
|
13
13
|
asserting on a refusal must use `invokeRaw`.
|
|
14
14
|
|
|
15
|
-
A permissions or scopes scenario
|
|
15
|
+
A permissions or scopes scenario _expects_ the 403. The status is the assertion,
|
|
16
16
|
and the body usually names the scope that was missing, so both have to survive as
|
|
17
17
|
data rather than being reduced to a thrown `Error`. These helpers also exist
|
|
18
18
|
because every scenario reaching past an actor was hand-writing the same
|
package/knowledge/decisions/internals/in-memory-workflow-history-aliases-the-live-step-object.md
CHANGED
|
@@ -9,7 +9,7 @@ tags: services
|
|
|
9
9
|
|
|
10
10
|
`InMemoryWorkflowService` (`packages/core/src/services/in-memory-workflow-service.ts`)
|
|
11
11
|
stores each step twice: in `steps`, keyed `${runId}:${stepName}`, and appended to
|
|
12
|
-
`stepHistory` for the run. Both hold the
|
|
12
|
+
`stepHistory` for the run. Both hold the _same object_. `createStepImpl` and
|
|
13
13
|
`createRetryAttemptImpl` push the reference they just put into `steps`, not a
|
|
14
14
|
copy.
|
|
15
15
|
|
|
@@ -10,6 +10,7 @@ A rule about how core behaves: what runs where, in what order, and what a
|
|
|
10
10
|
caller is entitled to assume.
|
|
11
11
|
|
|
12
12
|
<!-- pikku:knowledge-index -->
|
|
13
|
+
|
|
13
14
|
- [A non-streaming agent run registers with aiRunState on the same terms as a streaming one](a-non-streaming-agent-run-registers-with-airunstate-too.md) — Otherwise interruptAIAgent finds the run, passes the ownership check, then cannot stop it — and reports that as if the run were on another host
|
|
14
15
|
- [A resumed turn is as interruptible as the first one](a-resumed-agent-turn-is-as-interruptible-as-the-first.md) — It is the same person listening to the same voice, and after an approval it is where most of the reply actually gets spoken
|
|
15
16
|
- [A scenario step's prose template is offered to a virtual user unfilled](a-scenario-step-template-is-offered-unfilled.md) — A reporter fills placeholders from a run that happened; there is no run yet, and the filled form would answer the question the user is there to answer
|
|
@@ -57,7 +58,7 @@ caller is entitled to assume.
|
|
|
57
58
|
- [CLI stdout is reserved for machine-readable output](cli-stdout-is-reserved-for-machine-readable-output.md) — The default renderer emits single-line NDJSON, diagnostics go to stderr, and --json only hijacks rendering for commands that declared a renderer
|
|
58
59
|
- [CLI unknown long options warn instead of failing](cli-unknown-long-options-warn-instead-of-failing.md) — Unrecognised --long options are accepted, warned about and dropped so older binaries tolerate newer invocations, while unknown short flags stay hard errors
|
|
59
60
|
- [A column's at-rest form is an axis of its own](core-column-form-is-an-axis-of-its-own.md) — How a value is stored is independent of how sensitive it is, so form carries a required nominal brand on writes while classification stays optional on reads
|
|
60
|
-
- [The data-classification brand is an optional property](core-data-classification-brand-is-an-optional-property.md) — Making
|
|
61
|
+
- [The data-classification brand is an optional property](core-data-classification-brand-is-an-optional-property.md) — Making **classification** required would break ordinary Kysely operands, so the brand only constrains values flowing out
|
|
61
62
|
- [The function runner restores the wire fields it overwrites](core-function-runner-restores-the-wire-fields-it-overwrites.md) — One wire object is reused across nested calls, so functionId, audit, addonNamespace and rpc are saved and put back in a finally
|
|
62
63
|
- [Hot reload merges generated meta and never replaces it](core-hot-reload-merges-generated-meta-never-replaces-it.md) — Reloading codegen output must preserve runtime-registered meta, which no generated JSON contains
|
|
63
64
|
- [Hot reload owns its module registry instead of re-importing](core-hot-reload-owns-its-module-registry.md) — Dev reload transpiles to CJS and runs modules through vm.compileFunction, because the native ESM loader map cannot be evicted
|
|
@@ -103,7 +104,7 @@ caller is entitled to assume.
|
|
|
103
104
|
- [The agent `done` event goes through the middleware and is awaited](the-agent-done-event-goes-through-the-middleware-and-is-awaited.md) — `done` is the only end-of-reply signal a stream hook gets, and buffering hooks flush on it — sending it raw discards work already paid for
|
|
104
105
|
- [The API report pins members, because the export list only pins names](the-api-report-pins-members-not-just-names.md) — public-surface.json catches an export appearing or vanishing; it cannot see a method added to an interface, which is the change that breaks a consumer's build
|
|
105
106
|
- [The dev queue copies prod timing and serialization semantics](the-dev-queue-copies-prod-timing-and-serialization-semantics.md) — InMemoryQueueService dispatches via setTimeout, retries with backoff, and JSON round-trips every payload so dev behaviour matches a real backend
|
|
106
|
-
- [
|
|
107
|
+
- [One door per name — the ecosystem tier and the package root are both gone](the-ecosystem-entry-point-carries-the-adapter-surface.md) — the adapter surface was split onto @pikku/core/ecosystem to keep a stability promise at the root; publishing every module twice cost more than the promise was worth, so both the facades and the root barrel were deleted
|
|
107
108
|
- [The embedding model is pinned per service and doc/query embedding is split](the-embedding-model-is-pinned-per-service-and-doc-query-embedding-is-split.md) — AIEmbeddingService fixes its model at construction so index and query share a vector space, and separates embedDocuments from embedQuery for asymmetric models
|
|
108
109
|
- [The in-memory workflow service is inline-only and single-process](the-in-memory-workflow-service-is-inline-only-and-single-process.md) — InMemoryWorkflowService wires no queues and implements withRunLock/withStepLock as pass-throughs, because inline execution has no second holder to exclude
|
|
109
110
|
- [The KEK salt is scoped to the key version, not the secret](the-kek-salt-is-scoped-to-the-key-version.md) — One stored salt per key version means N secrets cost one derivation, which is the point of envelope encryption
|
|
@@ -153,4 +154,5 @@ caller is entitled to assume.
|
|
|
153
154
|
- [A workflow step's recorded `rpcName` is provenance only — nothing dispatches off it](workflow-step-rpc-name-is-provenance-only.md) — It exists so a reader can join a runtime step row back to the declaration that produced it, especially when the durable name was built in a loop
|
|
154
155
|
- [A suspend or approval `reason` is the step's durable identity, not just a message](workflow-suspend-and-approval-reasons-are-durable-step-identities.md) — The reason is namespaced and used raw as the step key, so it must be derived deterministically across replays
|
|
155
156
|
- [A suspended workflow run keeps its in-process context; only terminal runs release it](workflow-suspended-runs-keep-their-in-process-context.md) — `suspended` is absent from the terminal set on purpose, and a context is dropped only when nothing is holding it open
|
|
157
|
+
|
|
156
158
|
<!-- /pikku:knowledge-index -->
|
package/knowledge/decisions/internals/istanbul-statement-counts-attach-to-the-start-line-only.md
CHANGED
|
@@ -9,7 +9,7 @@ tags: services
|
|
|
9
9
|
|
|
10
10
|
`IstanbulCoverageService` (`packages/core/src/services/istanbul-coverage-service.ts`)
|
|
11
11
|
reads instrumented counters off the `__coverage__` global and, when turning
|
|
12
|
-
statement maps into line hits, credits each statement's count to its
|
|
12
|
+
statement maps into line hits, credits each statement's count to its _start_ line
|
|
13
13
|
and no other line it spans.
|
|
14
14
|
|
|
15
15
|
This is istanbul's own semantics, and the reason matters: statements nest. An
|
|
@@ -29,7 +29,7 @@ Two of workspace validate's own checks were not merely absent from fabric — th
|
|
|
29
29
|
had never run anywhere:
|
|
30
30
|
|
|
31
31
|
- the auth checks were gated on a middleware instance with `definitionId ===
|
|
32
|
-
|
|
32
|
+
'betterAuthSession'`, but the CLI wires `betterAuthStatelessSession` whenever
|
|
33
33
|
`session.cookieCache` is on, which is the configuration Fabric asks for. So
|
|
34
34
|
they skipped precisely the apps most likely to have auth.
|
|
35
35
|
- they looked for migrations in `packages/functions/db/`, and for tables named
|
|
@@ -10,7 +10,7 @@ tags: services
|
|
|
10
10
|
`QueueWebhookService.resolveJobOptions`
|
|
11
11
|
(`packages/core/src/services/queue-webhook-service.ts`) resolves retries as
|
|
12
12
|
per-call `retries` → `config.webhook.retries` → `DEFAULT_WEBHOOK_RETRIES`, then
|
|
13
|
-
|
|
13
|
+
_always_ puts `attempts: retries + 1` on the job options. It mirrors the workflow
|
|
14
14
|
service's policy resolution. Backoff is exponential unless a concrete
|
|
15
15
|
`retryDelay` selects a fixed one.
|
|
16
16
|
|
package/knowledge/decisions/internals/remote-addons-dispatch-over-http-instead-of-local-meta.md
CHANGED
|
@@ -15,7 +15,7 @@ handlers run on the host at `serverUrl`. `pikku verify` enforces the
|
|
|
15
15
|
devDependency placement.
|
|
16
16
|
|
|
17
17
|
`ContextAwareRPCService.invokeAddonFunction` in `rpc-runner.ts` therefore checks
|
|
18
|
-
`resolved.addonConfig?.remote`
|
|
18
|
+
`resolved.addonConfig?.remote` _before_ it looks for local function meta, and
|
|
19
19
|
routes to `invokeRemoteAddonFunction`. That method POSTs the addon's own function
|
|
20
20
|
name — the bare name, not the namespaced `ns:fn` form, optionally remapped by
|
|
21
21
|
`remoteName` — to `${serverUrl}/remote/rpc/:rpcName`, authenticating as a client
|
package/knowledge/decisions/internals/rpc-names-resolve-through-package-scope-before-root.md
CHANGED
|
@@ -15,7 +15,7 @@ throws `RPCNotFoundError`. It returns the resolving package alongside the
|
|
|
15
15
|
`runPikkuFunc` without a second lookup.
|
|
16
16
|
|
|
17
17
|
The package-first order exists because RPC meta only ever lives in root: addon
|
|
18
|
-
packages register their handlers under their own package name as
|
|
18
|
+
packages register their handlers under their own package name as _function_ meta,
|
|
19
19
|
never as RPC meta. Without the package probe, a bare `rpc('doThing')` made from
|
|
20
20
|
inside an addon would skip that addon's own `doThing` and either resolve to an
|
|
21
21
|
unrelated root function of the same name or fail outright. The versioned retry
|
|
@@ -12,8 +12,8 @@ All three run a named `pikkuScenarioStep` as one durable step. `given` and
|
|
|
12
12
|
identically either way.
|
|
13
13
|
|
|
14
14
|
`then` is a different operation. The phase is what decides how a step's surface
|
|
15
|
-
bindings are treated: for an action, the bindings are
|
|
16
|
-
chosen; for an assertion, they are
|
|
15
|
+
bindings are treated: for an action, the bindings are _alternatives_ and one is
|
|
16
|
+
chosen; for an assertion, they are _witnesses_ and every applicable one runs and
|
|
17
17
|
must agree. So the same step function invoked as `when` and as `then` executes a
|
|
18
18
|
different number of times against a different number of surfaces.
|
|
19
19
|
|
|
@@ -14,11 +14,11 @@ a directory listing which files ship and which files test.
|
|
|
14
14
|
|
|
15
15
|
So `validate` requires the declaration to be in a file named for what it is:
|
|
16
16
|
|
|
17
|
-
| declaration
|
|
18
|
-
|
|
|
19
|
-
| `pikkuScenario`, `pikkuFeature`
|
|
20
|
-
| `pikkuScenarioStep` and its platform/addon variants | `*.steps.ts` (or the above)
|
|
21
|
-
| `definePersonas`, `runVirtualUser`
|
|
17
|
+
| declaration | file |
|
|
18
|
+
| --------------------------------------------------- | --------------------------------- |
|
|
19
|
+
| `pikkuScenario`, `pikkuFeature` | `*.scenario.ts`, `*.scenarios.ts` |
|
|
20
|
+
| `pikkuScenarioStep` and its platform/addon variants | `*.steps.ts` (or the above) |
|
|
21
|
+
| `definePersonas`, `runVirtualUser` | `*.virtual-user.ts`, `*.vu.ts` |
|
|
22
22
|
|
|
23
23
|
Three suffixes for scenarios rather than one, because the split that matters is
|
|
24
24
|
scenarios apart from application code, not a particular spelling — `.steps.ts`
|
package/knowledge/decisions/internals/the-actor-prompt-says-json-because-of-json-object-mode.md
CHANGED
|
@@ -8,7 +8,7 @@ tags: core, actor-flow
|
|
|
8
8
|
# The actor's instructions say the word "json"
|
|
9
9
|
|
|
10
10
|
Every call the actor makes wants a schema'd object back. A gateway that cannot
|
|
11
|
-
accept a JSON
|
|
11
|
+
accept a JSON _schema_ degrades to OpenAI's `json_object` response mode, and
|
|
12
12
|
that mode refuses the request outright — a hard API error, not a bad answer —
|
|
13
13
|
unless the literal word "json" appears somewhere in the prompt.
|
|
14
14
|
|
|
@@ -9,7 +9,7 @@ tags: core, api
|
|
|
9
9
|
|
|
10
10
|
`public-surface.json` records `Object.keys(module)` for every entry point. That
|
|
11
11
|
is a real guard — it caught a new `./node-host-resolver` subpath and five
|
|
12
|
-
renames during a rebase — but it only sees
|
|
12
|
+
renames during a rebase — but it only sees _names_.
|
|
13
13
|
|
|
14
14
|
It cannot see:
|
|
15
15
|
|
package/knowledge/decisions/internals/the-ecosystem-entry-point-carries-the-adapter-surface.md
CHANGED
|
@@ -1,11 +1,49 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: decision
|
|
3
|
-
title:
|
|
4
|
-
description:
|
|
3
|
+
title: One door per name — the ecosystem tier and the package root are both gone
|
|
4
|
+
description: the adapter surface was split onto @pikku/core/ecosystem to keep a stability promise at the root; publishing every module twice cost more than the promise was worth, so both the facades and the root barrel were deleted
|
|
5
5
|
tags: core, api
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# One door per name
|
|
9
|
+
|
|
10
|
+
**Reversed.** The section below records why `@pikku/core/ecosystem` existed; it
|
|
11
|
+
is kept because the stability argument that produced it is still true and still
|
|
12
|
+
constrains what the subpaths may promise. What changed is the mechanism.
|
|
13
|
+
|
|
14
|
+
## What holds now
|
|
15
|
+
|
|
16
|
+
Every name lives on the subpath that owns the module it comes from, and every
|
|
17
|
+
import carries that subpath: `@pikku/core/http`, `@pikku/core/services`,
|
|
18
|
+
`@pikku/core/errors`, `@pikku/core/types`. There is no second specifier for the
|
|
19
|
+
same module and no package root — `.` resolves to a bootstrap shim, not an entry
|
|
20
|
+
point.
|
|
21
|
+
|
|
22
|
+
The facades did not survive contact with their own premise. `ecosystem/http`
|
|
23
|
+
re-exported `./http`, so a name was reachable through either door; every
|
|
24
|
+
addition had to be made twice, they drifted (25 names had accumulated in the
|
|
25
|
+
facade tier with no raw home, and about 26 more sat under a different area than
|
|
26
|
+
the module they came from), and a consumer's import told you nothing about what
|
|
27
|
+
it used. The package root was the same failure at a larger scale: 206 names in
|
|
28
|
+
one barrel that no bundler could take apart.
|
|
29
|
+
|
|
30
|
+
The stability distinction the split was built to express is now carried by
|
|
31
|
+
`public-surface.json` and `api-report.md`, which pin what each entry point
|
|
32
|
+
exports. Moving a symbol across an area boundary is still a visible diff; it
|
|
33
|
+
just no longer requires a parallel tree of re-export files to be visible.
|
|
34
|
+
|
|
35
|
+
Two modules survive at the old specifiers and are not entry points:
|
|
36
|
+
`bootstrap-compat/root.ts` and `bootstrap-compat/ecosystem.ts` exist because
|
|
37
|
+
`packages/cli` is generated by the published CLI pinned in its `build.sh`, which
|
|
38
|
+
still emits `@pikku/core/ecosystem` and a bare `@pikku/core`. A test pins their
|
|
39
|
+
exact contents so neither can grow, and both go when the pin moves to a CLI
|
|
40
|
+
released from this branch.
|
|
41
|
+
|
|
42
|
+
**What this rules out:** re-introducing any specifier that re-exports another
|
|
43
|
+
subpath's names. A curated facade over a module that is already published is the
|
|
44
|
+
thing that was tried; adding a name to two places is how it decays.
|
|
45
|
+
|
|
46
|
+
## Why the split existed (superseded)
|
|
9
47
|
|
|
10
48
|
`@pikku/core` has two kinds of consumer. An **application** writes functions and
|
|
11
49
|
wires them: `pikkuFunc`, `wireHTTP`, `PikkuWire`, the error catalogue. A
|
|
@@ -40,19 +78,5 @@ i.e. _the real API_, which is the opposite of the intended signal, and
|
|
|
40
78
|
`packages/runtimes/*` already claims the word while `packages/cli` is the
|
|
41
79
|
largest consumer here at 22 files.
|
|
42
80
|
|
|
43
|
-
`/ecosystem`
|
|
44
|
-
ecosystem — a runtime, a service, an addon, the CLI.
|
|
45
|
-
alias to the same module because the pinned bootstrap CLI still emits it.
|
|
46
|
-
|
|
47
|
-
Nothing was deleted. What stayed public is what applications actually
|
|
48
|
-
hand-write: `addTagMiddleware` (8 files), `addGlobalPermission`, `fetch` (31),
|
|
49
|
-
`wireAddon`, and the authoring helpers.
|
|
50
|
-
|
|
51
|
-
**What this rules out:** re-exporting anything from `/internal` at the package
|
|
52
|
-
root for convenience. The split is the whole point — `/internal` may change in
|
|
53
|
-
any release, and the root may not. It also rules out treating `/internal` as
|
|
54
|
-
private: it is a published entry point that runtime authors are expected to use,
|
|
55
|
-
just without the compatibility guarantee.
|
|
56
|
-
|
|
57
|
-
`public-surface.json` pins both, so moving a symbol across the line is a visible
|
|
58
|
-
diff rather than an accident.
|
|
81
|
+
`/ecosystem` said the true thing: you are building a package in the Pikku
|
|
82
|
+
ecosystem — a runtime, a service, an addon, the CLI.
|
|
@@ -9,7 +9,7 @@ tags: core, services
|
|
|
9
9
|
|
|
10
10
|
`HttpPersona`, `createHttpPersonas`, `readScenarioHttpResponse` and
|
|
11
11
|
`postScenarioJson` are exported from `@pikku/core/persona`, not from
|
|
12
|
-
`@pikku/core/services`. Their
|
|
12
|
+
`@pikku/core/services`. Their _types_ are re-exported freely — TypeScript erases
|
|
13
13
|
those and they cost a bundle nothing.
|
|
14
14
|
|
|
15
15
|
The values are different. They reach `http-personas`, which reaches the
|
package/knowledge/decisions/internals/the-worker-disposition-is-the-one-that-is-not-testing.md
CHANGED
|
@@ -7,7 +7,7 @@ tags: core, virtual-user
|
|
|
7
7
|
|
|
8
8
|
# The worker disposition is the only one not testing anything
|
|
9
9
|
|
|
10
|
-
Every other disposition exists to probe the product. The worker exists to
|
|
10
|
+
Every other disposition exists to probe the product. The worker exists to _use_
|
|
11
11
|
it, which changes every parameter: it abandons rarely, runs at a low temperature,
|
|
12
12
|
and is instructed to stop and report rather than guess its way past an obstacle.
|
|
13
13
|
|
|
@@ -10,7 +10,7 @@ tags: cli, validate, addons
|
|
|
10
10
|
`pikku workspace validate` was named after one of the things a repo can be.
|
|
11
11
|
Adding a second — "is this addon publishable" — invited a second command,
|
|
12
12
|
`pikku addon validate`, and that is where the naming falls apart: the addons
|
|
13
|
-
repo is a workspace
|
|
13
|
+
repo is a workspace _containing_ 217 publishable addons. Standing at its root,
|
|
14
14
|
`pikku addon validate` would have to refuse or sweep every package, at which
|
|
15
15
|
point it is doing the workspace thing anyway. The two nouns were never
|
|
16
16
|
alternatives.
|
|
@@ -67,7 +67,7 @@ and the published packages had drifted from it with nothing watching.
|
|
|
67
67
|
## The check walks whichever generated directory a package ships
|
|
68
68
|
|
|
69
69
|
`dist/.pikku` is the target shape (below), but the check cannot assume it: the
|
|
70
|
-
shape is what this work moved addons
|
|
70
|
+
shape is what this work moved addons _to_, and a package that has not moved —
|
|
71
71
|
or was published before it did — still carries `.pikku` at the root, listed in
|
|
72
72
|
`files` and mapped by `exports` as `./.pikku/*`. There it is a public entry
|
|
73
73
|
point rather than build input, and its imports climb one level fewer — to
|
|
@@ -100,7 +100,7 @@ workspace link and none of it resolved on install.
|
|
|
100
100
|
## Only a package that publishes gets the dist shape
|
|
101
101
|
|
|
102
102
|
The shape describes a tarball, so it means nothing for a `private` package —
|
|
103
|
-
and applying it there actively breaks: `exports`
|
|
103
|
+
and applying it there actively breaks: `exports` _is_ enforced across a
|
|
104
104
|
workspace link, so repointing a private fixture at `dist` makes every consumer
|
|
105
105
|
demand a directory that only a build produces. The three `verifiers/db-schema`
|
|
106
106
|
and `verifiers/addon-registry` fixtures have no build script at all, so `dist`
|
|
@@ -18,4 +18,4 @@ costs work to reproduce a fact that already holds.
|
|
|
18
18
|
|
|
19
19
|
**What this rules out:** "correcting" this to a topological walk because a graph
|
|
20
20
|
is present. The graph describes execution; the catalogue describes what the
|
|
21
|
-
scenario
|
|
21
|
+
scenario _says_, and those are read in declaration order.
|
package/knowledge/decisions/internals/webhook-delivery-history-records-every-attempt-best-effort.md
CHANGED
|
@@ -9,7 +9,7 @@ tags: services
|
|
|
9
9
|
|
|
10
10
|
`pikkuWebhookWorkerFunc` (`packages/core/src/services/queue-webhook-service.ts`)
|
|
11
11
|
POSTs the delivery, then — when the job carries a `deliveryId` — calls
|
|
12
|
-
`webhookService.recordAttempt` with the outcome
|
|
12
|
+
`webhookService.recordAttempt` with the outcome _before_ throwing on a non-2xx.
|
|
13
13
|
The throw is what makes the queue retry, so recording first is the only way the
|
|
14
14
|
console's delivery history shows every try rather than just the final one.
|
|
15
15
|
|
|
@@ -16,7 +16,7 @@ output at `unknown`, because one map has to hold every trigger in the app.
|
|
|
16
16
|
|
|
17
17
|
Handing `CoreTriggerSource<TInput, TOutput>` to a slot typed
|
|
18
18
|
`CoreTriggerSource<unknown, unknown>` is not an upcast. `func` takes its input
|
|
19
|
-
as a
|
|
19
|
+
as a _parameter_, and parameters are contravariant: a function that accepts
|
|
20
20
|
`TInput` cannot stand in for one that accepts `unknown`, since `unknown` admits
|
|
21
21
|
values `TInput` does not. TypeScript is right to reject it, and no variance
|
|
22
22
|
annotation makes it go away — the registry genuinely holds functions whose input
|
|
@@ -14,7 +14,7 @@ deadline. A duplicate, late, or entirely dropped timer therefore all produce the
|
|
|
14
14
|
same answer, and losing the wake costs liveness — the run sits until something
|
|
15
15
|
else resumes it — never correctness.
|
|
16
16
|
|
|
17
|
-
`scheduleRunWake` deliberately enqueues a delayed
|
|
17
|
+
`scheduleRunWake` deliberately enqueues a delayed _orchestrator_ pass rather
|
|
18
18
|
than reusing `scheduleSleep`. `scheduleSleep` resolves the step it is given,
|
|
19
19
|
which for an approval would resolve the gate itself; the wake only nudges the
|
|
20
20
|
run to replay and re-evaluate, leaving the gate the sole judge of its own
|
|
@@ -20,7 +20,7 @@ driver written against an earlier version keeps compiling; the runner treats a
|
|
|
20
20
|
driver without them as one offering no isolation and no diagnostics.
|
|
21
21
|
`captureFailure` must never throw — a failure to capture must not replace the
|
|
22
22
|
failure being captured — and exists because a browser step fails with a selector
|
|
23
|
-
timeout that says nothing about
|
|
23
|
+
timeout that says nothing about _why_ the page never rendered; the answer is
|
|
24
24
|
almost always in the page's own console and request errors, which the driver has
|
|
25
25
|
been collecting all along.
|
|
26
26
|
|
|
@@ -18,7 +18,7 @@ The failure path is equally deliberate. `WorkflowAsyncException`,
|
|
|
18
18
|
`WorkflowCancelledException`, `WorkflowSuspendedException` and
|
|
19
19
|
`WorkflowDispatchException` are all excluded from the "mark the run failed"
|
|
20
20
|
branch: the first three already recorded their own status, and the fourth is
|
|
21
|
-
transient. When a run does fail, an
|
|
21
|
+
transient. When a run does fail, an _expected_ error (a `PikkuError`, e.g. a
|
|
22
22
|
build gate tripping) logs only its message — the message is the whole story, and
|
|
23
23
|
the `expected` flag survives the step-boundary rehydration that strips the
|
|
24
24
|
class. Anything else is logged in full so the trace is there to debug.
|
package/knowledge/decisions/internals/workflow-invocation-id-is-the-dedupe-key-not-step-id.md
CHANGED
|
@@ -26,7 +26,7 @@ plus the version and variant bit twiddling) rather than pulled from the `uuid`
|
|
|
26
26
|
package, and `workflow-invocation-id.test.ts` pins it against the known
|
|
27
27
|
`www.example.com`-in-DNS-namespace vector.
|
|
28
28
|
|
|
29
|
-
Calling the same step name more than once in a run
|
|
29
|
+
Calling the same step name more than once in a run _is_ disambiguated. Ordinals
|
|
30
30
|
are already in: `nextStepKey` (`pikku-workflow-service.ts`) mints a physical key
|
|
31
31
|
per reach — `name`, then `name#1`, `name#2` — and every step entry point routes
|
|
32
32
|
through it, so `deriveInvocationId` hashes the physical key, not the logical
|
package/knowledge/decisions/internals/workflow-run-capabilities-are-extensions-not-subclasses.md
CHANGED
|
@@ -15,7 +15,7 @@ available to it without becoming public API on every workflow service a
|
|
|
15
15
|
production app instantiates.
|
|
16
16
|
|
|
17
17
|
The reason it is not a subclass is bundle size: a bundler drops an unused
|
|
18
|
-
|
|
18
|
+
_module_ but never an unused class member. Anything declared on
|
|
19
19
|
`PikkuWorkflowService` ships in every server built on Pikku, along with
|
|
20
20
|
everything it imports. `PikkuScenarioService` (`pikku-scenario-service.ts`) is
|
|
21
21
|
the one implementation today — steps, actors, lifecycle hooks, the browser
|
package/knowledge/decisions/internals/workflow-run-timeline-is-a-pure-fold-over-durable-history.md
CHANGED
|
@@ -7,7 +7,7 @@ tags: workflow
|
|
|
7
7
|
|
|
8
8
|
# The workflow run timeline is a pure fold over durable history, with the row's status as the authority
|
|
9
9
|
|
|
10
|
-
`run-timeline.ts` turns `getRunHistory` — one row per step
|
|
10
|
+
`run-timeline.ts` turns `getRunHistory` — one row per step _attempt_, each with
|
|
11
11
|
lifecycle timestamps — into a flat, chronologically ordered event stream, and
|
|
12
12
|
folds that stream up to any point to recover what the run "knew" then: the same
|
|
13
13
|
step cache a replay would hold, plus the walked path. Both functions are pure,
|
|
@@ -30,11 +30,15 @@ caller, who is the only one who knows what was being waited for. Its own
|
|
|
30
30
|
defaults are shorter than the assertion wrappers': `within` 15s, `interval`
|
|
31
31
|
250ms.
|
|
32
32
|
|
|
33
|
-
`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
`requireScenarioEnv` (`scenario-step-guards.ts`) exists for the mirror-image
|
|
34
|
+
reason: `env` is optional on the step wire because most steps need nothing from
|
|
35
|
+
it, so the narrowing happens in one place with a message that says what to do,
|
|
36
|
+
instead of every step file writing its own guard. The actor is not narrowed at
|
|
37
|
+
all — a step that runs as somebody declares `actor: true` (or a `browser`
|
|
38
|
+
binding, which cannot be provisioned without a window to open), and the runner
|
|
39
|
+
injects `wire.actor` non-optionally into every binding and refuses to dispatch
|
|
40
|
+
the step without one. A wire member can be required per binding; a property of
|
|
41
|
+
one cannot, which is why it is not on `scenarioStep`. `scenarioStep`'s `verifyStepName` call doubles as the guard for `then`
|
|
38
42
|
being a wire member — an accidental `await scenario` calls it with a resolve
|
|
39
43
|
function, which lands as a loud named error instead of a silent hang.
|
|
40
44
|
|
package/knowledge/decisions/internals/workflow-scenario-hooks-are-a-scenario-only-affordance.md
CHANGED
|
@@ -25,7 +25,7 @@ saying which phase it happened in.
|
|
|
25
25
|
suspended or waiting and teardown would fire mid-flight. When the scenario has
|
|
26
26
|
already failed for its own reason, an `after`-hook failure is attached as
|
|
27
27
|
`cause` and logged rather than replacing the headline; only a teardown failure
|
|
28
|
-
after a
|
|
28
|
+
after a _passing_ scenario fails the run.
|
|
29
29
|
|
|
30
30
|
At the feature level (`workflow.types.ts`, `CoreFeature`), hooks run once around
|
|
31
31
|
the whole group — `before → a → b → c → after` — not per scenario. That is the
|
|
@@ -15,7 +15,7 @@ ran it.
|
|
|
15
15
|
|
|
16
16
|
It earns its keep when the durable step name was built at runtime. A scenario
|
|
17
17
|
step called in a loop reaches the run as, say, `sees @pikku/addon-todos` while
|
|
18
|
-
it was declared as
|
|
18
|
+
it was declared as `sees ${packageName}`; the recorded step-function name is
|
|
19
19
|
then the only way to join that row back to its declaration. `inlineStep` also
|
|
20
20
|
records the `data` the step was called with for the same reason: a reporter
|
|
21
21
|
renders each step's prose from it, so two calls to one step stay
|
|
@@ -23,7 +23,7 @@ distinguishable by what they were asked to check.
|
|
|
23
23
|
|
|
24
24
|
Step lineage is recorded alongside it. `fromStepName` is the predecessor that
|
|
25
25
|
scheduled a step — the walked transition — captured by `rpcStep`/`inlineStep`
|
|
26
|
-
|
|
26
|
+
_before_ `nextStepKey` advances the lineage, and surfaced to a step as
|
|
27
27
|
`fromInvocationId`. In a cyclic graph `a → b → a → c`, the second `a` therefore
|
|
28
28
|
carries `b`'s id, which is what lets the walked path be reconstructed from the
|
|
29
29
|
chain alone.
|
|
@@ -28,7 +28,7 @@ one key per gate means two gates resolving concurrently cannot clobber each
|
|
|
28
28
|
other through a read-modify-write.
|
|
29
29
|
|
|
30
30
|
One consequence to know about: `approveStep`'s optional `reason` argument
|
|
31
|
-
addresses the
|
|
31
|
+
addresses the _first_ reach of a gate only. If a gate is reached again on a
|
|
32
32
|
later loop iteration, `nextStepKey` gives that row a `#N` suffix, and there is
|
|
33
33
|
currently no way for a caller to name it.
|
|
34
34
|
|
|
@@ -24,7 +24,7 @@ impossible rather than merely reported: secrets are resolved where things are
|
|
|
24
24
|
constructed — `pikkuServices`, `pikkuWireServices`, addon service factories,
|
|
25
25
|
middleware — and the function is handed the configured client.
|
|
26
26
|
|
|
27
|
-
The cost is that a function which needs to
|
|
27
|
+
The cost is that a function which needs to _ask about_ a secret rather than read
|
|
28
28
|
one — "is this key set?", for a readiness or provisioning check — cannot do it
|
|
29
29
|
directly either. It goes through a service that holds `secrets` and exposes only
|
|
30
30
|
that question, which is how `@pikku/addon-console` checks whether an installed
|
package/knowledge/decisions/security/a-step-runs-the-function-the-workflow-dispatched-it-with.md
CHANGED
|
@@ -11,7 +11,7 @@ tags: workflow
|
|
|
11
11
|
off the queue message and hands it to `executeWorkflowStep`. That call runs as
|
|
12
12
|
the run's owner — `invokeStepRpc` copies `run.wire.pikkuUserId` onto the wire —
|
|
13
13
|
and `rpcWithWire` does not apply the `expose` gate that the public `/rpc` route
|
|
14
|
-
applies. So the message decided both
|
|
14
|
+
applies. So the message decided both _what_ ran and _as whom_.
|
|
15
15
|
|
|
16
16
|
The claim in `executeWorkflowStepInner` read the step's status and nothing else;
|
|
17
17
|
there was no stored function name to compare against. `StepState` now carries
|
|
@@ -11,11 +11,10 @@ tags: core, virtual-user
|
|
|
11
11
|
platform and addon steps, from what a virtual user may call.
|
|
12
12
|
|
|
13
13
|
For scenario bodies the argument is only efficiency: they are held out of every
|
|
14
|
-
deployed unit and are not network-callable, so offering one wastes a turn on a
|
|
15
|
-
404.
|
|
14
|
+
deployed unit and are not network-callable, so offering one wastes a turn on a 404.
|
|
16
15
|
|
|
17
16
|
For a platform or addon step the argument is the oracle itself. A virtual user's
|
|
18
|
-
findings are worth something
|
|
17
|
+
findings are worth something _because_ it cannot manufacture the outcomes it is
|
|
19
18
|
meant to discover. A user that could invoke "Stripe's webhook arrives" forges its
|
|
20
19
|
own payment success, and every finding downstream of that forgery is worthless —
|
|
21
20
|
not merely unreliable, but actively misleading, because it looks like evidence.
|
package/knowledge/decisions/security/actor-sign-in-is-proven-by-set-cookie-not-a-non-empty-jar.md
CHANGED
|
@@ -15,7 +15,7 @@ header even though the response was a 2xx.
|
|
|
15
15
|
A cookie jar cannot answer "did sign-in happen". A target app may set a cookie on
|
|
16
16
|
any request — a CSRF token, an anonymous session, a locale — so a non-empty jar
|
|
17
17
|
after a failed or skipped sign-in looks exactly like a successful one. What
|
|
18
|
-
actually proves a session was established is
|
|
18
|
+
actually proves a session was established is _this_ response setting a cookie. A
|
|
19
19
|
2xx alone is not enough either: an endpoint that returns 200 while quietly
|
|
20
20
|
declining to issue a session would leave the actor running every subsequent
|
|
21
21
|
request unauthenticated, and the scenario would report the resulting refusals as
|
|
@@ -18,7 +18,7 @@ it is closed the same way: `runPikkuFunc` resolves both from the addon config.
|
|
|
18
18
|
`auth` merges as an OR and `auth: false` is ignored. The RPC path treats it as a
|
|
19
19
|
default (`addonConfig?.auth ?? options.requiresAuth`) because there the addon
|
|
20
20
|
config is the only statement of intent. On a direct wiring the route already
|
|
21
|
-
carries its own `auth`, so honouring `false` would let an addon
|
|
21
|
+
carries its own `auth`, so honouring `false` would let an addon _weaken_ a gate
|
|
22
22
|
the app wrote — the inverse of what a wiring-level declaration should be able to
|
|
23
23
|
do. An addon may require a session the wiring did not; it may never waive one
|
|
24
24
|
the wiring did.
|
package/knowledge/decisions/security/agent-gate-requires-a-session-only-when-auth-is-true.md
CHANGED
|
@@ -13,7 +13,7 @@ session presence (only when `CoreAgent.auth === true`), then `scopes`, then
|
|
|
13
13
|
`permissions`. The ordering mirrors the function runner — scopes AND together so
|
|
14
14
|
they can only narrow access, and a missing scope short-circuits before any
|
|
15
15
|
permission function does I/O. Declared `scopes` are narrowed to the generated
|
|
16
|
-
`ScopeId` union in a project's
|
|
16
|
+
`ScopeId` union in a project's `#pikku/scopes`, so an undeclared scope is a
|
|
17
17
|
compile error.
|
|
18
18
|
|
|
19
19
|
`auth` defaults to `false` (i.e. `pikkuSessionlessFunc`, not `pikkuFunc`) because
|