This commit is contained in:
Brent Larsen
2026-10-07 09:22:31 -05:00
parent a7ea0b20a0
commit 9b848cefcf
5 changed files with 423 additions and 0 deletions
+95
View File
@@ -0,0 +1,95 @@
# Design History
This is a reasoning history, not a commit log. It records the problems that shaped Optimus so later changes can distinguish intentional design from accidental implementation.
## Durable work instead of rerunning pipelines
Optimus grew around a practical problem: expensive and nondeterministic work should survive restarts and downstream changes.
A conventional pipeline runner tends to think in execution order. Optimus instead asks for a desired artifact and walks downward through the work needed to establish it. This made persisted intermediate results first-class rather than incidental cache files.
The important consequence was a pull-driven operation: request what you want, recursively establish what it depends on, and wake only the work that is actually missing or stale.
## Content identity stopped unnecessary invalidation
A parent transformation can become stale because its recipe changed and still reproduce exactly the same semantic output.
If every downstream artifact invalidated merely because the parent reran, expensive/nondeterministic work would be repeated unnecessarily. Optimus therefore uses content hashes as the identity passed downstream. A rebuilt parent with unchanged content does not force descendants to rebuild.
This was especially valuable for LLM-heavy pipelines where unnecessary reruns can produce different answers even when nothing semantically changed.
## Complete named parent sets became a useful default recipe check
`resolveArtifact()` compares the complete named set of source hashes rather than only overlapping hashes. Adding, removing, or renaming a semantic parent is therefore a recipe change under that helper.
The names matter because they describe roles, not just byte values.
This exact-source-set policy remains a useful framework service, but later clarification made an important boundary explicit: transformers own their own semantic freshness rules. `resolveArtifact()` is a strong default mechanism, not a universal definition imposed by Optimus.
## Artifacts remained readable instead of becoming an opaque cache
As more intermediate work became durable, it became useful to inspect it directly while debugging, evaluating LLM output, comparing translations, and understanding provenance.
Artifact directories therefore function as organized workbenches/warehouses. They are not intended to become private implementation storage addressed only by hashes.
`sourceRef` supports human navigation while `sourceHash` remains the content-validity mechanism.
## Modules became the team; transformers remained a subset
Optimus projects naturally accumulated participants that did not fit a strict "one transformer = one stage" model: source loaders, publishers, LLM wrappers, coordination helpers, and other services.
The resulting model is deliberately loose:
- Optimus organizes modules.
- Some modules are transformers.
- A transformer may own several closely related transformations.
- Ordinary module calls may express dependency relationships.
This avoids both a central monolith and artificial micro-transformers.
## Humans are legitimate artifact producers
The first Optimus projects mostly received human-authored material through input folders and then transformed it mechanically or through LLMs.
The framework was later clarified to permit humans as active participants inside transformations as well. A module may interview a human, collect approvals, accept manually authored guide entries, or allow a human to stamp prepared material as valid.
No Optimus-level human workflow system was added. If recurring human interaction needs reusable machinery, it can emerge as its own module (for example a future Bumblebee transformer) once real implementations provide evidence for what that machinery should be.
## 2026-09-09 — framework vision documented without runtime change
The project documentation was revised to describe Optimus as a lightly opinionated pull-driven transformer framework rather than primarily as a durable artifact resolver.
This was a clarification of the implementation's existing shape, not a runtime redesign.
The discussion established these intentional boundaries:
- Optimus organizes modules and participates through shared framework services.
- Transformers are artifact-producing/validating modules, not mandatory micro-machines.
- Freshness semantics ultimately belong to each transformer.
- Artifact areas are readable workbenches/warehouses.
- Human, LLM, external, and deterministic producers are all permitted.
- Optimus provides services rather than domain restrictions.
- No generic human-task system, central DAG, universal transformer interface, or other speculative framework machinery should be added without evidence.
## 2026-09-10 — useful build reporting without the full role call
Real translation runs showed that printing every already-current artifact check made normal console output noisy. The useful operational fact was usually the moment Optimus decided that work actually had to run.
Optimus therefore gained two optional presentation settings: `showOnEnsure` (default false) and `showOnBuild` (default true). Standard `resolveArtifact()` work reports automatically, while custom-validity transformers can report the same events through tiny framework hooks. Presentation remains completely outside artifact semantics.
This also reinforced an earlier framework principle: Optimus conveniences are services, not contracts. A transformer with unusual validity rules does not have to adopt `resolveArtifact()` merely to obtain consistent console behavior.
## 2026-10-06 — ensure remains the dependency contract
Publication work exposed an important distinction between expensive evergreen artifacts and intentionally frozen editions. The tempting shortcut was to read an existing expensive artifact directly so a downstream publisher could not accidentally wake it. That would have inverted Optimus's pull model: the downstream consumer, rather than the owning transformer, would decide whether a historical copy was acceptable.
The clarified strategy is:
- live dependencies are ensured normally;
- if an ensure wakes work unnecessarily, the owning transformer's freshness inputs or validity policy are too broad and should be corrected there;
- low-level artifact reads remain available for transformer-owned validity, migration, repair, and inspection;
- an accepted result that should no longer be evergreen is exported/ejected and becomes ordinary input to another project, intentionally severing the live dependency edge.
This was a documentation clarification rather than a runtime change.
+35
View File
@@ -0,0 +1,35 @@
# Ideas and Deferred Possibilities
This file is intentionally not a roadmap. Items here are possibilities or observations that do not yet have enough evidence to justify framework complexity.
The default action for every item is: leave it alone until real Optimus projects demonstrate the need.
## Human-interaction modules
A future module (informally imagined as something like Bumblebee) could own reusable human interaction: interviews, approval queues, manual guide entry, or explicit stamping of human-authored artifacts.
Optimus itself does not need a human-task subsystem. Build a concrete module first if/when a real workflow requires one. Only repeated implementations should motivate shared machinery.
## More transformer helpers
Different domains may eventually repeat freshness or persistence patterns that are not covered cleanly by `resolveArtifact()` and the current node helpers.
Do not add generic recipe objects, transformer base classes, validation interfaces, or capability registries in anticipation of that possibility. Let several real transformers reveal the common shape first.
## Artifact browsing tools
Because artifact areas are intended to be human-readable warehouses, a project may someday benefit from optional browsing/search tooling.
Do not restructure artifact storage around such a tool. The files should remain directly understandable without it.
## Module initialization
Modules currently initialize at project startup while transformation work remains pull-driven.
If a future project demonstrates that initialization itself is expensive or has harmful side effects, reconsider lazy initialization then. Do not add lifecycle machinery solely for architectural symmetry.
## Additional orchestration concepts
Queues, concurrency controls, distributed execution, human wait states, scheduling, and workflow status models are all conceivable around transformer operations.
None belong in Optimus merely because they are imaginable. Introduce only the smallest capability demanded by concrete work when that work arrives.
+105
View File
@@ -0,0 +1,105 @@
# Intentional Behavior
This document records Optimus behavior and boundaries that are deliberate. They should not be removed, generalized, centralized, or "cleaned up" without discussion about why they exist.
## Optimus is a pull framework
A desired artifact is requested at the top. Modules recursively request what they need. Work wakes up where the requested dependency chain finds missing or stale results.
Do not replace this with a centrally pushed stage sequence merely because a particular project happens to have a visually linear flow.
Ordinary module calls are allowed to be the dependency graph. A duplicate declarative DAG is not required.
A consumer normally establishes another module's artifact by ensuring it. Reading that module's persisted artifact directly in order to suppress a possible rebuild is intentionally not a second dependency mechanism. If an ensure rebuilds work that is not semantically stale, fix the owning transformer's freshness rule.
If a result is intentionally no longer evergreen, make that break explicit: publish/eject the accepted result and use the exported file as input to a separate project or graph. A frozen handoff and a live Optimus dependency are different concepts.
## Modules are broader than transformers
Optimus organizes modules.
A transformer is a module that can produce an artifact and determine whether an existing artifact remains current according to its own needs. Not every module has to produce artifacts.
Do not force service modules, human-facing modules, LLM wrappers, publishers, or other legitimate participants into an artificial transformer interface.
## Peer modules are resolved by semantic name
`settings/modules.json` is the project's composition map. Peer modules depend on one another by semantic module name and obtain one another through Optimus, normally with `utils.loadModule(name)`.
A module may freely use relative imports among private files inside its own module directory. It should not import a neighboring peer module by filesystem location. A neighboring directory that provides a real cross-module service should have a registered module identity; implementation that is private to one module should live inside that module instead.
This boundary is intentional. Optimus is the dependency resolver for peer modules, so consumers do not need to know whether a collaborator currently lives beside them in `src/`, is later extracted, or is otherwise mapped differently by the project. Avoid introducing a second peer-resolution convention based on `../some-module` paths merely because today's checkout makes that path convenient.
The current runtime reads filesystem entry paths from `settings/modules.json`. That is composition detail owned by the project mapping, not knowledge that should leak into consumers.
## Transformers may own several related transformations
Transformer is a responsibility, not a microservice size rule.
A coherent module may produce multiple artifact types or layers when those transformations genuinely belong together. Avoid both monoliths and artificial fragmentation.
## Freshness belongs to the transformer
Optimus supplies reusable mechanisms such as `resolveArtifact()` and `sameSourceHash()`. These make exact named-parent-hash freshness easy.
They are not the universal semantic definition of stale.
The owning transformer decides which inputs and rules matter to its output and is responsible for verifying those conditions before returning persisted work as current.
Do not move domain-specific invalidation policy into Optimus simply to make all transformers look identical.
Freshness sensitivity is a judgment call owned by the transformer and its pipeline. Cheap deterministic work may intentionally be highly sensitive because reconsideration costs almost nothing. Expensive or nondeterministic work may deliberately use a narrower validity contract. Hash helpers are tools, not requirements to collect every available dependency.
Artifact boundaries are likewise judgment calls. Granularity is valuable when it creates useful independent stability or clearer organization, but Optimus does not prescribe one artifact per consumer, one artifact per source node, or maximum fragmentation.
## Content hashes contain propagation
Children key off parent content identity, not the fact that the parent happened to rerun.
When a parent is rebuilt from a changed recipe but produces identical semantic content, downstream artifacts may remain current.
This is intentional and particularly important for expensive or nondeterministic work.
## Artifact storage is a workbench and warehouse
Artifact folders are intended to be useful to humans.
Do not replace readable artifact organization with opaque hash-only cache directories or structures that require special tooling merely to locate a known result.
Metadata should support provenance and freshness while leaving the actual work discoverable.
## Artifacts may have many kinds of producers
An artifact may be produced by deterministic code, an LLM, a human, an imported external source, or a combination.
Optimus does not require a generic human-task system or LLM subsystem to permit those producers. The responsible module owns the interaction and validity semantics.
## Side effects do not become semantic inputs automatically
Reasoning traces, request transcripts, timing, retries, token counts, diagnostics, and progress information can be valuable to keep. They are not semantic dependencies merely because they were generated during the work.
Do not make semantic artifacts depend on side-effect files unless their content has genuinely become part of the transformation's meaning.
## Settings are domain-agnostic
`getSettings(name)` gives Optimus projects a simple shared settings mechanism. Optimus does not interpret arbitrary setting content.
Do not add schemas, typed configuration domains, or framework ownership of settings that belong to modules without concrete evidence that the simple JSON model has failed.
## Presentation is reporting only
Optimus recognizes `presentation.showOnEnsure` and `presentation.showOnBuild`. Missing settings default to quiet ensure checks and visible actual builds. `resolveArtifact()` reports these decisions automatically; custom-validity transformers may call `reportEnsure()` / `reportBuild()` without owning console policy.
These settings and reporting hooks do not participate in artifact identity, freshness, ancestry, or persistence. Application-owned presentation settings may coexist in the same settings object and are ignored by Optimus.
`setArtifactOutcome()` remains as a compatibility reporting hook; it is also non-semantic.
## Module initialization is free
Current modules are initialized at project startup. A module may use initialization merely for setup or may synchronously establish substantial working state when its real responsibility requires that. Optimus does not impose a "lightweight init" rule.
Do not introduce lifecycle restrictions, lazy-loading machinery, or async conventions merely to make modules look uniform.
## Blocking flow is intentional
The project family intentionally targets synchronous, blocking batch execution. Promise-aware behavior that exists today supports legacy callers pending a separate unwind; it is not the desired public programming model. Do not add concurrency or Promise-driven orchestration as an optimization.