Cross-module drift detection for qualified default types (closes #47)#48
Merged
Conversation
Closes #47. Extends default field-schema validation to qualified `default alias/Type = { ... }` literals in the multi-file CLI. `collect_entity_field_schemas` exposes each module's entity/value type → field names; the CLI builds a per-file `imported_entity_fields` map (alias → type → fields) on `CrossModuleContext`, mirroring `imported_triggers`, and threads it through `analyze_with_cross_module` into `Ctx`. `check_default_field_schemas` then flags a qualified-default field not declared on the imported type (`allium.default.unknownField`). Aliases or types whose target module is outside the check set are left unvalidated rather than flagged — the same convention as qualified triggers. This is multi-file-CLI-only: the single-file TypeScript analyzer cannot see other modules, so it continues to validate only local default types (an asymmetry already documented for qualified-trigger resolution). The cross-module path carries field names only, so rule 14c and nested-object recursion remain local-type-only. Adds two CLI integration tests (drift flagged across modules; not flagged when the target is outside the check set) and updates the parity doc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 16, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47 — the cross-module follow-up to the Gap B drift work in #46.
What it does
Extends default field-schema validation to qualified
default alias/Type = { ... }literals in the multi-file CLI:collect_entity_field_schemas(module)(new, exported) exposes each module's entity/value type → declared field names.imported_entity_fieldsmap (alias → type → fields) onCrossModuleContext, mirroringimported_triggers, and threads it throughanalyze_with_cross_moduleintoCtx.check_default_field_schemasflags a qualified-default field not declared on the imported type →allium.default.unknownField(e.g.default gp/Policy d = { naem: ... }).Scope & conventions (consistent with qualified triggers)
Tests / verification
cargo test --workspacegreen (391 parser + 31 in the cross-module CLI binary, incl. 2 new: drift-flagged-across-modules, not-flagged-when-target-outside-check-set).allium checkflagsnaemagainstgp/Policy; single-file (parent not in check set) does not.🤖 Generated with Claude Code