Skip to content

docs(core): map provider, origin, parser, capture, and runtime identity boundaries #2184

Closed

Description

@Sinity

Parent: #1807
Related: #2177, #2178, #2180
Source material: /tmp/ideas.md cross-pollination from Sinex source-identity demotion; Polylogue code audit of Provider, Origin, parser dispatch, source parsing, query/read surfaces, daemon import status, provider schemas, and generated docs.

Purpose

Polylogue still uses several identity-like coordinates that can be confused when designing import, query, read, provider-package completeness, browser capture, and evidence/ref features:

Provider
Origin
source path / source root
capture mode
parser implementation
provider-wire format
session id / provider-native id
model / lab / runtime product
repo/project/workspace context
raw artifact kind
archive row identity

The current codebase mostly works, but the vocabulary is not mapped as a durable contract. That makes future work prone to treating one coordinate as authority for another. Examples:

  • treating Provider as both vendor and public source origin;
  • using source path as if it described parser identity or privacy/disclosure posture;
  • letting capture mode, parser mode, and public query origin collapse into one string;
  • assuming a session id prefix explains provenance when provider-native ids, logical session ids, topology edges, and archive ids all exist;
  • adding provider-package readiness checks without a table of which coordinate each row measures.

This issue should produce the Polylogue analogue of Sinex's source-identity demotion map: a precise, checked-in map of which identity coordinate owns which invariant, where it is currently represented in code, and which future features must cite it.

Current code reality to audit

Known starting points:

polylogue/types.py                         # Provider enum / provider-wire vocabulary
polylogue/core/enums.py                    # public Origin tokens
polylogue/core/sources.py                  # Source dataclass and source-family concepts
polylogue/core/provider_identity.py        # existing provider/origin identity notes
polylogue/sources/dispatch.py              # provider detection and LoweredPayloadSpec
polylogue/sources/source_parsing.py        # source path, artifact classification, raw emission, parser emission
polylogue/sources/artifact_taxonomy/       # artifact kinds before ingestion
polylogue/sources/parsers/                 # parser implementations and looks_like checks
polylogue/schemas/providers/               # provider-wire schema bundles
polylogue/pipeline/ids.py                  # archive content hash / session id production
polylogue/archive/query/metadata.py        # public query origin/filter vocabulary
polylogue/cli/query.py                     # user-facing query filters
polylogue/mcp/server_tools.py              # MCP origin/provider exposure
polylogue/daemon/status.py                 # import/readiness/status vocabulary
polylogue/daemon/browser_capture*.py       # browser capture source/capture-mode boundary

This list is intentionally not exhaustive; the implementation should use rg and code navigation to find every current public or semi-public coordinate named provider, origin, source, capture, parser, runtime, model, repo, and workspace where it affects archive meaning or user-facing filtering.

Target doctrine

Provider may remain a provider-wire/parser/schema coordinate where Polylogue is describing raw export families and parser contracts. It must not be treated as the public source-origin authority when the user is filtering archived sessions.

Origin should remain the public source-origin coordinate for read/query surfaces: examples include claude-code-session, claude-ai-export, chatgpt-export, codex-session, browser-capture, and any future imported runtime/export family.

A source path/root is a material acquisition coordinate. It may explain where bytes came from and how re-acquisition happens. It must not become parser identity, provider identity, disclosure authority, or semantic session identity.

A parser implementation and parser version are interpretation provenance. They describe how raw material became normalized sessions/messages/actions/blocks. They are not public origin, not material origin, and not model identity.

A capture mode describes acquisition shape: file export, live agent session stream, browser extension capture, language-server export, hook event, sidecar, or future API capture. It may affect completeness/debt reporting and privacy posture, but it is not the same thing as provider vendor.

A session id is archive identity. Provider-native ids, logical session ids, topology roots, and run/context ids are related but distinct coordinates. Code and docs should not imply that one can replace the others.

Model/lab/runtime names are descriptive metadata. They should not be used as provider-package identity unless the package is actually scoped to that runtime/export shape.

Classification table to produce

Add a checked-in document, likely under docs/architecture/, with at least these rows:

Coordinate Current code names Actual invariant Public? Authority boundary Cleanup decision
provider-wire family Provider, parser schema package names Raw export/parser/schema family Mostly internal parser/schema boundary Keep as parser/provider-schema coordinate
public origin Origin, query/read origin filters User-facing source-origin family Yes CLI/API/MCP/daemon query/read filters Prefer in public surfaces
material source path/root/raw artifact/source record Where acquired bytes came from Sometimes import/re-acquisition/debugging Keep separate from origin/provider
capture mode export/live stream/browser capture/language server/hook Acquisition mechanism and completeness expectations Yes in ops/status import debt/provider-package completeness Use in readiness/debt rows
parser binding parser module/version/LoweredPayloadSpec How raw bytes were interpreted Usually internal ImportExplain/provider-package completeness Report in explain/debug surfaces
archive session identity session_id, content hash Canonical stored session row Yes refs/query/read/storage Keep stable and ref-addressable
provider-native identity native id/thread id/cascade id Upstream identity inside raw source Yes as provenance topology/re-import/debug Never replace archive id
logical session identity logical root/topology root Work-session lineage grouping Yes topology/read/work-packet/context Keep distinct from physical session
run/context/event identity run refs, observed-event refs, context-snapshot refs Evidence/time-slice inside a session/run Yes as refs work packets/context/recovery/query units Resolve through refs
model/lab/runtime model name, lab, runtime product Descriptive execution context Yes as metadata analysis/cost/provider-package reports Not package identity by itself
repo/workspace context repo name, cwd, workspace User work context Yes as filters query/read/work packets Not source/provider identity
privacy/disclosure posture capture route, browser extension, raw path handling What may be exposed/rendered/exported Yes as policy hints web/API/MCP/raw views Must be explicit, not inferred from provider

The final map may add more rows if the audit finds real coordinates.

Required issue integration

Update the bodies or comments of the affected issues so they cite this map rather than reinventing identity rules:

Acceptance criteria

  • A checked-in architecture map exists and stands alone for a reader with no chat context.
  • The map cites current code paths and explains which coordinate owns each invariant.
  • Public query/read/API/MCP/docs vocabulary guidance is explicit: use origin for user-facing source-origin filters; keep provider only where the contract is provider-wire/parser/schema/embedding-provider/lab metadata.
  • ImportExplain/provider-package/debt/ref-resolution issues link to this map or repeat its relevant coordinate decisions.
  • The implementation identifies at least one concrete follow-up cleanup opportunity, but does not rename broad public/storage vocabulary unless the audit proves the change is safe and scoped.
  • Existing docs that currently imply provider == origin == source are corrected in the same PR when they are in the touched surface.

Verification expectations

  • devtools render all --check
  • devtools verify doc-commands if command examples are touched
  • Focused tests only if code/docs generation changes require them
  • Source audit evidence in the PR body: the main files searched and the coordinates found

Non-goals

  • A repo-wide rename campaign without the map.
  • Introducing compatibility aliases for old names.
  • Adding tests that merely assert an old spelling is absent.
  • Treating provider/origin cleanup as a command-surface cleanup issue; this issue owns vocabulary authority, not command deletion.

Activity

  1. added
    type:docs
    theme:evidence-trust
    area:core
    type:design
    on Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:parserarea:pipelinetheme:evidence-trusttype:designtype:docs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions