OfficeSpeak · Stage 2

From a description
to real, running code.

Stage 1 got you a team, explained and corrected in plain English. Stage 2 turns that into something that actually runs — checked, not guessed, every step of the way. The result is a Python program.

described team
matched & approved
running system
Recap

Where Stage 1 left off.

market data value opportunity manager accountant the file

This exact team, described, explained, and corrected in Stage 1. It ended with one file — a hand-off file that is a program template — with two kinds of blanks still open.

The vocabulary

Every worker is
one of four kinds.

Source
Gets information from outside the office.
e.g. the weather source polls a public forecast API.
Sink
Puts information outside the office.
e.g. jsonl_recorder writes each result to a file.
Transform
Does the actual thinking. Specified either as an LLM prompt or as a Python function.
prompt: "decide if this news item is relevant, and why" (VAL) · Python: a fee calculator (ACCOUNTANT)
Coordinator
Standard, pre-built OfficeSpeak workers — never something you specify or that gets generated.
e.g. merge_synch, gate, select
What Stage 1 hands off

One blank:
which source or sink?

Stage 1 writes this file automatically the moment its conversation ends. Every worker's name, job description, and message shape from that conversation is already in it — but which real, registered source or sink each one maps to is still open.

investment_club_handoff.py
dict(name="RECOMMEND", kind="sink", ... registered_as=None)

registered_as=None — what's left? Match it against the registry, or register something new if nothing fits (next).

What Stage 1 hands off

The other blank:
can it be trusted?

The same file also marks every worker's actual code or prompt as unapproved, until it's tested.

investment_club_handoff.py
dict(name="ACCOUNTANT", kind="transform", ... body_fn=None, approved=False)

approved=False — what's left? Verify that this worker can be trusted, one test at a time.

Step 1

Match it to something real.

The quoted phrase below is Pat's own words from Stage 1 — carried straight through into the hand-off file as this worker's description, not written by whoever does this matching step.

clean match
"writes the final plan to a file" → jsonl_recorder (path="recommendations.jsonl") — appends one line of JSON per period. No credentials needed.
Step 1, continued

Or flag it.
Never guess.

🚩
nothing fits
"a batch of market data, forecasts, and news" — no registered source polls Yahoo/Bloomberg/news and bundles it. Flagged, not guessed — stands in as a fixed test sequence for now, kicked off by the registered starter.

"Nothing fits" is a normal, common outcome here — not a failure. And it's rarer than the built-in list alone suggests: mcp_source/mcp_sink can already reach any server in the MCP Registry (500+ community servers — Google Drive, Notion, Postgres, Discord, and more), so check there before concluding it's unsupported. What's left, if truly nothing fits? Specify and register a new source or sink — a small Python class, following an existing entry's pattern, not a redesign. See phase3_source_sink_matching.md's "When nothing fits" for the full order of checks.

Step 2

Test each worker.

Here's the accountant, tested alone: one message in, and everything it does before answering.

the accountant, tested on real numbers
IN (manager's proposal): {"period": 1, "proposed_shares": 8}
OUT asks the ledger for current holdings, first — before pricing anything
IN (ledger's reply): {"aapl_shares": 0, "cash": 10000.0}
OUT {"fee": 8.0, "current_shares": 0, "current_cash": 10000.0}

This is the worker Stage 1's correction changed — it now checks current holdings first, exactly as asked. Only after a real test like this does it get approved.

Step 3

One command.
Then run it.

terminal
$ python -m dissyslab.office.assemble investment_club_handoff.py investment_club_office
$ dsl build investment_club_office
$ dsl run investment_club_office

The first command writes office.md and one file per worker. Then it builds, then it runs.

The result

Real numbers.
Not a mockup.

This isn't another isolated test — it's the whole office, actually running, start to finish.

recommendations.jsonl
period 1 → buy 8 shares, fee $8.00
period 2 → buy 16 shares, fee $16.80
period 3 → buy 24 shares, fee $26.40

The fee correctly grows from what the club already held each period — exactly the correction from Stage 1, now provably true, not just described.

Checked.
Then trusted to run.