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
* Fix diamond dependency double-import causing 'already initialized' error
When the same schema directory is imported via multiple paths (diamond
dependency), the schema file was being loaded twice. This caused plugin
init decorators (like @initAws) to run twice, throwing "Instance with id
'_default' already initialized".
Fix: Add _loadedImportPaths Set to EnvGraph to track already-loaded
import paths. Before adding a new DirectoryDataSource or
DotEnvFileDataSource for an import, check if the path was already
imported. If so, skip the duplicate import.
Also adds a test plugin (test-plugin-with-init) and three new tests in
import.test.ts covering the diamond dependency pattern for directory
imports, directory imports with plugins, and file imports.
Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/a36fdb26-ef5a-41af-a057-cfa6d4d04f7c
Co-authored-by: philmillman <3722211+philmillman@users.noreply.github.com>
* Refactor: extract checkAndRecordImportPath helper to reduce duplication
Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/a36fdb26-ef5a-41af-a057-cfa6d4d04f7c
Co-authored-by: philmillman <3722211+philmillman@users.noreply.github.com>
* Fix diamond dependency: use ImportAliasSource for correct precedence and importKeys handling
The previous approach skipped duplicate imports entirely, which lost importKeys
from the second import and placed definitions at the wrong precedence position.
Now, duplicate imports create lightweight ImportAliasSource nodes in the tree.
These alias nodes share the original source's definitions but carry their own
importMeta/parent, giving them the correct position in the precedence chain.
A new sortedDefinitionSources list (derived from sortedDataSources by expanding
aliases) is used by ConfigItem.defs for item resolution, while sortedDataSources
remains unchanged for plugin init, error collection, and serialization.
Also adds type field to serialized source entries and updates the Next.js
integration to filter by type instead of label prefix.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix typecheck: add 'import-alias' to DataSourceType union
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix smoke-test CI: use env vars to avoid shell injection from PR title
PR titles containing quotes broke the bash conditional. Using env vars
instead of inline interpolation prevents shell parsing issues.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix plugin typecheck: add node types to plugin tsconfig
The plugin tsconfig was missing node type definitions, causing typecheck
failures for any plugin importing node built-ins.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: philmillman <3722211+philmillman@users.noreply.github.com>
Co-authored-by: Theo Ephraim <theo@dmno.dev>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix diamond dependency handling when the same schema is imported via multiple paths. Previously, duplicate imports caused plugin init decorators to run twice ("Instance already initialized" error). Now, duplicate imports create lightweight `ImportAliasSource` nodes that appear at the correct precedence position without re-initializing the source. This correctly handles different importKeys subsets across import sites and preserves override semantics matching non-deduplicated behavior. Also adds `type` field to serialized source entries for easier filtering.
0 commit comments