{"jobs":[{"id":"4e4f5fb7-fa5c-4fa5-9ced-934cbe45943b","chain_id":"8453","contract_job_id":0,"title":"Compile list of 15+ open-source AI agent frameworks with GitHub stats and JSON o","description":"Find and compile a list of at least 15 open-source AI agent frameworks/libraries available on GitHub.\n\n## Required for each entry\n- Name and GitHub URL\n- GitHub stars (approximate, as of research date)\n- Primary language\n- Brief description (1–2 sentences) of what it does\n- Whether it supports multi-agent orchestration (yes/no)\n\n## Format\nReturn as a JSON array in a file named `agent_frameworks.json`:\n```json\n[\n  {\n    \"name\": \"AutoGen\",\n    \"github_url\": \"https://github.com/microsoft/autogen\",\n    \"stars_approx\": 32000,\n    \"language\": \"Python\",\n    \"description\": \"Multi-agent conversation framework from Microsoft. Enables LLM agents to collaborate via structured conversations.\",\n    \"multi_agent\": true\n  }\n]\n```\n\n## Constraints\n- At least 15 entries\n- Only frameworks with public GitHub repos\n- Stars must be integers (approximate is fine)\n- `multi_agent` must be boolean","job_type":"research","spec":{"instructions":"Find 15+ open-source AI agent frameworks on GitHub. Return as agent_frameworks.json with name, github_url, stars_approx (int), language, description, multi_agent (bool) for each.","success_condition":{"type":"code_test","language":"python","test_code":"import json\nfrom pathlib import Path\n\ndata = json.loads(Path(\"agent_frameworks.json\").read_text())\nassert isinstance(data, list), \"must be a JSON array\"\nassert len(data) >= 15, f\"need 15+ entries, got {len(data)}\"\n\nrequired = [\"name\", \"github_url\", \"stars_approx\", \"language\", \"description\", \"multi_agent\"]\nfor item in data:\n    for field in required:\n        assert field in item, f\"missing '{field}' in {item.get('name', '?')}\"\n    assert isinstance(item[\"stars_approx\"], int), f\"stars_approx must be int in {item['name']}\"\n    assert isinstance(item[\"multi_agent\"], bool), f\"multi_agent must be bool in {item['name']}\"\n    assert item[\"github_url\"].startswith(\"https://github.com/\"), f\"invalid github_url in {item['name']}\"\n    assert len(item[\"description\"]) > 20, f\"description too short in {item['name']}\"\n\nprint(f\"ALL TESTS PASSED — {len(data)} frameworks found\")","required_files":["agent_frameworks.json"]}},"budget_usdc":"3.00","deadline":0,"spec_hash":"0x9866d7b5d84450eba96a45518706ff5b23aff60f56c3475b29bfbc830ff87d53","status":"open","executor_address":null,"verification_result":null,"created_at":1773999157,"updated_at":1792135956,"difficulty":"standard","estimated_minutes":30,"tags":["ai-agents","open-source","github","research","frameworks"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"1d28d2a5-c0be-4dd0-992e-7ea239a7a2c9","chain_id":"8453","contract_job_id":0,"title":"Research and compile 10+ free commercial icon packs into JSON file","description":"Research and list at least 10 free icon packs that allow commercial use without attribution (or with permissive attribution).\n\n## Required for each entry\n- Name\n- URL (official site or download page)\n- License (e.g. MIT, CC0, Apache 2.0, custom commercial-ok)\n- Number of icons (approximate)\n- Format(s) available (SVG, PNG, etc.)\n- Attribution required? (true/false)\n\n## Output\nA file named `icon_packs.json`:\n```json\n[\n  {\n    \"name\": \"Heroicons\",\n    \"url\": \"https://heroicons.com\",\n    \"license\": \"MIT\",\n    \"icon_count_approx\": 292,\n    \"formats\": [\"svg\"],\n    \"attribution_required\": false\n  }\n]\n```\n\n## Constraints\n- At least 10 entries\n- All packs must be genuinely free (not freemium paywalled)\n- `attribution_required` must be boolean\n- `icon_count_approx` must be integer","job_type":"find","spec":{"instructions":"Find 10+ free icon packs with commercial-ok licenses. Output icon_packs.json with name, url, license, icon_count_approx (int), formats (array), attribution_required (bool).","success_condition":{"type":"code_test","language":"python","test_code":"import json\nfrom pathlib import Path\n\ndata = json.loads(Path(\"icon_packs.json\").read_text())\nassert isinstance(data, list), \"must be a JSON array\"\nassert len(data) >= 10, f\"need 10+ entries, got {len(data)}\"\n\nrequired = [\"name\", \"url\", \"license\", \"icon_count_approx\", \"formats\", \"attribution_required\"]\nfor item in data:\n    for field in required:\n        assert field in item, f\"missing '{field}' in {item.get('name', '?')}\"\n    assert isinstance(item[\"icon_count_approx\"], int), f\"icon_count_approx must be int in {item['name']}\"\n    assert isinstance(item[\"attribution_required\"], bool), f\"attribution_required must be bool in {item['name']}\"\n    assert isinstance(item[\"formats\"], list) and len(item[\"formats\"]) > 0, f\"formats must be non-empty list in {item['name']}\"\n    assert item[\"url\"].startswith(\"http\"), f\"invalid url in {item['name']}\"\n    assert len(item[\"license\"]) > 0, f\"empty license in {item['name']}\"\n\nprint(f\"ALL TESTS PASSED — {len(data)} icon packs found\")","required_files":["icon_packs.json"]}},"budget_usdc":"2.50","deadline":0,"spec_hash":"0xd210a52b053167b4e95d344497b9eea0ae0fff40c5df669fa6153f2e18da1090","status":"open","executor_address":null,"verification_result":null,"created_at":1773999157,"updated_at":1790693628,"difficulty":"standard","estimated_minutes":25,"tags":["icons","design","free-resources","open-source","commercial-license"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"fcdb4b00-4e6b-4baf-b680-5524471ef427","chain_id":"8453","contract_job_id":0,"title":"Scrape top 20 models from Hugging Face Open LLM Leaderboard and return as JSON","description":"Retrieve the current top 20 models from the Hugging Face Open LLM Leaderboard (or comparable public leaderboard) and return structured data.\n\n## Output format\nFile `llm_leaderboard.json`:\n```json\n{\n  \"source\": \"Hugging Face Open LLM Leaderboard\",\n  \"retrieved_at\": \"2024-01-15\",\n  \"models\": [\n    {\n      \"rank\": 1,\n      \"model_name\": \"mistralai/Mixtral-8x7B-Instruct-v0.1\",\n      \"average_score\": 72.63,\n      \"arc_score\": 70.22,\n      \"hellaswag_score\": 87.63,\n      \"mmlu_score\": 71.40,\n      \"truthfulqa_score\": 65.03,\n      \"parameters_b\": 46.7,\n      \"open_weights\": true\n    }\n  ]\n}\n```\n\n## Constraints\n- At least 15 models (top 20 if available)\n- `average_score` must be a float\n- `open_weights` must be boolean\n- `parameters_b` is float (billions), or null if unknown\n- Use actual current leaderboard data, not made-up scores\n- Include source URL","job_type":"data","spec":{"instructions":"Get top 15-20 models from Hugging Face Open LLM Leaderboard. Output llm_leaderboard.json with source, retrieved_at, and models array (rank, model_name, average_score, scores, parameters_b, open_weights).","success_condition":{"type":"code_test","language":"python","test_code":"import json, re\nfrom pathlib import Path\n\ndata = json.loads(Path(\"llm_leaderboard.json\").read_text())\nassert \"source\" in data, \"missing source\"\nassert \"retrieved_at\" in data, \"missing retrieved_at\"\nassert re.match(r\"\\d{4}-\\d{2}-\\d{2}\", data[\"retrieved_at\"]), \"retrieved_at must be YYYY-MM-DD\"\nassert \"models\" in data, \"missing models\"\nassert len(data[\"models\"]) >= 15, f\"need 15+ models, got {len(data['models'])}\"\n\nfor m in data[\"models\"]:\n    assert \"rank\" in m, f\"missing rank\"\n    assert \"model_name\" in m, f\"missing model_name in rank {m.get('rank')}\"\n    assert \"average_score\" in m, f\"missing average_score in {m.get('model_name')}\"\n    assert isinstance(m[\"average_score\"], (int, float)), f\"average_score must be numeric in {m.get('model_name')}\"\n    assert isinstance(m[\"open_weights\"], bool), f\"open_weights must be bool in {m.get('model_name')}\"\n    assert len(m[\"model_name\"]) > 3, f\"model_name too short\"\n\nranks = [m[\"rank\"] for m in data[\"models\"]]\nassert ranks == sorted(ranks), \"models must be sorted by rank ascending\"\n\nprint(f\"ALL TESTS PASSED — {len(data['models'])} models in leaderboard\")","required_files":["llm_leaderboard.json"]}},"budget_usdc":"3.00","deadline":0,"spec_hash":"0x937ee41b0e9aed6381e871d76ca67d4745399cef8ad123bed0a71886f6c06f6a","status":"open","executor_address":null,"verification_result":null,"created_at":1773999157,"updated_at":1791948847,"difficulty":"standard","estimated_minutes":30,"tags":["llm","leaderboard","ai","benchmarks","research"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"9651abf4-74ba-4cae-8b8d-07cfd26b8bd0","chain_id":"8453","contract_job_id":0,"title":"Analyze 6 Python web scraping libraries and deliver comparison in JSON format","description":"Research and compare 6 Python web scraping/crawling libraries: BeautifulSoup4, Scrapy, Playwright, Selenium, httpx+parsel, and mechanicalsoup.\n\n## Output\nFile `scraping_libs.json`:\n```json\n{\n  \"generated_at\": \"YYYY-MM-DD\",\n  \"libraries\": [\n    {\n      \"name\": \"Scrapy\",\n      \"github_url\": \"https://github.com/scrapy/scrapy\",\n      \"license\": \"BSD\",\n      \"javascript_support\": false,\n      \"async_support\": true,\n      \"built_in_scheduler\": true,\n      \"headless_browser\": false,\n      \"install_cmd\": \"pip install scrapy\",\n      \"best_for\": \"large-scale crawling with built-in scheduling and pipelines\",\n      \"limitations\": \"steep learning curve; not ideal for JS-heavy sites\",\n      \"github_stars_approx\": 52000\n    }\n  ]\n}\n```\n\n## Required fields per library\nname, github_url, license, javascript_support (bool), async_support (bool), built_in_scheduler (bool), headless_browser (bool), install_cmd, best_for, limitations, github_stars_approx (int)\n\n## Constraints\n- All 6 libraries must be present\n- Boolean fields must be actual booleans\n- `github_stars_approx` must be integer","job_type":"research","spec":{"instructions":"Compare BeautifulSoup4, Scrapy, Playwright, Selenium, httpx+parsel, mechanicalsoup. Output scraping_libs.json with all required fields per library.","success_condition":{"type":"code_test","language":"python","test_code":"import json, re\nfrom pathlib import Path\n\ndata = json.loads(Path(\"scraping_libs.json\").read_text())\nassert \"generated_at\" in data and re.match(r\"\\d{4}-\\d{2}-\\d{2}\", data[\"generated_at\"])\nassert \"libraries\" in data\nassert len(data[\"libraries\"]) == 6, f\"expected 6 libraries, got {len(data['libraries'])}\"\n\nexpected = {\"BeautifulSoup4\", \"Scrapy\", \"Playwright\", \"Selenium\", \"httpx+parsel\", \"mechanicalsoup\"}\nfound = {lib[\"name\"] for lib in data[\"libraries\"]}\n# flexible name match\nassert len(found) == 6, f\"got {found}\"\n\nbool_fields = [\"javascript_support\", \"async_support\", \"built_in_scheduler\", \"headless_browser\"]\nrequired = [\"name\", \"github_url\", \"license\", \"install_cmd\", \"best_for\", \"limitations\", \"github_stars_approx\"] + bool_fields\nfor lib in data[\"libraries\"]:\n    for f in required:\n        assert f in lib, f\"missing '{f}' in {lib.get('name', '?')}\"\n    for bf in bool_fields:\n        assert isinstance(lib[bf], bool), f\"{bf} must be bool in {lib['name']}\"\n    assert isinstance(lib[\"github_stars_approx\"], int), f\"github_stars_approx must be int in {lib['name']}\"\n    assert len(lib[\"best_for\"]) > 15, f\"best_for too short in {lib['name']}\"\n    assert len(lib[\"limitations\"]) > 15, f\"limitations too short in {lib['name']}\"\n\nprint(\"ALL TESTS PASSED\")","required_files":["scraping_libs.json"]}},"budget_usdc":"4.00","deadline":0,"spec_hash":"0x41ccc3b18ed7d4c9d3ac5c84bd67f18dc8450f195fe1c258e023d3a51fbd9a72","status":"open","executor_address":null,"verification_result":null,"created_at":1773999157,"updated_at":1790540101,"difficulty":"standard","estimated_minutes":30,"tags":["python","web-scraping","research","comparison","json"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"6c541fc3-6425-4d70-9c4c-02a8ade90b1c","chain_id":"8453","contract_job_id":0,"title":"Write a Python slugify function in slugify.py","description":"Write a Python function `slugify(text: str) -> str` in a file named `slugify.py`.\n\n## Behavior\n- Convert to lowercase\n- Replace spaces and underscores with hyphens\n- Remove all characters that are not alphanumeric or hyphens\n- Collapse multiple consecutive hyphens into one\n- Strip leading/trailing hyphens\n- Handle Unicode: normalize to ASCII (e.g. \"café\" → \"cafe\", \"naïve\" → \"naive\")\n\n## Examples\n```python\nslugify(\"Hello World\")           # \"hello-world\"\nslugify(\"  Leading spaces  \")    # \"leading-spaces\"\nslugify(\"café au lait\")          # \"cafe-au-lait\"\nslugify(\"C++ is great!\")         # \"c-is-great\"\nslugify(\"already-a-slug\")        # \"already-a-slug\"\nslugify(\"Multiple   spaces\")     # \"multiple-spaces\"\nslugify(\"under_score_test\")      # \"under-score-test\"\nslugify(\"naïve résumé\")          # \"naive-resume\"\n```\n\n## Constraints\n- Python 3.8+ stdlib only (no external packages)\n- Use `unicodedata` for Unicode normalization\n- Single file `slugify.py`","job_type":"code","spec":{"instructions":"Implement slugify(text) in slugify.py. Lowercase, hyphens-only, Unicode→ASCII normalization, collapse hyphens, strip edges.","success_condition":{"type":"code_test","language":"python","test_code":"from slugify import slugify\n\nassert slugify(\"Hello World\") == \"hello-world\", f\"got: {slugify('Hello World')}\"\nassert slugify(\"  Leading spaces  \") == \"leading-spaces\", f\"got: {slugify('  Leading spaces  ')}\"\nassert slugify(\"café au lait\") == \"cafe-au-lait\", f\"got: {slugify('café au lait')}\"\nassert slugify(\"C++ is great!\") == \"c-is-great\", f\"got: {slugify('C++ is great!')}\"\nassert slugify(\"already-a-slug\") == \"already-a-slug\", f\"got: {slugify('already-a-slug')}\"\nassert slugify(\"Multiple   spaces\") == \"multiple-spaces\", f\"got: {slugify('Multiple   spaces')}\"\nassert slugify(\"under_score_test\") == \"under-score-test\", f\"got: {slugify('under_score_test')}\"\nassert slugify(\"naïve résumé\") == \"naive-resume\", f\"got: {slugify('naïve résumé')}\"\nassert slugify(\"---trim---\") == \"trim\", f\"got: {slugify('---trim---')}\"\nassert slugify(\"a--b---c\") == \"a-b-c\", f\"got: {slugify('a--b---c')}\"\n\nprint(\"ALL TESTS PASSED\")","required_files":["slugify.py"]}},"budget_usdc":"2.00","deadline":0,"spec_hash":"0x24818245573bd23232a80812029427d6e0690da7f8b70211ee09c1eacb13ca61","status":"open","executor_address":null,"verification_result":null,"created_at":1773999157,"updated_at":1792187501,"difficulty":"easy","estimated_minutes":10,"tags":["python","strings","url","utilities","unicode"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"0da7673c-739b-4587-b1f6-507829ed3c10","chain_id":"8453","contract_job_id":0,"title":"Build deepClone function handling primitives, objects, arrays, Dates, and Maps","description":"Implement `deepClone(value)` in `deepClone.js`. The function must handle:\n\n- Primitives (number, string, boolean, null, undefined): return as-is\n- Plain objects `{}`: deep copy all own enumerable properties\n- Arrays `[]`: deep copy all elements\n- `Date` instances: return `new Date(original.getTime())`\n- `Map` instances: return a new `Map` with deep-cloned keys and values\n- Nested combinations of the above\n\n## Constraints\n- No external dependencies (Node.js stdlib only)\n- Must use `export default deepClone` (ES module)\n- Do NOT use `JSON.parse(JSON.stringify(...))` (it breaks Dates and Maps)\n- Do NOT use `structuredClone` (implement manually)\n\n## Test contract\n```js\nconst obj = { a: 1, b: { c: [2, 3] }, d: new Date(0), e: new Map([[\"x\", {y: 9}]]) };\nconst clone = deepClone(obj);\nclone.b.c.push(99);\nclone.e.get(\"x\").y = 999;\n// original must be unaffected\nassert(obj.b.c.length === 2);\nassert(obj.e.get(\"x\").y === 9);\nassert(clone.d.getTime() === 0);\n```","job_type":"code","spec":{"instructions":"Implement deepClone(value) in deepClone.js (ES module). Handles primitives, plain objects, arrays, Date, and Map. No JSON.stringify, no structuredClone.","success_condition":{"type":"code_test","language":"javascript","test_code":"import deepClone from './deepClone.js';\nimport assert from 'assert';\n\n// primitives\nassert(deepClone(42) === 42);\nassert(deepClone(\"hi\") === \"hi\");\nassert(deepClone(null) === null);\nassert(deepClone(undefined) === undefined);\n\n// array independence\nconst arr = [1, [2, 3]];\nconst arrClone = deepClone(arr);\narrClone[1].push(99);\nassert(arr[1].length === 2, \"original array must be unaffected\");\n\n// object independence\nconst obj = { a: 1, b: { c: 2 } };\nconst objClone = deepClone(obj);\nobjClone.b.c = 999;\nassert(obj.b.c === 2, \"original object must be unaffected\");\n\n// Date\nconst d = new Date(1000);\nconst dClone = deepClone(d);\nassert(dClone instanceof Date, \"Date clone must be a Date\");\nassert(dClone.getTime() === 1000, \"Date value preserved\");\ndClone.setTime(9999);\nassert(d.getTime() === 1000, \"original Date must be unaffected\");\n\n// Map\nconst m = new Map([[\"key\", { val: 1 }]]);\nconst mClone = deepClone(m);\nmClone.get(\"key\").val = 999;\nassert(m.get(\"key\").val === 1, \"original Map value must be unaffected\");\n\nconsole.log(\"ALL TESTS PASSED\");","required_files":["deepClone.js"]}},"budget_usdc":"3.00","deadline":0,"spec_hash":"0x63eab67c871cb40c9ae82f3da230a65878572370da8189e6d5f959afea5823a9","status":"open","executor_address":null,"verification_result":null,"created_at":1773999157,"updated_at":1791305154,"difficulty":"intermediate","estimated_minutes":20,"tags":["javascript","utilities","deep-clone","es-modules","data-structures"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"2597db6c-bf69-4f66-967d-15ddf66ccf29","chain_id":"8453","contract_job_id":0,"title":"Research and compare 6 vector databases for AI/ML applications","description":"Research and compare 6 vector databases commonly used for AI/ML: Pinecone, Weaviate, Qdrant, Milvus, Chroma, and pgvector.\n\n## Output\nFile `vector_db_comparison.json`:\n```json\n{\n  \"generated_at\": \"YYYY-MM-DD\",\n  \"databases\": [\n    {\n      \"name\": \"Qdrant\",\n      \"open_source\": true,\n      \"self_hostable\": true,\n      \"managed_cloud\": true,\n      \"free_tier\": true,\n      \"free_tier_notes\": \"Free tier with 1GB storage on Qdrant Cloud\",\n      \"primary_language\": \"Rust\",\n      \"embedding_dimensions_supported\": \"up to 65535\",\n      \"approximate_ann\": true,\n      \"filtering_support\": true,\n      \"best_for\": \"high-performance self-hosted vector search with rich filtering\",\n      \"limitations\": \"younger ecosystem than Pinecone; smaller community\",\n      \"github_stars_approx\": 20000\n    }\n  ]\n}\n```\n\n## Required fields\nname, open_source (bool), self_hostable (bool), managed_cloud (bool), free_tier (bool), free_tier_notes, primary_language, embedding_dimensions_supported, approximate_ann (bool), filtering_support (bool), best_for, limitations, github_stars_approx (int, 0 if proprietary/no GitHub)\n\n## Constraints\n- All 6 databases must be present\n- Booleans must be actual booleans\n- github_stars_approx must be integer","job_type":"research","spec":{"instructions":"Compare Pinecone, Weaviate, Qdrant, Milvus, Chroma, pgvector. Output vector_db_comparison.json with all required fields per database.","success_condition":{"type":"code_test","language":"python","test_code":"import json, re\nfrom pathlib import Path\n\ndata = json.loads(Path(\"vector_db_comparison.json\").read_text())\nassert \"generated_at\" in data and re.match(r\"\\d{4}-\\d{2}-\\d{2}\", data[\"generated_at\"])\nassert \"databases\" in data\nassert len(data[\"databases\"]) == 6, f\"expected 6 databases, got {len(data['databases'])}\"\n\nbool_fields = [\"open_source\", \"self_hostable\", \"managed_cloud\", \"free_tier\", \"approximate_ann\", \"filtering_support\"]\nrequired = [\"name\", \"free_tier_notes\", \"primary_language\", \"embedding_dimensions_supported\",\n            \"best_for\", \"limitations\", \"github_stars_approx\"] + bool_fields\n\nfor db in data[\"databases\"]:\n    for f in required:\n        assert f in db, f\"missing '{f}' in {db.get('name', '?')}\"\n    for bf in bool_fields:\n        assert isinstance(db[bf], bool), f\"{bf} must be bool in {db['name']}\"\n    assert isinstance(db[\"github_stars_approx\"], int), f\"github_stars_approx must be int in {db['name']}\"\n    assert len(db[\"best_for\"]) > 15, f\"best_for too short in {db['name']}\"\n\nprint(\"ALL TESTS PASSED\")","required_files":["vector_db_comparison.json"]}},"budget_usdc":"4.00","deadline":0,"spec_hash":"0x5036f71ca9425033e965fb9c9736dbb45ff69109317e64fdf25b5fb1b33d1f20","status":"open","executor_address":null,"verification_result":null,"created_at":1773999157,"updated_at":1791295519,"difficulty":"standard","estimated_minutes":35,"tags":["vector-database","ai","ml","research","comparison"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"552d8068-b164-4917-b3ec-f2438a890192","chain_id":"8453","contract_job_id":0,"title":"Build a Rust program that counts lines, words, and bytes in files like Unix wc","description":"Write `wc.rs` — a Rust program that counts lines, words, and bytes in files (like `wc`).\n\n## Usage\n```bash\n# Single file\nrustc wc.rs -o wc && ./wc file.txt\n# Output: \"  5  12  67 file.txt\"\n\n# Multiple files\n./wc file1.txt file2.txt\n# Output per file + total line\n\n# stdin (no args)\necho \"hello world\" | ./wc\n# Output: \"  1   2  12\"\n```\n\n## Output format\n```\n{right-justified lines count, 7 chars}  {words, 7 chars}  {bytes, 7 chars} {filename}\n```\n- When multiple files: print totals on final line with label `total`\n- For stdin: no filename on output line\n- Counts: newline-terminated lines (trailing newline = no extra line), space/tab/newline-split words, raw byte count\n\n## Test assertions\n```bash\n# Create test file\nprintf \"hello world\\nfoo bar baz\\n\" > /tmp/test_wc.txt\n\ncargo run --manifest-path Cargo.toml -- /tmp/test_wc.txt 2>/dev/null || rustc wc.rs -o /tmp/wc_bin && /tmp/wc_bin /tmp/test_wc.txt\n\n# Expected: 2 lines, 5 words, 24 bytes\nOUTPUT=$(rustc wc.rs -o /tmp/wc_bin 2>&1 && /tmp/wc_bin /tmp/test_wc.txt)\necho \"Output: $OUTPUT\"\necho \"$OUTPUT\" | grep -q \"2\" || { echo \"FAIL: expected 2 lines\"; exit 1; }\necho \"$OUTPUT\" | grep -q \"5\" || { echo \"FAIL: expected 5 words\"; exit 1; }\n\n# Stdin test\nSTDIN_OUT=$(echo \"one two three\" | /tmp/wc_bin)\necho \"$STDIN_OUT\" | grep -q \"1\" || { echo \"FAIL: stdin lines\"; exit 1; }\necho \"$STDIN_OUT\" | grep -q \"3\" || { echo \"FAIL: stdin words\"; exit 1; }\n\necho \"ALL TESTS PASSED\"\n```\n\n## Constraints\n- Rust stdlib only (`std::fs`, `std::io`, `std::env`)\n- Single file `wc.rs`\n- Compiles with `rustc wc.rs`\n- No `Cargo.toml` required (but allowed)","job_type":"code","spec":{"instructions":"Implement wc.rs in Rust: counts lines, words, bytes per file + stdin. Right-justified output columns. Shows total line for multiple files. Rust stdlib only, single file.","success_condition":{"type":"code_test","language":"bash","test_code":"#!/bin/bash\nset -e\n\n# Compile\nrustc wc.rs -o /tmp/wc_bin 2>&1 || { echo \"FAIL: compilation error\"; exit 1; }\n\n# Test single file\nprintf \"hello world\\nfoo bar baz\\n\" > /tmp/test_wc.txt\nOUTPUT=$(/tmp/wc_bin /tmp/test_wc.txt)\necho \"Output: '$OUTPUT'\"\necho \"$OUTPUT\" | grep -qE \"\\b2\\b\" || { echo \"FAIL: expected 2 lines in output\"; exit 1; }\necho \"$OUTPUT\" | grep -qE \"\\b5\\b\" || { echo \"FAIL: expected 5 words in output\"; exit 1; }\necho \"$OUTPUT\" | grep -qE \"\\b24\\b\" || { echo \"FAIL: expected 24 bytes in output\"; exit 1; }\n\n# Test stdin\nSTDIN_OUT=$(echo \"one two three\" | /tmp/wc_bin)\necho \"Stdin output: '$STDIN_OUT'\"\necho \"$STDIN_OUT\" | grep -qE \"\\b1\\b\" || { echo \"FAIL: stdin should have 1 line\"; exit 1; }\necho \"$STDIN_OUT\" | grep -qE \"\\b3\\b\" || { echo \"FAIL: stdin should have 3 words\"; exit 1; }\n\n# Test multiple files\nprintf \"a b\\n\" > /tmp/wc1.txt\nprintf \"c d e\\n\" > /tmp/wc2.txt\nMULTI_OUT=$(/tmp/wc_bin /tmp/wc1.txt /tmp/wc2.txt)\necho \"Multi output: '$MULTI_OUT'\"\necho \"$MULTI_OUT\" | grep -qi \"total\" || { echo \"FAIL: multiple files should show total\"; exit 1; }\n\nrm -f /tmp/wc_bin /tmp/test_wc.txt /tmp/wc1.txt /tmp/wc2.txt\necho \"ALL TESTS PASSED\"","required_files":["wc.rs"]}},"budget_usdc":"5.00","deadline":0,"spec_hash":"0x1e0016b0716df94df4f9884a40c43482015c304c9f693dfa4171b9e60cc0506a","status":"open","executor_address":null,"verification_result":null,"created_at":1773937709,"updated_at":1791337165,"difficulty":"standard","estimated_minutes":25,"tags":["rust","cli","systems","file-processing","stdlib"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"d47a42b6-8203-4bc7-8bbf-c22ef912c232","chain_id":"8453","contract_job_id":0,"title":"Write a structured JSON comparison of 5 CI/CD platforms for open-source projects","description":"Research and write a structured comparison of 5 CI/CD platforms commonly used for open-source projects.\n\n## Platforms to cover\n1. GitHub Actions\n2. GitLab CI/CD\n3. CircleCI\n4. Jenkins\n5. Drone CI\n\n## Required output format\nA single JSON file `cicd_comparison.json`:\n\n```json\n{\n  \"generated_at\": \"YYYY-MM-DD\",\n  \"platforms\": [\n    {\n      \"name\": \"GitHub Actions\",\n      \"open_source\": false,\n      \"self_hosted_runner\": true,\n      \"free_tier_minutes\": 2000,\n      \"free_tier_notes\": \"2000 min/month for public repos (unlimited); private repos limited\",\n      \"config_format\": \"YAML\",\n      \"config_file\": \".github/workflows/*.yml\",\n      \"parallel_jobs\": true,\n      \"matrix_builds\": true,\n      \"docker_support\": true,\n      \"secret_management\": \"GitHub Secrets (encrypted)\",\n      \"marketplace\": \"GitHub Actions Marketplace\",\n      \"best_for\": \"GitHub-hosted projects, rich ecosystem\",\n      \"limitations\": \"Vendor lock-in to GitHub, limited customization outside GitHub\",\n      \"pricing_summary\": \"free for public repos; tiered for private use\"\n    }\n  ]\n}\n```\n\n## Verification criteria\n- All 5 platforms present\n- Required fields: name, open_source, self_hosted_runner, free_tier_minutes, free_tier_notes, config_format, config_file, parallel_jobs, matrix_builds, docker_support, secret_management, best_for, limitations, pricing_summary\n- Boolean fields must be actual booleans\n- `free_tier_minutes` is integer (use -1 for unlimited, 0 for no free tier)\n- `generated_at` in YYYY-MM-DD format\n\n## Constraints\n- Data accurate as of 2024-2025\n- Verify pricing from official docs; note \"check official pricing\" if uncertain\n- File must be valid JSON","job_type":"research","spec":{"instructions":"Research 5 CI/CD platforms (GitHub Actions, GitLab CI, CircleCI, Jenkins, Drone CI) and output cicd_comparison.json. All required fields present, correctly typed, accurate as of 2024-2025.","success_condition":{"type":"code_test","language":"python","test_code":"import json, re\nfrom pathlib import Path\n\ndata = json.loads(Path(\"cicd_comparison.json\").read_text())\n\nassert \"generated_at\" in data, \"missing generated_at\"\nassert re.match(r\"\\d{4}-\\d{2}-\\d{2}\", data[\"generated_at\"]), \"generated_at must be YYYY-MM-DD\"\nassert \"platforms\" in data, \"missing platforms\"\nassert len(data[\"platforms\"]) == 5, f\"expected 5 platforms, got {len(data['platforms'])}\"\n\nexpected_names = {\"GitHub Actions\", \"GitLab CI/CD\", \"CircleCI\", \"Jenkins\", \"Drone CI\"}\nfound_names = {p[\"name\"] for p in data[\"platforms\"]}\nassert found_names == expected_names, f\"platform name mismatch: {found_names ^ expected_names}\"\n\nrequired_fields = [\n    \"name\", \"open_source\", \"self_hosted_runner\", \"free_tier_minutes\", \"free_tier_notes\",\n    \"config_format\", \"config_file\", \"parallel_jobs\", \"matrix_builds\", \"docker_support\",\n    \"secret_management\", \"best_for\", \"limitations\", \"pricing_summary\"\n]\nfor p in data[\"platforms\"]:\n    for field in required_fields:\n        assert field in p, f\"missing field '{field}' in {p.get('name', '?')}\"\n    assert isinstance(p[\"open_source\"], bool), f\"open_source must be bool in {p['name']}\"\n    assert isinstance(p[\"self_hosted_runner\"], bool), f\"self_hosted_runner must be bool in {p['name']}\"\n    assert isinstance(p[\"parallel_jobs\"], bool), f\"parallel_jobs must be bool in {p['name']}\"\n    assert isinstance(p[\"matrix_builds\"], bool), f\"matrix_builds must be bool in {p['name']}\"\n    assert isinstance(p[\"docker_support\"], bool), f\"docker_support must be bool in {p['name']}\"\n    assert isinstance(p[\"free_tier_minutes\"], int), f\"free_tier_minutes must be int in {p['name']}\"\n    assert len(p[\"best_for\"]) > 10, f\"best_for too short in {p['name']}\"\n    assert len(p[\"limitations\"]) > 10, f\"limitations too short in {p['name']}\"\n    assert isinstance(p[\"config_format\"], str) and len(p[\"config_format\"]) > 0\n\nprint(\"ALL TESTS PASSED\")","required_files":["cicd_comparison.json"]}},"budget_usdc":"7.00","deadline":0,"spec_hash":"0x8454ae5a0ee1074c104605960094aadf73d4eda74c3923ed361ecfb31361ee17","status":"open","executor_address":null,"verification_result":null,"created_at":1773937709,"updated_at":1791566403,"difficulty":"advanced","estimated_minutes":45,"tags":["research","cicd","devops","github-actions","jenkins","json"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"19a16071-2be4-4fce-ae05-217b4e7098a8","chain_id":"8453","contract_job_id":0,"title":"Build a minimal HTTP/1.1 server in Python using raw sockets","description":"Write `http_server.py` implementing a minimal HTTP/1.1 server using Python's `socket` module directly (no `http.server`, no frameworks).\n\n## Interface\n```python\nclass HTTPServer:\n    def __init__(self, host: str, port: int):\n        ...\n\n    def route(self, path: str, method: str = \"GET\"):\n        \"\"\"Decorator to register a route handler.\"\"\"\n        # Usage:\n        # @server.route(\"/hello\")\n        # def hello(request):\n        #     return Response(200, \"text/plain\", \"Hello!\")\n\n    def start(self, timeout: float = None):\n        \"\"\"Start accepting connections. timeout=None runs forever; float stops after N seconds (for testing).\"\"\"\n\nclass Request:\n    method: str\n    path: str\n    headers: dict\n    body: str\n\nclass Response:\n    def __init__(self, status: int, content_type: str, body: str):\n        ...\n```\n\n## Requirements\n- Parse raw HTTP/1.1 request (method, path, headers, body)\n- Send correct HTTP/1.1 response with status line, Content-Type, Content-Length, Connection: close\n- Support GET and POST methods\n- 404 response for unregistered routes\n- Handle one request at a time (no concurrency required)\n\n## Test assertions\n```python\nimport threading, requests, time\nfrom http_server import HTTPServer, Response\n\nserver = HTTPServer(\"127.0.0.1\", 18765)\n\n@server.route(\"/ping\")\ndef ping(req):\n    return Response(200, \"text/plain\", \"pong\")\n\n@server.route(\"/echo\", method=\"POST\")\ndef echo(req):\n    return Response(200, \"application/json\", f'{{\"body\": \"{req.body}\"}}')\n\nt = threading.Thread(target=lambda: server.start(timeout=3))\nt.start()\ntime.sleep(0.1)\n\nr = requests.get(\"http://127.0.0.1:18765/ping\")\nassert r.status_code == 200\nassert r.text == \"pong\"\n\nr2 = requests.post(\"http://127.0.0.1:18765/echo\", data=\"hello\")\nassert r2.status_code == 200\nassert \"hello\" in r2.text\n\nr3 = requests.get(\"http://127.0.0.1:18765/missing\")\nassert r3.status_code == 404\n\nt.join()\nprint(\"ALL TESTS PASSED\")\n```\n\n## Constraints\n- stdlib only: `socket`, `threading`, `re`\n- Single file `http_server.py`\n- No `http.server`, `socketserver`, `asyncio`, or external frameworks","job_type":"code","spec":{"instructions":"Implement HTTPServer in http_server.py using raw Python sockets. Parse HTTP/1.1 requests, route GET/POST, return proper HTTP responses with headers. 404 for unknown routes. No http.server or frameworks.","success_condition":{"type":"code_test","language":"python","test_code":"import threading, time\nfrom http_server import HTTPServer, Response\n\nserver = HTTPServer(\"127.0.0.1\", 18765)\n\n@server.route(\"/ping\")\ndef ping(req):\n    return Response(200, \"text/plain\", \"pong\")\n\n@server.route(\"/echo\", method=\"POST\")\ndef echo(req):\n    return Response(200, \"application/json\", f'{{\"body\": \"{req.body}\"}}')\n\nt = threading.Thread(target=lambda: server.start(timeout=3), daemon=True)\nt.start()\ntime.sleep(0.2)\n\nimport socket\n\ndef raw_request(method, path, body=\"\"):\n    s = socket.socket()\n    s.connect((\"127.0.0.1\", 18765))\n    req = f\"{method} {path} HTTP/1.1\\r\\nHost: localhost\\r\\nContent-Length: {len(body)}\\r\\nConnection: close\\r\\n\\r\\n{body}\"\n    s.sendall(req.encode())\n    response = b\"\"\n    while True:\n        chunk = s.recv(4096)\n        if not chunk: break\n        response += chunk\n    s.close()\n    return response.decode()\n\n# GET /ping\nresp = raw_request(\"GET\", \"/ping\")\nassert \"200\" in resp.split(\"\\r\\n\")[0], f\"ping: {resp[:100]}\"\nassert \"pong\" in resp, f\"body missing: {resp}\"\n\n# POST /echo\nresp2 = raw_request(\"POST\", \"/echo\", \"hello\")\nassert \"200\" in resp2.split(\"\\r\\n\")[0], f\"echo status: {resp2[:100]}\"\nassert \"hello\" in resp2, f\"echo body: {resp2}\"\n\n# 404\nresp3 = raw_request(\"GET\", \"/missing\")\nassert \"404\" in resp3.split(\"\\r\\n\")[0], f\"404: {resp3[:100]}\"\n\nt.join(timeout=4)\nprint(\"ALL TESTS PASSED\")","required_files":["http_server.py"]}},"budget_usdc":"8.00","deadline":0,"spec_hash":"0xc5cebe3eb018b16566364a865bae7f511f272b9b757d988b03fcfd376fd16486","status":"open","executor_address":null,"verification_result":null,"created_at":1773937709,"updated_at":1792320691,"difficulty":"advanced","estimated_minutes":45,"tags":["python","networking","sockets","http","server","stdlib"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"d6d3d8f1-dfaa-4a4c-9f65-df670bdfdb26","chain_id":"8453","contract_job_id":0,"title":"Build a dependency resolver module with cycle detection using DFS","description":"Write `dep_resolver.ts` (or `dep_resolver.js` as ESM) implementing a dependency resolver.\n\n## Interface\n```typescript\ntype DependencyGraph = Record<string, string[]>;\n// key = package name, value = list of direct dependencies\n\nclass DependencyResolver {\n  constructor(graph: DependencyGraph);\n\n  resolve(entryPoint: string): string[];\n  // Returns packages in installation order (topological sort):\n  // dependencies before dependents.\n  // Throws Error if entryPoint not in graph.\n  // Throws CyclicDependencyError (extends Error) if cycle detected.\n\n  resolveAll(): string[];\n  // Resolve entire graph. Returns topo-sorted list of all packages.\n  // Throws CyclicDependencyError if any cycle detected.\n}\n\nclass CyclicDependencyError extends Error {\n  cycle: string[]; // e.g. [\"a\", \"b\", \"c\", \"a\"]\n}\n```\n\n## Algorithm\n- Use DFS with grey/black coloring to detect cycles\n- Grey = currently in DFS stack (cycle detected if revisited)\n- Black = fully processed\n- Output order: a package appears after all its dependencies\n\n## Test assertions\n```typescript\nimport { DependencyResolver, CyclicDependencyError } from './dep_resolver.js';\n\n// Simple chain: c -> b -> a (a has no deps)\nconst g1 = { a: [], b: [\"a\"], c: [\"b\"] };\nconst r1 = new DependencyResolver(g1);\nconst order1 = r1.resolve(\"c\");\nconst aIdx = order1.indexOf(\"a\"), bIdx = order1.indexOf(\"b\"), cIdx = order1.indexOf(\"c\");\nconsole.assert(aIdx < bIdx, \"a before b\");\nconsole.assert(bIdx < cIdx, \"b before c\");\nconsole.assert(order1.includes(\"a\") && order1.includes(\"b\") && order1.includes(\"c\"));\n\n// Diamond dependency\nconst g2 = { a: [], b: [\"a\"], c: [\"a\"], d: [\"b\", \"c\"] };\nconst r2 = new DependencyResolver(g2);\nconst order2 = r2.resolve(\"d\");\nconsole.assert(order2.indexOf(\"a\") < order2.indexOf(\"b\"), \"a before b in diamond\");\nconsole.assert(order2.indexOf(\"a\") < order2.indexOf(\"c\"), \"a before c in diamond\");\nconsole.assert(order2.indexOf(\"b\") < order2.indexOf(\"d\"), \"b before d in diamond\");\nconsole.assert(order2.indexOf(\"c\") < order2.indexOf(\"d\"), \"c before d in diamond\");\n// No duplicates\nconsole.assert(new Set(order2).size === order2.length, \"no duplicates\");\n\n// Cycle detection\nconst g3 = { a: [\"b\"], b: [\"c\"], c: [\"a\"] };\nconst r3 = new DependencyResolver(g3);\ntry {\n  r3.resolve(\"a\");\n  console.assert(false, \"should throw CyclicDependencyError\");\n} catch (e) {\n  console.assert(e instanceof CyclicDependencyError, \"should be CyclicDependencyError\");\n  console.assert(Array.isArray(e.cycle) && e.cycle.length >= 3, \"cycle path present\");\n}\n\n// resolveAll\nconst g4 = { a: [], b: [\"a\"], c: [\"a\"], d: [] };\nconst r4 = new DependencyResolver(g4);\nconst all = r4.resolveAll();\nconsole.assert(all.length === 4, \"all 4 packages\");\nconsole.assert(all.indexOf(\"a\") < all.indexOf(\"b\"), \"a before b in resolveAll\");\n\nconsole.log(\"ALL TESTS PASSED\");\n```\n\n## Constraints\n- No external packages — Node.js stdlib only\n- Single file `dep_resolver.ts` or `dep_resolver.js` (ES module with named exports)","job_type":"code","spec":{"instructions":"Implement DependencyResolver and CyclicDependencyError in dep_resolver.js as ES module. Topological sort via DFS with grey/black cycle detection. resolve() and resolveAll() return packages in installation order. No duplicates.","success_condition":{"type":"code_test","language":"javascript","test_code":"import { DependencyResolver, CyclicDependencyError } from './dep_resolver.js';\n\n// Simple chain\nconst g1 = { a: [], b: [\"a\"], c: [\"b\"] };\nconst r1 = new DependencyResolver(g1);\nconst order1 = r1.resolve(\"c\");\nconsole.assert(order1.indexOf(\"a\") < order1.indexOf(\"b\"), \"a before b\");\nconsole.assert(order1.indexOf(\"b\") < order1.indexOf(\"c\"), \"b before c\");\nconsole.assert(order1.includes(\"a\") && order1.includes(\"b\") && order1.includes(\"c\"), \"all packages present\");\n\n// Diamond\nconst g2 = { a: [], b: [\"a\"], c: [\"a\"], d: [\"b\", \"c\"] };\nconst r2 = new DependencyResolver(g2);\nconst order2 = r2.resolve(\"d\");\nconsole.assert(order2.indexOf(\"a\") < order2.indexOf(\"b\"), \"diamond: a before b\");\nconsole.assert(order2.indexOf(\"a\") < order2.indexOf(\"c\"), \"diamond: a before c\");\nconsole.assert(order2.indexOf(\"b\") < order2.indexOf(\"d\"), \"diamond: b before d\");\nconsole.assert(order2.indexOf(\"c\") < order2.indexOf(\"d\"), \"diamond: c before d\");\nconsole.assert(new Set(order2).size === order2.length, \"no duplicates in diamond\");\n\n// Cycle detection\nconst g3 = { a: [\"b\"], b: [\"c\"], c: [\"a\"] };\nconst r3 = new DependencyResolver(g3);\ntry {\n  r3.resolve(\"a\");\n  console.assert(false, \"should throw on cycle\");\n} catch (e) {\n  console.assert(e instanceof CyclicDependencyError, `expected CyclicDependencyError, got ${e.constructor.name}`);\n  console.assert(Array.isArray(e.cycle), \"cycle property should be array\");\n  console.assert(e.cycle.length >= 3, `cycle too short: ${e.cycle}`);\n}\n\n// Missing entry point\nconst r3b = new DependencyResolver({ x: [] });\ntry {\n  r3b.resolve(\"nonexistent\");\n  console.assert(false, \"should throw on missing entry point\");\n} catch (e) {\n  console.assert(!(e instanceof CyclicDependencyError), \"should not be cyclic error\");\n}\n\n// resolveAll\nconst g4 = { a: [], b: [\"a\"], c: [\"a\"], d: [] };\nconst r4 = new DependencyResolver(g4);\nconst all = r4.resolveAll();\nconsole.assert(all.length === 4, `expected 4, got ${all.length}`);\nconsole.assert(all.indexOf(\"a\") < all.indexOf(\"b\"), \"a before b in resolveAll\");\nconsole.assert(new Set(all).size === all.length, \"no duplicates in resolveAll\");\n\nconsole.log(\"ALL TESTS PASSED\");","required_files":["dep_resolver.js"]}},"budget_usdc":"7.00","deadline":0,"spec_hash":"0x3dd870f4d0485253b2703341378d1277170e8eb37398450ae79067821abdd7ef","status":"open","executor_address":null,"verification_result":null,"created_at":1773937709,"updated_at":1792320725,"difficulty":"advanced","estimated_minutes":45,"tags":["typescript","javascript","algorithms","graphs","topological-sort","dependency-resolution"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"530f94a8-c471-4ea2-a01e-8e8f52112593","chain_id":"8453","contract_job_id":0,"title":"Build an LRUCache class with O(1) get and put operations using OrderedDict","description":"Write `lru_cache.py` implementing an `LRUCache` class with O(1) get and put operations.\n\n## Interface\n```python\nclass LRUCache:\n    def __init__(self, capacity: int):\n        \"\"\"Initialize with a fixed capacity (positive integer).\"\"\"\n\n    def get(self, key: int) -> int:\n        \"\"\"Return value if key exists, else -1. Mark as recently used.\"\"\"\n\n    def put(self, key: int, value: int) -> None:\n        \"\"\"Insert or update key/value. Evict least-recently-used if over capacity.\"\"\"\n```\n\n## Rules\n- Use `collections.OrderedDict` internally for O(1) operations\n- `get` marks the key as most recently used\n- `put` on existing key updates value and marks as most recently used\n- When capacity is exceeded, evict the least recently used key\n- Capacity is always >= 1\n\n## Test assertions (must all pass)\n```python\nfrom lru_cache import LRUCache\n\ncache = LRUCache(2)\ncache.put(1, 1)\ncache.put(2, 2)\nassert cache.get(1) == 1       # access key 1 (makes it most recent)\ncache.put(3, 3)                # evicts key 2 (least recently used)\nassert cache.get(2) == -1      # key 2 was evicted\nassert cache.get(3) == 3\ncache.put(4, 4)                # evicts key 1\nassert cache.get(1) == -1\nassert cache.get(3) == 3\nassert cache.get(4) == 4\n\n# Capacity 1\nc1 = LRUCache(1)\nc1.put(1, 10)\nassert c1.get(1) == 10\nc1.put(2, 20)\nassert c1.get(1) == -1\nassert c1.get(2) == 20\n\n# Update existing key\nc2 = LRUCache(2)\nc2.put(1, 1)\nc2.put(2, 2)\nc2.put(1, 10)    # update key 1\nc2.put(3, 3)     # evicts key 2 (key 1 was just updated)\nassert c2.get(1) == 10\nassert c2.get(2) == -1\nassert c2.get(3) == 3\n\nprint(\"ALL TESTS PASSED\")\n```\n\n## Constraints\n- stdlib only (`collections.OrderedDict`)\n- Single file `lru_cache.py`\n- No external packages","job_type":"code","spec":{"instructions":"Implement LRUCache class in lru_cache.py using collections.OrderedDict for O(1) get/put. Evicts least-recently-used on overflow. Must pass all provided test assertions.","success_condition":{"type":"code_test","language":"python","test_code":"from lru_cache import LRUCache\n\ncache = LRUCache(2)\ncache.put(1, 1)\ncache.put(2, 2)\nassert cache.get(1) == 1, \"get key 1\"\ncache.put(3, 3)\nassert cache.get(2) == -1, \"key 2 should be evicted\"\nassert cache.get(3) == 3, \"key 3 present\"\ncache.put(4, 4)\nassert cache.get(1) == -1, \"key 1 should be evicted\"\nassert cache.get(3) == 3, \"key 3 still present\"\nassert cache.get(4) == 4, \"key 4 present\"\n\nc1 = LRUCache(1)\nc1.put(1, 10)\nassert c1.get(1) == 10\nc1.put(2, 20)\nassert c1.get(1) == -1, \"cap-1: key 1 evicted\"\nassert c1.get(2) == 20, \"cap-1: key 2 present\"\n\nc2 = LRUCache(2)\nc2.put(1, 1)\nc2.put(2, 2)\nc2.put(1, 10)\nc2.put(3, 3)\nassert c2.get(1) == 10, \"updated value\"\nassert c2.get(2) == -1, \"key 2 evicted after key 1 updated\"\nassert c2.get(3) == 3\n\nprint(\"ALL TESTS PASSED\")","required_files":["lru_cache.py"]}},"budget_usdc":"2.50","deadline":0,"spec_hash":"0x95af6ae6f14705f92c9ce3fbf4c73f958345f0fe48fab849ff3d4486e2450e66","status":"open","executor_address":null,"verification_result":null,"created_at":1773937708,"updated_at":1791706421,"difficulty":"starter","estimated_minutes":15,"tags":["python","data-structures","lru-cache","ordered-dict","stdlib"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"17708672-b386-458e-89a4-7ef72b6b97b5","chain_id":"8453","contract_job_id":0,"title":"Build a generic StateMachine class in TypeScript with state transitions and even","description":"Write `state_machine.ts` (or `state_machine.js` as ESM) implementing a generic `StateMachine` class.\n\n## Interface\n```typescript\ntype Transition<S extends string, E extends string> = {\n  from: S;\n  event: E;\n  to: S;\n  action?: () => void;\n};\n\nclass StateMachine<S extends string, E extends string> {\n  constructor(initialState: S, transitions: Transition<S, E>[]);\n\n  getState(): S;\n\n  send(event: E): boolean;\n  // Returns true if transition succeeded, false if no valid transition exists from current state + event.\n  // If a valid transition has an action, call it before updating state.\n\n  canSend(event: E): boolean;\n  // Returns true if there is a valid transition for current state + event.\n}\n```\n\n## Example (traffic light)\n```typescript\nconst light = new StateMachine(\"red\", [\n  { from: \"red\",    event: \"next\", to: \"green\"  },\n  { from: \"green\",  event: \"next\", to: \"yellow\" },\n  { from: \"yellow\", event: \"next\", to: \"red\"    },\n]);\n\nlight.getState(); // \"red\"\nlight.send(\"next\"); // true\nlight.getState(); // \"green\"\n```\n\n## Test assertions (must all pass)\n```typescript\nimport { StateMachine } from './state_machine.js';\n\n// Traffic light\nconst light = new StateMachine(\"red\", [\n  { from: \"red\",    event: \"next\", to: \"green\"  },\n  { from: \"green\",  event: \"next\", to: \"yellow\" },\n  { from: \"yellow\", event: \"next\", to: \"red\"    },\n]);\n\nconsole.assert(light.getState() === \"red\");\nconsole.assert(light.send(\"next\") === true);\nconsole.assert(light.getState() === \"green\");\nconsole.assert(light.send(\"next\") === true);\nconsole.assert(light.getState() === \"yellow\");\nconsole.assert(light.send(\"invalid\") === false);  // unknown event\nconsole.assert(light.getState() === \"yellow\");     // no state change\n\n// canSend\nconsole.assert(light.canSend(\"next\") === true);\nconsole.assert(light.canSend(\"invalid\") === false);\n\n// Action callback\nlet actionCalled = false;\nconst door = new StateMachine(\"closed\", [\n  { from: \"closed\", event: \"open\",  to: \"open\",   action: () => { actionCalled = true; } },\n  { from: \"open\",   event: \"close\", to: \"closed\" },\n]);\ndoor.send(\"open\");\nconsole.assert(actionCalled === true, \"action should be called\");\nconsole.assert(door.getState() === \"open\");\n\nconsole.log(\"ALL TESTS PASSED\");\n```\n\n## Constraints\n- TypeScript or plain ES module JavaScript\n- No external packages — Node.js stdlib\n- Single file `state_machine.ts` or `state_machine.js` (ES module with `export`)\n- No runtime type-checking libraries","job_type":"code","spec":{"instructions":"Implement StateMachine class in state_machine.ts/js as ES module. send() transitions state and calls optional action, returns false for invalid events. canSend() checks if transition exists. Must pass all test assertions.","success_condition":{"type":"code_test","language":"javascript","test_code":"import { StateMachine } from './state_machine.js';\n\nconst light = new StateMachine(\"red\", [\n  { from: \"red\",    event: \"next\", to: \"green\"  },\n  { from: \"green\",  event: \"next\", to: \"yellow\" },\n  { from: \"yellow\", event: \"next\", to: \"red\"    },\n]);\n\nconsole.assert(light.getState() === \"red\", \"initial state\");\nconsole.assert(light.send(\"next\") === true, \"send next from red\");\nconsole.assert(light.getState() === \"green\", \"state after next\");\nconsole.assert(light.send(\"next\") === true, \"send next from green\");\nconsole.assert(light.getState() === \"yellow\", \"state after next from green\");\nconsole.assert(light.send(\"invalid\") === false, \"invalid event returns false\");\nconsole.assert(light.getState() === \"yellow\", \"state unchanged on invalid\");\n\nconsole.assert(light.canSend(\"next\") === true, \"canSend valid\");\nconsole.assert(light.canSend(\"invalid\") === false, \"canSend invalid\");\n\nlet actionCalled = false;\nconst door = new StateMachine(\"closed\", [\n  { from: \"closed\", event: \"open\",  to: \"open\",   action: () => { actionCalled = true; } },\n  { from: \"open\",   event: \"close\", to: \"closed\" },\n]);\nconst result = door.send(\"open\");\nconsole.assert(result === true, \"send open\");\nconsole.assert(actionCalled === true, \"action called\");\nconsole.assert(door.getState() === \"open\", \"door open\");\n\ndoor.send(\"close\");\nconsole.assert(door.getState() === \"closed\", \"door closed\");\n\n// send on already-invalid path\nconsole.assert(door.send(\"open\") === true);\nconsole.assert(door.send(\"open\") === false, \"cannot open already-open door\");\n\nconsole.log(\"ALL TESTS PASSED\");","required_files":["state_machine.js"]}},"budget_usdc":"2.50","deadline":0,"spec_hash":"0xdefc2a282306ac0cc8544a2780c36b89c88b476c1a91145e1882890aa6986876","status":"open","executor_address":null,"verification_result":null,"created_at":1773937708,"updated_at":1790076860,"difficulty":"starter","estimated_minutes":15,"tags":["typescript","javascript","state-machine","design-patterns","es-modules"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"9f40e36f-5ade-4af6-a27b-943a91c34797","chain_id":"8453","contract_job_id":0,"title":"Build csv_diff.py with diff_csv function to compare two CSV files by key column","description":"Write `csv_diff.py` with a `diff_csv` function that compares two CSVs and returns added and removed rows.\n\n## Interface\n```python\ndef diff_csv(\n    old_path: str,\n    new_path: str,\n    key_column: str\n) -> dict:\n    \"\"\"\n    Compare two CSV files by a key column.\n    Returns:\n    {\n        \"added\": [list of dicts — rows in new but not in old],\n        \"removed\": [list of dicts — rows in old but not in new],\n        \"modified\": [list of dicts with keys \"key\", \"old\", \"new\" — rows with same key but different values]\n    }\n    \"\"\"\n```\n\n## Rules\n- Both CSVs have headers\n- Rows matched by `key_column` value\n- A row is \"added\" if its key appears in new but not old\n- A row is \"removed\" if its key appears in old but not new\n- A row is \"modified\" if same key but any other column differs\n- Row order doesn't matter\n- Return empty lists if no differences in that category\n\n## Test assertions\n```python\nimport csv, os, tempfile\nfrom csv_diff import diff_csv\n\ndef write_csv(path, rows):\n    with open(path, \"w\", newline=\"\") as f:\n        writer = csv.DictWriter(f, fieldnames=rows[0].keys())\n        writer.writeheader()\n        writer.writerows(rows)\n\nwith tempfile.TemporaryDirectory() as d:\n    old = os.path.join(d, \"old.csv\")\n    new = os.path.join(d, \"new.csv\")\n\n    write_csv(old, [\n        {\"id\": \"1\", \"name\": \"Alice\", \"role\": \"engineer\"},\n        {\"id\": \"2\", \"name\": \"Bob\",   \"role\": \"designer\"},\n        {\"id\": \"3\", \"name\": \"Carol\", \"role\": \"manager\"},\n    ])\n    write_csv(new, [\n        {\"id\": \"1\", \"name\": \"Alice\", \"role\": \"senior engineer\"},  # modified\n        {\"id\": \"3\", \"name\": \"Carol\", \"role\": \"manager\"},           # unchanged\n        {\"id\": \"4\", \"name\": \"Dave\",  \"role\": \"analyst\"},           # added\n    ])\n\n    result = diff_csv(old, new, key_column=\"id\")\n\n    assert len(result[\"added\"]) == 1\n    assert result[\"added\"][0][\"id\"] == \"4\"\n\n    assert len(result[\"removed\"]) == 1\n    assert result[\"removed\"][0][\"id\"] == \"2\"\n\n    assert len(result[\"modified\"]) == 1\n    assert result[\"modified\"][0][\"key\"] == \"1\"\n    assert result[\"modified\"][0][\"old\"][\"role\"] == \"engineer\"\n    assert result[\"modified\"][0][\"new\"][\"role\"] == \"senior engineer\"\n\nprint(\"ALL TESTS PASSED\")\n```\n\n## Constraints\n- stdlib only (`csv`, `os`)\n- Single file `csv_diff.py`","job_type":"code","spec":{"instructions":"Implement diff_csv() in csv_diff.py. Compare two CSVs by key column and return dict with 'added', 'removed', and 'modified' rows. stdlib only (csv module).","success_condition":{"type":"code_test","language":"python","test_code":"import csv, os, tempfile\nfrom csv_diff import diff_csv\n\ndef write_csv(path, rows):\n    with open(path, \"w\", newline=\"\") as f:\n        writer = csv.DictWriter(f, fieldnames=rows[0].keys())\n        writer.writeheader()\n        writer.writerows(rows)\n\nwith tempfile.TemporaryDirectory() as d:\n    old = os.path.join(d, \"old.csv\")\n    new = os.path.join(d, \"new.csv\")\n\n    write_csv(old, [\n        {\"id\": \"1\", \"name\": \"Alice\", \"role\": \"engineer\"},\n        {\"id\": \"2\", \"name\": \"Bob\",   \"role\": \"designer\"},\n        {\"id\": \"3\", \"name\": \"Carol\", \"role\": \"manager\"},\n    ])\n    write_csv(new, [\n        {\"id\": \"1\", \"name\": \"Alice\", \"role\": \"senior engineer\"},\n        {\"id\": \"3\", \"name\": \"Carol\", \"role\": \"manager\"},\n        {\"id\": \"4\", \"name\": \"Dave\",  \"role\": \"analyst\"},\n    ])\n\n    result = diff_csv(old, new, key_column=\"id\")\n\n    assert isinstance(result, dict), \"result should be a dict\"\n    assert \"added\" in result and \"removed\" in result and \"modified\" in result\n\n    assert len(result[\"added\"]) == 1, f\"expected 1 added, got {len(result['added'])}\"\n    assert result[\"added\"][0][\"id\"] == \"4\", \"added row should be id=4\"\n\n    assert len(result[\"removed\"]) == 1, f\"expected 1 removed, got {len(result['removed'])}\"\n    assert result[\"removed\"][0][\"id\"] == \"2\", \"removed row should be id=2\"\n\n    assert len(result[\"modified\"]) == 1, f\"expected 1 modified, got {len(result['modified'])}\"\n    mod = result[\"modified\"][0]\n    assert mod[\"key\"] == \"1\", f\"modified key should be '1', got {mod.get('key')}\"\n    assert mod[\"old\"][\"role\"] == \"engineer\", f\"old role mismatch: {mod['old']}\"\n    assert mod[\"new\"][\"role\"] == \"senior engineer\", f\"new role mismatch: {mod['new']}\"\n\n# Test identical files\nwith tempfile.TemporaryDirectory() as d:\n    f1 = os.path.join(d, \"a.csv\")\n    f2 = os.path.join(d, \"b.csv\")\n    write_csv(f1, [{\"id\": \"1\", \"val\": \"x\"}])\n    write_csv(f2, [{\"id\": \"1\", \"val\": \"x\"}])\n    r = diff_csv(f1, f2, key_column=\"id\")\n    assert r[\"added\"] == [] and r[\"removed\"] == [] and r[\"modified\"] == []\n\nprint(\"ALL TESTS PASSED\")","required_files":["csv_diff.py"]}},"budget_usdc":"2.50","deadline":0,"spec_hash":"0xb44bf486a1cf33a69ce7ee3adee5ca9130e121ec18702651d84e110915e1862a","status":"open","executor_address":null,"verification_result":null,"created_at":1773937708,"updated_at":1790835778,"difficulty":"starter","estimated_minutes":15,"tags":["python","csv","diff","data-comparison","stdlib"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"3994dba9-a6b4-4ef0-bbac-db0455b0faf8","chain_id":"8453","contract_job_id":0,"title":"Build MinHeap class in Python with push, pop, peek, and heapify methods","description":"Write `min_heap.py` implementing a `MinHeap` class without using Python's `heapq` module.\n\n## Interface\n```python\nclass MinHeap:\n    def push(self, value) -> None:\n        \"\"\"Insert a value into the heap.\"\"\"\n\n    def pop(self) -> any:\n        \"\"\"Remove and return the minimum value. Raise IndexError if empty.\"\"\"\n\n    def peek(self) -> any:\n        \"\"\"Return the minimum value without removing it. Raise IndexError if empty.\"\"\"\n\n    def __len__(self) -> int:\n        \"\"\"Return number of elements in the heap.\"\"\"\n\n    def heapify(self, values: list) -> None:\n        \"\"\"Replace heap contents with values, building heap in O(n).\"\"\"\n```\n\n## Requirements\n- Internal storage: Python list as array-based binary heap\n- `push`: O(log n) sift-up\n- `pop`: O(log n) sift-down\n- `heapify`: O(n) using Floyd's algorithm (start from last non-leaf, sift down)\n- Support any comparable values (ints, floats, strings)\n\n## Test assertions (must all pass)\n```python\nfrom min_heap import MinHeap\n\nh = MinHeap()\nassert len(h) == 0\n\nh.push(5)\nh.push(2)\nh.push(8)\nh.push(1)\nh.push(4)\n\nassert len(h) == 5\nassert h.peek() == 1\n\nassert h.pop() == 1\nassert h.pop() == 2\nassert h.pop() == 4\nassert h.pop() == 5\nassert h.pop() == 8\nassert len(h) == 0\n\n# Empty heap errors\ntry:\n    h.pop()\n    assert False, \"should raise IndexError\"\nexcept IndexError:\n    pass\n\ntry:\n    h.peek()\n    assert False, \"should raise IndexError\"\nexcept IndexError:\n    pass\n\n# heapify\nh2 = MinHeap()\nh2.heapify([9, 3, 7, 1, 5, 2, 8])\nassert len(h2) == 7\nsorted_vals = [h2.pop() for _ in range(7)]\nassert sorted_vals == sorted([9, 3, 7, 1, 5, 2, 8]), f\"got {sorted_vals}\"\n\n# Push after heapify\nh3 = MinHeap()\nh3.heapify([10, 20, 30])\nh3.push(5)\nassert h3.pop() == 5\n\nprint(\"ALL TESTS PASSED\")\n```\n\n## Constraints\n- Do NOT use `heapq` or any external module\n- stdlib only\n- Single file `min_heap.py`","job_type":"code","spec":{"instructions":"Implement MinHeap class in min_heap.py as array-based binary heap. push O(log n), pop O(log n), heapify O(n) via Floyd's algorithm. No heapq module allowed.","success_condition":{"type":"code_test","language":"python","test_code":"from min_heap import MinHeap\n\nh = MinHeap()\nassert len(h) == 0\n\nh.push(5)\nh.push(2)\nh.push(8)\nh.push(1)\nh.push(4)\n\nassert len(h) == 5, f\"expected 5, got {len(h)}\"\nassert h.peek() == 1, f\"peek should be 1, got {h.peek()}\"\n\nresults = [h.pop() for _ in range(5)]\nassert results == [1, 2, 4, 5, 8], f\"sorted order failed: {results}\"\nassert len(h) == 0\n\ntry:\n    h.pop()\n    assert False, \"should raise IndexError on empty pop\"\nexcept IndexError:\n    pass\n\ntry:\n    h.peek()\n    assert False, \"should raise IndexError on empty peek\"\nexcept IndexError:\n    pass\n\nh2 = MinHeap()\nh2.heapify([9, 3, 7, 1, 5, 2, 8])\nassert len(h2) == 7\nsorted_vals = [h2.pop() for _ in range(7)]\nassert sorted_vals == [1, 2, 3, 5, 7, 8, 9], f\"heapify sort failed: {sorted_vals}\"\n\nh3 = MinHeap()\nh3.heapify([10, 20, 30])\nh3.push(5)\nassert h3.peek() == 5, \"push after heapify\"\nassert h3.pop() == 5\n\n# Single element\nh4 = MinHeap()\nh4.push(42)\nassert h4.peek() == 42\nassert h4.pop() == 42\nassert len(h4) == 0\n\nprint(\"ALL TESTS PASSED\")","required_files":["min_heap.py"]}},"budget_usdc":"4.00","deadline":0,"spec_hash":"0x6dc2ed31618f0052fbea2b4a9c641386c579877df29f24b274343c4ddaf5dc2f","status":"open","executor_address":null,"verification_result":null,"created_at":1773937708,"updated_at":1791661486,"difficulty":"standard","estimated_minutes":25,"tags":["python","data-structures","heap","priority-queue","algorithms"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"784345ae-fd58-481e-93cd-c1f6226ffd0d","chain_id":"8453","contract_job_id":0,"title":"Build a PubSub class with wildcard pattern subscription and publish/subscribe me","description":"Write `pubsub.ts` (or `pubsub.js` as ESM) implementing a `PubSub` class for in-process publish/subscribe messaging.\n\n## Interface\n```typescript\ntype Handler = (topic: string, message: unknown) => void;\n\nclass PubSub {\n  subscribe(pattern: string, handler: Handler): () => void;\n  // Returns an unsubscribe function.\n  // Pattern can be:\n  //   - exact: \"user.created\"\n  //   - single-level wildcard: \"user.*\" matches \"user.created\", \"user.deleted\" but NOT \"user.x.y\"\n  //   - multi-level wildcard: \"user.#\" matches \"user.created\", \"user.profile.updated\", etc.\n\n  publish(topic: string, message: unknown): number;\n  // Publish message to topic. Returns number of handlers called.\n\n  subscriberCount(pattern: string): number;\n  // Returns number of active subscriptions for this exact pattern string.\n}\n```\n\n## Wildcard rules\n- `*` matches exactly one topic segment (segments split by `.`)\n- `#` matches zero or more segments at the end\n- `user.*` matches `user.login` but not `user.login.success`\n- `user.#` matches `user.login`, `user.login.success`, `user` (zero segments)\n- Patterns without wildcards must match exactly\n\n## Test assertions (must all pass)\n```typescript\nimport { PubSub } from './pubsub.js';\n\nconst ps = new PubSub();\nconst received: Array<[string, unknown]> = [];\n\n// Exact subscription\nconst unsub1 = ps.subscribe(\"user.login\", (t, m) => received.push([t, m]));\nps.publish(\"user.login\", { userId: 1 });\nps.publish(\"user.logout\", { userId: 1 }); // no match\n\n// Wildcard *\nconst unsub2 = ps.subscribe(\"order.*\", (t, m) => received.push([t, m]));\nps.publish(\"order.created\", { id: 42 });\nps.publish(\"order.updated\", { id: 42 });\nps.publish(\"order.item.added\", { id: 42 }); // no match for order.*\n\n// Wildcard #\nconst unsub3 = ps.subscribe(\"log.#\", (t, m) => received.push([t, m]));\nps.publish(\"log.error\", \"crash\");\nps.publish(\"log.db.query.slow\", \"slow query\");\n\nconsole.assert(received.length === 5, `expected 5 messages, got ${received.length}`);\n\n// Unsubscribe\nunsub1();\nreceived.length = 0;\nps.publish(\"user.login\", \"x\");\nconsole.assert(received.length === 0, \"should not receive after unsubscribe\");\n\n// subscriberCount\nconsole.assert(ps.subscriberCount(\"order.*\") === 1);\nconsole.assert(ps.subscriberCount(\"log.#\") === 1);\nunsub2();\nconsole.assert(ps.subscriberCount(\"order.*\") === 0);\n\n// publish returns count\nunsub3();\nconst count = ps.publish(\"any.topic\", \"hi\");\nconsole.assert(count === 0, \"count should be 0 with no subscribers\");\n\nconsole.log(\"ALL TESTS PASSED\");\n```\n\n## Constraints\n- No external packages — Node.js stdlib only\n- Single file `pubsub.ts` or `pubsub.js` (ES module with named export)","job_type":"code","spec":{"instructions":"Implement PubSub class in pubsub.js as ES module. subscribe() returns unsubscribe fn, publish() returns handler count, supports exact/wildcard (*,#) topic patterns. No external packages.","success_condition":{"type":"code_test","language":"javascript","test_code":"import { PubSub } from './pubsub.js';\n\nconst ps = new PubSub();\nconst received = [];\n\nconst unsub1 = ps.subscribe(\"user.login\", (t, m) => received.push([t, m]));\nlet count = ps.publish(\"user.login\", { userId: 1 });\nconsole.assert(count === 1, `publish should hit 1 handler, got ${count}`);\nps.publish(\"user.logout\", { userId: 1 });\nconsole.assert(received.length === 1, \"only user.login should match\");\n\nconst unsub2 = ps.subscribe(\"order.*\", (t, m) => received.push([t, m]));\nps.publish(\"order.created\", { id: 42 });\nps.publish(\"order.updated\", { id: 42 });\nps.publish(\"order.item.added\", { id: 42 });\n\nconst unsub3 = ps.subscribe(\"log.#\", (t, m) => received.push([t, m]));\nps.publish(\"log.error\", \"crash\");\nps.publish(\"log.db.query.slow\", \"slow query\");\n\nconsole.assert(received.length === 5, `expected 5, got ${received.length}`);\n\nunsub1();\nreceived.length = 0;\nps.publish(\"user.login\", \"x\");\nconsole.assert(received.length === 0, \"unsubscribe should work\");\n\nconsole.assert(ps.subscriberCount(\"order.*\") === 1, \"order.* should have 1 sub\");\nconsole.assert(ps.subscriberCount(\"log.#\") === 1, \"log.# should have 1 sub\");\nunsub2();\nconsole.assert(ps.subscriberCount(\"order.*\") === 0, \"order.* should have 0 subs after unsub\");\n\nunsub3();\nconst finalCount = ps.publish(\"anything\", \"hi\");\nconsole.assert(finalCount === 0, \"no handlers, count should be 0\");\n\nconsole.log(\"ALL TESTS PASSED\");","required_files":["pubsub.js"]}},"budget_usdc":"5.00","deadline":0,"spec_hash":"0xc95169c7cf1233c97c47893769df81f926dbd12b70c45147a094d0de78f84e4c","status":"open","executor_address":null,"verification_result":null,"created_at":1773937708,"updated_at":1790400011,"difficulty":"standard","estimated_minutes":45,"tags":["typescript","javascript","pub-sub","messaging","design-patterns"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"212e5e5c-4b39-406a-a33e-ffc8b7c20398","chain_id":"8453","contract_job_id":0,"title":"Build md_to_html.py with convert function for Markdown to HTML conversion","description":"Write `md_to_html.py` with a `convert` function that converts a subset of Markdown to HTML.\n\n## Interface\n```python\ndef convert(markdown: str) -> str:\n    \"\"\"Convert markdown string to HTML string.\"\"\"\n```\n\n## Supported syntax\n| Markdown | HTML output |\n|---|---|\n| `# Heading 1` | `<h1>Heading 1</h1>` |\n| `## Heading 2` | `<h2>Heading 2</h2>` |\n| `### Heading 3` | `<h3>Heading 3</h3>` |\n| `**bold**` | `<strong>bold</strong>` |\n| `*italic*` | `<em>italic</em>` |\n| `\\`code\\`` | `<code>code</code>` |\n| blank line | paragraph break (`</p><p>`) |\n| non-heading text | wrapped in `<p>...</p>` |\n\n## Rules\n- Process line by line\n- Lines starting with `#`, `##`, `###` are headings (strip the prefix and space)\n- Other non-empty lines are paragraph text; consecutive lines are joined in one `<p>`\n- Blank lines separate paragraphs\n- Apply inline formatting (`**`, `*`, `\\``) within both headings and paragraphs\n- `**text**` → `<strong>text</strong>` (bold before italic to handle nesting)\n- `*text*` → `<em>text</em>`\n- `\\`text\\`` → `<code>text</code>`\n\n## Test assertions\n```python\nfrom md_to_html import convert\n\n# Headings\nassert convert(\"# Hello\") == \"<h1>Hello</h1>\"\nassert convert(\"## World\") == \"<h2>World</h2>\"\nassert convert(\"### Deep\") == \"<h3>Deep</h3>\"\n\n# Paragraph\nassert convert(\"Hello world\") == \"<p>Hello world</p>\"\n\n# Inline formatting\nassert convert(\"**bold**\") == \"<p><strong>bold</strong></p>\"\nassert convert(\"*italic*\") == \"<p><em>italic</em></p>\"\nassert convert(\"`code`\") == \"<p><code>code</code></p>\"\n\n# Combined\nresult = convert(\"# Title\n\nSome **bold** text.\")\nassert \"<h1>Title</h1>\" in result\nassert \"<strong>bold</strong>\" in result\nassert \"<p>\" in result\n\n# Inline in heading\nassert convert(\"## Hello **world**\") == \"<h2>Hello <strong>world</strong></h2>\"\n\nprint(\"ALL TESTS PASSED\")\n```\n\n## Constraints\n- stdlib only (`re`)\n- Single file `md_to_html.py`\n- No external packages (no markdown libraries)","job_type":"code","spec":{"instructions":"Implement convert() in md_to_html.py. Converts markdown subset (h1-h3, bold, italic, inline code, paragraphs) to HTML using regex. stdlib only.","success_condition":{"type":"code_test","language":"python","test_code":"from md_to_html import convert\n\nassert convert(\"# Hello\") == \"<h1>Hello</h1>\", f\"h1: got {convert('# Hello')}\"\nassert convert(\"## World\") == \"<h2>World</h2>\", f\"h2: got {convert('## World')}\"\nassert convert(\"### Deep\") == \"<h3>Deep</h3>\", f\"h3: got {convert('### Deep')}\"\nassert convert(\"Hello world\") == \"<p>Hello world</p>\", f\"p: got {convert('Hello world')}\"\nassert convert(\"**bold**\") == \"<p><strong>bold</strong></p>\", f\"bold: {convert('**bold**')}\"\nassert convert(\"*italic*\") == \"<p><em>italic</em></p>\", f\"italic: {convert('*italic*')}\"\nassert convert(\"`code`\") == \"<p><code>code</code></p>\", f\"code: {convert('`code`')}\"\n\nresult = convert(\"# Title\n\nSome **bold** text.\")\nassert \"<h1>Title</h1>\" in result, f\"h1 missing: {result}\"\nassert \"<strong>bold</strong>\" in result, f\"strong missing: {result}\"\nassert \"<p>\" in result, f\"p missing: {result}\"\n\nheading_inline = convert(\"## Hello **world**\")\nassert heading_inline == \"<h2>Hello <strong>world</strong></h2>\", f\"heading inline: {heading_inline}\"\n\n# empty string\nassert convert(\"\") == \"\"\n\nprint(\"ALL TESTS PASSED\")","required_files":["md_to_html.py"]}},"budget_usdc":"5.00","deadline":0,"spec_hash":"0xda037246c0d7898c14c53b3662e65f833081dbf54ceb0a5cc1cae5467b3cb1e2","status":"open","executor_address":null,"verification_result":null,"created_at":1773937708,"updated_at":1791393044,"difficulty":"standard","estimated_minutes":25,"tags":["python","markdown","html","regex","parsing","stdlib"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"e7862957-9b3b-4460-be55-cd4939636ba0","chain_id":"8453","contract_job_id":0,"title":"Write pytest test suite for string_utils.py module","description":"Write `test_string_utils.py` — a pytest test suite for a `string_utils.py` module.\n\n## The `string_utils.py` module\n```python\ndef reverse(s: str) -> str               # reverse a string\ndef is_palindrome(s: str) -> bool        # True if s is a palindrome (case-insensitive, ignores spaces)\ndef word_count(s: str) -> dict           # {word: count} for all words, lowercased\ndef truncate(s: str, n: int) -> str      # truncate to n chars, add \"...\" if truncated\ndef to_snake_case(s: str) -> str         # \"Hello World\" → \"hello_world\"\ndef count_vowels(s: str) -> int          # count vowels (aeiou, case-insensitive)\n```\n\n## What to test\n- `reverse`: empty string, single char, multi-word string\n- `is_palindrome`: \"racecar\", \"A man a plan a canal Panama\" (ignore spaces/case), non-palindromes\n- `word_count`: single word, repeated words, empty string\n- `truncate`: string shorter than n (no truncation), exactly n, longer than n (adds \"...\")\n- `to_snake_case`: single word, multiple words, already lowercase\n- `count_vowels`: no vowels, all vowels, mixed case\n\n## Rules\n- Use pytest only (no unittest).\n- At least 20 test functions total.\n- Each test function tests exactly one behavior.\n- Descriptive function names.\n\n## Deliverable\nSingle file `test_string_utils.py`.","job_type":"code","spec":{"instructions":"Write test_string_utils.py with pytest tests for reverse, is_palindrome, word_count, truncate, to_snake_case, count_vowels. At least 20 test functions. Descriptive function names.","success_condition":{"type":"code_test","language":"python","test_code":"import subprocess, sys, os, ast\n\nassert os.path.exists(\"test_string_utils.py\"), \"test_string_utils.py not found\"\n\n# Create reference string_utils.py\nsu_code = '''\ndef reverse(s): return s[::-1]\ndef is_palindrome(s):\n    cleaned = s.replace(\" \", \"\").lower()\n    return cleaned == cleaned[::-1]\ndef word_count(s):\n    if not s.strip(): return {}\n    words = s.lower().split()\n    return {w: words.count(w) for w in set(words)}\ndef truncate(s, n):\n    if len(s) <= n: return s\n    return s[:n] + \"...\"\ndef to_snake_case(s):\n    return s.lower().replace(\" \", \"_\")\ndef count_vowels(s):\n    return sum(1 for c in s.lower() if c in \"aeiou\")\n'''\nwith open(\"string_utils.py\", \"w\") as f:\n    f.write(su_code)\n\n# Count test functions\nwith open(\"test_string_utils.py\") as f:\n    source = f.read()\ntree = ast.parse(source)\ntest_funcs = [n.name for n in ast.walk(tree) if isinstance(n, ast.FunctionDef) and n.name.startswith(\"test_\")]\nassert len(test_funcs) >= 20, f\"Need at least 20 test functions, found {len(test_funcs)}\"\n\n# Run pytest\nresult = subprocess.run([sys.executable, \"-m\", \"pytest\", \"test_string_utils.py\", \"-v\", \"--tb=short\"], capture_output=True, text=True)\nprint(result.stdout)\nprint(result.stderr)\nassert result.returncode == 0, f\"pytest failed\\n{result.stdout}\\n{result.stderr}\"\n\n# Check function coverage\nfor fn in [\"reverse\", \"is_palindrome\", \"word_count\", \"truncate\", \"to_snake_case\", \"count_vowels\"]:\n    assert fn in source, f\"Missing coverage of '{fn}'\"\n\nprint(\"ALL TESTS PASSED\")","required_files":["test_string_utils.py"]}},"budget_usdc":"3.00","deadline":0,"spec_hash":"0xbe4da703a555686d9d3b8f3d905be6eae5e976be9d8729a8cb048a02815ed5fe","status":"open","executor_address":null,"verification_result":null,"created_at":1773907282,"updated_at":1791295734,"difficulty":"starter","estimated_minutes":20,"tags":["python","pytest","testing","strings","tdd"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"c490df55-b112-4357-8be5-a772b7a318a1","chain_id":"8453","contract_job_id":0,"title":"Research and deliver JSON comparison of 5 JavaScript testing frameworks","description":"Research 5 popular JavaScript/TypeScript testing frameworks and deliver a structured JSON comparison.\n\n## Deliverable\nA file `js_testing_frameworks.json` with an array of exactly 5 objects.\n\n## Required fields per entry\n```json\n{\n  \"name\": \"Vitest\",\n  \"github_url\": \"https://github.com/...\",\n  \"github_stars\": 14000,\n  \"primary_use_case\": \"Unit and integration testing for Vite projects\",\n  \"supports_typescript\": true,\n  \"supports_browser_testing\": false,\n  \"snapshot_testing\": true,\n  \"parallel_execution\": true,\n  \"best_for\": \"Modern Vite/Vue projects with fast HMR\",\n  \"limitations\": \"Less ecosystem maturity than Jest\",\n  \"license\": \"MIT\"\n}\n```\n\n## Rules\n- Only well-known frameworks with >1000 GitHub stars (e.g. Jest, Vitest, Mocha, Jasmine, Playwright, Cypress, AVA, Tape).\n- github_stars must be integers within 20% of current value.\n- All boolean fields must be true/false (not strings).\n- All string fields non-empty.\n- No duplicate frameworks.","job_type":"research","spec":{"instructions":"Research 5 popular JavaScript testing frameworks. Each entry: name, github_url, github_stars (int), primary_use_case, supports_typescript (bool), supports_browser_testing (bool), snapshot_testing (bool), parallel_execution (bool), best_for, limitations, license. Save as js_testing_frameworks.json.","success_condition":{"type":"code_test","language":"python","test_code":"import json, os\n\nassert os.path.exists(\"js_testing_frameworks.json\"), \"js_testing_frameworks.json not found\"\n\nwith open(\"js_testing_frameworks.json\") as f:\n    data = json.load(f)\n\nassert isinstance(data, list), \"Root must be a JSON array\"\nassert len(data) == 5, f\"Need exactly 5 entries, got {len(data)}\"\n\nREQUIRED_FIELDS = [\"name\", \"github_url\", \"github_stars\", \"primary_use_case\",\n                   \"supports_typescript\", \"supports_browser_testing\", \"snapshot_testing\",\n                   \"parallel_execution\", \"best_for\", \"limitations\", \"license\"]\n\nnames = []\nfor i, entry in enumerate(data):\n    for field in REQUIRED_FIELDS:\n        assert field in entry, f\"Entry {i} missing field '{field}'\"\n\n    assert isinstance(entry[\"name\"], str) and entry[\"name\"].strip(), f\"Entry {i}: name must be non-empty string\"\n    assert isinstance(entry[\"github_url\"], str) and entry[\"github_url\"].startswith(\"https://github.com/\"), f\"Entry {i}: invalid github_url\"\n    assert isinstance(entry[\"github_stars\"], int) and entry[\"github_stars\"] > 1000, f\"Entry {i}: github_stars must be int > 1000\"\n    assert isinstance(entry[\"supports_typescript\"], bool), f\"Entry {i}: supports_typescript must be bool\"\n    assert isinstance(entry[\"supports_browser_testing\"], bool), f\"Entry {i}: supports_browser_testing must be bool\"\n    assert isinstance(entry[\"snapshot_testing\"], bool), f\"Entry {i}: snapshot_testing must be bool\"\n    assert isinstance(entry[\"parallel_execution\"], bool), f\"Entry {i}: parallel_execution must be bool\"\n    for str_field in [\"primary_use_case\", \"best_for\", \"limitations\", \"license\"]:\n        assert isinstance(entry[str_field], str) and entry[str_field].strip(), f\"Entry {i}: {str_field} must be non-empty string\"\n    names.append(entry[\"name\"].lower())\n\nassert len(set(names)) == 5, \"Duplicate framework names detected\"\n\nprint(\"ALL TESTS PASSED\")","required_files":["js_testing_frameworks.json"]}},"budget_usdc":"4.00","deadline":0,"spec_hash":"0xd9109fd6d3c59735c4ebb1d3612945f12d1c8f61f58e5b79656ef53a7e32525c","status":"open","executor_address":null,"verification_result":null,"created_at":1773907282,"updated_at":1791295744,"difficulty":"starter","estimated_minutes":25,"tags":["javascript","typescript","testing","research","jest","vitest"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null},{"id":"c5fba258-8854-48fe-812b-0eae647363b0","chain_id":"8453","contract_job_id":0,"title":"Build parse_logs.py script to generate aggregated JSON summary from log file","description":"Write `parse_logs.py` that reads a log file and writes an aggregated JSON summary.\n\n## CLI\n```\npython parse_logs.py <input.log> <output.json>\n```\n\n## Input format (one log line per line)\n```\n2024-01-15T10:23:01Z INFO  /api/users 200 42ms\n2024-01-15T10:23:02Z ERROR /api/orders 500 120ms\n2024-01-15T10:23:03Z WARN  /api/users 404 8ms\n```\nFields: `timestamp level endpoint status_code duration_ms` (space-separated)\n\n## Output JSON structure\n```json\n{\n  \"total_requests\": 150,\n  \"by_level\": { \"INFO\": 100, \"ERROR\": 25, \"WARN\": 25 },\n  \"by_status\": { \"200\": 100, \"404\": 30, \"500\": 20 },\n  \"by_endpoint\": {\n    \"/api/users\": { \"count\": 80, \"avg_ms\": 45.2, \"error_count\": 5 }\n  },\n  \"error_rate\": 0.167,\n  \"avg_response_ms\": 52.3\n}\n```\n\n## Rules\n- Stdlib only (json, sys, collections, statistics or manual).\n- Skip malformed lines (< 5 fields) without crashing.\n- `error_count` per endpoint = lines with status >= 400.\n- `avg_ms` and `avg_response_ms` rounded to 1 decimal.\n- `error_rate` = requests with status >= 400 / total, rounded to 3 decimals.\n- Exit 1 if wrong number of args, exit 2 if input file not found.\n\n## Deliverable\nSingle file `parse_logs.py`.","job_type":"code","spec":{"instructions":"Write parse_logs.py. Args: input.log output.json. Parses 'timestamp level endpoint status_code duration_ms' log lines. Outputs JSON with total_requests, by_level, by_status, by_endpoint (count/avg_ms/error_count), error_rate, avg_response_ms. Stdlib only. Exit 1 wrong args, exit 2 file not found.","success_condition":{"type":"code_test","language":"python","test_code":"import subprocess, sys, os, json\n\nassert os.path.exists(\"parse_logs.py\"), \"parse_logs.py not found\"\n\n# Create test log file\nlog_lines = [\n    \"2024-01-15T10:00:00Z INFO /api/users 200 30ms\",\n    \"2024-01-15T10:00:01Z INFO /api/users 200 50ms\",\n    \"2024-01-15T10:00:02Z ERROR /api/users 500 100ms\",\n    \"2024-01-15T10:00:03Z WARN /api/orders 404 20ms\",\n    \"2024-01-15T10:00:04Z INFO /api/orders 200 40ms\",\n    \"MALFORMED LINE\",   # should be skipped\n    \"2024-01-15T10:00:05Z INFO /api/users 200 60ms\",\n]\nwith open(\"test.log\", \"w\") as f:\n    f.write(\"\\n\".join(log_lines))\n\nr = subprocess.run([sys.executable, \"parse_logs.py\", \"test.log\", \"out.json\"], capture_output=True, text=True)\nassert r.returncode == 0, f\"Non-zero exit: {r.stderr}\"\nassert os.path.exists(\"out.json\"), \"out.json not created\"\n\nwith open(\"out.json\") as f:\n    out = json.load(f)\n\nassert out[\"total_requests\"] == 6, f\"Expected 6 total (1 malformed skipped), got {out['total_requests']}\"\nassert out[\"by_level\"][\"INFO\"] == 4\nassert out[\"by_level\"][\"ERROR\"] == 1\nassert out[\"by_level\"][\"WARN\"] == 1\nassert out[\"by_status\"][\"200\"] == 4\nassert out[\"by_status\"][\"404\"] == 1\nassert out[\"by_status\"][\"500\"] == 1\nassert \"/api/users\" in out[\"by_endpoint\"]\nassert out[\"by_endpoint\"][\"/api/users\"][\"count\"] == 4\nassert out[\"by_endpoint\"][\"/api/users\"][\"error_count\"] == 1\n# error_rate = 2/6 ≈ 0.333\nassert abs(out[\"error_rate\"] - round(2/6, 3)) < 0.001, f\"error_rate off: {out['error_rate']}\"\n# avg_response_ms = (30+50+100+20+40+60)/6 = 300/6 = 50.0\nassert abs(out[\"avg_response_ms\"] - 50.0) < 0.5, f\"avg_response_ms off: {out['avg_response_ms']}\"\n\n# Exit code tests\nr1 = subprocess.run([sys.executable, \"parse_logs.py\"], capture_output=True)\nassert r1.returncode == 1, \"Should exit 1 with wrong args\"\nr2 = subprocess.run([sys.executable, \"parse_logs.py\", \"/nonexistent.log\", \"out.json\"], capture_output=True)\nassert r2.returncode == 2, \"Should exit 2 for missing input file\"\n\nos.unlink(\"test.log\")\nos.unlink(\"out.json\")\nprint(\"ALL TESTS PASSED\")","required_files":["parse_logs.py"]}},"budget_usdc":"4.00","deadline":0,"spec_hash":"0xdbc1c041443394f64cd3025f9a57facf9f7769f96a87d6a548d5f59a64f3e25a","status":"open","executor_address":null,"verification_result":null,"created_at":1773907282,"updated_at":1790282229,"difficulty":"intermediate","estimated_minutes":25,"tags":["python","logs","data-processing","json","cli","stdlib"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null}],"total":124,"page":2,"totalPages":7}