# Miadi Research Participant — MCP Requirements

Status: Proposed contract, not a deployment audit. No internal Miadi tools were exposed in the authoring session; no live inquiry, contact, review, trace, role, or token was changed.

## Purpose

Enable an external assistant to orient in current platform work, contribute during conversation, use its available research capabilities, deliver results into Miadi, and leave a resumable next step. GitHub is an optional source, not the participation interface.

## Naming and identity

- Integration label: `Miadi Research Participant`.
- Proposed role: `external_research_contributor`, reusable across assistant types.
- First client profile: `perplexity-research`, versioned.
- Principal/grant: separate per connection and environment; never one shared secret for all models.
- Contribution: durable platform-generated `contribution_id` for one bounded piece of work.
- Record human owner, authenticated principal, client application, and self-reported versus verified model identity separately.

Miadi currently resolves a person token and carries the person's role, API tier, and permissions. A service principal with explicit AI/human attribution is an extension to validate, not an existing capability established by that adapter. [Identity source](https://github.com/jgwill/Miadi/blob/main/packages/connector/src/people.ts)

A token authenticates a grant. Server policy determines permissions; assistant-supplied role metadata never grants authority. Prefer delegated human sessions first; optionally support a bounded service principal with an accountable owner. Do not create a fake human account or grant administrator access by default.

## Existing baseline

The connector documents context/search reads, reviews, Chronicle evidence, observations, inquiries, links, handoffs, research saving, and human-approved work requests. Reuse existing services before adding parallel ones. Repository presence does not establish deployment or runtime success. [Connector baseline](https://github.com/jgwill/Miadi/blob/main/packages/connector/README.md)

## Capability map

New tool names below are proposals, not registered tools.

| Capability | Requirement | Mapping |
|---|---|---|
| Discover | Effective identity, grants, tool/service status, allowed projects, capture/delivery policy | Extend `get_capabilities` |
| Orient | Current inquiry, intention, relevant authorized contacts, questions, pending decisions, prior artifacts, changes since last visit | Proposed `get_participation_context` over existing reads |
| Begin/resume | Link authorized input and intention to an existing inquiry; issue contribution/correlation IDs | Proposed `begin_contribution` |
| Evidence | Exact review versions, episode artifacts, source locations, timestamps | Reuse existing evidence/review/context tools |
| Incremental work | Findings, questions, corrections, uncertainty, and branches before final delivery | Extend observation/inquiry/link records |
| Checkpoint | Progress, next action, open branches, continuation state | Existing-record adapter or small new operation |
| Deliver | Persist text/files and provenance, verify storage, link inquiry, issue receipt | Extend `save_research` or thin delivery adapter |
| Route | Milestone proposals, handoffs, downstream status | Reuse existing work/mission/handoff services |

Context bundles must be bounded and include freshness, source references/revisions, pagination, omissions, and a continuation cursor. Resolve ambiguous names/IDs; never invent live identifiers. Treat supplied UUID D4715B2D-06CE-4AFD-BE7E-82B2A05EC303 as an external reference until its entity type is resolved.

## Authorization

| Area | Default | Separate grant |
|---|---|---|
| Reads | Designated inquiries/projects | Other projects, private rooms, restricted records |
| Participation | Append attributed observations and questions | Editing another person's testimony or accepting it for them |
| Contacts | Relevant permitted contact cards and routing | Address-book export or sending messages |
| Delivery | Private staging in approved destination | Publication, repository commits/pushes, issue creation |
| Coordination | Propose work and inspect scoped status | Execute/steer sessions or irreversible changes |
| Governance | Read applicable policy | Issue tokens, change roles, approve consent or own requests |

Filter tool discovery and enforce the same checks on every invocation. Apply resource-level audience checks as well as tool permissions. Avoid granting broad write-tier session access solely to provide orientation; supply a scoped status/context projection instead.

## Lifecycle

1. Identify effective role, grant, available services, and policy.
2. Orient in current work and reuse an existing inquiry where appropriate.
3. Register authorized original input or a redacted/reference-only form, separately from assistant interpretation.
4. Choose contribution mode: conversation, evidence check, research, architecture analysis, or implementation proposal.
5. Investigate and save material findings/questions incrementally.
6. Checkpoint progress and unresolved branches.
7. Deliver artifacts with provenance and a verified receipt.
8. Hand off a specific next step; distinguish request from acknowledgement.
9. Pause/close the contribution without automatically closing its parent inquiry.

Resume by rehydrating stored platform state and checking changes, not by assuming model memory. A useful conversation may yield one observation rather than a forced report.

## Trace requirements

Keep contribution identity separate from technical traces. A contribution may cross multiple conversations and asynchronous traces. OpenTelemetry spans represent operations; span links connect related asynchronous work. [OpenTelemetry](https://opentelemetry.io/docs/concepts/signals/traces/)

Proposed common envelope: contribution_id, inquiry_ref, input_ref, context_snapshot_ref, conversation_ref when available, trace_id, span_id, causal_links, actor, grant_ref, source_refs, audience, occurred_at, recorded_at, idempotency_key.

- Instrument connector middleware automatically for authorization, operation, downstream calls, duration, outcome, retries, artifact IDs, and side effects.
- Propagate technical trace context server-side; carry business correlation in tool arguments when necessary.
- Explicitly append inquiry observations for corrections, changed interpretations, disagreement, non-coding contributions, and consent concerns.
- Label server-observed events separately from client-reported external searches or activities.
- Do not claim that connector telemetry sees every user message, Web/Academic search, audio action, or hidden model process.
- Do not request hidden chain-of-thought. Store concise rationale, evidence, uncertainty, and decisions.
- Link later observations to earlier operations rather than assuming exported spans can be edited.
- Keep sensitive content in access-controlled storage, not default telemetry fields. Allow reference-only or disabled transcript capture.

## Delivery contract

A download in chat is not evidence that a local agent received the result.

Manifest: contribution/inquiry/input/context refs; title/language; files with type, bytes, hash, durable location; findings with sources and locators; URLs/DOIs and retrieval dates; local review versions/screenwalk timestamps; claim category; limitations; open questions; next actions; audience/reuse restrictions; capabilities actually used.

Distinguish source claim, participant account, assistant interpretation, hypothesis, desired feature, fiction, and verified implementation. Evidence links alone do not prove implementation or participant agreement.

Receipt: artifact/version IDs; actual storage; verified hash/bytes; audience; linked inquiry; handoff status; side effects; partial failures; continuation state. Keep stored, handoff_pending, acknowledged, accepted, and implemented distinct.

The documented `save_research` also creates an inquiry issue and commits/pushes a shelf folder. Separate private staging from those effects or require explicit authorization covering them. Use idempotent upload/finalization and disclose partial failures. [Delivery baseline](https://github.com/jgwill/Miadi/blob/main/packages/connector/README.md)

Keep portable source links/locators rather than chat-only citation markers. Do not copy copyrighted full texts or expose private participant context in public search queries without authorization.

## Human and narrative boundaries

- Enforce audience/consent/reuse rules in storage, search, exports, and handoffs.
- Preserve participant attribution and corrections; do not silently replace accounts with assistant synthesis.
- Keep engineering telemetry separate from restricted relationship/ceremony material; ceremonial recording is not a default condition of observability.
- Separate research permission from publication, fiction, generated dialogue, or voice/likeness reuse.
- Allow authorized redaction/deletion under policy; append-oriented history must not require indefinite retention of withdrawn sensitive content.
- Treat these controls as support for practice, not proof of relational accountability.

A local decision engine may route work but must not confer authority, supply consent, or establish truth. Record options, policy/version, outcome, and overrides. Authorization remains deterministic platform policy.

## Perplexity connection

Perplexity documents custom remote MCP over HTTPS with Streamable HTTP/SSE and OAuth/API-key authentication. Use OAuth delegation first; validate service-principal support before offering a machine credential. OAuth callback: https://www.perplexity.ai/rest/connections/oauth_callback (Enterprise has its own documented domain). [Official setup](https://perplexity.ai/help-center/fr/articles/13915507-ajouter-des-connecteurs-distants-personnalises)

A skill supplies instructions; a plugin may package skills and connectors where supported. Packaging does not grant access or guarantee execution on every turn. [Official skill documentation](https://www.perplexity.ai/help-center/en/articles/2026102602-what-is-a-skill)

Validate token audience and use revocable least-privilege grants. Do not pass the MCP access token through to unrelated downstream APIs. [MCP security guidance](https://modelcontextprotocol.io/docs/draft/tutorials/security/security_best_practices)

Do not assume remote MCP creates a persistent background worker, wakes a chat, or exposes Perplexity's internal search tools to local agents. Local workers own scheduling/retries. Test browser approvals and polling before relying on client-specific cards/notifications.

## First milestone

Outcome: an authorized Perplexity session orients in one existing inquiry, registers an input reference, appends an observation, delivers a private artifact, and leaves a resumable handoff with attributable receipts.

Acceptance checks:

1. Useful authorized context; no restricted leakage through search/direct invocation.
2. Payload role/actor changes cannot impersonate or elevate.
3. Original input remains distinct from interpretation.
4. Automatic connector telemetry; honest external coverage labels.
5. A conversational observation needs no report or execution request.
6. Local-agent retrieval/hash verification; idempotent finalization.
7. No unexpected publication, commits, pushes, or issue creation.
8. Revocation enforced within declared policy; sensitive writes fail closed.
9. Resume recovers corrections, pending handoffs, open questions.
10. Request, approval, dispatch, execution, acceptance stay distinct.

## Local-agent assignment

Inventory requirements against deployed schemas/services. Classify each as deployed-and-tested, source-only, partial, missing, or intentionally excluded. Return the smallest change set, permission migrations, integration-test evidence, and verified delivery receipt. Reuse existing inquiry/review/mission services.

This specification authorizes no live role changes, token issuance, publication, or autonomous execution.
