Configuration, defaults and limits
ExecKernel configuration belongs to the component your application constructs. Core policies, client transport options, session-store retention and deployment environment variables have separate owners. Use the tables below to find the point that controls a behavior; an option in one component does not automatically configure the others.
Engine construction and session policy
Section titled “Engine construction and session policy”The core PHP reference lists every ExecKernelFactory::build argument and type.
| Setting point | Effective default | Scope and accepted value |
|---|---|---|
Factory customRules |
[] |
Map of nonempty string rule names to nonempty handler identifiers. |
Factory timeProvider |
SystemTimeProvider |
Evaluation time. An explicit operation timestamp takes precedence. |
Factory stopwatch |
MonotonicStopwatch |
Duration measurement; distinct from logical evaluation time. |
Factory sessionTtlSeconds |
null |
Seconds; no TTL when no explicit expiration policy is supplied. |
Direct ConditionEvaluator constructor sessionTtlSeconds |
86400 |
Its own constructor default; the factory explicitly passes its nullable value. |
sessionExpirationPolicy |
SessionExpirationPolicy(sessionTtlSeconds) |
A supplied policy takes precedence over the TTL argument. |
Factory historyOverflowPolicy |
HistoryOverflowPolicy::PRESERVE |
Retains the full traversal history. |
Factory securityPolicy |
FlowSecurityPolicy::open() |
Empty language/edge restrictions and no optional depth, state-size or transition-rate limits. |
Factory payloadSanitizer |
NoopPayloadSanitizer |
No sanitation transformation by default. |
Factory sessionLock, stateVersioning, sessionIntegrity |
Corresponding null implementations | No real lock, state-hash enforcement or integrity signature supplied by omission. |
Factory sandboxDriver, pluginRegistry, versionUpgradePolicy |
null |
Application must supply the required extension or policy. |
Factory debugPayloadBuilder |
null |
Requesting debug alone does not install a detailed builder. |
| Logger, audit, metrics, tracing and error telemetry | Null/safe fallback adapters | Configure real sinks explicitly; tracing and error telemetry are wrapped by their safety adapters. |
SessionExpirationPolicy takes these optional nullable integers:
| Field | Default | Meaning |
|---|---|---|
ttl |
null |
Maximum age since createdAt, in seconds; nonnegative. |
idleTtl |
null |
Maximum time since updatedAt, in seconds; nonnegative. |
hardExpiration |
null |
Absolute Unix timestamp in seconds. |
A limit is reached at equality. If several have been reached, the reported reason follows hardExpiration, then ttl, then idleTtl. A timestamp earlier than the state’s last update is rejected. TTL 0 expires immediately. The policy evaluates expiration; it does not delete a stored row. Expiration, history and retention distinguishes those responsibilities.
For example, this fragment configures the engine used by your application:
use ExecKernel\Domain\Session\SessionExpirationPolicy;use ExecKernel\Infrastructure\Engine\ExecKernelFactory;
$engine = (new ExecKernelFactory())->build( sessionExpirationPolicy: new SessionExpirationPolicy( ttl: 3600, idleTtl: 600, ),);An API store TTL or database retention setting must be configured separately at that store.
Context and security policy
Section titled “Context and security policy”ContextValidationPolicy is supplied to Context or through FlowSecurityPolicy::contextPolicy.
| Field | Default | Type, range and effect |
|---|---|---|
maxDepth |
4 |
Integer ≥ 0; limits nested arrays when arrays are enabled. |
allowArrays |
false |
Boolean. Default values are UTF-8 strings, finite numbers and booleans. Null, objects and resources are rejected. |
keyWhitelist |
[] |
UTF-8 strings; empty means no whitelist restriction. |
keyRegex |
null |
Optional valid PHP regular expression. A key must satisfy both a configured whitelist and regex. |
Top-level keys must be strings. _execkernel, _history, _integrity and _session_age remain reserved. Context has a separate fixed limit of 128 entries. Merging contexts retains the receiver’s validation policy.
FlowSecurityPolicy field |
Default | Type, range and effect |
|---|---|---|
allowedLangs |
[] |
Nonblank UTF-8 language strings without control characters; empty imposes no policy-level language restriction. The graph’s language contract still applies. |
forbiddenEdges |
[] |
Integer edge IDs that the policy rejects. |
maxDepth |
null |
Optional integer ≥ 1 limiting traversal depth. |
maxSessionStateSize |
null |
Optional integer ≥ 1; serialized-state budget in bytes. |
transitionRateLimit |
null |
Optional TransitionRateLimit(maxTransitions, windowSeconds); both positive integers. |
contextPolicy |
null |
Optional context policy applied to operation candidates. |
The transition rate policy enforces a minimum interval of ceil(windowSeconds / maxTransitions) whole seconds between transitions. It is not the API’s request-counting window or Nginx’s per-IP limiter. Security policies and credentials explains the application’s remaining responsibilities.
Fixed runtime budgets
Section titled “Fixed runtime budgets”These are constants in ExecKernel\Domain\Engine\PerformanceBudget. They are not factory options or environment variables.
| Constant | Value | Applies to |
|---|---|---|
NODE_EXECUTION_MAX_MS |
20.0 ms |
Engine operation calculation. |
CUSTOM_RULE_MAX_MS |
2.0 ms |
Custom rule duration. |
MAX_RULE_TIME_MS |
50.0 ms |
Rule evaluation budget. |
MAX_NAVIGATION_TIME_MS |
5.0 ms |
Navigation calculation. |
MAX_PERSIST_TIME_MS |
20.0 ms |
Instrumented persistence duration. |
MAX_CONDITIONS_PER_EDGE |
32 |
Conditions attached to one edge. |
NODE_PAYLOAD_MAX_BYTES |
65536 bytes |
Decision-node payload. |
TERMINAL_PAYLOAD_MAX_BYTES |
131072 bytes |
Terminal payload. |
CONTEXT_MAX_ENTRIES |
128 |
Top-level context entries. |
CONTEXT_MAX_DEPTH |
4 |
Default context depth policy. |
HISTORY_MAX_LENGTH |
256 |
Per-list boundary under REJECT and legacy restoration checks. |
PRESERVE history does not truncate at 256. REJECT rejects an append beyond that boundary. Legacy TRUNCATE restoration has additional checks for potentially lost data; new appends normalize it to preservation. See the serialization contract.
A sandbox timeout and the runtime custom-rule budget are independent. Increasing a driver’s timeout does not increase CUSTOM_RULE_MAX_MS. Duration checks also do not create an operating-system interruption mechanism.
Loaders, import and plugins
Section titled “Loaders, import and plugins”| Setting point | Default | Effect |
|---|---|---|
SchemaImporter::timezoneId |
UTC |
Timezone used to interpret temporal input; invalid timezone IDs fail construction. |
SchemaImporter::clock |
null |
Optional explicit DateTimeImmutable; converted to the configured timezone. |
SchemaImporter::strict |
false |
Structural import/validation strictness. |
Importer/JSON loader allowedCustomHandlers |
null |
No explicit handler allowlist; [] is an explicitly empty allowlist. Declaration does not install an execution handler. |
Importer/JSON loader engineVersion |
1.0.0 |
Version string used by compatibility validation. |
Importer/JSON loader compatibilityMode |
CompatibilityMode::LOOSE |
Compatibility policy, separate from the importer’s strict flag. |
PluginRegistry engine version / mode |
1.0.0 / LOOSE |
Extension compatibility configuration, not automatic package-version discovery. |
| Default rule circuit breaker | 3 failures / 60000 ms |
RuleCircuitBreakerConfig(failureThreshold, windowMs); threshold ≥ 1, window ≥ 0. |
Version policy is specified in the compatibility matrix; handler and plugin registration in the extension contracts.
Sandbox drivers
Section titled “Sandbox drivers”All drivers below are in ExecKernel\Infrastructure\Sandbox and require a positive integer timeoutMs.
| Driver | Constructor defaults | Boundary |
|---|---|---|
FiberTimeoutDriver |
timeoutMs=50; disabledFunctions=null selects its built-in list |
Same PHP process; elapsed-time checks around cooperative Fiber execution. |
PHPDisabledFunctionsDriver |
timeoutMs=50, memoryLimit='16M', disabledFunctions=null, phpBinary='php', openBasedir=null |
PHP subprocess. Null openBasedir uses the system temporary directory as the sandbox base. |
DockerIsolatedDriver |
executor=null, command=null, timeoutMs=200, workingDirectory=null, env=[] |
Transport to a supplied launcher, or an in-process executor callback. |
Supplying disabledFunctions replaces the driver’s default list. For Docker’s adapter, a callback takes precedence over a command. Without either, execution returns a sandbox failure. The command itself must provide the intended isolation; the class does not create containers automatically. Consult Rule sandboxing before choosing the boundary.
Webhook delivery
Section titled “Webhook delivery”ResilientWebhookDispatcherConfig requires retryPolicy, timeoutMs, circuitBreaker and idempotency. There is no global default delivery configuration.
| Configuration object | Required fields and validation |
|---|---|
WebhookRetryPolicy |
maxAttempts ≥ 1; baseDelayMs ≥ 0; finite multiplier ≥ 1; maxDelayMs ≥ 0. A zero maximum delay removes that cap, with integer overflow saturation. |
WebhookCircuitBreakerConfig |
failureThreshold ≥ 1, recoveryTimeoutMs ≥ 0, successThreshold ≥ 1. |
WebhookIdempotencyConfig |
enabled, headerName and key generator. When enabled, header name must be nonempty and cannot be Content-Type, Accept or X-ExecKernel-Signature. |
Dispatcher timeoutMs |
Positive integer, in milliseconds. |
These configure the dispatcher your application creates. Graph webhook fields and HMAC inputs have their own webhook contract. A secret string in a graph is literal; environment placeholders are not expanded automatically.
SDK clients
Section titled “SDK clients”| Owner and option | Default | Scope and restriction |
|---|---|---|
PHP ExecKernel\Config\Config::baseUrl |
Required | Remote HTTP(S) URL with host, no userinfo, query, fragment, spaces or control characters. Trailing slashes are removed when read. |
PHP authToken / correlationId |
null / null |
Optional outbound authentication and correlation. |
PHP timeoutSeconds |
10 |
Positive integer seconds. Used by the native HTTP transport. |
PHP local |
false |
Config::local() creates the local configuration. |
PHP retryPolicy |
RetryPolicy::noRetries() |
retries=0 and backoffMs=0. Both nonnegative; backoff must fit the conversion to microseconds. |
PHP PSR-18 GuzzleTransport |
Supplied client configuration | Its client owns the deadline; it does not apply Config::timeoutSeconds. |
| JavaScript transport | Global fetch or supplied fetchImpl |
No SDK retry, timeout or abort-signal option; redirect handling is manual. |
| JavaScript authentication/correlation | Optional | Applied by the configured transport; not a server-side access policy. |
PHP retries are limited to read-only inspect/status transport connection or timeout exceptions whose retryable_transport marker allows retry. Mutation operations are not automatically repeated. See the PHP and JavaScript references for complete constructors and operation contracts.
Standalone API composition
Section titled “Standalone API composition”ExecKernelApi\Http\createApp accepts the engine and graph loader, with the following options:
| Option | Default | Scope |
|---|---|---|
sessionStore |
API NullSessionStore |
The standalone API store interface, distinct from the core store interface. |
metricsRegistry |
New EndpointMetricsRegistry |
Metrics for this application instance. |
rateLimitRequests |
30 |
Positive integer requests per tracked session/window. |
rateLimitWindowSeconds |
60 |
Positive integer seconds. |
shouldApplyRateLimit |
null |
Optional predicate; takes precedence over an endpoint list. |
rateLimitTargetEndpoints |
null |
A nonempty list customizes matching when no predicate is supplied. Omitted or empty uses the middleware default: /execkernel/session/next and /execkernel/session/resume. |
The request limiter holds process-local state and tracks at most 4096 active session buckets. Its default clock is time(). It is not shared across workers. The bundled deployment explicitly supplies a predicate that disables this limiter and uses ingress limiting instead.
Deployment environment and ingress
Section titled “Deployment environment and ingress”These variables belong to the standalone API deployment, not the core library:
| Setting | Default | Where applied |
|---|---|---|
EXECKERNEL_BIND |
127.0.0.1 |
Compose host bind address. |
EXECKERNEL_PORT |
4320 |
Compose host port, forwarded to web 8080. |
EXECKERNEL_API_IMAGE / EXECKERNEL_WEB_IMAGE |
execkernel-api:local / execkernel-web:local |
Compose image names. |
EXECKERNEL_SESSION_TTL_SECONDS |
86400 |
Runtime positive integer; passed to the API’s PDO session store. |
EXECKERNEL_SQLITE_PATH |
/var/lib/execkernel/sessions.sqlite |
Runtime database path; this path is set explicitly in Compose. |
EXECKERNEL_GRAPH_DIR |
/app/resources/graphs |
Runtime catalogue directory; set explicitly in Compose. The image contains a copied catalogue by default. |
EXECKERNEL_API_TOKEN_FILE |
Runtime: /run/secrets/api_token; Compose host source: ./.secrets/api-token |
Runtime reads and trims the file. Token must contain 32–256 ASCII letters, digits, underscores or hyphens. |
EXECKERNEL_COMPOSER_AUTH_FILE |
./.secrets/composer-auth.json |
Host source of the build secret. |
EXECKERNEL_GRAPH_HOST_DIR |
No default | Required only by the optional catalogue bind-mount override; source directory must already exist. |
Runtime environment lookup uses the listed fallbacks; changing a host path variable does not override a literal environment value already set by Compose. The token source on the host and the token path inside the container are different locations.
| Bundled file | Default limit |
|---|---|
| Nginx | 128k request body; 10s body timeout; 35s send/read timeout; 3s FastCGI connect timeout; 15s keepalive. |
| Nginx API ingress | 10 requests/s per IP, burst=40, nodelay; rejected requests return 429. |
| PHP INI | memory_limit=128M, max_execution_time=25 seconds, post_max_size=128K; uploads disabled. |
| PHP-FPM | One static child, pm.max_requests=500, request_terminate_timeout=30s. |
These are values in the bundled deployment files, not a single automatic timeout hierarchy. API configuration and access explains their operational interaction.
Error telemetry and analysis limits
Section titled “Error telemetry and analysis limits”RateLimitedErrorTelemetryEmitter defaults to a 5-second window, 50 events per session bucket, minimum severity RULE_FAILURE, debug=false, 4096 buckets and 8192 fingerprints. maxPerSession=0 disables that quota; capacity and other filters still apply. An explicit allowedSeverities list takes precedence over the minimum severity; [] rejects all severities. Debug bypasses these filtering/quota checks. The limiter uses delivery time, not the event timestamp, and a preconfigured limiter is preserved when wrapped.
The optimizer’s default exploration bounds are 1000 paths and 100000 work units, each configurable up to 1000000. Its warning thresholds and CLI-specific defaults are in CLI commands.