Commit Graph
5000 Commits
Author SHA1 Message Date
Martin Vogel dad89184cb fix(cs-lsp): look up the global namespace in C# spec order
C# looks a simple type name up namespace by namespace, innermost outward.
At each namespace N it checks the members of N, then the usings of the
namespace declaration enclosing the reference. The global namespace is
the last N, and its declaration is the compilation unit. So a type
declared without a namespace hides a type that only a compilation-unit
`using` imports, while a `using` inside a namespace body still wins over
the global namespace. Step 8b used to rank every using before the global
namespace.

- CBMCSUsing records whether a directive sits inside a namespace body
  (in_namespace). cs_collect_imports tracks it per node, including the
  compilation-unit siblings after a file-scoped namespace; the cross-file
  entry pre-loads the pipeline import list without placement and the AST
  walk upgrades it.
- cs_visible_namespaces ranks a simple name as: enclosing namespaces
  innermost outward, namespace-body usings, the global namespace "", and
  last the compilation-unit usings.

Ranking the global namespace that high also requires that only a type
proven global claims it. The vendored grammar does not parse a
`ref partial struct` with members, and error recovery dissolves the
enclosing namespace, so every type after it in that namespace surfaced
with no namespace. Mapped to "" those types outranked the real, imported
declaration: on dotnet/runtime 5,313 CALLS moved from implementation
files into reference assemblies (System.Runtime.cs, which declares
DefaultInterpolatedStringHandler as a `ref partial struct`).
cs_type_decl_namespace now returns "" only when the compilation unit
parsed without errors and NULL (unknown, invisible to step 8b, as on
main) otherwise; cs_top_level_namespace passes that through.

Tests:
- parallel_csharp_nested_type_and_global_namespace_binding: the
  compilation-unit `using` probe now expects the global type (spec), and
  a new namespace-body `using` probe expects the imported one. RED with
  the previous order: cu_using=0/0.
- parallel_csharp_parse_damaged_namespace_is_not_global (sequential and
  parallel). RED without the clean-parse rule: real=0 no_damaged=0 on
  both paths.
- cs_lsp::cslsp_decl_namespace_global_needs_clean_parse: extractor
  contract ("" for a clean global type, the namespace when found, never
  "" after a parse error).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 01:12:46 +01:00
Martin Vogel bc44de15d3 fix(cs-lsp): bound the nested-type qualifier walk
Resolving a qualified type name A.B that no namespace binds now resolves
the qualifier A as a type first (nested types). A using alias whose target
is qualified by the alias itself re-enters that walk through the alias
step without end: `using Loop = Loop.Inner;` resolves Loop to the target
Loop.Inner, whose qualifier is Loop again, and a mutual pair (`using
Ping = Pong.Inner; using Pong = Ping.Inner;`) cycles the same way. Both
are legal C# when namespaces of those names exist, and the walk overflowed
the stack on them.

The walk now carries a depth counter in the per-file context and stops
after CS_QUALIFIER_MAX_DEPTH (8) levels. One level is one type-nesting
step: a namespace-qualified top-level type binds without recursing, so
real nesting stays far below the bound.

Test: cs_lsp::cslsp_cyclic_alias_qualifier_terminates (self and mutual
alias cycles; the file must still resolve Svc.Go). RED without the bound:
AddressSanitizer stack-overflow, exit 134. GREEN with it.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 01:07:37 +01:00
Martin VogelandErsin Tarhan c0a8ed8b93 fix(cs-lsp): resolve nested types through type qualifiers, bind global-ns types
Follow-up to #2347 (issue #2120). Step 8b binds same-name TOP-LEVEL types
by declared namespace, but two shapes still fell through to the short-name
fallback, where the prefix score against a path-derived QN is 0 for every
variant and registration order decided:

1. A qualified A.B whose qualifier A is a TYPE, not a namespace:
   new Command.Result(...) and new Grain.Handler(dep).Handle(...).
   cs_visible_namespaces only tried A as a namespace, and nested types
   carry no namespace_qn, so the scan never had a candidate. Resolution
   now falls back to resolving the qualifier as a type (recursively, one
   segment shorter) and binding the nested member through the registry.

2. A top-level type with no namespace declaration (global namespace):
   cs_top_level_namespace returned NULL for it, making it invisible to
   step 8b. Top-level C# types now register namespace_qn "" and
   cs_visible_namespaces appends the global namespace last.

Test: parallel_csharp_nested_type_and_global_namespace_binding covers a
nested-type constructor and the member call on its result, a chained
constructor receiver, and a same-name type split across the global
namespace and an imported namespace, in the sequential pipeline and in
the parallel pipeline with the production Tier-2 C# registry. Decoys are
registered first. Adapted to current main: the two constructor-edge
checks gate the parallel path only, because the sequential constructor
edge is still drawn by the textual constructor carrier, a layer this
change does not touch.

Distilled from #2401: the net change of commits d11be54f and 613060ea.
The temporary debug prints added in d11be54f and the stale copy of #2347
the branch carried (already on main as 50d19f85) are not taken.

Co-authored-by: Ersin Tarhan <ersintarhan@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 01:07:01 +01:00
Martin Vogel c07cb8e4a9 Merge pull request #2864 from DeusData/fix/adr-sidecar-followups
fix(store): ADR sidecar follow-ups from #2315 review
2026-10-31 23:07:36 +01:00
Martin Vogel af4121616e Merge pull request #2833 from divakantpandey/fix/2671-agent-config-symlinks
fix(cli): recognize symlinked agent config directories during detection (#2671)
2026-10-31 22:07:33 +01:00
Martin Vogel a6d0d6c9bb Merge pull request #1936 from ilyabrykau-orca/fix/go-field-type-hint-owner-segment
fix(pipeline): bind field_type_hint by owning QN segment, not substring
2026-10-31 21:28:06 +01:00
Martin Vogel 2acbd3b028 fix(store): ADR sidecar follow-ups from #2315 review
Three small items promised in the #2315 review; behaviour is otherwise
unchanged.

1. A failed ADR restore on artifact import is no longer silent
   (src/pipeline/artifact.c). The import dropped both a failed reopen of
   the installed DB and the status of
   cbm_store_adr_restore_from_graph_if_absent, so a team ADR that never
   reached the sidecar left no trace. The restore moves into
   artifact_import_restore_adr, which logs
   level=warn msg=artifact.import err=adr_restore detail=<store error>
   path=<db> on either failure. The import still returns 0: the graph DB
   is already installed when the restore runs, and the restore stays
   best-effort as documented. adr_restore_if_absent now sets the store
   error for its begin, copy and commit failures, so the logged detail
   names the failing step.

2. The doc comment of adr_copy_legacy_once sat above adr_copy_rows,
   stacked on top of the comment that documents adr_copy_rows, which left
   adr_copy_legacy_once undocumented. It now sits above
   adr_copy_legacy_once (src/store/store.c).

3. adr_restore_if_absent no longer inserts the migrated marker. That
   INSERT OR IGNORE could never change state. Its only caller,
   cbm_store_adr_restore_from_graph_if_absent, takes the sidecar handle
   from adr_conn_write, which hands out a handle (cached or fresh) only
   after adr_copy_legacy_once returned OK, and that function returns OK
   only when the marker row is already committed (fast path, or the
   re-check under the write lock) or it just inserted and committed it.
   No code deletes an adr_meta row, so the insert hit the existing
   primary key every time, and its result was discarded anyway.

Tests: artifact_import_logs_failed_adr_restore puts a directory at
<db>.adr.db (the hook-free trick from the #2315 pipeline test), then
asserts the import still succeeds, the graph DB is installed, and the
warn line carries the store reason. It is red without the artifact.c
change. artifact_export_roundtrip_keeps_adr now also asserts that the
fresh destination sidecar is marked migrated after the import, which
pins the invariant item 3 relies on.

Refs #2315

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 20:46:20 +01:00
Martin Vogel f6fb3e0d36 Merge pull request #2371 from BobbieBarker/fix/elixir-extraction-defects
fix(elixir): guarded def heads, multi-clause spans, and typespecs walked as code
2026-10-31 20:08:31 +01:00
Martin Vogel e7a7a2b44e Merge origin/main into fix/2671-agent-config-symlinks
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 20:06:58 +01:00
Martin Vogel 3b46abec25 Merge pull request #2861 from DeusData/dependabot/npm_and_yarn/graph-ui/npm_and_yarn-89011d1d99
build(deps-dev): bump vite from 6.4.4 to 6.4.5 in /graph-ui in the npm_and_yarn group across 1 directory
2026-10-31 20:06:33 +01:00
Martin Vogel 7be2becf73 Merge pull request #2315 from 0xb007ab1e/fix/adr-reindex-race
fix(pipeline): preserve concurrent manage_adr write across reindex swap
2026-10-31 19:55:37 +01:00
Martin Vogel 257821805c Merge origin/main into fix/go-field-type-hint-owner-segment
Resolved tests/test_pipeline.c as the main version plus this PR diff: the owner-segment field-hint tests follow the new bare init tests, and both RUN_TEST pairs stay registered (pass_parallel.c merged cleanly).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 19:35:24 +01:00
Martin Vogel df30463f12 Merge pull request #2862 from DeusData/fix/go-bare-init-never-binds
fix(go): a bare init never binds to a package init or an init method
2026-10-31 19:27:50 +01:00
Martin Vogel a33cddcdba Merge origin/main into fix/go-field-type-hint-owner-segment
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 16:39:01 +01:00
Martin Vogel a5c5b42fea Merge origin/main into fix/elixir-extraction-defects
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 16:38:55 +01:00
Martin Vogel 8cef96dd88 Merge origin/main into fix/adr-reindex-race
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 16:38:41 +01:00
Martin Vogel 70a7062e18 Merge origin/main into fix/go-bare-init-never-binds
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 16:29:40 +01:00
dependabot[bot] 9901feeff1 build(deps-dev): bump vite
Bumps the npm_and_yarn group with 1 update in the /graph-ui directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 6.4.4 to 6.4.5
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.4.5/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.4.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.4.5
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-31 15:23:40 +00:00
Martin Vogel 4a78fe6a6b fix(go): a bare init never binds to a package init or an init method
Go gives `init` no binding in the package block: init functions cannot
be referred to from anywhere in a program, and a method or field named
init needs a selector. A bare `init` is therefore always a local name -
a closure (`init := func(ctx) {...}; init(ctx)`), a parameter, or the
`package init` clause of a directory named init.

Before #1915 same_module bound such a name to the flat package init.
With per-file init QNs it now falls through to the short-name fallback
and binds unrelated methods named init. On kubernetes that minted 24
CALLS (22 e2e storage DefineTests closures among them), 28 WRITES,
7 USAGE and one derived TESTS edge, all false.

cbm_go_suppress_bare_init_bind refuses, for a bare Go `init`, any
registry binding onto a Function (every Go Function named init is a
package init) and a weak short-name binding onto a Method or Field.
lsp_* answers and selector calls (`w.init()`) are untouched. Wired at
the CALLS, USAGE and READS/WRITES seams of both resolvers.

Kubernetes, full index, main vs branch: only those 60 edges removed,
nodes identical, no resolver edge added; the 14 LSP-typed selector
CALLS into init methods are unchanged.

Tests: pipeline_go_bare_init_binds_nothing (+ parallel twin) are RED
with the predicate disabled (closure CALLS, parameter CALLS, closure
WRITES, package-clause USAGE onto Watcher.init) and GREEN with it; the
selector control keeps Watcher.Start/Boot -> Watcher.init.
go_bare_init_never_binds_init_namesake pins the predicate.

Refs #1915

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 14:16:05 +01:00
Martin Vogel afb499b62a test(pipeline): pin owner-segment field-type hints for C#
Go no longer runs the parallel field-type hint (e554a2ab), so the Go test
of this PR passes with or without the owner-segment fix. C# still reaches
try_field_type_hint, and its PascalCase method names make every candidate
QN contain a one-letter receiver's hint: `w.Write()` on a StreamWriter was
upgraded to an arbitrary project Write as field_type_hint. The test is RED
on main's pass_parallel.c and GREEN with the fix, and its positive control
pins `store.Put()` to Store.Put, never FileStore.Put.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 13:56:42 +01:00
Martin Vogel 747665d71f Merge pull request #2752 from gaurav0107/fix/2537-go-net-http-servemux-patterns-with-a-met
fix(routes): read Go 1.22 ServeMux method and host patterns
2026-10-31 13:53:35 +01:00
Martin Vogel e0823879e9 Merge pull request #2819 from DeusData/fix/2386-bm25-post-window-filters
fix(mcp): rank every BM25 candidate when post-window filters would hide them
2026-10-31 13:45:14 +01:00
Martin Vogel d1d8bbfa8f Merge pull request #1833 from LeoLan-Digital/fix/permanent-daemon-watch
fix: persist daemon watches across client disconnects
2026-10-31 13:45:05 +01:00
Martin Vogel 70f6de8a2f Merge pull request #2822 from divakantpandey/fix/2722-install-managed-binary-path
fix(cli): use managed binary path for agent configs when externally managed (#2722)
2026-10-31 13:44:54 +01:00
Martin Vogel a2787346c0 Merge origin/main into fix/go-field-type-hint-owner-segment
Resolve tests/test_pipeline.c as main's file plus this PR's own test hunk; the RUN_TEST line is re-anchored before pipeline_go_multi_init_nodes_survive.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 10:08:36 +01:00
Martin Vogel 9faa3e5c06 Merge pull request #1915 from ilyabrykau-orca/fix/go-init-qn
fix(extract): give each Go init() its own QN
2026-10-31 09:47:32 +01:00
Divakant Pandey b738549097 Merge main and enforce user ownership for directory symlinks in dir_exists
Follow POSIX symlinks in dir_exists() on top of cbm_path_info_utf8() only when
the invoking user owns both the symlink and the target directory it resolves
to. Leave cbm_agent_registry_path_exists() unchanged, guard the POSIX symlink
tests with #ifndef _WIN32, and isolate XDG_CONFIG_HOME for Linux runs.

Refs #2671
2026-10-31 12:26:21 +05:30
Martin Vogel d86ca262ce Merge branch 'main' into fix/2386-bm25-post-window-filters 2026-10-31 06:11:43 +01:00
Martin Vogel c0e929378a Merge origin/main into fix/elixir-extraction-defects
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 06:11:38 +01:00
Martin Vogel 4787012023 Merge origin/main into fix/2722-install-managed-binary-path
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 06:11:22 +01:00
Martin Vogel 3e075d59be Merge origin/main into fix/2537-go-net-http-servemux-patterns-with-a-met
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 06:11:15 +01:00
Martin Vogel 0b0e294be0 Merge origin/main into fix/adr-reindex-race
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 06:11:08 +01:00
Martin Vogel 2609e56336 Merge origin/main into fix/permanent-daemon-watch
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 06:10:47 +01:00
Martin Vogel 8c62cb3344 Merge origin/main into fix/go-init-qn
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 06:10:26 +01:00
Martin Vogel 9f0fdcb400 Merge pull request #2613 from bline/fix/doc-section-hierarchy
fix(markdown): qualify a repeated heading's Section by its parent headings (#2586)
2026-10-31 06:09:28 +01:00
Martin Vogel 85a38ed2a8 Merge pull request #2839 from halindrome/fix/subagent-reminder-cli-fallback
fix(hooks): tell subagents without MCP tools how to reach the graph via the CLI
2026-10-31 06:07:37 +01:00
Martin Vogel 0e4c96b4cf Merge pull request #2849 from DeusData/ci/macos-15-runners
ci: move macOS runners to macos-15 and pin the deployment target to 14.0
2026-10-31 06:07:30 +01:00
Martin Vogel 76dda7e35b Merge pull request #2827 from nefayran/fix/2818-puml-edge-operand
fix(diagram): set an empty PlantUML operand id when there is none
2026-10-31 04:27:30 +01:00
Martin Vogel 30f1fbf33b Merge pull request #2841 from halindrome/fix/search-code-file-pattern-path
fix(mcp): match search_code file_pattern with a directory against the repo-relative path
2026-10-31 03:47:25 +01:00
Martin Vogel 395763cd1d Merge origin/main into fix/subagent-cli-hint
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 01:02:43 +01:00
Martin Vogel 3a869ee1ac fix(hooks): state the CLI fallback for subagents as a fact
Hook context reads best as plain facts: the SubagentStart sentence now says the same tools are also available from the shell instead of instructing the agent. The command the tests match is unchanged.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 01:02:43 +01:00
Martin Vogel 9bb891b669 ci: move macOS runners to macos-15 and pin the deployment target to 14.0
GitHub retires the macos-14 runner image on 2026-11-02, and its brownouts
already cancel our macos-14 jobs. Move every macos-14 runner reference to
macos-15 (arm64): the release darwin-arm64 build, the unix-macos14 and
tsan-mac test legs, the smoke-mac PR leg (its two matrix.os guards move in
lockstep), the release smoke, both soak legs, the memwaste event lane, the
bug-repro board, the cache warmer and the all-platform smoke. Lane names
stay unchanged: select-lanes.sh, ci-ok and the lane contracts key on them,
never on the runner label.

Two broad legs already ran on macos-15 (_test.yml BROAD_UNIX, _smoke.yml
BROAD_UNIX) and smoke.yml listed both images, so the moved legs would have
duplicated them. Those duplicates are dropped; PR CI keeps exactly the
same legs.

Without an explicit minimum, clang stamps the binary with the SDK's
default (LC_BUILD_VERSION minos), so a release built on macos-15 would
refuse to start on macOS 14. Makefile.cbm now folds
-mmacosx-version-min=14.0 into CC/CXX next to ARCHFLAGS for Apple targets
(detected from the compiler's target, not the host), so it reaches every
compile and link, vendored objects included, on every build path.

Proof on macOS 26.6 / SDK 26.5: the production binary built from
origin/main reports minos 26.0; with this change it reports minos 14.0,
with zero warnings under -Werror, no weak imports and an identical
undefined-symbol set. The test runner (direct make, no env.sh) is minos
14.0 too; platform and daemon_ipc suites pass.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 23:44:25 +01:00
Martin Vogel d514868ee4 test(diagram): keep the unclosed class declaration in its own diagram
A class line makes a PlantUML diagram a class diagram, where -> is an arrow rather than a sequence message, so the edge-message fixture could never produce the message arrow it asserts. Put the unclosed declaration in a second @startuml block and assert both diagram kinds.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 23:20:25 +01:00
Martin Vogel 6f63e38567 Merge origin/main into fix/search-code-file-pattern-path
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 23:00:55 +01:00
Martin Vogel bdf204b2e5 Merge origin/main into fix/elixir-extraction-defects
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 22:48:50 +01:00
Martin Vogel 47474b668a Merge pull request #2826 from knewstimek/fix/inc-c-family-routing
fix(discover): select C++ for C-family .inc fragments
2026-10-30 22:42:29 +01:00
Martin Vogel cf77fb84e2 Merge origin/main into fix/2722-install-managed-binary-path
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 22:40:59 +01:00
Martin Vogel b33a645e47 Merge origin/main into fix/permanent-daemon-watch
test_daemon_application.c: the new auto-watch test passes false for the approve_broad parameter that #2017 added to cbm_workspace_grant_add, the same value the existing callers use; the merged tree did not compile without it.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 22:37:40 +01:00
Martin Vogel 0bd442cd2f Merge origin/main into fix/doc-section-hierarchy
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 22:34:08 +01:00
Martin Vogel 7ee29d8841 Merge origin/main into fix/go-init-qn
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 22:33:54 +01:00