more
This commit is contained in:
@@ -237,21 +237,29 @@ This behavior is particularly valuable around nondeterministic work.
|
||||
|
||||
Do not remake an expensive artifact merely to verify it when its actual recipe is unchanged.
|
||||
|
||||
A useful LLM-shaped artifact stack can be:
|
||||
A useful LLM-shaped transformation chain can be:
|
||||
|
||||
```text
|
||||
semantic inputs + formation + model settings
|
||||
↓ cheap/deterministic
|
||||
LLM recipe artifact
|
||||
↓ expensive/nondeterministic
|
||||
LLM response artifact
|
||||
↓ cheap/deterministic
|
||||
parsed / interpreted artifact
|
||||
semantic parent artifacts + accepted formation/model settings
|
||||
↓ assemble transient input and fingerprint
|
||||
LLM executes only if the semantic result is stale
|
||||
↓
|
||||
reusable semantic result artifact
|
||||
↓
|
||||
further meaningful derived artifacts
|
||||
```
|
||||
|
||||
If only the parser changes, reparse the persisted response. Do not ask the model again.
|
||||
The assembled request, raw provider response, reasoning and execution trace
|
||||
belong in disposable side-effects. They need not be stored again as artifacts.
|
||||
A meaningful interpretation or evidence selection *is* an artifact, even when
|
||||
its deterministic computation is cheap. An owning transformer may use a
|
||||
versioned compatibility policy to preserve earlier LLM work across harmless
|
||||
instruction edits and narrow source changes.
|
||||
|
||||
Cheap deterministic work does not require the same protection. If rerunning it is simpler than proving freshness, rerun it. The resulting content hash naturally stops propagation when nothing changed.
|
||||
Cheap deterministic work may be recalculated more eagerly than expensive work;
|
||||
when the resulting semantic content hash is unchanged, downstream results can
|
||||
remain current. Do not persist a temporary prompt or transcript merely to
|
||||
supply a staleness fingerprint that can be calculated in memory.
|
||||
|
||||
## Side effects are not semantic dependencies
|
||||
|
||||
@@ -263,6 +271,55 @@ A useful test is:
|
||||
|
||||
> Delete diagnostic side effects, request the same top-level artifact, and do not repeat expensive semantic work unless an actual artifact input changed.
|
||||
|
||||
## Catalog-wide artifact vacuum
|
||||
|
||||
Once the complete catalog is current, Optimus can remove stored artifacts that
|
||||
no longer belong to **any** declared target's active pull tree. This is an
|
||||
explicit maintenance operation, never part of a normal build:
|
||||
|
||||
```bash
|
||||
npx optimus # Ensure all defined artifacts first
|
||||
npx optimus --vacuum # Read-only inventory and proposed removal plan
|
||||
npx optimus --vacuum --apply # Recheck and apply the identical plan
|
||||
```
|
||||
|
||||
The dry run saves `side-effects/optimus-vacuum/plan.json`, listing each candidate
|
||||
with its byte count and SHA-256 checksum and reporting totals by artifact family.
|
||||
Nothing is deleted on a dry run. `--apply` recomputes the entire graph and
|
||||
filesystem inventory, compares the new plan to the saved plan, preflights every
|
||||
candidate, and removes only unchanged files outside the active graph. The plan
|
||||
is disposable diagnostic data; remove it freely after maintenance.
|
||||
|
||||
Every entry in `settings/artifacts.json` is an equal root: no named `.all` is
|
||||
privileged. Even inexpensive intermediate results remain live when a current
|
||||
transformer pulls them. A result is **not** collectible merely because it is
|
||||
`sus` or expensive to produce; a result is collectible when no currently
|
||||
defined target depends upon it.
|
||||
|
||||
The vacuum asks each configured target to establish its own dependencies with
|
||||
production rebuilding prohibited. Ordinary `utils.resolveArtifact()` work is
|
||||
verified without invoking its producer. Custom-result transformers that use
|
||||
`utils.readArtifact()` and their own freshness rules must call
|
||||
`utils.requireCurrentArtifact(filename, isReusable)` **before** an external
|
||||
provider call, human request, or other rebuilding work. This is a no-op during
|
||||
normal execution and fails closed during vacuum inspection. Optimus also
|
||||
observes artifact file reads during the inspection, verifies stored ancestry
|
||||
references and payload hashes, and rejects filesystem/network writes or child
|
||||
process launches during the verification pass. An incomplete, stale or
|
||||
uninspectable graph aborts the vacuum; run normal Optimus first.
|
||||
|
||||
This verification contract applies to transforms participating in the Optimus
|
||||
lifecycle. Arbitrary custom code that bypasses the shared lifecycle, opens
|
||||
files through native extensions, or performs unmanaged external side effects
|
||||
cannot be proved safe merely by observing the graph; such modules must be
|
||||
adapted to the inspection contract before vacuuming their projects. Run the
|
||||
dry-run and keep a backup before using `--apply`. Do not run normal producers
|
||||
concurrently with a vacuum.
|
||||
|
||||
`--vacuum` accepts the usual `--setting` overlays; it cannot be combined with
|
||||
`--artifact` or `--relitigate-sus`. Files outside `artifacts/` are not deletion
|
||||
candidates. No permanent dependency DAG is stored.
|
||||
|
||||
## Named top-level artifacts
|
||||
|
||||
`settings/artifacts.json` gives humans and automation convenient roots into the pull graph:
|
||||
|
||||
Reference in New Issue
Block a user