Skip to content

Deflake connector pattern budget and template elseif fuzz assertion - #79653

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan/studious-guide
Nov 21, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan/studious-guide

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Two CI checks have been failing intermittently across unrelated PRs and are not caused by those PRs' changes: Unit tests (K-M) and fuzz (Workflow-Core). This PR fixes the cause of each.

Unit tests (K-M): TestLinearDevelopmentShorthandStaging

matchesConnectorPattern (actions/setup/js/connector_regex.cjs) runs each connector pattern in a worker thread with a 1s budget. That budget started when the worker was created, so worker startup counted against it. On a loaded CI runner, startup alone could use up the second and reject a valid argument. The Node conformance check then failed, even though the same SHA passes on other runs.

  • The 1s matching budget now starts on the worker's online event, so it measures pattern execution rather than startup.
  • A separate 10s startup bound keeps the promise bounded if the worker never starts.
  • New regression test: it uses fake timers to advance past the old budget before the worker comes online. It fails on the old code and passes with the fix. The existing catastrophic-backtracking test still hits the budget.

fuzz (Workflow-Core): FuzzWrapExpressionsInTemplateConditionals

The fuzzer found {{#if`{{elseif `}}. The elseif tag is inside inline code and its expression does not parse. wrapExpressionsInTemplateConditionals intentionally preserves such literal code examples verbatim (see TestWrapLiteralConditionalExamples), but the fuzz assertion still required every elseif to be canonicalized.

  • The assertion now exempts tags that the implementation itself treats as literal code examples: inside a masked code region and with an expression that does not parse.
  • The failing input is added as a seed.

Validation

  • make agent-report-progress passes.
  • A 3-minute fuzz run is clean.
  • The connector regex, runtime and content vitest suites pass, as do the targeted Go connector tests.

Review notes

  • The flake did not reproduce locally, even under heavy CPU contention. The evidence for the cause is a direct Node check (the old code rejects a valid pattern when the host is busy past 1s; the new code resolves) and the regression test above.
  • The 1s limit on author-defined regex execution is unchanged; only the point where timing starts moves.

- connector_regex: start the 1s pattern budget when the worker comes online,
  with a separate 10s startup bound, so slow isolate startup on loaded CI
  runners is not reported as a validation budget overrun (flaky
  TestLinearDevelopmentShorthandStaging in Unit tests K-M).
- template fuzz: exempt literal code examples with unparseable expressions,
  which wrapExpressionsInTemplateConditionals intentionally preserves.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 21, 2026 02:57
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 02:57
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by PR Specification Reviewer for #79653 · copilot · gpt56 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.7K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #79653 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@pelikhan
pelikhan merged commit b94e6cf into main Nov 21, 2026
165 of 189 checks passed
@pelikhan
pelikhan deleted the pelikhan/studious-guide branch November 21, 2026 02:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Worker readiness and timer sequencing still weaken the regex execution limit and can time out trivial matches, while the fuzz assertion can misclassify intentionally preserved literal tags as failures.

2 open issues
What changed in this PR

This PR targets intermittent CI failures in gh-aw’s connector validation and workflow-template fuzz tests by adjusting timeout accounting and literal-code assertions.

Changes:

  • Starts the one-second regex budget on worker online, with a separate ten-second startup deadline.
  • Adds a fake-timer regression test for delayed worker startup.
  • Exempts unparseable literal-code elseif examples from canonicalization assertions and adds the reported failing seed.
File Description
pkg/​workflow/​template_fuzz_test.go Updates literal-code exemptions and adds a regression seed.
actions/​setup/​js/​connector_regex.test.cjs Adds a worker-startup timing regression test.
actions/​setup/​js/​connector_regex.cjs Separates worker startup and pattern-matching deadlines.

Review effort: Max (adaptive)

Comment on lines +93 to +98
worker.once("online", () => {
if (settled) return;
clearTimeout(timer);
timer = setTimeout(() => {
void finish(undefined, new Error(`${ERR_VALIDATION}: Connector pattern exceeded its validation budget`));
}, PATTERN_BUDGET_MS);
// Ignore partial/malformed fragments produced by fuzzing (e.g. "{{elseif 0").
if strings.Contains(input, "{{#if") {
expressions, _ := actionslanguageservice.ExtractExpressions(result)
masked := maskTemplateCodeRegions(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants