Repository navigation
Conversation
…tage codex.yml is loaded into CodexConfiguration through a declared loader. A codex that is published is the next stage, PublishedCodexConfiguration, which carries the environment rule; reading one (sync, update-redirects) needs none. Messages, exceptions and file attribution are those of main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The set exists so every loaded type has a static T.Constraints, which Loader.For requires. A test fails when a rule is added, so a refactor PR cannot change what the codex commands report by accident. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An empty or null groups key, and an empty entry under it, load again. They fail only where a group is looked up, as before, so codex sync and codex update-redirects read such files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Load
codex.ymlinto aCodexConfigurationrecord through a declared loader, with the publishing check as its own stage type. Behaviour is unchanged: messages, exceptions and file attribution are those of main.Affects: Configuration, CLI
Why
Part of #4530. The codex configuration is a mutable class that deserializes itself, and the environment check sits in the consumer's loader as an
if. Moving it into the domain gives it the same shape as the other aggregates (record, DTO, loader, named rules).What
Codex domain record
CodexConfiguration,CodexGroupDefinitionandCodexDocumentationSetReferencemove toElastic.Documentation.Codexas value-equal records with internal setters.CodexDocumentationSetReference.ForRepositoryreplaces the object initializers in the clone service and the style-guide preview. The unusedGetGitUrl()on the reference is gone (the clone service has its own).Stage types
A codex is checked by
CodexConfiguration.Constraintswhen read (sync, update-redirects) and byPublishedCodexConfiguration.Constraintswhen published (it must name its environment). Each stage has one static rule set; the loader never chooses one and nothing composes rules at a call site. The read set is empty on purpose: main accepts every value, and the empty set exists so every loaded type has a staticT.Constraints(Loader.Forrequires it). A test pins it as empty, so a rule added in a refactor PR fails deliberately; the deferred group rules need their own PR with a snapshot diff. No caller dispatches, so there is no union.Loader
CodexSiteLoaderdeclaresReadandPublishloaders overCodexConfigurationDto, withLoad(text, file),LoadForPublish(text, file)and a throwingLoad(IFileInfo)forcodex sync, which has always thrown.CodexConfigurationLoaderkeeps itsTryLoadsignatures and reports errors as global errors with main's text.Tests
Loader tests (DTO projection, normalization, malformed YAML, environment message), the stage's
AutoTestaxes, and theDomainPurityTestsnamespace entry. No verified snapshot changes.Deferred behaviour changes (all in #4530, not here):
canonical_base_urlabsolute-URI warnings.codex.groupnames a group the codex does not define (DocumentationSetInCodex).GlobalCliOptionsparameter in the codex commands.codex syncloading through the checked loader (it still throws as on main).Known difference: an error from a YAML parse failure is now written without the original exception attached (
EmitGlobalError(message)); the text is unchanged.Stack: 5 of the wave-2 stack. Part of #4530; builds on the foundation #4888, the wave-1 PRs, and #4926, #4931 and #4930, via
split/integration-wave2.Verify
🤖 Generated with Claude Code
Golden compare
Local builds of the isolated docs, the prod assembler site and the codex example site, this branch's head against the wave-1 integration branch (
split/integration-wave1: currentmainplus the nine wave-1 PRs); aggregate counts, the output stays local.21 paths differ across the three sites. All also differ between two captures of that baseline taken hours apart (159 paths: live OpenAPI specs, the release-notes CDN and the generated
llmsfiles), so none of these can be attributed to this change. The capture was taken at an earlier head; the current head adds only a comment and a test.Limit: golden cannot show a real change inside those drifting pages.