Put the expertise in the code.

Operating Code is the agent-facing code for any system. What you keep in CLAUDE.md, AGENTS.md, rules, skills, workflows and memory moves into the functions agents call, so a day-1 agent in any harness gets the veteran’s answer. Every correction ships as a release that every agent gets on its next call.

  • struck from the file
  • carried by code
  • working answer
AGENTS.mdhand-writtengenerated
payables/release 0.41.0
AGENTS.mdintopayables/
# Accounts payable
- Invoice numbers repeat across suppliers. Match on supplier + number.
key = InvoiceId(inv.supplier, inv.number)
- Bank details changed since the last payment? DO NOT release. Hold it.
if bank_changed(sup): return hold("bank_changed", sup)
- Price tolerance is 2%. Quantity tolerance is zero.
Rule("payables.price_tolerance", 0.02)Rule("payables.qty_tolerance", 0)
- Never convert currencies. Compare in the invoice currency.
Money(120, "EUR") + Money(80, "USD")# raises MoneyMismatch
- Freight lines: no tolerance agreed yet. Ask finance before approving.
Answer("payables.freight_tolerance", status=PROVISIONAL, owner="lead:finance")
- Don't touch the ERP directly. All writes go through the scripts.
# house: holds no ERP credentialspayables.release(inv) # the only write path
> generated by orient(): nothing to maintain here
✓ test_no_handwritten_agent_docsrelease 0.41.0

Agents run on text. The text doesn’t run.

Today the know-how sits beside the code, in CLAUDE.md, AGENTS.md, rules files, skills, workflow docs and memory notes. Every session, the model rereads it and decides what it means.

It drifts.
Nothing fails when a paragraph goes stale. The code changes; the file does not.
It is interpreted.
Two models, or one model twice, read “revenue excludes trials” differently. They can also all agree on the wrong join.
It is optional.
A rule a model must obey is a rule a model can break. With raw SQL in reach, every rule is advice.
It is per-harness.
CLAUDE.md for one tool, AGENTS.md for another. Memory stays in the harness that wrote it, and a lesson that is not in a release is not in the system.
It cannot be tested.
You cannot run a paragraph, measure it, or see which answers depended on it.
It grows with the system.
Every new trap is another paragraph in every agent’s context.

Cognitive debt is anything someone must know to get a right answer that the system neither tells them nor enforces.

Operating Code pays it down into code. What an agent had to remember, the system now tells it or enforces.

The collapse

Every instruction has a home in the code.

Agents are steered with prose beside the code: instruction files, rules, skills, workflow docs, memory notes. Operating Code moves each of them into the functions agents call, where it runs, is tested and ships with every release.

What you steer agents with

A generated orientation page

What CLAUDE.md and AGENTS.md try to say, orient() renders from the executable definitions, once per release.

What you’d write for a CMS

CLAUDE.md
# Publishing Read this file first, then docs/content-model.md. - Statuses: draft, review, scheduled, published.- Embargo times are UTC.- Check alt text and internal links before publishing.- Finance articles need legal review. Last updated March 2025.

What it becomes

terminalcontent 0.41.0
$ oc house orient  release        content 0.41.0, definitions 7d02e1…  read in order  orient find describe check evaluate explain  concepts       article translation embargo blocker  published      live on the site; scheduled is not published✓ rule           content.embargo_site_time✓ rule           content.translation_inherits✓ rule           content.legal_review_finance  blockers       alt_text internal_links legal_review embargo~ fact           content.alt_text_min_length  provisional  not supported  unpublishing, comment moderation  changed        content.translation_inherits  new  words          "go live", "push out"  (authored)
  • orient() renders one page per release from the definitions: concepts and their default meanings, allowed values, facts and their status, rules, what is not supported, what changed.
  • Every operative line is read from code. Labels and synonyms live inside the definitions and are marked (authored).
  • The reading order is in the protocol. The server hands it to every client at connect time.
  • About a dozen verbs serve hundreds of functions, and a test fails if a CLAUDE.md, AGENTS.md, SKILL.md or GEMINI.md ships.

A stale page has nowhere to live.

Rules inside the call

The rule runs where the number is computed, so a caller that never read the rules file still meets it.

What you’d write for an ERP

rules/payables.md
# Payables rules - Never run raw SQL against the ledger.- Never add amounts in different currencies.- Price tolerance is 2%.- Only read invoices, receipts and purchase orders.

What it becomes

agent sessionpayables 0.41.0
>>> evaluate({"sql": "SELECT sum(amount) FROM ledger"})Refused("not_in_grammar",    allowed=["fn", "args", "group_by", "period"]) >>> evaluate({"fn": "payables.open_amount"})Refused("currency_mix", fixes=[    Fix({"group_by": ["currency"]}, "meaning-preserving"),    Fix({"where": {"currency": "EUR"}}, "meaning-changing")]) >>> rule("payables.price_tolerance")Rule(value=Pct(2), status="established",     evidence="ap/match_invoice.sql@r812:41") >>> describe("payables.match").reads["invoices", "receipts", "purchase_orders"]
  • What is forbidden is what cannot be spelled. Callers send a closed expression of released ids and typed literals: no SQL, no table name, no callable.
  • A refusal names what is allowed and suggests fixes labeled meaning-preserving, which an agent may apply, or meaning-changing, which it must ask about.
  • Types refuse. Money is exact, rejects floats, and raises instead of converting between currencies.
  • Each rule is a record with an id that results cite, a status and evidence pinned to a source revision. Reads are declared, and the serving process holds no database credentials.

A direct caller meets the same rule as a guided one.

Operating functions, found by discovery

A skill becomes a registered function. Agents find it by asking the library, not by loading the right file.

What you’d write for marketing analytics

skills/campaign-revenue/SKILL.md
---name: campaign-revenuedescription: Use when asked for revenue by campaign.---1. Join orders to sessions on utm_campaign.2. Use last-touch attribution.3. Subtract refunds.4. If several campaigns match, use the newest one.

What it becomes

agent sessioncampaigns 0.41.0
>>> find("revenue by campaign")["campaigns.attributed_revenue"] >>> describe("campaigns.attributed_revenue")Function(args={"campaign": CampaignId, "period": Period},    reads=["orders", "refunds", "sessions"],    evidence=["reports/attribution.sql@r340:12-58"],    assumes=["attribution model is last_touch"],    version="@9f3c1a") >>> resolve("spring sale revenue in September")Alternatives("campaign", {    "CMP-2207": "Spring sale, email",    "CMP-2211": "Spring sale, paid social"})
  • An operating function is a plain function with a declaration: typed arguments, declared reads, evidence (the source lines it reproduces), assumes and search words.
  • Its version is the digest of its own source. assumes is repeated in every result, so a guess can be corrected later.
  • Discovery is pure functions over an index generated from the code: find, resolve, describe, complete, explain. Every unknown says what would resolve it.
  • Every inferred slot records its source: explicit, rule or default. An ambiguous request returns named alternatives, never a silent pick.

An agent cannot skip a step it does not perform.

Next steps computed from the record

A workflow is a stream of accepted steps. What comes next is computed from it, for whichever harness asks.

What you’d write for project delivery

workflows/risk-review.md
# Weekly delivery risk review 1. Pull every open task in the portfolio.2. Ask the PM for any missing estimates.3. Flag tasks blocked by an open task.4. Write the summary for the steering call. If you get interrupted, start again from step 1.

What it becomes

terminalprojects 0.41.0
$ oc next review:PF-12/2026-W43✓ open_tasks       accepted  agent:codex via codex  flag_blocked     ready     claim: agent:claude, advisory~ summary          waits     for flag_blocked, estimate_rollup✕ estimate_rollup  blocked   missing estimate PRJ-88/T-1203 $ oc next build --area projects✓ projects.at_risk           accepted  0.41.0  projects.working_calendar  ready     no claim~ projects.portfolio_report  waits     for working_calendar  plan: 212 steps, no cycles
  • A multi-step analysis is a stream of events, and its state is the fold.
  • next_steps says what is ready, what waits and what is blocked, and names the missing fact.
  • Any harness can stop after an accepted step. Another harness resumes, and nothing accepted runs again.
  • The build plan is a dependency graph in code with cycle checks. Agents pull ready work under advisory claims that never block. The library never runs an agent or picks a model.

Any harness resumes where the last one stopped.

Cases, facts and the record

What an agent would jot down becomes a worked case, a recorded answer or an entry in the append-only record.

What you’d write for a SIEM

memory/MEMORY.md
# Memory - 14 Oct: the u-4471 travel alert was the VPN. False positive.- Alerts from the fra-2 egress range are usually VPN.- Travel window is 2 hours (confirmed by the SOC lead).- Unknown device posture means unmanaged.

What it becomes

identity/cases.pyidentity 0.41.0
Case("identity.impossible_travel/vpn-egress",    question="Did u-4471 travel impossibly on 14 Oct?",    dataset="snap:sha256:c41e9a…",    expected=Complete(False),    derivation="both sign-ins leave via EGRESS['fra-2']",    by="agent:codex")   # not the implementation's author Answer("identity.travel_window", revision=3, value=hours(2),    basis="lead:secops", status="established") Case("identity.device_managed/unknown-posture",    dataset="snap:sha256:c41e9a…",    expected=Partial(gaps=["posture:d-2290"]),    by="agent:codex")   # unknown is a gap, not unmanaged
  • An expected-outcome case is memory and eval at once: one question, one pinned dataset, one hand-worked answer, written by a different agent from the implementation.
  • “I cannot say, and here is the missing fact” is an expected outcome too. Held-back cases live in the evaluator’s store, and authors never read them.
  • Every business fact is an Answer with a revision, a basis and a status: established or provisional. Every result lists the answers it used.
  • Every discovery call is recorded, empty ones included. The append-only record is the only home of what was accepted.

A remembered answer is a tested answer.

Traps encoded as code

What the veteran knows becomes a helper that cites its source, a row that trips the naive reading, and a test.

What you’d write for a CMS

wiki/publishing-gotchas.md
# Publishing gotchas Things the web desk learned the hard way: - Embargo times are site-local, not server time.- A translation never goes live before its parent.

What it becomes

content/embargo.pyhelper, row, test
def embargo_lifts(a: Article, site: Site) -> Instant:    """cms/publish.php@r2214:212: embargo is site-local."""    own = a.embargo.at(site.time_zone)    if a.translation_of:              # inherits its parent's        return max(own, embargo_lifts(a.translation_of, site))    return own # fixtures: trap "translation_before_parent" (synthetic)Row("ART-5512", embargo="2026-10-24 09:00")Row("ART-5512-de", translation_of="ART-5512",    embargo="2026-10-24 06:00")    # own embargo is earlier def test_translation_waits_for_parent():  # worked by hand    now = utc("2026-10-24 05:30")         # site time 07:30    r = publish_readiness("ART-5512-de", now=now)    assert r.embargo_until == utc("2026-10-24 07:00")
  • Every trap becomes four things: a helper that cites its source line, a synthetic row that trips the naive reading, a test worked out by hand, and an assumes entry if a guess was needed.
  • Fixtures declare their traps by name next to the rows that trigger them, and mark every stand-in fact as synthetic.
  • A second, independent agent re-derives each area against the source. Each finding becomes a fix, a fixture and a test pinned to the source’s value.

A day-1 agent gets the veteran’s answer.

Pinned decisions and working answers

Where a model still decides, it answers a closed question pinned to an exact version, and its verdict is recorded once.

What you’d write for a SIEM

CLAUDE.md
## Revoking sessions - Use your judgment on whether a sign-in is a takeover.- Only revoke when you are confident.- If unsure, page the on-call analyst and wait.

What it becomes

identity/response.pyidentity 0.41.0
@decision("identity.takeover",    question="Is this sign-in an account takeover?",    options=["takeover", "benign", "none of these"],    evidence="signin_features@v7",    model="decider-2.4.1", threshold=0.92,    fallback=Alternatives("takeover", "benign"))def takeover(signin: SignIn) -> Verdict: ...# one recorded verdict per key, replayed for every caller @action("identity.revoke_session", effect="session.revoked",    requires=[corroborated(signals=2)])def revoke_session(session: SessionId, signals: list[Signal]):    ...   # refuses with the missing signal; never waits
  • A model enters only for a closed judgment: question, options (always a none of these, never an unclear), evidence version, exact model version, threshold and fallback. Its id is a hash of them all.
  • Below the threshold is abstention. One accepted verdict per request key is recorded before anything depends on it, so two harnesses on the same input agree.
  • When the route cannot decide, the declared fallback applies. It never escalates to the caller’s own model.
  • Open business questions become work items for a domain lead, with a working answer, labeled provisional, in the meantime.

Nothing waits on a person.

The release loop

A correction becomes a candidate, the installed release judges it, and every agent gets the result on its next call.

What you’d write for project delivery

LESSONS.md
# Lessons When someone corrects you, add a line hereso you remember it next session. - Unassigned tasks are not "on track". Flag them.- "Slipping" means at risk.

What it becomes

terminalrelease 0.40.0
$ oc loop show N-0193  signal     refused call on projects.at_risk/unassigned             from a day-1 agent via custom-loop  need       1 target, 3 neighbors, 305 preserved cases             impact probe: flips 2 tests, owner lead:delivery  candidate  C-0193a from agent:nightly via custom-loop  judge      installed 0.39.0, separate process✓ eligible   no tampering, 0 regressions, held-back 9/9✓ release    0.40.0, preserve set 305 to 311  next call  projects.at_risk@e86b14 in every harness $ oc loop show N-0194  signal     miss: find("slipping projects") was empty✓ release    0.40.0, words += "slipping"
  • A signal is a failing case, a correction, a refused question, a miss in discovery or a cross-check finding. A table in code routes it.
  • Code assembles the Need: the failing case, the affected definitions, neighbors that must stay different, and which tests the change would flip.
  • Any agent in any harness proposes a candidate. The installed release judges it in a separate process, with held-back cases the candidate cannot see.
  • The release swaps atomically and the preserve set grows. Changes to the judge go to a named authority who is not the proposer.

A lesson that is not in a release is not in the system.

Anatomy of an operating function

Expertise, as a function

An operating function is a plain function with a declaration. The declaration is at once the documentation, the search index, the validator and the provenance.

Same anatomy, any system

payables/match.py@9f3c1a
@op("payables.match", "Match an invoice to its order and receipt",    args={"invoice": InvoiceId},  # scoped: (supplier, number)    reads={"invoices": ("supplier", "number", "lines", "currency"),           "orders": ("po", "line", "qty", "unit_price"),           "receipts": ("po", "line", "qty_received")},    evidence=["ap/matching.sql:12-48", "ap/tolerances.py:7-19"],    assumes=["A credit note always cites its original invoice."],    words=["three-way match", "match invoice", "Rechnungsabgleich",           "rapprochement de facture", "conciliar factura"])def match(t, a):    """Match each invoice line to its order line and goods receipt."""    inv = t.invoices.get(a.invoice)  # numbers repeat across suppliers    rows, gaps = [], []    for ln in inv.lines:        po = t.orders.line(ln.po, ln.po_line)        gr = t.receipts.line(ln.po, ln.po_line)        if gr is None or gr.qty < ln.qty:  # a partial receipt is a gap            gaps.append(Gap("receipt.qty", line=ln.no))            continue        tol = rule(t, "payables.price_tolerance")  # 2%, established        kind = decide(t, "payables.line_kind", ln)  # pinned, replayed        if kind == "freight":  # freight tolerance is an open question            tol = answer(t, "payables.freight_tolerance")  # provisional        rows.append(line_match(ln, po, price=tol, qty=0))  # qty exact    # Money is exact: adding EUR to USD raises, nothing converts    return result(rows, gaps)

What it returns

Every call returns one of five outcomes. Only Complete gives a plain number. A gap is named, never filled with zero or a guess. Missing is a value.

  • CompleteA plain value. The only outcome that gives one.this call
  • PartialWhat it could compute, and each gap by name.this call
  • UnavailableEvery missing fact, and what would resolve it.this call
  • DisputedBoth sides. It composes with nothing.this call
  • RefusedWhat is allowed instead.this call

The provenance names the function version, the release, the data snapshot, the assumptions and every fact used, with its status: established or provisional.

payables.match(InvoiceId("SUP-0417", "88213"))Partial
{  "outcome": "Partial",  "value": [    { "line": 1, "kind": "goods", "match": "ok", "price": "+1.2%" },    { "line": 3, "kind": "freight", "match": "ok", "price": "+3.5%" }  ],  "gaps": [    { "fact": "receipt.qty", "line": 2, "invoiced": 60, "received": 40 }  ],  "provenance": {    "function": "payables.match@9f3c1a",    "release": "0.41.0",    "snapshot": "snap:7e2d90c4",    "assumes": ["A credit note always cites its original invoice."],    "facts": [      { "id": "payables.price_tolerance", "status": "established" },      { "id": "payables.freight_tolerance", "status": "provisional" }    ],    "operation": "op:sha256:7e2d4b…"  }}

Any harness

Any harness. One answer.

The run path is the same for every caller. Here four harnesses ask one question, each in its own words. Steered by prose, each improvises its own query and returns its own number. Calling the library, each walks the same verbs to the same outcome and the same operation id.

  1. ask
  2. orient
  3. find
  4. resolve
  5. check
  6. evaluate
  7. explain

explain: every gap says what would resolve it. One operation id in all four runs: op:sha256:4be19c…

Claude Codeagent:claude
> What did the spring campaign bring in last month?
• orient()  release 0.41.0, defs:7c21e0…
• find("spring campaign bring in")  campaigns.attributed_revenue @51e0d7  matched "bring in"
• resolve(…)  campaign  spring_2026    explicit "spring campaign"  month     2026-09    rule "last month"      today 2026-10-01 from context  model     last_touch    default, provisional
• check(expr)  ✓ valid, canonical expr:3a91f0…
• evaluate(expr)  Partial  EUR  41,280.00  USD  18,940.00  gap  no_currency(ord_2291)  ~ model last_touch, provisional
  op:sha256:4be19c…
  run:7f2a91  by agent:claude  via claude-code
• explain(op)  ord_2291 has no currency.    Set one to complete the totals.  last_touch applies until    lead:marketing answers.
Codexagent:codex
› Report attributed revenue for the spring campaign, last month.
• orient()  release 0.41.0, defs:7c21e0…
• find("attributed revenue spring")  campaigns.attributed_revenue @51e0d7  matched "attributed revenue"
• resolve(…)  campaign  spring_2026    explicit "spring campaign"  month     2026-09    rule "last month"      today 2026-10-01 from context  model     last_touch    default, provisional
• check(expr)  ✓ valid, canonical expr:3a91f0…
• evaluate(expr)  Partial  EUR  41,280.00  USD  18,940.00  gap  no_currency(ord_2291)  ~ model last_touch, provisional
  op:sha256:4be19c…
  run:c41d07  by agent:codex  via codex
• explain(op)  ord_2291 has no currency.    Set one to complete the totals.  last_touch applies until    lead:marketing answers.
Custom loopagent:nightly
task: Umsatz der Frühjahrskampagne im letzten Monat?
» orient()  release 0.41.0, defs:7c21e0…
» find("Umsatz Frühjahrskampagne")  campaigns.attributed_revenue @51e0d7  matched "umsatz"
» resolve(…)  campaign  spring_2026    explicit "Frühjahrskampagne"  month     2026-09    rule "letzten Monat"      today 2026-10-01 from context  model     last_touch    default, provisional
» check(expr)  ✓ valid, canonical expr:3a91f0…
» evaluate(expr)  Partial  EUR  41,280.00  USD  18,940.00  gap  no_currency(ord_2291)  ~ model last_touch, provisional
  op:sha256:4be19c…
  run:0e9b3c  by agent:nightly  via custom-loop
» explain(op)  ord_2291 has no currency.    Set one to complete the totals.  last_touch applies until    lead:marketing answers.
Person at a shellperson:ops
# spring campaign revenue, last month?
$ oc orient  release 0.41.0, defs:7c21e0…
$ oc find "spring revenue"  campaigns.attributed_revenue @51e0d7  matched "revenue"
$ oc resolve  campaign  spring_2026    explicit "spring campaign"  month     2026-09    rule "last month"      today 2026-10-01 from context  model     last_touch    default, provisional
$ oc check  ✓ valid, canonical expr:3a91f0…
$ oc evaluate  Partial  EUR  41,280.00  USD  18,940.00  gap  no_currency(ord_2291)  ~ model last_touch, provisional
  op:sha256:4be19c…
  run:b83f52  by person:ops  via shell
$ oc explain  ord_2291 has no currency.    Set one to complete the totals.  last_touch applies until    lead:marketing answers.
All four results
Claude CodePartial op:sha256:4be19c…Not yet
CodexPartial op:sha256:4be19c…Not yet
Custom loopPartial op:sha256:4be19c…Not yet
Person at a shellPartial op:sha256:4be19c…Not yet

One operation in all four

How the sameness works

Every evaluation carries an operation identity: a hash of everything that can change its answer. Callers on different harnesses, with different words and different prose in their heads, compute the same identity and get the same result. Run ids differ; operation ids do not.

Canonical expression
Canonical JSON. The same meaning is the same bytes, whoever wrote it.
Definitions fingerprint
A hash of every module that can change an answer, helpers included.
Data snapshot
Content-addressed and verified on every read.
Correction revision
The pinned corrections and decision verdicts the run used.
Context
Inputs such as today. The clock is never read, so a relative date without today is a missing input.
identity.pycampaigns.attributed_revenue
operation = hash(    canonical_expression    = "expr:3a91f0…",    definitions_fingerprint = "defs:7c21e0…",    data_snapshot           = "snap:e18a52…",    correction_revision     = "rev:58",    context                 = {"today": "2026-10-01"},)# op:sha256:4be19c… for all four callers

Sameness is measured, not assumed.

Three numbers, reported separately, each with its trial count.

Correctness
Results against independently worked cases. Agreement alone is not enough: every caller can agree on the wrong join.
Semantic agreement
Fresh callers, given only the question, reach the same meaning.
Execution agreement
Identical pinned inputs, run in isolated processes, return identical results.

The design goal: any agent, in any harness, with any decision model, gets the same result 99.9% of the time.

Judgment

When a model has to decide

Some questions need a model. It enters only for a closed question, declared as a contract and pinned to an exact model version. The verdict is recorded once and replayed, so it never differs by harness, and nothing waits on a person.

payables/decisions.pydc:c41e7a
line_kind = Decision(    "payables.line_kind",    question="Is this invoice line goods, freight or a service?",    options=("goods", "freight", "service", "none_of_these"),    evidence_version="invoice-line/3",  # the fields the model sees    route=(ProviderSpec("decider", "decider-2.4.1"),),  # exact version    threshold=0.8,    fallback="alternatives",)# no "unclear" option: below the threshold is abstention# identity = hash of all of the above -> dc:sha256:c41e7a…

Always a none_of_these, never an unclear. The contract’s identity is a hash of every field, so changing the question, an option, the model version or the threshold makes a different contract. payables.match asks it for every invoice line.

record/verdictsappend-only
{  "contract": "dc:sha256:c41e7a…",  "request_key": "rk:sha256:0d5be2…",  "route": "decider-2.4.1",  "scores": { "freight": 0.91, "service": 0.06,              "goods": 0.02, "none_of_these": 0.01 },  "verdict": "freight",  "recorded_at": "2026-10-23T09:14:03Z",  "first_caller": "agent:claude",  "replayed_for": ["agent:codex", "agent:nightly", "person:ops"]}

Set the model’s top probability

  1. Pinned route

    decider-2.4.1 answers, by exact version, for one request key. The caller’s own model is never asked.

  2. Threshold 0.8

    freight0.91
    service0.06
    goods0.02
    none_of_these0.01
  3. Cleartaken

    One verdict per request key, recorded before anything uses it, replayed for every caller after.

    Below thresholdnot taken

    The declared fallback applies. This contract declares named alternatives; others declare a default for a named use, or stop with a reason.

At 0.91, freight clears the threshold of 0.8. The verdict is recorded before anything uses it, and every later caller gets it from the record.

Never the caller’s own model. The route is part of the contract, so the harness an agent runs in changes nothing.

Never waiting on a person. When the route cannot decide, the declared fallback answers now.

Open questions get working answers

Some questions belong to the business, not to a model. Which price tolerance applies to freight lines is one. It becomes a work item for its owner, lead:finance, and a working answer applies meanwhile.

Every result that uses it says provisional. When the owner answers, the fact becomes established in a new revision. Only the narrow output that cannot be computed stays unavailable.

Nothing waits on a person.

facts/payables.freight_toleranceowner lead:finance
  1. Revision 1provisional

    5%

    Working answer. Applies until the owner answers.

    Work item for lead:finance: “Which price tolerance applies to freight lines?”

  2. Revision 2established

    5%

    The owner’s answer, recorded with its basis.

    Results from here on cite revision 2 as established.

The ladder

Every decision sits on one rung. Most of a system is plain code. A model is pinned only where a closed question needs one, and agents take what is not closed yet.

Every move down the ladder is a release: an agent’s judgment becomes a pinned question, a pinned question becomes code. Sixty uncertain decisions at 99% each all succeed about 55% of the time.

  1. T3Strong agent
  2. T2Fast agent
  3. T1Pinned decision modelA closed question, an exact model version, a threshold and a fallback.
  4. T0Plain codeTypes, rules and helpers. Most of a system lives here.

How it learns

It learns. Every agent gets the lesson.

A recorded verdict fixes the case. A released change fixes the class. Every miss, correction and finding becomes a candidate change. The installed release judges it, and every agent, in every harness, runs the result on its next call.

A cross-check finding becomes release 0.42.0.

  1. A miss, a correction, a refusal or a finding.

    • A table in code maps it to obligations.

      • Code assembles the work packet.

        • Any agent, in any harness, proposes.

          • The installed release decides eligibility.

            • One atomic swap. The preserve set grows.

              • Every agent runs the new version.

                Step 1 of 7: Signal

                A cross-check finds a wrong flag

                A nightly cross-check re-derives the identity area against the network inventory. Sign-ins through the new Frankfurt VPN egress come back as impossible travel. The inventory says they are corporate traffic.

                Who acts
                agent:nightly via custom-loop
                Result
                Signal recorded
                Installed release
                0.41.0
                Preserve set
                318 cases
                signals/sig-5d2e.jsonrecorded 02:14Z
                {  "signal": "sig-5d2e",  "type": "finding",  "source": "cross-check",  "by": "agent:nightly",  "via": "custom-loop",  "release": "0.41.0",  "function": "identity.impossible_travel@c0a95f",  "case": "travel.vpn_egress_fra",  "library_says": "travel: AMS to FRA in 6 min",  "source_says": "198.51.100.0/24 is corporate VPN egress, Frankfurt",  "source_rev": "netinv@2214"}

                What keeps it safe

                • The candidate never grades itself.The installed release judges, in a separate process, with its own runner, tests and expected answers. Not evaluable is never a pass.
                • Held-back cases never reach the author.They live in the evaluator’s store, outside the repository. One exposed while tuning stops counting.
                • The preserve set only grows.What passes now must pass next time. Only an authority’s recorded release removes a case.
                • Changes to the judge go to an authority.The evaluator, the release policy and reference truth are never eligible by policy. A named authority who is not the proposer reviews the exact artifact.
                • Nothing waits on a person.An eligible candidate releases without an approval step. A refused one re-opens its Need with the reasons attached.

                Two paths

                The run path is the same for every caller. The authoring path is where callers differ.

                Run path

                Released knowledge, pinned corrections and pinned verdicts decide every outcome.

                • claude-code
                • codex
                • custom-loop
                • shell

                Release 0.42.0

                Pinned corrections, revision 88

                Pinned decision routes

                One result for all four

                op:sha256:8c27d1…

                Authoring path

                Any agent proposes. The same judge evaluates. Leaders emerge from the record of accepted changes; standing never weakens a test.

                • claude-code
                • codex
                • custom-loop
                • shell

                The installed release judges

                Same tests, same expected answers

                Same held-back cases

                The record

                • p-2b84 custom-loop not eligible
                • p-7c1e codex released 0.42.0

                A living library

                The library you call tomorrow knows more than the one you call today.

                Every miss becomes code: a refused question, an empty search, a correction, a cross-check finding. Any agent can propose the change, every release reaches every agent on its next call, and each release adds what now passes to the preserve set. The library only gets stricter about what it knows.

                1. 0.42.0installed

                  SIEM

                  Frankfurt VPN egress is not travel

                  Released by the loop above

                  Preserve set 320+2

                2. 0.41.0installed

                  SIEM

                  Unknown device posture is a gap, not unmanaged

                  Preserve set 318+7

                3. 0.40.0installed

                  Projects

                  Unassigned tasks are never on track

                  Preserve set 311+6

                4. 0.39.0installed

                  Marketing

                  Refunds net out in the refund’s month

                  Preserve set 305+6

                5. 0.38.0installed

                  Search

                  “Not billed” never finds what was billed

                  Preserve set 299+5

                6. 0.37.0installed

                  ERP

                  Freight lines use the freight tolerance

                  Provisional until lead:finance answers

                  Preserve set 294+3

                7. 0.36.0installed

                  CMS

                  Translations inherit their parent’s embargo

                  Preserve set 291+3

                How an Operating Code library is built

                Seven steps, in order. After the fourth, the library builds itself: every later change goes through the loop, including changes to the loop.

                1. Start from the source of truth, read-only.

                  Inventory every place the existing system computes something: queries, reports, rules. Agents never touch production; synthetic datasets reproduce the schema with invented values and named traps.

                2. Pin the contracts first.

                  Formats for snapshots, expressions, outcomes and cases are fixed early and versioned, so many agents can build in parallel against the same interfaces.

                3. Write the cases independently.

                  A different agent works the expected answers by hand from the contract and the source, never from the implementation.

                4. Bootstrap the loop once.

                  The first release is installed by hand. From then on, every change is a candidate judged by the installed release.

                5. Grow the functions area by area.

                  One operating function per business question, each with its reads, evidence, assumptions and search words. A coverage ledger tracks every source site, built or skipped with a reason, until none are open.

                6. Cross-check and fold back.

                  A second, independent agent re-derives each area against the source. Every discrepancy becomes a fix, a trap fixture and a test.

                7. Let day-1 agents use it.

                  Agents in different harnesses, with nothing but the generated surface, ask questions in their own words. Their misses and refusals are the next signals.

                What every library holds to.

                Ten design calls. They hold the same way in an ERP, a CMS, a SIEM or a project tracker.

                • Instructions are an output.

                  Generate what agents read from the code they call, one page per release.

                • Put the rule where the number is computed.

                  A guided caller and a direct caller meet the same check.

                • What is forbidden is what cannot be spelled.

                  Close the grammar, and refuse with the vocabulary that is allowed.

                • Missing is a value.

                  Name the gap. Never fill it with a guess that would move the number.

                • Agents gather; decisions decide.

                  Load-bearing judgment comes from code or a pinned route, never from the caller’s model.

                • Nothing waits on a person.

                  Open questions get working answers, labeled provisional everywhere they are used.

                • A correction fixes the case. A release fixes the class.

                  A recorded verdict settles one question. A released change reaches every agent on its next call.

                • The judge is not the candidate.

                  The installed release grades every change, with cases the author cannot see.

                • Sameness is measured.

                  Correctness, semantic agreement and execution agreement are three numbers, each with its trial count.

                • Cut the theater.

                  If removing a step could not produce a wrong answer and it carries no fact about the domain, cut it.

                Others are reaching the same conclusions.

                People building with agents keep arriving at the same ideas from different directions. Here is where each one lands in Operating Code.

                Quoted from independent public discussions. They are not endorsements of Operating Code or Marbell.

                Rules that cannot be skipped

                Teams that steer agents are moving rules out of prompt files and into the systems the agents work in.

                In Operating Code a rule lives inside the call that computes the number, so a guided caller and a direct caller meet the same check. What agents read is generated from that code by orient(), so it cannot drift from it.

                See where each line goes

                Instructions are a last resort.

                Cory House@housecor (original post, opens in a new tab)

                a “company operating system” or CompanyOS, designed for agent and human collaboration

                Yohei Nakajima@yoheinakajima (original post, opens in a new tab)

                The record is the state

                Long agent work needs a durable account of what already happened, kept outside the model.

                Every accepted step lands in an append-only record, and the state is its fold. One harness can stop after an accepted step and another resumes from the record. Nothing accepted runs again.

                Ask from any harness

                The model decides what to do next. The log ensures that the runtime can always reconstruct what has already happened.

                Kun LiApache Maka (original post, opens in a new tab)

                A judge the candidate cannot tune

                An improvement loop is only as good as the check it loops against, and that check must not be the thing being tuned.

                The installed release judges every candidate in a separate process, with its own tests and held-back cases the author never sees. Only what passes ships as a release, and every agent gets it on its next call.

                Follow the release loop

                The reasoning model loops until the decision model says the answers meet the thresholds.

                Josh Rosen@JoshARosen (original post, opens in a new tab)

                Make sure to test your classifiers against human labels and don’t overfit.

                Hamel Husain@HamelHusain (original post, opens in a new tab)

                Start with one system.

                Pick the system your agents touch most, and the question they get wrong most often. That question is the first operating function.

                Marbell starts read-only from your system’s source of truth. Your agents call the first release, and every miss they hit becomes a signal for the next.

                Describe your system (opens marbell.com in a new tab)