Every model writes three kinds of record: created, updated, deleted. One row per change in the database, named after the model, post_created; no other kind at this level: publishing a post is a command, api2_publish_post, and its record is post_updated.
ALLAt a glance
HIST-01 Every model writes three kinds of record: created, updated, deleted
One row per change in the database, named after the model, post_created.
HIST-02 Every record points up to its command, named by its entry point
The call that caused the change is written first, api2_create_project, api2_publish_post; each record it causes carries its id.
HIST-03 Two levels, always
Under a command only records: never a record without one, never a command under a command.
CMD-01 A system is its commands first
Each thing it does is one command: a name, an input, an output; it starts, does its work and ends; run, read and debugged alone.
CMD-02 The app above calls the commands; they never call one another
It picks a command, packs its arguments, calls it and passes the result on.
CMD-03 Every command is drawn
One picture per command, what goes in and what comes out, and one of how they connect; made with the command, kept beside it.
CMD-04 Any command runs by hand at any time
The system is built on it: called whenever, the command reads the state and does what is left; nothing breaks.
CMD-05 The pages that depend on a command know it runs
They show its progress from the file it writes, and offer to start it again.
CMD-06 A command that runs one at a time guards itself
A second call sees the first and ends with an error that says so; the caller need not think of it.
HISTThe history of actionsA command above, its records under it.
Every record points up to its command, named by its entry point. The call that caused the change is written first, api2_create_project, api2_publish_post; each record it causes carries its id.
Two levels, always. Under a command only records: never a record without one, never a command under a command.
history.mdCMDA system as commandsSmall commands, each like a function; a system above calls them.
A system is its commands first. Each thing it does is one command: a name, an input, an output; it starts, does its work and ends; run, read and debugged alone.
commands.mdThe app above calls the commands; they never call one another. It picks a command, packs its arguments, calls it and passes the result on. A command takes its arguments, runs as often as needed, and is read apart from the rest.
commands.mdEvery command is drawn. One picture per command, what goes in and what comes out, and one of how they connect; made with the command, kept beside it.
commands.mdAny command runs by hand at any time. The system is built on it: called whenever, the command reads the state and does what is left; nothing breaks.
commands.mdThe pages that depend on a command know it runs. They show its progress from the file it writes, and offer to start it again.
commands.mdA command that runs one at a time guards itself. A second call sees the first and ends with an error that says so; the caller need not think of it.
commands.mdNo rule matches that.