Skip to content

Commit 463a62c

Browse files
authored
chore(craft-taskgen): add experimental craft-taskgen (#572)
* chore(craft-taskgen): add experimental craft-taskgen Signed-off-by: Greg Clark <grclark@nvidia.com>
1 parent 77af9b6 commit 463a62c

217 files changed

Lines changed: 71585 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

experimental/craft-taskgen/.claude/skills/harbor-f2p-p2p-deep-dive/SKILL.md

Lines changed: 284 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Verifier Validation Questions
2+
3+
Before accepting an **F2P** test failure as a genuine capability gap, apply these questions. Each was learned from a real false negative.
4+
5+
These questions are tuned for F2P (FAIL_TO_PASS) tests — the ones constructed to validate the requested feature, where false negatives are most common. The default verdict for P2P (PASS_TO_PASS) failures is regression (capability gap); apply these questions to a P2P only in the rare-exception cases listed in the parent SKILL.md "Test classes: F2P vs P2P" section.
6+
7+
## 1. Does the instruction specify what the test checks?
8+
9+
Read the assertion. Search the instruction for the corresponding requirement. If the test checks behavior the instruction never mentions (error-handling conventions, exit patterns, output formatting), it's an unstated assumption.
10+
11+
*Example: a test expected `SystemExit` on bad paths but the instruction said nothing about error handling. Fix: extend instruction with "invalid loop paths should log an error and exit the process."*
12+
13+
## 2. Does the instruction's wording match the test scope?
14+
15+
Instructions can accidentally narrow scope below what tests exercise. If the instruction says "X" but tests also require "Y," agents will reasonably implement only X.
16+
17+
*Example: instruction said "generators" but tests used `Iterable`/`AsyncIterable`. Both models implemented only generators.*
18+
19+
## 3. Did multiple models fail the same way?
20+
21+
If a strong model and a weak model both make the same "mistake," it's almost certainly an instruction or verifier issue. Genuine capability gaps produce *different* failure modes across tiers.
22+
23+
**Multi-trial generalization**: in cohorts with N trials × M models, applying this question to the universally-failing set (tests that fail in every complete-listing trial) provides evidence that scales with trial count. The "all models, all trials" pattern is suggestive — not conclusive — of an instruction or verifier issue, and still requires per-test triangulation in SKILL.md step 7 to confirm. Conversely, a test that some model passes on some trial is demonstrably solvable; capability-gap is a live hypothesis for that test regardless of how many trials failed it.
24+
25+
## 4. Would a correct alternative implementation fail?
26+
27+
Imagine a senior engineer who reads only the instruction (not the reference commit). Would their reasonable implementation pass this test? If not, the test is over-constrained for the instruction given.
28+
29+
## 5. Did passing tests pass for the right reason?
30+
31+
Don't only deep-dive failures — audit passes too. For each passing test, check whether the instruction actually guided the agent to the right design choice, or whether the agent made an arbitrary choice that happened to match. The way to check: read the instruction, then read the test's import/fixture assumptions. Is there a direct link (instruction says "put X in module Y," test imports X from Y)? Or is the match coincidental (instruction says "put X somewhere," agent guessed Y, test imports from Y)?
32+
33+
This matters because coincidental passes are fragile — they'll break if you change the instruction wording. If you update an instruction and a previously-passing test starts failing, the most likely cause is that the original pass was lucky, and the updated instruction nudged the agent to a different (equally valid) design choice that doesn't match the test.
34+
35+
### What to do with a coincidental pass
36+
37+
Once you've identified one, pick one of three actions:
38+
39+
1. **Tighten the instruction** — nail down the design choice the test assumes (preferred when the choice is genuinely required for the feature). The pass becomes principled, not lucky.
40+
2. **Loosen the test** — rewrite the assertion against the public contract instead of the implementation detail (preferred when the test is over-specific and the design choice is arbitrary).
41+
3. **Flag and accept** — if neither (1) nor (2) is in scope, mark the task as instruction-fragile in the report. Future re-runs may flip the verdict on this test, and reviewers should know the result is sensitive to instruction wording.
42+
43+
Pick (1) or (2) when you control the task; pick (3) when reporting on a frozen benchmark.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Required for Harbor agent smoke tests
2+
OPENAI_API_KEY=your-api-key-here
3+
OPENAI_API_BASE=base-url
4+
5+
# Anthropic-compatible aliases for Harbor smoke test (claude_code.py reads these)
6+
ANTHROPIC_API_KEY=your-api-key-here
7+
ANTHROPIC_BASE_URL=base-url
8+
9+
# Optional: separate key for LLM-judge steps
10+
JUDGE_API_KEY=
11+
JUDGE_BASE_URL=
12+
JUDGE_MODEL=
13+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*.egg-info/
5+
dist/
6+
build/
7+
8+
# Virtual environment
9+
.venv/
10+
11+
# Environment
12+
.env
13+
14+
# Pipeline output (generated at runtime)
15+
harbor-tasks/*
16+
# Allow the integrity-test toy task fixture (used by scripts/rerun-tainted.sh).
17+
!harbor-tasks/integrity-test
18+
# Allow the openhands smoke fixture (fast iteration for openhands wiring).
19+
!harbor-tasks/openhands-smoke
20+
jobs/
21+
candidates/
22+
repos/
23+
runs/
24+
/baselines/
25+
26+
# Generated shard CSVs (see craft-taskgen-split / scripts/run-pipeline.sh)
27+
references/repo_list_*_half.csv
28+
29+
# Local scratch
30+
tmp.sh
31+
tmp/
32+
notes/
33+
swebench_pro.jsonl
34+
35+
# IDE
36+
.idea/
37+
.vscode/
38+
*.swp
39+
40+
# OS
41+
.DS_Store
42+
43+
# pytest
44+
.pytest_cache/
45+
dashboard.html
46+
repos
47+
48+
# superpowers visual-companion session dirs
49+
.superpowers/
50+
51+
# triage-replay analysis outputs (ephemeral; data is large/external)
52+
triage-analysis/
53+
triage-replay-*.csv
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
stages:
2+
- quality
3+
- deploy
4+
5+
variables:
6+
UV_CACHE_DIR: .uv-cache
7+
PIP_CACHE_DIR: .pip-cache
8+
9+
.quality-base:
10+
stage: quality
11+
image: python:3.12
12+
tags:
13+
- nemollm-common
14+
before_script:
15+
- pip install uv
16+
# Honor uv.lock so CI matches local `uv sync` resolution (per CLAUDE.md
17+
# convention). Previously `uv pip install -e ".[dev]"` resolved fresh each
18+
# run and flaked on 2026-04-23 when a new tree-sitter-language-pack
19+
# resolution broke grep_ast imports in the CI container.
20+
- uv sync
21+
- source .venv/bin/activate
22+
rules:
23+
- if: $CI_MERGE_REQUEST_IID
24+
- if: $CI_COMMIT_BRANCH == "main"
25+
26+
lint:
27+
extends: .quality-base
28+
script:
29+
- ruff check src/ tests/
30+
- ruff format --check src/ tests/
31+
32+
test:
33+
extends: .quality-base
34+
script:
35+
- pytest tests/ -v
36+
37+
# GitLab Pages — publish the static results site at site/.
38+
# The job MUST be named `pages` and publish a `public/` directory; see
39+
# https://docs.gitlab.com/ee/user/project/pages/.
40+
pages:
41+
stage: deploy
42+
image: alpine:3.20
43+
tags:
44+
- nemollm-common
45+
script:
46+
- rm -rf public
47+
- cp -r site public
48+
artifacts:
49+
paths:
50+
- public
51+
rules:
52+
# Deploy from main on every push.
53+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

0 commit comments

Comments
 (0)