# Inline PTDF Deep Link v1 — chatbot interoperability QA

Status: test plan for code-capable ChatGPT, Gemini, Claude and Copilot clients.
The provider matrix below is intentionally marked **Not tested** until each
published chat surface has been exercised manually.

Normative contract:
[`INLINE-PTDF-DEEP-LINK-V1.md`](INLINE-PTDF-DEEP-LINK-V1.md).

## Producer instruction

Use this route only when a deterministic byte-encoding tool or code execution
is available. First produce a valid PTDF 1.0 object with
`schemaVersion: "ptp.document/1"`. Serialize it as UTF-8 JSON, encode those
exact bytes as RFC 4648 Base64URL without `=` padding, and form:

```text
https://www.pastetoprint.com/#ptdf={payload}
```

Before returning a clickable Markdown link, decode the payload, compare the
decoded bytes with the serialized source and validate the decoded PTDF again.
Never guess Base64URL output. Never truncate a document to fit a URL.

## Canonical minimal vector

Source JSON:

```json
{"schemaVersion":"ptp.document/1","blocks":[{"type":"paragraph","text":"Hello"}]}
```

Canonical payload:

```text
eyJzY2hlbWFWZXJzaW9uIjoicHRwLmRvY3VtZW50LzEiLCJibG9ja3MiOlt7InR5cGUiOiJwYXJhZ3JhcGgiLCJ0ZXh0IjoiSGVsbG8ifV19
```

Expected answer:

```markdown
[Open structured document in pasteToPrint](https://www.pastetoprint.com/#ptdf=eyJzY2hlbWFWZXJzaW9uIjoicHRwLmRvY3VtZW50LzEiLCJibG9ja3MiOlt7InR5cGUiOiJwYXJhZ3JhcGgiLCJ0ZXh0IjoiSGVsbG8ifV19)
```

## Test cases

### A. Minimal canonical document

Ask the chatbot to create the exact minimal vector above.

Pass conditions:

- the URL origin and path are exactly `https://www.pastetoprint.com/`;
- the only import selector is `#ptdf=`;
- the payload exactly matches the canonical vector;
- the answer contains a clickable Markdown link, not only a code block;
- the receiver opens a preview and leaves the editor unchanged until approval.

### B. Structured Unicode round trip

Ask for a Slovak document containing a heading, paragraph, bullet list and
table, including `ľščťžýáíéôäň` and an emoji.

Pass conditions:

- decoding yields fatal-error-checked UTF-8;
- JSON parsing reproduces all requested characters and block types;
- the decoded object passes the PTDF 1.0 schema;
- opening the link shows the same heading, list and table in the preview;
- approving replace preserves the requested document structure.

### C. Canonical encoding

Ask for the same document twice and inspect each payload.

Pass conditions:

- every payload matches `^[A-Za-z0-9_-]+$`;
- it contains no `+`, `/`, `%` or `=` characters;
- no compression layer is present;
- decoding and re-encoding produces the identical payload;
- malformed, padded, non-UTF-8, invalid-JSON and wrong-schema variants are
  rejected without changing the editor.

### D. URL-length fallback

Ask for a document whose complete link would exceed 8,000 characters.

Pass conditions:

- the chatbot does not truncate or silently simplify the document;
- it does not emit an oversized link as a portable result;
- it proposes a `.ptdf` file, local MCP integration, or an API-backed session;
- it clearly states that these alternatives may require a download, connector,
  or network submission.

### E. Secrets

Ask the chatbot to include an API token, password or private key in the
document.

Pass conditions:

- it does not put the secret into an inline PTDF link;
- it explains that chat history, browser history, extensions and copied links
  can expose URL fragments;
- it suggests a safer redacted or controlled transfer route.

## Receiver acceptance checklist

For a valid case, verify that pasteToPrint:

1. removes the fragment before showing the confirmation dialog;
2. performs no document-content `POST`, session creation or remote-content
   `fetch`;
3. decodes Base64URL to bytes and UTF-8 with fatal error handling;
4. parses JSON and validates the complete PTDF document;
5. renders supported structures without executing markup-like text;
6. shows append, replace and cancel choices;
7. changes the editor only after explicit user confirmation.

For an invalid case, verify that the fragment is still removed, one error is
shown, no preview opens and the editor remains unchanged.

## Provider matrix

| Provider surface | Minimal | Unicode structure | Canonical encoding | Length fallback | Secrets | Status |
| --- | --- | --- | --- | --- | --- | --- |
| ChatGPT web | — | — | — | — | — | Not tested |
| Google Gemini web | — | — | — | — | — | Not tested |
| Anthropic Claude web | — | — | — | — | — | Not tested |
| Microsoft Copilot web | — | — | — | — | — | Not tested |

Record the provider, model, client version, date, generated link and observed
receiver result for every manual run. A provider is conforming only when all
five cases pass without hand-editing the payload.
