pub struct Args {Show 16 fields
pub id: Option<String>,
pub expected_hash: Option<String>,
pub auto_hash: bool,
pub force: bool,
pub sections: Vec<String>,
pub append: Vec<String>,
pub patch: Vec<String>,
pub patch_all: Vec<String>,
pub metadata: Vec<String>,
pub metadata_unset: Vec<String>,
pub declare_relations: Vec<String>,
pub anchors: Vec<String>,
pub anchors_unset: Vec<String>,
pub dry_run: bool,
pub from: Option<PathBuf>,
pub note: Option<String>,
}Fields§
§id: Option<String>Full entity ID (e.g. specs--my-entity). Required unless --from is given.
expected_hash: Option<String>Hash from memstead entity <id> (the _hash field). Required unless
--auto-hash or --force is given. With --from, this flag
overrides the file’s expected_hash field and enforces CAS exactly
as on the inline path.
auto_hash: boolRefetch the current hash immediately before writing. Convenient for interactive use; accepts the race window between the refetch and the write.
force: boolSkip the hash check entirely (explicit overwrite).
sections: Vec<String>Replace section content: repeatable --section key=value. Body
wiki-links must take slug-form ([[idempotency]], not the
title-case [[Idempotency]]) — a non-slug target refuses with
INVALID_WIKI_LINK_TARGET carrying a proposed_slug to retry with.
append: Vec<String>Append to section content: repeatable --append key=value.
patch: Vec<String>Find-and-replace inside a section: repeatable --patch key=OLD=>NEW.
Use => (two chars) as the separator between old and new. Exact match
of the first occurrence; use --patch-all to replace every occurrence.
patch_all: Vec<String>Replace every occurrence of OLD in the section — sibling of --patch.
Repeatable --patch-all key=OLD=>NEW.
metadata: Vec<String>Metadata field: repeatable --metadata key=value.
metadata_unset: Vec<String>Remove a metadata field: repeatable --metadata-unset KEY. Silent
no-op if the key is absent; errors on read-only fields (mem/id/type
plus the engine-stamped created_date/last_modified) or
schema-required fields.
declare_relations: Vec<String>Atomic batched relation declaration: repeatable
--declare-relations REL_TYPE:TARGET_ID. Each entry is
validated like an individual memstead relate call (schema-shape,
cross-mem policy, target-id grammar) and appended to the
entity’s relations BEFORE the strict wiki-link/relation
validator runs. Lets the agent add [[target]] body
wiki-links AND declare the backing relation in one
memstead update call without an interleaved memstead relate.
Absent Write-mem targets are auto-stubbed identically to
memstead relate’s add path. Each successful declaration is
echoed in the response’s relations_declared (with
target_was_stubbed flagging the auto-stub case).
anchors: Vec<String>Provenance anchor: repeatable --anchor '<json>', each a JSON
object of the anchor shape. Written into the mem-branch anchors
sidecar in the same commit as the update; a malformed anchor
refuses INVALID_ANCHOR. An update carrying only --anchor (no
section/metadata change) still commits the sidecar. Conflicts with
--from (the file’s anchors[] is authoritative there).
anchors_unset: Vec<String>Explicit anchor removal: repeatable --anchor-unset '<json>', each
a JSON object { "artifact": "…" } optionally narrowed by
"grain" and/or "class" — a bare artifact removes every anchor
on it. Applied BEFORE the --anchor merge in the same commit
(anchors merge; writing never removes an anchor not named here).
Unsetting a nonexistent target is a no-op. A malformed selector
refuses INVALID_ANCHOR. Conflicts with --from (the file’s
anchors_unset[] is authoritative there).
dry_run: boolPreview what would change without writing. Applies on both the
inline and --from paths; with --from it forces a dry run even
when the file’s dry_run field is absent or false.
from: Option<PathBuf>JSON file matching MCP memstead_update args shape. The file is the
single source of the mutation content — the content flags
(--section / --append / --patch / --patch-all / --metadata /
--metadata-unset / --declare-relations / --anchor /
--anchor-unset) conflict with --from rather than being silently
ignored. The flags that DO apply
alongside --from: the hash-mode flags (--expected-hash, which
overrides the file’s expected_hash field; --auto-hash; --force),
--dry-run (forces a dry run even when the file says otherwise), and
--note.
note: Option<String>Agent-authored provenance note (≤280 chars). When
[mutations].require_notes = true a missing note adds a
NOTE_MISSING warning.
Trait Implementations§
Source§impl Args for Args
impl Args for Args
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Args
impl CommandFactory for Args
Source§impl FromArgMatches for Args
impl FromArgMatches for Args
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for Args
impl Parser for Args
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Args
impl RefUnwindSafe for Args
impl Send for Args
impl Sync for Args
impl Unpin for Args
impl UnsafeUnpin for Args
impl UnwindSafe for Args
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more