MiniCTRM - Build Tutorial 611: Scripting: an editor, a public API with a glossary, hooks on save
→ to begin · N for the speaker notes
On a phone: Next or a swipe left to begin, Notes for the words.
What you'll learn
A scripting API kept as a public contract, with one write through DealWriteService; a runner and a Script Editor; a glossary generated from the code with a test that keeps it complete; and activity hooks - on a save, on a valuation run and on a field - that warn, refuse or fill a field in the firm's own words, so a business rule is a script the firm switches on, never a limit in the code.
A public API as a contract – The fixed set of methods a script may call, the promise that keeps them, and the one write through the one door.
Running a script – Compiled or loaded at run time, run apart from the web requests with a time limit and a log; then the editor.
A glossary that cannot go stale – Every method's prototype, meaning and whole-script example, generated from the code and kept complete by a test.
Hooks: the firm's rules, as scripts – A script that runs at a moment inside the one door, warns or refuses in the firm's words; then the desk's first two rules.
A hook on a field, then ship – The piece lesson 533 left open: a rule that runs as a trader leaves a field, and again on every save; then /ship.
How MiniCTRM did it – The API Glossary and the Script Editor, and the Activity Hooks screen, live.
Copyright 2026-2027 Brian Shydlo. MiniCTRM is source-available under the PolyForm Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0): free for learning and other noncommercial use; no changes and no redistribution; commercial use needs permission.
Welcome
Rules that change weekly
1 / 15A public API as a contract
Use, configure, extend
2 / 15A public API as a contract
The contract
3 / 15Running a script
The script runner
4 / 15Running a script
The Script Editor
5 / 15A glossary that cannot go stale
Documentation that cannot go stale
6 / 15A glossary that cannot go stale
Generate it, and guard it
7 / 15Hooks: the firm's rules, as scripts
The firm's rules are hooks, not code
8 / 15Hooks: the firm's rules, as scripts
Hooks inside the one door
9 / 15Hooks: the firm's rules, as scripts
The desk's first two rules
10 / 15A hook on a field, then ship
A hook on a field
11 / 15A hook on a field, then ship
Ship it
12 / 15How MiniCTRM did it
The API Glossary and the Script Editor
13 / 15How MiniCTRM did it
Activity Hooks
14 / 15What you have now
What you have now
15 / 15
You have finished lesson 611, Scripting: an editor, a public API with a glossary, hooks on save.