Expand description
P4e (COMPOSABLE-HARNESS-DESIGN.md §1.6/§3.1 core.session.git_metadata,
catalog:331 “Git integration (metadata, diff, PR)”): a persisted, TYPED
record of the git branch/sha/dirty state a session was RUNNING under,
captured ONCE at session start (closes the loop catalog:331 flags —
supercode already preserves a foreign session’s own git-shaped fields
byte-for-byte on IMPORT via Session::raw’s verbatim capture; this is
the WRITE half: supercode’s OWN sessions get the same provenance).
Deliberately flat/typed (not a formatted string), the exact same
rationale as crate::usage_log::UsageRecord/
crate::model_change::ModelChangeRecord (§1.13): a translatable,
lossless session-data channel, not a lossy notice — so it survives a
save/load round trip byte-for-byte, and a future reader (a translator,
doctor/inspect stats) can consume it without re-parsing prose.
Structs§
- GitMetadata
Record - One session’s git provenance, best-effort captured at construction time
(
Agent::with_parts, gated byConfig::session_git_metadata).
Functions§
- capture
- Best-effort capture of
cwd’s git branch/sha/dirty state.Nonewhencwdisn’t inside a git repo,gitisn’t onPATH, or the repo has no commits yet (rev-parse HEADfails on an empty repo) — this is informational provenance, never worth failing agent construction over, the same postureagent::env_context_git_statusalready established. - from_
json - Parse a
<name>.git.jsonsidecar back into a record — the exact inverse ofto_json. - to_json
- Serialize a record as single-line JSON — the
<name>.git.jsonsidecar shapecrate::store::SessionStore::save_git_metadatawrites (a single-record file, like<name>.reduction.json, not a JSONL log: git state is captured once per session, not once per turn).