fix(generate): correct root-file ownership for wildcard configs and mirrored roots - #2008
Merged
Merged
Conversation
…irrored roots Follow-up fixes for the #1978 root-file ownership work (#1981): - #1 (mid): `extractConfigFileTargets` collapsed the wildcard array form `targets: ["*"]` to an empty list, so `getConfigFileTargets()` did not fall back and ownership was computed against no targets — reproducing #1894 for the very common `["*"]` config. Expand `*` to the full non-legacy target set (mirroring `Config.getTargets()`). Note the fallback to `getTargets()` is intentionally NOT used because it is CLI `-t` filtered, whereas ownership needs the full config-file target list. - #2 (mid): `computeRootFileOwnership` derived owned roots solely from `getSettablePaths().root`, missing rovodev's generation-time mirror to project-root ./AGENTS.md (mirrorsRootToAgentsMd) and any target's alternativeRoots. Register both so mirrored/aliased root files are attributed to the right target instead of inverting ownership. - #3/#4 (low): document the single-decision-across-output-roots assumption and the load-bearing last-target-in-config-order-wins semantics at the call site. - #5 (low): add a config-resolver regression test for `["*"]` expansion (incl. CLI -t independence) and an E2E test asserting a non-owning target passes check when rovodev owns the mirrored ./AGENTS.md. Closes #1981 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… follow-up) Address PR review findings on #2008: - Dedupe the wildcard (`*`) -> non-legacy-target expansion into a single exported `expandWildcardTargets()` helper used by both `Config.getTargets()` and `extractConfigFileTargets()`, removing the drift risk (and the redundant `validTargets.has` check). - Reword the `alternativeRoots` ownership comment (they are fallback/secondary root locations, not generation-emitted) and note the rovodev mirror overlaps its alt root today. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
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.
Summary
Follow-up fixes for the #1978 root-file-ownership work, addressing the non-blocking findings in #1981.
#1 (mid) — wildcard
targets: ["*"]silently bypassed the fixextractConfigFileTargetsfiltered out*and returned[](notundefined), sogetConfigFileTargets()did not fall back and root-file ownership was computed against an empty target list — reproducing #1894 for the very commontargets: ["*"]config (e.g.generate --check -t codexcli -f rulesfailing onAGENTS.md). Now*is expanded to the full non-legacy target set, mirroringConfig.getTargets().#2 (mid) — rovodev's mirrored
./AGENTS.mdwas invisible to ownershipcomputeRootFileOwnershipderived owned roots only fromgetSettablePaths().root, so rovodev's generation-time mirror to the project-root./AGENTS.md(mirrorsRootToAgentsMd) and any target'salternativeRootswere never attributed — inverting ownership in configs like{ codexcli, rovodev }. Both are now registered.#3 / #4 (low) — documentation
Documented the single-ownership-decision-across-output-roots assumption and the load-bearing "last target in config order wins" semantics at the call site.
#5 (low) — tests
["*"]expands to the full non-legacy list (and stays full even when CLI-tselects one target).codexcli) passes--checkwhen rovodev owns the mirrored./AGENTS.md.Verification
pnpm cicheckpasses (fmt, oxlint, typecheck, tests, content).generate --check -t codexclipasses when rovodev (last in config) owns the mirroredAGENTS.md.Closes #1981