Skip to content

Emulator runner: match Actions in the expression functions a deferred expression can reach #74

In review

Description

@waynesun09

Since #35, the server leaves an expression that reads a runner-only value (github.workspace, github.token, job.status and the others) for the runner. The emulator's own runner (src/runners/emulator/runner.py) then evaluates the whole expression with _StepIfParser. That parser now matches the server for operators, accessors after a call, ==/!=, fromJSON, toJSON, join and the status functions. A few functions still differ from Actions and from the server's evaluator (src/app/services/workflow_expressions.py).

Still to align

Function or behaviour Actions and the server Emulator runner today
contains(search, item) Case-insensitive for strings; for an array, an item matches by Actions' loose equality Case-sensitive; Python in
startsWith, endsWith Case-insensitive Case-sensitive
Filter accessors (a.*.b) on a value the runner resolves Supported Not supported (the server resolves filters on its own values before deferring)

Example: ${{ github.workspace && contains('ABC', 'a') }} renders true on GitHub, but false on the emulator's runner.

Also noted

_json_literal hides braces behind the U+FDD0 and U+FDD1 noncharacters while it encodes. An input that already contains one of those characters round-trips as a brace. Escaping braces directly inside the encoded JSON strings would remove the collision.

Tests to add

For each row, render server-side with a runner-only operand, then render the result on the emulator's runner, and compare with the value Actions gives.

Found in the review of #35. Part of #39.

Activity

  1. fullsend-ai-triage commented on Nov 19, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 7:16 PM UTC · Completed 7:18 PM UTC

    Commit: 69c2a2b · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.18

  2. fullsend-ai-triage commented on Nov 19, 2026

    @fullsend-ai-triage

    The issue is clear, but the code it describes is not on the main branch yet. The runner-side parser changes (fromJSON, toJSON, join, accessors after a call) and the brace-hiding in the server's JSON literal encoder exist only on the branch of PR #35, which is still open. On main, the runner's expression function handling is the older version, and the encoder doesn't use the noncharacter approach the issue describes.

    PR #35 doesn't resolve the items listed here. It keeps contains, startsWith and endsWith case-sensitive and adds no filter-accessor support for runner-resolved values. So it is a prerequisite rather than a fix. Work on this issue should start once #35 is merged, or be based on its branch.

    Once unblocked, the scope is:

    • Make contains, startsWith and endsWith case-insensitive for strings, and use Actions' loose equality when matching array items.
    • Support filter accessors (a.*.b) on values the runner resolves.
    • Replace the noncharacter brace hiding in the JSON literal encoder by escaping braces directly inside the encoded JSON strings.

    Proposed tests: for each row, render server-side with a runner-only operand, then evaluate the result on the emulator runner and compare with Actions' value. Include contains('ABC', 'a') (true), startsWith('ABC', 'ab') and endsWith('ABC', 'bc') (true), array membership with mixed-type items, a filter accessor on a runner-resolved object array, and an input string that contains U+FDD0 or U+FDD1 round-tripping unchanged.

    Blocked by:

  3. waynesun09 commented on Nov 19, 2026

    @waynesun09
    MemberAuthor

    Also from the #35 review: reject expressions in a step's uses (GitHub does), with a test that a server-resolved action reference containing ${{ github.token }} is neither evaluated nor logged; and a round-trip test for U+FDD0/U+FDD1 in deferred expressions.

  4. added
    ready-to-code
    and removed on Dec 3, 2026
  5. jctanner commented on Dec 3, 2026

    @jctanner
    Collaborator

    Unblocking: the prerequisite PR #35 merged on 2026-11-20; both the server parser (src/app/services/workflow_expressions.py) and the runner (src/runners/emulator/runner.py) are on main.

    Scope:

    1. Make contains, startsWith and endsWith case-insensitive for strings, and use Actions' loose equality when matching array items.
    2. Support filter accessors (a.*.b) on values the runner resolves.
    3. Replace the noncharacter brace hiding (\ufdd0/\ufdd1, workflow_expressions.py) by escaping braces directly inside the encoded JSON strings.
    4. From the review additions: reject expressions in a step's uses (GitHub does) — a server-resolved action reference containing ${{ github.token }} must be neither evaluated nor logged; and a round-trip test for U+FDD0/U+FDD1 in deferred expressions.

    Proposed tests per row: render server-side with a runner-only operand, evaluate on the emulator runner, compare with Actions' value — contains('ABC', 'a') true, startsWith('ABC', 'ab') and endsWith('ABC', 'bc') true, array membership with mixed-type items, a filter accessor on a runner-resolved object array, and an input string containing U+FDD0 or U+FDD1 round-tripping unchanged.

  6. jctanner commented on Dec 3, 2026

    @jctanner
    Collaborator

    /fs-code

  7. fullsend-ai-coder commented on Dec 3, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 10:33 PM UTC · Completed 11:09 PM UTC

    Commit: fdad287 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $4.34

  8. added 2 commits that reference this issue on Dec 3, 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

    ready-to-code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions