Repository navigation
Description
Describe the bug
This issue was discovered while implementing and running local validation for #1789 (compact continuity hints). It affects the existing native code indexing implementation and is independent of the continuity-hint feature. The compatibility fix will be submitted in a separate PR.
The native code indexing capability (powercontext.builtin.code, RFC 1708 Native Git Code Understanding) starts an isolated parser worker. On the affected revision, the worker unconditionally sets an address-space limit at the beginning of run():
def run(manifest_path: Path) -> None:
import resource
job = json.loads(manifest_path.read_bytes())
memory = job["memory_bytes"]
resource.setrlimit(resource.RLIMIT_AS, (memory, memory))In the reproduced macOS environment, this call fails with:
ValueError: current limit exceeds maximum limit
The worker's entry point catches ValueError and exits before emitting any progress line. The parent reads EOF from the worker's stdout, receives no completed files, and raises CodeError("code_parser_failed").
The parent reports the worker's startup failure as the generic code_parser_failed, without exposing the underlying memory-limit initialization error. The worker's stderr is also discarded by process._batch.
As a result, index or sync operations that need to start a parser worker fail before parsing begins. They publish no new index and preserve any previously published index. Operations that reuse cached facts or have no parsing jobs may not trigger the failure.
Steps to reproduce
On macOS, using the affected revision:
-
Install the code extra:
uv sync --extra code
-
Configure a repository binding and Scope in the environment file, with supported source files that require parsing, then run:
uv run powercontext code index --scope scp_demo --env-file <env-file>
The build fails with
code_parser_failed.
The underlying failure can also be reproduced without PowerContext:
import resource
limit = 1024 * 1024 * 1024
resource.setrlimit(resource.RLIMIT_AS, (limit, limit))
# ValueError: current limit exceeds maximum limitThe native code tests gate on POSIX rather than excluding macOS. Running the following on the affected revision exercises the failing parser startup path:
uv run pytest tests/builtin/test_native_code.pyExpected behavior
Native code indexing should work on macOS with an enforced and documented memory budget. Memory-limit failures should preserve the previously published index and report failure without claiming successful structural coverage.
If macOS local indexing is intentionally unsupported, it should fail early with a clear platform error, and the documentation and test gates should reflect that decision.
Actual behavior
Parser-dependent builds fail with the generic code_parser_failed because the worker cannot initialize its address-space limit. No new index is published, and the underlying ValueError is not surfaced.
The user-facing documentation describes macOS local indexing as unverified. This issue identifies a concrete failure in that unverified path; the POSIX test gate alone is not a claim of macOS support.
Environment
- PowerContext version: 1.2.0; affected revision:
4abc42332ffeb86338e65b0e682ab207c03b9917 - Python: 3.13.12
- OS: macOS (
darwin) - The
codeextra is installed, including Tree-sitter and grammar packages. - The isolated
RLIMIT_ASfailure was also reproduced locally with Python 3.12.14 on macOS / Apple Silicon.
Are you willing to submit a PR to fix this bug?
- Yes, I would like to submit a PR.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity