Skip to content

[codex] isolate Tree-sitter mutation parsing - #72

Merged
greenthree merged 1 commit into
mainfrom
codex/mutation-parser-worker
Aug 11, 2026
Merged

[codex] isolate Tree-sitter mutation parsing#72
greenthree merged 1 commit into
mainfrom
codex/mutation-parser-worker

Conversation

@greenthree

Copy link
Copy Markdown
Owner

What changed

  • Move Tree-sitter C++ mutation parsing into the shipped mutation_parser_worker.py subprocess.
  • Reuse shared process control for bounded output, timeout, cancellation, resource limits, temporary working directory, and descendant cleanup.
  • Validate the worker protocol, parser identity, source hash, candidate spans, positions, and count before accepting a plan; retain the previous evidence on parser/infrastructure failure.
  • Reuse the same parser worker from doctor, forward mutation deadlines/cancellation, and include the worker in npm packaging and documentation.

Why

Native Tree-sitter bindings should not run in the long-lived Core process. A bounded worker keeps parser crashes, malformed protocol output, resource exhaustion, and cancellation isolated while preserving deterministic mutation IDs and fail-closed behavior.

Validation

  • tests.test_mutation_syntax: 15 passed
  • tests.test_mutation: 24 passed
  • tests.test_core + tests.test_npm_packages: 49 passed
  • Python dependency audit: 12 dependencies, 0 vulnerabilities
  • clean-install delivery flow: passed (probhub 223 files, compatibility package 5 files)
  • npm run pack:check: passed
  • npm run release:check: passed
  • Skill validation and git diff --check: passed
  • phtest nine-problem lint: passed

The full npm run check was attempted but its npm test phase exceeded the 15-minute local timeout in an unrelated long-running interactive fixture; the residual test tree was terminated and no test processes remained.

Scope

This PR does not add typeid(type) compatibility, WebUI integration, Checker/Interactor integration, Legacy support, or a mutation hard gate for build.

@greenthree
greenthree marked this pull request as ready for review August 11, 2026 07:19
@greenthree
greenthree merged commit 90bc8a7 into main Aug 11, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant