Expand description
The single writer of GSD’s .planning/config.json in this codebase.
DevFlow does not own this file. Its other keys belong to GSD and to the
operator, and a live GSD process may read it at any moment during a run.
This module therefore acquires exactly ONE key of write authority —
workflow._auto_chain_active, the flag GSD’s checkpoint_handling consults
to decide whether an ordinary gate="blocking" checkpoint may be
auto-approved — and must leave every other key, its position, and its
serialized form byte-identical (35.1-01, T-35.1-02).
Three properties follow from that, and each is pinned by a test rather than left to inspection:
- No typed struct. The file is parsed as a bare
serde_json::Value. A typedConfig/Workflowround trip would silently DROP the keys this crate does not model (commit_docs,git,intel,review,model_overrides,mempalace), which is precisely the contract this module exists to honour. - Key order is preserved.
serde_json’spreserve_orderfeature is enabled in the workspaceCargo.tomlfor this module’s sake; without it every write re-sorts the top-level keys alphabetically and turns a tracked file into a full-file diff on every stage launch. - Writing a value the file already holds is a no-op. The file’s bytes
and mtime are left untouched, so an INELIGIBLE stage launch — which
actively asserts
falserather than merely leaving the file alone — does not dirty a tracked file every time it runs (35.1-01 F-3).
Reads are defensive (ASVS V5): a shape this module does not recognise
yields the inactive default, never a panic, and a malformed or absent file
is an Err the caller can log and skip rather than an abort that would kill
a long unattended run.
Structs§
- Clear
Outcome - What
force_clear_auto_chainactually did, so the CLI call sites can decide whether to be loud without re-deriving any of it.
Enums§
- GsdConfig
Error - Errors produced while reading or writing GSD’s project config.
Functions§
- auto_
chain_ active - Whether
workflow._auto_chain_activeis currently set underroot. - config_
path - Path of the GSD project config under a project (or worktree) root.
- force_
clear_ auto_ chain - Clear
workflow._auto_chain_activeunderrootunconditionally, repairing the branch tip too when that can be done without sweeping in anything else. - set_
auto_ chain_ active - Set
workflow._auto_chain_activeunderroot, returning whether the file was actually changed.