Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
# HIA_FEDERATION_FOUNDUP_IDENTITY_COVERAGE_AUDIT_PHASE2B

**Date**: 2026-05-06
**Slice**: HIA_FEDERATION_FOUNDUP_IDENTITY_COVERAGE_AUDIT_PHASE2B
**Status**: COMPLETE - AUDIT ONLY
**Author**: 0102 W1
**Base**: main @ `fccd7d9a8` (PR #510 merged)
**WSP References**: WSP 97, WSP 103, WSP 104, WSP 15
**Depends On**: HIA_FEDERATION_METADATA_TAGGING_PHASE2

---

## Purpose

Audit FoundUp identity coverage before enabling `foundup_id` query filtering.
Determine which `modules/foundups/*` directories are actual FoundUps, which
have manifests, which are externalized, and whether any ID mismatches exist.

---

## 1. Preflight Query Results

| Query | Top Doc Hits |
|-------|-------------|
| AutoPost externalized FoundUp | AUTOPOST_EXTERNAL_OPERATIONAL_READINESS_AUDIT.md (docs), INTERFACE.md (foundups) |
| Science Swarm Hub external pqn_swarm_hub | pqn_swarm_hub/README.md, FOUNDUPS_SCIENCE_SWARM_EMBED_SPEC.md, WSP_103, WSP_104 |
| FoundUp manifest schema foundup_id | PFMALL_FOUNDUP_MANIFEST_SCHEMA.md (TOP-1 docs), WSP_104 |

All preflight queries return relevant docs at top positions.

---

## 2. Catalog FoundUp IDs

From `public/member/mall-video-catalog.json`:

| Catalog foundup_id | Classification |
|-------------------|----------------|
| `antifafm` | ACTIVE_PFMALL_FOUNDUP |
| `autopost` | EXTERNAL_APP |
| `eduit` | CANDIDATE |
| `foundups_main` | BRAND_META |
| `gotjunk_001` | ACTIVE_INTERNAL |
| `kosei` | ACTIVE_INTERNAL |
| `linkedin_012` | IDENTITY_ONLY |
| `linkedin_esingularity` | LINKEDIN_MICRO |
| `linkedin_foundups` | IDENTITY_ONLY |
| `linkedin_tsingularity` | LINKEDIN_MICRO |
| `move2japan` | ACTIVE_PFMALL_FOUNDUP |
| `science_swarm` | EXTERNALIZED_STUB |
| `undaodu` | BRAND_META |

---

## 3. modules/foundups/* Directory Analysis

### Directories with foundup_manifest.json (4)

| Directory | Manifest foundup_id | Catalog Match | Status |
|-----------|-------------------|---------------|--------|
| `trade/` | `trade` | Not in catalog | MATCH - proto-ready |
| `kosei/` | `kosei` | `kosei` | MATCH |
| `gotjunk/` | `gotjunk_001` | `gotjunk_001` | MATCH |
| `voteballots/` | `voteballots` | Not in catalog | MATCH - proto-ready |

### FoundUp Directories WITHOUT Manifest (5)

| Directory | Evidence of FoundUp | Catalog ID | Action Required |
|-----------|-------------------|-----------|-----------------|
| `move2japan/` | README: "FoundUp", has src/ | `move2japan` | **ADD MANIFEST** |
| `geoze/` | README: FoundUp intent, has src/ | Not in catalog | ADD MANIFEST when activated |
| `pqn_portal/` | Has src/, incubating | Not in catalog | ADD MANIFEST when activated |
| `social_twin/` | Has src/, PoC status | Not in catalog | ADD MANIFEST when activated |
| `ecosystem_animation/` | Frontend animation | Not in catalog | ADD MANIFEST when activated |

### Support Modules (NOT FoundUps) (8)

| Directory | Purpose | Manifest Required |
|-----------|---------|-------------------|
| `agent/` | Agent lifecycle management | NO |
| `agent_market/` | CABR engine, FAM daemon | NO |
| `agent_market+/` | Memory folder only | NO |
| `memory/` | WSP 60 compliance storage | NO |
| `mobile_worker_skills/` | Worker skills framework | NO |
| `pfmall/` | Catalog API | NO |
| `simulator/` | Simulation tool | NO |
| `src/` | Infrastructure code | NO |

### Documentation Only (1)

| Directory | Purpose |
|-----------|---------|
| `docs/` | Architecture documentation |

### Externalized Stub (1)

| Directory | External Repo | Catalog ID | ID Mismatch |
|-----------|--------------|-----------|-------------|
| `pqn_swarm_hub/` | FOUNDUPS/science-swarm-hub | `science_swarm` | **YES** |

---

## 4. ID Mismatches

### Mismatch 1: science_swarm vs pqn_swarm_hub

| Field | Value |
|-------|-------|
| Catalog `foundup_id` | `science_swarm` |
| Module directory | `modules/foundups/pqn_swarm_hub/` |
| External repo | `FOUNDUPS/science-swarm-hub` |
| Package name | `science-swarm-hub` (pyproject.toml) |

**Resolution**: The directory name `pqn_swarm_hub` is historical. The canonical
name is `science_swarm`. If a manifest is added to the stub, use `foundup_id: "science_swarm"`.

**Current impact**: Files under `pqn_swarm_hub/` resolve to `foundup_id: "pqn_swarm_hub"`
(directory fallback). This is a stub-only directory with no executable code.

---

## 5. External FoundUps (Correctly Blocked)

| FoundUp | Monorepo Module | External Surface | Status |
|---------|----------------|-----------------|--------|
| AutoPost | NO (correct) | FOUNDUPS/AutoPost repo | BLOCKED |
| Science Swarm Hub | STUB only | FOUNDUPS/science-swarm-hub repo | BLOCKED |

Both externalized FoundUps are correctly blocked from internal indexing.

---

## 6. Missing Manifests

### Priority 1: move2japan

| Field | Recommended Value |
|-------|-------------------|
| `foundup_id` | `move2japan` |
| `routing_prefix` | `/f/move2japan` |
| `data_namespace` | `idb_move2japan` |
| `tier` | `F1_OPO` |
| `lifecycle_stage` | `proto` |
| Reason | Active in pfMALL (573 videos), has src/ |

### Priority 2-3: Deferred

| FoundUp | Priority | Reason |
|---------|----------|--------|
| `geoze` | P2 | Has src/, not in catalog |
| `pqn_portal` | P3 | Incubating |
| `social_twin` | P3 | PoC status |

---

## 7. antifaFM Location

antifaFM module is at `modules/platform_integration/antifafm_broadcaster/`, not
under `foundups/`. This means `resolve_foundup_metadata()` classifies it as `"core"`.

This is acceptable: the broadcaster is platform infrastructure. The FoundUp identity
`antifafm` belongs to the content lane, not the broadcaster code.

---

## 8. Phase 3 Filtering Readiness

### Ready for Query Filtering (4)

| foundup_id | Has Manifest | Filter-Ready |
|-----------|--------------|--------------|
| `trade` | YES | YES |
| `kosei` | YES | YES |
| `gotjunk_001` | YES | YES |
| `voteballots` | YES | YES |

### Fallback Works (1)

| Directory | Effective ID | Gap |
|-----------|-------------|-----|
| `move2japan/` | `move2japan` (fallback) | Manifest recommended |

### External (Blocked)

| FoundUp | Status |
|---------|--------|
| `autopost` | BLOCKED |
| `science_swarm` | BLOCKED |

**VERDICT**: Phase 3 query filtering CAN proceed. The 4 manifested FoundUps are
filter-ready. `move2japan` fallback produces correct ID.

---

## 9. WSP 97 Truth Boundaries

| Statement | Status |
|-----------|--------|
| Only 4 directories have foundup_manifest.json | TRUE |
| move2japan has 573 catalog videos but no manifest | TRUE |
| pqn_swarm_hub directory name mismatches catalog ID science_swarm | TRUE |
| antifaFM is under platform_integration, not foundups | TRUE |
| AutoPost has no internal module (correctly externalized) | TRUE |
| Science Swarm Hub is stub-only (code migrated to external) | TRUE |
| resolve_foundup_metadata() falls back to directory name | TRUE |
| No manifests added in this audit | TRUE |
| No external repo indexing enabled | TRUE |

---

## 10. Recommended Manifest Additions

| FoundUp | Priority | When |
|---------|----------|------|
| `move2japan` | P1 | Before Phase 3 (optional) |
| `geoze` | P2 | When activated |
| `pqn_portal` | P3 | When proto |
| `social_twin` | P3 | When proto |

---

## Files Added

| File | Purpose |
|------|---------|
| `HIA_FEDERATION_FOUNDUP_IDENTITY_COVERAGE_AUDIT.md` | This audit |
80 changes: 80 additions & 0 deletions holo_index/ModLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,85 @@
# HoloIndex Package ModLog

## [2026-05-06] HIA_FEDERATION_QUERY_FILTERING_PHASE3

**Agent**: 0102 (W1)
**WSP References**: WSP 97, WSP 87, WSP 15
**Status**: COMPLETE

### Summary

Added FoundUp-scoped query filtering to HoloIndex search API. When `foundup_id`
is provided, results are restricted to that FoundUp's documents. When
`include_shared=True` (default), shared `core` documents are also included.
Backward compatible: existing callers work unchanged.

### Changes

- `search_engine.py`: Added `_build_foundup_where_filter()` helper; extended
`_search_collection()`, `_lexical_search_collection()`, `execute_search()`
with `foundup_id: Optional[str]` and `include_shared: bool` params
- `holo_index.py`: Added `foundup_id` and `include_shared` params to
`HoloIndex.search()` passthrough
- `test_federation_query_filtering.py`: 19 unit tests (NEW)

### API Signature Changes

```python
# Before
def execute_search(holo, query, limit=10, doc_type_filter="all")
def HoloIndex.search(query, limit=10, doc_type_filter="all")

# After (backward compatible)
def execute_search(holo, query, limit=10, doc_type_filter="all",
foundup_id=None, include_shared=True)
def HoloIndex.search(query, limit=10, doc_type_filter="all",
foundup_id=None, include_shared=True)
```

### Filter Logic

- `foundup_id=None` → No filtering (all documents)
- `foundup_id="trade", include_shared=False` → `where={"foundup_id": "trade"}`
- `foundup_id="trade", include_shared=True` → `where={"$or": [{"foundup_id": "trade"}, {"foundup_id": "core"}]}`

### Test Results

- New: 19/19 pass (test_federation_query_filtering.py)
- Regression metadata: 22/22 pass (test_federation_metadata_tagging.py)
- Regression routing: 19/19 pass (test_backend_routing.py)

---

## [2026-05-06] HIA_FEDERATION_FOUNDUP_IDENTITY_COVERAGE_AUDIT_PHASE2B

**Agent**: 0102 (W1)
**WSP References**: WSP 97, WSP 103, WSP 104, WSP 15
**Status**: COMPLETE - AUDIT ONLY

### Summary

Audited FoundUp identity coverage for federation query filtering readiness.
Found 4 directories with manifests (trade, kosei, gotjunk, voteballots),
5 FoundUp directories without manifests (move2japan needs one), 1 ID mismatch
(pqn_swarm_hub dir vs science_swarm catalog ID), and 2 correctly externalized
FoundUps (AutoPost, Science Swarm Hub).

### Key Findings

- 4/17 directories have `foundup_manifest.json`
- `move2japan` active in catalog (573 videos) but no manifest
- `pqn_swarm_hub/` directory vs `science_swarm` catalog ID mismatch
- `antifafm` module under `platform_integration/`, not `foundups/`
- AutoPost and Science Swarm Hub correctly blocked as external
- Phase 3 filtering CAN proceed (fallback handles gaps)

### Changes

- `HIA_FEDERATION_FOUNDUP_IDENTITY_COVERAGE_AUDIT.md`: Audit document (NEW)
- No code changes in this slice

---

## [2026-05-06] HIA_FEDERATION_METADATA_TAGGING_PHASE2

**Agent**: 0102 (W1)
Expand Down
15 changes: 13 additions & 2 deletions holo_index/core/holo_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,25 @@ def index_skillz_entries(self) -> None:

# --------- Search --------- #

def search(self, query: str, limit: int = 10, doc_type_filter: str = "all") -> Dict[str, Any]:
def search(
self,
query: str,
limit: int = 10,
doc_type_filter: str = "all",
foundup_id: Optional[str] = None,
include_shared: bool = True,
) -> Dict[str, Any]:
"""Search across all indexed collections.

Delegates to search_engine.execute_search() — the search surface
was extracted from this class for WSP 87 size compliance.

Args:
foundup_id: If set, filter results to this FoundUp's documents.
include_shared: If True and foundup_id is set, also include 'core' docs.
"""
from .search_engine import execute_search
return execute_search(self, query, limit, doc_type_filter)
return execute_search(self, query, limit, doc_type_filter, foundup_id, include_shared)

# --------- CLI Helpers --------- #

Expand Down
Loading
Loading