Expand description
Process-birth identities in the incumbent’s exact spelling.
What:
Process-birth identities:
a string that names one process for its whole life and
changes when its PID is reused,
in the incumbent’s exact spelling.
Why:
Every lock and transaction records its owner’s PID and birth identity;
an owner is
alive only while its PID names a process with the recorded identity.
Both wrappers
judge each other’s locks,
so the strings must agree byte for byte
(src/policy-engine/commit-transaction-process-identity.ts;
the decision in
doc/handover/cli-git-rust-implementation.md,
“Adopted without a question”).
In TS you’d write (pseudocode):
const identity = await resolveProcessBirthIdentity(pid); // 'linux:8423337' or PROCESS_IDENTITY_ABSENTStructs§
- Malformed
Stat - What:
The one way a
/proc/<pid>/stattext can be malformed for this purpose. Why: The caller knows the PID and turns this into a named error.
Enums§
- Process
Identity Error - What: Why a birth identity could not be decided. Absence (the process exited) is not an error; these are states the incumbent also throws on. Why: A lock acquirer that cannot tell whether an owner lives must stop, not guess.
Functions§
- command_
identity - What:
The identity a platform inspector printed,
as
<prefix>:<trimmed output>, or nothing when it printed only whitespace.&[u8]borrows the raw standard output. Why: On macOS and Windows the incumbent runs a command and trims its output; empty output means the process is gone. - current_
birth_ identity - What: The birth identity of this process, computed once per process. Why: Every lock this process takes records it, and on macOS and Windows each computation starts a process.
- darwin_
identity_ arguments - What:
The arguments the incumbent passes to
psfor one PID on macOS. Why:ps -o lstart=prints the start time in the C locale; running it reproduces the incumbent’s string by construction. - linux_
identity_ from_ stat - What:
The birth identity in one
/proc/<pid>/stattext, or nothing for an exited process.Result<Option<String>, MalformedStat>is “an identity, nothing, or a malformed record”. Why: The incumbent cuts after the last)(the command name may hold spaces and)), skips), trims, splits on single spaces, treats statesZandXas exited (a zombie under a container init that never reaps keeps its PID forever), and answerslinux:plus the start tick. An empty start field is malformed. - process_
birth_ identity - What:
The birth identity of the process
pidnames now, or nothing when none runs.i64holds any PID a record can carry. Why: This is the one question every liveness check asks. - signal_
probe - What:
Whether a signal could be sent to
pid(it names some process), on Unix.Ok(false)means no such process; an error is a refusal such asEPERM. Why: The incumbent’sprocessIsAliveaskskill(pid, 0)before comparing identities; a process of another account answersEPERM, which callers judge themselves. - windows_
identity_ arguments - What:
The arguments the incumbent passes to PowerShell for one PID on Windows.
Vec<String>is an owned list of owned text. Why: The Windows identity is whatever this exact command prints, so running the same command reproduces it by construction; the conversion throughGetProcessTimesthat would avoid PowerShell is unproven (doc/handover/cli-git-native-transactions.md).