Skip to main content

When one package prepares data and another package needs it, the consumer should read a data name. It should not import the producer package, parse its files, or guess the storage address.

A project-preview package prepares a list of preview URLs and statuses. A web-frame package wants to render the active URL. The web-frame should not import project-preview storage code. It should read the view it was given.The producer can change how records are prepared. The consumer should keep reading the same public input shape.

Traditional app shape

This ties the web frame to the project-preview package. The consumer now depends on the producer’s module path, function name, record shape, and selection logic.

Bitfield shape

The consumer can read source-by-label, source-by-address, selected-file, current-project, or any other input that the package file exposes. It does not read producer private code.

Code translation

Traditional path

Bitfield path

React adapter example

Descriptor-projected records

Some consumers need a different view of the same source. That should be data, not a new import path.
This lets the consumer read a projected view. It does not make the consumer depend on the producer’s private data layout.

Four prepared-read situations

Preview surface

Private preview helper

Read the prepared preview

The preview package prepares the public view. The consumer renders the view without importing the preview package’s builder code.

Selected file content

Private file reader

Read the file-facing public values

The selected file fact and the prepared content are separate public reads. The consumer does not become the file package.

Help content

Private help file

Read the prepared help

The package can change how it ships or prepares the help content while the consumer keeps the same public read.

Worktree records

Private record cache

Read the prepared records

The consumer asks for the public prepared records it needs. It does not import the producer’s cache or storage shape.

Consumer boundary checklist

Full before and after

Traditional feature request

“Show the preview URL beside the current file and include help text if the user opens the command palette.”

Bad implementation

This code makes one consumer depend on three private details: file tree state shape, preview implementation, and help package folder layout.

Public read version

The consumer reads three public names. Each preparing package can change its private code without forcing this panel to change.The same translation works for a native app, terminal view, or future shell. The adapter changes. The public inputs do not.

What this prevents

React is one adapter for reading a data name. A Swift, Kotlin, terminal, or future shell should follow the same boundary: read the named input, not the package that prepared it.

Review check

If consumer code says import ... from '../other-package', ask why. A consumer package should receive a data name or an action name. It should not inspect another package’s source files.

Next

Last modified on May 10, 2026