Skip to content

feat(mine): route explicit source adapters through the RFC 002 registry - #2173

Open
joshuafontany wants to merge 1 commit into
MemPalace:developfrom
amorphous-dreams:feat/2062-source-adapter-registry
Open

feat(mine): route explicit source adapters through the RFC 002 registry#2173
joshuafontany wants to merge 1 commit into
MemPalace:developfrom
amorphous-dreams:feat/2062-source-adapter-registry

Conversation

@joshuafontany

@joshuafontany joshuafontany commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes #2062.

mempalace mine --source <adapter-name> resolves the adapter through resolve_adapter_for_source(), constructs the existing PalaceContext, and runs the adapter ingestion path. Adapter-authored metadata lands verbatim; PalaceContext stamps adapter_name and adapter_version. Omitting --source leaves the legacy --mode dispatch untouched, so mempalace mine <dir> and --mode projects|convos|extract behave exactly as before.

The exclusivity criterion. --mode and --source select the ingest path and cannot both apply, so they sit in a mutually exclusive group with --mode carrying no argparse default. argparse counts an option as "seen" for exclusivity only when its value differs from its default, which makes the default load-bearing here:

--mode default="projects":  --source nd --mode convos    → error
                            --source nd --mode projects  → accepted
--mode default=None:        both spellings               → error

cmd_mine restores "projects" when --mode goes unsupplied, so the parser holds the group and the dispatch site holds the default. If you would rather keep the default in argparse and accept the --mode projects spelling passing, say so and I will drop that part.

Tests cover registry resolution, PalaceContext construction, verbatim adapter metadata, unknown-adapter failure, dry-run filing nothing, exclusivity across all three mode spellings, and --help documenting --source as the RFC 002 extension path.

Suite: 3607 passed, 31 skipped. The five test_init leaked-PYTHONPATH results reproduce identically on an untouched develop checkout, so this branch leaves them where it found them.

Adds `--source <adapter-name>` to `mempalace mine`. When supplied, the
adapter resolves through resolve_adapter_for_source(), runs against the
existing PalaceContext, and files its DrawerRecords through the standard
write path. Omitting it leaves the legacy --mode dispatch untouched.

--mode and --source select the ingest path and cannot both apply, so they
sit in a mutually exclusive group. --mode carries no argparse default:
argparse counts an option as seen for exclusivity only when its value
differs from its default, so a default of "projects" would admit
`--source X --mode projects` while rejecting `--source X --mode convos`.
cmd_mine restores "projects" when --mode goes unsupplied, so
`mempalace mine <dir>` behaves as before.

Tests cover registry resolution, PalaceContext construction, adapter
metadata landing verbatim, unknown-adapter failure, dry-run, the
exclusivity across all three mode spellings, and help documenting
--source as the RFC 002 extension path.

Closes MemPalace#2062

tests/test_mine_source_registry.py: 5 passed. mine/cli selection: 752
passed, 3 skipped.
@joshuafontany
joshuafontany force-pushed the feat/2062-source-adapter-registry branch from 473383a to 2fb17c6 Compare August 8, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mine): route explicit source adapters through the RFC 002 registry

1 participant