Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

Custom functions in the specification — the part that is tied to a language #29

Open

Description

@kinlane

Named in office hours on 2026-08-21 as one of three areas of the format that need research and
workshopping before any normative wording is attempted. Not previously filed.

The question asked directly on the call — "is the spec going to also cover custom functions,
the interfaces?"
— was answered yes. The response from the person who maintained the
implementation was equally direct:

That's going to be very tricky, right… it's kind of tied to a language after all.

Why this is hard, specifically

Everything else in the ruleset format is data. Custom functions are code, and code has a
runtime. The moment the specification says anything normative about them it is making claims
about a language:

  • The function signature and its inputs. What a function receives (the targeted value, the
    path, the rule options, document context) and in what shape.
  • The return contract. What a violation looks like coming back, and how a function reports
    more than one.
  • Options and their validation. Functions today declare an options schema; is that
    normative, and in what schema language.
  • Resolution and packaging. How a ruleset names a function and how an implementation finds
    it — a filesystem path and a JS module today. A Go implementation cannot honor that, and a
    browser implementation honors it differently again.
  • The built-in set. truthy, falsy, pattern, schema, length, casing, and the rest
    are the part every implementation must agree on. They are separable from the custom-function
    extension point and are probably the part that can actually be made normative first.

The likely shape of the answer

Split the problem before trying to specify it:

  1. Built-in functions — normative, testable, engine-agnostic, and in scope for the
    conformance suite (Build the conformance suite — and no blessed implementation #9). Almost certainly required for compliance.
  2. The custom-function extension point — specify the contract (inputs, outputs, options
    schema, error semantics) without specifying the binding, and let each implementation
    declare its own binding. A ruleset that uses custom functions is then explicitly portable
    only across implementations that share a binding, and the specification says so out loud
    rather than pretending otherwise.
  3. A conformance tier for it. This maps neatly onto the MUST/MAY tiering discussed in Build the conformance suite — and no blessed implementation #9 —
    built-ins in the MUST tier, custom-function support in a MAY tier.

That split is a proposal, not a decision. What this issue needs is someone to work through
whether it holds up against the real implementation surface.

Related: #2, #9, #11.

Activity

  1. added
    question
    roadmap
    maturity:discussing
    on Aug 21, 2026
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

    maturity:discussingquestionroadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions