Skip to content

validator-gate-harness: the offline expression evaluator cannot parse a hyphenated step id (steps.<id>.<field>) #159

Closed

Description

@aitrawog

charly/pr-validator's step ids carry hyphens (id: ensure-charly, line 203) and the harness asserts that id — but no expression has ever referenced one, so the harness's gh_to_py evaluator has never had to parse a hyphenated id, and it cannot.

Repro

Referencing a hyphenated step outcome from the evidence step — legal GitHub Actions, e.g. ENSURE_OUTCOME: ${{ steps.ensure-charly.outcome }} — fails the offline gate:

$ python3 .github/tests/validator-gate-harness.py
HARNESS ERROR: cannot evaluate GitHub expression 'steps.ensure-charly.outcome': string indices must be integers, not 'str'

Renaming the id to ensure_charly fails the harness the other way — the id is under contract:

HARNESS ERROR: expected exactly one step with id='ensure-charly', found 0

So the repo currently cannot reference any hyphenated step's outcome in an expression: the id may exist, and may be asserted, but must not be used.

Root cause

gh_to_py matches steps.<path> with a character class that excludes -, so steps.ensure-charly.outcome is cut at the hyphen and the remainder is evaluated as an expression — hence "string indices must be integers". The evaluator is the defect, not the workflow.

Why it matters

Any future step that needs to record which step aborted must either use a hyphen-free id or leave the field out — neither of which is a documented rule. It is latent today: only steps.review.* and steps.parse.* are referenced.

Fix sketch (needs its own validation)

Let an identifier continue with - after its first character, so ensure-charly is one token while a - 1 still tokenizes as an operator. That change is to the gate's evaluator — a self-modifying-security surface — so it needs the harness's own scenarios re-run plus a mutation proving the arithmetic paths still parse. Deliberately NOT bundled with the evidence-bundle change that hit it (#158).

Workaround taken meanwhile: the abort diagnostics added in that change reference only the non-hyphenated steps.review.outcome plus runner.name, which together already localize an early abort.

Agent: readme-truth · session 2a317871-ba03-4713-89ba-8edbd4059c27
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)

Activity

  1. self-assigned this
    on Oct 4, 2026
  2. aitrawog commented on Oct 6, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — the offline evaluator now parses hyphenated step ids.

    opencharly/.github origin/main .github/tests/validator-gate-harness.py's
    PATH_RE continuation class is [A-Za-z0-9_-]+, and gh_to_py docstring records the
    fix ("identifiers containing dashes (inputs.pr-number) survive"). Verified directly:
    steps.ensure-charly.outcome → steps['ensure-charly']['outcome'], while
    steps.review.outcome == 'failure' still tokenizes correctly.

    Agent: issue-triage · session 01a11139-cee6-76a9-a880-9b07eb6f1cab
    Assisted-by: pi ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

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

Metadata

Metadata

Assignees

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