You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8a3b8d4
Browse filesBrowse the repository at this point in the historyBrowse files
Six independent keys are an honest interface and a poor default. An operator
who only wants indexing to stay within reason has to learn all six, choose a
value for each, and keep them consistent as the machine changes.
Add index_resource_profile, accepting off, balanced or strict. Balanced
guards the host: it lets an index use what the machine can spare and stops a
runaway worker before the host is exhausted. Strict holds indexing to the
daemon's own budget, so a repository that needs more fails fast and
attributed instead of finishing at the host's expense. Any individual key,
including an explicit off, replaces that dimension of the selected profile,
so a profile is a baseline rather than a lock.
The balanced worker ceiling is derived from detected host memory instead of
being tabled. Large-repository indexing peaks in the tens of gigabytes, so
any round number low enough to feel safe would reject repositories that index
successfully today. When host memory cannot be read, balanced falls back to a
fixed floor.
Profiles also bound directory count, entry count, traversal depth and
discovery time. These have no individual keys for the same reason as the
storage internals: they are only meaningful inside a composed decision. The
resolved profile travels through the same trusted worker contract as the
individual limits, so every entry point enforces the same decision.
That contract now also carries the resolved profile and the override mask, so
the shell fixture standing in for the supervisor sends both.
The coverage that proves a forged policy cannot fork a second job asserts
that an explicit request joins the auto-index job already running for the
same root, and that assertion found the join broken on Windows. A project
root reaches the daemon through the platform canonicalizer, which answers in
backslash form there, while every tool handler normalizes the separators of
the path it canonicalizes. One directory therefore had two spellings, and
they met in comparisons that are exact: whether an index request may join the
running job, and whether a watch is still live for that root. Both were
wrong on Windows, in opposite directions, so aligning either one alone moved
the failure rather than removing it. The session context now stores the
normalized spelling, and the daemon canonicalizes project roots through a
single function that normalizes on the way out.
Only the storage side is directly assertable off Windows, since separators
are folded on every platform; the watch-liveness side is held by the existing
watcher-ownership tests, which is where the second half of this surfaced.
Signed-off-by: 刘冲 <mail@liuchong.dev>
0 commit comments