You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Libra Code persists Agent development history as Intent, Plan, Task, Run,
PatchSet, and Decision objects. The Memory work in #456 compiles terminal Tasks
into Episodes and uses code versions to decide whether an Episode applies to the
current checkout.
Each Episode needs two code anchors:
base_oid: the Libra code version where the Agent run started;
result_oid: the durable Libra code version produced by the run.
Current behavior
The existing persistence path resolves the run base with git rev-parse HEAD.
Libra stores its own refs in the repository SQLite database, and a valid Libra
repository may have no .git directory. A failed Git lookup currently becomes
the zero OID, so a run can lose an existing Libra HEAD.
The final Decision path also writes result_commit_sha: None. Memory can still
compile and inspect the resulting Episode, but the applicability check cannot
reliably place that Episode in the current code history. It is therefore omitted
from normal context recall.
flowchart LR
H["Libra HEAD"] -->|run starts| B["Run.base_commit_sha"]
B --> A["Agent execution"]
A --> C["accepted code state"]
C --> D["Decision.result_commit_sha"]
B --> E["Episode.base_oid"]
D --> F["Episode.result_oid"]
E --> G["version applicability"]
F --> G
G --> R["Memory recall"]
Loading
Proposed contract
Resolve the start anchor from Libra's repository HEAD through the existing
history database connection.
Record the result anchor after accepted changes become a durable Libra code
version.
Keep Run.base_commit_sha and Decision.result_commit_sha as the
authoritative fields; Memory derives base_oid and result_oid from them.
Treat an unborn branch as an explicit repository state. Missing or corrupt
Libra HEAD data should return an actionable persistence error.
The existing fields appear sufficient, so this can be implemented without a new
database service or a separate Memory-owned version store.
Questions
Which runtime component should create or report the result code version?
Should an accepted code-changing Agent run create a Libra commit
automatically, or should the execution layer provide an already-created OID?
What should result_commit_sha contain for read-only, failed, or cancelled
runs: the base OID or no value?
How should isolated worktree execution publish its accepted result into the
repository history?
Does a checkpoint only preserve Agent context, or can it also identify a
durable code version?
Context
Libra Code persists Agent development history as Intent, Plan, Task, Run,
PatchSet, and Decision objects. The Memory work in #456 compiles terminal Tasks
into Episodes and uses code versions to decide whether an Episode applies to the
current checkout.
Each Episode needs two code anchors:
base_oid: the Libra code version where the Agent run started;result_oid: the durable Libra code version produced by the run.Current behavior
The existing persistence path resolves the run base with
git rev-parse HEAD.Libra stores its own refs in the repository SQLite database, and a valid Libra
repository may have no
.gitdirectory. A failed Git lookup currently becomesthe zero OID, so a run can lose an existing Libra HEAD.
The final Decision path also writes
result_commit_sha: None. Memory can stillcompile and inspect the resulting Episode, but the applicability check cannot
reliably place that Episode in the current code history. It is therefore omitted
from normal context recall.
flowchart LR H["Libra HEAD"] -->|run starts| B["Run.base_commit_sha"] B --> A["Agent execution"] A --> C["accepted code state"] C --> D["Decision.result_commit_sha"] B --> E["Episode.base_oid"] D --> F["Episode.result_oid"] E --> G["version applicability"] F --> G G --> R["Memory recall"]Proposed contract
history database connection.
version.
Run.base_commit_shaandDecision.result_commit_shaas theauthoritative fields; Memory derives
base_oidandresult_oidfrom them.Libra HEAD data should return an actionable persistence error.
The existing fields appear sufficient, so this can be implemented without a new
database service or a separate Memory-owned version store.
Questions
automatically, or should the execution layer provide an already-created OID?
result_commit_shacontain for read-only, failed, or cancelledruns: the base OID or no value?
repository history?
durable code version?
References
src/internal/ai/orchestrator/persistence.rssrc/internal/ai/memory/applicability.rs