root 574cb99d76
PR Pipeline — Authorize → Validate → Review → Merge / auth (pull_request) Successful in 6s
PR Pipeline — Authorize → Validate → Review → Merge / validate (pull_request) Successful in 4s
PR Pipeline — Authorize → Validate → Review → Merge / lint (pull_request) Failing after 6s
PR Pipeline — Authorize → Validate → Review → Merge / ai-review (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / gate (pull_request) Skipped
feat: land the revision-preflight guard, fixed and wired into contract execution
A contract verdict is only meaningful if it came from the merged copy. The
fleet has been bitten three times on 2026-09-25 (a clone parked on a merged
feature branch while executing from another clone; a script copied into the
runner clone by hand; a stale local origin/master making an ancestry check
report unlanded work). The control for this existed as an untracked draft and
protected nobody, because it was entirely fail-open.

Defect in the draft, preserved verbatim as tests/fixtures/revision-preflight.prefix.sh:

  git -C "$CLONE" show "origin/master:$(basename "$SCRIPT")"

basename drops the scripts/ prefix, so for any script under scripts/ it queried
the repo root, failed, took the "warn but don't block" branch and exited 0 -
passing a script that exists in no revision at all. Reproduced:
  pre-fix + scripts/demo.sh under scripts/  -> 'could not resolve', EXIT=0
  pre-fix + a script in no revision          -> EXIT=0

Fixed guard (scripts/revision-preflight.sh):
* resolves the repo-relative path inside the clone, so scripts/ paths resolve;
* FAILS CLOSED - a path absent from the ref, an unresolvable ref, or a failed
  fetch is a failure, never a warning;
* fetches the remote by default, because a stale local ref would otherwise
  pass a stale script as current; --no-fetch states the assumption instead of
  hiding it.

Wiring (scripts/contract-run.sh): before executing, the wrapper runs the guard
against the clone it lives in. Default CONTRACT_REVISION_PREFLIGHT=enforce
withholds the verdict, alerts and exits 2 on mismatch; =warn logs and
continues; =off skips. Verified live: match -> contract proceeds and PASSes;
mismatch -> 'VERDICT WITHHELD', exit 2; =warn -> continues.

Pinning (docs/contract-execution-pinning.md): every contract pins the clone
contract-run.sh lives in - the deployed runner being /opt/contract-runner on
CT 100. Documented that daily-health-digest has no contract file at all, which
is why its execution copy was silently operator-chosen.

Tests: tests/test_revision_preflight.sh, 15 assertions over a throwaway clone
with a real bare remote. It runs the pre-fix draft against the same cases and
shows it passing a ghost script, so the tests provably bite.

shellcheck: scripts/revision-preflight.sh and the new test are clean. The three
findings remaining in contract-run.sh (SC2086 x2, SC2034) are pre-existing and
byte-identical on master.
2026-09-25 11:04:29 +00:00

Prose Contracts — Syslog Solution LLC

Operating contracts for Syslog agents. Each .prose.md file defines a function (callable helper), responsibility (recurring duty with state), or pattern (instantiable knowledge/template) that agents can execute via OpenProse or follow manually.

⚠️ Operating Doctrine — Read Before Acting

Two rules govern how agents interact with this repo and the infrastructure it describes. Internalize both before running or relying on any contract.

1. Verify-before-mutate (the .117 rule)

Contracts are leads to investigate, NOT facts to act on. Live-state fields (IPs, ports, hostnames, credentials, container names, PIDs) drift. Before any mutating operation on infrastructure, verify the current state against the live system. On drift, halt and ask the user which value is correct — do NOT "fix" the live state to match a stale contract.

Origin: a contract stated Zulip CT 117 was at .117; the live IP was .19. An agent ran pct set without checking pct config first and changed the IP to the wrong value, breaking Zulip. The staleness was harmless until acted on.

Layer 3 enforcement — the safe-mutate wrapper (deployed on all 5 agents: Abiba, Tanko, Mumuni, Koby, Koonimo — Tanko runs on DSH/DeepSeek Harness since 2026-08-27 but safe-mutate enforcement still applies). ALL infrastructure mutations MUST go through safe-mutate. Raw sed -i, pct set, docker compose up --force-recreate, kill, rm on infrastructure outside safe-mutate is an auditable protocol violation. The wrapper runs a verify command, optionally checks an --expect pattern, refuses on mismatch, and logs every call to /root/.safe-mutate/audit.log.

safe-mutate --verify "CMD" [--expect "PATTERN"] --mutate "CMD" [--reason "WHY"]
safe-mutate --verify "CMD" --dry-run --mutate "CMD"      # verify + show, no execute
safe-mutate --verify "CMD" --verify-only                   # record a verification only

Load the verify-before-mutate skill (local pi skill + RA-H shared) for the full protocol. See knowledge graph node #604 for the post-mortem.

2. Field trust levels

Not all contract content carries the same trust:

Field type Trust level Examples
Policy Authoritative — trust the contract "hardcoded harness keys forbidden", "use api_key_env"
Live state Never trust — always verify IPs, ports, hostnames, credentials, container names, PIDs
Procedure Trust but adapt command patterns are right, values may be stale

Contracts label live-state fields with VERIFY-BEFORE-USE. Treat any such field as a hint to confirm against the live system, not a fact to apply.

3. Verify-before-fix (contract-native)

Never prose run a fix-contract directly. Run its verifier first, read the verdict, lint the fixer, then run:

prose run <verifier>           # e.g. zulip-platform-verification → verdict
prose lint <fixer>             # validate structure without executing
prose preflight <fixer>        # check deps/env, no execute
prose run <fixer>              # only after verdict + lint pass

kind: responsibility contracts VERIFY and return a verdict without making changes. kind: function contracts DO things. Forme ### Requires → ### Maintains wiring enforces this at the DAG level: a fixer that requires a fresh verdict cannot fire until the verifier has run.

How Agents Run These Contracts

Option A: Via OpenProse CLI (preferred)

prose run <contract-name> [param1=value1 param2=value2 ...]

Examples:

# Run a memory audit with default parameters
prose run memory-audit-maintenance

# Run a memory audit with custom threshold
prose run memory-audit-maintenance memory_threshold=90 verify_configs=true

# Configure a new agent with the template
prose run hermes-config-template agent_name=syslog-devops default_model=claude-sonnet-4

# Configure an agent with a different auxiliary model
prose run hermes-config-template agent_name=syslog-code default_model=gpu-dense auxiliary_model=gpu-vision

Option B: Manual Execution

If prose CLI isn't available, any agent can:

  1. Fetch the raw contract: curl -sL https://git.sysloggh.net/SyslogSolution/prose-contracts/raw/branch/master/<filename>
  2. Read the Execution section
  3. Follow the steps

Example for fetching:

curl -sL https://git.sysloggh.net/SyslogSolution/prose-contracts/raw/branch/master/memory-audit-maintenance.prose.md

Available Contracts

Responsibilities (Recurring Duties — kind: responsibility)

Run on trigger or schedule. Maintain persistent world-model state across runs.

Contract Domain Description
memory-audit-maintenance Memory Audits & reorganizes an agent's native memory (MEMORY.md, USER.md). Categorizes entries, moves rules to skills, verifies configs.
build-zulip-plugin Zulip Generates and iteratively improves a Hermes Zulip platform plugin. Each run produces a new version.
zulip-health Zulip Checks Zulip connectivity, message flow, and bot responsiveness.
zulip-mention-reliability Zulip Diagnoses and fixes @mention detection issues in Zulip.
zulip-approval-fix Zulip Fixes broken /approve and /deny slash commands for Hermes agents.
litellm-self-heal LiteLLM Applies remediation rules for LiteLLM stack failures detected by litellm-health (full nginx → LiteLLM → GPU chain). 9 remediation rules.
gpu-fleet GPU Manages the GPU inference fleet: model deployment, registration, health checks, LiteLLM sync.
gpu-monitor GPU Comprehensive GPU fleet monitor — polls sidecars, router, LiteLLM every 15s, renders SSE dashboard.
proxmox-monitor Infra Proxmox cluster + Docker monitoring via the existing Grafana/Prometheus stack on CT 116.
disk-gc-threat-response Infra Fleet-wide disk health scan + garbage collection across 15 CTs + 3 GPU hosts + docker-vm KVM VM. 5-tier threat levels with automated GC and Zulip alerting. Two incidents resolved: kagentz (35.67GB) and amdpve (11.56GB).
pm2-self-heal Ops Monitors PM2 processes (abiba-zulip, abiba-telegram) and auto-restarts any that are stopped or errored.

Instantiable Templates (kind: pattern — run with prose run)

Generate configs or perform a transformation on demand. No persistent state.

Contract Description Key Parameters
hermes-config-template Standard Hermes config for any Syslog agent. Enforces shared infra (Firecrawl, SearXNG, RA-H OS MCP, LiteLLM) + standardized api_key_env key indirection. agent_name (required), default_model, auxiliary_model
hermes-key-enforcement Enforcement contract — all harness/LiteLLM providers MUST use api_key_env, never hardcoded keys. Includes detection query, rotation procedure, violation response. External providers (DeepSeek, OpenAI) exempt. (none — doctrine reference)

Reference Documents (kind: pattern — read for context, not run)

Encode topology, architectural decisions, and lessons. You read them before planning; you don't prose run them.

Contract Description
infrastructure-control Full topology and control pattern: 5-node Proxmox cluster, 3 Docker ecosystems, NFS storage, network verification, IP-first configuration doctrine. Live-state fields marked VERIFY-BEFORE-USE.
pi-approval-architecture pi's approval model vs Hermes, available commands, architectural constraints.
zulip-adapter-lessons Failure modes, fixes, and patterns from building the pi Zulip extension and Hermes Zulip plugin.

Functions (kind: function — callable helpers, no state)

Called on-demand as single-render tools.

Contract Description
litellm-api-keys Manages LiteLLM API keys for agent identity. Create, rotate, verify, and list agent keys. References gpu-fleet for current key inventory.
litellm-health LiteLLM health check: public vs backend surfaces, CT 116 containers, GPU fleet, one model per GPU host, and agent keys. Owner of the probes; litellm-self-heal owns remediation.
infrastructure-monitoring Target-state for Prometheus + GPU exporters + Grafana. Core stack deployed, GPU exporters NOT live.
stirling-pdf-agent-access Documents the Stirling-PDF API access pattern for agents — global API key, 12 operations, curl examples. Agents use the stirling-pdf-api shared skill for templates.
hello-world Minimal test contract — verifies the OpenProse execution pipeline works.

Scripts (scripts/)

Companion shell scripts that contracts delegate to.

File Description
daily-infra-report.py Generates the daily infrastructure dashboard (HTML email to jerome@sysloggh.com).
pm2-self-heal.sh Shell companion to the pm2-self-heal contract — restarts crashed PM2 processes (runs every 5 min).
agent-health-check.py Consolidated agent health: LiteLLM key validation + GPU port conflict + streaming checks (every 10 min).

Contract Structure

Kinds determine the section set.

kind: responsibility (recurring duty with persistent state):

## Maintains      — World-model state this contract tracks
## Parameters     — Tunable inputs (with defaults)
## Requires       — External dependencies and preconditions
## Continuity     — When to run (triggers & cadence)
## Remembers      — What to learn between runs
## Invariants     — Inviolable rules for execution
## Execution      — Step-by-step instructions
## Example Output — What a good run looks like

kind: function (stateless callable helper):

## Parameters    — Tunable inputs (with defaults)
## Returns       — Output schema
## Requires      — External dependencies
## Execution     — Step-by-step instructions

kind: pattern (instantiable knowledge):

Variable — templates use Parameters + Execution; reference docs are prose-driven.

kind: gateway / kind: test — not currently used in this repo.

Adding New Contracts

  1. Create a .prose.md file following the structure above
  2. Push to this repo
  3. The contract is immediately available for any agent to prose run

Repository

S
Description
OpenProse contracts for Syslog agent mesh — health checks, deployments, workflows
Readme
4.5 MiB
Languages
Python 63.9%
Shell 36.1%