# Integration Architecture Map: PLN + ECAN + NAL
## Compiled by Max Botnick, 2026-04-09

## Cross-Repo Dependencies

### ECAN depends on PLN
- HebbianUpdatingAgent.metta line 58: calls mergeCalculation with PLN_BOOK_REVISION
- This uses PLN revision truth function: w=c/(1-c), weighted average of strengths
- ECAN stv format matches PLN stv format (strength, confidence pairs)

### PLN does NOT depend on ECAN
- No references to ECAN, attention, STI, or importance in PLN/ codebase
- PLN is a standalone inference engine; ECAN consumes its truth functions

### NAL Revision vs PLN Revision
- NAL revision: w1=c1/(1-c1), w2=c2/(1-c2), f_out=(w1*f1+w2*f2)/(w1+w2), c_out=(w1+w2)/(w1+w2+1)
- PLN revision: same formula (PLN_BOOK_REVISION in ECAN confirms this)
- Revision is the shared core between all three systems

## Architecture Diagram
```
[NAL Engine] ----revision formula----> [shared truth functions]
                                            |
[PLN Engine] ----revision+deduction+---> [PLN truth library]
              induction+abduction            |
                                            v
[ECAN Agents] <--PLN_BOOK_REVISION-- [HebbianUpdatingAgent]
  |-- ForgettingAgent (LTI threshold)
  |-- HebbianCreationAgent (AF co-occurrence)
  |-- HebbianUpdatingAgent (PLN revision merge)
  |-- AFImportanceDiffusionAgent (STI spreading)
  |-- WAImportanceDiffusionAgent (STI spreading)
  |-- AFRentCollectionAgent (STI/LTI deduction)
  |-- WARentCollectionAgent (STI/LTI deduction)
```

## Key Integration Points
1. ECAN Hebbian links get truth values via PLN revision
2. PLN inference could be guided by ECAN attention (not yet implemented in metta-attention)
3. NAL and PLN share revision formula exactly
4. ECAN AttentionParam.metta could feed PLN inference control priority

## Missing Integration (Future Work)
- PLN.Derive BestCandidate selection does NOT yet use ECAN STI for prioritization
- No NAL-to-ECAN bridge exists in current codebases
- Stochastic diffusion (paper concept) not implemented in metta-attention

## Artifacts Produced
1. nal_capability_map.md - NAL rule coverage
2. ngclearn_actpcgeom_trace.md - Active inference trace
3. ngclearn_component_taxonomy.md - NGC component map
4. pln_paper_to_code_trace.md - PLN book-to-code verification
5. ecan_paper_to_code_trace.md - ECAN paper-to-code verification
6. integration_architecture_map.md - This cross-repo integration map
