hermes-backup/daily/2026-04-28_203212/skills/devops/container_patch_workflow/SKILL.md
arifOS container patch workflow, dataclass gotchas, floor short-circuit rules, and F1-F13 data governance test patterns — discovered through trial and error.
npx skillsauth add ariffazil/openclaw-workspace container_patch_workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
arifOS runs from a baked image at /usr/src/app/arifosmcp/. Host source at /root/arifOS/ is SEPARATE. Host patches do NOT affect the running container.
# 1. Patch host source (for git commit)
patch /root/arifOS/arifosmcp/path/to/file.py
# 2. Sync to running container immediately
docker cp /root/arifOS/arifosmcp/path/to/file.py arifosmcp:/tmp/file.py
docker exec --user root arifosmcp sh -lc \
"cp /tmp/file.py /usr/src/app/arifosmcp/path/to/file.py && chown arifos:arifos /usr/src/app/arifosmcp/path/to/file.py"
# 3. Restart to reload code
docker restart arifosmcp && sleep 7
# 4. Verify
curl -s https://mcp.arif-fazil.com/ready | python3 -c \
"import sys,json; d=json.load(sys.stdin); print(d.get('status'))"
docker exec --user root arifosmcp python3 -c "
path = '/usr/src/app/arifosmcp/path/to/file.py'
with open(path) as f: c = f.read()
# make changes to c
with open(path, 'w') as f: f.write(c)
"
cd /root/arifOS/deployments/af-forge
docker compose down arifosmcp
docker pull ghcr.io/ariffazil/arifos:a-forge
docker compose up -d arifosmcp
Fields WITHOUT defaults MUST precede fields WITH defaults — Python enforced, no warning from linters:
# WRONG — TypeError at runtime
@dataclass
class AuditMutationLog:
fields_affected: list[str] = field(default_factory=list)
verdict: GovernanceVerdict # no default AFTER default → fails
# CORRECT
@dataclass
class AuditMutationLog:
fields_affected: list[str] = field(default_factory=list)
reason: str = ""
verdict: GovernanceVerdict = GovernanceVerdict.SEAL # default last
F12 (INJECTION) runs FIRST, before F01/F05/F10/F11. If F12 fires, those floors are never evaluated in the same pass:
# Test assertion must match actual enforcement order
decision = enforcer.ingest_asset(asset_data={"query": "'; DROP..."})
assert "F12" in decision.failed_floors # fires first
assert "F01" not in decision.failed_floors # never reached this pass
# WRONG — defaults to VIEWER → F11 fires → veto "vetoed" not "pending"
enforcer.ingest_asset(asset_id="x", asset_data={}, custodian_id="arif", ...)
# CORRECT
enforcer.ingest_asset(
asset_id="x", asset_data={}, custodian_id="arif",
actor_role=AccessRole.EDITOR, # explicit
)
bundle = WitnessBundle(consensus_score=0.65, ...) # fails F03
bundle = WitnessBundle(consensus_score=0.75, ...) # passes F03
high_impact=True creates "pending" veto ONLY if F02/F03 don't also fail. Provide verified source + 2-source bundle to isolate F13:
verified = SourceVerificationRecord(
source_name="trusted", verification_method="cryptographic", trust_score=0.95)
bundle = WitnessBundle(
sources=[...], witness_count=2, consensus_score=0.89)
decision = enforcer.ingest_asset(
..., high_impact=True,
source_verification=verified,
witness_bundle=bundle,
actor_role=AccessRole.EDITOR,
)
assert decision.veto_record.status == "pending" # F13 isolated
Container enum does NOT have MANIPULATION or SOCIAL_ENGINEERING:
from arifosmcp.core.threat_engine import ThreatCategory
# OK
ThreatCategory.FEDERATION_IMPERSONATION
ThreatCategory.SESSION_IMPERSONATION
ThreatCategory.INJECTION_SQL
# WRONG — AttributeError at runtime
ThreatCategory.MANIPULATION
ThreatCategory.SOCIAL_ENGINEERING
# Verify tesseract is in the running container
docker exec arifosmcp tesseract --version
docker exec arifosmcp python3 -c "import pytesseract; print('pytesseract OK')"
docker exec arifosmcp python3 -c "from PIL import Image; print('Pillow OK')"
Redeploy command (requires sovereign action):
cd /root/arifOS/deployments/af-forge
docker compose down arifosmcp && docker pull ghcr.io/ariffazil/arifos:a-forge && docker compose up -d arifosmcp
development
Federation-wide gold (XAUUSD) trading capability. Python stack, OANDA broker, backtesting, macro signals, RSI strategy. Every organ has a role.
development
Capital claim state management — tracks claim lifecycle across WEALTH organ.
development
Archived constitutional warga placeholder retained only for audit provenance. Do not use for active work; use the live arifOS governance and constitutional skills instead.
testing
Warga (citizen) agent skills for AAA federation members. See subdirectories for specialized warga skills.