Skip to content

[Slack] Fail closed unless a writeback receipt contains a real provider timestamp #251

Description

@khaliqgant

Problem

The shared Slack receipt helper currently returns externalId ?? ts ?? created ?? id ?? "", and adapter-core only checks whether externalId or ts is non-empty. This creates two fleet-wide false-success paths:

  • receipt.created or receipt.id can be mistaken for the delivered Slack message timestamp.
  • A blank or whitespace externalId can hide a valid ts, while any non-empty non-Slack-shaped value is accepted.

This is the same failure class independently fixed at persona boundaries in relay#1332 and internal-agents#25: a run can report Slack success without a real provider message timestamp.

Current shared owners:

  • packages/relay-helpers/src/slack.ts (slackReceiptTs)
  • packages/core/src/vfs-client/index.ts (hasSlackReceiptTs / terminal receipt validation)
  • any mounted-mode status/parser path that promotes receipt metadata to delivery success

Required contract

A Slack delivery is confirmed only when the receipt contains a trimmed Slack-ts-shaped value such as 1733512345.001900.

  1. Independently trim and validate externalId, then ts.
  2. Accept the first value matching the Slack timestamp contract (at minimum ^\\d{10,}\\.\\d+$).
  3. Never fall back to created or id as a Slack message timestamp.
  4. Make adapter-core terminal validation use the same shared predicate so mounted-mode callers cannot report success on metadata-only receipts.
  5. Keep the contract in one exported helper/predicate rather than duplicating it per persona.

Acceptance tests

  • valid externalId succeeds and is returned trimmed
  • blank externalId plus valid ts succeeds via ts
  • created/id-only fails closed
  • whitespace-only externalId/ts fails closed
  • non-Slack-shaped externalId/ts fails closed
  • mounted adapter-core terminal receipt validation rejects the same invalid cases
  • existing valid direct and idempotency-replay receipts remain green

Follow-up from the 2026-07-18 fleet recovery; this should not block the already reviewed persona rollout PRs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions