Find code by asking what it does. A CLI for coding agents that uses Jev to discover relevant files and source context.
TypeScript ai-sdkclaude-codeclicode-searchcodexcoding-agentscontext-retrievaldeveloper-toolsjevsemantic-searchtypescriptvercel-ai-gateway
Record bundled CPython parity decision and remaining gates
David Zhang584c5b3c48f6
diff --git a/specs/jevgrep/README.md b/specs/jevgrep/README.mdindex e2babcc..2e279f3 100644--- a/specs/jevgrep/README.md+++ b/specs/jevgrep/README.md@@ -7,12 +7,13 @@ Jev classification through Vercel AI Gateway. This is the build plan; production## Next Agent PromptYou are implementing this spec. Status: **implementing**, updated **2026-09-26**.-Next: finish the merged gate and whole-product review before freezing another-package or starting paid confirmation. The two reproduced defects are fixed:-second-pass evidence follows selection-completion order, and invalid TS/JS retains-reference comment ranges. Their whole-CLI regressions passed red/green comparisons.-Passing the earlier exercised fixtures was insufficient; the earlier paid start-was premature. No additional paid run may precede a clean whole-product review.+Next: integrate the bundled CPython parser and its packaging, then finish the+merged gate and whole-product review before freezing another package or starting+paid confirmation. Review found Python AST differences beyond the previously+fixed evidence-order and TS/JS comment defects. The smaller grammar parser did+not preserve the winner; use its unchanged Python helpers with bundled CPython.+See [runtime evidence](assets/python-runtime.md). No additional paid run may+precede a clean whole-product review.`installed-jg-reference-parity-v1` is stopped and superseded. Requests andscikit-learn officially solved but exceeded baseline cost; Django was interrupted@@ -144,11 +145,10 @@ This plan keeps two production packages, moves parser/filesystem risks before thfirst task, and separates failures/cache/output evidence instead of bundling theminto a vague hardening phase.-Claude proposed Pyodide for closer CPython parity. Prefer the smaller WASM grammar-mechanism initially; its prerequisite conformance gate must expose changes across-all three Python uses. A failed gate reopens that choice, not the Node-only user-contract. Do not require zero textual diffs by normalizing semantically meaningful-source or question order. The skill-path ambiguity was checked: the confirmation+Claude proposed Pyodide for closer CPython parity. The initial smaller grammar+parser failed that requirement; the measured fallback is now being integrated.+This reopens the parser mechanism, not the Node-only user contract. Do not+normalize semantically meaningful source or question order. The skill-path ambiguity was checked: the confirmationhash matches the retained ranked-leads skill; the current working skill has changed.Recursive fog audit: parser compatibility has its own artifact (02); eligibilitydiff --git a/specs/jevgrep/assets/parity-restoration.md b/specs/jevgrep/assets/parity-restoration.mdindex 69993f2..799d33a 100644--- a/specs/jevgrep/assets/parity-restoration.md+++ b/specs/jevgrep/assets/parity-restoration.md@@ -154,3 +154,13 @@ Finish whole-product review before paid confirmation, in addition to matchedHTTP tests and supported-runtime gates. The quality target remains every fixedbaseline solve preserved and at least seven solved strict Sol-cost wins in oneprospective ten-task cohort. Historical or interrupted attempts cannot be pooled.++## Python runtime parity remains open++Further whole-product review found Python decorator, line-ending and invalid-AST+mismatches beyond the already corrected TS/JS comments and selection ordering.+The grammar approximation is being replaced with unchanged reference helpers+executed in bundled CPython. [Runtime evidence](python-runtime.md) owns the bounded+probe and remaining integration requirements. Neither stopped paid cohort is+reactivated by this change; merged verification and a clean full review must+precede a new prospective confirmation.diff --git a/specs/jevgrep/assets/python-runtime.md b/specs/jevgrep/assets/python-runtime.mdnew file mode 100644index 0000000..e34f7b4--- /dev/null+++ b/specs/jevgrep/assets/python-runtime.md@@ -0,0 +1,55 @@+# Preserve Python behavior through the original interpreter++The spike's Python helpers define declaration, preview and neighboring-method+behavior through CPython's AST. A different grammar plus hand-written corrections+passed initial examples but failed later review on decorators, invalid syntax and+line endings. These differences change evidence sent to Jev. The selected remedy+is to execute the unchanged helpers with bundled CPython, retaining Node as the+only user prerequisite. Packaging and process isolation may change; extraction+algorithms may not silently change.++## Bounded adoption evidence — 2026-09-26++The offline probe pinned Pyodide 0.25.1, which reports CPython 3.11.3. It compared+all three unchanged helpers against the retained Requests task image's CPython+3.11.5: 162 of 162 outputs matched across 54 inputs. Inputs covered six frozen+corpus cases, 42 existing valid/invalid controls, and six additional decorator,+line-ending and invalid-AST cases. Comparisons did not sort, normalize or adjust+source coordinates. This is finite conformance evidence, not proof that every+input behaves identically across those patch versions.++The probe ran under Node 22.23.3 in a read-only, non-root Docker container with+network disabled and no Python executable. Required standard-library modules+loaded locally without extra packages. Pyodide and its direct dependency files+occupied 12,989,709 bytes. One run measured 2.49 seconds initialization, 0.66 seconds+for all helper calls and about 197 MiB final RSS. These measurements are diagnostic,+not performance promises or limits. Original probe inputs, oracle and replay are+retained locally at `/tmp/jg-pyodide-spike.NPvgLD/`; durable production coverage+belongs in the parser and full-CLI reference tests.++## Runtime boundary and remaining work++Repository source is data supplied to trusted AST helpers, never executed as+Python. Interpreter streams and globals are shared state, so one owner serializes+helper calls. A Node child process is being integrated to isolate synchronous+execution, permit cancellation, and support both the Node product and Bun-hosted+development. The attempted Bun worker-thread loader normalization did not work+and must not ship. Unrelated pending pure helper requests must survive another+query's cancellation; no interpreter pool or second parser is introduced.++Integration is unfinished until merged tests prove unchanged computed requests,+full stdout, cancellation, process exit and offline installed asset loading.+Missing or corrupt runtime assets must fail truthfully without fabricated+excerpts or stderr leakage. Helper conformance alone cannot close those gates,+and none of these checks replaces the frozen downstream quality comparison.++## Upstream provenance++The npm metadata's Apache label does not describe all bundled components. Tagged+Pyodide source uses MPL-2.0; CPython and compiled dependencies carry their own+notices. The package must retain component provenance rather than describe the+whole runtime as Apache-only. Packaging owns those notices and their verification.++- [Pyodide 0.25.1 license](https://github.com/pyodide/pyodide/blob/0.25.1/LICENSE)+- [Pyodide runtime API](https://pyodide.org/en/0.25.1/usage/api/js-api.html)+- [Interruption semantics](https://pyodide.org/en/0.25.1/usage/keyboard-interrupts.html)diff --git a/specs/jevgrep/choices.md b/specs/jevgrep/choices.mdindex d362111..0736d7d 100644--- a/specs/jevgrep/choices.md+++ b/specs/jevgrep/choices.md@@ -190,3 +190,18 @@ whole-computer throughput or optimal cache maintenance. Verdict: sound for thisconfirmation, with medium confidence: retain measured retrieval behavior andreport the cache limitation; test any later optimization as a separately identifiedartifact rather than silently changing the candidate being confirmed.++### Isolate bundled CPython in one Node child process++Gap: the spec requires no system Python and cancelable inspection but leaves the+interpreter isolation mechanism open. Use the spike's unchanged helpers inside+bundled CPython, with one Node child process owning interpreter state. A worker+thread passed Node checks but its Pyodide loader failed under the existing Bun+development runner; attempting to normalize its environment did not solve it.+A single Node process path avoids patching the dependency or retaining two parsers.++Reach: the package gains runtime assets and a child process; pure pending helper+jobs may need replay when cancellation terminates that process. The product still+requires only Node. Verdict: provisional pending merged lifecycle and parity+verification. Confidence: medium. Version coverage and footprint rationale live+in [runtime evidence](assets/python-runtime.md).diff --git a/specs/jevgrep/contracts.md b/specs/jevgrep/contracts.mdindex 82ea5bc..229309a 100644--- a/specs/jevgrep/contracts.md+++ b/specs/jevgrep/contracts.md@@ -113,10 +113,11 @@ bounded pages without silently dropping later pages; no global fixed file count.Reuse one bounded relationship pass from the reference, not an unbounded researchloop. Deduplicate repeated stage/input work within an invocation.-Parse Python with packaged Tree-sitter WASM and TS/JS with the TypeScript parser;-ship assets/licenses in the tarball. Check parser compatibility before final pin.-Use text chunks for unsupported languages or parse failure. Additional grammars-are delegated only if they use this same adapter and tests without new runtimes.+Parse Python using the frozen helpers unchanged in bundled CPython, and TS/JS+with the TypeScript parser. Ship local runtime assets and component notices;+no system Python or runtime download is required. See the+[runtime rationale](assets/python-runtime.md) for the measured version boundary.+Use reference text fallback for unsupported languages or parse failure.Units retain adjacent comments, decorators, docstrings and local context. Largeunits may be split and marked partial. Preserve accepted neighbor expansion as anexplicit policy, including its second-pass expansion of previously rendereddiff --git a/specs/jevgrep/map.md b/specs/jevgrep/map.mdindex 7558c23..40bf7f4 100644--- a/specs/jevgrep/map.md+++ b/specs/jevgrep/map.md@@ -71,7 +71,7 @@ installed-process/provider tests. No whole-repo security or performance audit cl## Facts implementation must establish-Pinned Python grammar/WASM and license compatibility, Node runtime asset loading,+Bundled CPython version and component-license compatibility, Node runtime asset loading,exact SDK evaluation HTTP shape, and initial directory sampling quality must beproved at the owning slice before its consumer lands. Excerpt budget is delegatedto comparative task evidence, not another product interview. An unavailable externaldiff --git a/specs/jevgrep/research.md b/specs/jevgrep/research.mdindex befb710..678f1f7 100644--- a/specs/jevgrep/research.md+++ b/specs/jevgrep/research.md@@ -12,12 +12,9 @@ they do not supersede the product's measured retrieval policy.validates answers, defaults to two retries and logs warnings. Pin the current SDK;explicitly own retries and warning routing so hidden retries do not escape the50k guard and SDK logs do not violate stdout-only output.-- [Web Tree-sitter](https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md)- supports WASM grammar assets in Node and documents ABI/loading constraints.- [Python grammar](https://github.com/tree-sitter/tree-sitter-python) provides the- candidate bundled parser. Use a pinned runtime/grammar pair with license notices;- verify the actual packed assets load without Python or build tools installed.- This is a proposed production mechanism, not the winning spike's parser.+- The initial Tree-sitter Python port failed exact AST compatibility during+ whole-product review. [Bundled CPython evidence](assets/python-runtime.md)+ records the measured replacement and its remaining verification boundary.- [Git ignore semantics](https://git-scm.com/docs/gitignore) distinguish trackedfiles and explain nested pattern precedence and excluded-parent negation.Jevgrep must document its traversal policy explicitly rather than claim to bediff --git a/specs/jevgrep/slices/02-parser.md b/specs/jevgrep/slices/02-parser.mdindex d242f04..23c7e87 100644--- a/specs/jevgrep/slices/02-parser.md+++ b/specs/jevgrep/slices/02-parser.md@@ -1,6 +1,6 @@-# Bundle source inspection without Python+# Bundle source inspection without system Python-Status: reopened for TS/JS syntax-fallback comment preservation (2026-09-26).+Status: reopened for bundled CPython integration and full parity review (2026-09-26).Depends on: 01.Read [contracts](../contracts.md) first. Recognized syntax outside the reference'sPython 3.11 boundary shares one fallback across inspection, previews and@@ -8,9 +8,9 @@ neighboring-method selection. TypeScript uses the reference comment traversal.## Contract and owner-Core `source` owns `inspect(snapshot) -> {units, comments, mode}` and Python preview/neighborhood helpers. First reproduce the frozen scripts on fixture source in the test container, then port their semantic units to packaged Tree-sitter Python WASM. TS/JS uses TypeScript. One snapshot supplies lines and source; unsupported or erroneous syntax falls back to text chunks.+Core `source` owns `inspect(snapshot) -> {units, comments, mode}` and Python preview/neighborhood helpers. First reproduce the frozen scripts on fixture source in the test container, then execute unchanged helpers in bundled CPython. See the [runtime evidence](../assets/python-runtime.md). TS/JS uses TypeScript. One snapshot supplies lines and source; unsupported or erroneous syntax falls back to text chunks.-Verify three Python uses: declarations, content previews and neighboring methods. Compare nested classes/functions, decorators, comments/docstrings, Unicode, CRLF, Python-2 syntax and parse failures. Differences must be explained as explicit production behavior changes, never normalized away. Package WASM/license assets now and resolve from the installed module location. If the chosen runtime/grammar cannot load reliably, stop this slice and revise the parser decision before integrating; do not add a Python prerequisite.+Verify three Python uses: declarations, content previews and neighboring methods. Compare nested classes/functions, decorators, comments/docstrings, Unicode, CRLF, Python-2 syntax and parse failures. Differences must be explained as explicit production behavior changes, never normalized away. Package WASM/license assets now and resolve from the installed module location. If the chosen runtime cannot load reliably, stop this slice and revise the parser decision before integrating; do not add a Python prerequisite.## Human-runnable artifact@@ -23,19 +23,18 @@ already exist. CLI transcripts replace visual/screenshot gates for this product.## Verification and verdict-The merged Docker gate passes 16 Node parser conformance tests and the whole-CLI-HTTP comparisons for Python fallback, oversized declarations and TypeScript-comment expansion. The [parser conformance guide](../../../test/parser/README.md)-defines the reference version and coverage limits. Packaged runtime journeys-verify asset loading without Python, Bun or a compiler. These checks prove the-exercised inspection behavior, not universal grammar equivalence or downstream-task quality.+Earlier grammar conformance checks passed the exercised fixtures but missed+Python AST differences found by whole-product review. They do not establish+completion. Bundled CPython helper conformance passed the bounded probe; merged+production, lifecycle, installed-package and whole-product gates remain required.+The [parser conformance guide](../../../test/parser/README.md) owns executable+coverage. Neither parser comparisons nor package checks establish task quality.Assert source text and line coordinates, meaningful comments, bounded oversized units and fallback behavior. Inspect representative source from the saved official task trees without copying personal repos. Ensure no shell-out to python/Bun/compiler and no runtime asset download.## Delegated decisions-Pinned compatible grammar/runtime versions, extraction implementation and extra easy grammars using the same seam; record differences from the spike.+Pinned runtime packaging and isolation; preserve the original extraction helpers and record remaining interpreter-version differences.## Keep green