Refine config mutability #10

Open
opened 2025-11-19 13:14:47 +00:00 by glenux · 0 comments
Owner

Description

Clarify and enforce stricter boundaries around the mutability of the global DocMachine::Config object after initial parsing, to prevent unintended side effects.

Expected outcome

Once argument parsing completes, DocMachine::Config should effectively be immutable for command Run classes; only the CLI parsing phase mutates it.

Current state

The shared config object is mutable and passed by reference, allowing subcommands to change properties after initialization, which may leak state between commands.

Technical details

  • Re-emphasize the config lifecycle in ADR 0005.
  • Consider using config.dup when handing off to Run classes.
  • Ensure command-specific config subclasses encapsulate their own mutations safely.

Additional info

Local task id: aa30c75.

## Description Clarify and enforce stricter boundaries around the mutability of the global `DocMachine::Config` object after initial parsing, to prevent unintended side effects. ## Expected outcome Once argument parsing completes, `DocMachine::Config` should effectively be immutable for command `Run` classes; only the CLI parsing phase mutates it. ## Current state The shared config object is mutable and passed by reference, allowing subcommands to change properties after initialization, which may leak state between commands. ## Technical details - Re-emphasize the config lifecycle in ADR 0005. - Consider using `config.dup` when handing off to `Run` classes. - Ensure command-specific config subclasses encapsulate their own mutations safely. ## Additional info Local task id: aa30c75.
glenux changed title from aa30c75 Refine config mutability to Refine config mutability 2025-11-19 13:18:33 +00:00
glenux added this to the By Status project 2025-11-19 18:02:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: glenux/docmachine-cli#10
No description provided.