pub struct PackContext {
pub cwd: PathBuf,
pub os: String,
pub shell: String,
pub date: String,
pub headless: bool,
pub is_git_repo: bool,
pub model: Option<String>,
pub os_version: Option<String>,
pub timezone: Option<String>,
pub strip_identity: bool,
}Expand description
Dynamic, per-run context a pack’s preamble is rendered against.
Deliberately small (like ToolCtx, ADR-0003 rejects god-object contexts): the fields
a harness’s real prompt needs (Task 13) — cwd/OS/shell/date + the headless identity
branch. Grows only if a ported prompt needs more.
Fields§
§cwd: PathBufAbsolute working directory shown to the model.
os: StringTarget OS label (e.g. macos).
shell: StringLogin shell (e.g. /bin/zsh).
date: StringCurrent date, preformatted (the preamble stays a pure function of context).
headless: boolHeadless run → autonomous identity branch (vs interactive). See Task 13.
is_git_repo: boolWhether the working directory is inside a git repository. Rendered in the
Claude pack’s # Environment block (Is a git repository: <bool>, D9).
Cheaply probed by the exec/tui layer (a .git walk) — no host handle in
preamble().
model: Option<String>The model id/name for the Claude pack’s env “You are powered by the model …”
line (D9). None skips the line (the pack does not guess).
os_version: Option<String>The OS version string for the Claude pack’s env OS Version: line
(uname -s -r, computed by the exec/tui layer). None skips the line.
timezone: Option<String>The IANA timezone name for the codex pack’s <environment_context>
<timezone> line (e.g. America/Los_Angeles), resolved best-effort by the
exec/tui layer. None omits the line (codex’s field is optional).
strip_identity: boolStrip identity-revealing sentences from the rendered prompt (e.g. grok’s
“You are Grok released by xAI.” and the <user_guide> block naming the
Grok Build TUI). Default false = faithful reproduction (user
decision, 2026-07-18); true is for A/B runs where the harness’s
self-identity would contaminate the comparison. Post-processing on the
rendered output only — the verbatim template copies are never edited.
Trait Implementations§
Source§impl Clone for PackContext
impl Clone for PackContext
Source§fn clone(&self) -> PackContext
fn clone(&self) -> PackContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more