{"id":51031799,"url":"https://github.com/fmguerreiro/tdad-ts","last_synced_at":"2026-06-22T01:01:47.720Z","repository":{"id":356489734,"uuid":"1232622313","full_name":"fmguerreiro/tdad-ts","owner":"fmguerreiro","description":"Test-Driven Agentic Development for TypeScript — graph-based test impact map for AI coding agents (TS port of arXiv 2603.17973)","archived":false,"fork":false,"pushed_at":"2026-05-25T00:25:58.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-25T02:27:57.299Z","etag":null,"topics":["ai-agents","ai-coding-agents","cli","code-analysis","dependency-graph","developer-tools","llm","regression-testing","static-analysis","test-driven-development","test-impact-analysis","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmguerreiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-08T05:36:40.000Z","updated_at":"2026-05-25T00:26:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fmguerreiro/tdad-ts","commit_stats":null,"previous_names":["fmguerreiro/tdad-ts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fmguerreiro/tdad-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmguerreiro%2Ftdad-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmguerreiro%2Ftdad-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmguerreiro%2Ftdad-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmguerreiro%2Ftdad-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmguerreiro","download_url":"https://codeload.github.com/fmguerreiro/tdad-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmguerreiro%2Ftdad-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34630753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","ai-coding-agents","cli","code-analysis","dependency-graph","developer-tools","llm","regression-testing","static-analysis","test-driven-development","test-impact-analysis","typescript"],"created_at":"2026-06-22T01:01:47.559Z","updated_at":"2026-06-22T01:01:47.705Z","avatar_url":"https://github.com/fmguerreiro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tdad-ts\n\nTypeScript port of TDAD (Test-Driven Agentic Development), a graph-based test\nimpact analyzer for AI coding agents.\n\nReference: Alonso, Yovine, Braberman.\n\"TDAD: Test-Driven Agentic Development - Reducing Code Regressions in AI\nCoding Agents via Graph-Based Impact Analysis.\" arXiv:2603.17973, March 2026.\n\n## What it does\n\nIndexes a TypeScript project into a static `test_map.txt` that maps each\nsource file to the tests at risk of regressing if that file changes. An AI\nagent grep's the map after editing a file, runs the listed tests, and\nself-corrects on failure - no MCP server, graph DB, or runtime API.\n\n## Status\n\nPrototype. Single-pass indexer, in-memory graph, file-level test map.\n\n## Usage\n\n```bash\ntdad-ts index \u003cproject-root\u003e --out test_map.txt\ntdad-ts index \u003cproject-root\u003e --out test_map.txt --coverage coverage.json\ntdad-ts impacted \u003cproject-root\u003e \u003cchanged-file\u003e [\u003cchanged-file\u003e ...]\ntdad-ts impacted \u003cproject-root\u003e \u003cchanged-file\u003e --coverage coverage.json\n```\n\n### Coverage strategy\n\nPass a JSON file via `--coverage \u003cpath\u003e` to enable the Coverage strategy. The\nfile maps each test file to the source files it covered at runtime:\n\n```json\n{\n  \"version\": 1,\n  \"tests\": {\n    \"tests/foo.spec.ts\": [\"src/used.ts\", \"src/lib/helper.ts\"],\n    \"tests/bar.spec.ts\": [\"src/lib/helper.ts\"]\n  }\n}\n```\n\nPaths are project-relative, forward-slash. Generating this file from a test\nrunner's raw output (e.g. vitest's v8 coverage report) is a downstream concern\nleft to the caller.\n\n## Algorithm\n\nSame scoring as the paper:\n\n```\nscore = (1 - c_w) * w_strategy + c_w * confidence\n```\n\nwith `c_w = 0.3` and per-strategy weights:\n\n| Strategy   | Weight | Confidence |\n|------------|--------|------------|\n| Direct     | 0.95   | 1.00       |\n| Route      | 0.90   | 0.70       |\n| Transitive | 0.70   | 0.56       |\n| Coverage   | 0.80   | 0.50       |\n| Imports    | 0.50   | 0.45       |\n\nTiers: high (\u003e= 0.8), medium (0.5-0.8), low (\u003c 0.5). Default cap 50 tests\nper source file.\n\n## Test linker heuristics\n\nThree-tier strategy from the paper, ported to TS conventions:\n\n1. Naming convention: `foo.spec.ts`, `foo.test.ts`, `__tests__/foo.ts` -\u003e `foo.ts`\n2. Prefix matching: progressive truncation of test-file stem\n3. Directory proximity: nearest non-test ancestor when a stem matches multiple sources\n\n## Route and registry edges\n\nStatic `import` chains miss two recurring patterns in real codebases: Next.js\nroute resolution (a test reaches the page through a URL, not an import) and\nregistry-based dispatch (a function looks up its target by name in a table).\nBoth are exposed via a single JSON config passed with `--registries`:\n\n```json\n{\n  \"routes\": { \"appDir\": \"app\" },\n  \"registries\": [\n    {\n      \"name\": \"email-templates\",\n      \"lookup\":     { \"import\": \"src/email-builder\", \"function\": \"buildEmail\", \"argIndex\": 0 },\n      \"registered\": { \"files\":  \"src/templates/*.ts\" }\n    }\n  ]\n}\n```\n\n`routes` walks the Next.js app directory, derives URL patterns (stripping\n`(group)` segments and replacing `[id]` with wildcards), and emits a `Route`\nedge from any test that contains a matching string literal. `registries`\ndetects calls to a configured lookup function whose key argument matches a\nregistered file's basename, and emits the same edge type. Both surface as the\n`Route` strategy in `test_map.txt` at the high tier.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmguerreiro%2Ftdad-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmguerreiro%2Ftdad-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmguerreiro%2Ftdad-ts/lists"}