Skip to main content

Module command_effects

Module command_effects 

Source
Expand description

What each aube command does to the world.

aube’s usage spec is derived from clap, and clap has no way to express this, so the classification lives here and is applied where the spec is generated.

The three values are defined by the usage spec:

  • read — only inspects state; running it twice is the same as running it once, and not running it changes nothing.
  • write — creates or modifies state, but removes nothing the user cannot recreate.
  • destructive — removes something the user installed or configured, where getting it back means redoing work. Deserves a confirmation prompt.

Fetching or extracting a package is not an effect. Almost every command here may populate the store or the metadata cache on the way to doing its job. That is aube doing its job: it is idempotent, aube refills it on demand, and it changes nothing the user authored. Counting it would make every command write and leave the field with no signal. The same goes for node_modules, which is reproducible from the lockfile — clean and ci delete it and are still only write.

Registry commands act on everyone, not just this machine. publish, deprecate, dist-tag and access change what every consumer of a package sees. They are classified by the same rules as everything else — unpublish removes, so it is destructive; publish creates, so it is write — but none of them are ever read, and the comments say why the blast radius is larger than the tier alone suggests.

An unlisted command means “unknown”, not “safe”. Consumers treat the absence of a value as “ask”, so leaving one out is the conservative choice and mislabeling one read is the dangerous one. Commands that run user-supplied code have no fixed effect and are listed in [UNCLASSIFIED].

Constants§

EFFECTS
Commands whose effect is fixed, keyed by their full path under the binary.
FEATURE_EFFECTS
Commands that only exist behind a cargo feature, so they must only be classified where they exist — otherwise the stale-entry test fails under --no-default-features. The feature is on by default.

Functions§

apply
Annotate every command in the spec that has a declared effect.