Skip to content

0.22.0: include completions accepted once in either mode (#80) and a session that keeps its engine starts (#86) - #85

Merged
Sunrisepeak merged 11 commits into
mainfrom
answer-routing-overslept
Nov 11, 2026
Merged

Sunrisepeak merged 11 commits into
mainfrom
answer-routing-overslept

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Carries the two test/CI fixes below (unchanged) and the 0.22.0 release on top of them. Release plan: .agents/docs/2026-11-11-0.22.0-release-plan.md.

#80 — the include completion's second quote, the half 0.21.0 left

clangd's include item takes the closing quote an editor auto-paired in its insert range only; its replace range ended at the cursor, so an editor accepting in replace mode (VS Code's Replace (Tab) — both reporters' editors, per their screenshots' hint bars) wrote the quote twice. Measured on the 0.21.0 payload, every include item had insert = [word, cursor+1) and replace = [word, cursor); accepting the latter on #include "common/numb produces #include "common/number-literals.hpp"", cursor between the quotes — character for character the reporter's 0.21.0 screenshots.

  • completion::balance_for_replace at the one egress every completion answer passes through (finish_job): where insert reaches past the cursor and replace ends at it, replace takes insert's end — both accept modes consume the editor's quote exactly once. Fresh answers and retargeted late answers alike.
  • The word cache keeps no include answer (WordKey carries the include line; the cache's one writer refuses it): its key ages by the file's text and cannot say when a header list changed, and a complete list is filtered client-side anyway. The late path stays on purpose — it is the engine's own answer, at most LATE_ANSWER_KEPT (5 s) old, and what fills the popup while the engine is cold or busy.
  • The no-engine fallback offers no identifiers on an include line (import lines already excluded).
  • The conformance client advertises insertReplaceSupport as VS Code does (without it clangd emits a single TextEdit and the asymmetry never appears — which is also why this was only visible in real editors), and a failed completion-item check now prints the item it held.

#86 — a session ran out of engine starts (Windows and Linux)

The sandbox's "out of memory" on a grant is not memory: openkal 0.20.0 keeps a fixed table of attenuated directories and never returns a slot (forget() keeps a root "until the program ends"), one slot per read-only grant per engine start. The reporter's Windows machine spent nine a start and the session's eighth start failed whole — granting C:/Program Files: out of memory, exactly the directory the 65th slot would have taken. The new engine-restarts conformance case then caught the same cliff on Linux during this release's own verification: eleven read-only grants a start (eight system roots, two package stores, the payload), the eleventh start failing with granting ~/.mcpp/registry/data/xpkgs: out of memory — the table is every implementation's, not Windows' alone.

  • No system is granted blanket roots any more (C:/Program Files and kin on Windows; /usr and seven more on a Linux box): the plan already names each toolchain (flags, the compiler's installation, the MSVC/SDK roots mcppls injects); a compiler named by a bare name resolves through PATH; mcppls.grants adds anything a probe failed to name.
  • Read-only grants beneath one directory merge into it — always, on every host (each costs a table slot a start) — never into a volume root (/, C:/) or the person's home (~/.vscode and ~/.mcpp share only ~): guards the old over-16 merge lacked. A start now spends two or three slots; a session holds an order of magnitude more starts.
  • A start still refused with granting … out of memory says so in numbers (starts spent, grants each — the message was verified against a real Linux failure during verification) and names the recoveries: restart the editor, or mcppls.grants: ["all"].
  • The durable fix is upstream (openkal recycling slots, or mcpplibs.os reusing attenuated handles) and lands as a pin bump when it exists; this holds the line regardless.

Tests and verification

  • Unit (615 cases, 44 programs, all green locally): the balance rule on the measured item shapes; the include flag; the bare-name resolver; the merge and its volume-root guard; Windows' empty system roots.
  • Conformance: inferred gains C8-include-replace-takes-the-editors-quote (the reporter's exact keystrokes, asserting replace.end == insert.end); completion-templates and completion-keywords unchanged and green.
  • End-to-end against a locally built server over the released payload: 11 keystroke steps (#include ", letters, render/pass/, common/numb …) — every served item balanced; on stock 0.21.0 the same steps show replace = cursor, insert = cursor+1.
  • mcppls-devtools check all, version --check (every component 0.22.0, one series), the settings reference and its zh-CN mirror re-rendered, CHANGELOG entry [server 0.22.0].

The two original fixes of this branch (unchanged)

  • answer routing/where the engine answers within its budget, a kept list waits for it a little past its pace measures the time since the request and skips, saying so, when the runner slept past 740 ms (a loaded Windows runner overslept the check's own sleep on main's run 42712814292).
  • A second attempt of a conformance row runs only the failed cases (mtest run --failed); the zip check requires bundles only when diagnostic-bundle ran in that attempt.

Closes #80. Mitigates #86 (the durable fix is upstream; see the plan's §3.4).

…sed it

The case sleeps for real (0.5 s, then 0.15 s) and checks that the kept list waits 150 ms past the
engine's pace. A loaded Windows runner overshot the first sleep past that wait (main 42712814292,
unit tests win32-x64 openkal), and the check then said nothing about the wait. The case now measures
the time since the request and is skipped, saying so, when the runner slept past it.

Co-authored-by: speak-agent <[email protected]>
@Sunrisepeak
Sunrisepeak force-pushed the answer-routing-overslept branch from 65793af to 45e63ef Compare November 10, 2026 00:46
…gnostic-bundle's bundles

A second attempt of a conformance row runs only the cases that failed (mtest run --failed); a
diagnostic-bundle that passed in the first attempt does not run again, and the zip check found no
bundle and failed the row. The rerun now states itself (CONFORMANCE_FAILED_ONLY), and the check
requires bundles only when diagnostic-bundle ran in that attempt.

Co-authored-by: speak-agent <[email protected]>
@Sunrisepeak Sunrisepeak changed the title tests: a kept list's wait is checked only while the clock has not passed it tests: answer-routing's oversleep and the conformance rerun's bundle check Nov 10, 2026
…and a Windows session keeps its engine starts (#86)

- completion: an include item's replace range takes the editor's auto-paired
  closing quote as its insert range does (balance_for_replace at the one
  egress every completion answer passes); the word cache keeps no include
  answer (a header name is not a word its key can age); the no-engine
  fallback offers no identifiers on an include line. The conformance client
  advertises insertReplaceSupport as VS Code does, and a failed
  completion-item check prints the item it held.
- grants: Windows names no system roots (the plan names each toolchain; a
  compiler named by a bare name resolves through PATH), read-only grants
  beneath one directory merge -- never into a volume root -- always on
  Windows where each costs a sandbox table slot per start, and a start
  refused with 'granting ... out of memory' says what spent and what
  restores it.

Co-authored-by: speak-agent <[email protected]>
@Sunrisepeak Sunrisepeak changed the title tests: answer-routing's oversleep and the conformance rerun's bundle check 0.21.1: include completions accepted once in either mode (#80) and a Windows session that keeps its engine starts (#86) Nov 10, 2026
Sunrisepeak and others added 8 commits November 11, 2026 06:11
… anywhere, and a restart-loop conformance case

The engine-restarts fixture caught what the bundles could not: a Linux session's
eleventh start failed the same way the reporter's Windows eighth did -- the
attenuating table openkal never returns a slot of is every implementation's,
and a Linux box was spending eleven read-only grants a start (eight system
roots, two package stores, the payload). system_roots() is now empty on every
system (the plan names each toolchain; a bare compiler name resolves through
PATH; mcppls.grants adds the rest), the read-only merge runs on every host, and
its ancestor may be neither a volume root nor the person's home. The fixture
restarts the engine eight times over and expects an answer after each.

Co-authored-by: speak-agent <[email protected]>
A server patch (docs/92-release.md "Versions") moves the server past the
plugin's own version; the regression asserted they were equal and failed on
server 0.21.1 with the plugin at 0.21.0. It now expects what mcpp.toml names.

Co-authored-by: speak-agent <[email protected]>
…arries

The zip carries the server this repository builds; a server patch moves it past
the plugin's own version (docs/92-release.md), so pluginVersion was the wrong
default. mcpp.toml's version is the one the payload names.

Co-authored-by: speak-agent <[email protected]>
Removing them degraded a real macOS kit project: the driver finds the SDK and
the system frameworks by its own convention and no command names them, so the
blanket there is the only cover until the plan's 3.4 (the platform's own table)
or flag-naming. Windows and Linux keep the narrowing -- their conformance
suites pass without any root -- and the restart-loop fixture runs where the
fix is, not on macOS.

Co-authored-by: speak-agent <[email protected]>
xmake-basic reproduced it locally: scanning a toolchain's std.cc fails at
features.h -- the GCC driver adds /usr/include to every compile whatever the
flags say, so it is the one root a Linux start truly needs (eight became one;
Windows keeps none, macOS its conventional list). xmake-basic, xmake-no-
standard and mcpp-emit pass against this build, as do the restart loop and the
inferred fixture; the unit suite is 615/615.

Co-authored-by: speak-agent <[email protected]>
The server fix and the plugins it ships with are one release: every component
0.22.0. Dependencies are untouched (openkal-platform 0.21.1 stays).

Co-authored-by: speak-agent <[email protected]>
@Sunrisepeak
Sunrisepeak force-pushed the answer-routing-overslept branch from ca79c2f to febc8ac Compare November 11, 2026 02:11
@Sunrisepeak Sunrisepeak changed the title 0.21.1: include completions accepted once in either mode (#80) and a Windows session that keeps its engine starts (#86) 0.22.0: include completions accepted once in either mode (#80) and a session that keeps its engine starts (#86) Nov 11, 2026
@Sunrisepeak
Sunrisepeak merged commit 9e31bf6 into main Nov 11, 2026
92 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.

Extraneous quote in include completion

1 participant