Skip to content

fix(host-core): clarify Edit parse recovery - #2465

Merged
vastsa merged 5 commits into
vastsa:mainfrom
Linuxdazhao:fix/edit-dsl-diagnostics-2453
Nov 21, 2026
Merged

vastsa merged 5 commits into
vastsa:mainfrom
Linuxdazhao:fix/edit-dsl-diagnostics-2453

Conversation

@Linuxdazhao

Copy link
Copy Markdown
Contributor

Summary

  • Name concrete PUT / CUT / gap-insert replacements in malformed Edit op diagnostics.
  • Teach the tool prompt to reject empty PUT deletions and foreign patch/Markdown wrappers.
  • Add parser and tool-definition regression coverage, with matching spec and E2E documentation.
  • Preserve the existing DSL acceptance rules; no silent wrapper stripping or alternate edit mode.

Validation

  • cargo test -p host-core --locked tools::hashline::parse::tests — 5 passed.
  • cargo test -p host-core --locked tool_defs_advertise_the_scoping_parameters — 1 passed.
  • cargo fmt --all -- --check — passed.
  • cargo clippy -p host-core --all-targets --locked — passed with one pre-existing warning in transcripts.rs.
  • node scripts/check-pr-base-main.mjs — passed; origin/main is an ancestor of the head.
  • node scripts/e2e-smoke.mjs — 21/22 passed, 2 live-model checks skipped without an API key. The remaining E2E-fatal — revision not found also occurs on the unmodified main baseline (50b73f618).
  • cargo test -p host-core --locked — 1339 passed, 2 failed, 1 ignored. Both failures reproduce on the unmodified baseline and come from the local AIE plugin and login-shell PATH environments.

Known baseline result

The task-candidate smoke suite is not fully green because of the baseline revision not found failure described above; it is recorded here explicitly rather than claimed as passing.

Fixes #2453

Name concrete replacement operations in malformed Edit diagnostics and teach the model to avoid empty PUT and foreign patch wrappers. Keep the existing grammar and rejection behavior unchanged.

fixes vastsa#2453
@vastsa

vastsa commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Thanks — the diagnostics change is good, but there is one concrete defect in the Edit tool description in crates/host-core/src/tools/mod.rs:

The edited line now ends with \" instead of the original line-continuation \:

... a widened PUT that restates survivors. \"

That ends the continuation and inserts a literal " followed by a newline and indentation into the advertised Edit description. The new test only checks contains(...), so it passes anyway. Please restore the trailing \ (no quote). It would also help to assert that the description contains "survivors. All line numbers", so this cannot regress.

The new clause ended with an escaped quote instead of a line-continuation
backslash, so the advertised Edit description carried a literal `"` plus a
newline and indentation where the sentence should have joined. The existing
assertions used `contains` on fragments that straddled nothing, so the broken
join still passed.

Assert the joined text (`survivors. All line numbers`) so a dropped
continuation fails the suite.
@Linuxdazhao

Copy link
Copy Markdown
Contributor Author

Fixed in 2991afda7: the clause now ends with the line-continuation \\ again, so the Edit description joins into ... restates survivors. All line numbers ... with no literal quote or newline. The test asserts that joined text, which fails against the escaped-quote form, so the regression cannot come back silently.

Also merged origin/main into the branch to keep the Head contains latest base gate green.

Local checks: cargo fmt --all -- --check clean, cargo clippy -p host-core --all-targets clean, cargo test -p host-core 1353 passed with 2 failures that are pre-existing in this environment — tools::shell::tests::user_login_path_probes_a_real_path and plugins::tests::a_valid_id_cannot_take_over_a_legacy_plugin_stored_under_its_sanitized_name both fail identically on a pristine origin/main checkout.

@vastsa
vastsa merged commit e89051f into vastsa:main Nov 21, 2026
6 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.

[Bug] Edit ops DSL: ~5% of Edit calls fail on pure grammar, and the error text doesn't name the replacement form

2 participants