Priority
High — configuration correctness, trust-boundary clarity, and prevention of silent build/default changes.
Context
internal/project has an AST-only loader for gowdk.config.go. It parses Go syntax and then manually interprets a subset of gowdk.Config without type-checking the file.
The current decoder is permissive in places that should be fail-closed:
- selector expressions are treated as not requiring executable evaluation;
- nested config parsers usually ignore unknown fields;
- non-keyed composite literal elements are skipped by the non-strict parser;
- unsupported literals often become zero values instead of diagnostics.
This is related to the broader loader unification tracked in #665, but this issue is a focused correctness bug that should be fixed even before the final config model is chosen.
Problem
A configuration that normal Go compilation would reject or evaluate correctly can be silently loaded with different values.
Example shape:
var Config = gowdk.Config{
AppName: constants.Name,
Source: gowdk.SourceConfig{
Incldue: []string{"src/**/*.gwdk"},
},
}
Observed-by-inspection risks:
constants.Name is a selector expression, so it is classified as static, but the string parser cannot decode it and returns "".
Incldue is not a valid gowdk.SourceConfig field, but nested parsing ignores it, leaving Source.Include empty.
- Unkeyed nested values can also be skipped rather than rejected.
This makes small refactors or typos change the effective build configuration without an actionable diagnostic.
Proposed direction
Until the config loader is unified:
- type-check
gowdk.config.go before accepting the AST-only path;
- require keyed struct literals for all decoded config structs;
- reject every unknown nested config field;
- reject non-literal values unless the loader deliberately falls back to executable evaluation;
- report the field path, for example
Config.Source.Include;
- do not let unsupported values silently decode as zero values.
Acceptance criteria
Related
Priority
High — configuration correctness, trust-boundary clarity, and prevention of silent build/default changes.
Context
internal/projecthas an AST-only loader forgowdk.config.go. It parses Go syntax and then manually interprets a subset ofgowdk.Configwithout type-checking the file.The current decoder is permissive in places that should be fail-closed:
This is related to the broader loader unification tracked in #665, but this issue is a focused correctness bug that should be fixed even before the final config model is chosen.
Problem
A configuration that normal Go compilation would reject or evaluate correctly can be silently loaded with different values.
Example shape:
Observed-by-inspection risks:
constants.Nameis a selector expression, so it is classified as static, but the string parser cannot decode it and returns"".Incldueis not a validgowdk.SourceConfigfield, but nested parsing ignores it, leavingSource.Includeempty.This makes small refactors or typos change the effective build configuration without an actionable diagnostic.
Proposed direction
Until the config loader is unified:
gowdk.config.gobefore accepting the AST-only path;Config.Source.Include;Acceptance criteria
Configand every nested config literal reject unknown fields.gowdk.config.goare surfaced before AST decoding succeeds.Related
gowdk.config.goloading under one explicit execution model #665 — Unifygowdk.config.goloading under one explicit execution model