Skip to content

[PERF] Doctor reads full audit events.jsonl (up to max_audit_log_len) for health checks #411

Description

@christopherkarani

Summary

Doctor reads full audit events.jsonl (up to max_audit_log_len) for health checks

Evidence

readFileAlloc events_path limited by max_audit_log_len for last-session checks; MCP dir iterate; multiple integration probes. doctor.zig is 3030 lines monopath pulling nested tests.

Trigger

ryk doctor interactive/check

Files

  • src/cli/doctor.zig:922-928
  • src/cli/doctor.zig:1388+

Adversarial check

Doctor is offline UX not hook path; large audit logs make doctor slow and memory-heavy.

Metadata

  • Audit ID: P022
  • Severity: P2
  • Confidence: medium
  • Area: cli/doctor
  • Category: performance
  • Source: adversarial memory/perf audit 2026-08-16 (static evidence; product code untouched)
  • Checkout: local rykan_codebase @ ryk 0.2.18

Guidance

Do not weaken fail-closed / lock / fsync semantics on security-critical paths without an explicit durability tradeoff. Prefer mtime caches, long-lived evaluator/prewarm, caps/rings, and errdefer ownership fixes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-filedFiled by eng-factory agentarea:cliCLI commands doctor installenhancementNew feature or requestfactory:autoAutonomous eng-factory pickup OKin-reviewPR open; review/verifypriority:p2Normal prioritytriage:confirmedTriage verified real issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions