MiniCTRMSearch

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.

Before you start

The lessons this one builds on: 533 Front end: the Deal Input Screens, 601 Valuation and reports: mark-to-market, valuation runs, position, day-over-day change.

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 / 15
Rules that change weekly
A public API as a contract

Use, configure, extend

2 / 15
Use, configure, extend
A public API as a contract

The contract

3 / 15
The contract
Running a script

The script runner

4 / 15
The script runner
Running a script

The Script Editor

5 / 15
The Script Editor
A glossary that cannot go stale

Documentation that cannot go stale

6 / 15
Documentation that cannot go stale
A glossary that cannot go stale

Generate it, and guard it

7 / 15
Generate it, and guard it
Hooks: the firm's rules, as scripts

The firm's rules are hooks, not code

8 / 15
The firm's rules are hooks, not code
Hooks: the firm's rules, as scripts

Hooks inside the one door

9 / 15
Hooks inside the one door
Hooks: the firm's rules, as scripts

The desk's first two rules

10 / 15
The desk's first two rules
A hook on a field, then ship

A hook on a field

11 / 15
A hook on a field
A hook on a field, then ship

Ship it

12 / 15
Ship it
How MiniCTRM did it

The API Glossary and the Script Editor

13 / 15
The API Glossary and the Script Editor
How MiniCTRM did it

Activity Hooks

14 / 15
Activity Hooks
What you have now

What you have now

15 / 15
What you have now

You have finished lesson 611, Scripting: an editor, a public API with a glossary, hooks on save.

Where next?

← → move · N notes · Home / End