Repository navigation
v1.5.0 - ingest provenance (DeclaresProvenance)
Adds an opt-in capability letting a connector declare where the authority of the content it ingests comes from.
Phase 1 of AskMyDocs ADR 0028.
Why
dispatchIngestion() records what a document is and nothing about who wrote it. That is invisible until you line up what connectors actually do: Drive, Confluence, Jira, Notion, OneDrive, Evernote and Fabric carry text written inside the organisation, while IMAP carries text written by anyone who can send an email to the mailbox. Both become retrieval grounding, and on a host that also exposes tools to an agent the second is attacker-reachable text arriving in a tool-calling context. Stored identically, no deployment can answer "how much of our corpus is externally authored?".
What's new
enum ProvenanceTier: string {
case TrustedInternal = 'trusted-internal';
case UntrustedExternal = 'untrusted-external';
case MachineGenerated = 'machine-generated';
}
interface DeclaresProvenance {
public function provenanceTier(int $installationId): ProvenanceTier;
}Resolved per installation, like SupportsFolderDiscovery::listAvailableFolders() — two installations of one connector routinely differ, and an internal distribution list and a public contact address are the same IMAP code against sources with opposite authorship models.
Backward compatible
- Opt-in interface, detected by the host via
instanceof. ConnectorIngestionContractsignature unchanged.- A connector implementing nothing keeps its exact current meaning, falling back to
ProvenanceTier::default()(TrustedInternal).
Nothing built on the public connector template breaks.
Two deliberate choices
The default is not the most cautious value. Defaulting to untrusted would relabel every existing corpus overnight and make the label mean nothing. External content is the exception a connector has to declare.
Absence and unrecognition are different facts. fromStorage(null) means "no declaration" and reads as the default. An unrecognised value — written by a newer version during a mixed deployment or after a rollback — fails closed to UntrustedExternal, because resolving unknown to trusted would invert the protection this method exists to give.
Not a curation tier
A curation ranking answers "has a human vouched for this?"; provenance answers "who wrote it?". A human-accepted page summarising an external email is both at once. The two must not be collapsed.
Enforcement
None here, by design. The tier is a label — enforcement is only testable against a corpus that is already labelled.
Tests: 107 passing / 249 assertions, across PHP 8.3/8.4/8.5 x Laravel 12/13.