Repository navigation
mcpx: Phase 3 task audit logging, unbound-task docs, conformance truth-up (#2500) - #4743
Conversation
…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).
|
Warning Review limit reachedYou'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. View limit details
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. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| if s.Audit == nil { | ||
| return | ||
| } |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
Phase 3 of #2497 (queue task 6075). Phase 1 (#2498) and Phase 2 (#2499) are closed; PR #3699 is merged.
Change
unbound, effective TTL and whether clamped), terminal state (id, status, duration), limit refusals (limit and requestor key) — on MCP and /v1 surfaces.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.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.