14 Commits
Author SHA1 Message Date
Matt Van Horn aa02511cc7 test(pipeline): expect Layout.__init__ for the #1548 constructor call
pipeline_python_init_function_shares_submodule_qn pinned the old Class
target for Layout("demo"). Layout defines __init__, so the constructor
call now lands on that method. The other tests that pin the contract
were moved in the previous commit; this one reached main afterwards.

Refs #1642

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-11-01 12:25:07 -08:00
Matt Van Horn 1b64c50c54 fix(python): resolve ClassName() calls to __init__
A Python construction call resolved to the Class node, so a user
__init__ never received a caller from ClassName(...) and the dead-code
view reported live constructors as unreferenced.

When the called name is the class itself, resolve it to the __init__
found on the class or, depth-first, its declared bases (the lookup
super().__init__() already uses), with a new lsp_constructor_init
strategy that joins the textual call site through its reason. Classes
with no user __init__ keep the Class target (lsp_constructor), as does
a builtins.* __init__. Calls through an instance (f = Foo(); f()) are
unchanged, since they dispatch to __call__.

This changes the documented Class-target contract for classes that
define __init__; the three tests that pinned it are updated.

Refs #1642

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-11-01 09:11:36 -08:00
Matt Van Horn 6bc7ade18c fix(mcp): log the server/discover connect probe as info, not an error
That call now passes false for the error argument when the method is
server/discover and true for every other unknown method, so the probe is
logged as level=info with status=ok while other misses stay level=warn
and status=error. The JSON-RPC response is still -32601 Method not
found. The new test server_handle_discover_probe_logs_info checks those
log fields, checks that unknown/method still logs a warning, checks that
an initialize request for 2026-07-28 still negotiates 2025-11-25, and
checks that resources/list still returns an empty resource list.

Fixes #2433

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-10-06 00:37:54 -07:00
Matt Van Horn 26eece514f fix(mcp): keep full width for a project's first index
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-10-02 14:03:59 -07:00
Matt Van HornandClaude Opus 5 9bfd5cbe60 fix: route the remaining all-core sites and fix the review findings
Addresses the four blockers from review:

- Capture the expected worker count while CBM_WORKERS is still unset in
  mcp_auto_index_in_process_uses_background_worker_policy, so the assertion no
  longer reads the lane override restored just before it.

- Give pipeline_background_policy_preserves_index_results a fixture past
  MIN_FILES_FOR_PARALLEL and drop any inherited CBM_WORKERS /
  CBM_INDEX_SINGLE_THREAD pin, so it really compares an all-core index against
  a headroom index instead of two sequential runs.

- Route the two remaining all-core sites through cbm_pipeline_worker_count:
  the LSP surface pass and incremental manifest hashing. The pipeline is
  plumbed into cbm_pipeline_build_semantic_manifest for that.

- Rename the hidden key _background to _cbm_background, matching the existing
  _cbm_index_policy convention, across every producer and consumer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Du315CaKLufAYPEdEwcocq
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-10-02 14:03:42 -07:00
Matt Van Horn 2443e92bec fix: preserve CPU headroom during background indexing
Fixes #1084

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-10-02 14:03:41 -07:00
Matt Van Horn 088fedb2d2 test(cli): restore suite activation runtime after recovery test
The markerless stale-rendezvous recovery test reset the activation runtime
parent to NULL instead of restoring g_cli_suite_runtime_parent, so every
later cli test ran the activation probe against the developer's real
/tmp/cbm-daemon-<uid>. Restore the suite value per the contract at
tests/test_cli.c:61-65 and the sibling at :1310.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-09-06 18:54:28 -07:00
Matt Van Horn 8e70590d16 fix: recover markerless stale rendezvous sockets during activation
Fixes #1760

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-08-31 05:49:20 -07:00
Matt Van Horn 3d4979ed64 feat: add auto-install support for the Junie agent
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-06-27 23:29:52 -07:00
Matt Van Horn 0714e46346 fix: address self-review findings — keep node_degree CALLS-only
cbm_store_node_degree backs the MCP get_code_snippet callers/callees
counts and the Cypher in_degree/out_degree virtual property, which are
deliberately CALLS-scoped. Restore it to CALLS-only and scope the
INHERITS/IMPLEMENTS broadening to cbm_store_search alone, which is the
search_graph surface issue #558 is about. Adjust the new tests so
node_degree assertions expect CALLS-only counts while the search_graph
result assertions expect the broadened structural degree.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-06-23 04:08:36 -07:00
Matt Van Horn 65b8425648 fix: count INHERITS/IMPLEMENTS edges in search_graph degree
search_graph reported in_degree/out_degree of 0 for Class nodes that
have real INHERITS edges, because the degree computation in both
cbm_store_node_degree (Cypher virtual properties) and cbm_store_search
(result population and min_degree/max_degree filter) only counted CALLS
(and USAGE) edges. A min_degree filter therefore silently excluded
well-connected classes.

Broaden the edge-type predicate in both surfaces to
IN ('CALLS', 'USAGE', 'INHERITS', 'IMPLEMENTS') so search_graph and
Cypher report the same edge-type-agnostic degree and stay consistent.

Add regression tests covering: a parent class with N INHERITS children,
combined CALLS+INHERITS degree without double counting, min_degree now
including inheritance-only classes, and isolated nodes still reporting
zero.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-06-23 04:08:36 -07:00
Matt Van Horn 44d5174511 fix: address review feedback on artifact export error surfacing
- Declare cbm_artifact_export_last_error() in artifact.h and drop the ad-hoc
  forward declarations in pipeline.c and test_artifact.c so there is a single
  shared declaration.
- Document that dump_and_persist_hashes now intentionally propagates a failed
  artifact export as a pipeline error (previously silently ignored), so the
  behavior change is recorded in-tree.
- Use MoveFileExA(MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH) for the
  Windows replace in write_file_atomic instead of unlink+rename; it replaces
  the destination atomically (credit @Ayush7Ranjan, from #492).

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-06-22 14:46:29 -07:00
Matt Van Horn 9f66e428f8 fix: resolve core.excludesFile only from user-owned global git configs
Drop the repo-local .git/config pass in resolve_global_excludes_path() so
an untrusted repo cannot point core.excludesFile at an arbitrary file (e.g.
~/.ssh/id_rsa) and have cbm open and read it merely by being indexed. git is
safe here because it only trusts a repo's .git/config after a deliberate
clone/init; the indexer has no such trust step. Global excludes now resolve
only from the user-owned ~/.gitconfig and $XDG_CONFIG_HOME/git/config. A
repo's own ignores remain handled by .gitignore / .cbmignore.

Add a guard test asserting a repo-local .git/config whose excludesFile points
outside the repo is ignored, not read.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-06-22 14:39:26 -07:00
Matt Van Horn 3975d7950d fix: honor git global core.excludesFile as an ignore source
Implements 2026-06-20-013-fix-global-core-excludesfile-ignore-source.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-06-20 18:48:47 -07:00