Skip to content

fix(devcloud): retire withdrawn secrets and scrub daemon output - #350

Merged
SSFSKIM merged 6 commits into
mainfrom
devcloud-host-secrets
Oct 22, 2026
Merged

SSFSKIM merged 6 commits into
mainfrom
devcloud-host-secrets

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Addresses board tickets #89 and #91 as one host-secrets change.

  • Remove retired secret targets only when their regular-file lstat identity still matches an actual devcloud write. Preserve user-created files, edits, same-content replacements and final symlink/non-regular targets. Existing symlinked parent directories work without parent-route bookkeeping.
  • Missing, unreadable or invalid ownership metadata means no prior ownership, with a status diagnostic rather than a failed secrets step. Save failures do not block credentials; persistent failures warn that cleanup ownership may be incomplete. Failed cleanup retains retry bookkeeping.
  • Wrap the command from the installed sminos user unit in devcloud run-scrubbed, using devcloud's existing drop-in. Sminos keeps its unit, output destination and process-only kill policy. Linux child-side parent-death binding prevents forced wrapper termination from orphaning the daemon without killing independent sessions.
  • Record both decisions and the requested ownership simplification in the devcloud design. Devcloud remains 0.9.4.

The daemon ticket assumed journald, but the current unit appends to daemon.out; the proof checks both destinations without changing that documented diagnostic path. The lifecycle credential ledger is not ownership proof because it records paths before writes. Reconciliation uses separate private metadata containing file identity, never secret values. Unchanged pre-existing files without ownership proof are deliberately not adopted.

Validation Evidence

  • Final head ce51870d: GREEN via ci-gate. Passed all eight selected gates: shell-lint, repo-checks, mods-types, devcloud-mods, devcloud-unit, devcloud-image, devcloud-systemd and devcloud-host. The unit suite ran 738 tests. Systemd proof passed output scrubbing, graceful stop, timeout escalation, direct wrapper death and independent-session survival.
  • Test-first daemon lifetime proof: ci-gate --gates devcloud-systemd at 2d9dcc11 was RED, with exactly the daemon survived timeout; setup and the other systemd cases passed. Only afterward was the lifetime fix implemented. Its GREEN run and final-head run both pass that regression.
  • Ownership simplification TDD: the focused secret suite first failed on missing diagnostics, route-based refusal and invalid/unreadable/save-error bookkeeping blocking writes. Final result: 28 tests passed. Behavior coverage includes withdrawal and env contraction, user replacements, symlinked parents, cleanup retries, partial writes and non-blocking manifest failures. Daemon integration's focused suite passed 18 tests.
  • Independent review: doperpowers:review-code, medium rung, found no material findings after the daemon lifetime fix. The requested ownership simplification received a separate medium delta review (4e1f4ae8..1dc02d65), also correct — no material findings.
  • Rebased onto main's 55083c19, preserving both Decision Log additions. Range-diff shows the reviewed simplification patch unchanged; the first commit differs only in surrounding Decision Log context. Version manifests are synchronized at 0.9.4.
  • A pre-rebase run passed seven gates but hit the existing fixture startup race before host boot. Recorded in friction tracker Friction tracker (moved to ~/.claude/friction-tracker/doperpowers/) #304; the final rebased-head run above is fully green.

Residue

No unresolved review findings. The fixture startup race is tracked in #304, outside this change. Legacy files without ownership metadata remain unclaimed; if bookkeeping stays unwritable, credentials still materialize but their future cleanup cannot be guaranteed, and status explicitly reports that limitation.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)

Track materializer ownership before pruning retired targets, preserving user replacements. Wrap the installed sminos command in the existing host drop-in without changing its diagnostic destination. Bump devcloud to 0.9.4.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Exercise TimeoutStopSec and direct scrubber death with the installed process-only kill policy; observe this regression in the systemd gate before implementing child lifetime enforcement.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Track unchanged parent routes through symlinks before retiring managed targets. Arm Linux parent-death SIGKILL in scrubbed children to preserve process-only systemd forced-stop behavior without terminating independent sessions.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…ping

Use regular-file lstat identity alone for retirement, including symlinked parent paths. Treat missing, unreadable or invalid ownership metadata as no prior ownership and report bookkeeping failures without blocking secret materialization. Keep devcloud at 0.9.4.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
@SSFSKIM
SSFSKIM force-pushed the devcloud-host-secrets branch from 4e1f4ae to ce51870 Compare October 22, 2026 11:03
The fakes make /srv/fakes as they start; seeding before the readiness wait
raced it ("cannot create /srv/fakes/secrets.json.tmp: Directory nonexistent",
devcloud-host gate, run 39766022963).

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
@SSFSKIM
SSFSKIM merged commit 2a4332b into main Oct 22, 2026
10 checks passed
@SSFSKIM
SSFSKIM deleted the devcloud-host-secrets branch October 22, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant