# Intentional behavior These are deliberate Perry behaviors and boundaries, not incidental implementation details. Do not remove, generalize, or substantially alter them during cleanup or refactoring without discussion. ## Perry is the LLM boundary, not the application Perry handles LLM transaction mechanics. Consumers decide who agents are, which Legos form them, why a request exists, what an answer means, and what happens next. Do not move pipeline stages, translation semantics, artifact logic, domain validation, or agent personas into Perry merely because they are adjacent to an LLM call. ## Perry is independent of Optimus Perry must not import Optimus, read Optimus settings, or provide an Optimus-specific adapter. Optimus must not be required by Perry. An Optimus application may create its own local module that reads application settings, constructs Perry, and exposes whatever interface is convenient to that application. ## Perry instances are cheap Construction does not open an expensive persistent connection, load a model, register global state, or create a resource that needs special disposal. Consumers may use one Perry instance or many. Do not introduce singleton assumptions or application-global model state. ## Settings are small and explicit Current settings are exactly the concepts Perry has evidence to own: - `provider` - `model` Both are required. `provider` replaced the older `client` name deliberately. Do not add settings merely because an underlying provider exposes options. Provider capabilities do not automatically become Perry configuration. ## Exact model means exact model Perry does not know model aliases or equivalence classes. Before a request, an implemented provider should use any certainty it actually possesses to establish that the exact configured model can handle the work. If it can prove that model is unavailable or another model would be used, fail before inference. If the provider cannot know, ambiguity is allowed. After a response, reject a model mismatch only when the provider explicitly supplies enough evidence to know the response came from a different model. Absence of model metadata is not itself failure. Application-level aliases and model-selection policy belong before Perry construction. ## Lego shape is Perry-owned and provider-neutral Conversation messages use Perry's known shape. Providers translate that shape into provider-native requests. Do not pass arbitrary provider-specific message fields through Perry. A provider currently accepting Perry's shape directly does not make that provider's format Perry's public contract. Conversation subsets are ordinary data. Lego Towers do not require registries, inheritance, graph objects, session managers, or special persistence machinery. ## Reasoning is observable, not conversational authority When a provider exposes reasoning, Perry may stream it through `onReasoning` and retain it on returned replies for diagnostics. Reasoning is not normally included when a prior Lego/conversation subset is added to a new active conversation. The model's ordinary conversation context remains role/content history. ## Perry does not speak Perry does not own console or UI output. No automatic response printing, reasoning headings, retry messages, continuation messages, warnings, or progress output should be added to Perry. Consumers can use callbacks, return values, errors, and provider diagnostics to decide what to display or log. ## Automatic continuation is intentional Provider-native incomplete responses are continued automatically when it can be done safely. If provider-native continuation is unavailable and the model produced reasoning without final content, Perry may continue through explicit conversation history. Partial failed responses are not silently appended as successful conversation turns. ## Retry behavior is intentionally conservative and currently imperfect Transient transport failures currently retry up to ten times with the existing backoff. Non-retryable failures, including known model availability/identity failures, stop immediately. The ten-attempt strategy is not considered perfected or permanent. It remains because changing it is a separate behavioral decision; see `ideas.md`. ## LM Studio repetition protection is intentionally local Exact repetition-loop detection lives in the LM Studio implementation because LM Studio is the concrete provider where the failure has been observed and implemented. Do not manufacture a provider-wide repetition/cancellation interface from this single example. Generalize only after repeated real implementations expose the same natural boundary. ## Blocking boundary is the intended direction Applications in this project family are synchronous blocking batch tools. Perry may need to deal with provider-level asynchronous transport internally, but that should eventually be hidden behind a blocking application-facing boundary with bounded timeout behavior. Existing Promise/callback APIs are legacy plumbing, not a desired architecture to extend.