Summary
DocBuilder._build_combined_for_ref constructs ref_args as a fresh types.SimpleNamespace populated with a hardcoded set of fields (output, no_draft, only, exclude). Any other argparse flag set on the top-level args is silently dropped before reaching the worktree builder. Most visibly, this means --allow-railroad-failure does not propagate, even when explicitly set by the user.
Why it matters
If <from_ref> pre-dates a PEG fix that subsequently landed on <to_ref> (e.g. a railroad PEG that has since been corrected), the build of the from ref still fails fatally despite the user passing the opt-out flag.
Concretely, this blocks pixi run main build --allow-railroad-failure --diff e98ceb3 <newer-tip> in aousd/core-spec-wg because e98ceb3 (1.1.0 voting open) pre-dates aousd/core-spec-wg#494's schemas-PEG fix.
Where it happens
doc_build/doc_builder.py, around the _build_combined_for_ref body:
ref_args = types.SimpleNamespace(
output=output_dir,
no_draft=getattr(args, "no_draft", False),
only=getattr(args, "only", []),
exclude=getattr(args, "exclude", []),
)
output_dir.mkdir(parents=True, exist_ok=True)
return builder._setup_and_preprocess(ref_args)
The hardcoded list misses allow_railroad_failure (and would miss any other flag a downstream subclass adds via make_build_parser).
Suggested fix
Option A (explicit, minimal): add the one missing flag:
ref_args = types.SimpleNamespace(
output=output_dir,
no_draft=getattr(args, "no_draft", False),
only=getattr(args, "only", []),
exclude=getattr(args, "exclude", []),
allow_railroad_failure=getattr(args, "allow_railroad_failure", False),
)
Option B (extensible): expose a hook so downstream subclasses can extend ref_args without re-overriding _build_combined_for_ref. For example a _ref_args_overrides(args) -> dict method whose return value is merged into the SimpleNamespace. This handles future / downstream flags too.
I'd lean Option B because the same problem can recur: any downstream make_build_parser add can fall through this gap.
Workaround in place downstream
aousd/core-spec-wg#499 overrides _build_combined_for_ref in CoreSpecBuilder to forward the flag, duplicating ~22 lines of the upstream method body. We'd like to drop that override once upstream forwards the flag.
Summary
DocBuilder._build_combined_for_refconstructsref_argsas a freshtypes.SimpleNamespacepopulated with a hardcoded set of fields (output,no_draft,only,exclude). Any other argparse flag set on the top-levelargsis silently dropped before reaching the worktree builder. Most visibly, this means--allow-railroad-failuredoes not propagate, even when explicitly set by the user.Why it matters
If
<from_ref>pre-dates a PEG fix that subsequently landed on<to_ref>(e.g. a railroad PEG that has since been corrected), the build of the from ref still fails fatally despite the user passing the opt-out flag.Concretely, this blocks
pixi run main build --allow-railroad-failure --diff e98ceb3 <newer-tip>in aousd/core-spec-wg becausee98ceb3(1.1.0 voting open) pre-dates aousd/core-spec-wg#494's schemas-PEG fix.Where it happens
doc_build/doc_builder.py, around the
_build_combined_for_refbody:The hardcoded list misses
allow_railroad_failure(and would miss any other flag a downstream subclass adds viamake_build_parser).Suggested fix
Option A (explicit, minimal): add the one missing flag:
Option B (extensible): expose a hook so downstream subclasses can extend
ref_argswithout re-overriding_build_combined_for_ref. For example a_ref_args_overrides(args) -> dictmethod whose return value is merged into theSimpleNamespace. This handles future / downstream flags too.I'd lean Option B because the same problem can recur: any downstream
make_build_parseradd can fall through this gap.Workaround in place downstream
aousd/core-spec-wg#499 overrides
_build_combined_for_refinCoreSpecBuilderto forward the flag, duplicating ~22 lines of the upstream method body. We'd like to drop that override once upstream forwards the flag.