Skip to content

fix(experiments): unblock hypothesis-builder validate and eval checks - #141

Merged
ericoh-ld merged 3 commits into
feat/experiment-hypothesis-builderfrom
eric/fix-hypothesis-builder-checks
Aug 3, 2026
Merged

ericoh-ld merged 3 commits into
feat/experiment-hypothesis-builderfrom
eric/fix-hypothesis-builder-checks

Conversation

@ericoh-ld

@ericoh-ld ericoh-ld commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Fixes the 4 failing checks on feat/experiment-hypothesis-builder. There were 2 independent root causes plus 2 cascades, none of which were caused by the changes to SKILL.md in PR#139

Checks and failures:

  1. validate: frontmatter name ≠ directory name. SKILL.md declared name: launchdarkly-experiment-hypothesis-assistantwhile the directory is ...-builder, and validate_skills.py requires the two to match
  2. Evaluate launchdarkly-experiment-hypothesis-builder: nunjucks template render error. The suite registered SKILL.md as promptfoo's prompt, promptfoo renders prompts through nunjucks, and SKILL.md documents its own hole syntax ({{measurement:...}}, {{component:hint}}) in the output-contract examples. Nunjucks reads measurement as a variable, hits the :, and throws the error.
  3. Aggregate scores: suite scored 0% → below the 75% threshold. These were outdated and not appropriate for the new version of the skill.
  4. Evaluate gate: suite scored 0% → the evaluate job failed. Cascades from the errored evaluations.

Testing

  • Not applicable

  • Manual (describe below)

  • Rendered prompt vs SKILL.md: 27763 vs 27763 chars, byte-identical

  • Checked that {% raw %}tags do not leak into the prompt

  • Checked that the hole syntax {{measurement: is preserved

  • python3 scripts/validate_skills.py → 46/46 pass

  • npm test (evals) → 70/70 pass

  • promptfoo eval on the realigned suite → 10/10 pass


Note

Low Risk
Changes are limited to skill frontmatter/handoff strings and eval configuration; no runtime product logic or LaunchDarkly write paths are modified.

Overview
Unblocks CI for launchdarkly-experiment-hypothesis-builder by aligning skill metadata with the directory name and fixing promptfoo’s nunjucks render failure on hole syntax in SKILL.md.

Skill metadata: Frontmatter name and the handoff example’s handoffFrom are renamed from …-assistant to …-builder so validate_skills.py passes (name must match the parent folder).

Eval suite redesign: The promptfoo config shifts from conversational E2E checks (MCP read tools, ask-question, LLM rubrics, no-write assertions) to headless structured-output contract tests. A new prompt.js loads SKILL.md wrapped in {% raw %} so {{measurement:…}} / {{component:hint}} examples are not parsed as nunjucks. The provider runs with MCP and ask-question disabled; a shared binary contract assertion (weight 3) validates JSON-only replies against per-case expect (route, components, holes, measurements, echo rules). Cases cover A/A, junk, scaffold edge cases, XSS non-echo, unfalsifiable outcomes, and multi-measurement primary rules.

Reviewed by Cursor Bugbot for commit 4889195. Bugbot is set up for automated code reviews on this repo. Configure here.

Two independent breakages on this branch turned 4 checks red. Neither came
from #139 — it only touched SKILL.md, which is what diff-changed-skills.js
uses to decide the suite must re-run, so it surfaced both.

validate: SKILL.md declared name: launchdarkly-experiment-hypothesis-assistant
while the directory is ...-builder, and validate_skills.py requires the two to
match. Landed in 7e486ab (v0.3.0). Everything else in the repo already said
-builder (_manifest.js, the evals/<suite> dir, the provider's skill_slug, the
eval:hypothesis-builder script), so the frontmatter was the lone outlier.
Renamed it, plus the handoffFrom value where the skill names itself — the only
other occurrence in the repo, with no consumer matching the literal.

This also realigns the eval's forced invocation: the provider invokes
/<skill_slug> = /launchdarkly-experiment-hypothesis-builder, which did not
match the name the skill declared.

Evaluate suite: all 5 tests errored in 0s with "Template render error [Line 190,
Column 90] expected variable end" — none reached an API call. The suite
registered SKILL.md as promptfoo's prompt, promptfoo renders prompts through
nunjucks, and SKILL.md documents its own hole syntax ({{measurement:...}},
{{component:hint}}) in the output-contract examples. Nunjucks reads
`measurement` as a variable, hits the `:`, and throws. Landed in 849ee1e (#134),
whose CI never ran these checks.

Replaced the prompt with a suite-local function prompt that returns SKILL.md
wrapped in {% raw %}. A function prompt does not skip nunjucks — renderPrompt
assigns the return value to basePrompt and still calls renderString on it — and
promptfoo's own autoWrapRawIfPartialNunjucks only fires on unclosed tags, so
closed-but-invalid {{measurement:...}} sails through. Wrapping supplies the
{% raw %} that helper would have added; renderString then returns the file
byte-for-byte, so results.json still shows the exact skill text and SKILL.md on
disk keeps its hole syntax byte-identical to the o11y contract.

Kept suite-local rather than in evals/shared/, which is a GLOBAL_TRIGGERS entry
and would force all 7 suites to re-run.

Verified: validate_skills.py passes 46/46; nunjucks reproduces the exact
Line 190 Column 90 failure on the bare file and renders the wrapped prompt
byte-identically; npm test 70/70; one live suite test passes in 1m2s (was
5 errors in 0s).

Aggregate scores and Evaluate gate need no separate fix — both were cascades of
the errored suite.
@ericoh-ld
ericoh-ld changed the base branch from main to feat/experiment-hypothesis-builder August 3, 2026 19:25
@ericoh-ld
ericoh-ld marked this pull request as ready for review August 3, 2026 19:44
@ericoh-ld
ericoh-ld requested a review from a team as a code owner August 3, 2026 19:44
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Skill eval results

Skill Before After Δ
agentcontrol/configs-create 100/100 (4/4) 75/100 (3/4) -25
agentcontrol/configs-update 80/100 (4/5) 80/100 (4/5) no change
agentcontrol/configs-variations 80/100 (4/5) 80/100 (4/5) no change
agentcontrol/tools 75/100 (3/4) 75/100 (3/4) no change
experiments/launchdarkly-experiment-hypothesis-builder - 100/100 (10/10) new
feature-flags/launchdarkly-flag-command - 100/100 (3/3) new
feature-flags/launchdarkly-flag-create 100/100 (3/3) 100/100 (3/3) no change

Only suites whose source actually changed since their last recorded score were re-run. Soft-failing while we stabilise the baseline.

@ericoh-ld
ericoh-ld requested a review from hsadhvani August 3, 2026 22:14
@ericoh-ld
ericoh-ld merged commit 0e81d12 into feat/experiment-hypothesis-builder Aug 3, 2026
14 checks passed
@ericoh-ld
ericoh-ld deleted the eric/fix-hypothesis-builder-checks branch August 3, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants