# Story 6.12: Remove Marketplace from Core

**Status:** Complete
**Priority:** Medium
**Depends on:** None

---

## Context / Background

Strategic decision: A plugin marketplace is premature for fapilog's current stage. Enterprise developers use PyPI search and `pip install` - they don't need a custom marketplace UI.

**Current state:**

- `MarketplaceSettings` exists but does nothing
- Plugin metadata has `marketplace_id` field (unused)
- README and docs reference "plugin marketplace" aspirationally
- Stories 5.11, 5.12, 4.14 plan marketplace features

**Reality:**

- Zero or near-zero third-party plugins exist
- Marketplaces need critical mass (WordPress: 60k plugins, VS Code: 40k)
- PyPI + entry points already solve discovery and installation
- Building infrastructure for non-existent ecosystem is waste

**Decision:** Remove marketplace config and references. If needed later (50+ plugins), build as separate service.

---

## Scope (In / Out)

### In Scope

- Remove `marketplace.py` from core
- Remove `MarketplaceSettings` export
- Remove `marketplace_id` from plugin metadata
- Update README to remove marketplace claims
- Cancel/archive marketplace-related stories
- Update stability tiers (Story 10.13 already marks it "Experimental")

### Out of Scope

- Building alternative discovery (docs page listing plugins is fine)
- Removing plugin system itself (entry points stay)

---

## Acceptance Criteria

### AC1: Marketplace Module Removed

**Description:** No marketplace code in core.

**Validation:**

```bash
ls src/fapilog/core/marketplace.py  # Should fail (file doesn't exist)

python -c "from fapilog.core import MarketplaceSettings"  # ImportError
```

### AC2: Plugin Metadata Cleaned

**Description:** `marketplace_id` field removed from plugin metadata.

**Validation:**

```python
from fapilog.plugins.metadata import PluginMetadata

# marketplace_id should not be a field
assert not hasattr(PluginMetadata, 'marketplace_id')
```

### AC3: README Updated

**Description:** No "marketplace" claims in README.

**Validation:**

```bash
grep -i "marketplace" README.md
# Should return no matches (or only in context of "removed")
```

### AC4: Stories Archived

**Description:** Marketplace-related stories marked as cancelled/archived.

**Validation:**

Stories to update:
- 5.12 (plugin-marketplace-client) → Cancelled
- 4.14 (marketplace-security-signals) → Cancelled
- References in other stories updated

---

## Implementation Notes

### Files to Delete

```
src/fapilog/core/marketplace.py (DELETE - entire module)
```

### Code Files to Modify

| File | Line(s) | Change |
|------|---------|--------|
| `src/fapilog/core/__init__.py` | 94, 217-218 | Remove `MarketplaceSettings` import and export |
| `src/fapilog/plugins/metadata.py` | 80-85, 125 | Remove `marketplace_id` field and "Marketplace information" comment; update `source` field description |
| `src/fapilog/fastapi/integration.py` | 4, 18 | Remove comments about "marketplace endpoints removed" |
| `tests/unit/test_plugin_metadata.py` | 227 | Remove test for `marketplace_id` |

### Config Files to Modify

| File | Line(s) | Change |
|------|---------|--------|
| `pyproject.toml` | 121 | Remove commented marketplace URL |
| `pyproject.toml` | 394 | Remove vulture exclusion for `marketplace.py` |
| `pyproject.toml` | 514 | Remove mypy comment about marketplace settings |

### README Changes

| File | Line(s) | Change |
|------|---------|--------|
| `README.md` | 7 | **Remove badge:** `![Plugin Marketplace](...)`  |
| `README.md` | 25 | Remove "plugin marketplace remains experimental" |
| `README.md` | 156 | Remove "Optional marketplace router" comment |
| `README.md` | 177 | Remove "Experimental: plugin marketplace surface" |

### Documentation Files to Update

| File | Action |
|------|--------|
| `docs/user-guide/fastapi.md` | Remove marketplace router mention (line 54) |
| `docs/architecture.md` | **Heavy cleanup** - remove PluginMarketplace component, diagrams, sequences |
| `docs/prd.md` | Remove marketplace stories (FR13, Story 3.2, Story 7.2, etc.) |
| `docs/prd/epic-3-plugin-ecosystem-foundation.md` | Remove Story 3.2 marketplace infrastructure |
| `docs/v3-migration-plan.md` | Remove marketplace sections and references |
| `docs/roadmap.md` | Remove marketplace from roadmap |
| `docs/index.md` | Remove marketplace mentions |

### Files to Leave Unchanged (Historical Record)

| File | Reason |
|------|--------|
| `CHANGELOG.md` | Historical entry about removal is fine |
| `docs/audits/*.md` | Audit findings are historical record |

### Stories to Update

| Story | Change |
|-------|--------|
| `5.12.plugin-marketplace-client.md` | ✅ Already marked Cancelled |
| `4.14.marketplace-security-signals.md` | ✅ Already marked Cancelled |
| `5.11.plugin-hot-reload.md` | Remove marketplace dependency if mentioned |
| `5.10.plugin-dependency-declaration.md` | Remove marketplace references |
| `3.4a.compliance-plugins-framework.md` | Remove marketplace references |
| `3.4c.supply-chain-security.md` | Remove marketplace artifact storage refs |
| `3.4d.enterprise-distribution-lts.md` | Remove marketplace references |

### What Replaces Marketplace

Simple alternatives that don't require infrastructure:

1. **Docs page:** `docs/community-plugins.md` listing known plugins
2. **Naming convention:** `fapilog-*` prefix on PyPI
3. **GitHub topic:** `fapilog-plugin` for discoverability

---

## Tasks

### Phase 1: Code Removal

- [ ] Delete `src/fapilog/core/marketplace.py`
- [ ] Remove `MarketplaceSettings` from `core/__init__.py` (lines 94, 217-218)
- [ ] Remove `marketplace_id` from `plugins/metadata.py` (lines 80-85)
- [ ] Update `source` field description in `metadata.py` (line 125)
- [ ] Clean up `fastapi/integration.py` comments (lines 4, 18)
- [ ] Remove test in `test_plugin_metadata.py` (line 227)

### Phase 2: Config Cleanup

- [ ] Remove marketplace URL from `pyproject.toml` (line 121)
- [ ] Remove vulture exclusion from `pyproject.toml` (line 394)
- [ ] Remove mypy comment from `pyproject.toml` (line 514)

### Phase 3: README & Badge Removal

- [ ] Remove marketplace badge from `README.md` (line 7)
- [ ] Remove "marketplace experimental" from stability claim (line 25)
- [ ] Remove marketplace router comment (line 156)
- [ ] Remove experimental marketplace note (line 177)

### Phase 4: Documentation Cleanup

- [ ] Update `docs/user-guide/fastapi.md`
- [ ] **Major cleanup:** `docs/architecture.md` (remove PluginMarketplace component)
- [ ] **Major cleanup:** `docs/prd.md` (remove FR13, Stories 3.2, 7.2)
- [ ] Update `docs/prd/epic-3-plugin-ecosystem-foundation.md`
- [ ] Update `docs/v3-migration-plan.md`
- [ ] Update `docs/roadmap.md`

### Phase 5: Story Cleanup

- [ ] ✅ Story 5.12 - Already Cancelled
- [ ] ✅ Story 4.14 - Already Cancelled
- [ ] Review and update stories 5.10, 5.11, 3.4a, 3.4c, 3.4d

### Phase 6: Validation

- [ ] `grep -ri "marketplace" src/` returns no matches
- [ ] `grep -i "marketplace" README.md` returns no matches
- [ ] All tests pass
- [ ] `ruff check` passes
- [ ] `mypy` passes

---

## Tests

### Verification

```bash
# No marketplace imports
grep -r "marketplace" src/fapilog/ --include="*.py"
# Should only find removal comments or none

# Tests pass without marketplace
pytest tests/ -v
```

---

## Definition of Done

### Code Complete

- [ ] `marketplace.py` deleted
- [ ] `MarketplaceSettings` export removed from `core/__init__.py`
- [ ] `marketplace_id` field removed from plugin metadata
- [ ] FastAPI integration comments cleaned up
- [ ] Test for `marketplace_id` removed
- [ ] pyproject.toml references removed

### Documentation Complete

- [ ] README badge removed
- [ ] README marketplace references removed
- [ ] `docs/architecture.md` PluginMarketplace sections removed
- [ ] `docs/prd.md` marketplace stories removed
- [ ] Related story files updated/cancelled

### Quality Assurance

- [ ] `grep -ri "marketplace" src/` returns no matches
- [ ] `grep -i "marketplace" README.md` returns no matches
- [ ] All tests pass
- [ ] `ruff check` passes
- [ ] `mypy` passes
- [ ] CHANGELOG updated

---

## Risks / Rollback

### Risks

1. **Risk:** Breaking change if anyone uses MarketplaceSettings
   - **Mitigation:** It's documented as experimental and does nothing

### Rollback Plan

Restore marketplace.py if needed (unlikely).

---

## Related Stories

- **Cancels:** Story 5.12 - Plugin marketplace client
- **Cancels:** Story 4.14 - Marketplace security signals
- **Related:** Story 10.13 - README stability claims (mentions marketplace as experimental)

---

## Change Log

| Date       | Change        | Author |
|------------|---------------|--------|
| 2026-01-16 | Initial draft | Claude |
