Operator Governance

AI Repo Operating Contract

Repository-wide contract for AI operator behavior.

Generated from canonical Markdown. Markdown controls.

Section 01

Purpose

Repository-wide operating contract for any AI operator/agent working in LifeHub. This is not app-specific.

Section 02

Source-of-truth rule

Repository files are authoritative.
Chat is execution interface, not canonical memory.
Important decisions must be written to the correct file surface.

Section 03

Action Surface Precedence

For Custom GPT / connector-enabled operation, the GitHub connector/action is the default surface for ordinary repository reads and writes. Use local repository worktrees only when local execution is required.

Section 04

Canonical clone model

Canonical operational clone for local VM operations: /home/cloudhermes/work/LifeHub2.0-cloudrepo-main
Preview/sandbox clone: /home/cloudhermes/work/LifeHub2.0-preview-mongumeal
Default local behavior: use the canonical clone for read-only inspection, clean synchronization, or task-worktree creation unless task is explicitly preview/sandbox. Do not use the canonical clone itself as a routine editing surface.

Section 05

Common task -> destination routing

Section 06

Change-control rule

Any change affecting behavior, structure, ownership, runtime, monitoring, or deployment must update relevant authoritative docs in the same change set.

Section 07

Owner-Facing Reporting Contract

All substantive LifeHub progress and closeout reports must follow LIFEHUB_OWNER_REPORTING_PROTOCOL.md (lifehub-owner-v1).

Section 08

Provider-Aware Bounded Execution Policy

This section is the canonical execution-shaping policy for ChatGPT-facing LifeHub work. Its purpose is to make legitimate operations explicit, bounded, typed, auditable, and easier for provider-side systems to classify correctly.

Default execution decision order

For ordinary LifeHub work, prefer the least-indirect sufficient route in this order:

  • GitHub-native read/write/action when the task is fundamentally repository or GitHub work.
  • Purpose-built structured LifeHub or SentinelX operation when machine execution is required.
  • Governed privileged broker action only when privilege is actually required and the exact action is already authorized.
  • Bounded free-form shell when no suitable structured primitive exists and direct execution remains sufficient; keep the command narrowly scoped, single-purpose, and tied to an explicit working directory or target.
  • Remote Desktop Commander (RDC) only as the last-resort direct-execution surface after the preceding direct routes are insufficient.
  • Authorized independent worker only when direct execution, including RDC where it is technically applicable, is factually insufficient and the separate worker/delegation gate is satisfied. For substantial repo-local coding or validation, prefer the production-qualified native Codex lane when it matches the authorized worker class; otherwise use the exact authorized Hermes, Adam, or other worker contract and transport.

Operation classification

Before machine execution, classify the intended action using the smallest applicable class:

  • github-native
  • structured-machine-read
  • structured-machine-mutation
  • governed-privileged-broker
  • bounded-shell
  • authorized-independent-worker
  • native-codex-repo-work (worker subtype)
  • rdc-last-resort

Preferred command and action shape

Favor:

  • one operation per request;
  • an explicit repository, worktree, service, or path;
  • exact known identifiers such as PR number, full SHA, job ID, unit name, or fixed action name;

Filtered or delayed tool action

If a legitimate action appears to be filtered, delayed, or blocked before reaching the target:

  • Determine whether the target actually received or created the request/job. For a mutation, distinguish confirmed receipt, confirmed non-receipt, and unknown receipt.
  • If receipt is unknown for a non-idempotent mutation and there is no durable job identity or idempotency mechanism that is guaranteed to cover the fallback path, stop and reconcile the original request outcome before any retry, decomposition, surface switch, or worker fallback. Do not create a second potentially effective mutation while the first may still complete.
  • Do not weaken provider safeguards, SentinelX policy, Linux permissions, Git safe.directory, sudoers, repository ownership, review controls, or other LifeHub protections.

Bounded output and observability

Keep high-volume validation, build, and runtime logs on the governed execution surface whenever practical. Return only the decision-relevant bounded result: exact target identity, exit/disposition, selected test counts, concise failure summary, and a durable evidence reference when available.

  • operation class;
  • selected execution surface;
  • whether the target received the request;

Relationship to structured review execution

Issue #758 and merged PR #761 establish the same direction for Independent Review: GitHub-native portable validation first, bounded structured SentinelX/LifeHub execution for machine work, deterministic job identity, fixed repositories/worktrees/actions, structured bounded results, and no arbitrary credential/path/merge/deploy authority. This section generalizes that execution-shaping doctrine to ordinary LifeHub work without altering Independent Review assurance, reviewer independence, merge authority, deployment authority, or production controls.

Section 09

Validation authority

Repository-contained validator code and contracts are authoritative. A GitHub Actions workflow is one replaceable execution venue for those validators and produces commit-scoped operational evidence only.

Section 10

Approved publication gates

Approved local repository publication paths are fail-closed:

every ordinary local commit must pass the installed shared pre-commit hook, including the exact staged-index Publication Policy validator;
every ordinary local push must pass the installed shared pre-push hook, which validates each exact non-deletion commit/ref in a disposable detached worktree through lifehub-validate.py;
git push --no-verify, suppressing hooks, replacing the shared wrappers, or otherwise bypassing these gates is outside approved publication paths; and
connector/API writes cannot be intercepted by local Git hooks, so their exact PR head must pass portable exact-head validation before the PR is advanced, approved for merge, or merged.

Pre-push scratch boundary

The pre-push helper must not depend on the caller's default temporary directory. When LIFEHUB_PRE_PUSH_TMPDIR is absent, it derives a deterministic host-visible scratch root from the repository owner's account home (~/.lifehub-pre-push), not TMPDIR, HOME, /tmp, or accidental transient-service environment inheritance.

Section 11

GitHub Actions degraded mode

Classify the result before treating a red check as a repository failure.

Repository assertion failure

A validator command started and returned a nonzero result, failed assertion, syntax error, test failure, or other substantive repository result.

Runner or execution-boundary failure

The workflow produced no validator step, steps: none or steps: null, no job log for a validator command, or an account-capacity, billing, runner-allocation, or job-start failure before the first repository command executed.

  • do not repeatedly rerun the same no-step failure;
  • validate the exact PR head in a clean isolated checkout or task worktree;
  • use the portable validation entrypoint or the exact registered suite commands;

Section 12

Required PR validation evidence

Use this compact block when GitHub-hosted execution is unavailable or non-substantive:

Section 13

Fast-Track Execution Lane

LifeHub/08_admin/03_operator/FAST_TRACK_EXECUTION_POLICY.md defines the explicit owner-authorized alternate lane for accelerated experimental or canonical work. Fast-Track changes only the safeguards it explicitly waives or compresses; source-of-truth, task authority, scope, recoverability, Publication Policy, red-zone boundaries, and truthful reporting remain active.

Section 14

Independent review gate for risk-qualified pull requests

Apply LifeHub/08_admin/03_operator/workspace_protection/INDEPENDENT_REVIEW_COST_AND_EXECUTION_POLICY.md.

Section 15

Cross-clone boundary rule

Never edit the same logical artifact in both clones during one task unless doing an intentional sync.
If intentional sync is required, state it explicitly in task notes and validate both trees after edit.

Section 16

Scope coverage all domains

Any AI operator must support and route work across: - LifeHub/01_inbox intake and triage - LifeHub/02_projects active project execution - LifeHub/03_systems reusable methods and continuity systems - LifeHub/04_assets SOPs/templates/checklists - LifeHub/05_specs requirements and behavior contracts - LifeHub/06_apps shared/cross-project implementation - LifeHub/07_outputs final reports and operator logs - LifeHub/08_admin governance and navigation authority

LifeHub/01_inbox intake and triage
LifeHub/02_projects active project execution
LifeHub/03_systems reusable methods and continuity systems
LifeHub/04_assets SOPs/templates/checklists

Section 17

Startup checklist every session

1. Confirm workdir and git branch.

Confirm target domain and environment (production vs preview).
Load LifeHub/08_admin/03_operator/context_runtime/TIER_A_CORE.md.
Route with LifeHub/08_admin/03_operator/context_runtime/CONTEXT_DIRECTORY.index.json.

Section 18

Continuity-guard filename resilience rule

When governance files are renamed for neutrality or clarity, update continuity/onboarding guards in the same change set.

Prefer the current canonical filename first.
Keep prior-name compatibility fallback only as a non-authoritative backup.
Add pattern fallback for future variants when appropriate (for example _REPO_OPERATING_CONTRACT.md).
Never keep a legacy filename as a hard requirement after a canonical rename.

Section 19

Automation rule

All LifeHub-related cron jobs must pin workdir to the intended clone path.

Section 20

Periodic consistency check

Run lightweight drift checks weekly and after major infra/runtime changes. Reference: HERMES_WEEKLY_DOC_CONSISTENCY_CHECK.md (filename retained; rule applies to all AI operators).

Section 21

Definition of done

Task artifacts are written to correct repository surfaces.
Routing/governance docs remain consistent.
Applicable validation is tied to the exact candidate head rather than to one execution vendor.
No important decision is left only in chat.