Skip to content

mcpx: Phase 3 task audit logging, unbound-task docs, conformance truth-up (#2500) - #4743

Merged
dezren39 merged 2 commits into
mainfrom
queue/6075-2500-mcpx-audit-logging
Nov 3, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/6075-2500-mcpx-audit-logging

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Phase 3 of #2497 (queue task 6075). Phase 1 (#2498) and Phase 2 (#2499) are closed; PR #3699 is merged.

Change

  • Info-level audit entries through the existing logging seam: task creation (task id, requestor key or unbound, effective TTL and whether clamped), terminal state (id, status, duration), limit refusals (limit and requestor key) — on MCP and /v1 surfaces.
  • Debug-level retrieval logs at the tasks/get and tasks/result handler seams on both surfaces (never info in normal operation).
  • IDs and metadata only: no task results, tool arguments, task content, or result payloads are logged.
  • Docs (protocol.md, cli.md, exec.md) corrected for the unbound-task model: unbound tasks are reachable by ID, IDs are 128-bit and unguessable, tasks/list lists only a connection's own tasks, identity-less list returns none, clients need identity for listable tasks. The recorded get/list disposition is documented, not changed.
  • All seven design(mcpx): tasks, bounded — operational limits, cooperative cancel, audit, and the small truths #2497 task rows in the conformance coverage retired or precisely reworded.

Provenance

The implementation was found uncommitted in the task's preserved laptop worktree on resume (task 6075, lane F); it was verified, committed, and pushed unchanged in substance.

Verification (laptop, branch head)

  • go test ./internal/tasks/ ./internal/mcpserver/ ./internal/daemon/ — all pass.
  • go test ./internal/conformance/ — one failure, TestUtilitiesServer/2024-11-05/completion/completion-max-100, proven pre-existing: identical failure on clean main at the branch base (f961fb8a), unrelated to this change (completion capability advertisement).

Evidence note toward #1557 still owed post-merge (packet: post without closing dezren39/darwin-nix#209 — nix#209 is already CLOSED per the prior task 6075 checkpoint).

Refs #2500.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…h-up (#2500)

Info-level audit entries for task creation (task id, requestor key or
unbound, effective TTL and clamp), terminal state (id, status, duration),
and limit refusals (limit, requestor key); debug-level retrieval logs at
tasks/get and tasks/result handler seams on MCP and /v1 surfaces. IDs and
metadata only — never task results, tool arguments, or payloads.

Docs (protocol/cli/exec) now explain the unbound-task model: reachable by
ID, 128-bit unguessable IDs, tasks/list lists only a connection's own
tasks, identity-less list returns none. Seven #2497 task rows in the
conformance coverage retired/reworded per the recorded disposition.

Implementation found uncommitted in the task worktree on resume by
task 6075 (lane F); verified: internal/tasks, internal/mcpserver,
internal/daemon suites pass on the laptop. internal/conformance
TestUtilitiesServer completion-max-100 fails identically on clean main
(pre-existing, unrelated).
@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 02:49
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4be720b3-7bf6-41f6-9f47-463679d101d6
Commits

Reviewing files that changed from the base of the PR and between 4ab8889 and b4f13cb.

Files selected for processing: 15
  • pkgs/mcpx/docs/cli.md
  • pkgs/mcpx/docs/exec.md
  • pkgs/mcpx/docs/protocol.md
  • pkgs/mcpx/internal/cli/logsink.go
  • pkgs/mcpx/internal/cli/serve.go
  • pkgs/mcpx/internal/conformance/coverage_stateful.go
  • pkgs/mcpx/internal/conformance/task_docs_test.go
  • pkgs/mcpx/internal/daemon/ops.go
  • pkgs/mcpx/internal/daemon/task_audit_test.go
  • pkgs/mcpx/internal/mcpserver/server.go
  • pkgs/mcpx/internal/mcpserver/tasks.go
  • pkgs/mcpx/internal/mcpserver/tasks_audit_internal_test.go
  • pkgs/mcpx/internal/mcpserver/tasks_audit_test.go
  • pkgs/mcpx/internal/tasks/audit_test.go
  • pkgs/mcpx/internal/tasks/tasks.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T03:19:38.870292Z b4f13cb New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: aff96600ea

ℹ️ 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 on lines +172 to +174
if s.Audit == nil {
return
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wire task auditing into standalone MCP servers

For mcpx serve over stdio, Audit is never initialized, so this guard silently drops every new creation, terminal, limit-refusal, and retrieval record. The only production assignment is in daemon/ops.go, while cli/serve.go injects that daemon store only when a.daemonStore exists; otherwise mcpserver.Server.tasks() creates a private store without an audit callback. The new MCP tests manually inject the callback and therefore miss this production path. Wire the standalone store to the logging seam before treating MCP task auditing as covered.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in b4f13cb (pushed to this PR).

Confirmed: MCPServer only wired Audit through the daemon's store; the standalone private store in mcpserver.tasks() was created with no Audit, so the nil guard dropped every record on the mcpx serve path.

Fix:

  • mcpserver.Server gains a TaskAudit seam; tasks() wires it into the private store it creates (an injected TaskStore stays configured by its owner, as before).
  • cli MCPServer sets TaskAudit when daemonStore is nil: App.standaloneTaskAudit() lazily opens the durable logging.FileSink under the same settings the daemon sink uses (logging.file / logging.dir / rotation, fileOptions), so standalone task lifecycle records land in the same durable log. Sink failure or logging.file off leaves the seam inert rather than stopping the server.
  • Regression test TestPrivateTaskStoreAuditsViaServerSeam (internal/mcpserver) covers exactly the production path the finding named: no injected store, creation + terminal records arrive via the server seam.

Verified on the laptop worktree: go test ./internal/mcpserver/ ./internal/cli/ ./internal/tasks/ ./internal/daemon/ — all pass.

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