graflo.cli._store¶
Commit-store plumbing shared by the commit and merge verbs.
Both verbs write to the same history, so the store path option and the append refusal live here rather than in either command module -- a command importing another command is the arrangement that makes the second one impossible to read in isolation.
Attributes¶
DEFAULT_STORE = Path('.graflo/commits')
module-attribute
¶
__all__ = ['DEFAULT_STORE', 'append_entry', 'store_option']
module-attribute
¶
store_option = click.option('--store', type=click.Path(path_type=Path), default=DEFAULT_STORE, show_default=True, help='Directory holding the commit history.')
module-attribute
¶
Classes¶
Functions:¶
append_entry(store, entry)
¶
Store entry, turning a DAG-validation failure into a usable message.
History validates on construction, so an entry that does not line up
surfaces as a raw pydantic ValidationError. That is the correct refusal
reaching the user in the wrong shape -- it names a pydantic model and a
tree hash, and says nothing about what to do next.