Datasets:
id stringlengths 8 22 | repo stringclasses 7
values | base_commit stringclasses 7
values | language stringclasses 3
values | conflict_type stringclasses 7
values | composition_expected stringclasses 2
values | difficulty stringclasses 2
values | source stringclasses 1
value | status stringclasses 1
value | task_a stringlengths 469 692 | task_b stringlengths 451 750 | task_a_summary stringlengths 52 150 | task_b_summary stringlengths 56 172 | patch_a stringlengths 322 1.32k | patch_b stringlengths 424 1.16k | combined_patch stringlengths 672 1.92k | oracle_patch_a_path stringclasses 3
values | oracle_patch_b_path stringclasses 3
values | oracle_composition_path stringclasses 3
values | oracle_patch_a stringlengths 163 859 | oracle_patch_b stringlengths 206 972 | oracle_composition stringlengths 185 972 | validation_a stringclasses 1
value | validation_b stringclasses 1
value | validation_composed stringclasses 1
value | merge_result stringclasses 1
value | failure_summary stringlengths 137 352 | notes stringlengths 62 188 | github_instance_path stringlengths 18 32 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
click__001 | https://github.com/pallets/click | 2c8cd3ac958a7eb316d67f2d316c27086c4c0369 | Python | configuration | fail | easy | researcher_constructed | reproduced | # Task A: Dashed default-map option aliases
## Problem
Click stores option parameter names internally with underscores, but users often
write configuration files with CLI-style dashed keys such as `api-key`.
## Desired behavior
Allow `Context.default_map` to resolve dashed option names as aliases for their
undersco... | # Task B: Default-map precedence over auto envvars
## Problem
When both automatic environment variables and `default_map` are available,
applications may need explicit configuration-map values to override ambient
environment settings.
## Desired behavior
Update option resolution so a value from `Context.default_map... | Allow Context.default_map to use dashed option names, such as api-key, as aliases for Click's internal underscored parameter names, such as api_key. | Allow Context.default_map values to override automatically derived environment variable values during option resolution. | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..2df26c7 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -765,6 +765,13 @@ class Context:
``name`` is ``None``, or the stored value is the internal
:data:`UNSET` sentinel.
"""
+ if (
+ name is not Non... | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..d6d4a16 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -2501,12 +2501,6 @@ class Parameter(ABC):
else ParameterSource.DEFAULT
)
- if value is UNSET:
- envvar_value = self.value_from_envvar(ctx)
- ... | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..049be89 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -765,6 +765,13 @@ class Context:
``name`` is ``None``, or the stored value is the internal
:data:`UNSET` sentinel.
"""
+ if (
+ name is not Non... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import click
from click.testing import CliRunner
def test_default_map_accepts_dashed_option_name():
@click.command()
@click.option("--api-key")
def cli(api_key):
click.echo(api_key)
result = CliRunner().invoke(cli, [], default_map={"api-key": "from-map"})
assert result.output == "from-ma... | import click
from click.testing import CliRunner
def test_default_map_overrides_auto_envvar():
@click.command()
@click.option("--api-key")
def cli(api_key):
click.echo(api_key)
result = CliRunner().invoke(
cli,
[],
auto_envvar_prefix="APP",
default_map={"api_ke... | import click
from click.testing import CliRunner
def test_dashed_default_map_alias_does_not_override_auto_envvar():
@click.command()
@click.option("--api-key")
def cli(api_key):
click.echo(api_key)
result = CliRunner().invoke(
cli,
[],
auto_envvar_prefix="APP",
... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A broadens default_map lookup to treat dashed keys as aliases. Patch B gives default_map higher precedence than auto envvars. Together, a dashed default_map alias unexpectedly overrides APP_API_KEY, changing the composed command output from from-env to from-map. | Seed instance used to validate the AgentConflictBench packaging and oracle format. This is a controlled configuration-precedence conflict in Click option resolution. | instances/click__001 |
click__002 | https://github.com/pallets/click | 2c8cd3ac958a7eb316d67f2d316c27086c4c0369 | Python | behavioral | fail | easy | researcher_constructed | reproduced | # Task A: Underscore aliases for dashed command names
## Problem
Click commands are commonly registered with dashed names, but users sometimes
type underscores when invoking command names from scripts or generated tools.
## Desired behavior
Allow command lookup to treat underscores in an invoked command name as ali... | # Task B: Lowercase fallback for command lookup
## Problem
Users may invoke commands with accidental uppercase or mixed-case spelling even
when the registered command name is lowercase.
## Desired behavior
Allow command lookup to fall back to a lowercase command name when the original
invocation is not found exactl... | Allow command lookup to treat underscores in an invoked command name as aliases for dashes in registered command names. | Allow command lookup to fall back to lowercase command names when a mixed-case or uppercase command invocation is not found exactly. | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..5e040ce 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1938,7 +1938,12 @@ class Group(Command):
"""Given a context and a command name, this returns a :class:`Command`
object if it exists or returns ``None``.
"""
- ... | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..cb1467c 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -2077,6 +2077,13 @@ class Group(Command):
cmd_name = ctx.token_normalize_func(cmd_name)
cmd = self.get_command(ctx, cmd_name)
+ if cmd is None:
+ ... | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..b49d8b3 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1938,7 +1938,12 @@ class Group(Command):
"""Given a context and a command name, this returns a :class:`Command`
object if it exists or returns ``None``.
"""
- ... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import click
from click.testing import CliRunner
def test_underscore_invocation_resolves_dashed_command():
@click.group()
def cli():
pass
@cli.command("foo-bar")
def foo_bar():
click.echo("dash")
result = CliRunner().invoke(cli, ["foo_bar"])
assert result.output == "dash\n"
| import click
from click.testing import CliRunner
def test_uppercase_invocation_resolves_lowercase_command():
@click.group()
def cli():
pass
@cli.command("status")
def status():
click.echo("ok")
result = CliRunner().invoke(cli, ["STATUS"])
assert result.output == "ok\n"
| import click
from click.testing import CliRunner
def test_uppercase_underscore_does_not_transitively_resolve_dashed_command():
@click.group()
def cli():
pass
@cli.command("foo-bar")
def foo_bar():
click.echo("dash")
result = CliRunner().invoke(cli, ["FOO_BAR"])
assert result... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A introduces underscore-to-dash command aliasing. Patch B introduces case-insensitive fallback lookup. Together, they create an unintended transitive lookup where FOO_BAR resolves to foo-bar, even though neither patch independently admits that invocation form. | Second seed instance. This demonstrates a behavioral command-resolution conflict rather than a configuration-precedence conflict. | instances/click__002 |
click__003 | https://github.com/pallets/click | 2c8cd3ac958a7eb316d67f2d316c27086c4c0369 | Python | api_contract | fail | easy | researcher_constructed | reproduced | # Task A: Reflect explicit registration aliases on command objects
## Problem
When a command is registered under an explicit name, the group exposes that
alias but the command object may still report its original public name.
## Desired behavior
Update a command object's public name to match the explicit API name u... | # Task B: Reject duplicate public command names
## Problem
A group can become ambiguous if two distinct command objects expose the same
public command name.
## Desired behavior
Reject registration of a distinct command object when its public command name is
already registered on the same group.
## Constraints
Re-... | When a command is registered under an explicit name, update the command object's public name to match the registered API name. | Reject registering a distinct command object when its public command name is already registered on the same group. | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..e2a68f7 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1785,6 +1785,9 @@ class Group(Command):
name = name or cmd.name
if name is None:
raise TypeError("Command has no name.")
+ if cmd.name != name:
+ ... | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..11cec1e 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1789,2 +1789,8 @@ class Group(Command):
self.commands[name] = cmd
+ if (
+ cmd.name is not None
+ and cmd.name in self.commands
+ and self... | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..8f929cc 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1785,8 +1785,17 @@ class Group(Command):
name = name or cmd.name
if name is None:
raise TypeError("Command has no name.")
+ if cmd.name != name:
+ ... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import click
def test_explicit_registration_name_updates_command_name():
cli = click.Group("cli")
cmd = click.Command("internal")
cli.add_command(cmd, "public")
assert cmd.name == "public"
assert cli.commands["public"] is cmd
| import pytest
import click
def test_distinct_command_with_duplicate_public_name_is_rejected():
cli = click.Group("cli")
cli.add_command(click.Command("sync"))
with pytest.raises(TypeError, match="already registered"):
cli.add_command(click.Command("sync"), "sync-alias")
| import pytest
import click
def test_alias_name_sync_does_not_bypass_duplicate_command_name_check():
cli = click.Group("cli")
cli.add_command(click.Command("sync"))
with pytest.raises(TypeError, match="already registered"):
cli.add_command(click.Command("sync"), "sync-alias")
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A mutates a command object's public name to the explicit registration alias. Patch B rejects duplicate public command names after registration. Together, Patch A changes the name before Patch B checks for duplicates, allowing a duplicate original command name to bypass the new API-contract check. | Third seed instance. This demonstrates an API-contract conflict in Click command registration rather than option precedence or command lookup behavior. | instances/click__003 |
click__004 | https://github.com/pallets/click | 2c8cd3ac958a7eb316d67f2d316c27086c4c0369 | Python | behavioral | fail | easy | researcher_constructed | reproduced | # Task A: Unique command-prefix lookup
## Problem
Long command names are inconvenient to type, and some CLIs allow users to invoke
a command by an unambiguous prefix.
## Desired behavior
Allow command lookup to resolve a command-name prefix when it uniquely matches a
registered command.
## Constraints
Ambiguous p... | # Task B: Lowercase fallback for Click command lookup
## Problem
Command invocations with accidental uppercase spelling fail even when the
registered command has a clear lowercase equivalent.
## Desired behavior
When exact lookup fails, retry lookup using the lowercase form of the invoked
command name.
## Constrai... | Allow a command invocation to resolve a uniquely matching command-name prefix. | Allow command lookup to fall back to lowercase command names when an uppercase or mixed-case command invocation is not found exactly. | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..52d1cd2 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1938,7 +1938,21 @@ class Group(Command):
"""Given a context and a command name, this returns a :class:`Command`
object if it exists or returns ``None``.
"""
- ... | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..cb1467c 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -2077,6 +2077,13 @@ class Group(Command):
cmd_name = ctx.token_normalize_func(cmd_name)
cmd = self.get_command(ctx, cmd_name)
+ if cmd is None:
+ ... | diff --git a/src/click/core.py b/src/click/core.py
index de129ec..6d9c664 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -1938,7 +1938,21 @@ class Group(Command):
"""Given a context and a command name, this returns a :class:`Command`
object if it exists or returns ``None``.
"""
- ... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import click
from click.testing import CliRunner
def test_unique_prefix_invocation_resolves_command():
@click.group()
def cli():
pass
@cli.command("status")
def status():
click.echo("ok")
@cli.command("stop")
def stop():
click.echo("stop")
result = CliRunner().in... | import click
from click.testing import CliRunner
def test_uppercase_invocation_resolves_lowercase_command():
@click.group()
def cli():
pass
@cli.command("status")
def status():
click.echo("ok")
result = CliRunner().invoke(cli, ["STATUS"])
assert result.output == "ok\n"
| import click
from click.testing import CliRunner
def test_uppercase_prefix_does_not_transitively_resolve_command():
@click.group()
def cli():
pass
@cli.command("status")
def status():
click.echo("ok")
result = CliRunner().invoke(cli, ["STA"])
assert result.exit_code != 0
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A introduces unique-prefix command lookup. Patch B introduces lowercase fallback lookup. Together, an uppercase prefix such as STA is lowercased to sta and then resolved as a unique prefix for status, even though neither patch independently intended uppercase abbreviations. | Expansion seed instance. This is a controlled command-resolution conflict distinct from the underscore/dash aliasing interaction in click__002. | instances/click__004 |
typer__001 | https://github.com/fastapi/typer | 9a7b2e83f6b62c750d6026b0de9ebf2026a8b8fa | Python | behavioral | fail | easy | researcher_constructed | reproduced | # Task A: Underscore aliases for dashed Typer commands
## Problem
Typer command names often use dashes, while programmatic callers and scripts may
produce underscores.
## Desired behavior
Allow `TyperGroup` command lookup to treat underscores in the invoked command
name as aliases for dashes in registered command n... | # Task B: Lowercase fallback for Typer command lookup
## Problem
Users sometimes invoke Typer commands with uppercase or mixed-case spelling even
when the intended command is registered in lowercase.
## Desired behavior
Allow `TyperGroup` lookup to fall back to lowercase command names after exact
lookup fails.
## ... | Allow TyperGroup command lookup to treat underscores in an invoked command name as aliases for dashes in registered command names. | Allow TyperGroup command lookup to fall back to lowercase command names when a mixed-case or uppercase command invocation is not found exactly. | diff --git a/typer/core.py b/typer/core.py
index 1bfc399..1ef0610 100644
--- a/typer/core.py
+++ b/typer/core.py
@@ -1048,7 +1048,12 @@ class TyperGroup(_click.Command):
self.commands[name] = cmd
def get_command(self, ctx: _click.Context, cmd_name: str) -> _click.Command | None:
- return self.com... | diff --git a/typer/core.py b/typer/core.py
index 1bfc399..554d213 100644
--- a/typer/core.py
+++ b/typer/core.py
@@ -1168,6 +1168,13 @@ class TyperGroup(_click.Command):
cmd_name = ctx.token_normalize_func(cmd_name)
cmd = self.get_command(ctx, cmd_name)
+ if cmd is None:
+ ... | diff --git a/typer/core.py b/typer/core.py
index 1bfc399..777e0ab 100644
--- a/typer/core.py
+++ b/typer/core.py
@@ -1048,7 +1048,12 @@ class TyperGroup(_click.Command):
self.commands[name] = cmd
def get_command(self, ctx: _click.Context, cmd_name: str) -> _click.Command | None:
- return self.com... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import typer
from typer.testing import CliRunner
def test_underscore_invocation_resolves_dashed_command():
app = typer.Typer()
@app.command("foo-bar")
def foo_bar():
typer.echo("dash")
@app.command("other")
def other():
typer.echo("other")
result = CliRunner().invoke(app, ["... | import typer
from typer.testing import CliRunner
def test_uppercase_invocation_resolves_lowercase_command():
app = typer.Typer()
@app.command("status")
def status():
typer.echo("ok")
@app.command("other")
def other():
typer.echo("other")
result = CliRunner().invoke(app, ["ST... | import typer
from typer.testing import CliRunner
def test_uppercase_underscore_does_not_transitively_resolve_dashed_command():
app = typer.Typer()
@app.command("foo-bar")
def foo_bar():
typer.echo("dash")
@app.command("other")
def other():
typer.echo("other")
result = CliRun... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A introduces underscore-to-dash command aliasing in TyperGroup. Patch B introduces case-insensitive fallback lookup. Together, they create an unintended transitive lookup where FOO_BAR resolves to foo-bar, even though neither patch independently admits that invocation form. | First non-Click seed instance. This demonstrates that the command-resolution interference pattern can appear in Typer's framework layer as well. | instances/typer__001 |
typer__002 | https://github.com/fastapi/typer | 9a7b2e83f6b62c750d6026b0de9ebf2026a8b8fa | Python | behavioral | fail | easy | researcher_constructed | reproduced | # Task A: Unique-prefix Typer command lookup
## Problem
Typer command names may be long, and users sometimes expect unambiguous
abbreviations to work.
## Desired behavior
Allow a Typer command invocation to resolve a uniquely matching command-name
prefix.
## Constraints
Ambiguous prefixes must not execute a comma... | # Task B: Lowercase fallback for Typer invocations
## Problem
Case mistakes in command invocations are common, especially in scripts and
documentation examples.
## Desired behavior
When exact Typer command lookup fails, retry lookup using the lowercase invoked
name.
## Constraints
The fallback should not rewrite ... | Allow a Typer command invocation to resolve a uniquely matching command-name prefix. | Allow Typer command lookup to fall back to lowercase command names when an uppercase or mixed-case command invocation is not found exactly. | diff --git a/typer/core.py b/typer/core.py
index 51cd733..e8d09d3 100644
--- a/typer/core.py
+++ b/typer/core.py
@@ -1048,7 +1048,21 @@ class TyperGroup(_click.Command):
self.commands[name] = cmd
def get_command(self, ctx: _click.Context, cmd_name: str) -> _click.Command | None:
- return self.com... | diff --git a/typer/core.py b/typer/core.py
index 51cd733..a23b195 100644
--- a/typer/core.py
+++ b/typer/core.py
@@ -1168,6 +1168,13 @@ class TyperGroup(_click.Command):
cmd_name = ctx.token_normalize_func(cmd_name)
cmd = self.get_command(ctx, cmd_name)
+ if cmd is None:
+ ... | diff --git a/typer/core.py b/typer/core.py
index 1bfc399..30d71a0 100644
--- a/typer/core.py
+++ b/typer/core.py
@@ -1048,7 +1048,21 @@ class TyperGroup(_click.Command):
self.commands[name] = cmd
def get_command(self, ctx: _click.Context, cmd_name: str) -> _click.Command | None:
- return self.com... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import typer
from typer.testing import CliRunner
def test_unique_prefix_invocation_resolves_command():
app = typer.Typer()
@app.command("status")
def status():
typer.echo("ok")
@app.command("stop")
def stop():
typer.echo("stop")
result = CliRunner().invoke(app, ["sta"])
... | import typer
from typer.testing import CliRunner
def test_uppercase_invocation_resolves_lowercase_command():
app = typer.Typer()
@app.command("status")
def status():
typer.echo("ok")
@app.command("other")
def other():
typer.echo("other")
result = CliRunner().invoke(app, ["ST... | import typer
from typer.testing import CliRunner
def test_uppercase_prefix_does_not_transitively_resolve_command():
app = typer.Typer()
@app.command("status")
def status():
typer.echo("ok")
@app.command("other")
def other():
typer.echo("other")
result = CliRunner().invoke(ap... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A introduces unique-prefix command lookup in TyperGroup. Patch B introduces lowercase fallback lookup. Together, an uppercase prefix such as STA is lowercased and then resolved as a unique prefix for status, creating an unintended command invocation path. | Expansion seed instance. This mirrors the command-resolution interaction in Typer's custom Click-compatible group implementation. | instances/typer__002 |
commander__001 | https://github.com/tj/commander.js | ba6d13ddb4243e5913367734f8c159089ffe7834 | JavaScript | behavioral | fail | easy | researcher_constructed | reproduced | # Task A: Unique-prefix Commander subcommands
## Problem
Commander subcommands can have long names, and users may expect an
unambiguous abbreviation to resolve to the intended command.
## Desired behavior
Allow subcommand lookup to resolve a command-name prefix when exactly one
registered subcommand matches that pr... | # Task B: Lowercase fallback for Commander subcommands
## Problem
Users may type Commander subcommands with uppercase or mixed-case spelling even
when the registered subcommand is lowercase.
## Desired behavior
When exact subcommand dispatch fails, retry lookup with the lowercase invoked
subcommand name.
## Constr... | Allow a Commander subcommand invocation to resolve a uniquely matching command-name prefix. | Allow Commander subcommand dispatch to fall back to lowercase command names when an uppercase or mixed-case invocation is not found exactly. | diff --git a/lib/command.js b/lib/command.js
index e79a5ad..885f7d3 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -1660,10 +1660,20 @@ export class Command extends EventEmitter {
* @return {Command | undefined}
*/
_findCommand(name) {
if (!name) return undefined;
- return this.commands.find(
+ ... | diff --git a/lib/command.js b/lib/command.js
index e79a5ad..3f3cc61 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -1567,6 +1567,14 @@ export class Command extends EventEmitter {
unknown = parsed.unknown;
this.args = operands.concat(unknown);
+ if (operands.length && !this._findCommand(operands[0]))... | diff --git a/lib/command.js b/lib/command.js
index 9a3d03e..1bb74e3 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -1567,6 +1567,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
unknown = parsed.unknown;
this.args = operands.concat(unknown);
+ if (operands.length && !this._findCommand(opera... | oracle/test_patch_a.mjs | oracle/test_patch_b.mjs | oracle/test_composition.mjs | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('unique prefix invocation resolves subcommand', () => {
const program = new Command();
let called = '';
program... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('uppercase invocation resolves lowercase subcommand', () => {
const program = new Command();
let called = '';
p... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('uppercase prefix does not transitively resolve subcommand', () => {
const program = new Command();
let called = '... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A introduces unique-prefix subcommand lookup. Patch B introduces lowercase fallback before dispatch. Together, an uppercase prefix such as STA is lowercased to sta and then resolved as a unique prefix for status, admitting a command spelling neither patch independently intended. | First JavaScript seed instance. The oracle uses Node's built-in node:test runner and imports Commander from the local repository checkout. | instances/commander__001 |
commander__002 | https://github.com/tj/commander.js | ba6d13ddb4243e5913367734f8c159089ffe7834 | JavaScript | configuration | fail | easy | researcher_constructed | reproduced | # Task A: False-like environment values for booleans
## Problem
Boolean options sourced from environment variables often receive string values
such as `false`, `0`, or `no`, which should be interpreted as false rather than
truthy strings.
## Desired behavior
Treat common false-like environment values for boolean op... | # Task B: Implied option values override configuration sources
## Problem
An option may imply another option value, and users expect that implication to
take effect even when the implied option has a value from environment or config.
## Desired behavior
Allow implied option values to override values derived from en... | Treat common false-like environment values for boolean options as false. | Allow implied option values to override environment/config-derived values. | diff --git a/lib/command.js b/lib/command.js
index 9a3d03e..14f364a 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -1992,8 +1992,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);
} else {
// boolean
- ... | diff --git a/lib/command.js b/lib/command.js
index 9a3d03e..e8794d7 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -2010,7 +2010,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
const hasCustomOptionValue = (optionKey) => {
return (
this.getOptionValue(optionKey) !== undefined &&
- ... | diff --git a/lib/command.js b/lib/command.js
index 9a3d03e..e0cbae3 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -1992,8 +1992,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);
} else {
// boolean
- ... | oracle/test_patch_a.mjs | oracle/test_patch_b.mjs | oracle/test_composition.mjs | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command, Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
function withEnv(name, value, fn) {
const previous = process.env[name];
process.env[name] = value;
try {
... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command, Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
function withEnv(name, value, fn) {
const previous = process.env[name];
process.env[name] = value;
try {
... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command, Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
function withEnv(name, value, fn) {
const previous = process.env[name];
process.env[name] = value;
try {
... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A turns DEBUG=false into an explicit env-derived false value. Patch B lets implied option values override env/config-derived values. Together, --trace can override DEBUG=false via an implied debug=true value, violating the intended configuration precedence contract. | Second Commander.js seed instance. This expands configuration-precedence coverage with a JavaScript-only example. | instances/commander__002 |
commander__003 | https://github.com/tj/commander.js | ba6d13ddb4243e5913367734f8c159089ffe7834 | JavaScript | api_contract | fail | easy | researcher_constructed | reproduced | # Task A: Flag spelling aliases for option conflicts
## Problem
Commander option conflict declarations are easier to write with CLI flag
spellings such as `--cache-dir`, but internally options are tracked by
attribute names such as `cacheDir`.
## Desired behavior
Allow `Option.conflicts()` to accept long flag spell... | # Task B: Flag spelling aliases for implied option values
## Problem
Commander implication declarations are easier to read when they use CLI flag
spellings, but implied values are applied using internal option attribute names.
## Desired behavior
Allow `Option.implies()` to accept long flag spellings and normalize ... | Allow Option.conflicts() to accept long option flag spellings, such as --cache-dir, as aliases for Commander option attribute names, such as cacheDir. | Allow Option.implies() to accept long option flag spellings, such as --cache-dir, and normalize them to Commander option attribute names when setting implied option values. | diff --git a/lib/option.js b/lib/option.js
index 4b4daaf..caa8325 100644
--- a/lib/option.js
+++ b/lib/option.js
@@ -80,7 +80,16 @@ export class Option {
*/
conflicts(names) {
- this.conflictsWith = this.conflictsWith.concat(names);
+ const normaliseName = (name) => {
+ if (name.startsWith('--no-'))... | diff --git a/lib/option.js b/lib/option.js
index 4b4daaf..6d7754d 100644
--- a/lib/option.js
+++ b/lib/option.js
@@ -103,6 +103,12 @@ export class Option {
// string is not documented, but easy mistake and we can do what user probably intended.
newImplied = { [impliedOptionValues]: true };
}
+ new... | diff --git a/lib/option.js b/lib/option.js
index 4b4daaf..9fbe5f2 100644
--- a/lib/option.js
+++ b/lib/option.js
@@ -80,7 +80,16 @@ export class Option {
*/
conflicts(names) {
- this.conflictsWith = this.conflictsWith.concat(names);
+ const normaliseName = (name) => {
+ if (name.startsWith('--no-'))... | oracle/test_patch_a.mjs | oracle/test_patch_b.mjs | oracle/test_composition.mjs | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command, Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('conflicts accepts long option flag spelling', () => {
const program = new Command();
program.exitOverride... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command, Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('implies accepts long option flag spelling', () => {
const program = new Command();
program.exitOverride()... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command, Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('self-implied option value does not trigger a user-facing conflict', () => {
const program = new Command();
... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A normalizes flag spellings in conflicts(). Patch B normalizes flag spellings in implies(). Together, an option that both conflicts with and implies the same flag spelling converts the implied value into the canonical option key, so Commander reports a user-facing conflict even though the user only supplied the i... | Third JavaScript seed instance. It captures an API-contract interaction between two helper APIs that each accept user-facing long flag spellings. | instances/commander__003 |
commander__004 | https://github.com/tj/commander.js | ba6d13ddb4243e5913367734f8c159089ffe7834 | JavaScript | api_contract | fail | easy | researcher_constructed | reproduced | # Task A: Clear defaults when making prepared arguments optional
## Problem
A prepared `Argument` can be converted from required to optional after it has
already been given a default value, leaving stale fallback state attached to the
argument.
## Desired behavior
Update `Argument.argOptional()` so converting an ar... | # Task B: Accept prepared required arguments with defaults
## Problem
`Command.addArgument()` rejects a prepared required `Argument` that has a
default value, even though applications may want to interpret that default as a
fallback for omitted input.
## Desired behavior
Allow `Command.addArgument()` to treat such ... | Allow Argument.argOptional() to clear stale default values when converting required arguments into optional arguments. | Allow Command.addArgument() to treat prepared required arguments with defaults as optional fallback arguments. | diff --git a/lib/argument.js b/lib/argument.js
index 6da521d..a168149 100644
--- a/lib/argument.js
+++ b/lib/argument.js
@@ -126,10 +126,11 @@ export class Argument {
*
* @returns {Argument}
*/
argOptional() {
this.required = false;
+ this.defaultValue = undefined;
return this;
}
}
/*... | diff --git a/lib/command.js b/lib/command.js
index 9a3d03e..36d458e 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -383,13 +383,11 @@ export class Command extends EventEmitter {
if (
argument.required &&
argument.defaultValue !== undefined &&
argument.parseArg === undefined
) {
- ... | diff --git a/lib/argument.js b/lib/argument.js
index 6da521d..a168149 100644
--- a/lib/argument.js
+++ b/lib/argument.js
@@ -126,10 +126,11 @@ export class Argument {
*
* @returns {Argument}
*/
argOptional() {
this.required = false;
+ this.defaultValue = undefined;
return this;
}
}
/*... | oracle/test_patch_a.mjs | oracle/test_patch_b.mjs | oracle/test_composition.mjs | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Argument } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('argOptional clears default values when changing required arguments', () => {
const arg = new Argument('<file>').de... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Argument, Command } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('required argument default is treated as optional fallback', () => {
const program = new Command();
let ... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Argument, Command } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('required argument defaults survive the optionalization path', () => {
const program = new Command();
le... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A changes argOptional() so it clears default values. Patch B starts using argOptional() to reinterpret required arguments with defaults as optional fallback arguments. Together, the fallback value is silently discarded, so a missing argument resolves to undefined instead of the configured default. | Commander.js API-contract interaction around default-bearing positional arguments and helper reuse. | instances/commander__004 |
commander__005 | https://github.com/tj/commander.js | ba6d13ddb4243e5913367734f8c159089ffe7834 | JavaScript | behavioral | fail | easy | researcher_constructed | reproduced | # Task A: Classify negated options as boolean options
## Problem
Negated options such as `--no-cache` behave like boolean flags but may not be
reported as boolean options by generic option-inspection code.
## Desired behavior
Update boolean option classification so negated options are treated as boolean
options.
#... | # Task B: Simplify missing option value resolution
## Problem
Commander has multiple branches for filling in missing option values, including
boolean, optional, and negated options.
## Desired behavior
Resolve boolean and optional options before falling through to the dedicated
negated-option value branch.
## Cons... | Classify negated options as boolean options so generic option-inspection code treats boolean flags uniformly. | Resolve boolean and optional option values before falling through to the dedicated negated-option value branch. | diff --git a/lib/option.js b/lib/option.js
index 4b4daaf..d80d923 100644
--- a/lib/option.js
+++ b/lib/option.js
@@ -252,11 +252,11 @@ export class Option {
* @return {boolean}
* @package
*/
isBoolean() {
- return !this.required && !this.optional && !this.negate;
+ return !this.required && !this.... | diff --git a/lib/command.js b/lib/command.js
index 9a3d03e..6d5ff84 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -695,14 +695,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
val = option._collectValue(val, oldValue);
}
// Fill-in appropriate missing values. Long winded but easy... | diff --git a/lib/command.js b/lib/command.js
index 9a3d03e..6d5ff84 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -695,14 +695,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
val = option._collectValue(val, oldValue);
}
// Fill-in appropriate missing values. Long winded but easy... | oracle/test_patch_a.mjs | oracle/test_patch_b.mjs | oracle/test_composition.mjs | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command, Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('negated options are classified as boolean options', () => {
assert.equal(new Option('--no-cache').isBoolean... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('negated options still resolve to false without an explicit value', () => {
const program = new Command();
program... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Command } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('negated options still resolve to false after boolean classification changes', () => {
const program = new Command()... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A broadens Option.isBoolean() to include negated options. Patch B checks isBoolean() before the negate-specific branch. Together, --no-cache is interpreted as a regular boolean flag and becomes true instead of false. | Commander.js behavioral interaction between option classification and value-resolution branch ordering. | instances/commander__005 |
commander_control__001 | https://github.com/tj/commander.js | ba6d13ddb4243e5913367734f8c159089ffe7834 | JavaScript | control | pass | easy | researcher_constructed | reproduced | # Patch A task
Add an introspection helper for positional arguments.
Users who build higher-level tooling around Commander need to know whether an
`Argument` instance is required without parsing the decorated usage string. Add
an `isRequired()` method to `Argument` that returns the argument's existing
required/option... | # Patch B task
Add an introspection helper for negated options.
Users who inspect command schemas need to distinguish `--no-*` options from
ordinary boolean options without reaching into private fields. Add an
`isNegated()` method to `Option` that returns whether the option was declared as
a negated option.
Constrai... | Add Argument.isRequired() so tooling can inspect whether a positional argument is required. | Add Option.isNegated() so tooling can inspect whether an option was declared as --no-*. | diff --git a/lib/argument.js b/lib/argument.js
index 6da521d..ded0d68 100644
--- a/lib/argument.js
+++ b/lib/argument.js
@@ -128,10 +128,19 @@ export class Argument {
*/
argOptional() {
this.required = false;
return this;
}
+
+ /**
+ * Return whether argument is required.
+ *
+ * @returns {bo... | diff --git a/lib/option.js b/lib/option.js
index 4b4daaf..d7ed57f 100644
--- a/lib/option.js
+++ b/lib/option.js
@@ -254,10 +254,21 @@ export class Option {
*/
isBoolean() {
return !this.required && !this.optional && !this.negate;
}
+
+ /**
+ * Return whether option is a negated option.
+ *
+ * ... | diff --git a/lib/argument.js b/lib/argument.js
index 6da521d..ded0d68 100644
--- a/lib/argument.js
+++ b/lib/argument.js
@@ -128,10 +128,19 @@ export class Argument {
*/
argOptional() {
this.required = false;
return this;
}
+
+ /**
+ * Return whether argument is required.
+ *
+ * @returns {bo... | oracle/test_patch_a.mjs | oracle/test_patch_b.mjs | oracle/test_composition.mjs | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Argument } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('Argument.isRequired exposes required argument state', () => {
assert.equal(new Argument('<file>').isRequired(), tr... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('Option.isNegated exposes negated option state', () => {
assert.equal(new Option('--no-cache').isNegated(), true);
... | import assert from 'node:assert/strict';
import { test } from 'node:test';
import { pathToFileURL } from 'node:url';
const { Argument, Option } = await import(pathToFileURL(`${process.cwd()}/index.js`));
test('argument and option introspection helpers compose cleanly', () => {
assert.equal(new Argument('<file>').is... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A and Patch B add independent introspection helpers on separate Commander classes, and the composition oracle confirms both APIs work together. | Initial matched control instance for clean composition in Commander.js. | instances/commander_control__001 |
httpx__001 | https://github.com/encode/httpx | b5addb64f0161ff6bfe94c124ef76f6a1fba5254 | Python | api_contract | fail | easy | researcher_constructed | reproduced | # Task A: Case-insensitive QueryParams membership
## Problem
Some query parameter checks use membership tests, and callers may expect
parameter names to match regardless of casing.
## Desired behavior
Allow `QueryParams.__contains__` membership checks to treat parameter names
case-insensitively.
## Constraints
Th... | # Task B: Delegate QueryParams.get through mapping access
## Problem
`QueryParams.get`, membership checks, and item access can drift if each path
implements lookup logic separately.
## Desired behavior
Refactor `QueryParams.get` to delegate through the mapping protocol so `get`,
`in`, and item access share behavior... | Allow QueryParams membership checks to treat query parameter names case-insensitively. | Refactor QueryParams.get to delegate through the mapping protocol so get, contains, and item access share behavior. | diff --git a/httpx/_urls.py b/httpx/_urls.py
index 8f261c7..7c91581 100644
--- a/httpx/_urls.py
+++ b/httpx/_urls.py
@@ -601,7 +601,13 @@ class QueryParams(typing.Mapping[str, str]):
return self._dict[key][0]
def __contains__(self, key: typing.Any) -> bool:
- return key in self._dict
+ if ... | diff --git a/httpx/_urls.py b/httpx/_urls.py
index 8f261c7..81411cc 100644
--- a/httpx/_urls.py
+++ b/httpx/_urls.py
@@ -521,8 +521,8 @@ class QueryParams(typing.Mapping[str, str]):
q = httpx.QueryParams("a=123&a=456&b=789")
assert q.get("a") == "123"
"""
- if key in self._dict:
- ... | diff --git a/httpx/_urls.py b/httpx/_urls.py
index 301d087..af9e6b0 100644
--- a/httpx/_urls.py
+++ b/httpx/_urls.py
@@ -519,8 +519,8 @@ class QueryParams(typing.Mapping[str, str]):
q = httpx.QueryParams("a=123&a=456&b=789")
assert q.get("a") == "123"
"""
- if key in self._dict:
- ... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import httpx
def test_queryparams_contains_is_case_insensitive():
params = httpx.QueryParams({"Token": "abc"})
assert "token" in params
assert "TOKEN" in params
| import httpx
def test_queryparams_get_still_returns_exact_key_value():
params = httpx.QueryParams({"token": "abc"})
assert params.get("token") == "abc"
assert params.get("missing", "fallback") == "fallback"
| import httpx
def test_case_insensitive_contains_does_not_break_get_default():
params = httpx.QueryParams({"Token": "abc"})
assert params.get("token", "missing") == "missing"
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A makes QueryParams.__contains__ case-insensitive without changing __getitem__. Patch B changes QueryParams.get to depend on __contains__ and __getitem__ agreeing. Together, a case-insensitive membership hit can be followed by exact-key item access, raising KeyError instead of returning the provided default. | First HTTPX seed instance. This broadens the benchmark beyond CLI parsing into mapping/API-contract behavior. | instances/httpx__001 |
httpx__002 | https://github.com/encode/httpx | b5addb64f0161ff6bfe94c124ef76f6a1fba5254 | Python | security_policy | fail | medium | researcher_constructed | reproduced | # Task A: Preserve credentials for loopback HTTP-to-HTTPS redirects
## Problem
Local development services often redirect from HTTP to HTTPS on loopback hosts,
and dropping credentials can break authenticated local workflows.
## Desired behavior
Preserve `Authorization` headers for redirects that stay on a loopback ... | # Task B: Treat localhost aliases as same-origin
## Problem
Loopback services may use `localhost` and `127.0.0.1` interchangeably, but
origin checks can treat them as unrelated hosts.
## Desired behavior
Treat `localhost` and `127.0.0.1` as same-origin aliases when scheme and port
match.
## Constraints
The alias ... | Preserve Authorization headers for loopback HTTP-to-HTTPS redirects. | Treat localhost and 127.0.0.1 as same-origin aliases when scheme and port match. | diff --git a/httpx/_client.py b/httpx/_client.py
index 13cd933..f1e8d02 100644
--- a/httpx/_client.py
+++ b/httpx/_client.py
@@ -74,6 +74,21 @@ def _is_https_redirect(url: URL, location: URL) -> bool:
)
+def _is_loopback_https_redirect(url: URL, location: URL) -> bool:
+ """
+ Return 'True' for HTTPS upg... | diff --git a/httpx/_client.py b/httpx/_client.py
index 13cd933..8fb223c 100644
--- a/httpx/_client.py
+++ b/httpx/_client.py
@@ -86,11 +86,18 @@ def _same_origin(url: URL, other: URL) -> bool:
"""
return (
url.scheme == other.scheme
- and url.host == other.host
+ and _same_host_or_loopb... | diff --git a/httpx/_client.py b/httpx/_client.py
index 13cd933..dc8cc58 100644
--- a/httpx/_client.py
+++ b/httpx/_client.py
@@ -74,6 +74,21 @@ def _is_https_redirect(url: URL, location: URL) -> bool:
)
+def _is_loopback_https_redirect(url: URL, location: URL) -> bool:
+ """
+ Return 'True' for HTTPS upg... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import httpx
def test_loopback_https_upgrade_preserves_authorization():
client = httpx.Client()
request = client.build_request(
"GET",
"http://localhost:8000/start",
headers={"Authorization": "Bearer secret"},
)
headers = client._redirect_headers(
request,
http... | import httpx
def test_loopback_alias_same_scheme_preserves_authorization():
client = httpx.Client()
request = client.build_request(
"GET",
"http://localhost:8000/start",
headers={"Authorization": "Bearer secret"},
)
headers = client._redirect_headers(
request,
... | import httpx
def test_loopback_alias_https_upgrade_strips_authorization():
client = httpx.Client()
request = client.build_request(
"GET",
"http://localhost:8000/start",
headers={"Authorization": "Bearer secret"},
)
headers = client._redirect_headers(
request,
h... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A preserves Authorization on loopback HTTP-to-HTTPS redirects. Patch B treats localhost and 127.0.0.1 as same-origin aliases for matching scheme and port. Together, the composed client preserves Authorization across both a scheme change and host-alias change, violating the redirect credential-forwarding policy en... | First security-policy seed. It tests how two individually plausible redirect relaxations compose into an overly broad credential-forwarding rule. | instances/httpx__002 |
httpx__003 | https://github.com/encode/httpx | b5addb64f0161ff6bfe94c124ef76f6a1fba5254 | Python | state_invariant | fail | easy | researcher_constructed | reproduced | # Task A: Preserve original header casing in keys
## Problem
HTTP header lookup is case-insensitive, but callers sometimes need to inspect
the original casing used when headers were provided.
## Desired behavior
Expose original header casing from `Headers.keys()`.
## Constraints
Case-insensitive lookup behavior s... | # Task B: Optimize Headers.update normalized-key removal
## Problem
Updating headers should remove any existing logical header before inserting the
new value, and this path can be optimized by comparing normalized keys directly.
## Desired behavior
Refactor `Headers.update` to remove existing entries through direct... | Preserve original header casing when exposing Headers.keys(). | Optimize Headers.update by removing existing entries through direct normalized-key matching. | diff --git a/httpx/_models.py b/httpx/_models.py
index 2cc8632..80bfb65 100644
--- a/httpx/_models.py
+++ b/httpx/_models.py
@@ -200,7 +200,7 @@ class Headers(typing.MutableMapping[str, str]):
return [(raw_key, value) for raw_key, _, value in self._list]
def keys(self) -> typing.KeysView[str]:
- ... | diff --git a/httpx/_models.py b/httpx/_models.py
index 2cc8632..ec3837f 100644
--- a/httpx/_models.py
+++ b/httpx/_models.py
@@ -274,8 +274,10 @@ class Headers(typing.MutableMapping[str, str]):
def update(self, headers: HeaderTypes | None = None) -> None: # type: ignore
headers = Headers(headers)
... | diff --git a/httpx/_models.py b/httpx/_models.py
index 2cc8632..efc615c 100644
--- a/httpx/_models.py
+++ b/httpx/_models.py
@@ -200,7 +200,7 @@ class Headers(typing.MutableMapping[str, str]):
return [(raw_key, value) for raw_key, _, value in self._list]
def keys(self) -> typing.KeysView[str]:
- ... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import httpx
def test_headers_keys_preserve_original_casing():
headers = httpx.Headers([("X-Token", "one")])
assert list(headers.keys()) == ["X-Token"]
| import httpx
def test_update_replaces_existing_logical_header():
headers = httpx.Headers({"X-Token": "old"})
headers.update({"x-token": "new"})
assert headers.get_list("x-token") == ["new"]
| import httpx
def test_update_preserves_single_logical_header_after_case_change():
headers = httpx.Headers({"x-token": "old"})
headers.update({"X-Token": "new"})
assert headers.get_list("x-token") == ["new"]
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A makes Headers.keys() expose original-case header names. Patch B optimizes Headers.update() by directly comparing incoming keys against normalized lookup keys. Together, an update with different casing fails to remove the old logical header and leaves duplicate values in the internal header list. | First state-invariant seed. It captures the invariant that Headers.update must leave one logical value per updated header regardless of presentation casing. | instances/httpx__003 |
httpx_control__001 | https://github.com/encode/httpx | b5addb64f0161ff6bfe94c124ef76f6a1fba5254 | Python | control | pass | easy | researcher_constructed | reproduced | # Patch A task
Add a helper for detecting repeated header values.
Consumers that inspect HTTP response metadata sometimes need to know whether a
header was provided more than once without manually calling and counting
`get_list()`. Add `Headers.has_multiple(key)` that returns `True` when the
header has multiple store... | # Patch B task
Add a helper for query-parameter key presence.
Callers that inspect query strings need a direct way to ask whether a key is
present without retrieving a value. Add `QueryParams.has_key(key)` that returns
whether the normalized key exists in the query parameter mapping.
Constraints:
- Do not change qu... | Add Headers.has_multiple() so callers can detect repeated header values without manually counting get_list(). | Add QueryParams.has_key() so callers can directly test query-parameter key presence. | diff --git a/httpx/_models.py b/httpx/_models.py
index 2cc8632..61f23a1 100644
--- a/httpx/_models.py
+++ b/httpx/_models.py
@@ -247,10 +247,16 @@ class Headers(typing.MutableMapping[str, str]):
try:
return self[key]
except KeyError:
return default
+ def has_multiple(sel... | diff --git a/httpx/_urls.py b/httpx/_urls.py
index 301d087..c9be7a2 100644
--- a/httpx/_urls.py
+++ b/httpx/_urls.py
@@ -521,10 +521,16 @@ class QueryParams(typing.Mapping[str, str]):
"""
if key in self._dict:
return self._dict[str(key)][0]
return default
+ def has_key(self,... | diff --git a/httpx/_models.py b/httpx/_models.py
index 2cc8632..61f23a1 100644
--- a/httpx/_models.py
+++ b/httpx/_models.py
@@ -247,10 +247,16 @@ class Headers(typing.MutableMapping[str, str]):
try:
return self[key]
except KeyError:
return default
+ def has_multiple(sel... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import httpx
def test_headers_has_multiple_detects_repeated_values():
headers = httpx.Headers([("X-Trace", "one"), ("x-trace", "two"), ("Other", "v")])
assert headers.has_multiple("X-Trace") is True
assert headers.has_multiple("x-trace") is True
assert headers.has_multiple("Other") is False
asser... | import httpx
def test_query_params_has_key_detects_presence():
params = httpx.QueryParams("a=1&a=2&empty=")
assert params.has_key("a") is True
assert params.has_key("empty") is True
assert params.has_key("missing") is False
assert params.has_key(123) is False
| import httpx
def test_header_and_query_helpers_compose_cleanly():
headers = httpx.Headers([("X-Trace", "one"), ("x-trace", "two"), ("Other", "v")])
params = httpx.QueryParams("a=1&a=2&empty=")
assert headers.has_multiple("X-Trace") is True
assert headers.has_multiple("Other") is False
assert para... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A and Patch B add independent helpers on Headers and QueryParams, and the composition oracle confirms both behaviors pass together. | Initial matched control instance for clean composition in HTTPX. | instances/httpx_control__001 |
markupsafe__001 | https://github.com/pallets/markupsafe | b2e4d9c7687be25695fffbe93a37622302b24fb1 | Python | test_assumption | fail | easy | researcher_constructed | reproduced | # Task A: Treat None as empty in old-style Markup formatting
## Problem
Old-style Markup formatting may receive optional values that are represented as
`None`, and rendering the literal string `"None"` can be undesirable in HTML
templates.
## Desired behavior
Make old-style Markup formatting treat `None` as an empt... | # Task B: Reuse old-style escaping for simple format fields
## Problem
Markup has multiple formatting paths, and simple new-style format fields should
reuse the same escaping behavior as the older helper where practical.
## Desired behavior
Refactor simple `Markup.format` field handling to use the old-style escape
... | Make old-style Markup formatting treat None as an empty optional value. | Reuse the old-style escape helper for simple Markup.format fields. | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..01cd222 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -367,7 +367,7 @@ class _MarkupEscapeHelper:
return self.__class__(self.obj[key], self.escape)
def __str__(self, /) -> str:
- retu... | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..328c244 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -348,6 +348,9 @@ class EscapeFormatter(string.Formatter):
)
rv = value.__html__()
else:
+ if not forma... | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..b79d5b3 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -348,6 +348,9 @@ class EscapeFormatter(string.Formatter):
)
rv = value.__html__()
else:
+ if not forma... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import Markup
def test_old_style_markup_formatting_treats_none_as_empty() -> None:
assert Markup("%s") % None == Markup("")
assert Markup("{}").format(None) == Markup("None")
| import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import Markup
def test_simple_format_fields_preserve_existing_escape_behavior() -> None:
assert Markup("<{}>").format("<x>") == Markup("<<x>>")
assert Markup("{}").format(None) == Markup("None")
assert ... | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import Markup
def test_new_style_formatting_does_not_silently_drop_none() -> None:
assert Markup("{}").format(None) == Markup("None")
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A changes the old-style formatting helper so None is silently escaped as an empty string. Patch B routes simple new-style format fields through that helper. Together, Markup.format(None) stops rendering the literal text None, violating an existing formatting assumption that new-style formatting preserves Python's... | First MarkupSafe seed instance and first test_assumption category instance. The interaction is between formatting-helper reuse and an implicit test expectation around None stringification. | instances/markupsafe__001 |
markupsafe__002 | https://github.com/pallets/markupsafe | b2e4d9c7687be25695fffbe93a37622302b24fb1 | Python | api_contract | fail | easy | researcher_constructed | reproduced | # Task A: Decode bytes in soft_str
## Problem
`soft_str` is used as a gentle conversion helper, but byte strings are displayed
as Python bytes representations instead of decoded text.
## Desired behavior
Teach `soft_str` to decode byte strings as UTF-8 text.
## Constraints
Existing string and Markup inputs should... | # Task B: Use soft_str for escape fallback conversion
## Problem
`escape` and `soft_str` can diverge when converting non-string values before
HTML escaping.
## Desired behavior
Refactor `escape` so its non-string fallback conversion goes through
`soft_str`.
## Constraints
HTML-aware objects and existing Markup va... | Teach soft_str to decode byte strings as UTF-8 text. | Refactor escape to use soft_str for non-string fallback conversion. | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..761b61a 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -75,6 +75,9 @@ def soft_str(s: t.Any, /) -> str:
>>> escape(soft_str(value))
Markup('<User 1>')
"""
+ if isinstance(s, bytes):
+... | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..03ac53a 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -42,7 +42,7 @@ def escape(s: t.Any, /) -> Markup:
if hasattr(s, "__html__"):
return Markup(s.__html__())
- return Markup(_escape_inne... | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..f67c9ef 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -42,7 +42,7 @@ def escape(s: t.Any, /) -> Markup:
if hasattr(s, "__html__"):
return Markup(s.__html__())
- return Markup(_escape_inne... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import escape, soft_str
def test_soft_str_decodes_bytes_without_changing_escape_bytes_contract() -> None:
assert soft_str(b"<x>") == "<x>"
assert escape(b"<x>") == "b'<x>'"
| import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import Markup, escape
def test_escape_soft_str_refactor_preserves_fallback_behavior() -> None:
assert escape(Markup("<safe>")) == Markup("<safe>")
assert escape(b"<x>") == Markup("b'<x>'")
| import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import Markup, escape
def test_escape_bytes_keeps_python_bytes_representation() -> None:
assert escape(b"<x>") == Markup("b'<x>'")
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A makes soft_str decode bytes to text. Patch B makes escape use soft_str for fallback conversion. Together, escape(bytes) stops escaping Python's bytes representation and instead escapes decoded byte content, changing a public conversion contract. | Second MarkupSafe seed instance. It targets conversion and escaping semantics, distinct from markupsafe__001 formatting-helper assumptions. | instances/markupsafe__002 |
markupsafe__003 | https://github.com/pallets/markupsafe | b2e4d9c7687be25695fffbe93a37622302b24fb1 | Python | api_contract | fail | easy | researcher_constructed | reproduced | # Task A: Prefer __html_format__ during escaping
## Problem
HTML-aware objects may define both `__html__` and `__html_format__`, and
format-aware escaping should prefer the richer formatting protocol when
available.
## Desired behavior
When escaping an HTML-aware object, prefer `__html_format__("")` over
`__html__`... | # Task B: Delegate Markup construction through escape
## Problem
Constructing `Markup` from HTML-aware objects duplicates conversion behavior
that already exists in `escape`.
## Desired behavior
Delegate `Markup` construction for HTML-aware objects through `escape`.
## Constraints
The constructor should preserve ... | Prefer __html_format__("") when escaping HTML-aware objects. | Delegate Markup construction for HTML-aware objects through escape. | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..64a2348 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -38,6 +38,10 @@ def escape(s: t.Any, /) -> Markup:
if type(s) is str:
return Markup(_escape_inner(s))
+ html_format = getattr(s, "__h... | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..4883345 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -122,7 +122,7 @@ class Markup(str):
cls, object: t.Any = "", encoding: str | None = None, errors: str = "strict"
) -> te.Self:
if... | diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index f8a0d58..af787e1 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -38,6 +38,10 @@ def escape(s: t.Any, /) -> Markup:
if type(s) is str:
return Markup(_escape_inner(s))
+ html_format = getattr(s, "__h... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import Markup, escape
class HTMLAndFormat:
def __html__(self) -> str:
return "<html>"
def __html_format__(self, format_spec: str) -> str:
assert format_spec == ""
return "<format>"
def ... | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import Markup
class HTMLAndFormat:
def __html__(self) -> str:
return "<html>"
def __html_format__(self, format_spec: str) -> str:
return "<format>"
def test_markup_constructor_escape_delegation... | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "src"))
from markupsafe import Markup
class HTMLAndFormat:
def __html__(self) -> str:
return "<html>"
def __html_format__(self, format_spec: str) -> str:
return "<format>"
def test_markup_constructor_still_uses_html_m... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A makes escape prefer __html_format__("") over __html__ when both are present. Patch B makes Markup construction delegate HTML-aware objects through escape. Together, Markup(obj) changes from using obj.__html__() to using obj.__html_format__(""), violating the constructor's established HTML protocol contract. | Third MarkupSafe seed instance. It targets protocol precedence between __html__, __html_format__, escape, and Markup construction. | instances/markupsafe__003 |
rich__001 | https://github.com/Textualize/rich | 9d8f9a372cc5916fd4781fec207ced7ddac2f08f | Python | behavioral | fail | easy | researcher_constructed | reproduced | # Task A: Extend trailing inline style spans during right padding
## Problem
When right-padding a Rich `Text` object, added spaces can appear unstyled even
when they conceptually extend styled inline content.
## Desired behavior
Extend trailing inline style spans when right-padding `Text`.
## Constraints
Only tra... | # Task B: Reuse right-padding helper in truncate padding
## Problem
`Text.truncate(..., pad=True)` has padding logic that overlaps with the
existing right-padding helper.
## Desired behavior
Refactor truncate padding to delegate to the existing right-padding helper.
## Constraints
The visible output of truncation... | Extend trailing inline style spans when right-padding Rich Text objects. | Delegate truncate padding to the existing right-padding helper. | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..163e52d0 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -939,7 +939,17 @@ class Text(JupyterMixin):
"""
assert len(character) == 1, "Character must be a string of length 1"
if count:
+ original_length = len(self)
... | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..36cdeca9 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -880,8 +880,7 @@ class Text(JupyterMixin):
self.plain = set_cell_size(self.plain, max_width)
if pad and length < max_width:
spaces = max_width - length
- ... | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..112258c6 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -880,8 +880,7 @@ class Text(JupyterMixin):
self.plain = set_cell_size(self.plain, max_width)
if pad and length < max_width:
spaces = max_width - length
- ... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | from rich.text import Span, Text
def test_pad_right_extends_trailing_inline_style_over_padding() -> None:
text = Text.from_markup("[red]x[/red]")
text.pad_right(2)
assert text.plain == "x "
assert text.spans == [Span(0, 3, "red")]
| from rich.text import Span, Text
def test_truncate_pad_preserves_existing_padding_contract() -> None:
text = Text.from_markup("[red]x[/red]")
text.truncate(3, pad=True)
assert text.plain == "x "
assert len(text) == 3
assert text.spans == [Span(0, 1, "red")]
| from rich.text import Span, Text
def test_truncate_padding_does_not_inherit_content_style() -> None:
text = Text.from_markup("[red]x[/red]")
text.truncate(3, pad=True)
assert text.plain == "x "
assert text.spans == [Span(0, 1, "red")]
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A makes pad_right extend a trailing inline style span over added padding. Patch B routes truncate(..., pad=True) through pad_right. Together, truncation padding inherits the content style, violating the existing truncation-padding contract that added padding remains unstyled. | First Rich seed instance and first text-rendering instance. It broadens the benchmark to terminal rendering behavior and captures a helper-delegation interaction. | instances/rich__001 |
rich__002 | https://github.com/Textualize/rich | 9d8f9a372cc5916fd4781fec207ced7ddac2f08f | Python | api_contract | fail | easy | researcher_constructed | reproduced | # Task A: Preserve appended Text end metadata in append_text
## Problem
Internal text appends may drop the appended `Text` object's end metadata, which
can matter for downstream rendering or line-ending behavior.
## Desired behavior
Make `append_text` preserve the appended `Text` object's end metadata.
## Constrai... | # Task B: Delegate public Text.append(Text) to append_text
## Problem
Public `Text.append` and the internal `append_text` helper duplicate logic for
combining `Text` objects.
## Desired behavior
Refactor public `Text.append(Text)` to delegate to `append_text`.
## Constraints
The public `append` contract should re... | Make append_text preserve the appended Text object's end metadata. | Refactor public Text.append(Text) to delegate to append_text. | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..1d2ccbfd 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -1025,6 +1025,7 @@ class Text(JupyterMixin):
for start, end, style in text._spans.copy()
)
self._length += len(text)
+ self.end = text.end
return self
d... | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..eefa3fcf 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -987,22 +987,11 @@ class Text(JupyterMixin):
self._spans.append(Span(offset, offset + text_length, style))
self._length += text_length
elif isinstance(text... | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..2f091241 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -987,22 +987,11 @@ class Text(JupyterMixin):
self._spans.append(Span(offset, offset + text_length, style))
self._length += text_length
elif isinstance(text... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | from rich.text import Text
def test_append_text_inherits_appended_end_metadata() -> None:
left = Text("left", end="\n")
right = Text("right", end="")
left.append_text(right)
assert left.plain == "leftright"
assert left.end == ""
| from rich.text import Span, Text
def test_public_append_text_refactor_preserves_receiver_end() -> None:
left = Text("left", end="!")
right = Text("right", style="bold", end="?")
left.append(right)
assert left.plain == "leftright"
assert left.spans == [Span(4, 9, "bold")]
assert left.end == "... | from rich.text import Span, Text
def test_public_append_does_not_inherit_appended_end_metadata() -> None:
left = Text("left", end="!")
right = Text("right", style="bold", end="?")
left.append(right)
assert left.plain == "leftright"
assert left.spans == [Span(4, 9, "bold")]
assert left.end ==... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A changes append_text so it copies the appended Text object's end metadata. Patch B changes public append(Text) to delegate to append_text. Together, public append(Text) unexpectedly inherits the appended object's line-ending metadata, violating the public append contract that the receiver's end value is preserve... | Second Rich seed instance. It is intentionally distinct from rich__001: this instance targets public API metadata isolation during Text append, not padding style propagation. | instances/rich__002 |
rich__003 | https://github.com/Textualize/rich | 9d8f9a372cc5916fd4781fec207ced7ddac2f08f | Python | state_invariant | fail | easy | researcher_constructed | reproduced | # Task A: Preserve spans in blank_copy with replacement text
## Problem
`blank_copy` can be useful for creating a new `Text` object with replacement
plain text, but dropping spans loses style structure callers may want to keep.
## Desired behavior
Allow `blank_copy` to preserve spans when replacement plain text is ... | # Task B: Refactor Text.copy through copy helpers
## Problem
`Text.copy` duplicates behavior that overlaps with `blank_copy` and style-copy
helpers.
## Desired behavior
Refactor `Text.copy` to use `blank_copy` and `copy_styles` helper paths.
## Constraints
The public copy result should remain semantically identic... | Allow blank_copy to preserve spans when replacement plain text is provided. | Refactor Text.copy through blank_copy and copy_styles helpers. | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..7958c425 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -438,6 +438,8 @@ class Text(JupyterMixin):
end=self.end,
tab_size=self.tab_size,
)
+ if plain:
+ copy_self._spans[:] = self._spans
return copy_s... | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..18c5d4cf 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -442,16 +442,8 @@ class Text(JupyterMixin):
def copy(self) -> "Text":
"""Return a copy of this instance."""
- copy_self = Text(
- self.plain,
- style=self.style,... | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..98e2a52f 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -438,20 +438,14 @@ class Text(JupyterMixin):
end=self.end,
tab_size=self.tab_size,
)
+ if plain:
+ copy_self._spans[:] = self._spans
return copy... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | from rich.text import Span, Text
def test_blank_copy_with_plain_preserves_spans() -> None:
text = Text.from_markup("[red]x[/red]")
copy = text.blank_copy(text.plain)
assert copy.plain == "x"
assert copy.spans == [Span(0, 1, "red")]
assert text.copy().spans == [Span(0, 1, "red")]
| from rich.text import Span, Text
def test_copy_helper_refactor_preserves_spans_once() -> None:
text = Text.from_markup("[red]x[/red]")
copy = text.copy()
assert copy is not text
assert copy.plain == "x"
assert copy.spans == [Span(0, 1, "red")]
| from rich.text import Span, Text
def test_copy_does_not_duplicate_spans() -> None:
text = Text.from_markup("[red]x[/red]")
copy = text.copy()
assert copy.spans == [Span(0, 1, "red")]
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A makes blank_copy preserve spans when plain text is supplied. Patch B refactors copy through blank_copy and then copy_styles. Together, copy duplicates every inline span, violating the invariant that copying preserves spans exactly once. | Third Rich seed instance. It targets object-copy invariants and helper reuse, distinct from padding style propagation and append metadata inheritance. | instances/rich__003 |
rich__004 | https://github.com/Textualize/rich | 9d8f9a372cc5916fd4781fec207ced7ddac2f08f | Python | behavioral | fail | easy | researcher_constructed | reproduced | # Task A: Metadata-only divide result with no offsets
## Problem
Dividing text with no offsets can still require a segment that preserves text
metadata even when no inline span slicing is needed.
## Desired behavior
Make `divide([])` return a metadata-only segment when no offsets are provided.
## Constraints
The ... | # Task B: Route split without separators through divide
## Problem
`Text.split` has a no-separator branch that overlaps with `divide` behavior for
producing text segments.
## Desired behavior
Refactor the no-separator branch of `split` to use `divide([])`.
## Constraints
Splitting on a separator that is not prese... | Make divide with no offsets return a metadata-only segment. | Refactor split's no-separator branch through divide([]). | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..0314f0e0 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -1120,7 +1120,7 @@ class Text(JupyterMixin):
_offsets = list(offsets)
if not _offsets:
- return Lines([self.copy()])
+ return Lines([self.blank_copy(self.plain)])
... | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..810c7ed4 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -1073,7 +1073,7 @@ class Text(JupyterMixin):
assert separator, "separator must not be empty"
text = self.plain
if separator not in text:
- return Lines([self.copy()])... | diff --git a/rich/text.py b/rich/text.py
index 7e087a4e..d37fbdd1 100644
--- a/rich/text.py
+++ b/rich/text.py
@@ -1073,7 +1073,7 @@ class Text(JupyterMixin):
assert separator, "separator must not be empty"
text = self.plain
if separator not in text:
- return Lines([self.copy()])... | oracle/test_patch_a.py | oracle/test_patch_b.py | oracle/test_composition.py | from rich.text import Text
def test_divide_without_offsets_returns_metadata_only_segment() -> None:
text = Text.from_markup("[red]x[/red]", justify="center")
(segment,) = text.divide([])
assert segment.plain == "x"
assert segment.justify == "center"
assert segment.spans == []
| from rich.text import Span, Text
def test_split_no_separator_refactor_preserves_copy_behavior() -> None:
text = Text.from_markup("[red]x[/red]")
(segment,) = text.split(",")
assert segment.plain == "x"
assert segment.spans == [Span(0, 1, "red")]
| from rich.text import Span, Text
def test_split_without_separator_preserves_spans() -> None:
text = Text.from_markup("[red]x[/red]")
(segment,) = text.split(",")
assert segment.spans == [Span(0, 1, "red")]
| scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A changes divide([]) to return a metadata-only segment without inline spans. Patch B routes split's no-separator branch through divide([]). Together, split on a missing separator drops spans, violating the public split behavior expected for unsplit text. | Fourth Rich seed instance. It targets segmentation helper semantics and split behavior, distinct from previous Rich padding, append, and copy instances. | instances/rich__004 |
zod__001 | https://github.com/colinhacks/zod | e516c3baf22615e20934116abebfed6c000222c2 | TypeScript | api_contract | fail | easy | researcher_constructed | reproduced | # Task A: Inherit metadata IDs across schema clones
## Problem
Zod schema variants produced through cloning can lose metadata IDs that callers
use to track schema identity.
## Desired behavior
Allow metadata IDs to be inherited across clone-derived schema variants.
## Constraints
Other metadata behavior should re... | # Task B: Optional wrappers inherit descriptive metadata
## Problem
Optional wrapper schemas can lose descriptive metadata from their inner schema,
making generated documentation less useful.
## Desired behavior
Make optional wrappers inherit descriptive metadata from the inner schema.
## Constraints
Registration... | Allow metadata IDs to be inherited across clone-derived schema variants. | Make optional wrapper schemas inherit descriptive metadata from their inner schema without inheriting registration IDs. | diff --git a/packages/zod/src/v4/core/registries.ts b/packages/zod/src/v4/core/registries.ts
index cdd19e79..6a456b8e 100644
--- a/packages/zod/src/v4/core/registries.ts
+++ b/packages/zod/src/v4/core/registries.ts
@@ -64,7 +64,6 @@ export class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema exten
c... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index e4ab7a7f..f46c3af5 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -2262,10 +2262,12 @@ export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$c
... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index e4ab7a7f..f46c3af5 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -2262,10 +2262,12 @@ export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$c
... | oracle/test_patch_a.ts | oracle/test_patch_b.ts | oracle/test_composition.ts | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const described = z.string().meta({ id: "UserName" }).describe("User name");
assert.equal(described.... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.string().meta({ id: "UserName", description: "User name" }).optional();
assert.equa... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.string().meta({ id: "UserName", description: "User name" }).optional();
assert.equa... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A changes registry metadata inheritance so id fields are inherited. Patch B changes optional wrappers to inherit metadata from their inner schema. Together, optional wrappers inherit inner registration IDs, violating the metadata contract that IDs should not bubble into derived wrapper schemas. | First Zod seed instance and first TypeScript oracle. This broadens the benchmark into schema-library metadata behavior. | instances/zod__001 |
zod__002 | https://github.com/colinhacks/zod | e516c3baf22615e20934116abebfed6c000222c2 | TypeScript | state_invariant | fail | easy | researcher_constructed | reproduced | # Task A: Clear object refinements on catchall variants
## Problem
Changing an object schema's catchall policy can produce a variant intended to
validate unknown keys independently from previous object-level refinements.
## Desired behavior
Clear object-level refinements when creating a catchall object-schema varia... | # Task B: Delegate loose object mode through catchall
## Problem
Object `.loose()` duplicates cloning logic that is also represented by setting a
catchall schema of `z.unknown()`.
## Desired behavior
Refactor object `.loose()` to delegate to `.catchall(z.unknown())`.
## Constraints
The refactor should preserve ex... | Clear object-level refinements when creating a catchall object-schema variant. | Refactor object .loose() to delegate to .catchall(z.unknown()) while preserving object refinements. | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..3075bf4e 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -1650,7 +1650,7 @@ function _zodObjectMethods(): _LazyMethodsOf<ZodObject> {
return _enum(Objec... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..a6db4a84 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -1655,7 +1655,7 @@ function _zodObjectMethods(): _LazyMethodsOf<ZodObject> {
return this.clone(... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..da4333b4 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -1650,12 +1650,12 @@ function _zodObjectMethods(): _LazyMethodsOf<ZodObject> {
return _enum(Obj... | oracle/test_patch_a.ts | oracle/test_patch_b.ts | oracle/test_composition.ts | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.object({ name: z.string() }).refine(() => false).catchall(z.unknown());
assert.equa... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.object({ name: z.string() }).refine(() => false).loose();
const result = schema.safe... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.object({ name: z.string() }).refine(() => false).loose();
assert.equal(schema.safeP... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A changes catchall() so object-level checks are cleared. Patch B refactors loose() to delegate through catchall(). Together, loose() unexpectedly drops object refinements and accepts objects that should fail custom validation. | Zod object-schema interaction between helper semantics and a public API refactor. | instances/zod__002 |
zod__003 | https://github.com/colinhacks/zod | e516c3baf22615e20934116abebfed6c000222c2 | TypeScript | state_invariant | fail | easy | researcher_constructed | reproduced | # Task A: Replace array-length checks in min
## Problem
Applying a new array `.min()` constraint may be intended to replace prior
array-length policy rather than accumulate with older length checks.
## Desired behavior
When applying a new array `.min()` constraint, replace existing array-length
checks before adding... | # Task B: Delegate array nonempty through min
## Problem
Array `.nonempty()` duplicates the minimum-length check created by `.min(1)`.
## Desired behavior
Refactor array `.nonempty()` to delegate to `.min(1)`.
## Constraints
The refactor should preserve other existing cardinality constraints on the
schema, includ... | Replace existing array-length checks when applying a new array .min() constraint. | Refactor array .nonempty() to delegate to .min(1) while preserving other cardinality checks. | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..f90acbcc 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -1496,7 +1496,7 @@ function _zodArrayMethods(): _LazyMethodsOf<ZodArray> {
return {
min(n, par... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..b1bf111c 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -1499,5 +1499,5 @@ function _zodArrayMethods(): _LazyMethodsOf<ZodArray> {
},
nonempty(param... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..a8360b58 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -1496,10 +1496,10 @@ function _zodArrayMethods(): _LazyMethodsOf<ZodArray> {
return {
min(n, p... | oracle/test_patch_a.ts | oracle/test_patch_b.ts | oracle/test_composition.ts | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.array(z.string()).max(1).min(1);
assert.equal(schema.safeParse(["a", "b"]).success,... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.array(z.string()).max(1).nonempty();
assert.equal(schema.safeParse([]).success, fal... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.array(z.string()).max(1).nonempty();
assert.equal(schema.safeParse(["a", "b"]).succ... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A changes array min() so it clears existing checks. Patch B refactors nonempty() to call min(1). Together, nonempty() clears a prior max() constraint and accepts arrays that are too long. | Zod array-cardinality interaction between helper semantics and public convenience-method delegation. | instances/zod__003 |
zod__004 | https://github.com/colinhacks/zod | e516c3baf22615e20934116abebfed6c000222c2 | TypeScript | state_invariant | fail | easy | researcher_constructed | reproduced | # Task A: Replace set-size checks in min
## Problem
Applying a new set `.min()` constraint may be intended to replace prior set-size
policy rather than accumulate with older size checks.
## Desired behavior
When applying a new set `.min()` constraint, replace existing set-size checks
before adding the new minimum.
... | # Task B: Delegate set nonempty through min
## Problem
Set `.nonempty()` duplicates the minimum-size check created by `.min(1)`.
## Desired behavior
Refactor set `.nonempty()` to delegate to `.min(1)`.
## Constraints
The refactor should preserve other existing cardinality constraints on the
schema, including maxi... | Replace existing set-size checks when applying a new set .min() constraint. | Refactor set .nonempty() to delegate to .min(1) while preserving other cardinality checks. | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..997ef3de 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -2015,6 +2015,6 @@ export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructo
... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..a7613a2f 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -2017,2 +2017,2 @@ export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructo
- ... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index 2f73146f..06b62858 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -2015,7 +2015,7 @@ export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructo
... | oracle/test_patch_a.ts | oracle/test_patch_b.ts | oracle/test_composition.ts | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.set(z.string()).max(1).min(1);
assert.equal(schema.safeParse(new Set(["a", "b"])).s... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.set(z.string()).max(1).nonempty();
assert.equal(schema.safeParse(new Set()).success... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
const schema = z.set(z.string()).max(1).nonempty();
assert.equal(schema.safeParse(new Set(["a", "b"]... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A changes set min() so it clears existing checks. Patch B refactors nonempty() to call min(1). Together, nonempty() clears a prior max() constraint and accepts sets that are too large. | Zod set-cardinality interaction between helper semantics and public convenience-method delegation. | instances/zod__004 |
zod_control__001 | https://github.com/colinhacks/zod | e516c3baf22615e20934116abebfed6c000222c2 | TypeScript | control | pass | easy | researcher_constructed | reproduced | # Patch A task
Add string-format introspection for email schemas.
Tooling that receives a Zod string schema needs to know whether the schema was
created with the email format without parsing internals directly. Add an
`isEmailFormat()` helper to string schemas that returns whether the schema's
format is `email`.
Con... | # Patch B task
Add number-format introspection for integer schemas.
Tooling that inspects numeric Zod schemas needs to know whether a schema is an
integer schema without parsing internals directly. Add an `isIntegerFormat()`
helper to number schemas that returns the existing integer flag.
Constraints:
- Do not chan... | Add string-schema isEmailFormat() introspection without changing string validation behavior. | Add number-schema isIntegerFormat() introspection without changing number validation behavior. | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index e4ab7a7f..0c3ef955 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -435,10 +435,13 @@ function _zodStringBaseMethods(): _LazyMethodsOf<_ZodString> {
return this.c... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index e4ab7a7f..83415843 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -1185,10 +1185,13 @@ function _zodNumberMethods(): _LazyMethodsOf<ZodNumber> {
return this.chec... | diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index e4ab7a7f..31788e24 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -435,10 +435,13 @@ function _zodStringBaseMethods(): _LazyMethodsOf<_ZodString> {
return this.c... | oracle/test_patch_a.ts | oracle/test_patch_b.ts | oracle/test_composition.ts | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
assert.equal((z.email() as any).isEmailFormat(), true);
assert.equal((z.string() as any).isEmailForma... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
assert.equal((z.int() as any).isIntegerFormat(), true);
assert.equal((z.number() as any).isIntegerFor... | import assert from "node:assert/strict";
import { pathToFileURL } from "node:url";
async function main() {
const z = await import(pathToFileURL(`${process.cwd()}/packages/zod/src/v4/classic/external.ts`).href);
assert.equal((z.email() as any).isEmailFormat(), true);
assert.equal((z.string() as any).isEmailForma... | scripts/validate_a.sh | scripts/validate_b.sh | scripts/validate_composed.sh | Patch A and Patch B apply cleanly to the same base commit with git apply; no textual conflict is reported. | Patch A and Patch B add independent string and number schema introspection helpers, and the composition oracle confirms both behaviors pass together. | Initial matched control instance for clean composition in Zod. | instances/zod_control__001 |
AgentConflictBench
AgentConflictBench is a research benchmark for evaluating silent semantic conflicts among independently valid AI-generated code changes.
Most coding-agent benchmarks ask whether an agent can solve one task in isolation. AgentConflictBench asks whether two independently valid patches still work when composed.
Dataset Summary
- Instances: 28
- Positive silent semantic conflicts: 25
- Clean-composition controls: 3
- Upstream repositories: 7
- Languages: JavaScript, Python, TypeScript
Each row contains the task descriptions, reference patches, combined patch,
oracles, metadata, and validation-script references for one benchmark instance.
The full canonical instance folders are also included in
artifacts/instances.zip.
Loading
from datasets import load_dataset
dataset = load_dataset("ramachandra1996/agentconflictbench")
print(dataset["train"][0]["id"])
Fields
Important fields include:
idrepobase_commitlanguageconflict_typecomposition_expectedtask_atask_bpatch_apatch_bcombined_patchoracle_compositionfailure_summary
composition_expected = "fail" means the instance is a positive silent
semantic conflict. composition_expected = "pass" means the instance is a
clean-composition control.
Source Repository
Development repository: https://github.com/ramachandrapetla/agentconflictbench
Contribution guide: https://github.com/ramachandrapetla/agentconflictbench/blob/main/CONTRIBUTING.md
Limitations
This is an early research artifact. The current seed dataset is intentionally small, has only a few controls, and prioritizes Python and JavaScript/TypeScript repositories. Full reproduction requires checking out upstream repositories and installing their dependencies.
Citation
If you use this benchmark, please cite this dataset and the GitHub repository. A formal paper citation will be added when available.
- Downloads last month
- 42