Skip to content

Fill the github context and runner environment as GitHub does - #35

Merged
waynesun09 merged 15 commits into
mainfrom
emu-08-actions-context
Nov 20, 2026
Merged

waynesun09 merged 15 commits into
mainfrom
emu-08-actions-context

Conversation

@waynesun09

@waynesun09 waynesun09 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Part of #39

What this fixes

The github context in a workflow on the emulator differed from GitHub's in three areas. Steps read the wrong values, and the runner left several GITHUB_* variables unset.

Identity values. These were empty in expressions the emulator rendered: actor, actor_id, triggering_actor, api_url, graphql_url, repository_id, repository_owner_id, run_attempt and workflow_ref. The job message's github context lacked actor, actor_id, triggering_actor and workflow_ref, so GITHUB_ACTOR, GITHUB_ACTOR_ID, GITHUB_TRIGGERING_ACTOR and GITHUB_WORKFLOW_REF were unset. REST runs had no run_started_at or display_title, and jobs had no created_at, head_sha or head_branch.

Rendering of run:, with: and env:.

Expression GitHub Emulator before
${{ inputs.flag }} (false) false False
${{ github.event_name == 'x' }} false empty
${{ inputs.name || inputs.flag }} false False
github.ref_name, ref_type, ref_protected, workflow_sha, repository_visibility, repositoryUrl, retention_days set empty
github.token, github.workspace, github.job, github.event_path, github.action, job.status ... the runner's value empty
${{ github.token != '' }} true empty
${{ github.run_attempt }} on a re-run 2 1

GITHUB_REF_NAME, GITHUB_REF_TYPE, GITHUB_REF_PROTECTED, GITHUB_WORKFLOW_SHA and RUNNER_ENVIRONMENT were unset on the runner.

Authentication answers.

Request GitHub Emulator before
GET /installation/repositories with a job's GITHUB_TOKEN 200, the run's repository, repository_selection: selected 403 "Resource not accessible by personal access token"
Any route with an unknown, revoked or expired credential 401 "Bad credentials" 401 "Requires authentication"

Clients that probe /installation/repositories to tell an installation token from a personal access token took a job token for a PAT.

Changes

  • github_identity_context fills the nine values for rendering and for the job message. Ids and run_attempt are strings, as GitHub gives them. It reads columns only, not whole entities.
  • Runs report run_started_at and display_title: the pull request's or issue's title, the head commit's first line, or the workflow name. Jobs report created_at, head_sha and head_branch.
  • render_expressions writes a false result as false, a null one as empty, and takes a || b as the first truthy alternative, else the last.
  • static_github_facts fills the ref, sha and repository facts, with ref_protected as a boolean. They go into both rendering and the job message. system.runnerEnvironment is github-hosted.
  • In run:, with: and env:, an expression that reads a value only the runner knows is left for the runner, with the server's own values bound in. A bound string quotes a quote as '', which the runner's parser expects. job.workflow_* stay the server's to render, because the runner gets no job context for them. Outside steps, for example in a concurrency group, nothing evaluates the expression again, so those values still render empty.
  • The re-run route passes the attempt number to create_workflow_run, which sets it before the steps render.
  • GET /installation/repositories with a job token lists the run's repository. A personal access token still gets 403.
  • The 401 handler says "Bad credentials" when an Authorization header was sent.
  • Bug ledger entries docs/bugs/fixed/github-context-identity-values-are-empty.md and docs/bugs/fixed/rendered-github-context-differs-from-github.md, with their PLAN.md lines.

Tests

Every new test fails on main, except the one that guards existing behaviour:

File Tests On main
tests/actions/test_github_identity_context.py 4 all fail
tests/actions/test_render_github_parity.py 10 the module does not import (ref_facts is new)
tests/actions/test_job_token_installation_routes.py test_a_job_token_lists_its_own_repository, test_a_refused_credential_is_bad_credentials fail
test_a_personal_access_token_is_still_refused passes (guard)

Full suite: runs in this pull request's CI.

Effect on existing behaviour

  • Expressions that rendered False or empty for a false value now render false. That includes job names, concurrency groups and job outputs, which now match GitHub.
  • A step's run:, with: or env: that reads a runner-only value now gets the runner's value, not an empty string.
  • A 401 for a bad credential now says "Bad credentials". The WWW-Authenticate header for git clients is unchanged.

Known gaps, not changed here

  • A re-run is a new run whose actor is the user who asked for it, so actor and triggering_actor are both that user. On GitHub actor stays the user who started the first attempt. Fixing it needs a new column.
  • display_title does not use the workflow's run-name:.
  • github.job comes from the job's display name, for example build (3.11), where GitHub gives the YAML key.

@waynesun09
waynesun09 requested a review from jctanner November 18, 2026 22:41
@qodo-code-review

qodo-code-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Match GitHub Actions context, runner variables, and token responses

🐞 Bug fix ✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Fill GitHub identity and repository context values so steps and runner variables match GitHub.
• Correct expression rendering and expose missing workflow run and job API fields.
• Treat job tokens as installation tokens and distinguish refused credentials from missing
 credentials.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 3 capabilities

  • 3 affected capabilities span independent functional scopes: GitHub Actions workflow execution, GitHub Actions workflow integration, GitHub-compatible API authentication integration.
  • The server renderer and runner jointly determine the same end-to-end workflow step behavior: rendered run/with/env/working-directory/shell values and step conditions.
  • They are implementation hops of one bounded workflow-execution capability, not separate capabilities.
  • Run creation, job-message construction, runner context, rerun initialization, and REST serialization all support the bounded integration that presents a workflow run consistently to steps, runners, and API clients.
  • The propagation path crosses components but remains one functional scope.
  • The changed request classification and response branches serve one bounded authentication integration: clients determine credential type and handle authenticated versus unauthenticated API responses.
  • The installation route and generic 401 wording are distinct surfaces but the same integration outcome, not separate deployment scopes.
Behavioral complexity 🟡 Medium 🧩 Multiple interactions

  • Before: the server mostly resolved expressions to strings and the runner handled a smaller expression subset.
  • After: server-known and runner-only contexts are deliberately split, values may be encoded as JSON expressions, and the runner adds coercion, object access, functions, status-sensitive evaluation, and comparison semantics.
  • New correctness conditions: the two evaluators must agree on quoting, truthiness, type coercion, deferred values, nested accessors, and expression-bound data without allowing resolved text to become executable expression syntax.
  • These are interacting staged states and compatibility cases, not merely reuse of an existing parser.
Potential damage 🟡 Medium 🩹 Incorrect results

  • A wrong expression result can skip a required step, run an unintended step, or pass incorrect data to an action or command.
  • Reverting code can restore future runs, but already executed commands or external effects require workflow-specific reruns or compensation; no automatic repair of those effects is shown.
  • Future behavior is recoverable by code rollback and rerun.
  • Affected completed runs may require manual rerun or external compensation, and persistent artifacts or deployments are not automatically repaired.
Assessed commit c986516
Diagram

graph TD
  Run["Run records"] --> Context["Context builders"] --> Render["Expression rendering"] --> Payload["Job payload"] --> Runner["Actions runner"]
  Context --> Payload
  Run --> API["Run and job API"]
  Payload --> Auth["Token resolution"] --> Installation["Installation API"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Share one GitHub context factory
  • ➕ Reduces drift between server-rendered values and runner job context.
  • ➖ Must accommodate runner-specific URLs, secrets, and values unavailable during run creation.
2. Defer all step expressions to the runner
  • ➕ Relies more heavily on the runner's native expression evaluator.
  • ➖ The runner cannot resolve all server-only contexts, so mixed expressions still need server-side binding.

Recommendation: Keep the selective rendering approach: it preserves runner-owned values while binding server-only facts, and shares static GitHub facts across both paths. A unified context factory is worth considering if the remaining duplicated identity fields begin to diverge.

Files changed (14) +578 / -39

Enhancement (2) +9 / -4
deps.pyAttach the workflow run to validated job requests +4/-4

Attach the workflow run to validated job requests

• Stores the validated run on request state so installation routes can identify the repository associated with a job token.

src/app/api/deps.py

actions.pyDeclare additional run and job response fields +5/-0

Declare additional run and job response fields

• Adds optional run start time and display title fields, plus job creation time, head SHA, and head branch fields.

src/app/schemas/actions.py

Bug fix (6) +205 / -35
actions.pyExpose run titles, timestamps, and job head fields +22/-2

Expose run titles, timestamps, and job head fields

• Derives event-specific display titles and adds missing REST run and job fields. Passes the incremented attempt into re-run creation so steps render the correct attempt.

src/app/api/actions.py

actions_distributed_task.pyFill runner job context and environment +14/-1

Fill runner job context and environment

• Adds actor, triggering actor, workflow ref, and static GitHub facts to the job message. Sets the runner environment to github-hosted.

src/app/api/actions_distributed_task.py

apps.pyList the run repository for a job token +22/-0

List the run repository for a job token

• Makes the installation repositories endpoint return the job token's repository with selected scope. Personal access tokens remain forbidden, while refused credentials receive a distinct 401 message.

src/app/api/apps.py

error_handler.pyDistinguish refused from absent credentials +7/-2

Distinguish refused from absent credentials

• Returns GitHub's Bad credentials message for 401 responses when an Authorization header was sent, while retaining Requires authentication when none was sent.

src/app/middleware/error_handler.py

workflow_expressions.pyCorrect rendering and preserve runner-owned expressions +54/-16

Correct rendering and preserve runner-owned expressions

• Renders booleans and OR fallbacks with GitHub-compatible values and derives ref names and types. Preserves runner-only expressions in step values while binding server context with Actions-compatible quoting.

src/app/services/workflow_expressions.py

workflow_service.pyBuild GitHub context before rendering workflow steps +86/-14

Build GitHub context before rendering workflow steps

• Derives identity and static GitHub facts for run expressions and step rendering, using targeted column queries. Enables runner-side evaluation for step run, with, and env values, and sets the attempt before rendering re-runs.

src/app/services/workflow_service.py

Tests (3) +265 / -0
test_github_identity_context.pyTest identity context, API fields, and re-run attempts +100/-0

Test identity context, API fields, and re-run attempts

• Checks rendered step environment, runner job context, run and job REST fields, and the attempt value rendered into a re-run step.

tests/actions/test_github_identity_context.py

test_job_token_installation_routes.pyTest installation routes and credential responses +62/-0

Test installation routes and credential responses

• Verifies that a job token lists only its repository, a personal access token remains forbidden, and refused versus missing credentials receive different 401 messages.

tests/actions/test_job_token_installation_routes.py

test_render_github_parity.pyTest GitHub-compatible expression rendering +103/-0

Test GitHub-compatible expression rendering

• Covers boolean and fallback rendering, static ref and repository facts, runner-deferred expressions, server-context binding, and Actions string quoting.

tests/actions/test_render_github_parity.py

Documentation (3) +99 / -0
PLAN.mdIndex the two resolved GitHub parity bugs +2/-0

Index the two resolved GitHub parity bugs

• Adds links to the identity-context and rendered-context bug records.

PLAN.md

github-context-identity-values-are-empty.mdDocument missing identity context and API fields +43/-0

Document missing identity context and API fields

• Records the missing GitHub identity values, runner variables, run and job fields, and re-run behavior. Notes remaining actor-attribution and run-name gaps.

docs/bugs/fixed/github-context-identity-values-are-empty.md

rendered-github-context-differs-from-github.mdDocument expression and authentication parity fixes +54/-0

Document expression and authentication parity fixes

• Describes corrected rendering, runner-owned values, runner environment, installation repository responses, and 401 messages.

docs/bugs/fixed/rendered-github-context-differs-from-github.md

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:44 PM UTC · Completed 10:54 PM UTC

Commit: 2e0371a · View workflow run →

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

@qodo-code-review

qodo-code-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Protected branches appear unprotected ✓ Resolved

Resolving commit: aac88c8

Resolution reason
static_github_facts now takes a protected argument computed by a per-repo, per-branch lookup
(_branch_protected for server context; repo.branches check in _job_request_message for the job
message), so ref_protected reflects the branch's stored protection state instead of always False. A
test asserts ref_protected flips to True when the branch is protected.
Description
static_github_facts always sets ref_protected to False rather than reading the protection
state of the triggering ref. A workflow on a protected branch therefore receives false in
expressions and GITHUB_REF_PROTECTED, including conditions that depend on that value.

2. Local steps lose false comparisons ✓ Resolved

Resolving commit: aac88c8

Resolution reason
The local runner's _render_local_action now returns "false" for a boolean False result and "" only
for None, so false comparisons such as ${{ github.workspace == 'nowhere' }} render as "false"
instead of empty. A test covers this case.
Description
render_expressions now leaves comparisons involving runner-filled values for the local runner,
whose _render_local_action converts a parsed False result to an empty string. For example, `${{
github.workspace == '' }}` evaluates false on the runner but produces an empty step value instead of
false.

3. Quoted inputs break deferred steps ✓ Resolved

Resolving commit: aac88c8

Resolution reason
The runner's string tokenizer now accepts doubled apostrophes ('(?:''|\\.|[^'])*') and the string
decoder converts '' to a single apostrophe in src/runners/emulator/runner.py (_StepIfParser), and
_render_local_action resolves via this parser. A test
(test_the_emulator_runner_finishes_what_the_server_leaves) asserts format('{0}', 'Don''t') renders
as "Don't" through the runner's render path. This addresses the parser mismatch the finding
describes, though the fix is in the runner's _StepIfParser rather than the suggested
decoder/tokenizer in the same region, and the string decoder also handles the backslash form for
older records.
Description
_as_literal now doubles apostrophes in server values, but the local runner's expression parser
treats the first apostrophe as the end of the string. When a step mixes a runner value with an input
such as Don't, the resulting expression fails to parse and reaches the step unchanged.

View medium (4)
4. Installation probe loads a repository's issues and labels ✓ Resolved

Resolving commit: aac88c8

Resolution reason
The db.get(Repository, ...) call in the job-token branch was replaced with a column-only select of
Repository.id, full_name, name and private filtered by workflow_run.repo_id, with a comment
explaining that the entity would eagerly load issues, labels, branches. This matches the suggested
fix prompt exactly, so the eager loading of a repository's related rows no longer happens on this
probe.
Description
The new job-token branch of list_token_installation_repositories calls `db.get(Repository,
workflow_run.repo_id) and only reads id, full_name, name and private. Repository` eagerly loads
collaborators, stars, branches, labels, milestones and issues through lazy="selectin", so every
probe from a job token fetches all of a repository's issues and related rows just to return four
columns.

5. Local steps retain status expressions ✓ Resolved

Resolving commit: aac88c8

Resolution reason
The emulator runner now recognizes the job context root and supplies job.status (success or failure
based on prior step results) when rendering local steps, so ${{ job.status }} no longer remains
literal text.
Description
_RUNNER_FILLED defers job.status, but the local runner has no job expression context. In a
local job, a step using ${{ job.status }} in run or env receives the literal expression rather
than a status value.

6. Push runs show the workflow as title ✓ Resolved

Resolving commit: aac88c8

Resolution reason
Adds head_commit {id, message} to the push event payload, resolved from the head SHA via
get_commit_info, so _display_title finds the commit message for ordinary pushes and shows its first
line instead of the workflow name. A test covers the normal push title.
Description
_display_title reads head_commit.message for a push title, but process_push_event does not
place head_commit in its payload. Ordinary pushes therefore take the workflow-name fallback, so
the new display_title field never shows their head commit's first line.

7. Step working directories still lose runner-only paths ✓ Resolved

Resolving commit: aac88c8

Resolution reason
The commit changes the for_runner condition in build_steps_data to key in ("run", "with",
"working-directory", "shell"), exactly as the suggested fix prompt recommends, so working-directory
and shell expressions with runner-only values are left for the runner. A test
(test_working_directory_and_shell_leave_runner_values_for_it) covers the working-directory case.
Description
build_steps_data sets for_runner only for run and with, so working-directory (and shell)
still go through the old path. There, ${{ github.workspace }} and the other values the PR now
leaves for the runner render as an empty string. A step written as `working-directory: ${{
github.workspace }}/app reaches the runner as /app` and runs in the wrong directory or fails, even
though the runner evaluates workingDirectory through the same _template_mapping inputs as
script.


Informational

8. Re-run jobs still report attempt 1 ✓ Resolved

Resolving commit: aac88c8

Resolution reason
In create_workflow_run, the WorkflowJob's hard-coded run_attempt=1 is replaced with
run_attempt=run_attempt, so re-run jobs record the run's attempt number. A test also asserts
job.run_attempt == 2 for a re-run.
Description
create_workflow_run now accepts run_attempt and stores it on the run, but each WorkflowJob it
creates still gets a hard-coded run_attempt=1. On a re-run, the REST job objects (_job_json
returns j.run_attempt) report attempt 1 while the run and github.run_attempt report 2, and so
does the job message's fallback when the run is missing.

Grey Divider

Context sources
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 6 rules
✅ Web pages:
  +7 more
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/fullsend (sha: f28397f5) — View relationship
✅ Context preparation
  Commit messages: summarized; full text retained for this review
Review mode: Auto: 🧠 Deep: Broad behavioral, authentication, expression, and runner-context changes create many independent defect opportunities.

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/app/services/workflow_service.py Resolved
Comment thread src/app/api/actions.py Resolved
Comment thread src/app/services/workflow_service.py Resolved
Comment thread src/app/api/apps.py Resolved
Comment thread src/app/services/workflow_service.py Resolved
@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 18, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate risk change across 19 files improving workflow expressions and Actions runner parity without touching protected paths or dependencies, preserved at score 2 due to low author contention, zero reverts, and strong test coverage despite moderate churn and direct behavior modifications without feature flags.

Previous run

Risk Assessment: moderate (2/5)

Details

Moderate risk change across 18 files improving workflow expressions and Actions runner parity without touching protected paths or dependencies, preserved at score 2 due to low author contention, zero reverts, and strong test coverage despite moderate churn and direct behavior modifications without feature flags.

Previous run (2)

Risk Assessment: moderate (2/5)

Details

Moderate risk change across 18 files with unflagged runtime behavior modifications balanced by zero protected paths, single-author stability, zero reverts, and close alignment with tracking issue #39.

Previous run (3)

Risk Assessment: moderate (2/5)

Details

Moderate risk change across 18 files with unflagged runtime behavior modifications balanced by zero protected paths, single-author stability, zero reverts, and close alignment with tracking issue #39.

Previous run (4)

Risk Assessment: moderate (2/5)

Details

Moderate risk change across 18 files with unflagged runtime behavior modifications balanced by zero protected paths, single-author stability, zero reverts, and close alignment with tracking issue #39.

Previous run (5)

Risk Assessment: moderate (2/5)

Details

Moderate risk: large change size across 18 files and unflagged modifications to existing expression rendering are balanced by zero protected paths, good test coverage, low author contention, and close tracking issue alignment.

Previous run (6)

Risk Assessment: moderate (2/5)

Details

Moderate risk: large change size across 18 files and unflagged modifications to existing expression rendering are balanced by zero protected paths, good test coverage, low author contention, and close tracking issue alignment.

Previous run (7)

Risk Assessment: moderate (2/5)

Details

Score preserved at 2 (moderate) as the change across 18 files and 971 lines fills GitHub context and runner environment without modifying protected paths or dependencies, where unflagged runtime behavior modifications remain balanced by low author contention, zero reverts, and direct alignment with tracking issue #39.

Previous run (8)

Risk Assessment: moderate (2/5)

Details

Score preserved at 2 (moderate) as the change across 18 files and 939 lines fills GitHub context and runner environment without modifying protected paths or dependencies, where unflagged runtime behavior modifications remain balanced by single-author stability, zero reverts, and close alignment with tracking issue #39.

Previous run (9)

Risk Assessment: moderate (2/5)

Details

Score preserved at 2 (moderate) as the change added expression injection hardening across 17 files and 872 lines without modifying protected paths or dependencies, where unflagged runtime behavior modifications remain balanced by single-author stability, zero reverts, and close alignment with tracking issue #39.

Previous run (10)

Risk Assessment: moderate (2/5)

Details

Score preserved at 2 (moderate) as the change expanded slightly to 17 files and 767 lines improving workflow expressions without modifying protected paths or dependencies, where modifications to existing runtime behavior without feature flags are balanced by single-author stability, zero reverts, and close alignment with tracking issue #39.

Previous run (11)

Risk Assessment: moderate (2/5)

Details

Moderate risk change with 14 files and 617 lines improving workflow expressions and Actions parity without modifying protected paths or dependencies, balanced by single-author stability and zero reverts despite moderate historical churn and fix activity.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Review

Findings

Medium

  • [logic-error] src/runners/emulator/runner.py:2103 — Composite steps do not receive the new runtime rendering arguments. _render_local_action(action_step, inputs, step_outputs, github_token, job) omits the composite's failure state and the inner step number, although the top-level path (around line 1210) passes both. After an inner step fails, a later always-running step still sees job.status == 'success', failure() == false and success() == true. github.output, github.env and github.path are also empty inside composite steps.
    Remediation: Pass "failure" if failed else "success" and the inner step number to _render_local_action before each inner step runs, and add composite-level regression tests.

Low

  • [logic-error] src/runners/emulator/runner.py:831 — format() still converts its arguments with Python str(). A deferred expression such as github.workspace && format('{0}', false) produces False, not GitHub's false. The code predates this PR but bypasses the boolean conversion it added.
    Remediation: Use _expression_string for format() arguments and test boolean arguments in deferred expressions.
  • [logic-error] src/runners/emulator/runner.py:733 — contains() is case-sensitive, unlike Actions (contains('Hello', 'hello') is false). startsWith() and endsWith() in the same dispatcher have the same gap. The PR makes more expressions reach this code.
    Remediation: Implement case-insensitive string matching and loose array-element comparison for these functions, with deferred-expression regression tests.
  • [logic-error] src/app/services/workflow_expressions.py:906 — The server's _NEEDS_PARSER_RE (line 158) does not recognise standalone !, <, >, <= or >=. ${{ !inputs.flag }} and ${{ inputs.n > 1 }} take the context-lookup fallback and render empty. The PR widened the runner's equivalent regex but not the server's.
    Remediation: Include negation and relational operators in _NEEDS_PARSER_RE and add server-side rendering tests that use no runner-only operands.
  • [logic-error] src/app/services/workflow_expressions.py:897 — Expressions containing runner.* are deferred without binding server-owned contexts, so ${{ runner.os && inputs.x }} reaches the runner with inputs.x unresolved. The runner's top-level execution has an empty inputs context. The neighbouring runner-filled github/job branch does bind server context.
    Remediation: Apply bind_server_context when deferring runner-context expressions.
  • [logic-error] src/app/services/workflow_service.py:786 — Step if: conditions that read runner-owned values (for example job.status == 'success') are still decided on the server unless they also contain a runtime function or steps. reference. They resolve to 'false' and the step is skipped. This is not a regression: _resolve_step_condition is unchanged and the PR's stated scope is run:, with: and env:. It is a parity gap next to the new job.status support.
    Remediation: In a follow-up, treat runner-owned github/job values as runtime dependencies in _resolve_step_condition, bind the server-owned operands, and test through build_steps_data.
  • [injection-vuln] src/app/services/workflow_service.py:815 — The second-evaluation protection (for_runner) covers run, with, working-directory and shell, but not uses. With uses: ${{ inputs.action }}, an input containing ${{ github.token }} is stored as an executable expression. The runner renders the whole step and writes the result into its unsupported-action log line. This is a token-disclosure path in a test-only emulator.
    Remediation: Reject expressions in uses (GitHub requires a static reference) or keep server-resolved uses values literal during the runner's rendering pass. Add a regression test that passes ${{ github.token }} through a dynamic action reference.
  • [pattern-inconsistency] src/app/api/apps.py:416 — revoke_installation_token declares current_user: CurrentUser but never uses it. After this PR, the neighbouring list_token_installation_repositories returns 401 "Bad credentials" for a refused credential, while revoke_installation_token still returns 403 for the same input.
    Remediation: Check current_user and return 401 for a refused credential, matching the listing route, or drop the unused dependency. The planned job-token revoke follow-up could also cover this.
  • [design-smell] src/app/middleware/error_handler.py:117 — http_401_handler chooses between "Bad credentials" and "Requires authentication" from the raw Authorization header and ignores exc.detail, unlike http_403_handler. The new 401 branch in apps.py computes the same header-based detail, which the handler discards.
    Remediation: Have http_401_handler read getattr(exc, 'detail', None) before falling back to the header check, or remove the duplicate computation in apps.py.

Earlier findings

  • src/runners/emulator/runner.py:831, src/runners/emulator/runner.py:733 — logic-error, reclassified medium to low. Both functions are unchanged by this PR and were already reachable before it.
  • src/app/api/apps.py:401 — pattern-inconsistency, resolved. The base-to-head diff no longer touches _issue_installation_token; its only apps.py hunk is in list_token_installation_repositories.
  • src/app/api/apps.py:427 — scope-creep, reclassified low to info. The PR body lists job-token handling on GET /installation/repositories in scope.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

1 finding(s) below the low severity threshold were not posted.

Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRl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0seyJpZCI6ImZfYjgxNzQ3NWVjZDYxMjQwMSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzkzNjA4NTgxMjNlMDgwZTQiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifV19 -->

Review

Findings

Medium

  • [logic-error] src/runners/emulator/runner.py:2103 — Composite steps do not receive the runtime status or step number when rendering expressions: _render_local_action runs with job_status=success and step_number=None even after an earlier composite step failed, so job.status/failure() render success/false and github.output/github.env render empty.
    Remediation: Pass the composite's current failure status and step number into _render_local_action; add a regression test.
  • [logic-error] src/runners/emulator/runner.py:831 — format() converts arguments with Python str(), so format('{0}', false) yields False. This PR defers more expressions to the runner with booleans bound as literals, so the path is reachable.
    Remediation: Use _expression_string for format() arguments and test booleans inside a deferred format expression.
  • [logic-error] src/runners/emulator/runner.py:733 — Runner contains()/startsWith()/endsWith() are case-sensitive, while the server parser lowercases both sides; contains('Production','prod') is false here and true on GitHub.
    Remediation: Implement case-insensitive matching in the runner, matching the server parser.

Low

  • [logic-error] src/app/services/workflow_expressions.py:906 — _NEEDS_PARSER_RE omits standalone ! and relational operators, so ${{ inputs.n > 1 }} and ${{ !inputs.flag }} render empty on the server.
    Remediation: Include unary negation and relational operators in parser dispatch, with tests.
  • [logic-error] src/app/services/workflow_expressions.py:897 — runner.* expressions are deferred without binding server-owned operands, so ${{ runner.os == inputs.os }} compares against an unbound inputs.os.
    Remediation: Call bind_server_context before deferring, as the runner-filled branch does.
  • [injection-vuln] src/app/services/workflow_service.py:815 — uses is excluded from the second-evaluation protection: uses: ${{ inputs.action }} with an input of ${{ github.token }} is re-rendered by the runner and the resolved token reaches the job log via the unsupported-action diagnostic. Requires a workflow that builds an action reference from attacker-controlled data.
    Remediation: Reject expressions in uses or preserve resolved values as literals across the runner boundary; add a regression test.
  • [pattern-inconsistency] src/app/api/apps.py:416 — revoke_installation_token declares current_user but never uses it and answers 403 for unauthenticated or revoked credentials, unlike the sibling route that this PR changed to return 401.
    Remediation: Check current_user is None and raise 401, matching the sibling route.

Earlier findings

  • src/app/services/workflow_expressions.py:693, edge-case, reclassified low to info: only Unicode noncharacters U+FDD0/U+FDD1 are affected and nothing can be injected.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

1 finding(s) below the low severity threshold were not posted.

Previous run (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6InNyYy9ydW5uZXJzL2VtdWxhdG9yL3J1bm5lci5weSIsImlkIjoiZl9iYTdkOWUzMWE0YTA5NTUzIiwibGluZSI6MjEwMywiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJzcmMvcnVubmVycy9lbXVsYXRvci9ydW5uZXIucHkiLCJpZCI6ImZfNGZmN2M3MWE3YzA0YTRhZiIsImxpbmUiOjgzMSwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJlZGdlLWNhc2UiLCJmaWxlIjoic3JjL2FwcC9zZXJ2aWNlcy93b3JrZmxvd19leHByZXNzaW9ucy5weSIsImlkIjoiZl8zMTY1OTU2MTIxMTRhMTNjIiwibGluZSI6NjkzLCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ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yZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9iODE3NDc1ZWNkNjEyNDAxIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfOTM2MDg1ODEyM2UwODBlNCIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9XX0= -->

Review

Findings

Medium

  • [logic-error] src/runners/emulator/runner.py:2103 — Composite steps are rendered without the runtime arguments added to _render_local_action, so job.status is always success, failure() is false after an earlier composite failure, and github.output/github.env/github.path render empty.
    Remediation: Pass the composite's current failure status and step number when rendering each internal step; test an always-running cleanup step after failure and a composite step writing through github.output.
  • [logic-error] src/runners/emulator/runner.py:831 — _format_expression still converts placeholder values with Python str(): format('{0}', github.workspace == '') gives False, not false, and integral floats give 1.0.
    Remediation: Use _expression_string for format() placeholders and add boolean and float tests.

Low

  • [logic-error] src/app/services/workflow_expressions.py:906 — The server's _NEEDS_PARSER_RE (line 158) omits !, < and >, so ${{ 2 > 1 }} and ${{ !inputs.flag }} render empty. The runner's regex was widened to include them.
    Remediation: Add the operators to the server regex and test them without another operator that selects the parser.
  • [edge-case] src/app/services/workflow_expressions.py:693 — Brace escaping reserves U+FDD0/U+FDD1, but those input characters already serialize as \ufdd0/\ufdd1, so they are converted to braces. They are noncharacters and rarely occur.
    Remediation: Escape braces without reserving input-representable sentinels; add round-trip tests.
  • [injection-vuln] src/app/services/workflow_service.py:815 — Literal-preserving rendering covers run, with, working-directory and shell but not uses, which the runner still evaluates and logs. Impact is limited (GitHub rejects expressions in uses; short-lived single-repository job token; exposure predates this PR).
    Remediation: Apply the same rendering to uses or reject expressions there; add a regression test.
  • [pattern-inconsistency] src/app/api/apps.py:416 — list_token_installation_repositories uses CurrentUser with a manual None check; other authenticated routes use user: AuthUser.
    Remediation: Switch to AuthUser and drop the manual check.
  • [design-smell] src/app/middleware/error_handler.py:117 — http_401_handler ignores exc.detail while apps.py repeats the same Authorization-header ternary in its detail.
    Remediation: Prefer exc.detail in the handler and drop the duplicate ternary.
  • [scope-creep] src/app/api/apps.py:427 — The job-token /installation/repositories route and the 401 message sit outside the "github context and runner environment" area listed for this PR in Upstream the emulator fixes found by fullsend's behaviour tests #39. The PR body documents both, so this is a process note only.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (3)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6InNyYy9ydW5uZXJzL2VtdWxhdG9yL3J1bm5lci5weSIsImlkIjoiZl9iYTdkOWUzMWE0YTA5NTUzIiwibGluZSI6MjEwMywiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJzcmMvcnVubmVycy9lbXVsYXRvci9ydW5uZXIucHkiLCJpZCI6ImZfZGQ0ZjFiZmU5YThjNGVkNiIsImxpbmUiOjczMywiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJlZGdlLWNhc2UiLCJmaWxlIjoic3JjL2FwcC9zZXJ2aWNlcy93b3JrZmxvd19leHByZXNzaW9ucy5weSIsImlkIjoiZl8zMTY1OTU2MTIxMTRhMTNjIiwibGluZSI6NjkzLCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ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5nZSJ9LHsiaWQiOiJmXzMxNjU5NTYxMjExNGExM2MiLCJzdGF0dXMiOiJvcGVuIn0seyJpZCI6ImZfMWJiYTIyNTcyZmYzNTM3NyIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzQ5YmNhMTllODE5YzY4YzIiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl8yYTI1OGE1NTY2OGVhZWRlIiwic3RhdHVzIjoib3BlbiJ9LHsiaWQiOiJmX2U0OTE3MjM4NmNhNDZjNGIiLCJzdGF0dXMiOiJvcGVuIn0seyJpZCI6ImZfNmU5YWJlMmMzODE3YThiNyIsInN0YXR1cyI6Im9wZW4ifSx7ImlkIjoiZl8wOWY5NDJjOGJlZWQ2YTIwIiwic3RhdHVzIjoib3BlbiJ9LHsiaWQiOiJmXzc0MGIzODk1OWNhYzRmZTQiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9iODE3NDc1ZWNkNjEyNDAxIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfYjQyM2FlZDJlMjA5ODEzMCIsInN0YXR1cyI6Im9wZW4ifSx7ImlkIjoiZl85MzYwODU4MTIzZTA4MGU0Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn1dfQ== -->

Review

Findings

Medium

  • [logic-error] src/runners/emulator/runner.py:2103 — The composite-action caller does not pass job_status or step_number to _render_local_action. Composite steps always render job.status as success and failure() as false, even after an earlier composite step failed. They also render github.output, github.env and github.path empty. An if: always() cleanup step sees the wrong failure state, and a composite step cannot publish outputs through ${{ github.output }}. The main job loop does pass both arguments.
    Remediation: Pass the composite's current failure state and the real command-file step number to the renderer before each inner step. Cover a failed inner step followed by cleanup, and an inner step writing through github.output.

  • [logic-error] src/runners/emulator/runner.py:733 — The runner's contains, startsWith and endsWith are case-sensitive. The server evaluator, and Actions, compare strings case-insensitively. This PR defers more expressions to the runner, so ${{ github.workspace != '' && contains('ABC', 'abc') }} now yields false, while the same expression resolved on the server yields true.
    Remediation: Make the runner's string functions and array membership comparisons match the server's, and test mixed runtime/server expressions with differently cased operands.

Low

  • [edge-case] src/app/services/workflow_expressions.py:693 — The brace-escaping placeholders U+FDD0 and U+FDD1 collide with real input characters. Binding {"title":"\ufdd0"} produces fromJSON('{"title":"\u007b"}'), which changes the title to {. Event data is silently corrupted.
    Remediation: Escape braces inside JSON string tokens without placeholder characters that can occur in the data, and add a round-trip test for both code points.

  • [logic-error] src/app/services/workflow_expressions.py:897 — The runner.* and steps.* deferral branches (around lines 891-897) return the whole expression without binding server-owned values. The new github.workspace branch does bind them. So ${{ runner.os && github.actor_id }} reaches the emulator runner unchanged and renders empty, because the runner's github context has no actor_id. The newly filled identity fields therefore still vanish when mixed with these contexts. The branches pre-date this PR.
    Remediation: Apply bind_server_context to every expression deferred for runtime evaluation, keeping the runtime operands. Add server-to-runner round-trip tests that mix these operands with the new identity fields.

Earlier findings

  • src/app/services/workflow_expressions.py and src/runners/emulator/runner.py, logic-error (three findings), resolved. The deferred-expression marker is now a _Deferred str subclass rather than a text prefix. The runner passes the failure state (failed=) to the deferred-expression parser.
  • src/app/services/workflow_expressions.py, injection-vuln (four findings), resolved. Server-resolved text holding $, { or } is bound as fromJSON('...'), per fragment. The protection covers adjacent fragments and quote and brace escaping, with regression tests.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (4)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6InNyYy9ydW5u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I6ImZfMmEyNThhNTU2NjhlYWVkZSIsInN0YXR1cyI6Im9wZW4ifSx7ImlkIjoiZl9lNDkxNzIzODZjYTQ2YzRiIiwic3RhdHVzIjoicmVjbGFzc2lmaWVkIn0seyJpZCI6ImZfYjQyM2FlZDJlMjA5ODEzMCIsInN0YXR1cyI6Im9wZW4ifSx7ImlkIjoiZl8wOWY5NDJjOGJlZWQ2YTIwIiwic3RhdHVzIjoicmVjbGFzc2lmaWVkIn0seyJpZCI6ImZfOTM2MDg1ODEyM2UwODBlNCIsInN0YXR1cyI6Im9wZW4ifV19 -->

Review

Findings

Medium

  • [logic-error] src/runners/emulator/runner.py:947 — Deferred expressions receive job_status in their context, but _StepIfParser is constructed without its failed flag. Consequently, after an earlier step fails, an always-run step rendering ${{ github.workspace != '' && failure() }} gets false, while success() incorrectly returns true. The condition evaluator has the inverse propagation gap: it receives failed but builds a job context whose status defaults to success, so failure() && job.status == 'failure' incorrectly skips the step.
    Remediation: Propagate the current failure state into both the parser's failed argument and the job.status context at every runtime evaluation entry point, including composite steps. Add tests that evaluate these expressions after a failed step.

  • [logic-error] src/app/services/workflow_expressions.py:883 — The new deferral path moves entire expressions to the emulator runner, but its startsWith, endsWith, and contains implementations remain case-sensitive, unlike both GitHub Actions and this module's server evaluator. For example, ${{ github.workspace && contains('ABC', 'a') }} is now deferred and renders false on the emulator runner instead of true. Adding a runner-only operand therefore changes the semantics of otherwise supported expressions.
    Remediation: Align the runner's string functions with the server's Actions-compatible case-insensitive comparisons, including array membership coercion for contains, and add end-to-end deferred-expression tests.

  • [injection-vuln] src/app/services/workflow_expressions.py:871 — Untrusted resolved strings can impersonate the internal deferred-expression marker. For example, rendering ${{ inputs.title }} with inputs.title equal to \u0000deferred\u0000${{ github.token }} strips the marker and returns a live token expression before reaching the escaping check. The emulator runner then replaces that expression with the job credential. Ordinary resolved strings containing ${{ are protected, but strings beginning with the marker bypass that protection.
    Remediation: Represent deferred results using a separate type or an explicit metadata flag rather than a prefix embedded in string data. Add a regression test passing a marker-prefixed untrusted value through both server and runner rendering.

  • [injection-vuln] src/app/services/workflow_expressions.py:873 — Expression escaping checks each replacement independently, so adjacent replacements can assemble a live expression after the check. For example, ${{ inputs.a }}${{ inputs.b }} with a='$' and b='{{ github.token }}' produces ${{ github.token }}, which the runner expands into its credential. A complete ${{ within either input is protected, but delimiter fragments spanning two inputs or an input and surrounding literal text are not.
    Remediation: Preserve replacement provenance and encode server-resolved fragments as inert runner literals even when a fragment does not independently contain ${{. Ensure expression delimiters cannot form across fragment boundaries, and add end-to-end tests for adjacent replacements and replacement/literal boundaries.

Low

  • [edge-case] src/app/services/workflow_expressions.py:693 — The brace-escaping scheme also replaces genuine U+FDD0 and U+FDD1 characters in input data. For example, binding an object containing {"s":"\ufdd0"} produces JSON containing \u007b, so the runner receives { instead of the original character. Object keys can likewise be changed or collide.
    Remediation: Escape braces directly in JSON string tokens, or use a collision-free encoding that distinguishes original sentinel characters from inserted placeholders. Add a round-trip test containing both sentinel characters.

  • [pattern-inconsistency] src/app/api/apps.py:401 — list_token_installation_repositories injects current_user as CurrentUser and manually checks if current_user is None to raise HTTPException(401). Standard endpoint convention is current_user: AuthUser, which delegates to require_auth and includes the WWW-Authenticate header. http_401_handler already centralizes the 'Bad credentials' vs 'Requires authentication' choice.
    Remediation: Change the dependency parameter to current_user: AuthUser and remove the redundant manual None check and 401 raise.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

3 finding(s) below the low severity threshold were not posted.

Previous run (5)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6InNyYy9hcHAvc2VydmljZXMvd29ya2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ZWNsYXNzaWZpZWQifSx7ImlkIjoiZl9iNDIzYWVkMmUyMDk4MTMwIiwic3RhdHVzIjoicmVjbGFzc2lmaWVkIn0seyJpZCI6ImZfMDlmOTQyYzhiZWVkNmEyMCIsInN0YXR1cyI6InJlY2xhc3NpZmllZCJ9XX0= -->

Review

Findings

Medium

  • [logic-error] src/app/services/workflow_expressions.py:867 — Expressions the server defers to the emulator runner can exceed what the runner's _StepIfParser supports. ${{ github.workspace && fromJSON(inputs.data).ok }}: the runner's tokenizer has no token for . after ), raises ValueError, and the expression text is left unrendered, so the shell can fail with 'bad substitution'. ${{ github.workspace && inputs.mode == 'PROD' }} with mode='prod' renders false, because the runner compares with Python == (case-sensitive) where GitHub compares strings case-insensitively. Unchanged by the latest push.
    Remediation: Make the runner's parser handle what the server defers: property access on function results and Actions-style equality. Add end-to-end server-then-runner tests for both examples.

  • [injection-vuln] src/app/services/workflow_expressions.py:912 — A server-resolved value can become a live expression when the runner renders the step a second time. With TITLE: ${{ github.event.issue.title }} and an issue title of ${{ github.token }}, the plain-lookup path returns the title verbatim and the runner's _render_local_action replaces it with the job credential. String results from the parser branch behave the same. The new _as_literal/_json_literal binding only covers expressions that also name a runner-only value. Affects run, with, env, shell and working-directory. Unchanged by the latest push.
    Remediation: When for_runner=True, keep server-resolved values as safely bound literals, or escape ${{ in resolved output, so the runner never parses resolved data as template source, including for expressions with no runner-only reference. Add regression tests passing an issue title containing ${{ github.token }} through a plain env lookup and a server-evaluated function, then runner rendering, asserting the title stays literal and the credential is absent.

Low

  • [edge-case] src/app/services/workflow_expressions.py:693 — _json_literal hides braces behind U+FDD0/U+FDD1 sentinels and then does a blind substring replace on the dumped JSON. An input containing the actual U+FDD0 character round-trips as {, and a string holding the six literal characters \ufdd0 becomes the literal text \u007b.
    Remediation: Escape braces directly inside the serialized JSON strings, without sentinel characters. Add round-trip tests for actual U+FDD0/U+FDD1 characters and literal backslash-u text.

  • [pattern-inconsistency] src/app/api/apps.py:401 — list_token_installation_repositories uses CurrentUser plus its own 401 check with an inline 'Bad credentials' conditional instead of the standard AuthUser dependency. http_401_handler already picks the same message from the Authorization header, and this path omits the WWW-Authenticate header require_auth adds.
    Remediation: Use current_user: AuthUser and remove the manual if current_user is None block.

Earlier findings

  • src/app/middleware/error_handler.py:117, backward-incompatible — reclassified to info: intentional GitHub-parity message change, documented and tested in this PR.
  • src/app/api/apps.py:397, backward-incompatible — reclassified to info: job-token 200 vs earlier 403 is intentional parity, PAT still 403.
  • src/app/services/workflow_expressions.py:896, backward-incompatible — reclassified to info: intentional rendering parity fix documented in the bug ledger.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

3 finding(s) below the low severity threshold were not posted.

Previous run (6)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImluamVjdGlvbi12dWxuIiwiZmlsZSI6InNyYy9hcHAvc2VydmljZXMvd29ya2Zsb3dfZXhwcmVzc2lvbnMucHkiLCJpZCI6ImZfOTM2MDg1ODEyM2UwODBlNCIsImxpbmUiOjg3MiwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoic2VjdXJpdHkifSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJzcmMvYXBwL3NlcnZpY2VzL3dvcmtmbG93X2V4cHJlc3Npb25zLnB5IiwiaWQiOiJmXzc0MGIzODk1OWNhYzRmZTQiLCJsaW5lIjo4NjcsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiZWRnZS1jYX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LCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY3Jvc3MtcmVwby1jb250cmFjdHMifV19 -->

Review

Findings

Medium

  • [injection-vuln] src/app/services/workflow_expressions.py:872 — Server-resolved strings can become live expressions on the runner's second render pass. The ordinary lookup path and the a || b loop return context strings unescaped, and the runner's _render_local_action (runner.py:903-904) replaces any literal ${{github.token}} with the job token. A branch named ${{github.token}} makes ${{ github.ref_name }} render to the token. This PR adds new carriers (github.ref_name, github.workflow_ref); the second pass already existed on base.
    Remediation: Keep server-resolved strings literal when sent to the runner (e.g. escape ${{ on the ordinary render path when for_runner=True), and add regression tests with a branch named ${{github.token}} in env, with and run values.
  • [logic-error] src/app/services/workflow_expressions.py:867 — Deferred expressions go to a weaker runner evaluator. The runner parser cannot read .name/[] after a function call (${{ github.workspace && fromJSON(inputs.json).name }} is left as literal text), and runner equality is case-sensitive (runner.py:624) while the server's _compare is case-insensitive with numeric coercion, so adding a runner-only operand changes the result of an otherwise supported comparison.
    Remediation: Support property/index access on function results in the runner parser, align runner equality/coercion with _compare, and add server-to-runner round-trip tests.

Low

  • [edge-case] src/app/services/workflow_expressions.py:693 — Brace hiding with sentinels U+FDD0/U+FDD1 corrupts input that already contains those characters (U+FDD0{x} round-trips as {{x}).
    Remediation: Escape braces inside JSON string tokens without a collision-prone replacement; add a round-trip test.
  • [pattern-inconsistency] src/app/api/apps.py:401 — list_token_installation_repositories uses CurrentUser with a manual 401 instead of AuthUser/require_auth; the hand-built detail is dead code since http_401_handler ignores exc.detail, and WWW-Authenticate is omitted.
    Remediation: Use user: AuthUser and remove the manual check.
  • [backward-incompatible] src/app/middleware/error_handler.py:117 — The shared 401 handler now answers "Bad credentials" whenever an Authorization header is present, overriding explicit 401 details and applying to malformed or ignored-scheme headers. It is emulator-wide, somewhat beyond the PR's stated scope; the PR announces and tests it.
    Remediation: Note for downstream behaviour tests; consider using exc.detail when explicitly set.
  • [backward-incompatible] src/app/api/apps.py:397 — A job token on GET /installation/repositories now gets 200 instead of 403, and unauthenticated calls get 401 instead of 403. Callers that relied on the 403 to detect a job token will change behaviour.
    Remediation: Document the new behaviour.
  • [backward-incompatible] src/app/services/workflow_expressions.py:896 — Rendered output changes: false renders false (was empty/False), a || b falls back to the last alternative, and runner-only expressions in run:/with:/env: are now deferred to the runner. Workflows relying on empty-string falsiness now see false.
    Remediation: Call out the rendering change in release notes; confirm external runners evaluate the bound fromJSON('...') forms.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (7)

Review

Reason: tool-failure

This PR was NOT reviewed. Do not count this as an approval.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:04 PM UTC · Completed 11:15 PM UTC

Commit: aac88c8 · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:21 PM UTC · Completed 11:33 PM UTC

Commit: 6b3a10b · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@waynesun09
waynesun09 force-pushed the emu-08-actions-context branch from 92359d8 to 59a7f6a Compare November 18, 2026 23:39
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:41 PM UTC · Completed 11:58 PM UTC

Commit: 59a7f6a · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:05 AM UTC · Completed 12:21 AM UTC

Commit: ce332ee · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ❌ Failure (post-script /home/runner/work/github-emulator/github-emulator/.fullsend/.fullsend-cache/resources/sha256/c1cf6b8a6eef6ce57d3699d6ef35384ee0505ef8cc9a0fb4a6a3eb53e2f1432c/scripts/post-review.sh failed:…) · Started 12:29 AM UTC · Completed 12:59 AM UTC

Commit: e72abc4 · View workflow run →

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

@fullsend-ai-review fullsend-ai-review Bot removed the risk/moderate PR risk: moderate label Nov 19, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:09 AM UTC · Completed 3:26 AM UTC

Commit: e72abc4 · View workflow run →

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

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 19, 2026
fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

waynesun09 added a commit to waynesun09/github-emulator that referenced this pull request Nov 19, 2026
 x fullsend-ai#35)

fullsend-ai#35's github_identity_context runs four reads (repository, actor, workflow, branch protection) and create_workflow_run called it after db.add(run) and flush, inside SQLite's write transaction; fullsend-ai#33's test_creating_a_run_reads_nothing_inside_the_write failed on them. Compute it before the run is added.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
waynesun09 added a commit to waynesun09/github-emulator that referenced this pull request Nov 19, 2026
…ries (fullsend-ai#32 x fullsend-ai#35)

fullsend-ai#35 answers an unknown or revoked token on /installation/repositories with 401 Bad credentials, as GitHub does; fullsend-ai#32's revoke test expected the route's earlier 403. The test's intent, that the revoked token no longer authenticates, is unchanged.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@waynesun09
waynesun09 force-pushed the emu-08-actions-context branch from 04ede0f to eeb4429 Compare November 19, 2026 23:27
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:29 PM UTC · Completed 11:42 PM UTC

Commit: eeb4429 · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

…GitHub sets

Compared side by side with a run on GitHub: actor, actor_id,
triggering_actor, api_url, graphql_url, repository_id,
repository_owner_id, run_attempt and workflow_ref were empty in
expressions the emulator rendered, and GITHUB_ACTOR, GITHUB_ACTOR_ID,
GITHUB_TRIGGERING_ACTOR and GITHUB_WORKFLOW_REF were unset on the
runner, which exports them from the job message's github context. Both
now carry them (ids and run_attempt as strings, as GitHub gives them).

Runs report run_started_at and display_title (the head commit's first
line, the pull request's or issue's title, or the workflow name); jobs
report created_at, head_sha and head_branch.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
…allation/repositories

- Server-side rendering of run:, with: and env: writes a false result as
  "false" (it was ""), takes "a || b" as the first truthy alternative,
  and fills github.ref_name, ref_type, ref_protected, workflow_sha,
  repository_visibility, repositoryUrl and retention_days.
- Values only the runner knows (github.token, github.workspace,
  github.job, github.event_path, github.action, job.status ...) are left
  for the runner, with the server's own contexts bound in. Rendered here
  they came out empty, and `${{ github.token != '' }}` gave "false".
- The runner's own github context gets the same keys, so it exports
  GITHUB_REF_NAME, GITHUB_REF_TYPE, GITHUB_REF_PROTECTED and
  GITHUB_WORKFLOW_SHA, and RUNNER_ENVIRONMENT is set.
- A job's GITHUB_TOKEN on GET /installation/repositories lists the run's
  repository (repository_selection "selected"). It answered 403
  "personal access token", so clients that probe the route to tell an
  installation token from a PAT took a job token for a PAT.
- A refused credential answers 401 "Bad credentials", as on GitHub; a
  missing one stays "Requires authentication".

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
The re-run route set run_attempt after create_workflow_run had already
rendered the steps, so ${{ github.run_attempt }} in a step said 1 while
the runner's GITHUB_RUN_ATTEMPT said 2. The attempt is now passed in and
set before the steps render.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
Fixed-bug entries for the empty identity values and for the rendering
and authentication answers that differed from GitHub's, and their
PLAN.md lines.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
…ted and push titles

Review follow-ups:
- The emulator's own runner now finishes what the server leaves for it:
  it reads a doubled quote inside a string, writes a false result as
  "false", and resolves job.status.
- working-directory and shell are left for the runner like run.
- An object or array passed as a function argument beside a runner value
  is bound whole (fromJSON), not collapsed to true.
- github.ref_protected says whether the branch is protected.
- A push payload carries head_commit, so a push run's display_title is the
  commit's first line.
- A re-run's jobs carry its attempt.
- The job-token branch of /installation/repositories reads columns only.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
- A bound string that holds a brace, and every bound object or array, is
  written as fromJSON('...') with the braces inside strings as \u007b and
  \u007d escapes and no two closing braces next to each other. A value
  such as an issue title holding "}}" can no longer end the expression it
  is bound into, so text after it stays text.
- The emulator's runner implements fromJSON and toJSON, so an object bound
  beside a runner value round-trips.
- The emulator's runner gives github.env, github.output, github.path and
  github.event_path the paths of the step's files.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
…ndex notation

- A plain path to an object or array is bound as fromJSON('...') wherever
  it appears. Collapsing it to true outside a function call lost the value
  that a && b or a || b returns.
- A '...' literal's only escape is a doubled quote, as in Actions, in both
  the server's parser and the emulator's runner. Turning \" into " broke
  bound JSON whose strings hold quotes.
- github['workspace'], job['status'] and the other runner-only values in
  index notation are left for the runner like their dot forms.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
- The server's and the emulator runner's tokenizers now end a '...'
  literal at the first quote that is not doubled; a backslash is an
  ordinary character. format('{0}', 'Don''t') parsed as two strings on the
  server, and a bound value ending in a backslash swallowed its closing
  quote on the runner.
- A deferred github['workspace'] or job['status'] is sent as
  github.workspace or job.status, which the emulator's runner reads (its
  parser has no index access).

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
The server now leaves expressions that read runner-only values to the
runner, and those may use what the server's parser supports. The
emulator's runner adds <, >, <= and >= (Actions' coercion: strings
case-insensitively, else numbers), join(), and sends an expression that
starts with ! through its parser. Before, such an expression reached the
step as literal ${{ ... }} text.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
The job message is built synchronously, and it read repo.branches to
fill github.ref_protected. That only worked while the relationship was
eagerly loaded; with lazy loading, every job hand-out would raise
MissingGreenlet on the claim path. The claim route now queries the one
Branch row with the async session and passes the flag in, and the message
builder no longer touches repo.branches.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
create_workflow_run read the identity context (repository, actor,
workflow, branch protection) after adding and flushing the run, inside
the write. It needs only the run's own fields, so it now runs before the
run is added, keeping reads out of the write transaction.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
…oose ==

- In values the runner renders again (run, with, env, working-directory,
  shell), a value the server resolved that holds ${{ is sent as
  ${{ fromJSON('...') }}, which yields the text itself. An issue title
  holding ${{ github.token }} reached the runner as a live expression,
  through a plain lookup or a server-evaluated function alike.
- The emulator's runner reads .name and [index] after a call or a
  parenthesis (fromJSON(inputs.data).ok), and its == and != follow Actions:
  strings case-insensitively, mixed types as numbers.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
… expressions

- An expression left for the runner is marked by a str subclass, not a
  prefix in the text, so resolved data can never pose as one.
- In values the runner renders again, a resolved value holding $, { or }
  is sent as ${{ fromJSON('...') }}. Checking only for a whole ${{ let
  two values side by side, or a value and the literal text next to it,
  assemble one ("$" then "{{ github.token }}").
- The emulator's runner gives a deferred expression the failure state
  (failure()/success()) and a step condition the matching job.status.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
Hygiene's pre-commit runs ruff over every whole file a change touches.
This fixes what main's config reports in them: import order and unused
imports (ruff --fix), the late imports in actions_distributed_task.py
moved to the top, unused locals, a lambda assignment, and a
try/except/pass in a test replaced by contextlib.suppress. No behaviour
change.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@waynesun09
waynesun09 force-pushed the emu-08-actions-context branch from eeb4429 to 5c897cf Compare November 19, 2026 23:45
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:47 PM UTC · Completed 11:58 PM UTC

Commit: 5c897cf · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

…ories

#32's revoke test expected 403, from before #35 answered 401 for a token the
emulator doesn't know, as GitHub does. Agreed in review: whichever of the two
lands second updates the test.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:19 AM UTC · Completed 12:32 AM UTC

Commit: c986516 · View workflow run →

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

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • src/runners/emulator/runner.py (file-level): Line 2103 ·
    [medium] logic-error

Composite steps do not receive the failure state or step number when rendering; a later always-running step sees job.status 'success'.

Suggested fix: Pass the composite's failure state and inner step number to _render_local_action and add composite-level tests.

  • src/runners/emulator/runner.py (file-level): Line 831 ·
    [low] logic-error

format() converts arguments with Python str(), rendering false as 'False' in deferred expressions.

Suggested fix: Use _expression_string for format() arguments and test boolean arguments.

  • src/app/services/workflow_expressions.py (file-level): Line 906 ·
    [low] logic-error

_NEEDS_PARSER_RE misses standalone !, <, >, <=, >=, so such expressions render empty.

Suggested fix: Add negation and relational operators to _NEEDS_PARSER_RE and add server-side tests.

  • src/app/services/workflow_service.py (file-level): Line 786 ·
    [low] logic-error

Step if: conditions reading runner-owned values such as job.status are decided on the server and resolve to false. Pre-existing and outside the PR's stated scope.

Suggested fix: In a follow-up, treat runner-owned github/job values as runtime dependencies in _resolve_step_condition.

  • src/app/api/apps.py (file-level): Line 416 ·
    [low] pattern-inconsistency

revoke_installation_token has an unused current_user and returns 403 where the neighbouring route returns 401 for a refused credential.

Suggested fix: Check current_user and return 401, or drop the unused dependency.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

Comment thread src/runners/emulator/runner.py Resolved
Comment thread src/app/services/workflow_service.py Resolved
Comment thread src/app/middleware/error_handler.py Resolved
@waynesun09
waynesun09 merged commit 63adc27 into main Nov 20, 2026
94 of 95 checks passed
@waynesun09
waynesun09 deleted the emu-08-actions-context branch November 20, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants