Sharpee
Chord / Standard Library / Manipulation / cutting and digging

cutting and digging

Two tool verbs with one design (ADR-230 D3c): the platform action gates eligibility and validates the tool; the outcome belongs to the entity. cut (cutting) parses bare as cut X (also slice, chop) and tooled as cut X with/using Y (the tooled form outranks when a tool is named); dig (digging) likewise as dig X and dig X with/using Y. Eligibility is a trait (cuttable / diggable), and the tool contract mirrors the lockable key contract exactly: the trait names its implement (cuttable with the billhook; toolId/toolIds in TypeScript), and forward references are legal. A trait with no tool configured accepts any attempt. The checks run in order: no such trait yields not_cuttable / not_diggable; a declared requirement with no tool named yields no_tool; a named tool not in hand yields tool_not_held; and the wrong one yields wrong_tool.

The stdlib action then performs no mutation of its own. What a cut or dig does (bramble into a gap, earth yielding a tin) is the entity's registered implementation, and it is required: exactly one per entity, either an on cutting it / on digging it clause (the entity's own or a composed trait's) or a capability behavior for the action id (TypeScript, ADR-090). Zero or two is a load error, never a silent runtime no-op ("… is cuttable but registers no cutting implementation").

The author writes:

create the Kitchen Garden
  a room

  Bean rows, bramble, and one freshly turned seedbed.

create the bramble
  aka briar
  cuttable with the billhook
  scenery
  in the Kitchen Garden
  states: overgrown, cleared

  A wall of thorns swallowing the back fence.

  on cutting it
    change it to cleared
    phrase bramble-cleared
  end on

create the billhook

  A short curved blade on an ash handle.

create the trowel

  A hand trowel, good for nothing woody.

create the seedbed
  aka bed, soil
  diggable
  scenery
  in the Kitchen Garden

  A patch of dark earth, recently disturbed.

  on digging it, once
    move the seed tin to the Kitchen Garden
    phrase tin-unearthed
  end on

create the seed tin
  aka tin

  A rusted biscuit tin, rattling faintly.

create the player
  starts in the Kitchen Garden
  carries the trowel
  carries the billhook

define phrases en-US
  bramble-cleared:
    The billhook hacks a gap through the thorns; the back fence shows through.
  tin-unearthed:
    A few trowelfuls down you strike metal, and lever out a rusted seed tin.

The player sees:

> cut the bramble
You need something to cut the bramble with.

> cut the bramble with the trowel
The trowel won't cut the bramble.

> cut the bramble with the billhook
The billhook hacks a gap through the thorns; the back fence shows through.

> dig the seedbed
A few trowelfuls down you strike metal, and lever out a rusted seed tin.

> dig the seedbed
You dig the seedbed.

> take the tin
Taken.

The platform ran every check (the declared implement missing from a bare cut, the wrong tool, the winning tool) and mutated nothing itself; both outcomes are the entities' own clauses, and the second dig, its , once spent, falls through to the generic dug stub.

cut (cutting-*)dig (digging-*)
Refusalsno_target · not_cuttable · no_tool · tool_not_held · wrong_tool · cant_cutno_target · not_diggable · no_tool · tool_not_held · wrong_tool · cant_dig
Successcut (the generic stub — the entity's own text renders over it)dug (same)
Eventscut / cut_blockeddug / dug_blocked

Interceptors: on cutting it / on digging it are the implementation here; the target's interceptor is consulted first, then an explicitly named tool's, and a cursed knife can veto the cut. Composing cuttable/diggable obliges the entity to register exactly one implementation.