Skip to content

[Low priority] Make all PR #609 resource-budget policies overrideable through .wflcfg #612

Description

@logbie

Summary

Follow-up to PR #609.

PR #609 intentionally ships conservative, safe defaults for execution budgets, stack safety, parsing/analysis checkpoints, pattern execution, source loading, HTTP admission/body/response handling, and WebSocket capacity. Keep those defaults, but make every user-relevant limit or policy introduced or consolidated by the PR overrideable through a project .wflcfg when an operator has a legitimate need to raise or lower it.

This is low priority for now. The current defaults should remain unchanged and safe.

Scope

Audit the complete PR #609 surface, including all later remediation commits and issue #611, and classify every constant/default as one of:

  1. Public operational policy — must have a documented .wflcfg override.
  2. Internal sampling/implementation detail — should remain private unless a real operational use case justifies exposing it.
  3. Safety invariant — may be configurable only with validation, warnings, or an explicit unsafe/advanced opt-in.

At minimum, verify configurability and consistent propagation for:

  • overall execution timeout and cooperative cancellation behavior;
  • maximum interpreter operations;
  • call/recursion depth, including the conservative direct-embedding default;
  • import/include and execute file depth;
  • maximum source size for CLI, REPL, modules, includes, and nested execution;
  • pattern transition/step and active-state ceilings;
  • HTTP request-body and response-body limits;
  • HTTP pending/in-flight admission and bounded request queue capacity;
  • HTTP body/handler response timeout;
  • WebSocket queue, queued-byte, and connection ceilings;
  • interpreter stack sizing / stack-safety policy where it is controlled by WFL;
  • any other user-visible resource ceiling added or centralized by PR feat: add shared ExecutionBudget consolidating runtime resource caps #609.

Also audit constructors and entry points. A value loaded from .wflcfg should reach the CLI, REPL, nested interpreters, modules/includes, pattern VM, HTTP/WebSocket transports, and supported embedding runners without silently falling back to a different hard-coded value.

Important distinction

Do not automatically expose hot-loop implementation constants such as lexer checkpoint stride or cooperative-yield sampling stride merely because they are constants. Expose them only if users need them to control observable behavior. Deadline/cancellation correctness must not depend on making sampling internals configurable.

Proposed behavior

  • Existing values remain the defaults.
  • Local/project .wflcfg overrides global configuration following the existing precedence rules.
  • Invalid, zero, overflowing, or dangerous values receive clear validation errors or documented sentinel behavior.
  • Safety-sensitive overrides have documented consequences. For example, a high recursion limit without an adequate interpreter stack must not quietly reintroduce native stack overflow risk.
  • Config-taking library APIs continue to honor explicit caller configuration; define clearly how filesystem .wflcfg applies to embedding APIs such as Interpreter::new().
  • Configuration checker/fixer, reference docs, examples, and generated/default config are updated together.

Acceptance criteria

  • Inventory every resource limit and user-visible policy introduced or changed by PR feat: add shared ExecutionBudget consolidating runtime resource caps #609.
  • Each public operational setting has a documented .wflcfg key and default.
  • All execution entry points consistently receive the resolved values.
  • Configuration precedence and embedding behavior are explicitly documented.
  • Dangerous combinations are rejected or produce actionable warnings.
  • Config checker/fixer recognizes every new key.
  • Tests cover default behavior, overrides, invalid values, precedence, and propagation into nested/runtime transport paths.
  • No current safe default is weakened.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions