Document 5 — Selective Instructions Sparse Recipes

Large source data with sparse instructions. Why instructions only touch targeted nodes and omit unneeded data.

We have already seen that the structure can grow by adding new roots and children without changing the traversal mechanism.

Now we make the source considerably larger. The important point is that the source can contain much more information than the instructions need to address.

Instructions are mandatory: A node is acted upon only when an instruction exists for that node. There is no fallback behavior.

1. A Larger Source

Imagine that our source contains several parts of an enterprise order:

{
  "customer": {
    "name": "Keshav",
    "email": "keshav@example.com",
    "phone": "9876543210"
  },
  "order": {
    "id": "ORD-101",
    "date": "2026-10-07",
    "status": "confirmed"
  },
  "product": {
    "code": "P-100",
    "name": "Laptop",
    "price": 75000
  },
  "shipping": {
    "address": {
      "city": "Kakinada",
      "state": "Andhra Pradesh"
    },
    "method": "Express"
  }
}

This is a much larger source. Yet the traversal engine does not need to become more complicated.

2. Instructions Are Selective

We do not have to attach a function to every value in this source. Instead, we explicitly describe only the locations we want to act upon:

{
  "customer": {
    "name": {
      "transform": "logPath"
    }
  },
  "order": {
    "id": {
      "transform": "logPath"
    }
  },
  "shipping": {
    "address": {
      "city": {
        "transform": "logPath"
      }
    }
  }
}

Notice what happened: The source is large, but the instructions are small. Only three locations have instructions, so only those three locations become function points.

3. What the Traversal Sees

customer
  └── name → transform → logPath

order
  └── id → transform → logPath

shipping
  └── address
      └── city → transform → logPath

Other source values such as customer.email, customer.phone, order.date, product.price, and shipping.method have no instruction in this example. They are simply untouched.

4. Runtime Output

I am here in the tree: customer.name Keshav
I am here in the tree: order.id ORD-101
I am here in the tree: shipping.address.city Kakinada

5. The Resulting In-Memory Object

{
  customer: {
    name: logPath
  },
  order: {
    id: logPath
  },
  shipping: {
    address: {
      city: logPath
    }
  }
}

Why This Matters

The Separation of Concerns:
  • The source describes what exists.
  • The instructions describe what should happen.
  • The external function provides the behavior.

A very large source therefore does not force us to create a very large instruction set. We select only the parts of the structure that matter.