Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .cursor/skills/change2task/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: change2task
description: Constructs and validates executable coding-agent tasks from historical repository changes with the Change2Task L1/L2/L3 pipeline. Use when converting a PR or commit into a TaskCase, running healthy/challenge/restored validation, inspecting the public 900-pair corpus, or invoking the change2task CLI.
---

# Change2Task

Use the repository CLI instead of reimplementing task construction.

## Select the workflow

- **Inspect the public corpus:** read `data/v1/manifest.json`, then the relevant
family JSONL file.
- **Validate a case:** run `change2task validate-case CASE.json`.
- **Construct a task:** run `change2task build-case` against a trusted checkout.
- **Generate the schema:** run `change2task case-schema`.

## Construct a task

1. Confirm the target repository is a Git checkout containing the exact
`modern_commit` in the `TaskCase`.
2. Treat the case file as executable input. Review all commands, working
directories, environments, and shell flags.
3. Validate without execution:

```bash
change2task validate-case path/to/case.json
```

4. Run in a disposable sandbox:

```bash
change2task build-case path/to/case.json \
--repository-cache /path/to/repository \
--output .change2task/outcome.json
```

5. Report the accepted construction level or the explicit terminal failure.
Never turn infrastructure errors into task failures.

## Method invariants

- Escalate L1 Patch Reversal → L2 Code Mapping → bounded L3 Agent
Reconstruction.
- Apply the same qualification, scope, fidelity, and repeated H/C/R lifecycle
gates at every level.
- Target checks must pass/fail/pass across healthy/challenge/restored states.
- Protected regression checks must pass in all three states.
- Never expose construction traces or hidden checks to a downstream agent.

## Public corpus

Validate before use:

```bash
python scripts/validate_public_dataset.py data/v1
(cd data/v1 && sha256sum -c CHECKSUMS.sha256)
```

The corpus contains task definitions, not agent-evaluation results. Respect
`artifact_availability`, `sources.json`, and `repository_licenses.json`.

## Safety

- Do not run unreviewed `TaskCase` commands on a developer workstation.
- Do not expose credentials to the worktree or L3 backend.
- Keep raw model I/O capture disabled unless explicitly required.
- Do not publish `.change2task/` runtime artifacts without a separate review.

For the input contract, Python API, output interpretation, and dataset layout,
read [reference.md](reference.md).
60 changes: 60 additions & 0 deletions .cursor/skills/change2task/reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Change2Task Reference

## Install

```bash
python -m pip install \
"git+https://github.com/microsoft/RepoLaunch.git@change2task"
```

## CLI

```bash
change2task --help
change2task case-schema --output schemas/task-case.schema.json
change2task validate-case examples/task_case.synthetic.json
change2task build-case CASE.json \
--repository-cache REPOSITORY \
--output .change2task/outcome.json
```

## Required TaskCase evidence

- historical forward patch and request;
- exact historical and modern revisions;
- modern behavior-host and allowed-path lists;
- at least one target check and one protected regression check;
- source and modern check identities.

`TaskCase` rejects unknown fields. Prefer command argument arrays; use shell
commands only when unavoidable.

## Python API

```python
from pathlib import Path

from change2task.workflow.construction import CaseBuilder
from change2task.workflow.ledger import ConstructionLedger
from change2task.workflow.models import TaskCase

case = TaskCase.model_validate_json(Path("case.json").read_text())
ledger = ConstructionLedger(Path(".change2task/ledger"))
builder = CaseBuilder(
repository_cache=Path("/path/to/repository"),
worktrees_root=Path(".change2task/worktrees"),
ledger=ledger,
)
```

## Public data

- `data/v1/manifest.json`: counts and release properties.
- `data/v1/task_pairs/*.jsonl`: five family partitions.
- `data/v1/schema.json`: strict public record schema.
- `data/v1/sources.json`: benchmark provenance and terms.
- `data/v1/repository_licenses.json`: pinned-base license inventory.
- `data/v1/AUDIT.md`: privacy and integrity review.

`embedded` records contain task artifacts. `reference_only_license_restriction`
records contain provenance and hashes but intentionally omit copied content.
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# L3 is reached only when deterministic L1 and L2 do not qualify.
CHANGE2TASK_L3_MODEL=claude-opus-4.8
CHANGE2TASK_L3_EXECUTABLE=claude
CHANGE2TASK_L3_PERMISSION_MODE=acceptEdits
CHANGE2TASK_L3_TIMEOUT_SECONDS=1800
CHANGE2TASK_L3_MAX_ATTEMPTS=4

# Optional custom endpoint. Credentials remain in the caller's environment or
# the configured agent CLI; never write them into this file.
# CHANGE2TASK_L3_PROVIDER_BASE_URL=https://example.invalid/api/anthropic

CHANGE2TASK_LIFECYCLE_REPEAT_COUNT=2
CHANGE2TASK_RUN_ROOT=.change2task
CHANGE2TASK_KEEP_WORKTREE=false

# Raw prompts and command output can contain source code or secrets.
CHANGE2TASK_CAPTURE_AGENT_IO=false
CHANGE2TASK_CAPTURE_COMMAND_OUTPUT=false
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 30

- package-ecosystem: "github-actions"
directory: "/"
groups:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Change2Task CI

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Method release checks
runs-on: ubuntu-24.04
timeout-minutes: 15

steps:
- name: Check out repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml

- name: Install Change2Task
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

- name: Run tests
run: python -m pytest -q

- name: Run lint
run: python -m ruff check .

- name: Validate release example and schema
run: |
change2task validate-case examples/task_case.synthetic.json
change2task case-schema --output schemas/task-case.schema.json
git diff --exit-code -- schemas/task-case.schema.json

- name: Validate public task corpus
run: |
python scripts/validate_public_dataset.py data/v1
cd data/v1
sha256sum -c CHECKSUMS.sha256

- name: Validate agent skill
run: |
bash -n scripts/install.sh scripts/install_skill.sh
bash scripts/install_skill.sh \
--source .cursor/skills/change2task \
--destination "$RUNNER_TEMP/change2task-skill"
test -f "$RUNNER_TEMP/change2task-skill/SKILL.md"
101 changes: 0 additions & 101 deletions .github/workflows/publish-pypi.yml

This file was deleted.

Loading
Loading