Skip to content

Rotate managed application and provider logs daily with bounded private diagnostic export #3012

Closed

Description

@integry

Managed diagnostic logs: daily rotation, bounded storage, provider coverage

User decision

Hosted instance logs are needed for debugging past incidents. Keep 14 days of encrypted off-site diagnostic history, rotate daily, and also rotate/retain internal Codex, Claude and other supported provider logs because these grow quickly. Daily rotation alone is insufficient: use explicit segment/per-source and aggregate byte bounds between daily boundaries. Implement the application/provider half here; a linked Fleet issue owns journald/Docker capture and encrypted off-site transport/retention. No deployment in this task.

Required behavior

Audit the actual supported provider versions and host/container managed mounts first, including Codex, Claude, Antigravity/OpenCode/Vibe and any other enabled provider. Document a table of diagnostic/debug/output files, session/transcript files, auth/config files, writer lifetime and available safe reopen/native rotation mechanisms. Do not assume personal ~/.codex or ~/.claude directories are the Hosted mount layout. Current selected source103409d6 uses per-agent managed credential roots, Codex/Claude mounted provider homes and shared /tmp/claude-logs; current main may differ. No broad recursive provider-home copy.

Implement versioned managed log policy, safe local daily UTC rotation plus earlier size rollover, compressed closed segments and bounded private spool. Produce an explicit allowlisted export/manifest for Fleet to consume, with source/provider/agent/instance identifiers, time window, sizes/digests, redaction version and sequence/gap metadata. Operational diagnostics and provider logs are included; never include auth.json, .credentials.json, config/secrets, token databases, arbitrary provider-home files or repository/worktree contents. Redact known secret patterns, structured auth fields and configured credentials without printing secret values; malformed/unrecognized unsafe records must not fall back to shipping raw bytes. Provider logs may contain customer prompts/content, so all exports remain tenant-private and must never become public artifacts or GitHub comments.

Distinguish diagnostic logs from state needed to resume an agent session. Include safely snapshot-able provider diagnostic/session log history in the private export, but do not blindly rename/truncate/delete an active file, reset provider state, remove a resumable session or break live task watchers. Use supported writer reopen/rotation, managed capture, or closed-file rollover per provider; explicitly document any native state that cannot safely be rotated as a log and expose retained/protected reasons. Protect active/running/recoverable tasks; unknown ownership fails safe. Preserve resumption and UI log access. If pruning local resumable history requires archive retrieval, implement and test that retrieval or retain it visibly as protected state—not an undocumented loss of recovery.

Local pruning must respect upload/readback acknowledgement where available, with a documented bounded outage/backpressure policy. Never pretend full 14-day history exists after local cap eviction or failed export: record and surface gaps/dropped bytes and last-successful collection. Use bounded streaming, file counts, decompression/line/record sizes and deadlines; do not buffer a multi-GB provider log into memory. No symlink/hardlink/FIFO/device/traversal escapes, directory-swap races or cross-tenant paths; pin owned descriptors where needed. Concurrent rotation/export/prune must not race or delete someone else's open files. Missing optional provider logs are valid; unsafe sources are reported/refused.

Integrate into the real Hosted/application lifecycle and launcher/runtime as appropriate, not only an unused helper or manual cron example. Self-managed users must not unexpectedly have personal home files pruned: scope destructive maintenance to configured managed roots and document opt-in/Hosted policy activation. Do not change repository cleanup policy, fleet stock, billing, provider permissions, authentication files or unrelated desktop release code.

Evidence required

  • Real temporary filesystem tests across UTC midnight and multiple size rolls; bounded memory/spool, no lost/duplicated committed records, deterministic compression/manifest and restart/concurrency recovery.
  • Provider inventory fixtures matching actual supported mount layouts; test positive collection/rotation for Codex and Claude and documented supported behavior for every enabled provider. Fake generic stdout alone is insufficient.
  • Keep a provider/task writer active while maintenance runs; demonstrate safe rotation/capture without broken live logs, resumed-session data loss or credential mutation. Where native files are protected, test explicit protection plus capacity warning/backpressure.
  • Secret canaries in supported structured/text formats and hostile paths; assert no exported credentials, unrelated home files or plaintext secret values in diagnostics.
  • Fault tests for upload acknowledgement absent, partial export, ENOSPC, symlinks/hardlinks/FIFOs and ancestor replacement. No successful coverage claim after a gap.
  • Application/CLI export integration test, documented machine-readable contract for Fleet and full relevant existing tests. Report exact tested provider versions and limits; no claimed production acceptance without live evidence.

This is the application/provider producer dependency for Fleet https://github.com/integry/propr-fleet/issues/78. Keep 60-day DB/config restore backups unchanged and separate.

Activity

  1. propr-dev commented on Oct 12, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using codex agent with gpt-6-astra model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: codex
    • Model: gpt-6-astra
    • Branch: 3012/gpt-6-astra-rotate-managed-applicatio-20261012-1032-w9t
    • Base Branch: main
    • Worktree: issue-3012-20261012-1032-gpt-6-astra-w9t

    🔍 Track Task Execution

  2. added a commit that references this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions