122 lines
9.9 KiB
Markdown
122 lines
9.9 KiB
Markdown
# Development Philosophy
|
|
|
|
## Simplicity is the default
|
|
|
|
Speculative architecture always has negative value.
|
|
|
|
The cost of writing code is small compared with the cost of carrying it. Every abstraction, hook, compatibility layer, option, fallback, extension point, and anticipated future feature becomes something the project must understand and preserve. Worse, later work begins building on guesses about a future that has not arrived yet.
|
|
|
|
If we understand A and B, partly understand C and D, and only imagine E, build A and B. Do not pour foundations for C, D, or E. When C becomes real, A and B will have taught us things we could not know beforehand. That evidence lets us build C once and integrate it with what actually exists. Premature preparation for E can occupy the very ground the real E eventually needs and can force A through D to depend on a mistaken future.
|
|
|
|
The only reliable speculation is that simplicity will pay off.
|
|
|
|
Build the smallest thing that fully serves the need we concretely understand. Do not future-proof by predicting the future. Preserve the future by refusing to obstruct it.
|
|
|
|
## Discussion before action
|
|
|
|
A problem report is information, not an instruction to patch the nearest code.
|
|
|
|
When something breaks, first understand what happened, why it happened, which behavior was intentional, and what solution landscape the evidence supports. A clear path is not necessarily the right path. The right path tends to reveal itself when investigation and discussion converge on an obvious next step.
|
|
|
|
This is not ceremony. The discussion may be brief. The rule is simply that action follows understanding rather than replacing it.
|
|
|
|
Do not make meaningful behavioral or architectural changes merely because they appear straightforward. Surface the evidence, alternatives, and consequences first and agree on direction.
|
|
|
|
## Beauty over perfection
|
|
|
|
We are not building machinery to eliminate every imperfect judgment, irregular case, or possible mistake. Predictably good, useful, approachable work is more valuable than elaborate systems designed to force perfection.
|
|
|
|
An occasional exception is allowed to remain an exception. Do not immediately turn anomalies into rules, validation systems, abstractions, fallbacks, or special cases. Forgive exceptions until repeated evidence shows that the exception is actually part of the shape of the problem.
|
|
|
|
This applies to code and to the content these tools help produce. Complexity introduced to prevent every possible imperfection often damages the work more than the imperfection would have.
|
|
|
|
## Follow evidence without an agenda
|
|
|
|
Investigate the actual code, data, failures, and outputs rather than speculating about what they probably mean. Do not steer evidence toward a preferred architecture or conclusion.
|
|
|
|
For translation and ancient-text work, the received text is the authority. Tradition is context, not a destination. We are not trying to reinforce tradition or tear it down, and we do not bend the text toward doctrine, dogma, skepticism, apologetics, or novelty. The aim is unbiased, approachable, useful, compelling translation of ancient wisdom.
|
|
|
|
Not every participant in a creative or translation pipeline produces evidence. Explorers, philosophers, and literary voices may speculate, reach, or occasionally indulge wishful thinking when that is useful to their role. Be rigorous about what is called evidence and which roles have authority to alter the received text; do not turn the entire endeavor into an academic apparatus in pursuit of impossible perfection.
|
|
|
|
## Perry is an external boundary; async is not the application architecture
|
|
|
|
The project family intentionally uses synchronous blocking batch control flow. Provider transports may inherently expose asynchronous or streaming mechanics, but those mechanics should ultimately be isolated inside Perry and presented to applications as a blocking call with bounded timeout behavior.
|
|
|
|
The current Perry implementation still exposes Promise/callback streaming behavior. Treat that as legacy plumbing awaiting a separate unwind, not as an architectural virtue and not as precedent for application code. Do not add new async abstractions, concurrency, queues, or callback-oriented control flow merely because Node examples normally do.
|
|
|
|
# Perry
|
|
|
|
Perry is an agent who does not do much. He has a knack for doing exactly enough to get the job done and avoid catastrophe.
|
|
|
|
Perry is the LLM boundary for applications. Applications own who an agent is, why work happens, what work means, and what to do with the result. Perry owns the mechanics of forming and operating an LLM-backed conversational agent through a configured provider.
|
|
|
|
## Scope
|
|
|
|
Perry owns:
|
|
|
|
- the provider-neutral Perry conversation/Lego shape;
|
|
- provider selection and provider-specific translation of Perry conversations;
|
|
- model selection exactly as requested by the consumer;
|
|
- provider-specific availability checks when the provider can offer certainty;
|
|
- provider transport of reasoning and final content (currently exposed through legacy callbacks pending the blocking-boundary unwind);
|
|
- conversation preparation, independent asks, and follow-up conversations;
|
|
- automatic continuation of incomplete responses;
|
|
- transport retry behavior;
|
|
- provider diagnostics and usage returned with replies;
|
|
- provider-specific catastrophe protection that has been proven necessary, such as LM Studio repetition-loop detection.
|
|
|
|
Applications own:
|
|
|
|
- agent personas and Lego content;
|
|
- which Lego pieces form an agent and in what order;
|
|
- pipeline orchestration and artifact meaning;
|
|
- application settings and any aliases that resolve to Perry settings;
|
|
- terminal, UI, or logging output;
|
|
- interpretation and validation of domain-specific model answers.
|
|
|
|
## Intentional boundaries
|
|
|
|
Perry is independent of Optimus. Do not add an Optimus adapter, Optimus settings lookup, or any other reciprocal dependency. An Optimus-based application may wrap Perry in its own module if that is convenient for that application.
|
|
|
|
A Perry instance is lightweight. It is essentially provider/model settings plus behavior. It must be natural to create one Perry for an application, one per transformer, one per agent, or one per request. Do not introduce a meaningful instance lifecycle, singleton requirement, global model state, connection manager, or shared registry without discussion and concrete evidence.
|
|
|
|
Current Perry settings are intentionally only `provider` and `model`. Both are required. Do not add configuration knobs because a provider happens to expose them. Add Perry settings only when actual consumers demonstrate that Perry needs to own them.
|
|
|
|
Model identity is exact. Perry does not know that two model names are aliases, equivalent weights, variants, or interchangeable workers. If an application wants `gemma4-31b` to resolve to a particular provider model name, that abstraction belongs to the application before Perry is constructed.
|
|
|
|
Perry never owns user-facing console output. Perry does not speak. Its current callback streaming surface is a legacy transport detail pending the blocking-boundary unwind; results and diagnostics belong to the caller, and consumers decide what humans see.
|
|
|
|
A Perry Lego is not provider-specific data. Perry owns its known conversation shape and providers transform that shape into their own request format. A provider that happens to accept the same shape directly is an implementation coincidence, not permission to pass unknown provider-specific fields through Perry.
|
|
|
|
Do not create provider frameworks, capability matrices, registries, cancellation abstractions, or shared provider behavior from one example. Let repeated implementations reveal a common interface before extracting one.
|
|
|
|
## Current direction
|
|
|
|
Perry 0.2 consolidates the behavior already proven by the project family while remaining deliberately small:
|
|
|
|
- direct lightweight construction from `{ provider, model }`;
|
|
- LM Studio as the only currently implemented provider;
|
|
- fail-fast LM Studio warmup when the requested model is known to be unavailable;
|
|
- exact requested-model checks before work and exact response-model rejection when LM Studio explicitly reports a different model;
|
|
- silent operation with optional reasoning/content callbacks;
|
|
- preservation of the existing Lego, continuation, retry, diagnostics, and repetition-loop behavior.
|
|
|
|
## Deliberately not doing yet
|
|
|
|
- Ollama support. It existed historically, but no current implementation survived into this codebase and we are not rebuilding untested complexity in anticipation of future use.
|
|
- generalized remote-provider infrastructure;
|
|
- provider capability declarations;
|
|
- application or model alias registries;
|
|
- reasoning-effort, context-size, token-limit, temperature, or similar Perry settings without a demonstrated consumer need;
|
|
- retry/model-recovery redesign. See `docs/ideas.md` for the concrete observation already on the radar.
|
|
|
|
## Lego formation: awareness before rules
|
|
|
|
A Lego should help an agent understand one idea deeply enough to exercise judgment in the moment. Do not treat formation as a place to accumulate behavioral commandments.
|
|
|
|
For an observed failure mode, explain clearly what happened, why the outcome was undesirable, and what feature of the situation seems to create the risk. Then let the agent reflect the problem back in its own words and carry that awareness into later judgment. Avoid turning the lesson into `do this / do not do that`, and avoid eliciting rigid promises such as `I will always...` or `I will never...` when understanding can do the work instead.
|
|
|
|
**One exchange teaches one takeaway.** Even closely related observations should receive separate complete back-and-forth exchanges when each matters. Bundling several lessons into one exchange tends to dilute how fully the model incorporates each one.
|
|
|
|
Rules remain appropriate when the task genuinely has a mechanical contract, but do not substitute rules for judgment merely because rules are easier to write. Repeated project evidence shows that agents often make better case-specific decisions when they understand the problem than when they are forced to obey an anticipated solution.
|