Skip to content

Add privacy-preserving work queue runtime debug logging - #66943

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan-work-queue-logging
Oct 8, 2026
Merged

pelikhan merged 3 commits into
mainfrom
pelikhan-work-queue-logging

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Work queue failures can be difficult to diagnose when publication retries, uncertain launches, and verification recovery paths provide little diagnostic context. This adds extensive opt-in runtime logging without exposing Work payloads or credentials.

Approach

  • Reuse the shared JavaScript logger through a work-queue wrapper with DEBUG=work-queue:*, component selection, wildcard exclusions, and GitHub Actions runner-debug support.
  • Instrument scheduling, ledger replay and publication, native launch/binding, reconciliation, Claim completion and delivery verification, effects, memory preparation, and MCP intent processing.
  • Restrict metadata to counts, flags, retry delays, and HTTP status codes. Omit identifiers, repository names, paths, URLs, payloads, credentials, raw responses, error messages, and stack traces.
  • Wire the logger into deployed runtime dependencies and document namespaces and activation settings. Logging is disabled by default and preserves queue authority and publication semantics.

Validation

  • make fmt-cjs && make lint-cjs
  • npm run typecheck in actions/setup/js
  • make agent-report-progress
  • All 46 queue and deployment test suites passed with DEBUG=work-queue:* enabled: 895 tests, including privacy filtering, idempotent recovery, ambiguous-write recovery, and isolated runtime deployment checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🎯 Great work on the work queue debug logging! Privacy filtering, test coverage and instrumentation look solid — this looks ready for review.

Generated by ✅ Contribution Check · copilot · auto · 47.4 AIC · ⌖ 0.609 AIC · ⊞ 9.2K · ◷

@pelikhan
pelikhan marked this pull request as ready for review October 8, 2026 17:26
Copilot AI balanced review requested due to automatic review settings October 8, 2026 17:26
@pelikhan

pelikhan commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Error inspection in the new logger can throw and alter queue recovery behavior when debugging is enabled.

1 open finding
What changed in this PR

Adds opt-in, privacy-preserving diagnostics across the work queue runtime.

Changes:

  • Adds namespace filtering and sanitized failure logging.
  • Instruments queue publication, scheduling, delivery, reconciliation, and MCP paths.
  • Deploys and documents the logger with focused tests.
File Description
docs/​src/​content/​docs/​reference/​work-queue.md Documents debug activation and privacy guarantees.
actions/​setup/​setup.sh Deploys the logger module.
actions/​setup/​js/​work_queue_store.cjs Logs storage and publication activity.
actions/​setup/​js/​work_queue_scheduler.cjs Logs scheduling decisions.
actions/​setup/​js/​work_queue_replay.cjs Logs replay and append activity.
actions/​setup/​js/​work_queue_reconciler.cjs Logs reconciliation and recovery.
actions/​setup/​js/​work_queue_provisioning_checks.cjs Validates isolated logger deployment.
actions/​setup/​js/​work_queue_native.cjs Logs native API operations.
actions/​setup/​js/​work_queue_memory.cjs Logs memory preparation.
actions/​setup/​js/​work_queue_mcp_server.cjs Logs MCP snapshot and intent activity.
actions/​setup/​js/​work_queue_logging.test.cjs Tests filtering and privacy behavior.
actions/​setup/​js/​work_queue_logging.cjs Implements the work queue logger.
actions/​setup/​js/​work_queue_intents.cjs Logs intent parsing and staging.
actions/​setup/​js/​work_queue_effect_client.cjs Logs effect mutations.
actions/​setup/​js/​work_queue_dispatch.cjs Logs dispatch and launch processing.
actions/​setup/​js/​work_queue_delivery.cjs Logs delivery verification.
actions/​setup/​js/​setup_sh_file_lists.test.cjs Checks logger deployment inclusion.
actions/​setup/​js/​finish_work_queue_claim.cjs Logs claim completion and verification.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread actions/setup/js/work_queue_logging.cjs Outdated
function failure(event, error) {
if (!debugEnabled(namespace)) return;
// Do not use debugError: API errors may contain request bodies and tokens.
const status = error && typeof error === "object" ? Object.getOwnPropertyDescriptor(error, "status")?.value : undefined;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed in d1910f1: descriptor inspection is guarded, so throwing/revoked proxies fall back to failed=true without propagating errors or logging their contents. Added regression tests for both proxy cases and disabled-debug behavior; all 898 queue/deployment tests passed.

…ogging

# Conflicts:
#	docs/src/content/docs/reference/work-queue.md

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved and pushed in ef2a829 by merging latest main, preserving both the workflow-example links and runtime logging documentation. All 895 queue/deployment tests passed; secret scan and merge review were clean. Final gate hit existing upstream Go lint errors; CodeQL validation was partial due to timeout.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_logging.cjs:42): failure() can itself throw while handling an unknown error: Object.getOwnPropertyDescriptor invokes a proxy's getOwnPropertyDescriptor trap. With debug enabled, a proxied/revoked error therefore replaces the original queue failure and can break recovery paths that previously swallowed or classified that error. Guard descriptor inspection so diagnostics remain side-effect-free for arbitrary thrown values. - Add privacy-preserving work queue runtime debug logging #66943 (comment)

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: ef2a829
Sous-chef work: 39c5c6ef71f13556dae48e266d96e53e6a48c73a41f1bd5a56a9d6eedc1983e8
Sous-chef state: 18d185c3555c0564ee2d1510cbf9ecb9cd26edc130e35adeb03624c73d6dbe6b

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 3.63 AIC · ⌖ 7.62 AIC · ⊞ 1K · ◷
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Pushed d1910f1. make merge-main passed; latest main was already included. Guarded descriptor inspection and added throwing/revoked-proxy regression tests. Formatting, lint, typecheck, progress gate, and all 898 queue/deployment tests passed. Replied to the linked review thread, but resolution failed because gh has no token and the available MCP tools cannot resolve threads; a maintainer must mark it resolved. CI remains unverified on the new head; no CI was triggered.

Copilot AI requested a review from gh-aw-bot October 8, 2026 18:21
@pelikhan
pelikhan merged commit fb759bf into main Oct 8, 2026
16 checks passed
@pelikhan
pelikhan deleted the pelikhan-work-queue-logging branch October 8, 2026 19:19
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.7

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.

4 participants