Skip to content

feat(remote_agent): add queue telemetry motif mixer and logging#72

Open
PiyushDatta wants to merge 2 commits intomainfrom
agent/workerpal-04dc03e6/47c4cce8-3e3d-474b-a236-c647610e5a45
Open

feat(remote_agent): add queue telemetry motif mixer and logging#72
PiyushDatta wants to merge 2 commits intomainfrom
agent/workerpal-04dc03e6/47c4cce8-3e3d-474b-a236-c647610e5a45

Conversation

@PiyushDatta
Copy link
Copy Markdown
Collaborator

Summary

  • Apply WorkerPal completion 47c4cce8-3e3d-474b-a236-c647610e5a45 to main_agents.
  • Integrate commit fb9c09907bcd96c436a90f419c41486b69270997 from refs/pushpals/agent/workerpal-04dc03e6/47c4cce8-3e3d-474b-a236-c647610e5a45.
  • Worker workerpal-04dc03e6 reported: Executed task and modified 1 file(s) (quality gate soft-pass after 4 auto-revision attempt(s))
  • Canonical task request: Update apps/remotebuddy/src/autonomous_engine.ts to introduce an adjacency-graph mixer that blends startup-stability and conflict-resolution motifs when queue_p95 exceeds a soft threshold, expose a configurable exploration weight to bi...

Motivation / Context

  • Preserve and review autonomous worker output before final merge to base branch.
  • Keep integration branch current with queued worker completions.

Planned Scope

  • apps/remotebuddy/src/autonomous_engine.ts

Planned Validation

  • Planned: bun run test:root

Changes

  • Updated apps/remotebuddy/src/autonomous_engine.ts

Testing / Validation

  • Planned: bun run test:root
  • Worker completion summary did not include explicit command pass/fail output.

Impact / Risk

  • Risk level: medium (automated worker-generated change; maintainer review required).
  • No secrets or credentials are expected in this PR body.

SourceControlManager Note

  • Use this worker-provided PR title/body when creating the integration PR.
  • Suggested title: fix(repo): Update apps/remotebuddy/src/autonomous_engine.ts to introduce an adjacency-graph mixer that...

Checklist

  • Tests added/updated where appropriate

  • Validation commands run (or noted as not run)

  • Docs/comments updated if needed

  • No sensitive data (secrets/tokens) committed

  • Agent branch: agent/workerpal-04dc03e6/47c4cce8-3e3d-474b-a236-c647610e5a45

  • Completion ref: refs/pushpals/agent/workerpal-04dc03e6/47c4cce8-3e3d-474b-a236-c647610e5a45

  • Commit: fb9c09907bcd96c436a90f419c41486b69270997

  • Completion ID: eacbe302-da6a-4ae0-bbe7-bc536aa8d471

- add queue latency/failure constants plus MotifMixer types in apps/remotebuddy/src/autonomous_engine.ts
- implement normalizeMotifMixerConfig, parseQueueTelemetry, buildQueueAdjacencyMixer to emit adjacency blocks
- update buildEngineInspirationContext and RemoteBuddyAutonomousEngine to use adjacencyMixer config and logMotifMixerDecision
- add vitest coverage for telemetry parsing, mixer activation, and logging via encodeLogEvidence helpers

Tests:
- not run
@PiyushDatta
Copy link
Copy Markdown
Collaborator Author

ReviewAgent: Changes Rejected (score 7.8/10)

Verdict: The feature is substantial and well-tested, but it introduces correctness and observability risks that should be fixed before considering it production-ready.

Issues:

  • Potential metric mis-scaling bug: normalizeRateValue treats unitless failure rates as already normalized fractions, so inputs like job_failure_rate=12 (commonly 12%) become 12.0 and immediately saturate pressure logic; add a defensive normalization rule (for example, if unitless value > 1 and <= 100, treat as percent) and corresponding tests.
  • Sensitive-data logging risk: logMotifMixerDecision logs queue_evidence_b64, but base64 is reversible encoding, not sanitization; telemetry evidence may contain identifiers or payload fragments and is now emitted to logs. Remove raw evidence logging or replace with strict redaction/hash-only metadata.
  • parseQueueTelemetry selects the maximum observed jobFailureRate sample, which can overreact to single noisy outliers and destabilize mixer behavior; use a more robust aggregation (e.g., bounded percentile/mean of recent samples or capped max with sample-count guard) and add tests for outlier handling.
  • Regression risk from in-file test block growth: appending a very large import.meta.vitest section directly in autonomous_engine.ts increases maintenance burden and can make production-module diffs noisy; move mixer/parsing tests into dedicated test files while keeping only minimal local hooks if needed.

This PR has been re-queued for automated fixes. A worker will address the issues above.

- Reviewer scores >= 8.1/10
- All relevant tests pass

Tests:
- bun test
@PiyushDatta
Copy link
Copy Markdown
Collaborator Author

ReviewAgent: Changes Rejected (score 7.6/10)

Verdict: The change improves telemetry redaction and failure-signal handling, but introduces observability regressions and lacks verification coverage for new scoring/redaction behavior.

Issues:

  • apps/remotebuddy/src/autonomous_engine.ts:2895 now computes requestPayloadHash from the redacted payload, which can collapse distinct requests into the same hash when they differ only in redacted fields (e.g., queue_evidence_b64), degrading traceability and dedup/debug fidelity.
  • apps/remotebuddy/src/autonomous_engine.ts:2231 redaction only matches the exact key queue_evidence_b64; equivalent sensitive fields with different casing/naming conventions are not redacted, creating an inconsistent data-leak risk across payload producers.
  • No tests are included for normalizeFailureRateValue, aggregateFailureRateSamples, maxSignalScore failure-only path, and redactTelemetryPayload; this is high risk because the PR changes core scoring semantics and logging payload contents.

This PR has been re-queued for automated fixes. A worker will address the issues above.

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