Skip to content

test(corpus): guard task-target integrity (non-empty valid-regex url_pattern + no dupes)#258

Open
reacher-z wants to merge 1 commit into
mainfrom
feat/corpus-integrity
Open

test(corpus): guard task-target integrity (non-empty valid-regex url_pattern + no dupes)#258
reacher-z wants to merge 1 commit into
mainfrom
feat/corpus-integrity

Conversation

@reacher-z

Copy link
Copy Markdown
Collaborator

Adds corpus-integrity CI guards (re #244).

validate_task_data checks eval_schema.url_pattern is a string but not that it's non-empty or a valid regex — so two silent-corruption classes slip through:

  • empty url_patternre.search('', url) matches every request → false-positive Stage-1 interceptions (task always 'passes' Stage-1)
  • malformed regex → the runtime interceptor crashes at eval time

New tests over every suite (v1/v2/v1-lite/claw-eval): url_pattern is non-empty + compiles as a regex, and no two tasks share the same (url_pattern, method, instruction) (accidental copy-paste). Both pass on the current corpus and act as a drift/corruption guard.

(The 129-vs-130 count reconciliation in #244 needs the source data — left to maintainers.)

…_pattern + no dupes (re #244)

validate_task_data checks eval_schema.url_pattern is a *string* but not that it
is non-empty or a valid regex, so two silent-corruption classes slip through:
- an empty url_pattern -> re.search('', url) matches EVERY request -> false-
  positive Stage-1 interceptions (task always 'passes' Stage-1)
- a malformed regex -> the runtime interceptor crashes at eval time

Add corpus-integrity tests over every suite: url_pattern is non-empty and
compiles as a regex, and no two tasks share the same (url_pattern, method,
instruction) (accidental copy-paste dupes). Both pass on the current corpus;
they act as a CI drift/corruption guard going forward.

(The v1/v2 count reconciliation itself — #244's 129-vs-130 — needs the source
data and is left to the maintainers.)

@Perry2004 Perry2004 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A validate-task GHA is already implemented for similar purposes. If additional restrictions need to be implemented, please add to that GHA instead.

Since this is not related with code logic and thus should be in the CI rather than the general test file.

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