Recovery API
Use a signed-in human Session from the intended Product origin. These read-only tRPC queries do not require paid Product capabilities and are not MCP tools:
scopeRecovery.home({scope})reports availability and the confirmed reading deadline.scopeRecovery.browse({scope, collection, after?, limit?})pagessources,journals,tasks,goals, orsprints. The default limit is 30, maximum 50. PassnextAfterasafter; null means the last page. Task headers omit descriptions.scopeRecovery.read({scope, collection, id})reads one retained item. For a Source, optionalversionIdselects an exact retained version. New transcript/extraction revisions retain their corresponding text; metadata-only revisions preserve the existing original. Earlier versions remain unchanged. An explicitly empty original stays empty rather than displaying a fallback transcript or extraction. Tasks return saved scheduling/status/priority dates and text, without provider metadata or inferred ownership from the contributor.
For goals, the read result is {collection: "goals", goal}. It preserves id, name, year, completedAt, deletedAt, createdAt, and updatedAt; archived Goals remain readable. For sprints, the result is {collection: "sprints", sprint} with id, number, startsAt, endsAt, rolledOverAt, createdAt, and updatedAt. Their pages contain the same metadata and order by stable ID. Dates use the configured tRPC transformer. Sprint settings are not included. Both record families use exclusive content ownership. Organization Goal reads also keep the current Member’s normal audience, including older same-User records without a Member link; owner/admin roles do not bypass it. Personal Goals use direct User ownership independently of contributor attribution. Creator, assignee and sponsor identities cannot widen the selected scope.
For Source revision discovery, call scopeRecovery.browse({scope, collection: "sourceVersions", sourceId, after?, limit?}). It returns {collection: "sourceVersions", items, nextAfter}. Each header contains only id, sourceId, version, title, and createdAt, ordered by descending version number with a stable identity tie-breaker. Pass a returned id as versionId to the Source read query. The cursor is bound to the same Source and ownership scope; a foreign or unknown cursor returns an empty page. Current original-Source privacy applies to all retained versions. No text, file locator, raw provider metadata or private content stamp appears in a version header. Page release rechecks current access and the selected versions, including empty-page authority checks. This is live history reading, not a complete export snapshot.
For Journal history, call scopeRecovery.browse({scope, collection: "journalChanges", journalId, after?, limit?}). It returns change headers containing id, documentId, kind, actorType, projected title, and createdAt, ordered by descending creation time with a stable identity tie-breaker. The cursor is bound to that Journal and scope. Read an exact change with scopeRecovery.read({scope, collection: "journalChanges", journalId, id}); it returns {collection: "journalChanges", change}. The change contains its identity, kind, actor type, creation/update dates, safe before/after snapshots and a withheld flag. before is null when the Journal did not yet exist. Snapshots include saved text, presentation fields and currently permitted parent/link relationships. Raw Source provenance, extraction origins, tag identifiers and Agent selectors are excluded. Current evidence restrictions reproject both snapshots, preserving independently attributed human text and withholding unknown legacy lineage. withheld indicates when projected content or relationships differ from the retained snapshots. A foreign parent or unavailable exact change never falls back to current Journal text. Final release checks current credential, lifecycle, coverage, window and projected content, including authority for empty pages. This read-only API does not reverse changes or provide a complete export.
For Dossiers, call scopeRecovery.browse({scope, collection: "dossiers", after?, limit?}). This collection defaults to8 and permits at most8 items per page. It includes archived Dossiers and returns safe projected titles, saved purpose/status, dates, archive markers and contentWithheld, excluding descriptions and bodies from the page. Read with scopeRecovery.read({scope, collection: "dossiers", id, versionId?}). The result is {collection: "dossiers", dossier, version}: dossier includes id, projected title, description, body, saved purpose, status, createdAt, updatedAt, deletedAt, and contentWithheld. version is null for current content; an exact saved version returns its header and its own saved purpose rather than the current purpose. Current parent dates and archive status still apply.
Discover versions with scopeRecovery.browse({scope, collection: "dossierVersions", dossierId, after?, limit?}), also default/max8. Headers contain only id, dossierId, version, and createdAt, newest version first. Pass a header ID as versionId; a foreign parent/version or cursor returns NOT_FOUND, without falling back. Historical text is reprojected against current exact evidence, preserving independently attributed human segments and withholding unverified lineage. Anydayway retains the current human author's evidence audience; TypeOrb uses the reusable Organization audience. Final release rechecks native Session/Membership, lifecycle generation, coverage, reading window, parent/version and proof facts inside the content transaction, including authority for empty pages. Raw evidence receipts, work/admission state, error diagnostics and publication capabilities are excluded. These endpoints neither regenerate content nor provide a complete export snapshot.
For Goal assessment notes, call scopeRecovery.browse with collection: "goalNotes" and required goalId. It returns {collection, items, nextAfter} ordered by creation time with a stable identity tie-breaker. Each item includes id, goalId, sourceId, sourceVersion, note, impact, source, confidence, createdAt, and updatedAt. Only notes with a valid assessment receipt and currently readable, eligible supporting Source are included. Archived Goals can retain qualified notes; changed Goal metadata, current Source content/policy or missing receipts can withhold them. Legacy text without proof is preserved but not exposed by this collection. Goal Member audience still applies, and the cursor is bound to that Goal. This does not start assessment or make archived Goals available for active generation.
For Task Briefs, call scopeRecovery.browse({scope, collection: "taskBriefs", taskId, after?, limit?}) (default/max8). The result contains exact version headers (id, taskId, version, status, origin, createdAt, updatedAt) newest first. Cursors are bound to the same Task and ownership scope; a foreign or unavailable cursor returns NOT_FOUND. Read with scopeRecovery.read({scope, collection: "briefs", taskId, id?}). Omit id for the latest ready Brief, falling back to the latest saved version only when none is ready. An explicit id must belong to that Task and never falls back. The result is {collection: "briefs", brief} with the header fields, saved request, currently permitted context, boundaries, safe citations and contentWithheld. Citations contain only kind, original identity/version, title and excerpt. Raw evidence proofs, operational disclosure, errors and publication capabilities are excluded. Archived Tasks retain Brief history. Organization Briefs always use the reusable Organization audience in both Products. Personal Briefs require their exact original proofs and any transitive Dossier receipts, including the saved metadata/body mode and current original evidence. A stale dependency withholds only dependent segments. Native authority, lifecycle, coverage, window, Task/Brief and proof facts are rechecked in the real content transaction before release, including empty-page authority. These queries cannot regenerate a Brief or send a Delivery and are not a complete export snapshot.
For human Assistant histories, call scopeRecovery.browse({scope, collection: "conversations", after?, limit?}). It returns {collection: "conversations", items, nextAfter}; each item contains id, title, createdAt, and updatedAt. To open one, call scopeRecovery.browse({scope, collection: "conversationTurns", conversationId, after?, limit?}). It returns {collection: "conversationTurns", conversation, items, nextAfter}. The conversation has the same safe header. Each turn contains id, conversationId, question, answer (nullable), contentWithheld, citations, createdAt, and updatedAt. Both collections default to and cap at eight items, ordered by descending creation date then ID. Turn cursors must belong to the selected conversation; conversation cursors must belong to the same native human principal. Empty IDs are rejected; unknown or foreign parents/cursors return NOT_FOUND without fallback. Use independent cursors for the list and turns.
Organization conversations require the current Member’s original member principal; an owner/admin role does not authorize another Member’s or an Agent’s history. Personal conversations require the direct User’s user principal and are available only in Anydayway. Answers require complete saved history provenance, the matching human research subject and all current original proofs under that human’s author audience. Citation identities must bind to those exact proofs. Otherwise answer is null, contentWithheld is true and citations is empty, while the saved question remains readable. Citations expose only their kind, title, excerpt and Journal ID or Source ID/version/native versionId; Journal citations also carry their original contentVersion. A Source versionId is present only for an exact same-owner Source/version row and can be passed to the exact Source read query. Raw provenance, research metadata, allowance epochs, usage, diagnostics, work authority and capabilities are never returned. Final native authority, lifecycle, coverage, reading window, parent/cursor/turn and current proof facts are checked in the owning transaction, including empty pages. These calls do not start paid work or recreate old lineage. Agent, legacy chat and Mastra histories outside this native human conversation store require separate export/disposal handling; these endpoints do not constitute a complete export.
For saved Task Deliveries, call scopeRecovery.browse({scope, collection: "taskDeliveries", taskId, after?, limit?}) (default/max 8). It returns {collection: "taskDeliveries", items, nextAfter}, ordered by descending creation date and descending ID. Each item contains id, taskId, agentId, briefVersion, briefVersionId, status, run, attemptCount, nextAttemptAt, deliveredAt, createdAt, and updatedAt. attemptCount describes only the current run; no per-attempt history is reconstructed. A non-null briefVersionId is a verified link to the same Task, native owner and saved version number; otherwise it is null while the saved briefVersion remains. Pass a verified ID to the exact Brief read query, which checks its own current content permissions. Raw errors, Personal handoff admission, Agent names, webhook addresses and credentials are excluded. Archived Tasks remain readable. Unknown, empty or foreign cursors never fall back to another page; unavailable native cursors return NOT_FOUND, and empty input IDs are rejected. Final release checks native authority, lifecycle, coverage, reading window, Task, cursor, selected Delivery and linked Brief facts in the owning transaction, including empty pages. Removed rows cannot be reconstructed. This endpoint does not enqueue, retry or send work and does not provide a complete export snapshot.
For Task activity, call scopeRecovery.browse with collection: "taskActivities" and the required taskId. It returns {collection, items, nextAfter} with comments and typed creation, status, priority, assignment, Sprint, Brief and Delivery events. Pages use creation time with a stable identity tie-breaker. Pass the returned nextAfter without reconstructing it. Activity must belong to the same selected scope as its parent Task; attribution does not grant access. Raw Delivery error diagnostics are omitted; status and version metadata remain. This is a live retained-content reader, not a complete export snapshot or complete Brief export.
Use {kind: "organization", organizationId} for a current membership, or {kind: "personal", ownerUserId} for your own Anydayway Personal space. TypeOrb refuses Personal scope. A revoked Session, changed ownership/content or expired reading window can prevent release even after retrieval. On CONFLICT, refresh access and the item; NOT_FOUND does not reveal another scope's content. No endpoint starts generation, editing, or delivery.
See Read retained knowledge for the screen walkthrough.
Posts and publishing history
For Organization Posts, call scopeRecovery.browse({scope, collection: "posts", after?, limit?}). Current and archived Posts are included, ordered by descending creation date then ID. Items contain safe current Post metadata (id, createdAt, updatedAt, deletedAt, publishedAt, scheduledAt, platform, platformPublishStatus) plus the permitted title and contentWithheld flag. Read with scopeRecovery.read({scope, collection: "posts", id, revisionId?}). Omit revisionId for current text; supply an exact native saved revision ID for historical text. The result is {collection: "posts", post, content, revision, savedRevision, contentWithheld}. revision is null when absent, otherwise {id, objectId, revision, createdAt}. post metadata describes the current parent, including while savedRevision is true; it must not be interpreted as historical publication status. The title and content are the selected text.
Use scopeRecovery.browse({scope, collection: "postRevisions", postId, after?, limit?}) for saved revision headers, ordered by descending revision number. Use scopeRecovery.browse({scope, collection: "publishAttempts", postId, after?, limit?}) for attempt metadata, ordered by descending creation date then ID. Attempt items contain only id, contentId, platform, status, createdAt and nullable completedAt. All three collections return nextAfter, default to eight items and cap at eight. Cursors must bind to the exact parent and Organization. Unknown or foreign selectors return NOT_FOUND; empty IDs/cursors are rejected. There is no fallback to current or another revision. Malformed saved revision provenance returns CONFLICT without releasing the saved text; refresh and review the affected record.
These calls require the exact current native Organization Member and human Session in either Product. Personal requests are refused. Original Source audiences and transitive Post/body dependencies continue to protect selected text. Invalid or legacy provenance withholds affected segments. Recovery does not issue edit stamps, approve, schedule, publish, retry or invoke a provider. Raw lineage, private diagnostics, publish requests/responses/errors and connection information are excluded. Final authority, lifecycle, reading window and complete parent/cursor/lookahead/dependency snapshots are rechecked in the owning transaction, including empty pages. Other publishing object kinds require separate export and disposal handling.
Exact original file downloads
Send an authenticated GET /scope-recovery/original from the selected Product’s registered Origin. Supply kind=organization&organizationId=<id> or kind=personal&ownerUserId=<your-user-id>, plus required sourceId and exact versionId. IDs must be nonempty. Personal downloads are available only in Anydayway. The selected scope is explicit and does not fall back to the Session’s active Organization. This is the binary attachment transport; existing JSON recovery queries remain tRPC.
A successful response is an application/octet-stream attachment with the recorded filename and Cache-Control: no-store, private. It contains the immutable object bytes for that exact same-owner Source revision, checked against the recorded provider version, size, content type and supported checksum. It never redirects to a storage URL or returns provider keys, descriptors or credentials. A reviewed original must retain its same-Source review basis. Linked File artifacts must be complete and retain current evidence permissions; uploading User attribution does not determine Source ownership.
Missing/foreign versions, unverified keys or URLs and recordings marked missing cannot substitute a current file. Malformed selectors return 400, missing credentials 401, unavailable authority 403/404, changed native facts 409, and failed storage acquisition 502. Error responses contain no raw provider diagnostic. Native Session, User, Membership, lifecycle generation, coverage, reading window and the complete original/proof snapshot are rechecked after byte acquisition before release. Storage acquisition occurs outside the database transaction. Downloads do not start processing or generation, and this endpoint is not a complete account export.
Readable archive download
Use authenticated GET /scope-recovery/archive?kind=organization&organizationId=<id> or GET /scope-recovery/archive?kind=personal&ownerUserId=<your-user-id> from the exact registered Product Origin with a current native human Session. Personal archives are available only in Anydayway. Supply exactly one explicit scope; extra, repeated, empty or mixed-scope query parameters return 400. The active Organization is never substituted. Existing JSON recovery queries remain unchanged.
Success returns an application/x-ndjson attachment named recovery-<kind>-<scope-id>.ndjson, with Cache-Control: no-store, private. Stream the response rather than accumulating an unbounded body in memory. Records are newline-delimited JSON: record entries have family and value; a manifest entry has value; verified originals use original, ordered original_chunk entries with byte offset and base64, and original_end with sizeBytes and SHA-256. Only a final {"type":"complete","originals":<count>} line marks a completed archive. Reject an interrupted response or a response without that final line. A successful status alone does not establish completion.
The manifest's format is typeorb-recovery-ndjson-v1. It binds scope and product, lists per-family emitted record and content-withholding counts, per-store disposition, and original-file counts/bytes. scopeRows: null with countBoundary: "unknown" means ownership/count coverage is unresolved, not zero. native_readable_scope_rows counts are bounded readable metadata rows, not a complete inventory or erasure authority. User-only candidates are explicitly separate from scope ownership; deduplicate the same principal across archives. Agent content, taxonomy labels/relationships and some workspace text remain withheld. The boundary is readable_projection_with_explicit_withholding_not_erase_authority; this is not a complete export or deletion proof.
The sourceAnalyses family contains only metadata (id, sourceId, sourceVersionId, revision, createdAt), contentWithheld: true and disposition: "native_readable_source_analysis_payload_withheld". Every saved assessment revision must retain its exact version and currently readable canonical Source. Creator and subject attribution do not assign space ownership; assessment content and identified-subject fields are withheld.
The applicable organization_sprint_settings or personal_sprint_settings family contains table and value: the native organizationId or ownerUserId primary key, enabled, lengthWeeks, startWeekday, timeZone, createdAt and updatedAt. No generic id is added. An absent row emits no settings record and has scopeRows: 0; it does not synthesize defaults. These stores use bytes: "no_blob_columns" and disposition: "native_configuration_projection". The other scope type remains outside this archive's count coverage. Source-analysis counts mean currently readable native rows, with their payload withheld.
Task history uses families taskHistory:task_context_checks, taskHistory:task_context_conflicts, taskHistory:task_required_context_heads and taskHistory:task_required_context_references. Each value contains row: {table, metadata}, contentWithheld: true and disposition: "native_task_history_payload_and_identity_withheld". Metadata contains taskId; checks add id, version, updatedAt; conflicts add id, createdAt, resolvedAt; heads add version, requiredVersion; references add id, createdAt, updatedAt. These history times are native millisecond numbers, not ISO date strings. Heads have no generic id. Check IDs are nonunique: do not deduplicate records by id. Their native composite key includes a private principal and is not emitted. Actor identities, readiness payloads, conflict/reference content, reference selectors and notes remain withheld. Rows must bind the canonical Task's exact space; head ownership must also match. Archived Tasks and resolved/removed entries are included. Their store counts use native_readable_scope_rows, bytes: "withheld" and disposition: "native_scope_metadata_withheld", not complete-history or erasure coverage.
File candidates use the files family with kind: "file", metadata: {id, status, createdAt, updatedAt}, contentWithheld: true and a disposition. Candidates come from native Organization File ownership or an ownerless File bound to an exact-space Source. The fileArtifactRevisions family lists every retained native File receipt for an Organization, including pending receipts and missing parents, as kind: "file_artifact", metadata: {id, objectId, revision, createdAt}, contentWithheld and disposition. Locators, render manifests, proof identities and cross-space reference fences remain private. File stores retain unknown count coverage; emitted candidate counts are not a complete File inventory.
Qualified File revisions use separate file_original, file_original_chunk and file_original_end records. Each carries fileId and artifactRevisionId; these never substitute invented Source IDs. Header fields are name, contentType, sizeBytes; chunks carry offset and base64; the ending carries sha256 and sizeBytes. Existing Source original records retain sourceId and versionId. The final complete.originals and manifest original totals include both kinds. Different retained receipts may include the same immutable bytes; each counts against the shared limits.
File disposition is immutable_original_separate for included, byte-qualified revisions; otherwise it explains withholding or delegation: pending_artifact, current_file_unavailable, current_evidence_unavailable, immutable_proof_unavailable, file_artifact_revisions_separate or source_originals_separate. Source-bound Files use existing Source revision originals. The file_user_candidates family contains rows and disposition: "user_candidates_never_personal_scope", separately from scope ownership. User-only uploads without a canonical direct Personal Source binding do not become Personal Files. Ownerless, foreign or shared references do not grant erasure authority. Files or Media without verified immutable File receipts remain outside this byte coverage.
Organization archives include one publishingOrphanCandidates record with countBoundary: "unknown", contentWithheld: true and disposition: "native_organization_custody_unknown_audience". It has the same shape whether or not orphaned publishing states exist: no row count, kind count, identifiers, actors, payload or locator is released when the saved audience cannot be verified. A missing or mismatched current parent never turns creator attribution into an audience grant. File receipts use the separate File families described above. Personal archives do not include this Organization-only family. This disposition is not a complete inventory or erasure authority.
Limits include 10,000 emitted records, 20,000 pages, 64 MiB of staged record data, and 256 originals totaling at most 128 MiB before base64 encoding. Conservative underlying-store materialization limits can refuse an archive even if the selected space is small. Acquisition and returned-stream leases are bounded to at most 120 seconds, and credential expiry or the reading deadline may shorten release. Abort the request when no longer needed. Scope, native authority, original permissions and complete content snapshots are freshly rechecked after all original bytes are acquired and before release. Changed content or authority returns 409; missing credentials return 401, unavailable authority 403/404, oversized snapshots 413, and failed original acquisition 502. Other failures return a generic error. A failure after response headers closes the stream without a completion record. Refresh before retrying; there are no automatic retries, storage redirects or provider credentials in the response.