feat(backup): add unique-knowledge offsite backup runner #701
No reviewers
Labels
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pdurlej/platform!701
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "codex/698-unique-knowledge-backup"
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?
Canary status: missing — fire canary 3+3 manually before merge
Summary
Adds the ADR-0013 / #698 unique-knowledge backup runner for local + rclone-crypt pCloud backups, plus restore verification and a live evidence report.
Closes #698.
Canary Context Pack
Product story
The platform now has an operator-run path to preserve irreplaceable knowledge outside RS2000: local archive plus encrypted pCloud offsite, with restore verification instead of trusting backup creation alone.
What changed
config/backup/unique-knowledge.sources.jsonfor the default unique-knowledge source set.scripts/backup/unique_knowledge_backup.py.scripts/backup/restore_check.py.state/reports/unique-knowledge-backup-2026-06-04.md.Why it changed
ADR-0013 chose rclone-crypt pCloud plus a pluggable local copy. #698 required actual restore verification, not only scripts.
Files touched
config/backup/unique-knowledge.sources.jsonscripts/backup/runbooks/unique-knowledge-backup.mdstate/reports/unique-knowledge-backup-2026-06-04.mdtests/test_unique_knowledge_backup.pyRelevant context
Runtime evidence
A full live run completed:
20260603T231146Z;3133883380bytes;c84a6f7455d096bbcaf049d7993641fccf58e582017d2ee64d410f3e234fee37;copiedtopcloud_crypt;12/12captured sources and387973archive entries.Known constraints
rsync; the script usedtar-over-ssh.Explicit out-of-scope
Requested decision
Approve this as the first completed ADR-0013 backup-continuity implementation and live restore proof.
Merge blockers
Spec sources read
decisions/0013-offsite-backup-rclone-crypt-pcloud.md— ADR contract.state/strategy/platform-maturity-roadmap-2026-06-01.md— Phase-1 backup continuity context.scripts/cutover/backup-before-apply.sh— existing backup receipt/style reference.scripts/cutover/README.md— existing backup helper runbook style.Validation
uv run pytest tests/test_unique_knowledge_backup.pyuv run pytest tests/test_unique_knowledge_backup.py tests/test_honcho_log_privacy.pyPYTHONPATH=control-plane uv run --project control-plane python -m platformctl.cli validate all --jsongit diff --checkstate/reports/unique-knowledge-backup-2026-06-04.md54071bd046dc7765c613Patchwarden PR sanity
advisory_findings701dc7765c61363ee04babe695590bd731c65652075missingDeterministic findings
No deterministic findings.
Model reviewers
global-glm/glm-5.1:cloudStatus:
okVerdict:
NOT_OKhighCommand injection via unvalidated remote_host in SSH commandsIn scripts/backup/unique_knowledge_backup.py,remote_hostfrom the manifest JSON is passed directly to SSH without validation. Lines ~219-236 (copy_remote_path_tar), ~170 (remote_path_exists), ~179 (remote_path_is_dir), and ~195 (r`require_safe_hostnamefunction that validatesremote_hostagainst a pattern like^[A-Za-z0-9][A-Za-z0-9.-]{0,253}$(no spaces, no dashes at start, no SSH option characters). Call it incopy_remote_path,copy_remote_path_tar,capture_postgres_dumpall,remote_path_exists, `remote_pmediumUnquoted remote_path in SSH test commands enables argument injectionIn scripts/backup/unique_knowledge_backup.py lines ~170-180,remote_path_existsandremote_path_is_direxecutesubprocess.run(["ssh", remote_host, "test", "-e", remote_path], ...). Theremote_pathstring is not shell-quoted before bshlex.quote(remote_path)in the SSH remote command strings withinremote_path_existsandremote_path_is_dir, consistent with howcopy_remote_path_tarquotes paths.lowOverly broad hex-string redaction may mask legitimate error contextIn scripts/backup/unique_knowledge_backup.py line ~30,SECRETISH_REincludes([A-Fa-f0-9]{40})which matches any 40+ character hex string. This could redact non-secret hex values like tar archive checksums or size counters that appear isk-prefix for OpenAI keys, which is already covered), or add a comment acknowledging the trade-off. Consider adding equivalent redaction to restore_check.py for consistency.global-deepseek/deepseek-v4-pro:cloudStatus:
okVerdict:
OKmediumRestore check does not validate symlink targetsscripts/backup/restore_check.py: list_archive_members() only checks for absolute paths and '..' in member names, but does not inspect symlink targets. A malicious archive could contain a symlink with an absolute target (e.g., 'foo -> /etc/predteam/kimi-k2.6:clouderror-Policy notes
PLATFORMCTL_PR_SANITY_REDTEAM_MODELis configured.