Skip to content

landing: batch K (task descriptors, disk-limit walks, deleted-root language servers, inspect lease, Swift syntax) - #634

Queued
aft-alfonso[bot] wants to merge 17 commits into
mainfrom
land/batch-1020k
Queued

aft-alfonso[bot] wants to merge 17 commits into
mainfrom
land/batch-1020k

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Landing batch of settled worker fixes, each reviewed and verified before settling:

  • mason: bound descriptors retained by bash task history
  • Word the task descriptor release note for users
  • mason: reduce disk-limit walks and health census churn
  • Word the disk-limit release note for users
  • mason: reap language servers when project roots are deleted
  • Word the deleted-root language server release note for users
  • mason: allow an initial inspect lease attempt after slow preparation
  • mason: retry merge-queue PR association lookup
  • mason: report unconfirmed created Swift syntax as unknown
  • mason: retry transient Swift compiler discovery
  • mason: tolerate in-flight Windows replacement in frozen LSP test

Summary by cubic

Lands a batch of settled worker fixes, each reviewed and verified before settling. Adds user-facing release notes for the behavior changes.

Bug Fixes

  • Finished and recovered background commands no longer keep a folder handle open each, so a long command history can't exhaust the daemon's open-file limit.
  • Language servers started for a project shut down as soon as the project folder is deleted, instead of running until the idle timeout (fixes Standalone AFT keeps language servers running after the project root is deleted #631).
  • aft_inspect no longer reports a writer-lease timeout when slow cache preparation exhausts the retry budget but no other process holds the cache.
  • A new Swift file reports its syntax check as unknown, not invalid, when the compiler check times out or fails transiently; transient compiler discovery failures are retried.
  • Merge-queue PR association lookup retries transient empty responses instead of failing the run.
  • A temporary filesystem failure in the root-presence check no longer disables file watching for that root.

Performance

  • The disk-limit background check reduces re-measurement of unchanged folders by about 94%, and the health summary does less work per tick.
  • Health census rendering now moves prebuilt root JSON instead of reserializing, cutting CPU per tick.
  • Semantic view fills reuse verified resident chunk vectors so one-file edits avoid SQLite payload reads, and same-epoch touches skip the write transaction entirely.

Written for commit 1cf4900. Summary will update on new commits.

View guided diff Turn on auto-fix

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues remain.

Summary

This batch reduces retained task handles and repeated disk work. It also shuts down language servers for deleted projects, improves inspect lease acquisition, and reports unfinished Swift checks as unknown.

  • Disk-limit checks reuse unchanged file sizes between walks.
  • Semantic fills reuse verified chunk vectors and skip unneeded writes.
  • Deleted project roots now trigger language-server cleanup.
  • New Swift files show unknown syntax when checks cannot confirm them.
  • Background task history no longer keeps a folder handle per command.
  • Health summaries reuse unchanged rows and report rollup timings.
  • Inspect cache opening makes its first lease attempt after slow preparation.
  • Merge-queue lookup retries empty PR results and checks the final queue ref.
  • Windows test helpers tolerate file replacement and slower actor startup.

The ancestry checks did not pass, so the full PR diff was reviewed as the changes since the previous review.

Reviews (4) · Last reviewed commit: "mason: correct Batch K cross-platform re..." · Reviewed by Greptile

Comment thread crates/aft/src/context.rs Outdated
@ualtinok
ualtinok added this pull request to the merge queue Oct 20, 2026
Any commits made after this event will not be merged.
@ualtinok
ualtinok removed this pull request from the merge queue due to a manual request Oct 20, 2026
ualtinok added a commit that referenced this pull request Oct 20, 2026
Replace the obsolete Windows task-folder pinning assertion with the DirectorySnapshot identity contract: swaps must be refused even though renames are allowed. Recreate the full replacement layout so a missing directory cannot mask a bypassed identity check.

Let the fake LSP leave its project cwd before initialization, preserving native Windows deleted-root teardown coverage. Use platform-native relative paths for semantic chunk seeding and lookups; the resident shortcut already works on Windows (362 hits and 4 gets versus 366 gets without it).

Assert stale backend census mappings before response budgeting and independently prove that a bounded response may omit both details. The former test incorrectly treated root_count as a guarantee that detail rows survived process-wide payload pressure. Add deterministic budget pressure instead of timing-dependent load.

Verified Linux and native Windows scoped suites, 30 Linux health repetitions, Windows cross-compile with warnings denied, and five isolated native Windows mutation reds followed by clean restoration. (#634)

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 20, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 20, 2026
ualtinok and others added 17 commits October 21, 2026 00:35
Store verified directory identity snapshots instead of open handles in both artifact-owner and bundle-read caches. Reopen with existing no-follow checks per access; keep running task pins unchanged. Release adopted-process exit monitors at terminal cleanup.

Add an isolated Linux /proc/self/fd regression for 520 finished/replayed tasks, passing at soft limit 1024. Preserve cache eviction/cleanup assertions while naming descriptor-free cached records accurately. Directory identity, foreign-session, directory-retention and monitor-release mutation controls each reddened their named tests.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Reuse immutable v1/v2 generation sizes across publication using readdir inode identity and cache stable-directory totals; keep mutable files and reconciliation fresh. Mixed publication fixture drops from 5,514-5,640 to 312 metadata calls per enforcement with eviction parity.

Time rollup phases and debug-log once per minute. Keep detailed timing in the uncapped census, not the budgeted health reply: the existing stale-backend root test exposed root-detail displacement in an initial implementation. Cache only rendered census inputs and move prebuilt root JSON; counted mutation controls defend each saving. At 110 roots census rendering measured 7.493 -> 3.334 CPU ms/tick. Existing tests retain their contracts.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Handle issue #631 before ordinary root-presence admission while retaining bound/current-generation checks. Keep generation-scoped retry demand after dropping the watcher, invalidate initializing clients even when none are published, and reap detached clients outside the manager lock. Log the root and server count once per cleanup.

Cover standalone running and initializing children, busy-manager and watcher-lock retries, unbind, recreation, and idempotence. Subc already shuts down servers on route-scoped actor retirement; add a fake-server regression proving that without the orphan sweep.

The existing binary deletion-control test sent RootDeleted while its directory still existed. Delete the fixture directory before sending the event so its unchanged assertions test actual deletion; stale events for existing/recreated roots must not trigger teardown. Add the release-note credit to @chrisolszewski.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
An absolute retry deadline could expire before the first filesystem lock attempt, falsely reporting contention on an unowned cold inspect cache. Admit that first attempt without restarting or relaxing subsequent contention retries.

Add a deterministic slow-preparation regression and preserve the held-lease deadline/epoch assertions. The existing expired-preparation expectation changes from zero to one attempt intentionally; no extra sleep or writer takeover is permitted.

Verified Linux and native Windows lock/cache/fallback, binary inspect, and tsconfig integration tests; Linux compiler and warning-denied Windows target checks. Mutation controls independently reject the original false-timeout behavior and a restarted retry budget.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
A Swift tree-sitter rejection needs compiler confirmation for a new file. Timeout, discovery failure, signal termination and abnormal compiler failure now leave the verdict unknown with syntax_skipped_reason and no syntax_error_line. Preserve conservative rollback for existing files and propagate the reason through write, append, patch metadata and agent-facing text.

The native integration test previously required compiler success inside the production five-second budget. It now accepts an explicitly explained unknown outcome; deterministic injected tests still require true for compiler acceptance and false for a confirmed syntax rejection, and a separate macOS native test requires acceptance under the existing generous test-only guard. The old missing-compiler created-file expectation intentionally changes from invalid to unknown.

Verified Linux compiler diagnostics, Swift/created-file regressions and binary tests. Mutation controls restored timeout-to-invalid fallback and removed the rendered unknown notice: each named guard failed while the definite-answer control passed, then all six created-Swift tests passed after restore. Native swiftc checks remain for macOS.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Cache only a found absolute compiler path or definitive absence. xcrun timeout, spawn failure, signal termination, truncated/invalid output and other transient lookup errors leave discovery retryable. Preserve distinct lookup outcomes through parsing so a timed-out discovery reports unknown without poisoning later confirmations.

Restore the established tree-sitter verdict and error line when swiftc is definitively missing, including the original created-file test row. Missing installation is not an unfinished compiler check. Shorten the release fragment to one plain sentence.

Injected discovery tests cover timeout then successful lookup/compiler confirmation, successful-path reuse, definitive-negative caching, and transient retry. Portable xcrun outcome tests cover nonzero/empty output versus timeout/spawn/termination failures. Before-fix tests failed for both poisoned-cache recovery and missing-compiler compatibility. Mutation controls cached transient lookup failures and changed Missing back to unknown: each targeted guard reddened while its positive control stayed green; all 24 Swift tests passed after restore. Native macOS compiler/discovery follow-up remains required.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Index only validated chunk-row vectors with weak, bounded handles; legacy file payloads can contain independently chosen floats and must not seed this index. Share verified allocations with file runs so unchanged chunks survive one-file edits without payload reads. Keep existing unchanged-file generation reuse and count semantic I/O at production sites.

Same-epoch touch already avoided row updates; now skip the write transaction too. Update large_semantic_materialization_batches_pins_and_touches from one transaction to zero because freshly stored keys need no writer, retaining the pin-byte and blob-identity assertions.

Measured 300-chunk one-line edit: 366 gets and 127960 payload bytes without shortcut, 4 misses and zero payload bytes with it; canonical file payloads match cold rebuild. Repository-linked fixture: one-file edit 26 gets/79940 bytes -> 4/0; ten-file edit 312/1014310 -> 32/0; no-change zero reads/writes. Three restored mutations reddened resident-key, incremental-content, and same-epoch writer guards.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
On a loaded Windows runner, actor startup alone exceeded the 1 s bound and the
test failed in #624's merge-queue run. In the opening case the database never
finishes opening, so a refusal that waited for it would still hang past 15 s.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
…ate a test-only probe

memory() reports the chunk table's allocated capacity, and HashMap::retain
keeps that allocation, so an arena whose views were all released still
reported 784 bytes. The deleted-root probe seam is only called from Unix
tests, and Windows CI denies dead code.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Replace the obsolete Windows task-folder pinning assertion with the DirectorySnapshot identity contract: swaps must be refused even though renames are allowed. Recreate the full replacement layout so a missing directory cannot mask a bypassed identity check.

Let the fake LSP leave its project cwd before initialization, preserving native Windows deleted-root teardown coverage. Use platform-native relative paths for semantic chunk seeding and lookups; the resident shortcut already works on Windows (362 hits and 4 gets versus 366 gets without it).

Assert stale backend census mappings before response budgeting and independently prove that a bounded response may omit both details. The former test incorrectly treated root_count as a guarantee that detail rows survived process-wide payload pressure. Add deterministic budget pressure instead of timing-dependent load.

Verified Linux and native Windows scoped suites, 30 Linux health repetitions, Windows cross-compile with warnings denied, and five isolated native Windows mutation reds followed by clean restoration. (#634)

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 20, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026
@ualtinok
ualtinok added this pull request to the merge queue Oct 20, 2026
Any commits made after this event will not be merged.
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.

Standalone AFT keeps language servers running after the project root is deleted

1 participant