/** * Pre-commit E-guard verdict. The caller (typically a bash pre-commit hook) * sends a JSON request with the staged paths and prints the verdict * messages + exits with verdict.exit_code. Committer identity is resolved * HERE via `resolveOwner()` unless the request explicitly carries one. * * Three outcomes: * 1. allow (no conflicts): exit 0. * 2. allow + suppressed (self-attribution heuristic: holder's files ⊆ * staged set AND no live foreign pid anchors them): exit 0, prints * "treating as self under transient identity". * 3. block: exit 1, prints "Commit blocked by multi-agent coordination". * * `bypass: true` flips conflict → allow + warning lines (the * `HARNERY_AGENT_COORD_BYPASS=1` escape hatch). * * Gitlink discrimination: a parent-repo staged submodule path is a pointer * bump, NOT a claim on the submodule's contents. The caller supplies * `staged_gitlinks[]` (cheap to compute via `git ls-files --stage`); paths * in that set are matched with the staged-is-gitlink rule. */ interface Conflict { /** Staged path that triggered the match. */ staged_path: string; /** The peer's claimed path (may be a parent/child of staged_path). */ claimed_path: string; /** Peer's instance_id. */ instance_id: string; /** Peer's display name (or first 8 chars of instance_id). */ short_name: string; } export interface CommitVerdictRequest { /** * Committer identity. Optional: when absent (or the legacy * `__unattributed__` sentinel), the verdict resolves it via * `resolveOwner()` — env → pid-map walk → validated Codex thread id — * from its own process context. Callers should stop hand-rolling * identity resolution and omit this. */ instance_id?: string; /** Group key. Subagents inherit parent's session_id. Same optionality. */ session_id?: string; /** Canonical monorepo-relative paths. */ staged_paths: string[]; /** Paths in `staged_paths` that resolve to submodule gitlinks (mode 160000) * in the index. Used for gitlink-discrimination prefix matching. */ staged_gitlinks?: string[]; /** `HARNERY_AGENT_COORD_BYPASS=1` was set. Conflicts become warnings, not blocks. */ bypass?: boolean; } export interface CommitVerdictResult { allow: boolean; exit_code: number; rule: string; /** The committer identity the verdict actually used (resolved or passed). */ instance_id: string; /** Conflict details (for the caller to print). */ conflicts: Conflict[]; /** Path-specific gates that fired (for `coord_log` lines). */ log_lines: string[]; /** Human-readable header for printing. */ message: string; /** When true, conflicts were detected but suppressed (self-attribution). */ suppressed_self_attribution?: boolean; } export declare function evaluateCommit(coordRoot: string, req: CommitVerdictRequest): CommitVerdictResult; export {}; //# sourceMappingURL=commit-conflict.d.ts.map