Skip to content

docs: plugin architecture — data sovereignty and download-then-display contract#31

Merged
jschloman merged 1 commit intomainfrom
docs/plugin-architecture-principles
Mar 31, 2026
Merged

docs: plugin architecture — data sovereignty and download-then-display contract#31
jschloman merged 1 commit intomainfrom
docs/plugin-architecture-principles

Conversation

@jschloman
Copy link
Copy Markdown
Owner

Summary

Replaces the brief "Plugin System" section in the README with a full Plugin Architecture chapter that establishes the two foundational design principles for all current and future source plugins.

Principle 1 — Data Sovereignty

Each SourcePlugin is the sole authority over its own data. It has no knowledge of other sources, their schemas, or how its output will be joined or merged. All cross-source logic (temporal joins, geographic enrichment, correlation) lives exclusively in DataBroker. This contract is illustrated with an ASCII diagram showing plugins as isolated islands feeding into a single broker.

Principle 2 — Download-then-Display

Collection and display are strictly separated phases that must never be mixed:

  • Collection (CLI download script): the only place credentials, API keys, and outbound HTTP calls exist in the codebase. Runs once offline and writes to data/.
  • Display (SourcePlugin.load()): reads only from the previously downloaded local file. Zero network calls, zero credentials required at runtime. Raises FileNotFoundError if the file is absent — no live-fetch fallback.

Other updates

  • "Adding a plugin" walkthrough now shows the download script as step 1 before the plugin file, making the two-phase separation concrete
  • Config field types corrected (file_path / dir_path replacing the old path)
  • ICON attribute documented
  • Note added that selected paths persist to data/config.json across restarts
  • Plugin schema table retained and kept accurate

Test plan

  • README renders correctly on GitHub (diagrams, tables, code blocks)
  • No code changes — CI lint/type/test steps should pass unchanged

🤖 Generated with Claude Code

…ract

Replaces the brief "Plugin System" section with a full "Plugin Architecture"
chapter covering the two foundational principles:

1. Data Sovereignty — each SourcePlugin is the sole authority over its own
   data and has no knowledge of other sources or how its output is joined.
   All cross-source logic lives exclusively in DataBroker.

2. Download-then-Display — collection (CLI script, credentials, HTTP) and
   display (SourcePlugin.load(), zero network I/O) are strictly separated.
   load() raises FileNotFoundError if the local file is absent rather than
   falling back to a live fetch.

Also updates the "Adding a plugin" walkthrough to show the download script
step first, corrects config field types (file_path/dir_path replacing path),
documents the ICON attribute, and notes that paths persist to data/config.json.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jschloman jschloman merged commit f1dc690 into main Mar 31, 2026
2 checks passed
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.

1 participant