Stack / layer

Description

Abstraction levels built on each other, where each layer depends on the correctness of the layer below. The fundamental form for hierarchical decomposition. The diagnostic question — which layer is this problem really at? — is one of the most common moves in good engineering reasoning. Marr’s three levels (computational, algorithmic, implementational) is the canonical cog-sci instance; the OSI model is the canonical networking instance.

Encounters

  • “Identity → grouping → planner → social alignment is a stack” — KCC program-identity work: explicit four-layer stack with named dependencies; failure at any layer creates hidden failure modes above.
  • “This layers on TOP of the cache” — pipeline architecture: distinguishing the new contribution from the existing layer it builds on.
  • “Marr-style levels” — explanatory-style observations: applying abstraction-level distinctions to the analysis itself.
  • “The bottom of the stack is loose” — load-bearing × stack: when a lower layer has hidden failure modes, everything above carries unsupported weight.
  • substrate-surface-amplifier — a three-element stack with named layer roles.

When it applies / triggers on

User-initiated: User describes a system as if it were monolithic (“this isn’t being captured”, “we have whack-a-mole bugs”) and the agent re-frames it as layered; OR the user surfaces a bug that’s bouncing between layers and the agent attributes it to a specific layer; OR the user explicitly proposes a stack (“identity → grouping → planner → social alignment”) and the agent extends or validates it. Trigger-verb signal in user messages is weak — below, on top, above each appear in only ~5% of top T2 candidates; the strongest signal is implicit (user describes a feature, agent decomposes it). Four recurring sub-shapes:

  • Decomposition — one-layer-as-experienced becomes two-or-more (example: “set the hook to global to save insights” → agent recognizes the insight-saving feature as a two-layer system: plumbing layer + content layer, each with different failure modes).
  • Layer-attribution / elimination — bug must be at layer X because layers Y, Z are known-clean (example: “the verbatim-title rule is enforced at three layers (prompt, codebook, honesty invariant #5)… the drift must be at a fourth layer”).
  • Layer-multiplicity-as-strategic-framing — name the layers, the workstream becomes coherent (example: “drift can enter at six independent layers” reframes whack-a-mole into a coherent six-layer doctrine).
  • Named-role stack — substrate-surface-amplifier instances: each layer has a specific job; the form specializes.

Agent-initiated: The <task-notification> flavor (8/30 of T2 top candidates) is where the elephant evaluates a layered output from a goldfish — “this layers on top of…” framing. Engine notices a proposed solution sitting at one level when the actual fault is at another, and surfaces stack-layer as the re-framing primitive.

Vocabulary cues: “layer,” “layered,” “stack,” “layer above,” “layer below,” “bottom of the stack,” “which layer,” “level of abstraction,” “this layers on top of,” “depends on the correctness below,” “defense in depth,” “single feature vs two things.”

Situation-shape signals: A feature being described as a single thing whose failure modes split cleanly along an implicit layer boundary; a maintenance pain (“whack-a-mole”) that resolves into a coherent workstream once layers are named; a multi-stage validation/filtering pipeline where each stage independently contributes to the overall guarantee. (Note: T2 negative-filtering on call stack/tech stack/stack trace likely under-counts the form by 30-40%; treat lexical-frequency as a floor.)

Composes with

  • load-bearing — load-bearing is the auditing question for stacks. Which layers are doing actual work for the layer above?
  • container — each stack layer is a container; the stack is a nested-containers structure.
  • substrate-surface-amplifier — the named-role specialization of the generic stack.

When it doesn’t apply

  • Genuinely flat systems — peer-to-peer architectures, distributed graph problems; forcing a stack frame loses information.
  • Mutual recursion / circular dependencies — when layers depend on each other rather than strictly one-way, the stack metaphor misleads.

Sources

  • Marr (1982) cognitive-science levels of analysis.
  • OSI / TCP-IP networking stack.
  • Engineering decomposition tradition.

Canonical exemplars from corpus (T2 2026-05-17)

  • Two-layer instrumentation mistaken for one (cwd: campconnect, session: idx=0): “Insight-saving looks like a single feature, but it’s actually plumbing (the hook captures whatever’s there) plus content (the output style produces what’s there). Either layer alone fails.”
  • Defense in depth = layered filters (cwd: campconnect, session: idx=2): “A bad URL has to slip past Stage 2’s ranker, the boundary check, the LLM’s extraction discipline, the post-extraction validators, the matcher’s tier-3 refusal, AND the manual auto-PR review. Each layer compounds.”
  • Enforced at three layers → fault must be at the fourth (cwd: campconnect, session: idx=4): “The verbatim-title rule is enforced at three layers (prompt, codebook, honesty invariant #5)… The drift must be at a fourth layer — source-routing or the source page itself.”
  • Drift can enter at six independent layers (cwd: campconnect, session: idx=5): “Without a doctrine, every PR is whack-a-mole — the fixes are reactive, the bar for ‘is this URL stable now?’ is implicit.”

Trigger pattern (T2): Stack-layer surfaces when the user describes a system as if monolithic and the agent re-frames it as layered, or when a bug is bouncing between layers and the agent attributes it to a specific one — trigger verbs in user messages are weak; the signal is implicit (user describes a feature, agent decomposes it).