-
Notifications
You must be signed in to change notification settings - Fork 355
Fix: child-config autoentities fails validation with "No entities found" when using data-source-files
#3723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
448161e
fefffea
c12d550
bb1fce0
fdcea19
b1e3d6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -740,6 +740,17 @@ private void ValidateRootConfig(RuntimeConfig runtimeConfig) | |
| // Validate each child config independently. | ||
| foreach ((string fileName, RuntimeConfig childConfig) in runtimeConfig.ChildConfigs) | ||
| { | ||
| // The metadata provider stores autoentity resolution counts on the root config. | ||
| // Copy those counts to the child config so per-child validation can find them | ||
| foreach (KeyValuePair<string, Autoentity> ae in childConfig.Autoentities) | ||
| { | ||
| if (!childConfig.AutoentityResolutionCounts.ContainsKey(ae.Key) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The latest metadata result should be authoritative instead of preserving an existing child value. The Please overwrite the child value from the current root result, including removing a stale child value when the root has no result. Preferably, avoid mutating the child entirely and have per-child validation read the authoritative root count dictionary using the child's autoentity definition names. |
||
| && runtimeConfig.AutoentityResolutionCounts.TryGetValue(ae.Key, out int count)) | ||
| { | ||
| childConfig.AutoentityResolutionCounts[ae.Key] = count; | ||
| } | ||
| } | ||
|
|
||
| ValidateNonRootConfig(childConfig, configName: fileName); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests exercise the propagation loop but do not reproduce the production
data-source-filespath.Manually calling
rootConfig.ChildConfigs.Add(...)does not perform the other work done by the real loader: child entities and autoentities are merged into the root collections, ownership maps are combined, and metadata providers are created per data source. The missing merge is significant because it hides both the root-without-data-source failure and the case where child discoveries incorrectly satisfy the root.Please add a regression test that creates actual root and child JSON files, loads them through
FileSystemRuntimeConfigLoader, runs metadata initialization and validation, and asserts the per-file result. Since the linked issue also reports missing child-generated entities through MCP, please either add runtime/MCP coverage proving those entities are present or track that runtime behavior separately rather than closing the whole issue with validation-only tests.