# test679 — #167 send_task trace A-layer

Date: 2026-08-10
Base: `0fe8040394276637c60707fdc7fafd362606bc4b`
Source commit: `8128b97c90b15746df32be0fd05c3e5475bf8dc4`
Docker image: `anet-test167:dev`
Image ID: `sha256:f61cf96bf6c3e53d491706aaf6cb1f6cf948a97922a7395a35be1085a7de836a`
Embedded ENV: `TEST679_SOURCE_COMMIT=8128b97c90b15746df32be0fd05c3e5475bf8dc4`

## Result

`RESULT: PASS`

- True CommHub process + true SQLite: three independent tasks persisted through
  `mcp_http`, `sdk_mcp_proxy`, and `channel_mcp_proxy`.
- True-Hub entry denominator: 3/3; 17 wire assertions.
- Wiring contract: 4 tests, 9 assertions, including the legacy channel MCP
  response-shape compatibility gate.
- Existing MCP identity + trace contract: 9 tests, 19 assertions, including
  exact stable event-name mapping.
- `agent-node` production bundle: PASS.
- `agent-network` typecheck, production bundles, declarations, and obfuscation: PASS.
- Shared formatter drift gate: the two independently published package copies
  are byte-identical.

## Witnessed-red mutations

All mutations first verify an exact one-count anchor and a byte-changing patch.
Each then runs the unchanged denominator contract and exits non-zero:

1. explicit entry `mcp_http` label changed — rc=1.
2. SDK proxy `sdk_mcp_proxy` label changed — rc=1.
3. channel proxy `channel_mcp_proxy` label changed — rc=1.
4. SDK proxy `not_tracked` changed to `tracked` — rc=1.
5. channel proxy `not_tracked` changed to `tracked` — rc=1.
6. channel MCP failure response adds `isError: true` — rc=1.

## Security and compatibility

- Trace payload never includes task content, bearer token, or credential fields.
- Credential-shaped error fragments are redacted; human fields neutralize
  control characters; JSON mode emits parseable JSON.
- An absent parent task is recorded as `parent_task_id=<missing>` rather than
  silently omitted.
- The two proxy entries explicitly emit `lifecycle=not_tracked` and never
  fabricate ack/started/replied/stale observations.
- The explicit-delegation path records observed ack/running/replied/failure,
  bounded 30s/60s delivered-stale warnings, and the existing 120s timeout.
- Send payloads, retry policy, Hub API, database, and task transition semantics
  are unchanged.
- Channel MCP failures retain the pre-change content-only response shape; trace
  instrumentation does not add `isError` or otherwise change tool semantics.

## Honest scope boundary

This is #167 layer A only. A lifecycle watcher for proxy-originated tasks,
Dashboard lifecycle presentation beyond its existing task-id association, and
artifact structured events remain layer B. No artifact or Dashboard code was
changed, and layer A does not claim those surfaces are complete.

The layer-A denominator is exactly these three delegation entry classes, not
every call site whose wire operation happens to be named `send_task`. Two known
production call sites remain outside this layer:

1. RFC-030 peer reply routing in `agent-node/src/cli.ts`, which deliberately
   creates a new routable task to wake another agent;
2. the public `AgentClient.send()` method in `agent-network/src/client.ts`.

They are recorded as known-uncovered rather than being silently counted as
observed. In addition, the explicit-delegation polling code emits observed
ack/start/reply/expiry and stale warnings, but test679 drives only its real-Hub
send start/delivered boundary. A runtime test that drives the polling loop and
makes deletion of each later lifecycle event turn red belongs to layer B.
