Operations
Start / Run / Deploy
Local development:
./scripts/dev.sh bootstrap./scripts/dev.sh run- INSTALL.md
- CONFIGURATION.md
CI verification:
./scripts/ci.sh
OCI image helper:
./scripts/oci_image.sh print-tags./scripts/oci_image.sh build./scripts/oci_image.sh publish
Operator Entry Paths
- Local service path:
./scripts/dev.sh bootstrap./scripts/ci.sh./scripts/dev.sh run
- Standalone host path:
deploy/compose/jhf-warp.stack.yml- PRODUCTION_STACK_DEPLOYMENT.md (
docs/PRODUCTION_STACK_DEPLOYMENT.md) - OPERATOR_RUNBOOK.md (
docs/OPERATOR_RUNBOOK.md)
- Fabric read-first consumer path:
/health/ready/version/fabric-manifest.json/openapi.json
- OCI consumer path:
./scripts/oci_image.sh print-tags- OCI_IMAGE_PATH.md (
docs/OCI_IMAGE_PATH.md)
Healthchecks
GET /health- basic liveness
GET /ready- readiness plus warnings, capability keys, and self-description references
GET /version- canonical version endpoint
- Compose healthcheck policy:
- no interval below
20s - production default:
120s - optional low-CPU production override:
180s - integration stack:
20son Postgres only, then stop the stack after verification
- no interval below
- Production container checks:
api: lightweight TCP socket open on<internal-runtime-redacted>:8080postgres: nativepg_isready
Deployment Boundary
Minimum operator baseline:
- reverse proxy or gateway in front of the service
- internal-network-only exposure wherever possible
- self-description endpoints handled separately from mutation/control surfaces
- mutating routes default-denied unless an authenticated internal caller explicitly needs them
- configure
JHF_WARP_FABRIC_CONTEXT_BASE_URLfor the current projection/composition layer - if
JHF_WARP_FABRIC_CONTEXT_BASE_URLis set for a guarded live Fabric path, require non-emptyJHF_WARP_FABRIC_CONTEXT_AUTH_TOKENfor Warp -> Fabric service auth - verify host-local env files with
python scripts/verify_host_env_contract.py <env-file>and keep only canonicalJHF_WARP_*keys in live deployment files - verify runtime materialization drift with
python scripts/verify_runtime_materialization.py --host <internal-runtime-redacted>for the canonical Host172 live readback, orpython scripts/verify_runtime_materialization.py --host <live-host>for another owner-bounded live host, so repo truth, host env, container env, authenticated runtime inventory, authenticated drift summary, compose labels, and app readback stay aligned - verify the live checkout remains fetchable, exact-main-clean, and free of unwritable ref/reflog ownership drift with
./scripts/verify-host-repo-fast-forward.sh --repo-dir <owner-runtime-checkout> --branch main ./scripts/host_checkout_sync.shquarantines known root-owned generated churn (__pycache__/,.pytest_cache/,build/,*.egg-info) into the timestamped backup root beforegit clean, using a bounded Docker helper because some container-written cache paths cannot be moved directly by the host user
Read-only self-description surfaces:
/health/ready/version/openapi.json/fabric-manifest.json
Mutating/control surfaces that should stay on authenticated internal-only paths:
/api/v1/openclaw/patch/*/api/v1/execution/*/api/v1/control-agent/*- persistent learning proposal review/write paths
Projected authority contract:
- self-description endpoints remain open
- internal routes require
Authorization: Bearer <token> - Heddle stays upstream auth truth
- Fabric currently normalizes/projects context
- future normative governance docks at Spine
- internal write/control endpoints fail closed when the projected authority context is unavailable or incomplete
Safe Docker Log Diagnostics
Use bounded snapshots only for live-host Docker log inspection.
Rules:
- never run unbounded
docker logson a live host - always include
--since - always include
--tail - always wrap the call in a hard
timeout - prefer one bounded snapshot over long-running follow mode
Repo helper:
./scripts/safe_docker_logs.sh jhf-warp-api 10m 200 20
The wrapper supplies the hard timeout, bounded time window, bounded tail, and
cleanup-safe process lifecycle; do not reproduce its underlying docker logs
call directly in an operator command.
Runtime Guardrails
CPU-safe runtime guardrails for the shared host baseline:
- no-repeat, low-pressure diagnostics only
- repo-owned stack truth stays
jhf-warpwith canonicaljhf-warp-*container names - default shared-host health and watchdog cadence must stay non-aggressive (
>= 60s) - restart handling must use bounded backoff instead of tight loops
- every deploy/verify pass must end with a bounded post-deploy cleanup check
- rerunning the same bounded verify flow must stay idempotent and leave no hanging debug helpers
Canonical verifier:
python scripts/verify_runtime_guardrails.py --report artifacts/runtime-guardrails-report.json
python scripts/verify_runtime_guardrails.py --host <live-host> --report artifacts/runtime-guardrails-live-report.json
python scripts/verify_runtime_materialization.py
python scripts/verify_runtime_materialization.py --host <internal-runtime-redacted>
python scripts/verify_runtime_materialization.py --host <live-host>
./scripts/verify-host-repo-fast-forward.sh --repo-dir <owner-runtime-checkout> --branch main
python scripts/verify_agent_capability_policy_projection.py
Troubleshooting shortcut:
Standard bounded diagnostics evidence:
- repo/CI path writes
artifacts/runtime-guardrails-report.json - live host path writes
artifacts/runtime-guardrails-live-report.json - the smoke workflow uploads the repo report as the canonical bounded diagnostics artifact
Post-deploy cleanup/postcheck expectations:
- run a bounded log snapshot, not a long-lived stream:
./scripts/safe_docker_logs.sh jhf-warp-api 10m 200 20
- a bounded timeout counts as valid completion for the diagnostic snapshot as long as no lingering log readers remain
- ensure no lingering
docker logs,watch, ortail -fprocesses remain forjhf-warp - prefer one lightweight
docker stats --no-streamsample over sustained monitoring
Logging
The service currently relies on standard application logging and CI command output. There is no fully documented structured logging contract yet.
Minimum operator-useful logging should include:
- startup mode, runtime mode, and persistence mode
- outbound integration skip/fail/success outcomes
- control-agent cycle outcomes
- patch plan/apply guard decisions
Monitoring
Useful operator views today:
/health/ready/version/metrics/api/v1/runtime/inventory/api/v1/topology/diff/api/v1/drift/summary/api/v1/control-agent/status/api/v1/persistent-agents
Bounded verify/test stack handling:
- start only for explicit integration verification:
docker compose -f compose.integration.yml up --build -d
- stop immediately after the check window:
docker compose -f compose.integration.yml down -v
Minimum monitoring baseline today:
- self-description state from
/health,/ready,/version - normalized internal metrics from
/metrics - persistence mode and runtime mode from
/api/v1/runtime/inventory - drift severity from
/api/v1/drift/summary - rollout verification from
/api/v1/rollouts/audit - control-agent health and scheduler state from
/api/v1/control-agent/status - persistent-agent governance state from
/api/v1/persistent-agents - host checkout hygiene from the ff-only verifier, including ref/reflog writability
Metrics surface:
GET /metrics- Prometheus-style text payload
- protected as an internal read route by the same projected-authority boundary as other internal operator reads
- intentionally small: service, persistence, runtime, drift, outbox, control-agent, and governance counters only
Minimum alert/warning set that should be surfaced operationally:
fixture-memoryactive outside explicit development/test use- OpenClaw runtime unavailable or degraded
- failed or repeatedly skipped downstream delivery
- control-agent reconcile warnings, replay spikes, or watchdog growth
- OCI publish failures on release-oriented builds
Useful dashboard fields:
- Grafana:
- health/readiness state
- version and deployment image ref
- runtime mode and persistence mode
- drift severity trend
- integration failure counts
- Gitea:
- latest green CI state
- latest built image tag
- known blocker/warning summary
- last successful verification timestamp
- current
/metricsscrape timestamp or last successful metrics read
Recommended alert thresholds and warnings:
fixture-memoryactive outside explicit development/test use- repeated OpenClaw inventory failures
- non-zero drift severity that persists across checks
- repeated control-agent reconcile warnings, replay spikes, or watchdog growth
- repeated downstream integration failures or skipped deliveries
- publish-lane failure when a release-oriented OCI build is expected
Known Failure Modes
- service starts in fixture-memory mode because Postgres DSN is missing
- runtime inventory/drift degrade because OpenClaw host/runtime facts are unavailable
- outbound integration routes skip because downstream tokens or URLs are missing
- OCI publish job skips because
GITEA_PACKAGES_TOKENis not present in the runner context
Restart / Recovery
- restart the service process/container through the deployment system
- verify
/readyand/api/v1/runtime/inventoryafter restart - verify migration state before assuming persistence regressions
- regenerate a patch plan before any live runtime mutation retry
Runtime Dependencies
- Python runtime
- Postgres for durable state
- OpenClaw host/runtime for full orchestration value
- optional downstream integrations for setup/sync delivery
Implemented Vs Planned
Implemented today:
- local and stack deployment flows
- projected authority gating for internal read/write routes
- minimal metrics export at
/metrics - read-first Fabric self-description surfaces
Planned or external-only:
- Fabric registration or write-back control
- remote MCP server delivery
- operator-managed runner Postgres verification prerequisites
- operator-managed OCI publish credentials and downstream consumer rollout
Related Documents
- RUNBOOK.md
- SECURITY.md
- OPERATOR_RUNBOOK.md (
docs/OPERATOR_RUNBOOK.md) - OCI_IMAGE_PATH.md (
docs/OCI_IMAGE_PATH.md)
License
AGPLv3. See ../LICENSE (LICENSE).
Learn more at helpifyr.com.
Workspace Git/Scan Guardrails (Mandatory)
- Gitea is Source of Truth; local Windows workspaces are disposable working copies.
- Never run Codex sessions on the workspace root; always use a concrete repo path.
- Limit active repo sessions to 2-3 in parallel.
- Before each run in a repo:
git fetch --prune,git checkout <branch>,git pull --ff-only. - No background git discovery loops (
git status,git ls-files, worktree scans) without explicit scoped need. - Automation scripts must run repo-scoped only, never global over the workspace root.
scan_and_fix Standard
scripts/scan_and_fix.shmust enforce runner timeout + single-run lock +.envfallback to the operator-managed workspace.env.scripts/scan_open_issues_repo_only.shmust exist and query only current repo open issues via Gitea API.scripts/scan_and_fix.shtreats Gitea open issues of the current repo as the canonical queue by default.- normal mode is a bounded serial live run over the open queue;
--dry-runis only for inspection/debugging. - if no local
openclawCLI exists, the dispatcher must route through the configured OpenClaw host path and fail closed on execution errors. - default runtime lane is the permanent specialist agent
cicd-ops; use--agentonly when a different explicit lane is needed.
Release Eligibility Posture
- Public release-surface admission is bounded by
../contracts/admission/release_surface_inventory_v1.json. - Current repository history posture is tracked in
../contracts/admission/repository_publication_history_posture_v1.json. - Active owner follow-up issue:
JaddaHelpifyr/jhf-warp#564. jhf-warpremainspending_history_scan; repo-owned history evidence now runs throughpython scripts/verify_repository_history_posture.pyand currently provesfiltered_publication_required, while operator-only runtime manifests and live runbooks stay explicit but outside public release-surface admission.- The selected owner decision is filtered publication from exact
main; canonical history rewrite stays out of scope for this preparation lane.
Workspace Hygiene
- Daily cleanup: stale
_worktrees/*,_tmp/*,test-results/*, large temporary artifacts. - Weekly cleanup: stale local branches/worktrees.
- Never leave valuable artifacts as untracked files in workspace root.
Dirty-State Policy
- Dirty state is allowed while actively implementing.
- Before new scan/automation runs: commit/stash, or use a dedicated worktree.
- Never propagate
dirty_unknownstates.
Incident Playbook (git.exe storm)
- Identify parent of
git.exe(usually oneCodex.exe). - Stop only the offending process tree.
- Restart session on concrete repo path.
- Reduce parallel sessions.
- Verify
git.execount drops within 30-60s.