Skip to content

fix: validation - #1628

Open
jakelorocco wants to merge 3 commits into
generative-computing:mainfrom
jakelorocco:fix/validation
Open

fix: validation#1628
jakelorocco wants to merge 3 commits into
generative-computing:mainfrom
jakelorocco:fix/validation

Conversation

@jakelorocco

Copy link
Copy Markdown
Contributor

Pull Request

Issue

Fixes #426

Description

I believe I covered all the parts of the initial issue.

  1. Dead validation context — avalidate's throwaway SimpleContext() deleted. Validation runs over the caller's context, in their own context type. output now designates the target and is appended only when context.last_output() is not output

  2. Provenance loss — Requirement._output: str → _validation_target: Span, bound on a copy via _bind_validation_target, exposed through parts() so generate_walk can await it, rendered preferring a Component parsed_repr over the raw string.

  3. Dead validation_ctx (bug: validation_ctx parameter in SamplingStrategy.sample() exists but is not being used in the validation call #668) — honored in sampling/base.py, budget_forcing.py, sofai.py; majority_voting.py verified. The old validation_ctx or context default was itself wrong (pre-generation context)

  4. Judge prompt reworded — Requirement.jinja2, scoping the verdict to the output while telling the model the conversation is there to interpret the requirement. Got better results and fewer tokens across several models (granite 4.2 as well)

  5. genstub preconditions judged over a fresh ChatContext() instead of leaking session history

  6. Fixing alora requirement validation especially when auto-routing: when a reroute would happen but the context renders nothing, an explicit ALoraRequirement raises ValueError naming the context, the adapter, and both ways out; an auto-rerouted plain Requirement disables the reroute and falls back to LLMaJ with a warn-once

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code was added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Attribution

  • AI coding assistants used

Adding a new component, requirement, sampling strategy, or tool?

If your PR adds or modifies one of the types below, check the matching box. A checklist of type-specific review items will be posted as a comment.

  • Component
  • Requirement
  • Sampling Strategy
  • Tool

NOTE: Please ensure you have an issue that has been acknowledged by a core contributor and routed you to open a pull request against this repository. Otherwise, please open an issue before continuing with this pull request.

Signed-off-by: Jake LoRocco <jake.lorocco@ibm.com>
Assisted-by: CLAUDE:OPUS
…mple context

Signed-off-by: Jake LoRocco <jake.lorocco@ibm.com>
Signed-off-by: Jake LoRocco <jake.lorocco@ibm.com>
@jakelorocco
jakelorocco requested a review from a team as a code owner September 4, 2026 17:03
@github-actions github-actions Bot added the bug Something isn't working label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validation is wrong and needs to be rewritten

1 participant