Sign in
Vanja Oljacatechnical field notes

2026-08-08

The org chart should compile

i think we're all collectively working on solving the "enterprise architect who can't keep up with code so gives up and retreats" problem

my solution is everyone in management chain personally owns code. 1 manager = 1 class file

that class file replaces the phone tool. instead of saying who your reports are, you just import that person's class

and your class file shows what data endpoints etc you own, & route

The idea in three files

ceo.ts

export class CeoModel {
  owns = [RootEnvironment]

  company = {
    product: engineering,
    trust: security.expectations,
    money: finance.expectations
  }
}

export const ceo = new CeoModel()

import { engineering } from "./engineering-manager"
import { RootEnvironment } from "./environments"
import { finance } from "./finance-manager"
import { security } from "./security-manager"

engineering-manager.ts

export class EngineeringManagerModel {
  deployment = EngineeringDeployment
  owns = [EngineeringDeployment, RootEnvironment.test]
  awareOf = [RootEnvironment.production, RootEnvironment.beta]
  inputs = [UpgradeUser]
  outputs = [UserUpgraded, BillingRequested]
  store = UserStore

  passesUp = {
    customerApi: this.deployment.outputs.customerApi,
    userDataBoundary: this.deployment.outputs.userDataBoundary
  }
}

export const engineering = new EngineeringManagerModel()

import { EngineeringDeployment } from "./TeamDeployment"
import { BillingRequested, UpgradeUser, UserUpgraded } from "./events"
import { RootEnvironment } from "./environments"
import { UserStore } from "./UserStore"

BackendService.ts

export class BackendService {
  constructor(private users: UserStore) {}

  upgradeUser(userId: string, plan: Plan) {
    const user = this.users.find(userId)
    const upgraded = { ...user, plan }
    this.users.save(upgraded)
    return upgraded
  }
}

import type { Plan, UserStore } from "./UserStore"

the nice thing about this is it generalizes down

that manager's code represents their internal mental state, how they think of the current system (their patch)

their reports are responsible for connecting to that system to achieve expected results

if that mental model is wrong, it needs to be manually updated by someone who update's that manager's mental model

that results in the manager updating their code

The model connected to production code

ceo.ts

export class CeoModel {
  owns = [RootEnvironment]

  company = {
    product: engineering,
    trust: security.expectations,
    money: finance.expectations
  }
}

export const ceo = new CeoModel()

import { engineering } from "./engineering-manager"
import { RootEnvironment } from "./environments"
import { finance } from "./finance-manager"
import { security } from "./security-manager"

ceo.expectations.test.ts

describe("the company in the CEO's head", () => {
  it("upgrades a customer without exposing their data", () => {
    const customer = testSystem.backend
      .upgradeUser("vanja", "pro")

    expect(customer.plan).toBe("pro")
    expect(testSystem.datastore.find("vanja").plan).toBe("pro")
    expect(ceo.company.product.outputs).toContain(UserUpgraded)
  })
})

import { ceo } from "./ceo"
import { UserUpgraded } from "./events"
import { testSystem } from "./TestSystem"

engineering-manager.ts

export class EngineeringManagerModel {
  reports = [backendDeveloper, dataDeveloper]
  deployment = EngineeringDeployment
  owns = [EngineeringDeployment, RootEnvironment.test]
  awareOf = [RootEnvironment.production, RootEnvironment.beta]
  inputs = [UpgradeUser]
  outputs = [UserUpgraded, BillingRequested]
  store = UserStore

  passesUp = {
    customerApi: this.deployment.outputs.customerApi,
    billingEvents: this.deployment.outputs.billingEvents
  }
}

export const engineering = new EngineeringManagerModel()

import { backendDeveloper } from "./backend-developer"
import { dataDeveloper } from "./data-developer"
import { EngineeringDeployment } from "./TeamDeployment"
import { BillingRequested, UpgradeUser, UserUpgraded } from "./events"
import { RootEnvironment } from "./environments"
import { UserStore } from "./UserStore"

BackendService.ts

export class BackendService {
  constructor(private users: UserStore) {}

  upgradeUser(userId: string, plan: Plan) {
    const user = this.users.find(userId)
    const upgraded = { ...user, plan }
    this.users.save(upgraded)
    return upgraded
  }
}

import type { Plan, UserStore } from "./UserStore"

UserStore.ts

export abstract class UserStore {
  abstract find(userId: string): User
  abstract save(user: User): void
}

export type Plan = "free" | "pro"

export type User = {
  userId: string
  plan: Plan
}

TestSystem.ts

class ExpectedUserStore extends UserStore {
  private users = new Map([
    ["vanja", { userId: "vanja", plan: "free" as Plan }]
  ])

  find(userId: string) {
    return this.users.get(userId)!
  }

  save(user: User) {
    this.users.set(user.userId, user)
  }
}

const datastore = new ExpectedUserStore()

export const testSystem = {
  backend: new BackendService(datastore),
  datastore
}

import { BackendService } from "./BackendService"
import { UserStore, type Plan, type User } from "./UserStore"

ProductionUserStore.ts

export class ProductionUserStore extends UserStore {
  find(userId: string) {
    return usersTable.get({ userId })
  }

  save(user: User) {
    usersTable.put(user)
  }
}

import { usersTable } from "./aws-production-account"
import { UserStore, type User } from "./UserStore"

TeamDeployment.tf

module "backend" {
  source   = "../../infra/service"
  name     = "backend"
  artifact = var.backend_service_artifact

  environment = {
    USER_TABLE = aws_dynamodb_table.users.name
    METRICS    = aws_cloudwatch_log_group.product.name
  }
}

resource "aws_dynamodb_table" "users" {
  name         = "users"
  billing_mode = "PAY_PER_REQUEST"
  hash_key     = "userId"

  attribute {
    name = "userId"
    type = "S"
  }
}

resource "aws_cloudwatch_log_group" "product" {
  name = "/company/product"
}

output "customer_api" {
  value = module.backend.public_url
}

output "user_data_boundary" {
  value     = aws_dynamodb_table.users.arn
  sensitive = true
}

output "billing_events" {
  value = module.backend.events["BillingRequested"]
}

non manager engineers work in a shared space. my condolences to them

in this model the ai slop is indistinguishable from human slop

i like this model but i think i need to polish the explanation a bit...

Goals of this system