Skip to content

engineering-loop: logrotate for the agent-core trace sink (Closes #309)#312

Merged
Svaag merged 2 commits into
mainfrom
chore/agent-core-trace-logrotate
Jun 29, 2026
Merged

engineering-loop: logrotate for the agent-core trace sink (Closes #309)#312
Svaag merged 2 commits into
mainfrom
chore/agent-core-trace-logrotate

Conversation

@Svaag

@Svaag Svaag commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Bounds the additive agent-core trace sink so it can't grow unbounded under the unit's
ProtectSystem=strict / ReadWritePaths confinement.

  • roles/engineering_loop/templates/agent-core-trace.logrotate.j2/etc/logrotate.d/engineering-loop-agent-core-trace
  • policy: weekly OR size 20M, rotate 8, compress/delaycompress, copytruncate,
    su loop loop (sink lives in the loop-owned state dir), missingok/notifempty.
  • Installed by the engineering_loop role on apply (one new template task).

render-check clean. Low-velocity sink (max_runs_per_day: 2), so this is headroom, not urgent.

Closes #309.

🤖 Generated with Claude Code

Bounds /var/lib/engineering-loop/agent-core-trace.jsonl (weekly OR 20M, keep 8, compress, copytruncate, su loop loop) so the additive emission sink cannot grow unbounded under ProtectSystem=strict. Installed via the engineering_loop role on apply; missingok covers the sink-not-yet-created case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Svaag Svaag requested a review from a team as a code owner June 29, 2026 10:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ed5bb90e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ansible/roles/engineering_loop/templates/agent-core-trace.logrotate.j2 Outdated
Comment thread ansible/roles/engineering_loop/templates/agent-core-trace.logrotate.j2 Outdated
@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

Address codex review on #312: use maxsize with weekly rotation so weekly cadence is preserved, and use normal rename/create rotation instead of copytruncate because the emitter reopens the trace path per write.
@Svaag

Svaag commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Addressed both inline findings in 0f58c91:

  • changed size 20M to maxsize 20M so weekly rotation is preserved with a size cap;
  • removed copytruncate and use normal rename/create rotation (create 0640 loop loop) because the emitter reopens the trace path per write.

Local render check: scripts/ci/render-all.sh passed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 0f58c914e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Svaag Svaag merged commit b36a0a8 into main Jun 29, 2026
11 of 12 checks passed
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.

Add log rotation/retention for agent-core trace JSONL sinks

1 participant