Skip to content
CodelessOps

/architect · Under the hood

How it's built.

A language model writes the answers. Everything it knows about your model comes from code that parses your exports, and everything it says is checked by code before you see it. This page is the detail.

The Anaplan grammar

It reads your formulas as formulas, not as text.

Anaplan's formula language has no published grammar, so I wrote a parser for it. On top of that sits the estate report: it loads your Line Items, Modules and Actions exports, builds the graph of what reads what, and runs a fixed list of tests. /architect is built on both. That's why it can break a formula into its branches, count a reach exactly, and refuse a plan whose formula doesn't parse.

A formula in parts CAL10 Depreciation.Charge, from the demo

IFISBLANK(INP04 Capex.Asset Class)THEN0
ELSE IFINP04 Capex.Useful Life Years = 3THENMOVINGSUM(INP04 Capex.Capex Spend, -35, 0) / 36
ELSE IFINP04 Capex.Useful Life Years = 5THENMOVINGSUM(INP04 Capex.Capex Spend, -59, 0) / 60
ELSE IFINP04 Capex.Useful Life Years = 7THENMOVINGSUM(INP04 Capex.Capex Spend, -83, 0) / 84
ELSE IFINP04 Capex.Useful Life Years = 10THENMOVINGSUM(INP04 Capex.Capex Spend, -119, 0) / 120
ELSE IFINP04 Capex.Useful Life Years > 10THENMOVINGSUM(INP04 Capex.Capex Spend, -239, 0) / 240
ELSEINP04 Capex.Capex Spend / 12

Read by the parser, not by the model: six branches and a fallback, 3 inputs. The answer it fed took 140 words.

The tools and the loop

The model doesn't hold your estate. It asks for it.

Each question runs a loop. The model plans, calls a tool, reads what comes back, and calls another, until it can answer. The tools are plain functions over the parsed exports and the document index. When the draft is long, one more model call cuts it, and that editor may only cut. Then code checks the result.

  1. Your question
  2. Model: plan, call a tool, read, repeat
  3. Tools: code over your exports and documents
  4. Draft, then an edit that may only cut
  5. Validator: code, not a model
  6. Answer

One real run the CR-031 build plan from the demo, step by step

  1. 1 plan
  2. 2 list_models
  3. 3 read
  4. 4 search_documents
  5. 5 get_object
  6. 6 get_object
  7. 7 action_plan
  8. 8 read
  9. 9 search_documents
  10. 10 get_section
  11. 11 get_object
  12. 12 get_object
  13. 13 read
  14. 14 get_section
  15. 15 get_section
  16. 16 get_section
  17. 17 read
  18. 18 validate_formula
  19. 19 read
  20. 20 build_plan
  21. 21 answer
  22. 22 validator

7 model calls, 14 tool calls, 1 check. It validated the formula and the plan with tools before it wrote a word of the answer.

The tools it can call

Read the models

What is there, what reads what, how big it is.

list_modelsfindget_objectexplainlineageimpactactionssizequery_line_items

Read the documents

Search, then read a section in full before quoting it.

search_documentsobject_documentsget_section

The review

The tests run over the exports, and the ranked plan.

testsaction_planlist_patternsget_patternrule

Propose a build

Parse a formula, then check a whole plan.

validate_formulabuild_plan

Only when you say so

Record your decision or your word, with your reason.

set_edge_stateset_statusset_action_statepropose_actionremember

The names are the ones in the code today. The last group changes nothing unless you asked for it in the conversation.

The validator

A language model writes the answer. Code checks it.

Here is a draft with two things wrong in it. Press through what happens before it reaches you.

1 · The draft. What the language model wrote. Two things in it are wrong, and it reads fine.

The mapping in CAL03 Opex.Forecast Opex was a change-control decision. The design record says: "The account-to-driver mapping is written into the IF chain of CAL03 Opex.Forecast Opex because Finance Systems did not want planners, or anyone outside Finance Systems, to be able to edit a mapping table" ¶ 4.3. It adds that "a locked mapping module was judged too risky" ¶ 4.3, and the same mapping is kept inSYS08 Account Mapping.

2 · The check. Code looks every name up in the exports and every quote up in the section it cites.

  • ✓Name CAL03 Opex.Forecast Opexin the exports
  • ✕Name SYS08 Account Mappingnot found: the model has no such module
  • ✓Quote "The account-to-driver mapping is written into the IF chain…"in section 4.3, word for word
  • ✕Quote "a locked mapping module was judged too risky"not in section 4.3 word for word: counted apart, never as found
  • ✓Why rests on a passageso it may give a reason

3 · What you see. The answer, with what couldn't be supported flagged on it. Not smoothed over, not hidden.

The mapping in CAL03 Opex.Forecast Opex was a change-control decision. The design record says: "The account-to-driver mapping is written into the IF chain of CAL03 Opex.Forecast Opex because Finance Systems did not want planners, or anyone outside Finance Systems, to be able to edit a mapping table" ¶ 4.3. It adds that"a locked mapping module was judged too risky" quote not checked, and the same mapping is kept inSYS08 Account Mapping not found.

Flagged 1 name not found · 1 of 2 quotes found · 1 quote not checked

An illustration. The draft is built from a real demo passage with two faults I planted by hand; the module SYS08 Account Mapping doesn't exist in the demo model. The flags are drawn here, not captured from the app.

Checked on every answer

Names
Every model, module, line item and action the answer names is looked up in your exports. One your model doesn't have is listed as not found.
Figures
Every number must come from what the tools returned for that question.
Quotes
Every quoted passage must be in the section it cites, word for word.
Why
A why-answer must rest on a passage or an owner note. With neither, it says Not recorded.
Plans
A build plan isn't shown at all unless every formula parses, every name it uses exists or is built by the plan, nothing is built before what it refers to, and no change closes a circular reference.

All eight demo answers on the main page came back clean. More in the validator's own page.

Lean context

What goes to the model, and what's left out.

A good answer comes from a small, relevant context, not from pouring everything in. The budget for one answer is 32,000 tokens, enforced in code. This is what the model was given for the first demo question, and the same list sits under every answer in the app.

18,401 of 32,000 tokens

0budget: 32,000

  1. Instructions7,992

    Every answer: the instructions, the validator's rules and the tool definitions.

  2. The estate in brief6,330

    Every answer: the models, their sizes, feeds, the leading patterns and decisions.

  3. 6 document cards1,091

    Always in context, so it knows which documents exist. Cards only, not the documents.

  4. The question23

    As asked.

  5. 6 owner notes556

    Retrieved for this question.

    • Forecast Opex: why the mapping is in the formula86
    • Benchmark Opex was a Q3 temp fix59
    • Workforce rates are keyed by hand: the FP&A feed is not live83
    • Pack views keep Versions on purpose141
    • CAL05 Opex OLD is kept on purpose, for now83
    • FP&A: read these modules first104
  6. 2 tool results1,333

    What it looked up: only the rows it asked for.

    • The models and the feeds between them678
    • Document search: section hits (snippets only)655
  7. 2 sections pulled1,076

    Read in full for this question, because the answer rests on them.

    • Caldergate FP&A: design decision record v1.2 · 4.3 Opex forecast logic805
    • CR-031: Legal fees driver in the opex forecast · Wider point: the mapping271

Left out: everything else. The six documents went in as cards only; a section goes in when the answer reads it. Line items go in as a count and a few rows, never as the whole list.

From the recorded run of "Why is the account mapping written into the Forecast Opex formula instead of a lookup table?". Sizes are the app's own estimates, at four characters to a token. The context view, in the repo.

Tracing, with consent

Each login decides what is traced. Nobody decides for them.

Every answer keeps its own run timeline, with no outside account. Whoever runs the app can also send runs to LangSmith. On a shared instance that would let the operator read other people's questions, so what is sent is each login's own choice, for that login's own questions.

Off
Nothing. Not even that a question was asked.
Structure
A run tree: the tool names and their order, sizes, tokens, timings, the verdict's counts. Not the question, the answer, document text or any object name.
Full
The same tree with the content.

Tracing, in the repo

Planual flags

It flags the Planual rules it can see in an export.

As followed or departed from: 18 rule numbers across 24 checks. It does not check the Planual. A flag is advisory. A departure never rejects a plan, because you may have a reason, and often a document or a note already records it. Only rule numbers and the tool's own wording appear.

On a build plan CAL03 Opex.Forecast Opex, in the demo's CR-031 plan

  • Departs from Planual 2.02-01, 2.02-0213 IF THEN ELSE in one formula
  • Departs from Planual 2.01-08, 2.01-09ITEM in a 5,017,824-cell line item
  • Departs from Planual 2.02-02, 2.02-18144 tokens
  • As per Planual 2.01-09, 2.02-12no hard-coded figure: what it uses is read from line items

On the review, each finding card carries the rule numbers it rests on, or says it is the tool's own test.

Reviewed before release, and open for you to check

Ten security issues found and fixed. The code is yours to read.

Before release, in November 2026, the code was reviewed by a separate AI reviewer with no part in building it. It found ten security issues, including one that broke workspace isolation. All were fixed, each with a test. The whole codebase is on GitHub under the MIT licence. You're welcome to run your own security review, and I'd like to hear what you find.

What it won't do

The honest list.

Back to /architect and the eight questions

/architect is an independent product. It isn't made with Anaplan, agreed with them, affiliated with them or endorsed by them. Anaplan and the Planual are its owner's. Everything shown here is the fictional Caldergate demo.