AdithyaSK's picture
AdithyaSK HF Staff
MiMo-V2.6-RL Terminal as Harbor tasks
5708f7d verified
|
Raw History Blame Contribute Delete
2.13 kB

You are an agent, your current working directory is /app.

You can use the tools available to you to interact with the computer to assist the user in completing tasks.

Repair independent LALR interactive-parser clones

The frozen Lark tree in /app/vendor/lark has a clone-ownership regression. Copying an InteractiveParser after partially consuming a source stream creates multiple lexer objects whose references do not agree. A clone may therefore consume the original parser's remaining input, or a superficially independent implementation may leave parser_state.lexer disconnected from lexer_thread.

Repair the existing implementation in both files:

  • /app/vendor/lark/lark/parsers/lalr_parser_state.py
  • /app/vendor/lark/lark/parsers/lalr_interactive_parser.py

Required behavior

  1. ParserState.copy(deepcopy_values=...) must create an independent lexer thread and independent parser stack while preserving its current shallow-versus-deep value-stack policy.
  2. InteractiveParser.copy(deepcopy_values=...) must use one coherent cloned lexer thread: the clone's parser_state.lexer must be the clone's lexer_thread, and neither may be the original parser's lexer thread.
  3. After partially consuming input, clone and original must both be resumable to the same complete parse tree in either execution order. Advancing either continuation must not change the other's cursor.
  4. Existing manual feed_token, exhaust_lexer, EOF, and ordinary LALR parsing behavior must remain compatible.

Do not replace the parser with a task-specific implementation, hard-code the sample streams, disable tests, or edit the supplied upstream test asset.

Validation and artifact

From /app/vendor/lark, run:

python3 -m compileall -q lark
python3 tests/test_parser.py TestLalrBasic.test_parser_interactive_parser -q

Then generate the required artifact:

cd /app
python3 tools/run_clone_matrix.py --output /app/repair_report.json

The artifact must use output_schema_version lark-clone-repair-v1 and the driver must report summary.all_cases_pass: true after the source repair.