Skip to content

Parity gaps against the Python agent (rules refresh, key stamp, stats, docs) #36

Closed

Description

@rennf93

I audited guard-agent-php 3.2.4 against the Python agent (guard-agent 3.2.4) and found these divergences, each reproduced with a failing test first.

  • start() schedules the dynamic rules refresh without a project id. The reference runs the rules loop only if self.config.project_id (client.py:128-129).
  • Persistence keys are stamped with hrtime(true), a monotonic clock. The reference stamps wall-clock time.time_ns() (_buffer_redis.py:54). The AGENTS.md claim that reload is oldest-first is also untrue: the reference does not sort on reload and neither does this agent.
  • EventBuffer::getStats() lacks auto_flush_running, which the reference buffer stats carry (buffer.py:57-74).
  • AGENTS.md is stale: it says version 0.1.0 with no shipped tags, a guard-agent/<version> User-Agent (the code sends guard-agent-php/), omits the encryption onError stage, and claims the Python, TS and Go agents sign post-gzip bytes (they sign the uncompressed body).

Stats keys: the agent, buffer and transport key sets otherwise equal the reference. The arrays are host-facing only (the PHP adapters merge them into agentStats) and are never serialized into a status push, health endpoint or SaaS payload, so I keep camelCase and document the mapping.

The persist-at-flush, tick or shutdown deferral stays as is (maintainer-approved in #33). I only make the docs state it accurately.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions