{"id":48000456,"url":"https://github.com/zevorn/go-box-checker","last_synced_at":"2026-04-04T12:18:25.583Z","repository":{"id":340728818,"uuid":"1166716178","full_name":"zevorn/go-box-checker","owner":"zevorn","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-26T07:22:54.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-26T12:39:12.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/zevorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-02-25T14:27:40.000Z","updated_at":"2026-02-26T07:22:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zevorn/go-box-checker","commit_stats":null,"previous_names":["zevorn/go-box-checker"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zevorn/go-box-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevorn%2Fgo-box-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevorn%2Fgo-box-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevorn%2Fgo-box-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevorn%2Fgo-box-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zevorn","download_url":"https://codeload.github.com/zevorn/go-box-checker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevorn%2Fgo-box-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31399281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-04-04T12:18:25.146Z","updated_at":"2026-04-04T12:18:25.562Z","avatar_url":"https://github.com/zevorn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Parser Box-Depth Static Checker\n\nA static analysis tool that verifies box depth balancing in Go hand-written recursive descent parsers.\n\n## Problem\n\nGo parsers using a custom recursive descent framework track depth via `db.New()` (depth+1) and `db.Wrap()` (depth-1). This tool statically checks that all execution paths from the entry function `f_top` end with box depth == 0.\n\n## How It Works\n\n- **Abstract interpretation** with `DeltaSet` (set of possible depth-delta integers)\n- **Worklist-based CFG analysis** per function (handles if/for/switch/break/return/panic)\n- **Tarjan SCC + fixed-point iteration** for inter-procedural recursive calls\n- **Widening** to prevent divergence on unbounded loops\n- Paths ending in `panic()` are discarded\n\n## Usage\n\n```bash\n# Install\npip install tree-sitter tree-sitter-go\n\n# Check a Go file (default entry: f_top)\npython -m box_checker path/to/parser.go\n\n# Specify entry function\npython -m box_checker path/to/parser.go f_my_entry\n```\n\n## Testing\n\n```bash\npip install pytest\n\n# Run all tests\npytest tests/ -v\n\n# Generate stress test fixtures (~750 cases, ~20000 lines of Go)\npython tests/gen_stress.py\n\n# Run stress tests only\npytest tests/test_stress.py -v\n```\n\n## Project Structure\n\n```\nbox_checker/\n    model.py       # DeltaSet, CFGNode, FuncCFG, FuncSummary\n    go_parser.py   # tree-sitter Go parsing, f_xxx extraction\n    cfg.py         # AST -\u003e CFG builder\n    analyzer.py    # Dataflow analysis + fixed-point iteration\n    main.py        # CLI entry point\ntests/\n    test_e2e.py    # 15 end-to-end test cases\n    test_stress.py # ~750 parametrized stress test cases (auto-generated)\n    gen_stress.py  # Stress test generator script\n    testdata/      # Go test fixtures (01-15 manual + stress_01-15 generated)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevorn%2Fgo-box-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzevorn%2Fgo-box-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevorn%2Fgo-box-checker/lists"}