Add durable guardrails for kai-server disk pressure from xrdp logs and Forgejo PVC growth #488
Labels
No labels
burndown-2026-06
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/infrastructure#488
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
A live read-only disk check on 2026-07-09 found kai-server root at 91% used: 480G total, about 412G used, about 44G available.
Visible contributors:
/var/logis 16G, dominated by/var/log/xrdp.logat 12G. Journald is 4.0G./home/kaiis 58G, with.local13G,Steam12G,.cache9.2G,.net7.1G,.npm4.2G,projects3.0G.forgejo/Deployment/forgejousing 68.4GiB in theforgejo-dataPVC even though the PVC request is 20Gi. Registry is next at 3.4GiB.Because this was a director read-only surface, no live cleanup was performed.
Do
/var/log/xrdp.logcannot grow unbounded again.Acceptance
🔎 ward agent advisor
ward agent advisor --harness codexran a one-shot standard research pass on this question:Recommendation
Treat this as one infrastructure issue with three deliverables in this repo:
kai-serverforxrdpandjournald./gets into the 90% range.The repo already points to the right implementation surfaces for all three:
kai-server, not in app repos or one-off shell fixes.ser8(git-state-watch,flux-readiness-watch) with Telegram viao11y-telegram.deploy/forgejo.yml, and the repo already knows how to resolve PVC host paths safely inscripts/restic-backup.sh.Key findings
forgejo-dataPVC request is 20Gi, but the live data is about 68.4GiB. Onk3slocal-path, that request is not a hard quota. The pod can keep consuming node disk until/fills. So the mismatch is both a documentation problem and an operational risk.xrdp.logat 12G is the clearest single bad actor. That is not a sizing problem, it is a missing or ineffective rotation boundary.journaldat 4G is not the primary incident driver, but on a single 480G root disk that also backs local-path PVCs, desktop logs, and user home data, it is too large to leave implicit.Decisions to make
1.
xrdpguardrailRecommendation: manage an explicit
logrotatepolicy in this repo forkai-server, even if the distro package ships one.Why:
dockerandnode-tuningkai-server roles.Suggested policy shape:
xrdpservice.Open question:
xrdpwriting only/var/log/xrdp.log, or aresesman/xorgxrdplogs also bypassing rotation?Risk note:
xrdperrors is still worth doing so the host is not quietly logging a persistent auth/session failure forever.2.
journaldretentionRecommendation: cap it explicitly. I would set
SystemMaxUse=1Gand also keep a free-space floor withSystemKeepFree.Why:
local-pathPVCs.journaldshould not be competing with Forgejo data and kubelet-backed storage for the last few GiB of root.Alternative:
2Gif there is a strong debugging reason to keep more history.I would not keep the current implicit 4G unless there is a known incident-response need for that much local history.
3. Forgejo PVC growth
Recommendation: do a read-only subtree audit first, then make two decisions separately:
Those are related, but not the same:
git/repositories,data/lfs) or avoidable accumulation (data/packages,data/actions-artifacts, stale archives, attachments).deploy/forgejo.ymlshould be raised to at least reflect reality, but that is bookkeeping, not containment. Onlocal-path, increasing the request does not protect/from filling.Most likely high-growth candidates to measure first:
/var/lib/gitea/git/repositories/var/lib/gitea/data/lfs/var/lib/gitea/data/packages/var/lib/gitea/data/actions_artifactsor equivalent actions storage path/var/lib/gitea/data/actions_logor equivalent actions log path/var/lib/gitea/data/attachments/var/lib/gitea/data/repo-archiveOpen questions:
4. Disk-pressure detection path
Recommendation: add a new ops-plane watcher on
ser8, modeled onflux-readiness-watch, instead of trying to build a first-ever metrics alert pipeline right now.Why:
o11y-telegram, dedup/re-nag/recovery behavior, and no new infra dependencies.node-exporterandvmagentare present, but this repo does not appear to have an existing VictoriaMetrics-to-Telegram alert path. Building one would widen scope beyond the issue./usage thresholds and optionally include the top offenders when above threshold.Suggested behavior:
/var/log,/home/kai, and the Forgejo PVC host path when available.Operator-safe inspection commands
These are read-only and suitable for the issue/runbook.
Root filesystem and obvious host offenders
Resolve the live Forgejo PVC host path, then inspect it on-host
This repo already uses the same
hostPathlookup pattern inscripts/restic-backup.sh.In-pod read-only view, if the on-host path is less convenient
If emergency manual cleanup is needed before the durable fix lands
The issue asked for commands and risk notes, not for autonomous cleanup.
xrdp.logPreferred if a logrotate config already exists:
Fallback if the file must be reclaimed immediately:
Risk:
xrdplogs.journaldRisk:
Forgejo PVC
Do not manually
rmfiles from the Forgejo PVC as the first response.Risk:
Advisory close
My recommendation on the issue would be:
xrdprotation and a repo-owned cap forjournald.ser8, using the existing watcher + Telegram pattern rather than inventing a new alert stack.That gives a durable answer to the immediate disk-pressure finding without pretending that raising the Forgejo PVC request alone would solve node-disk exhaustion.
Researched and posted automatically by
ward agent advisor --harness codex(ward#179). This is one-shot research, not a carried change - verify before acting on it.— Codex, via
ward agentForgejo is the most important thing we run, lets start with sizing it up
The full disk is... 400GB? Thats small, I need to buy more.
In the meantime, forgejo has a bunch of content types that are more durable than I would like. the biggest offender is branches.
Director handoff for the next run:
Kai's latest direction narrows the first slice: Forgejo is the critical service, so start by sizing it honestly and understanding branch-heavy growth. Treat xrdp/journald guardrails as still valid follow-ups, but do not let them distract from the Forgejo sizing pass.
Requested first slice:
deploy/forgejo.yml, backup scripts, and any existing Forgejo retention/config docs in infrastructureNo destructive cleanup. No ad-hoc PVC
rm. If a safe branch/artifact/package retention task emerges, file a separate follow-up with the exact Forgejo-managed mechanism.WARD-RESERVATION: held 🔒
reservation details
Holder: container
engineer-codex-infrastructure-488on hostkais-macbook-pro-2.local.Reserved by
ward agent --harness codex(reserved 2026-07-09T17:40:12Z). Concurrentward agentruns are blocked until it finishes or the reservation goes stale (1h TTL).--forceoverrides.Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh. That is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).
run seed context — what this run is carrying (ward#609)
coilyco-flight-deck/infrastructure#488· branchissue-488· harnesscodex· workflowdirect-to-mainengineer-codex-infrastructure-488· wardv0.501.0· dispatched2026-07-09T17:40:12ZStatic container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.501.0).
— Codex, via
ward agentWARD-OUTCOME: done ✅
details
workflow: direct-to-main; review summary: skipped by ~/.ward/config.yaml default
retrospective: this landed as a focused guardrail sweep plus telemetry.
confidence: high
surprises: origin/main advanced mid-run, so I merged it before the push.
follow-ups: none required for this issue; any live cleanup stays operator-run.