delimit_handoff_preflight
Validates cross-agent handoff invariants by inspecting git config, environment variables, and capture stamp. Prevents state corruption with a fail-closed verdict on critical failures.
Instructions
Validate cross-agent handoff invariants before switching coding agents (LED-1710).
When to use: before a session hands off to a different coding agent
(claude -> antigravity -> codex -> gemini) or an Auto-Phoenix revive,
to confirm the next agent will NOT inherit corrupted state — a
core.bare=true repo, a junk test@*/empty git identity, leaked
GIT_* env vars that misdirect git subprocesses, a stale
<gitdir>/index.lock, or a missing/stale ~/.delimit/.last_capture
stamp (next agent starts blind). When NOT to use: to capture or
restore session context (use delimit_soul_capture / delimit_revive —
this only INSPECTS), or for general repo health (delimit_repo_diagnose).
Sibling contrast: delimit_revive restores prior context (read+write); delimit_gov_health reports the policy-kernel layer; this is a narrow read-only pre-handoff gate over git + env + capture stamp returning a fail-closed verdict. Phase-1 VALIDATOR only: NOT wired into any live handoff path; auto-remediation is held for a later phase.
Side effects: READ-ONLY — inspects git config + the process env + the
.last_capture file via a hermetic git env. NO writes, env mutation,
git config changes, network, ledger, or notification; it cannot itself
corrupt the state it checks.
Verdict: ok=False if ANY critical check fails (fail-closed).
Critical: git_identity, not_bare. Warn: no_git_env_leak,
no_stale_index_lock, handoff_freshness. Each check is
{name, ok, severity, detail, remediation}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Repository path to inspect. Empty resolves via the gateway resolver, then cwd. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||