Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 10.4 KB

prior-art.md

File metadata and controls

55 lines (36 loc) · 10.4 KB

Related implementations

Streaming execution already has direct precedents. This prototype focuses on an append-only Python boundary contract, original-source provenance, top-level await, and explicit terminal state. The comparisons below describe inspected versions; they are not claims about every version or benchmark results for this project. External implementations were inspected without installing or executing them, and no implementation code was copied.

The partial family

The family suggests keeping provisional display separate from committed effects:

Reference Useful idea and boundary
partial-json-parser API Separates value parsing from string completion. Allow controls incomplete values; fix separates retained text and synthetic suffix. This motivates complete() and its display-only permissions.
partial-tsx Tracks original-source provenance; continuation handling retains pending control structures. Display exceptions for JSX or function shells do not authorize Python effects.
partial-react Separates scheduling, compilation and committed rendering. A renderer can coalesce updates; an executor must preserve accepted source order and must not replay effects.
partial-vue Structural directives wait for a real closing quote: a temporarily valid expression can still change. Python statements likewise need actual boundary evidence.
partial-svelte Documents limitations of state preservation through internal compiler-generated APIs. The Python parser delegates final syntax acceptance to the host compiler.
partial-solidjs Preserves visible output and reactive state across updates. Such restoration cannot undo a Python operation's external effects.

The inspected JSON revision is e0aa5e2ec52ed81c2c5d7692d5fe81d01c4b0bc6, with an MIT license. Renderer references are pinned to GenUI revision e960b17a460e7ddf7f03045c2a67aabbf5f79f67; this audit does not establish a standalone license for those in-repository packages. Preview design describes the resulting API in more detail.

EAGER / StreamExec

Executing as You Generate, arXiv 2604.00491v2 (22 June 2026), describes AST boundary detection with lookahead, persistent execution, dynamic batching, gating and optional early error interruption. This is directly related prior art. Batching is useful when interpreter invocation has meaningful overhead; its benefits need measurement for a particular host.

The inspected public artifact is an earlier version, published 27 March 2026: EAGER-main.zip, MD5 f441473c12c18fd106eb80926059ec75. It has no Git commit metadata. The archive's LICENSE:1–21 is MIT, copyright 2026 EAGER Authors; the deposit metadata separately labels the deposit CC BY 4.0. Paper and artifact dates differ, so implementation differences below should not be read as an audit of the later paper's implementation.

Useful source locations within that archive:

Location Inspected behavior
eager/parser.py:117–172,289–344,397–433 Uses code.compile_command and ast.parse on pending physical lines. Compounds wait for a later parsed statement or finalization. It reparses the growing pending source, and receives lookahead through complete LF-terminated lines.
eager/parser.py:446–473; eager/consumer.py:303–324 Invalid/incomplete EOF becomes a chunk carrying parse_error; the consumer records and excludes such chunks from executable batches.
eager/consumer.py:62–133,479–516 Coalesces available chunks, with optional size/delay limits and halt/continue error policies.
eager/executors.py:17–46,50–85,152–207 Shared namespaces in local threads or a persistent subprocess. The subprocess has its own timeout/kill mechanism. Plain compilation does not enable top-level await or retain future flags across subprocess requests.
eager/pipeline.py:41,94–125 Disables rewriting by default, gathers producer/consumer, then runs a separate full-program baseline: this entry point is an experiment harness.
eager/parser.py:26,48–50; eager/rewriters.py:101–117,139–173 Direct parser construction instead enables an if-chain rewriter by default. It injects bookkeeping globals and fixed-indentation source.

Our contract deliberately avoids that rewriting, retains native exceptions, and makes EOF, abort and failure explicit. The examined artifact's runtime-error halt marks later chunks skipped while generation continues; its timeout path cancels both tasks (clean_benchmark/runtime.py:310–351). The later paper describes additional gating and interruption behavior that should not be inferred from these older paths.

Static inspection also highlights why source reconstruction alone cannot prove general module equivalence: compiler flags, module docstrings and compilation context survive differently across separate exec calls. See our semantic limits. The archive contains benchmark runners and an overhead experiment (scripts/test_exec_overhead.py); no dedicated parser unit/property suite was found. None of its reported benchmark results are results for partial-python.

Playbooks

Playbooks contains a direct streaming Python executor integrated with agent call frames. Inspected revision: 1f6ee0cc760f245aa3af262b0fd0e6d0d70060f8; MIT license, copyright 2024 Playbooks AI.

  • CodeBuffer finds a parsable prefix using physical newlines and indentation. Its markdown stripping and $variable preprocessing serve that host's language, rather than exact Python-source preservation.
  • add_chunk executes parsed statements and records errors. Await handling wraps a statement in an async function, then copies selected locals into the agent frame. Partial-python instead uses native top-level-await compilation and one namespace.
  • Tests exercise variable persistence and mixed sync/async work. Host-specific safety-filter tests intentionally permit skipping some source statements, unlike this project's execution contract.

Static counterexamples help define our regression requirements: else: must not close and emit the preceding if; a final suite needs explicit EOF handling; x = x + await foo() must keep module scope; and successful statements before a later failure need individual provenance. At the inspected revision, CodeBuffer:95–102 can select the prefix before else, finalize only retries the normal buffer path, and the prefix journal updates after the entire parsed statement loop succeeds. These are source-derived observations, not execution results from that project.

Partial expression parsing

vLLM's make_valid_python completes streaming tool-call expressions and returns completed text plus an added suffix, or None. The inspected revision is b8c04dd3b455affd8d91f0ab436b815491c9af38; the file declares Apache-2.0. It can strip trailing whitespace/comma and synthesize delimiters; it also rejects synthesized sets that could really be incomplete dictionaries. This is useful preview prior art, with a different contract from executing committed original Python.

Python's codeop supplies complete/incomplete/error classification and a stateful compiler that remembers future directives. That is useful machinery, but temporary syntactic completeness does not establish append stability. Parso supplies error recovery and optional incremental reparsing; recovering a syntax tree likewise does not authorize irreversible execution.