diff --git a/AFI_BRANCH_STATUS_REPORT.md b/AFI_BRANCH_STATUS_REPORT.md deleted file mode 100644 index 86fc3dc..0000000 --- a/AFI_BRANCH_STATUS_REPORT.md +++ /dev/null @@ -1,350 +0,0 @@ -# AFI Branch Status Report - -**Generated:** 2025-12-07 -**Workspace:** `/Users/secretservice/AFI_Modular_Repos` -**Total Repos Analyzed:** 23 AFI repos (7 core repos detailed below) - ---- - -## Executive Summary - -**Overall Status:** 🟑 **ACTIVE BUT FRAGILE** - -You are actively developing on **feature/migration branches** across multiple repos, with significant work that has **not been merged into canonical main branches**. All work is pushed to remote, but the branch topology suggests you're in the middle of a major multi-repo migration/refactor effort. - -**Key Findings:** - -- βœ… **All recent work is pushed** β€” No unpushed commits detected -- ⚠️ **4 repos on non-canonical branches** with substantial divergence from main -- ⚠️ **15+ commits in afi-reactor** not in main (TSSD Vault, Replay, Test fixes) -- ⚠️ **20+ commits in afi-core** not in main (UWR scoring, Math integration, ESM migration) -- ⚠️ **20+ commits in afi-token** not in main (Foundry v2, Pattern A role wiring) -- βœ… **1 repo on main** and in sync (afi-math) - -**Critical Decision Point:** - -You need to decide whether these feature branches (`docs/branch-doctrine-and-replay-spec`, `migration/multi-repo-reorg`, `eliza/nodenext-upgrade`, `afi-token-v2-foundry`) should: -1. Be merged into main (if they represent the new canonical state) -2. Continue as long-lived development branches -3. Be rebased/synchronized with main - ---- - -## Detailed Repo Analysis - -### 1. afi-reactor - -**Path:** `/Users/secretservice/AFI_Modular_Repos/afi-reactor` -**Current Branch:** `docs/branch-doctrine-and-replay-spec` -**Canonical Branch:** `main` (origin HEAD) -**Working Tree:** Clean (1 untracked symlink: `afi-core`) -**Status:** 🟑 **ACTIVE BUT FRAGILE** - -**Branch Breakdown:** - -- `docs/branch-doctrine-and-replay-spec` (current) - - **Tracking:** `origin/docs/branch-doctrine-and-replay-spec` (up to date) - - **Divergence:** 15 commits ahead of main, 0 behind - - **Last Commit:** `9312cc6` - ci: fix afi-core dependency build in GitHub Actions - - **Contains:** TSSD Vault (Phase 1), Provenance (Phase 1.5), Replay (Phase 2), Test fixes, AFI Eliza Demo rename - -- `main` - - **Tracking:** `origin/main` (local out of date) - - **Status:** Behind remote (needs pull) - -- `afi-reactor-freeze-2025-11-16` - - **Tracking:** None (local only) - - **Purpose:** Appears to be a safety snapshot - -**Commentary:** - -This branch contains **substantial new functionality** (TSSD MongoDB vault, replay system, test infrastructure improvements). The work is complete, tested, and pushed. However, it has **completely diverged from main** β€” main has no commits that this branch doesn't have, suggesting main is stale. - -**Suggested Next Steps:** - -```bash -# Option A: If this is the new canonical state, merge into main -git checkout main -git pull origin main -git merge docs/branch-doctrine-and-replay-spec -git push origin main - -# Option B: If main should stay separate, continue on this branch -# (Current approach β€” seems intentional given branch name suggests "doctrine") -``` - ---- - -### 2. afi-core - -**Path:** `/Users/secretservice/AFI_Modular_Repos/afi-core` -**Current Branch:** `migration/multi-repo-reorg` -**Canonical Branch:** `main` (origin HEAD) -**Working Tree:** Clean -**Status:** 🟑 **ACTIVE BUT FRAGILE** - -**Branch Breakdown:** - -- `migration/multi-repo-reorg` (current) - - **Tracking:** `origin/migration/multi-repo-reorg` (up to date) - - **Divergence:** 20 commits ahead of main, 0 behind - - **Last Commit:** `f697858` - docs(math): add Math Audit documentation and enrichment spec - - **Contains:** UWR scoring, Math integration, ESM invariants, Froggy analyst, validator types - -- `main` - - **Tracking:** `origin/main` (ahead 2, behind 11) - - **Status:** Diverged from remote (needs sync) - -- `broken-chaos`, `restore-augmentcode`, `validator-template-recovery` - - **Tracking:** Various (local branches, some with backup remote) - - **Purpose:** Appear to be recovery/safety snapshots - -**Commentary:** - -This branch represents a **major refactor** of afi-core with 20+ commits including critical features (UWR scoring, math integration, ESM migration). The branch name suggests this is part of a coordinated multi-repo reorganization effort. Main is diverged and appears stale. - -**Suggested Next Steps:** - -```bash -# Option A: If migration is complete, merge into main -git checkout main -git pull origin main -git merge migration/multi-repo-reorg -git push origin main - -# Option B: Continue migration work on this branch -# (Current approach β€” branch name suggests ongoing migration) - -# Clean up old recovery branches if no longer needed: -# git branch -d broken-chaos restore-augmentcode -``` - ---- - -### 3. afi-gateway - -**Path:** `/Users/secretservice/AFI_Modular_Repos/afi-gateway` -**Current Branch:** `eliza/nodenext-upgrade` -**Canonical Branch:** `main` (origin HEAD) -**Working Tree:** Clean -**Status:** 🟒 **OK** (but on feature branch) - -**Branch Breakdown:** - -- `eliza/nodenext-upgrade` (current) - - **Tracking:** `origin/eliza/nodenext-upgrade` (up to date) - - **Divergence:** 0 commits ahead of main (already merged or rebased) - - **Last Commit:** `1d04646` - feat(eliza-demo): rename Prize to AFI Eliza Demo and add CLI - - **Contains:** AFI Eliza Demo rename, CLI tool, documentation - -- `main` - - **Tracking:** `origin/main` (local out of date) - - **Status:** Behind remote (needs pull) - -**Commentary:** - -This branch appears to be **in sync with main** (no divergence detected). The branch name suggests a NodeNext upgrade effort. The work is complete and pushed. Main is slightly behind remote. - -**Suggested Next Steps:** - -```bash -# If work is complete, switch back to main -git checkout main -git pull origin main - -# If this branch is still active for NodeNext work, continue here -# (Branch appears complete based on commit messages) -``` - ---- - -### 4. afi-mint - -**Path:** `/Users/secretservice/AFI_Modular_Repos/afi-mint` -**Current Branch:** `migration/multi-repo-reorg` -**Canonical Branch:** `main` (origin HEAD) -**Working Tree:** Clean -**Status:** 🟒 **OK** - -**Branch Breakdown:** - -- `migration/multi-repo-reorg` (current) - - **Tracking:** `origin/migration/multi-repo-reorg` (up to date) - - **Divergence:** 5 commits ahead of main, 0 behind - - **Last Commit:** `b99206e` - chore: add .gitignore to exclude factory workspace - - **Contains:** .gitignore, package.json, AGENTS.md, reputation bridge scaffolding - -- `main` - - **Tracking:** `origin/main` (up to date) - -**Commentary:** - -Part of the multi-repo migration effort. Contains 5 commits with infrastructure improvements. Work is complete and pushed. Low risk. - -**Suggested Next Steps:** - -```bash -# When migration is complete across all repos, merge into main -git checkout main -git merge migration/multi-repo-reorg -git push origin main -``` - ---- - -### 5. afi-token - -**Path:** `/Users/secretservice/AFI_Modular_Repos/afi-token` -**Current Branch:** `afi-token-v2-foundry` -**Canonical Branch:** `main` (origin HEAD) -**Working Tree:** Clean -**Status:** 🟑 **ACTIVE BUT FRAGILE** - -**Branch Breakdown:** - -- `afi-token-v2-foundry` (current) - - **Tracking:** `origin/afi-token-v2-foundry` (up to date) - - **Divergence:** 20 commits ahead of main, 0 behind - - **Last Commit:** `6cc5840` - feat(factory): add contract-test-droid and add-contract-test-scenario skill - - **Contains:** Foundry v2, Pattern A role wiring, xERC20 integration, mainnet deployment, CI - -- `afi-token-mainnet-freeze-2025-11-16` - - **Tracking:** `origin/afi-token-mainnet-freeze-2025-11-16` (up to date) - - **Tag:** `v2.0.0-rc1` - - **Purpose:** Pre-mainnet baseline freeze - -- `main` - - **Tracking:** `origin/main` (ahead 1, behind many) - - **Status:** Diverged and stale - -- `merge-sprint`, `migration/multi-repo-reorg`, `remove-hardhat-ci` - - **Tracking:** Various - - **Purpose:** Historical branches - -**Commentary:** - -This is a **major version upgrade** (v2 Foundry rewrite) with 20+ commits including critical contract changes, role wiring patterns, and mainnet deployment scaffolding. There's a tagged release candidate (`v2.0.0-rc1`) on the freeze branch. Main is significantly behind. - -⚠️ **HIGH RISK:** This repo contains **on-chain contract logic**. Per AFI rules, contract changes should not be auto-merged without explicit human review. - -**Suggested Next Steps:** - -```bash -# DO NOT auto-merge this branch -# Requires explicit human review and approval before merging to main - -# When ready (after thorough review and testing): -git checkout main -git pull origin main -git merge afi-token-v2-foundry -git push origin main - -# Consider creating a PR for review rather than direct merge -``` - ---- - -### 6. afi-math - -**Path:** `/Users/secretservice/AFI_Modular_Repos/afi-math` -**Canonical Branch:** `main` (origin HEAD) -**Working Tree:** Clean -**Status:** βœ… **OK** - -**Branch Breakdown:** - -- `main` (current) - - **Tracking:** `origin/main` (up to date) - - **Last Commit:** `b03c9ab` - docs(governance): add AGENTS.md with ESM invariants - -**Commentary:** - -Clean and in sync. No action needed. - ---- - -## Other Repos (Brief Status) - -**afi-config:** On `migration/multi-repo-reorg` (no remote tracking shown) -**afi-factory:** On `migration/multi-repo-reorg` (no remote tracking shown) - -**Remaining 16 repos:** Not analyzed in detail (appear to be supporting repos: artifacts, assets, benchkit, docs, governance, infra, protocol, research-site, sdk-python, sdk-ts, starters) - ---- - -## Risk Analysis - -### High Priority Issues - -1. **afi-token on afi-token-v2-foundry** β€” Contains contract changes that require explicit review before merging -2. **afi-reactor 15 commits ahead** β€” Substantial new functionality (vault, replay) not in main -3. **afi-core 20 commits ahead** β€” Core protocol changes (UWR, math) not in main - -### Medium Priority Issues - -1. **Multiple repos on migration/multi-repo-reorg** β€” Coordinated migration effort in progress -2. **Main branches out of date** β€” Several repos have stale local main branches - -### Low Priority Issues - -1. **Local-only branches** β€” Some recovery/snapshot branches that may be obsolete -2. **Untracked symlink** β€” afi-reactor has untracked `afi-core` symlink (expected for local dev) - ---- - -## Recommendations - -### Immediate Actions - -1. **Review afi-token changes** β€” Do NOT auto-merge contract changes -2. **Decide on migration strategy** β€” Are migration branches ready to merge into main? -3. **Update local main branches** β€” Run `git checkout main && git pull` in repos where main is out of date - -### Strategic Decisions Needed - -**Question 1:** Is the multi-repo migration complete? -- If YES β†’ Merge `migration/multi-repo-reorg` branches into main across all repos -- If NO β†’ Continue work on migration branches - -**Question 2:** Should `docs/branch-doctrine-and-replay-spec` become the new main for afi-reactor? -- If YES β†’ Merge into main -- If NO β†’ Keep as long-lived feature branch - -**Question 3:** Is afi-token v2 ready for mainnet? -- If YES β†’ Merge `afi-token-v2-foundry` into main (after thorough review) -- If NO β†’ Continue development on feature branch - -### Cleanup Suggestions (Advisory Only) - -```bash -# In afi-core, if recovery branches are no longer needed: -cd /Users/secretservice/AFI_Modular_Repos/afi-core -git branch -d broken-chaos restore-augmentcode - -# In afi-reactor, if freeze branch is no longer needed: -cd /Users/secretservice/AFI_Modular_Repos/afi-reactor -git branch -d afi-reactor-freeze-2025-11-16 - -# Update all stale main branches: -for repo in afi-reactor afi-gateway; do - cd /Users/secretservice/AFI_Modular_Repos/$repo - git checkout main - git pull origin main - git checkout - # Return to previous branch -done -``` - ---- - -## Summary - -You are in the middle of a **coordinated multi-repo migration/refactor effort** with significant work on feature branches. All work is safely pushed to remote, but **none of it is in the canonical main branches yet**. - -**No immediate danger**, but you need to make strategic decisions about: -1. When to merge migration branches into main -2. Whether feature branches should become the new canonical state -3. How to handle the afi-token v2 contract changes (requires explicit review) - -**Next Step:** Decide whether the migration is complete and ready to merge, or if you should continue development on feature branches. - - diff --git a/AFI_CORE_BRANCH_ANALYSIS_REPORT.md b/AFI_CORE_BRANCH_ANALYSIS_REPORT.md deleted file mode 100644 index 2fa0b44..0000000 --- a/AFI_CORE_BRANCH_ANALYSIS_REPORT.md +++ /dev/null @@ -1,208 +0,0 @@ -# AFI-Core Repository Branch Analysis Report - -## Executive Summary - -This report provides a comprehensive analysis of all branches in the afi-core repository, both locally and on GitHub. The repository contains a main branch with foundational structure and five feature branches implementing core AFI functionalities. All branches are synchronized between local and remote repositories. The main branch is up-to-date with origin/main but lacks critical features implemented in the feature branches, which should be merged to achieve a complete, functional AFI core system. - -## Repository Overview - -- **Repository**: afi-core -- **Location**: /Users/secretservice/AFI_Modular_Repos/afi-core -- **Git Status**: Clean working directory, up-to-date with remote -- **Remote**: origin (GitHub) - -## Branch Inventory - -### Local Branches -- main (current branch) -- feature/enrichment-adapters -- feature/signal-decay -- feature/signal-scoring -- feature/validator-decision -- feature/validator-governance - -### Remote Branches -- origin/main -- origin/feature/enrichment-adapters -- origin/feature/signal-decay -- origin/feature/signal-scoring -- origin/feature/validator-decision -- origin/feature/validator-governance - -All local branches are synchronized with their remote counterparts. - -## Branch Analysis - -### Main Branch -**Commit History:** -- Total commits: 1 -- Recent activity: Initial commit "Initial commit for afi-core with base structure" -- Last commit: Dec 25, 2024 - -**File Structure:** -- Core directories: analysts/, cli_hooks/, docs/, droids/, runtime/, schemas/, src/, tests/, validators/ -- Configuration files: package.json, tsconfig.json, .gitignore, etc. -- Documentation: AGENTS.md, README.md -- Schemas: Multiple JSON schema files for signals, validators, etc. - -**Key Components:** -- Base project structure with TypeScript configuration -- Fundamental schemas (universal_signal_schema, validator_metadata_schema, etc.) -- Basic runtime adapter -- Test infrastructure - -### Feature Branches - -#### feature/enrichment-adapters -**Commit History:** -- Total commits: 1 -- Commit: "Add enrichment adapters for analysts" - -**Modifications:** -- Added: analysts/froggy.enrichment_adapter.ts -- Added: analysts/froggy.trend_pullback_v1.ts -- Added: analysts/__tests__/froggy.enrichment_adapter.test.ts -- Added: analysts/__tests__/froggy.trend_pullback_v1.test.ts - -**Key Features:** -- Enrichment adapters for analyst processing -- Trend pullback analysis implementation -- Comprehensive test coverage - -#### feature/signal-decay -**Commit History:** -- Total commits: 1 -- Commit: "Add signal decay functionality" - -**Modifications:** -- Added: src/decay/GreeksDecayTemplate.ts -- Added: src/decay/index.ts -- Added: src/decay/__tests__/GreeksDecayTemplate.test.ts - -**Key Features:** -- Greeks-based decay template for signal processing -- Modular decay system architecture - -#### feature/signal-scoring -**Commit History:** -- Total commits: 1 -- Commit: "Add signal scoring system" - -**Modifications:** -- Added: validators/SignalScorer.ts - -**Key Features:** -- Signal scoring logic for validator system -- Integration with existing validator framework - -#### feature/validator-decision -**Commit History:** -- Total commits: 1 -- Commit: "Add validator decision logic" - -**Modifications:** -- Added: validators/ValidatorDecision.ts -- Added: docs/VALIDATOR_DECISION_SPEC.v0.1.md - -**Key Features:** -- Decision-making logic for validators -- Specification documentation for decision processes - -#### feature/validator-governance -**Commit History:** -- Total commits: 1 -- Commit: "Add validator governance schemas and logic" - -**Modifications:** -- Added: schemas/validator_governance_schema.ts -- Added: validators/validator_registry.ts - -**Key Features:** -- Governance schema for validator management -- Registry system for validator coordination - -## Branch Comparisons - -### Differences from Main Branch -All feature branches add new files without modifying existing ones, ensuring clean integration potential. - -- **feature/enrichment-adapters**: Adds analyst enrichment capabilities (4 new files) -- **feature/signal-decay**: Adds signal decay processing (3 new files) -- **feature/signal-scoring**: Adds signal scoring (1 new file) -- **feature/validator-decision**: Adds decision logic and docs (2 new files) -- **feature/validator-governance**: Adds governance schemas (2 new files) - -### File Overlap Analysis -No overlapping file modifications detected. Each branch introduces unique files, minimizing merge conflict risk. - -## Potential Merge Conflicts - -**Assessment**: Low risk of conflicts -- All branches add new files only -- No modifications to shared files -- Independent feature implementations -- Clean separation of concerns - -**Recommended Merge Strategy**: -1. Merge feature branches in logical order (enrichment β†’ decay β†’ scoring β†’ decision β†’ governance) -2. Perform integration testing after each merge -3. Use merge commits to preserve branch history - -## Synchronization Status - -- **Local vs Remote**: All branches synchronized -- **Main Branch Status**: Up-to-date with origin/main -- **Feature Branches**: All current with remote counterparts - -## Completeness Assessment - -### Main Branch Status -The main branch provides a solid foundation but is **not fully complete**. It contains: -- βœ… Base project structure -- βœ… Core schemas -- βœ… Runtime infrastructure -- βœ… Test framework -- ❌ Enrichment adapters -- ❌ Signal decay processing -- ❌ Signal scoring -- ❌ Validator decision logic -- ❌ Validator governance - -### Essential Updates in Feature Branches -All feature branches contain **critical, production-ready updates** that are essential for AFI core functionality: - -1. **Enrichment Adapters**: Required for analyst data processing -2. **Signal Decay**: Essential for signal lifecycle management -3. **Signal Scoring**: Critical for validator evaluation -4. **Validator Decision**: Required for automated decision-making -5. **Validator Governance**: Necessary for system coordination - -## Recommendations - -### Immediate Actions -1. **Merge Priority**: Merge all feature branches into main to achieve functional completeness -2. **Testing**: Implement comprehensive integration tests post-merge -3. **Documentation**: Update README and architecture docs to reflect new features - -### Merge Sequence -``` -main ← feature/enrichment-adapters - ← feature/signal-decay - ← feature/signal-scoring - ← feature/validator-decision - ← feature/validator-governance -``` - -### Long-term Strategy -1. **Branch Management**: Consider feature branch cleanup after successful integration -2. **CI/CD**: Implement automated testing for future feature branches -3. **Versioning**: Tag releases after major integrations - -### Risk Mitigation -- Perform merges in development environment first -- Maintain backup branches before integration -- Monitor for any integration issues - -## Conclusion - -The afi-core repository demonstrates well-structured development with clear feature separation. The main branch provides an excellent foundation, but integration of all feature branches is essential to deliver a complete, functional AFI core system. With no merge conflicts anticipated and all branches synchronized, immediate integration is recommended to unlock the full potential of the AFI platform. \ No newline at end of file diff --git a/AFI_CORE_POST_CLEANUP_ANALYSIS.md b/AFI_CORE_POST_CLEANUP_ANALYSIS.md deleted file mode 100644 index 0db6ffa..0000000 --- a/AFI_CORE_POST_CLEANUP_ANALYSIS.md +++ /dev/null @@ -1,174 +0,0 @@ -# AFI-Core Repository Post-Cleanup Branch Analysis - -## Executive Summary - -Following the cleanup of extraneous branches, the afi-core repository now maintains a clean state with only the main branch. All feature branches have been successfully integrated, and obsolete branches have been removed. The repository is fully synchronized between local and remote states, with comprehensive feature integration and robust test coverage. - -## Repository Status - -- **Repository**: afi-core -- **Git Status**: Clean working directory, fully synchronized -- **Remote Synchronization**: Up-to-date with origin/main -- **Branch Cleanup**: Completed - only main branch retained - -## Branch Inventory - -### Local Branches -- **main** (active branch) - -### Remote Branches -- **origin/main** (primary remote branch) -- **backup/main** (backup remote - separate repository) -- **backup/validator-template-recovery** (backup remote - separate repository) - -## Commit History Analysis - -### Main Branch Commit History -**Recent Commits (Last 10):** -1. `5a4dd7d` - docs: update README to reflect current structure with all integrated features (Dec 25, 2024) -2. `cdd4dfc` - docs: clarify PoI/PoInsight as analyst-level reputation metrics (Dec 25, 2024) -3. `703fb78` - core: make decay export resolvable (Dec 25, 2024) -4. `0be9be4` - build: remove postinstall script and update afi-math dependency (Dec 25, 2024) -5. `3725d85` - build: add postinstall script and update afi-math dependency (Dec 25, 2024) -6. `7e45602` - build: add prepare script and use Git dependency for afi-math (Dec 25, 2024) -7. `a39103f` - Merge pull request #14 from AFI-Protocol/migration/multi-repo-reorg (Dec 25, 2024) -8. `449bcf8` - feat(decay): add time-decay templates + applyTimeDecay primitive (Dec 25, 2024) -9. `c52ec21` - Merge pull request #13 from AFI-Protocol/migration/multi-repo-reorg (Dec 25, 2024) -10. `6a78db4` - feat(analyst): make AnalystScoreTemplate canonical for Froggy (Dec 25, 2024) - -**Activity Summary:** -- Total commits: 15+ (extensive history) -- Recent activity: Active development with merges and feature additions -- Integration pattern: Pull request merges for feature branches -- Documentation updates: Recent README improvements - -## File Structure Analysis - -### Key Directory Structures - -#### analysts/ -``` -analysts/ -β”œβ”€β”€ froggy.enrichment_adapter.ts -β”œβ”€β”€ froggy.trend_pullback_v1.ts -└── __tests__/ - β”œβ”€β”€ froggy.enrichment_adapter.test.ts - └── froggy.trend_pullback_v1.test.ts -``` -**Status**: Complete with enrichment adapters and comprehensive test coverage - -#### src/decay/ -``` -src/decay/ -β”œβ”€β”€ GreeksDecayTemplate.ts -β”œβ”€β”€ index.ts -└── __tests__/ - └── GreeksDecayTemplate.test.ts -``` -**Status**: Fully implemented with Greeks-based decay templates and tests - -#### validators/ -``` -validators/ -β”œβ”€β”€ index.ts -β”œβ”€β”€ NoveltyScorer.ts -β”œβ”€β”€ NoveltyTypes.ts -β”œβ”€β”€ SignalDecay.ts -β”œβ”€β”€ SignalScorer.ts -β”œβ”€β”€ UniversalWeightingRule.ts -β”œβ”€β”€ ValidatorDecision.ts -└── __tests__/ - β”œβ”€β”€ NoveltyScorer.test.ts - β”œβ”€β”€ SignalDecay.test.ts - └── UniversalWeightingRule.test.ts -``` -**Status**: Complete validator system with scoring, decision logic, and governance - -#### schemas/ -``` -schemas/ -β”œβ”€β”€ index.ts -β”œβ”€β”€ pipeline_config_schema.ts -β”œβ”€β”€ signal_finalization_request_schema.ts -β”œβ”€β”€ universal_signal_schema.mjs -β”œβ”€β”€ universal_signal_schema.ts -β”œβ”€β”€ validator_governance_schema.ts -β”œβ”€β”€ validator_metadata_schema.ts -└── README.md -``` -**Status**: Comprehensive schema definitions including governance - -## Branch Comparison Analysis - -### Current State -- **Only main branch exists** - all features integrated -- **No divergent branches** - clean repository state -- **No unmerged changes** - all development consolidated -- **No conflicts** - successful integration completed - -### Previously Integrated Features -Based on commit history, the following features were merged via pull requests: -- **Enrichment Adapters** (PR #13) -- **Signal Decay** (PR #14) -- **Signal Scoring** (integrated) -- **Validator Decision Logic** (integrated) -- **Validator Governance** (integrated) - -## Completeness Evaluation - -### Feature Completeness: βœ… COMPLETE -- **Signal Processing**: Full pipeline from enrichment to finalization -- **Validation System**: Comprehensive scoring and decision logic -- **Governance**: Schema-based validator management -- **Testing**: 7 test suites with 100% pass rate -- **Documentation**: Updated README reflecting all features - -### Development Progress: βœ… MATURE -- **Code Quality**: TypeScript with proper exports and dependencies -- **Architecture**: Modular design with clear separation of concerns -- **Integration**: Successful merge of all feature branches -- **Maintenance**: Clean repository with only essential branch - -## Most Complete Branch Assessment - -**Main Branch Status: FULLY COMPLETE AND UP-TO-DATE** - -- Contains all integrated features -- Comprehensive test coverage -- Updated documentation -- Synchronized with remote -- No outstanding development branches - -## Conflict and Divergence Analysis - -### No Conflicts Detected -- **Clean Integration**: All merges successful via pull requests -- **No Overlapping Changes**: Feature branches added distinct functionality -- **Successful Cleanup**: Obsolete branches removed without data loss - -### Repository Health -- **Synchronization**: Local and remote fully aligned -- **Backup Integrity**: Separate backup remotes preserved -- **History Preservation**: All commits retained in main branch - -## Recommendations - -### Repository Maintenance -1. **Monitor Dependencies**: Address GitHub security advisories (4 vulnerabilities detected) -2. **Regular Testing**: Maintain test suite integrity -3. **Documentation**: Keep README synchronized with feature additions - -### Development Workflow -1. **Feature Branches**: Create new branches for future features from main -2. **Pull Requests**: Use PRs for code review and integration -3. **Testing**: Ensure comprehensive test coverage for new features - -### Long-term Strategy -1. **Version Tagging**: Consider tagging releases for stability -2. **CI/CD**: Implement automated testing and deployment -3. **Backup Management**: Maintain backup remotes for disaster recovery - -## Conclusion - -The afi-core repository has achieved a clean, integrated state with all features successfully merged into the main branch. The cleanup removed obsolete branches while preserving all development history and functionality. The repository is production-ready with comprehensive features, robust testing, and clear documentation. Future development should follow the established pattern of feature branches and pull request integration. -The afi-core repository has been successfully cleaned and analyzed. The repository now contains only the main branch, which is fully integrated with all features and synchronized with GitHub. All obsolete branches have been removed, and the codebase is complete with comprehensive test coverage and updated documentation. \ No newline at end of file diff --git a/AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md b/AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md deleted file mode 100644 index 7272666..0000000 --- a/AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md +++ /dev/null @@ -1,211 +0,0 @@ -# AFI-Reactor Repository Branch Analysis Report - -## Executive Summary - -The afi-reactor repository exhibits significant branch divergence with active development occurring on the `docs/branch-doctrine-and-replay-spec` branch, which contains 15 commits ahead of main. This branch includes critical features like TSSD Vault (Phase 1), Provenance (Phase 1.5), and Replay (Phase 2) capabilities that are not present in the main branch. The repository requires branch consolidation to bring these advanced features into the canonical main branch. - -## Repository Overview - -- **Repository**: afi-reactor (formerly afi-engine) -- **Location**: /Users/secretservice/AFI_Modular_Repos/afi-reactor -- **Git Status**: Clean working directory on docs/branch-doctrine-and-replay-spec -- **Remote Synchronization**: Up-to-date with origin -- **Architecture**: DAG-based orchestrator for AFI Protocol - -## Branch Inventory - -### Local Branches -- **docs/branch-doctrine-and-replay-spec** (current branch) -- **main** -- **afi-reactor-freeze-2025-11-16** (local snapshot) - -### Remote Branches -- **origin/main** (canonical branch) -- **origin/docs/branch-doctrine-and-replay-spec** (feature branch) - -## Branch Analysis - -### Main Branch -**Status**: Behind remote, requires pull -**Commit History:** -- Tracks origin/main -- Contains base orchestrator functionality -- Lacks advanced features present in docs branch - -**File Structure:** -- Core directories: src/, config/, docs/, droids/ -- Configuration: Multiple codex files (dag.codex.json, agents.codex.json, etc.) -- Services: Comprehensive service architecture -- Routes: API endpoints for signal processing - -### docs/branch-doctrine-and-replay-spec Branch -**Status**: 15 commits ahead of main, up-to-date with remote -**Divergence**: Significant feature additions not in main -**Last Commit**: `9312cc6` - ci: fix afi-core dependency build in GitHub Actions - -**Key Features Added:** -- **TSSD Vault (Phase 1)**: Secure storage and retrieval system -- **Provenance (Phase 1.5)**: Signal lineage and tracking -- **Replay (Phase 2)**: Historical signal replay capabilities -- **Test Fixes**: Improved test suite reliability -- **AFI Eliza Demo Rename**: Updated demo components - -**File Structure Enhancements:** -- Additional service modules in src/services/ -- Enhanced configuration in config/ -- Updated documentation in docs/ -- Improved test coverage - -### afi-reactor-freeze-2025-11-16 Branch -**Status**: Local only, no remote tracking -**Purpose**: Safety snapshot from November 16, 2025 -**Usage**: Backup/restore point for critical functionality - -## Branch Comparisons - -### Differences from Main Branch -The `docs/branch-doctrine-and-replay-spec` branch contains substantial additions: - -- **New Services**: TSSD Vault, Provenance tracking, Replay engine -- **Enhanced Configuration**: Updated codex files for new features -- **Improved Testing**: Fixed CI/CD pipeline and test reliability -- **Documentation Updates**: Branch doctrine and replay specifications -- **Demo Updates**: AFI Eliza integration improvements - -### File Structure Analysis - -#### src/ Directory (All Branches) -``` -src/ -β”œβ”€β”€ adapters/ # External system integrations -β”œβ”€β”€ aiMl/ # AI/ML processing components -β”œβ”€β”€ cli/ # Command-line interfaces -β”œβ”€β”€ collectors/ # Data collection modules -β”œβ”€β”€ config/ # Runtime configuration -β”œβ”€β”€ core/ # Core orchestration logic -β”œβ”€β”€ cpj/ # CPJ processing (Crypto Price JSON) -β”œβ”€β”€ enrichment/ # Signal enrichment -β”œβ”€β”€ indicator/ # Technical indicators -β”œβ”€β”€ news/ # News processing -β”œβ”€β”€ novelty/ # Novelty detection -β”œβ”€β”€ routes/ # API route handlers -β”œβ”€β”€ services/ # Business logic services -β”œβ”€β”€ types/ # TypeScript type definitions -β”œβ”€β”€ uss/ # Universal Signal Schema processing -└── utils/ # Utility functions -``` - -#### config/ Directory (All Branches) -``` -config/ -β”œβ”€β”€ agent.registry.json # Agent definitions -β”œβ”€β”€ agents.codex.json # Agent configurations -β”œβ”€β”€ dag.codex.json # DAG pipeline definitions -β”œβ”€β”€ execution-agent.registry.json # Execution agents -β”œβ”€β”€ ops.codex.json # Operations configurations -└── schema.codex.json # Schema definitions -``` - -## Completeness Evaluation - -### Architectural Correction Required -**Critical Issue**: Validator should be external to DAG, not a node within it. Current configurations in both branches violate this architecture. - -### Main Branch Completeness: PARTIAL (65%) -- βœ… Base DAG orchestration -- βœ… Signal processing pipeline -- βœ… API endpoints -- βœ… Basic agent registry -- ❌ TSSD Vault functionality -- ❌ Provenance tracking -- ❌ Replay capabilities -- ❌ Advanced testing fixes -- ❌ **Validator incorrectly placed in DAG** (architectural violation) - -### docs/branch-doctrine-and-replay-spec Branch Completeness: HIGH (90%) -- βœ… All main branch features -- βœ… TSSD Vault (Phase 1) -- βœ… Provenance (Phase 1.5) -- βœ… Replay (Phase 2) -- βœ… CI/CD fixes -- βœ… Enhanced documentation -- ⚠️ Requires integration testing with main -- ❌ **Validator incorrectly placed in DAG** (architectural violation) - -### afi-reactor-freeze-2025-11-16 Branch Completeness: BASELINE (55%) -- βœ… Stable snapshot -- βœ… Core functionality preserved -- ❌ Missing recent developments -- ❌ Not recommended for active use -- ❌ **Validator incorrectly placed in DAG** (architectural violation) - -## Development Progress Assessment - -### Most Complete Branch: docs/branch-doctrine-and-replay-spec -**Rationale:** -- Contains latest features (TSSD, Provenance, Replay) -- 15 commits ahead with substantial improvements -- Active development branch with CI/CD fixes -- Comprehensive feature set for Phase 2 capabilities - -### Development Status: ACTIVE DIVERGENCE -- **Main Branch**: Stable but outdated -- **Feature Branch**: Advanced but unmerged -- **Freeze Branch**: Archived baseline - -## Conflict and Divergence Analysis - -### Divergent Paths Detected -1. **Feature Development**: docs branch contains Phase 1.5-2 features not in main -2. **Testing Improvements**: CI fixes and test enhancements isolated to feature branch -3. **Documentation**: Branch-specific doctrine and specifications -4. **Architecture Discrepancy**: Validator node status unclear - README shows validator as DAG node, but user indicates it should be outside DAG - -### Potential Integration Challenges -- **Merge Complexity**: 15 commits may require careful conflict resolution -- **Testing Requirements**: Full integration testing needed post-merge -- **Documentation Sync**: Branch doctrine needs main branch integration -- **Architecture Clarification**: Need to confirm if validator should remain in DAG or be external - -### No Conflicts Anticipated -- **Clean Separation**: Feature additions don't overlap with main functionality -- **Modular Design**: New services are additive, not modifying existing code -- **Schema Compatibility**: Codex updates are backward compatible - -## Recommendations - -### Immediate Actions -1. **Architectural Fix**: Remove validator nodes from DAG configuration (both branches) -2. **Branch Consolidation**: Merge docs/branch-doctrine-and-replay-spec into main after validator fix -3. **Integration Testing**: Validate TSSD, Provenance, and Replay functionality -4. **Documentation Update**: Incorporate branch doctrine into main docs and update README DAG diagram - -### Merge Strategy -``` -main ← docs/branch-doctrine-and-replay-spec (post-validator-removal) - ← (selective merge of freeze branch if needed) -``` - -### Validator Architecture Implementation -- **Remove from DAG**: Eliminate validator-decision-node and afi-ensemble-score from dag.codex.json -- **External Integration**: Implement validator as external service called by reactor -- **API Interface**: Create REST/WebSocket interface for validator communication -- **Configuration Update**: Update codex files to reflect external validator architecture - -### Long-term Strategy -1. **Feature Branch Workflow**: Continue using feature branches for development -2. **Regular Merges**: Merge completed features into main more frequently -3. **Freeze Branches**: Maintain periodic snapshots for stability -4. **CI/CD Enhancement**: Ensure all branches have proper testing -5. **Architecture Governance**: Regular audits to ensure doctrine compliance - -### Risk Mitigation -- Create backup branch before merge -- Test in staging environment first -- Monitor for integration issues post-merge -- Update dependent repositories (afi-gateway, etc.) - -## Conclusion - -The afi-reactor repository demonstrates active development with significant feature advancement in the `docs/branch-doctrine-and-replay-spec` branch. This branch represents the most complete and up-to-date version with critical Phase 1.5-2 capabilities (TSSD Vault, Provenance, Replay) that should be integrated into main to advance the AFI Protocol's orchestration capabilities. The repository requires branch consolidation to unify these developments while maintaining the stability of the core DAG orchestration system. -The afi-reactor repository analysis is complete. The report reveals significant branch divergence with the `docs/branch-doctrine-and-replay-spec` branch containing 15 commits ahead of main, including critical features like TSSD Vault, Provenance tracking, and Replay capabilities. This branch is the most complete and should be merged into main for full functionality. \ No newline at end of file diff --git a/AFI_REACTOR_BRANCH_CLEANUP_ANALYSIS.md b/AFI_REACTOR_BRANCH_CLEANUP_ANALYSIS.md deleted file mode 100644 index be399e6..0000000 --- a/AFI_REACTOR_BRANCH_CLEANUP_ANALYSIS.md +++ /dev/null @@ -1,224 +0,0 @@ -# AFI-Reactor Branch Cleanup Analysis - -## Executive Summary - -This analysis examines two branches in the afi-reactor repository to determine if they are still needed: -- `feature/remove-dag-validators` -- `release/reactor-scored-only-public` - -**Conclusion**: Both branches can be safely deleted after pushing the validator removal changes to remote main. - -## Branch Analysis - -### 1. feature/remove-dag-validators - -**Status**: βœ… **CAN BE DELETED** (after pushing to remote) - -**Purpose**: Remove validator nodes from DAG configuration because validators should be external to reactor, not nodes within it. - -**Key Commit**: `d85a446` - "fix: remove validator nodes from DAG - validators should be external to reactor" - -**Changes Made**: -- Removed `afi-ensemble-score` node from [`config/dag.codex.json`](afi-reactor/config/dag.codex.json) -- Removed `validator-decision-node` from [`config/dag.codex.json`](afi-reactor/config/dag.codex.json) -- Updated [`README.md`](afi-reactor/README.md) to reflect 13-node DAG instead of 15-node DAG -- Removed validator section from README DAG description - -**Current State**: -- Local `main` branch is at commit `d85a446` (same as this branch) -- Remote `origin/main` is at commit `19ad90d` (merge commit, 1 commit behind) -- Local `origin/feature/remove-dag-validators` is at commit `d85a446` -- This branch is identical to local `main` (no diff) - -**Architectural Alignment**: βœ… **CORRECT** -- Aligns with [`AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md`](AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md) recommendation -- Validators should be external to DAG, not nodes within it -- Current DAG configuration has no validator nodes (correct architecture) - -**Recommendation**: -1. Push local `main` to `origin/main` to propagate validator removal -2. Delete both local and remote `feature/remove-dag-validators` branches - ---- - -### 2. release/reactor-scored-only-public - -**Status**: ❌ **CAN BE DELETED** (contains incorrect architecture) - -**Purpose**: Create a "scored-only public runtime" with isolated vault, removing demo/validator/replay functionality. - -**Key Commit**: `96c5111` - "Reactor: scored-only public runtime (isolated vault, no demo/validator/replay)" - -**Changes Made**: -- Massive refactoring (8048 files changed, 14928 insertions, 1517665 deletions) -- Added `afi-ensemble-score` node to [`config/dag.codex.json`](afi-reactor/config/dag.codex.json) -- Added `validator-decision-node` to [`config/dag.codex.json`](afi-reactor/config/dag.codex.json) -- Updated [`README.md`](afi-reactor/README.md) to reference "AFI-Engine" (old naming) instead of "AFI-Reactor" -- Updated README to reflect 15-node DAG instead of 13-node DAG -- Added validator section to README DAG description - -**Current State**: -- Branch is at commit `0e372b0` (parent of merge commit `19ad90d`) -- Remote `origin/release/reactor-scored-only-public` is at commit `0e372b0` -- This branch was merged into `main` via PR #12 (commit `19ad90d`) -- The merge has since been corrected by `feature/remove-dag-validators` - -**Architectural Alignment**: ❌ **INCORRECT** -- Violates [`AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md`](AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md) recommendation -- Validators should be external to DAG, not nodes within it -- Uses old "AFI-Engine" naming (repo was renamed to "AFI-Reactor" on 2025-11-14) -- Contains outdated documentation - -**Recommendation**: -1. Delete both local and remote `release/reactor-scored-only-public` branches -2. The useful changes from this branch (security fixes, CI improvements) are already in main -3. The incorrect architectural changes (validator nodes in DAG) have been corrected - ---- - -## Git History Context - -``` -* d85a446 (HEAD -> feature/remove-dag-validators, origin/feature/remove-dag-validators, main) - fix: remove validator nodes from DAG - validators should be external to reactor -* 19ad90d (origin/main, origin/HEAD) - Merge pull request #12 from AFI-Protocol/release/reactor-scored-only-public -|\ -| * 0e372b0 (origin/release/reactor-scored-only-public, release/reactor-scored-only-public) - ci: build afi-core and rely on package exports -| * 96c5111 - Reactor: scored-only public runtime (isolated vault, no demo/validator/replay) -|/ -* 9915a27 (release/reactor-live-testing) - security: Eliminate exposed MongoDB credentials and add secret scanning -``` - -## Current Repository State - -### Local Branches -- `main` - at commit `d85a446` (validator removal applied) -- `feature/remove-dag-validators` - at commit `d85a446` (identical to main) -- `release/reactor-scored-only-public` - at commit `0e372b0` (incorrect architecture) - -### Remote Branches -- `origin/main` - at commit `19ad90d` (merge commit, needs validator removal) -- `origin/feature/remove-dag-validators` - at commit `d85a446` (validator removal) -- `origin/release/reactor-scored-only-public` - at commit `0e372b0` (incorrect architecture) - -### Current HEAD -- HEAD is on `feature/remove-dag-validators` (commit `d85a446`) - -## Recommendations - -### Immediate Actions - -1. **Push validator removal to remote main**: - ```bash - git checkout main - git push origin main - ``` - This will propagate the validator removal changes to `origin/main`. - -2. **Delete feature/remove-dag-validators branches**: - ```bash - git branch -d feature/remove-dag-validators - git push origin --delete feature/remove-dag-validators - ``` - This branch has served its purpose and is no longer needed. - -3. **Delete release/reactor-scored-only-public branches**: - ```bash - git branch -D release/reactor-scored-only-public - git push origin --delete release/reactor-scored-only-public - ``` - This branch contains incorrect architecture and outdated naming. - -### Rationale - -**Why delete feature/remove-dag-validators?** -- Changes have been applied to local `main` branch -- Branch is identical to `main` (no diff) -- Purpose was to remove validator nodes, which is now complete -- Keeping it creates confusion about which branch is canonical - -**Why delete release/reactor-scored-only-public?** -- Contains incorrect architecture (validator nodes in DAG) -- Uses outdated "AFI-Engine" naming -- Was merged into main via PR #12, but has since been corrected -- Useful changes (security, CI) are already preserved in main -- Keeping it risks accidental re-introduction of incorrect architecture - -### Branch Doctrine Compliance - -According to [`afi-reactor/docs/BRANCH_DOCTRINE.v0.1.md`](afi-reactor/docs/BRANCH_DOCTRINE.v0.1.md): - -- **feature/*** branches should be short-lived and focused βœ… -- **release/*** branches are not mentioned in doctrine (human-only operations) -- Branches should be deleted after merging βœ… -- No history rewrites on main βœ… - -Both branches comply with the doctrine's intent of keeping the repository clean and focused. - -## Architectural Impact - -### Before Cleanup -- Confusion about which branch contains correct architecture -- Risk of accidentally using incorrect validator-in-DAG configuration -- Outdated documentation references in release branch - -### After Cleanup -- Single source of truth: `main` branch with correct architecture -- No validator nodes in DAG (correct external validator architecture) -- Clean branch history aligned with branch doctrine -- Reduced risk of architectural regression - -## Verification Steps - -After cleanup, verify: - -1. **Main branch has correct architecture**: - ```bash - git checkout main - git log --oneline -1 - # Should show: d85a446 fix: remove validator nodes from DAG - ``` - -2. **DAG configuration has no validator nodes**: - ```bash - cat config/dag.codex.json | grep -i validator - # Should return nothing - ``` - -3. **Remote branches are deleted**: - ```bash - git branch -r | grep -E "feature/remove-dag-validators|release/reactor-scored-only-public" - # Should return nothing - ``` - -4. **Local branches are deleted**: - ```bash - git branch | grep -E "feature/remove-dag-validators|release/reactor-scored-only-public" - # Should return nothing - ``` - -## Conclusion - -Both branches can be safely deleted: - -- **feature/remove-dag-validators**: βœ… Completed its purpose, changes are in main -- **release/reactor-scored-only-public**: ❌ Contains incorrect architecture, has been corrected - -The cleanup will: -- Align the repository with correct architectural principles -- Remove confusion about which branch is canonical -- Prevent accidental re-introduction of incorrect architecture -- Maintain compliance with branch doctrine - -**Next Steps**: Execute the recommended cleanup commands and verify the results. - ---- - -**Analysis Date**: 2025-12-26 -**Repository**: afi-reactor -**Branches Analyzed**: feature/remove-dag-validators, release/reactor-scored-only-public -**Status**: Ready for cleanup diff --git a/AFI_REACTOR_MAIN_VS_DEMO_LIVE_ANALYSIS.md b/AFI_REACTOR_MAIN_VS_DEMO_LIVE_ANALYSIS.md deleted file mode 100644 index f2fea9b..0000000 --- a/AFI_REACTOR_MAIN_VS_DEMO_LIVE_ANALYSIS.md +++ /dev/null @@ -1,341 +0,0 @@ -AFI-Reactor: main vs demo/live Branch Analysis - -## Executive Summary - -The `main` and `demo/live` branches in afi-reactor have significant architectural and functional divergence. The `demo/live` branch contains advanced features (TSSD Vault, Provenance, Replay, CPJ ingestion, Telegram MTProto) that are not present in `main`, while `main` contains security fixes and architectural corrections (validator removal) that are not in `demo/live`. - -**Key Finding**: The `demo/live` branch represents a more feature-complete but architecturally incorrect version (validators in DAG), while `main` represents a more secure but less feature-complete version (validators external to DAG). - -## Branch Overview - -### main Branch - -**Current Commit**: `97f949d` (Merge pull request #13 from AFI-Protocol/feature/remove-dag-validators) - -**Purpose**: Canonical production branch with security fixes and architectural corrections. - -**Key Characteristics**: -- βœ… Validators are external to DAG (correct architecture) -- βœ… Security fixes for MongoDB credentials -- βœ… Secret scanning infrastructure -- βœ… CI/CD improvements -- ❌ Missing TSSD Vault functionality -- ❌ Missing Provenance tracking -- ❌ Missing Replay capabilities -- ❌ Missing CPJ ingestion -- ❌ Missing Telegram MTProto collector -- ❌ Missing advanced enrichment features - -### demo/live Branch - -**Current Commit**: `e14b916` (test: add Pattern Regime provider test script) - -**Purpose**: Feature-rich demo branch with advanced capabilities for live deployment. - -**Key Characteristics**: -- βœ… TSSD Vault (Phase 1) - MongoDB persistence -- βœ… Provenance tracking (Phase 1.5) - Signal lineage -- βœ… Replay capabilities (Phase 2) - Historical signal replay -- βœ… CPJ ingestion - Crypto Price JSON format -- βœ… Telegram MTProto collector - Social signal collection -- βœ… Advanced enrichment - Pattern regime, perp sentiment, news features -- βœ… Multiple price feeds - BloFin, Coinbase, Coinalyze -- βœ… Tiny Brains AI/ML integration -- βœ… USS v1.1 canonical flow -- ❌ Validators are in DAG (incorrect architecture) -- ❌ Missing security fixes from main -- ❌ Uses outdated "AFI-Engine" naming -- ❌ Uses Git dependencies instead of local file dependencies - -## Divergence Analysis - -### Commits Unique to main (not in demo/live) - -``` -97f949d Merge pull request #13 from AFI-Protocol/feature/remove-dag-validators -d85a446 fix: remove validator nodes from DAG - validators should be external to reactor -19ad90d Merge pull request #12 from AFI-Protocol/release/reactor-scored-only-public -0e372b0 ci: build afi-core and rely on package exports -96c5111 Reactor: scored-only public runtime (isolated vault, no demo/validator/replay) -9915a27 security: Eliminate exposed MongoDB credentials and add secret scanning -ba6fa7a fix: exclude more placeholder patterns from secret scan -74a91f7 fix: exclude node_modules and build artifacts from secret scan -a38bcb8 fix: scan only tracked files, not git history -655501a fix: exclude placeholder values from secret scanner -0f1fb59 fix: simplify secret scanner to use basic scan only -e804628 fix: make secret scanner work without Gitleaks license -6ac702c security: add secret management and scanning infrastructure -f2611db fix(reactor): restore main build + align tests to canonical analystScore -6177828 fix: install afi-core dependencies before afi-reactor -a31bb5e fix: properly checkout afi-core in CI and remove stub/typings hacks -33af96b fix: add froggy.trend_pullback_v1 stub for CI -434b62d fix: add enrichmentMeta.categories to FroggyEnrichedView type -da3fff2 fix: add strategyId to AnalystScoreTemplate and FroggyTrendPullbackScore -a24451f fix: add froggy.trend_pullback_v1 module declarations -a1ec593 fix: expand FroggyEnrichedView type definition for test assertions -ea337ac fix: add afi-core module declarations for CI TypeScript compilation -0f2ab31 fix: use local type stubs for afi-core imports in CI -e9f9eba fix: define EnrichmentProfile locally for CI (afi-core unavailable) -b472378 fix: add supertest devDependency for prizeDemoEndpoint tests -e7ee298 fix: CI runs tests only (afi-core private repo access limitation) -db3875d fix: remove explicit token param (use default GITHUB_TOKEN behavior) -bfc8569 fix: checkout afi-core as sibling for file: dependency resolution -3990bfe chore: ignore local env + local afi-core symlink -505bf91 fix: checkout afi-core in CI for file: dependency resolution -be32f23 fix: include plugins in tsconfig for tsc compilation -3252ee6 fix: resolve 5 test failures (network deps + type mismatches) -10d5929 fix: restore reactor main build after PR #7 -``` - -**Summary**: 35 commits focused on security, CI/CD improvements, and architectural corrections. - -### Commits Unique to demo/live (not in main) - -``` -e14b916 test: add Pattern Regime provider test script -b3a0e87 feat: replace CoinGecko with exchange OHLC for Pattern Regime -0118353 feat: add CPJ ingestion and Telegram MTProto collector -991d6d6 build: switch to HTTPS Git deps and prioritize PORT env var for Render -852d796 build: use Git dependencies and add build:deps script for Render deployment -37cf7fa chore: ignore deps/build outputs; stop tracking node_modules -37e40c5 test: update expectations after merge with main -36e49a9 Merge remote-tracking branch 'origin/main' into docs/branch-doctrine-and-replay-spec -c7b0437 feat(uss): add replay-canonical ingest facts block (symbol/timeframe/strategy) -2251530 refactor(demo): enforce canonical USS v1.1 flow (no backward compat) -275659f fix(tests): restore demo endpoint + aiMl category expectations -92657f1 fix(tests): resolve ussValidator ESM syntax errors in Jest -69fb498 feat(validator): implement real novelty scoring with replay-canonical guarantees -3513ec1 feat(validator): add validatorConfigId/version to decision + replay checks -c103b38 chore(ingest): quarantine legacy ingest plugins; add guardrails -1393640 feat(vault): persist canonical rawUss v1.1 in TSSD document -ba5b90a refactor(reactor): pipeline consumes rawUss; remove legacy ingest stages -0ef7d66 feat(reactor): pass canonical uss v1.1 into DAG as rawUss -4f828f1 feat(reactor): enforce canonical ussignal at tradingview webhook boundary -9ecfb02 feat(time): wire scoredAt/decayParams + runtime ESM smoke test -395b0af feat(reactor): consume AnalystScoreTemplate as canonical analyst output -d9b6e6b feat(dag): add DAG runner and Froggy DAG pipeline helper -cafd132 chore: point Tiny Brains integration to standalone afi-tiny-brains service -a3e08ab feat: add Tiny Brains aiMl integration and observability for Froggy -c6d78e1 feat: add news features and max enrichment profile for Froggy -60e9941 feat: add pluggable NewsProvider system with NewsData.io integration -21a03a0 feat: add pattern regime lens and mirror regime to top-level pattern -1ca48f5 feat: add Froggy perp sentiment via Coinalyze and fix /test/enrichment -bb4bdfd feat: add Froggy indicator profile and indicator kernel integration -c3bf054 feat: wire USS lenses through enrichment β†’ TSSD β†’ replay -d01b5d0 feat: add Coinbase price feed + TSSD simple replay with provenance audit -a0afa58 feat: add BloFin price feed and TSSD provenance wiring -9312cc6 ci: fix afi-core dependency build in GitHub Actions -4c75727 chore(dev): add supertest and update Jest moduleNameMapper -fdea7cc test(core): fix DAG config shape test import syntax -173acdd test(eliza-demo): add in-process HTTP tests with supertest -653c909 feat(eliza-demo): rename Prize to AFI Eliza Demo with enhanced docs -3388523 feat(replay): add read-only TSSD vault replay (Phase 2) -e853d9b feat(provenance): extend TSSD schema for mint lifecycle (Phase 1.5) -b2b6f81 feat(vault): implement TSSD MongoDB persistence (Phase 1) -``` - -**Summary**: 40 commits focused on advanced features, integrations, and demo capabilities. - -## Key Differences - -### 1. DAG Configuration (config/dag.codex.json) - -**main branch**: -- 13-node DAG -- No validator nodes in DAG (correct architecture) -- No deprecated nodes -- Clean, minimal configuration - -**demo/live branch**: -- 15-node DAG -- Contains `afi-ensemble-score` node (validator in DAG - incorrect) -- Contains `validator-decision-node` (validator in DAG - incorrect) -- Marks `alpha-scout-ingest` and `pixelrick-structurer` as deprecated -- More complex configuration with additional nodes - -**Impact**: The demo/live branch violates the architectural principle that validators should be external to the DAG. - -### 2. README.md - -**main branch**: -- References "AFI-Reactor" (correct naming) -- Describes 13-node DAG -- No validator section in DAG description -- Includes security section with secret scanning setup - -**demo/live branch**: -- References "AFI-Engine" (outdated naming) -- Describes 15-node DAG -- Includes validator section in DAG description -- Missing security section - -**Impact**: The demo/live branch has outdated documentation and incorrect architectural description. - -### 3. package.json - -**main branch**: -- Uses local file dependencies: `"afi-core": "file:../afi-core"` -- Minimal dependencies -- Basic scripts - -**demo/live branch**: -- Uses Git dependencies: `"afi-core": "git+https://github.com/AFI-Protocol/afi-core.git#0be9be4"` -- Additional dependencies: ajv, ccxt, node-telegram-bot-api, telegram, trading-signals -- Advanced scripts: build:deps, build:smoke, test:cpj:smoke, test:mtproto:smoke, verify:tssd:blofin - -**Impact**: The demo/live branch has more dependencies and build complexity for advanced features. - -### 4. src/server.ts - -**main branch**: -- Minimal server with only `/health` and `/api/webhooks/tradingview` endpoints -- No test endpoints -- Gated debug endpoint (only when DEBUG_ENDPOINTS_ENABLED=true) -- Focus on scoring-only functionality - -**demo/live branch**: -- Rich server with multiple test endpoints: `/test`, `/test/blofin`, `/test/coinbase` -- Includes replay and vault services -- More permissive debug endpoint -- Focus on demo and testing capabilities - -**Impact**: The demo/live branch has more endpoints and services for testing and demo purposes. - -### 5. Architecture - -**main branch**: -- βœ… Validators external to DAG (correct) -- βœ… Security-focused -- βœ… Minimal, production-ready -- ❌ Missing advanced features - -**demo/live branch**: -- ❌ Validators in DAG (incorrect) -- ❌ Security fixes missing -- βœ… Feature-rich -- βœ… Advanced integrations - -**Impact**: Fundamental architectural difference that affects the entire system design. - -## Feature Comparison - -| Feature | main | demo/live | Notes | -|---------|------|-----------|-------| -| TSSD Vault (Phase 1) | ❌ | βœ… | MongoDB persistence | -| Provenance (Phase 1.5) | ❌ | βœ… | Signal lineage tracking | -| Replay (Phase 2) | ❌ | βœ… | Historical signal replay | -| CPJ Ingestion | ❌ | βœ… | Crypto Price JSON format | -| Telegram MTProto | ❌ | βœ… | Social signal collection | -| Pattern Regime | ❌ | βœ… | Technical analysis | -| Perp Sentiment | ❌ | βœ… | Coinalyze integration | -| News Features | ❌ | βœ… | NewsData.io integration | -| Multiple Price Feeds | ❌ | βœ… | BloFin, Coinbase, Coinalyze | -| Tiny Brains AI/ML | ❌ | βœ… | AI/ML integration | -| USS v1.1 Flow | ❌ | βœ… | Canonical signal format | -| Validator Architecture | βœ… External | ❌ In DAG | Architectural violation | -| Security Fixes | βœ… | ❌ | MongoDB credentials, secret scanning | -| CI/CD Improvements | βœ… | ❌ | Build fixes, dependency resolution | -| Naming | βœ… AFI-Reactor | ❌ AFI-Engine | Outdated naming | -| Dependencies | βœ… Local | ❌ Git | More complex | - -## Merge Base - -**Merge Base Commit**: `91e9f95189bb3d6d2fd097d7a12e2ad4be417cad` - -This is the common ancestor where the two branches diverged. - -## Recommendations - -### Option 1: Merge demo/live into main (Recommended) - -**Steps**: -1. Cherry-pick or merge the feature commits from demo/live into main -2. Remove validator nodes from DAG after merge -3. Update documentation to reflect correct architecture -4. Apply security fixes from main to demo/live features -5. Test thoroughly - -**Pros**: -- Combines best of both branches -- Main becomes feature-complete with correct architecture -- Single source of truth - -**Cons**: -- Complex merge with potential conflicts -- Requires careful testing -- May need to resolve architectural conflicts - -### Option 2: Rebase demo/live onto main - -**Steps**: -1. Rebase demo/live onto main -2. Remove validator nodes from DAG after rebase -3. Update documentation -4. Test thoroughly - -**Pros**: -- Cleaner history -- Main becomes feature-complete - -**Cons**: -- Rewrites history (may affect collaborators) -- Complex rebase with potential conflicts - -### Option 3: Keep branches separate - -**Steps**: -1. Keep main as production branch -2. Keep demo/live as experimental branch -3. Periodically merge security fixes from main to demo/live -4. Eventually merge demo/live features into main when ready - -**Pros**: -- No merge conflicts -- Clear separation of concerns -- Safe experimentation - -**Cons**: -- Divergence will increase over time -- Confusion about which branch to use -- Duplicate maintenance effort - -### Option 4: Create new integration branch - -**Steps**: -1. Create new branch from main -2. Cherry-pick feature commits from demo/live -3. Remove validator nodes from DAG -4. Update documentation -5. Test thoroughly -6. Merge into main when ready - -**Pros**: -- Clean integration -- No history rewriting -- Safe testing - -**Cons**: -- Additional branch to maintain -- More complex workflow - -## Conclusion - -The `main` and `demo/live` branches have significant divergence in both architecture and features. The `demo/live` branch contains advanced features that are not present in `main`, but it also contains architectural violations (validators in DAG) and missing security fixes. - -**Recommendation**: Option 1 (Merge demo/live into main) is the best approach, as it combines the feature completeness of demo/live with the architectural correctness and security of main. This will require careful merge conflict resolution and thorough testing. - -**Next Steps**: -1. Decide on merge strategy -2. Create backup branches -3. Perform merge/rebase -4. Remove validator nodes from DAG -5. Update documentation -6. Test thoroughly -7. Deploy to production - ---- - -**Analysis Date**: 2025-12-26 -**Repository**: afi-reactor -**Branches Analyzed**: main, demo/live -**Status**: Significant divergence detected - requires integration planning \ No newline at end of file diff --git a/AFI_REACTOR_MERGE_DEMO_LIVE_INTO_MAIN_PLAN.md b/AFI_REACTOR_MERGE_DEMO_LIVE_INTO_MAIN_PLAN.md deleted file mode 100644 index 46a43c5..0000000 --- a/AFI_REACTOR_MERGE_DEMO_LIVE_INTO_MAIN_PLAN.md +++ /dev/null @@ -1,297 +0,0 @@ -# AFI-Reactor: Merge demo/live into main - Orchestrator Action Plan - -## Objective - -Merge the feature-rich `demo/live` branch into the architecturally correct `main` branch, creating a unified production branch that combines: -- Advanced features from demo/live (TSSD Vault, Provenance, Replay, CPJ ingestion, Telegram MTProto) -- Architectural correctness from main (validators external to DAG) -- Security fixes from main (MongoDB credentials, secret scanning) - -## Context - -**Current State**: -- `main` branch: commit `97f949d` (correct architecture, security fixes, missing features) -- `demo/live` branch: commit `e14b916` (incorrect architecture, missing security, feature-rich) -- Merge base: `91e9f95189bb3d6d2fd097d7a12e2ad4be417cad` - -**Key Challenge**: The demo/live branch contains validator nodes in the DAG, which violates the architectural principle that validators should be external to the reactor. - -## Prerequisites - -- [ ] Review [`AFI_REACTOR_MAIN_VS_DEMO_LIVE_ANALYSIS.md`](AFI_REACTOR_MAIN_VS_DEMO_LIVE_ANALYSIS.md) for detailed differences -- [ ] Ensure all work is committed and pushed -- [ ] Create backup branches before starting merge -- [ ] Verify current working directory is clean - -## Action Plan - -### Phase 1: Preparation - -**Step 1.1**: Create backup branches -```bash -cd afi-reactor -git branch backup-main-before-merge -git branch backup-demo-live-before-merge -``` -**Purpose**: Safety net in case merge goes wrong - -**Step 1.2**: Verify branch status -```bash -git status -git log --oneline -1 -``` -**Expected**: Clean working directory, on main branch - -**Step 1.3**: Pull latest changes -```bash -git fetch origin -git pull origin main -``` -**Purpose**: Ensure main is up-to-date with remote - -### Phase 2: Merge Execution - -**Step 2.1**: Attempt merge -```bash -git merge demo/live --no-ff -m "Merge demo/live into main - combine features with correct architecture" -``` -**Purpose**: Merge demo/live into main with explicit commit message - -**Expected Outcome**: -- Success with automatic merge (best case) -- OR merge conflicts requiring resolution (likely case) - -**Step 2.2**: If merge conflicts occur - -**Conflict Resolution Strategy**: - -1. **DAG Configuration Conflicts** ([`config/dag.codex.json`](afi-reactor/config/dag.codex.json)) - - **Action**: Remove validator nodes (afi-ensemble-score, validator-decision-node) - - **Reason**: Validators should be external to DAG per architectural doctrine - - **Resolution**: Keep main's version (no validators) but preserve other demo/live features - -2. **README Conflicts** ([`README.md`](afi-reactor/README.md)) - - **Action**: Update to reflect correct architecture - - **Reason**: Remove validator section, update node count to 13, use "AFI-Reactor" naming - - **Resolution**: Keep main's architectural description but preserve demo/live feature descriptions - -3. **package.json Conflicts** - - **Action**: Preserve Git dependencies from demo/live - - **Reason**: Advanced features require Git dependencies - - **Resolution**: Use demo/live's dependency structure but preserve main's security fixes - -4. **server.ts Conflicts** - - **Action**: Preserve test endpoints from demo/live - - **Reason**: Demo capabilities require test endpoints - - **Resolution**: Use demo/live's endpoint structure but preserve main's security gating - -**Step 2.3**: Resolve conflicts systematically -```bash -# Check for conflicts -git status - -# For each conflict file: -# 1. Open file -# 2. Review conflict markers (<<<<<<<, =======, >>>>>>>) -# 3. Choose correct resolution based on strategy above -# 4. Remove conflict markers -# 5. git add -``` - -**Step 2.4**: Complete merge -```bash -git commit -m "Merge demo/live into main - combine features with correct architecture - -- Preserved advanced features from demo/live: - - TSSD Vault (Phase 1) - - Provenance (Phase 1.5) - - Replay (Phase 2) - - CPJ ingestion - - Telegram MTProto collector - - Advanced enrichment (pattern regime, perp sentiment, news features) - - Multiple price feeds (BloFin, Coinbase, Coinalyze) - - Tiny Brains AI/ML integration - - USS v1.1 canonical flow - -- Maintained architectural correctness from main: - - Validators external to DAG (removed validator nodes) - - Security fixes (MongoDB credentials, secret scanning) - - Correct naming (AFI-Reactor, not AFI-Engine) - -- Resolved merge conflicts: - - DAG configuration: removed validator nodes - - README: updated to 13-node DAG, removed validator section - - package.json: preserved Git dependencies for advanced features - - server.ts: preserved test endpoints with security gating" -``` - -### Phase 3: Post-Merge Validation - -**Step 3.1**: Verify DAG configuration -```bash -cat config/dag.codex.json | grep -i validator -``` -**Expected**: No output (no validator nodes in DAG) - -**Step 3.2**: Verify README -```bash -grep -i "validator" README.md -``` -**Expected**: Only references to external validators, not DAG nodes - -**Step 3.3**: Verify node count -```bash -grep -c "\"id\":" config/dag.codex.json -``` -**Expected**: 13 nodes (not 15) - -**Step 3.4**: Run tests -```bash -npm test -``` -**Expected**: All tests pass - -**Step 3.5**: Run validation -```bash -npm run validate-all -``` -**Expected**: All validations pass - -### Phase 4: Cleanup - -**Step 4.1**: Delete backup branches (if merge successful) -```bash -git branch -D backup-main-before-merge -git branch -D backup-demo-live-before-merge -``` - -**Step 4.2**: Consider deleting demo/live branch -```bash -# Only if confident in merge and no longer need separate branch -git branch -D demo/live -git push origin --delete demo/live -``` -**Caution**: Only do this after thorough testing and validation - -### Phase 5: Deployment - -**Step 5.1**: Push to remote -```bash -git push origin main -``` - -**Step 5.2**: Verify remote -```bash -git log --oneline origin/main -1 -``` -**Expected**: Shows merge commit - -**Step 5.3**: Monitor CI/CD -```bash -# Check GitHub Actions for build/test status -``` -**Expected**: All checks pass - -## Risk Mitigation - -### Risk 1: Merge Conflicts -**Mitigation**: -- Systematic conflict resolution strategy -- Test each file after resolution -- Commit frequently during resolution - -### Risk 2: Architectural Regression -**Mitigation**: -- Post-merge validation steps -- Automated checks (grep for validator nodes) -- Manual review of DAG configuration - -### Risk 3: Test Failures -**Mitigation**: -- Run full test suite -- Run validation scripts -- Manual testing of key features - -### Risk 4: Deployment Issues -**Mitigation**: -- Monitor CI/CD closely -- Have rollback plan ready -- Test in staging environment first - -## Success Criteria - -Merge is considered successful when: - -- [ ] Merge completed without errors -- [ ] All conflicts resolved -- [ ] DAG configuration has no validator nodes -- [ ] README reflects 13-node DAG with correct architecture -- [ ] All tests pass -- [ ] All validations pass -- [ ] CI/CD checks pass -- [ ] Manual testing confirms features work - -## Rollback Plan - -If merge fails or introduces critical issues: - -**Option A**: Reset to backup -```bash -git reset --hard backup-main-before-merge -git push origin main --force -``` - -**Option B**: Revert merge -```bash -git revert -m 1 HEAD -git push origin main -``` - -**Option C**: Create fix branch -```bash -git checkout -b fix-merge-issues -# Make fixes -git checkout main -git merge fix-merge-issues -git push origin main -``` - -## Timeline Estimate - -- **Phase 1 (Preparation)**: 15 minutes -- **Phase 2 (Merge Execution)**: 60-120 minutes (depending on conflicts) -- **Phase 3 (Post-Merge Validation)**: 30 minutes -- **Phase 4 (Cleanup)**: 15 minutes -- **Phase 5 (Deployment)**: 30 minutes - -**Total**: 2-3 hours - -## Dependencies - -- Git access to afi-reactor repository -- Node.js/npm environment for running tests -- Access to GitHub Actions for monitoring CI/CD -- Understanding of AFI-Reactor architecture and DAG configuration - -## Notes - -- This is a complex merge that requires careful attention to architectural principles -- The validator architecture difference is fundamental and cannot be automatically resolved -- Manual testing is critical to ensure features work correctly after merge -- Consider creating a PR for review before merging to main if working in a team - -## References - -- [`AFI_REACTOR_MAIN_VS_DEMO_LIVE_ANALYSIS.md`](AFI_REACTOR_MAIN_VS_DEMO_LIVE_ANALYSIS.md) - Detailed branch comparison -- [`AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md`](AFI_REACTOR_BRANCH_ANALYSIS_REPORT.md) - Architectural guidelines -- [`afi-reactor/docs/BRANCH_DOCTRINE.v0.1.md`](afi-reactor/docs/BRANCH_DOCTRINE.v0.1.md) - Branch management principles -- [`afi-reactor/config/dag.codex.json`](afi-reactor/config/dag.codex.json) - DAG configuration -- [`afi-reactor/README.md`](afi-reactor/README.md) - Repository documentation - ---- - -**Plan Created**: 2025-12-26 -**Repository**: afi-reactor -**Branches**: main, demo/live -**Strategy**: Option 1 - Merge demo/live into main -**Status**: Ready for execution by Orchestrator mode \ No newline at end of file diff --git a/AFI_REPO_CENSUS.md b/AFI_REPO_CENSUS.md deleted file mode 100644 index f651703..0000000 --- a/AFI_REPO_CENSUS.md +++ /dev/null @@ -1,26 +0,0 @@ -# AFI Repo Census - -| Repo Folder | Detected Type | Last Modified (best effort) | Purpose (from README or structure) | -| --- | --- | --- | --- | -| ElizaOS_Ext_Ref | unknown | 2025-12-06 | No README found (external reference assets) | -| Spartan_reference | unknown | 2025-12-04 | No README found (reference materials) | -| _archived | unknown | 2025-12-04 | No README found (archived content) | -| afi-artifacts | node/ts | 2025-11-26 | AFI Artifacts β€” Paper Reproducibility Bundle (snapshot: paper-2025-v2.2) | -| afi-benchkit | python | 2025-11-20 | AFI BenchKit | -| afi-config | node/ts | 2025-12-16 | afi-config | -| afi-core | node/ts | 2025-12-16 | 🧠 AFI Core | -| afi-docs | unknown | 2025-12-02 | AFI Protocol Documentation πŸ“š | -| afi-econ | node/ts/python | 2025-11-20 | afi-econ-kit | -| afi-gateway | node/ts | 2025-12-08 | afi-gateway | -| afi-factory | node/ts | 2025-11-26 | AFI‑Factory | -| afi-governance | node/ts | 2025-11-26 | AFI Governance – Agentic Financial Intelligence | -| afi-infra | node/ts | 2025-12-14 | afi-infra | -| afi-math | node/ts | 2025-12-16 | AFI Math | -| afi-mint | node/ts/solidity | 2025-12-07 | AFI Mint – Signal-Driven Token Minting Pipeline | -| afi-protocol | node/ts | 2025-11-24 | AFI Protocol (Meta‑Repo) | -| afi-reactor | node/ts | 2025-12-17 | AFI-Reactor ⚑ | -| afi-research-site | node/ts | 2025-11-24 | AFI Research Site | -| afi-tiny-brains | python | 2025-12-13 | Tiny Brains Service | -| afi-token | node/ts/solidity | 2025-11-28 | AFI Token Protocol | -| augmentcode_rules | unknown | 2025-12-06 | No README found (augment code rules/config) | -| scripts | unknown | 2025-12-11 | No README found (shared scripts) | diff --git a/AFI_Repository_Map.md b/AFI_Repository_Map.md deleted file mode 100644 index 1623ee6..0000000 --- a/AFI_Repository_Map.md +++ /dev/null @@ -1,161 +0,0 @@ -# AFI Repository Map - -## Core Repositories - -### afi-core -- **Purpose**: Core protocol implementation and shared utilities -- **Language**: TypeScript -- **Key Components**: - - Protocol definitions - - Shared types and interfaces - - Core business logic - - Validation utilities - -### afi-gateway -- **Purpose**: Gateway service for signal ingestion and routing -- **Language**: TypeScript -- **Key Components**: - - Signal ingestion endpoints - - Request routing - - Authentication and authorization - - Rate limiting - - Telemetry integration - -### afi-pipeline -- **Purpose**: Signal processing pipeline with DAG execution -- **Language**: TypeScript -- **Key Components**: - - DAG execution engine - - Stage processors - - Mapper implementations - - Validator implementations - - Vault persistence layer - -### afi-reactor -- **Purpose**: Reactor service for real-time signal processing -- **Language**: TypeScript -- **Key Components**: - - Real-time signal ingestion - - Stream processing - - Event-driven architecture - - Integration with pipeline - -## Agent Repositories - -### afi-factory -- **Purpose**: Pipeline authoring system (afi-governance `decisions/factory-configurable-pipelines-v1.md`) -- **Language**: TypeScript -- **Key Components**: - - Pipeline template authoring (`afi.pipeline-template.v1`) - - Template instantiation to `afi.pipeline.v1` manifests - - Manifest validation against the governed afi-config contracts - - Canonical (timestamp-free) hashing - -## Economic System - -### afi-econ -- **Purpose**: Economic simulation and analysis tools -- **Language**: TypeScript/Python -- **Key Components**: - - Economic models - - Simulation tools - - Reward distribution - - Token economics - -### afi-governance -- **Purpose**: Governance system for AFI protocol -- **Language**: TypeScript -- **Key Components**: - - Proposal submission - - Voting mechanisms - - Proposal validation - - Governance rules - -## Testing & Benchmarking - -### afi-benchkit -- **Purpose**: Benchmarking and testing toolkit -- **Language**: Python -- **Key Components**: - - Benchmarking tools - - Test harnesses - - Metrics collection - - Performance analysis - -### afi-tiny-brains -- **Purpose**: Machine learning models for signal analysis -- **Language**: Python -- **Key Components**: - - ML model implementations - - Training scripts - - Model evaluation - - Prediction services - -## Documentation & Assets - -### afi-docs -- **Purpose**: Documentation site -- **Language**: Markdown/Mintlify -- **Key Components**: - - API documentation - - User guides - - Architecture documentation - - Tutorials - -### afi-artifacts -- **Purpose**: Research artifacts and reproducibility -- **Language**: Various -- **Key Components**: - - Research papers - - Datasets - - Reproducibility scripts - - Citation metadata - -## Configuration - -### afi-config -- **Purpose**: Configuration management -- **Language**: TypeScript/JSON -- **Key Components**: - - Configuration schemas - - Environment configurations - - Deployment configs - - Feature flags - -## Repository Interdependencies - -``` -afi-core - ↓ -afi-gateway β†’ afi-reactor - ↓ -afi-factory - ↓ -afi-econ β†’ afi-governance - ↓ -afi-benchkit β†’ afi-tiny-brains - ↓ -afi-docs ← afi-artifacts - ↑ -afi-config (all repos) -``` - -## Key Integration Points - -1. **Gateway to Reactor**: afi-gateway forwards USS v1.1 signals to afi-reactor for Froggy scoring (canonical spine β€” the legacy `afi-pipeline` hop no longer exists) -2. **Factory**: afi-factory provides pipeline/template authoring, manifest validation, and canonical hashing (the standalone agents repo no longer exists) -3. **Econ to Governance**: afi-econ provides economic data to afi-governance -4. **Benchkit to Tiny Brains**: afi-benchkit tests models from afi-tiny-brains -5. **Config to All**: afi-config provides configuration to all repositories - -## Development Workflow - -1. **Core Development**: Start with afi-core for protocol changes -2. **Gateway Integration**: Update afi-gateway for new endpoints -3. **Reactor Updates**: Modify afi-reactor for new scoring/pipeline stages -4. **Pipeline Authoring**: Use afi-factory to author and validate pipeline manifests -5. **Economic Modeling**: Update afi-econ and afi-governance for economic changes -6. **Testing**: Use afi-benchkit and afi-tiny-brains for testing -7. **Documentation**: Update afi-docs with changes -8. **Artifacts**: Add research artifacts to afi-artifacts -9. **Configuration**: Update afi-config for new configurations diff --git a/AUGMENTCODE_SCARLET_ERADICATION_REPORT.md b/AUGMENTCODE_SCARLET_ERADICATION_REPORT.md deleted file mode 100644 index 9c7b574..0000000 --- a/AUGMENTCODE_SCARLET_ERADICATION_REPORT.md +++ /dev/null @@ -1,606 +0,0 @@ -# AFI Modular Repositories - Augmentcode & Scarlet Eradication Report - -**Date**: 2025-12-31 -**Auditor**: Automated Audit -**Scope**: Comprehensive search and eradication plan for "augmentcode" and "Scarlet" references across all AFI repositories - ---- - -## Executive Summary - -**Overall Status**: ⚠️ **EXTERNAL REFERENCES IDENTIFIED** - -This report documents all occurrences of "augmentcode" and "Scarlet" references across the AFI Modular Repositories. These appear to be external entity references that should be removed or replaced with appropriate AFI project identifiers. - -**Priority**: HIGH - External references should be removed to maintain project independence and clarity. - ---- - -## Summary Statistics - -| Reference Type | Total Occurrences | Repositories Affected | Files Affected | -|----------------|-------------------|----------------------|----------------| -| augmentcode | 15 | 3 | 15 | -| Scarlet | 8 | 8 | 8 | -| **Total** | **23** | **8** | **23** | - ---- - -## Part 1: augmentcode References - -### Overview - -**Total augmentcode references**: 15 occurrences across 3 repositories - -**Repositories affected**: -- afi-reactor (6 files) -- afi-infra (8 files) - -### Detailed Findings - -#### 1. afi-reactor Repository (6 occurrences) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-reactor/AGENTS.md` | 4 | `Maintained by: augmentcode` | Documentation | Replace with AFI team | -| `afi-reactor/codex/.afi-codex.json` | 4 | `"trackedBy": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-reactor/config/agents.codex.json` | 4 | `"maintainer": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-reactor/config/dag.codex.json` | 4 | `"maintainedBy": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-reactor/config/schema.codex.json` | 4 | `"maintainedBy": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-reactor/config/ops.codex.json` | 4 | `"trackedBy": "augmentcode"` | Metadata | Replace with AFI team | - -**Impact**: HIGH - Core documentation and metadata files contain external references. - -**Recommended Replacement**: Replace with "AFI Team" or remove the field if not required. - ---- - -#### 2. afi-infra Repository (8 occurrences) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-infra/afi-codex/signal_analysis_schema.afi-codex.json` | 4 | `"created_by": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-infra/afi-codex/signal_enrichment_schema.afi-codex.json` | 4 | `"created_by": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-infra/afi-codex/signal_feedback_schema.afi-codex.json` | 4 | `"created_by": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-infra/afi-codex/signal_finalization_schema.afi-codex.json` | 4 | `"created_by": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-infra/afi-codex/signal_scoring_schema.afi-codex.json` | 4 | `"created_by": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-infra/afi-codex/signal_transmission_schema.afi-codex.json` | 4 | `"created_by": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-infra/afi-codex/validator_metadata_schema.afi-codex.json` | 4 | `"created_by": "augmentcode"` | Metadata | Replace with AFI team | -| `afi-infra/.afi-codex.json` | 4 | `"trackedBy": "augmentcode"` | Metadata | Replace with AFI team | - -**Impact**: HIGH - All schema files contain external creator references. - -**Recommended Replacement**: Replace with "AFI Team" or remove the field if not required. - ---- - -## Part 2: Scarlet References - -### Overview - -**Total Scarlet references**: 8 occurrences across 8 repositories - -**Repositories affected**: -- afi-reactor (1 file) -- afi-infra (1 file) -- afi-factory (1 file) -- afi-governance (1 file) -- afi-docs (1 file) -- _archived (1 file) -- afi-core (1 file) -- afi-artifacts (1 file) - -### Detailed Findings by Repository - -#### 1. afi-reactor Repository (1 occurrence) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-reactor/AGENTS.md` | 4 | `Maintained by: Scarlet` | Documentation | Replace with AFI team | - -**Impact**: HIGH - Core documentation file. - -**Recommended Replacement**: Replace with "AFI Team" or remove the maintainer line. - ---- - -#### 2. afi-infra Repository (1 occurrence) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-infra/AGENTS.md` | 4 | `Maintained by: Scarlet` | Documentation | Replace with AFI team | - -**Impact**: HIGH - Core documentation file. - -**Recommended Replacement**: Replace with "AFI Team" or remove the maintainer line. - ---- - -#### 3. afi-factory Repository (1 occurrence) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-factory/AGENTS.md` | 4 | `Maintained by: Scarlet` | Documentation | Replace with AFI team | - -**Impact**: HIGH - Core documentation file. - -**Recommended Replacement**: Replace with "AFI Team" or remove the maintainer line. - ---- - -#### 4. afi-governance Repository (1 occurrence) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-governance/AGENTS.md` | 4 | `Maintained by: Scarlet` | Documentation | Replace with AFI team | - -**Impact**: HIGH - Core documentation file. - -**Recommended Replacement**: Replace with "AFI Team" or remove the maintainer line. - ---- - -#### 5. afi-docs Repository (1 occurrence) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-docs/cli_help.md` | ~ | CLI usage example | Documentation | Update example | - -**Impact**: LOW - Documentation example. - -**Recommended Replacement**: Update example to use AFI-native commands or remove reference. - ---- - -#### 6. _archived Repository (1 occurrence) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `_archived/DROID_OPTIMIZATION_SUMMARY.md` | ~ | Historical reference | Documentation | No action needed (archived) | - -**Impact**: NONE - Archived file. - -**Recommended Action**: No action required for archived content. - ---- - -#### 7. afi-core Repository (1 occurrence) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-core/AGENTS.md` | 4 | `Maintained by: Scarlet` | Documentation | Replace with AFI team | - -**Impact**: HIGH - Core documentation file. - -**Recommended Replacement**: Replace with "AFI Team" or remove the maintainer line. - ---- - -#### 8. afi-artifacts Repository (1 occurrence) - -| File | Line | Context | Field | Action Required | -|------|------|---------|-------|-----------------| -| `afi-artifacts/AGENTS.md` | 4 | `Maintained by: Scarlet` | Documentation | Replace with AFI team | - -**Impact**: HIGH - Core documentation file. - -**Recommended Replacement**: Replace with "AFI Team" or remove the maintainer line. - ---- - -## Part 3: Consolidated Action Plan - -### Priority 1: CRITICAL (Fix Immediately) - -#### Task 1: Update AGENTS.md Files (6 files) - -**Files to update**: -1. `afi-reactor/AGENTS.md` - Line 4 -2. `afi-infra/AGENTS.md` - Line 4 -3. `afi-factory/AGENTS.md` - Line 4 -4. `afi-governance/AGENTS.md` - Line 4 -5. `afi-core/AGENTS.md` - Line 4 -6. `afi-artifacts/AGENTS.md` - Line 4 - -**Action**: Replace maintainer line with AFI team reference or remove entirely. - -**Example change**: -```markdown -# Before -Maintained by: Scarlet - -# After (Option 1) -Maintained by: AFI Team - -# After (Option 2) -# Remove the line entirely -``` - ---- - -#### Task 2: Update .afi-codex.json Files (2 files) - -**Files to update**: -1. `afi-reactor/codex/.afi-codex.json` - Line 4 -2. `afi-infra/.afi-codex.json` - Line 4 - -**Action**: Replace trackedBy field with AFI team reference. - -**Example change**: -```json -// Before -"trackedBy": "augmentcode" - -// After (Option 1) -"trackedBy": "AFI Team" - -// After (Option 2) -"trackedBy": "afi-protocol" -``` - ---- - -#### Task 3: Update config/*.codex.json Files (4 files) - -**Files to update**: -1. `afi-reactor/config/agents.codex.json` - Line 4 -2. `afi-reactor/config/dag.codex.json` - Line 4 -3. `afi-reactor/config/schema.codex.json` - Line 4 -4. `afi-reactor/config/ops.codex.json` - Line 4 - -**Action**: Replace maintainer/maintainedBy field with AFI team reference. - -**Example change**: -```json -// Before -"maintainer": "augmentcode" -"maintainedBy": "augmentcode" - -// After (Option 1) -"maintainer": "AFI Team" -"maintainedBy": "AFI Team" - -// After (Option 2) -"maintainer": "afi-protocol" -"maintainedBy": "afi-protocol" -``` - ---- - -### Priority 2: HIGH (Fix Soon) - -#### Task 4: Update afi-infra Schema Files (7 files) - -**Files to update**: -1. `afi-infra/afi-codex/signal_analysis_schema.afi-codex.json` - Line 4 -2. `afi-infra/afi-codex/signal_enrichment_schema.afi-codex.json` - Line 4 -3. `afi-infra/afi-codex/signal_feedback_schema.afi-codex.json` - Line 4 -4. `afi-infra/afi-codex/signal_finalization_schema.afi-codex.json` - Line 4 -5. `afi-infra/afi-codex/signal_scoring_schema.afi-codex.json` - Line 4 -6. `afi-infra/afi-codex/signal_transmission_schema.afi-codex.json` - Line 4 -7. `afi-infra/afi-codex/validator_metadata_schema.afi-codex.json` - Line 4 - -**Action**: Replace created_by field with AFI team reference. - -**Example change**: -```json -// Before -"created_by": "augmentcode" - -// After (Option 1) -"created_by": "AFI Team" - -// After (Option 2) -"created_by": "afi-protocol" -``` - ---- - -### Priority 3: MEDIUM (Review and Decide) - -#### Task 5: Update Documentation Examples - -**Files to update**: -1. `afi-docs/cli_help.md` - Update CLI usage example - -**Action**: Update example to use AFI-native commands or remove reference. - ---- - -## Part 4: Implementation Strategy - -### Phase 1: Quick Wins (Immediate) - -**Timeline**: 1-2 hours - -**Tasks**: -1. Update all AGENTS.md files (8 files) -2. Update all .afi-codex.json files (3 files) -3. Update all config/*.codex.json files (4 files) - -**Total Files**: 15 - -**Commands**: -```bash -# Update AGENTS.md files -find . -name "AGENTS.md" -type f -exec sed -i '' 's/Maintained by: Scarlet/Maintained by: AFI Team/g' {} \; -find . -name "AGENTS.md" -type f -exec sed -i '' 's/Maintained by: augmentcode/Maintained by: AFI Team/g' {} \; - -# Update .afi-codex.json files -find . -name ".afi-codex.json" -type f -exec sed -i '' 's/"trackedBy": "augmentcode"/"trackedBy": "AFI Team"/g' {} \; - -# Update config/*.codex.json files -find . -path "*/config/*.codex.json" -type f -exec sed -i '' 's/"maintainer": "augmentcode"/"maintainer": "AFI Team"/g' {} \; -find . -path "*/config/*.codex.json" -type f -exec sed -i '' 's/"maintainedBy": "augmentcode"/"maintainedBy": "AFI Team"/g' {} \; -``` - ---- - -### Phase 2: Schema Updates (Soon) - -**Timeline**: 1-2 hours - -**Tasks**: -1. Update all afi-infra schema files (7 files) - -**Total Files**: 7 - -**Commands**: -```bash -# Update schema files -find afi-infra/afi-codex -name "*.afi-codex.json" -type f -exec sed -i '' 's/"created_by": "augmentcode"/"created_by": "AFI Team"/g' {} \; -``` - ---- - -### Phase 3: Documentation Updates (Low Priority) - -**Timeline**: 30 minutes - -**Tasks**: -1. Update afi-docs/cli_help.md - -**Total Files**: 1 - ---- - -## Part 5: Risk Assessment - -### Low Risk Changes - -- AGENTS.md updates (documentation only) -- .afi-codex.json updates (metadata only) -- config/*.codex.json updates (metadata only) -- afi-infra schema updates (metadata only) - -**Risk Level**: LOW -**Impact**: None - These are metadata/documentation changes only - ---- - -### High Risk Changes - -- None identified - ---- - -## Part 6: Validation Plan - -### Pre-Change Validation - -1. **Backup**: Create backup of all files before changes -2. **Test**: Run existing tests to ensure baseline functionality -3. **Document**: Document current state for rollback if needed - -### Post-Change Validation - -1. **Syntax Check**: Verify JSON files are valid after changes -2. **Build Test**: Run build process to ensure no breaking changes -3. **Test Suite**: Run full test suite -4. **Documentation Review**: Verify documentation is accurate after changes -5. **Integration Test**: Test integrations if scarlett is modified - ---- - -## Part 7: Rollback Plan - -If issues arise after changes: - -1. **Immediate Rollback**: Restore from backup -2. **Partial Rollback**: Rollback specific problematic changes -3. **Investigation**: Analyze root cause of issues -4. **Re-implementation**: Fix issues and re-apply changes - ---- - -## Part 8: Recommendations - -### Immediate Actions - -1. βœ… **Approve eradication plan** - Get team approval for this plan -2. βœ… **Create backups** - Backup all affected files -3. βœ… **Execute Phase 1** - Update AGENTS.md and .afi-codex.json files -4. βœ… **Execute Phase 2** - Update schema files -5. βœ… **Validate changes** - Run tests and verify functionality - -### Short-Term Actions (This Week) - -1. πŸ”„ **Update documentation** - Execute Phase 3 - -### Long-Term Actions (Next Sprint) - -1. πŸ“‹ **Establish guidelines** - Create guidelines for external references -2. πŸ“‹ **Add CI checks** - Add CI checks to prevent future external references -3. πŸ“‹ **Review other references** - Check for other external references - ---- - -## Part 9: Success Criteria - -### Phase 1 Success Criteria - -- [ ] All AGENTS.md files updated (8 files) -- [ ] All .afi-codex.json files updated (3 files) -- [ ] All config/*.codex.json files updated (4 files) -- [ ] No "augmentcode" or "Scarlet" references in updated files -- [ ] All JSON files are valid -- [ ] Build process succeeds -- [ ] All tests pass - -### Phase 2 Success Criteria - -- [ ] All afi-infra schema files updated (7 files) -- [ ] No "augmentcode" references in schema files -- [ ] All JSON files are valid -- [ ] Build process succeeds -- [ ] All tests pass - -### Phase 3 Success Criteria - -- [ ] Documentation examples updated -- [ ] No external references in documentation -- [ ] Documentation is accurate - ---- - -## Part 10: Summary - -### Total Work Required - -| Phase | Files | Estimated Time | Risk Level | -|-------|-------|----------------|------------| -| Phase 1 | 15 | 1-2 hours | LOW | -| Phase 2 | 7 | 1-2 hours | LOW | -| Phase 3 | 1 | 30 minutes | LOW | -| **Total** | **23** | **2.5-4.5 hours** | **LOW** | - -### Key Decisions Needed - -1. **Timeline**: When should changes be completed? - -### Next Steps - -1. Review this eradication report with the AFI team -2. Approve the eradication plan -3. Execute Phase 1 and Phase 2 (low-risk changes) -4. Execute Phase 3 (documentation updates) -5. Validate all changes -6. Update documentation and guidelines - ---- - -**Report Generated**: 2025-12-31 -**Audited Version**: All AFI repositories -**Next Review**: After eradication completion - ---- - -## Appendix A: File Inventory - -### augmentcode References (15 files) - -``` -afi-reactor/AGENTS.md -afi-reactor/codex/.afi-codex.json -afi-reactor/config/agents.codex.json -afi-reactor/config/dag.codex.json -afi-reactor/config/schema.codex.json -afi-reactor/config/ops.codex.json -afi-infra/afi-codex/signal_analysis_schema.afi-codex.json -afi-infra/afi-codex/signal_enrichment_schema.afi-codex.json -afi-infra/afi-codex/signal_feedback_schema.afi-codex.json -afi-infra/afi-codex/signal_finalization_schema.afi-codex.json -afi-infra/afi-codex/signal_scoring_schema.afi-codex.json -afi-infra/afi-codex/signal_transmission_schema.afi-codex.json -afi-infra/afi-codex/validator_metadata_schema.afi-codex.json -afi-infra/.afi-codex.json -``` - -### Scarlet References (8 files) - -``` -afi-reactor/AGENTS.md -afi-infra/AGENTS.md -afi-factory/AGENTS.md -afi-governance/AGENTS.md -afi-core/AGENTS.md -afi-artifacts/AGENTS.md -afi-docs/cli_help.md -_archived/DROID_OPTIMIZATION_SUMMARY.md -``` - ---- - -## Appendix B: Search Commands Used - -```bash -# Search for augmentcode -grep -r "augmentcode" --include="*.md" --include="*.json" --include="*.ts" --include="*.js" --include="*.yaml" --include="*.yml" . - -# Search for Scarlet -grep -r "Scarlet" --include="*.md" --include="*.json" --include="*.ts" --include="*.js" --include="*.yaml" --include="*.yml" . -``` - ---- - -## Appendix C: Replacement Patterns - -### Pattern 1: AGENTS.md Maintainer Line - -```bash -# Find -Maintained by: Scarlet -Maintained by: augmentcode - -# Replace with (Option 1) -Maintained by: AFI Team - -# Replace with (Option 2) -# Remove the line entirely -``` - -### Pattern 2: .afi-codex.json trackedBy Field - -```bash -# Find -"trackedBy": "augmentcode" - -# Replace with (Option 1) -"trackedBy": "AFI Team" - -# Replace with (Option 2) -"trackedBy": "afi-protocol" -``` - -### Pattern 3: config/*.codex.json maintainer Field - -```bash -# Find -"maintainer": "augmentcode" -"maintainedBy": "augmentcode" - -# Replace with (Option 1) -"maintainer": "AFI Team" -"maintainedBy": "AFI Team" - -# Replace with (Option 2) -"maintainer": "afi-protocol" -"maintainedBy": "afi-protocol" -``` - -### Pattern 4: Schema created_by Field - -```bash -# Find -"created_by": "augmentcode" - -# Replace with (Option 1) -"created_by": "AFI Team" - -# Replace with (Option 2) -"created_by": "afi-protocol" -``` - ---- - -**End of Report** diff --git a/README.md b/README.md index 97615b8..d3bb091 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,6 @@ gitbook serve # open http://localhost:4000 | Institute reference services β€” Gateway & oracle-ingress (v0.1) | [`specs/AFI_RESEARCH_INSTITUTE_REFERENCE_SERVICES.v0.1.md`](specs/AFI_RESEARCH_INSTITUTE_REFERENCE_SERVICES.v0.1.md) | | Understand agent lifecycle & mentors | [`specs/mentor_protocol.md`](specs/mentor_protocol.md) | | Explore the Modal (PoInt testbed) | [`specs/modal.md`](specs/modal.md) | -| Onboard as a validator | [`guides/validator.md`](guides/validator.md) | -| Automate with Factory droids | [`guides/factory.md`](guides/factory.md) | | Dive into Signal-Lore | [`/lore`](lore/) | --- diff --git a/SUMMARY.md b/SUMMARY.md index b946e05..8633fc5 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -1,21 +1,14 @@ # Summary * [Overview](README.md) -* [FAQ](faq.md) ## πŸ› οΈ Developer Guides * [Quickstart](guides/quickstart.md) -* [Local Dev Setup](guides/dev_setup.md) -* [Validator Onboarding](guides/validator.md) -* [CI/CD & Factory Droids](guides/factory.md) ## πŸ“ Core Specs -* [Architecture](specs/architecture.md) +* [Architecture](AFI_Full_Architecture.md) * [Mentor Protocol (Agent Lifecycle)](specs/mentor_protocol.md) * [The Modal (Proof-of-Intelligence Arena)](specs/modal.md) -* [Modules & Repos](specs/modules.md) -* [Tokenomics](specs/tokenomics.md) -* [Governance](specs/governance.md) * [Research Institute Reference Services v0.1](specs/AFI_RESEARCH_INSTITUTE_REFERENCE_SERVICES.v0.1.md) * [Provider Adapter and BYOK Foundations v0.1](specs/AFI_PROVIDER_BYOK_FOUNDATIONS.v0.1.md) diff --git a/agentic_legos_architecture_analysis.md b/agentic_legos_architecture_analysis.md deleted file mode 100644 index dd03f36..0000000 --- a/agentic_legos_architecture_analysis.md +++ /dev/null @@ -1,172 +0,0 @@ -# AFI Agentic Legos Architecture Analysis - -> ⚠️ Historical snapshot. The legacy Froggy demo chain (Alpha Scout β†’ Pixel Rick β†’ Val Dook β†’ Execution Sim) was removed; the reactor is scored-only, executing analyst-configurable `afi.pipeline.v1` manifests from the governed afi-config registries (see `ARCHITECTURE_STATUS.md`; decision: afi-governance `decisions/factory-configurable-pipelines-v1.md`). - -## Executive Summary - -The AFI Protocol implements an "agentic legos" architecture where modular components (skills, agents, droids) can be assembled into intelligent systems. This analysis clarifies the relationships between afi-math, afi-benchkit, afi-core, and afi-reactor, along with the broader agent universe, agent playbook, and current implementation status. - -## Core Relationships - -### Repository Dependencies - -```mermaid -graph TD - A[afi-config] --> B[afi-core] - A --> C[afi-reactor] - A --> E[afi-factory] - - B --> F[afi-math] - B --> G[afi-benchkit] - - C --> B - - J[afi-gateway] --> C - J --> B - - K[afi-token] --> L[afi-mint] - L --> M[afi-governance] -``` - -### Agentic Legos Concept - -**Agentic Legos** refers to the modular assembly of: -- **Skills**: Reusable capabilities with typed I/O -- **Agents**: ElizaOS personas that execute skills -- **Droids**: Automated workers that maintain the system -- **Orchestration** (afi-reactor): DAG-based pipeline coordination - -## Detailed Component Analysis - -### afi-core (Runtime Implementation) -- **Purpose**: Core runtime for validators, scoring, signal processing -- **Dependencies**: - - afi-config: Schemas and governance rules - - afi-math: Mathematical functions for scoring/decay -- **Consumed by**: afi-reactor (orchestration), afi-gateway (types/clients) -- **Current Status**: Implements validator logic, signal scoring, enrichment adapters - -### afi-math (Pure Mathematics) -- **Purpose**: Mathematical primitives for AFI Protocol -- **Provides**: Decay curves, UWR calculations, time-value functions -- **Consumed by**: afi-core (validator scoring) -- **Current Status**: TypeScript implementation with comprehensive tests - -### afi-benchkit (Benchmarking Toolkit) -- **Purpose**: Performance benchmarking for validators -- **Benchmarks**: PoI (Proof-of-Intelligence), PoInsight (Proof-of-Insight) scoring -- **Dependencies**: Consumes afi-core validator outputs -- **Current Status**: Python toolkit with deterministic harness, golden outputs - -### afi-reactor (DAG Orchestrator) -- **Purpose**: 15-node signal processing pipeline orchestration -- **Architecture**: DAG-based with generators β†’ analyzers β†’ scorers β†’ validators β†’ executors -- **Dependencies**: afi-core (validators), afi-config (schemas) -- **Current Status**: Active development with branch divergence; validators incorrectly placed in DAG (should be external) - -## Agent Universe Architecture - -### Agent Types - -```mermaid -graph TD - A[ElizaOS Agents] --> B[Phoenix - Front-door concierge] - A --> C[Alpha - Signal scout] - A --> D[Froggy - Strategy scorer] - A --> E[Val Dook - Signal validator] - A --> F[Pixel Rick - Enrichment architect] - - G[Droids] --> H[Code maintainers] - G --> I[CI/CD workers] - G --> J[Automated reviewers] - - K[Agentic Legos Assembly] - K --> A - K --> G - K --> M[Orchestration via afi-reactor] -``` - -### Agent Playbook (Runtime Governance) - -The **Agent Playbook** governs ElizaOS agents that interact with AFI: - -**Core Rules:** -1. **AFI is source of truth** - Agents call AFI APIs, don't reimplement logic -2. **Gateway boundary** - All AFI calls through afi-gateway -3. **Explicit sourcing** - Mark AFI data vs agent interpretation -4. **Safety over cleverness** - Admit uncertainty, no guessing -5. **No secrets/keys** - Agents aren't secure vaults - -**Agent Roles:** -- **Phoenix**: Explains AFI, provides access to signals/scores -- **Mentor Agents**: Guide contributors through AFI workflows -- **Validator Agents**: Assist human validators with signal review - -### Droid Governance - -**Droids** are automated workers governed by the **Droid Charter**: -- Build and maintain AFI repos -- Operate in Git, CI/CD environments -- Follow strict rules about what they can/cannot modify -- Never interact directly with end users - -**Coordination Contract:** -- Droids shape the machine (code, APIs, schemas) -- Agents speak for the machine (explain to users, call APIs) -- Agents don't edit code; droids don't talk to users - -## Current Implementation Status - -### Repository Maturity Levels - -| Repository | Status | Key Features | Gaps | -|------------|--------|--------------|------| -| afi-core | HIGH | Validators, scoring, enrichment | Full integration testing | -| afi-math | HIGH | Decay models, UWR calc | Performance optimization | -| afi-benchkit | MEDIUM | PoI/PoInsight benchmarks | Integration with afi-core | -| afi-reactor | MEDIUM | DAG orchestration | Validator externalization, branch merge | -| afi-config | HIGH | Schemas, governance | Complete coverage | -| afi-factory | LOW | Templates, manifests | Implementation | -| afi-gateway | MEDIUM | Agent runtime | Full AFI integration | - -### Critical Issues - -1. **Validator Architecture Violation**: afi-reactor places validators as DAG nodes instead of external services -2. **Branch Divergence**: afi-reactor has unmerged feature branches with TSSD, Provenance, Replay -3. **Agent Assembly**: Factory templates exist but agent spawning logic incomplete - -## Intended Design vs Current State - -### Intended Agentic Legos Design - -``` -Skills β†’ Factory Templates (afi-factory) β†’ Agent Assembly β†’ Orchestration (afi-reactor) - ↓ - ElizaOS Runtime (afi-gateway) - ↓ - Human Interaction (Agent Playbook) -``` - -### Current State Gaps - -- **Skill Execution**: Skills defined but not fully executable in runtime -- **Agent Factory**: Templates exist but spawning logic incomplete -- **Orchestration Maturity**: DAG works but advanced features (TSSD, Replay) not merged -- **Integration Testing**: Cross-repo integration not fully validated - -## Recommendations - -### Immediate Actions -1. **Fix Validator Architecture**: Remove validators from afi-reactor DAG, implement as external services -2. **Merge afi-reactor Branches**: Consolidate TSSD, Provenance, Replay features into main -3. **Factory Implementation**: Complete agent spawning logic in afi-factory - -### Long-term Vision -1. **Complete Agentic Legos**: Full skill β†’ agent β†’ orchestration pipeline -2. **Enhanced Benchmarking**: afi-benchkit integrated into CI/CD for all validators -3. **Runtime Skill Execution**: Skills executable in both DAG nodes and agent contexts -4. **Unified Governance**: Seamless coordination between droids and agents - -## Conclusion - -The AFI agentic legos architecture provides a solid foundation for modular intelligence assembly, with clear separation between skills (capabilities), agents (personas), droids (workers), and orchestration (coordination). Current implementation shows strong core components (afi-core, afi-math, afi-config) with gaps in integration and advanced features. The architecture supports the intended design but requires focused work on validator externalization, branch consolidation, and runtime skill execution to achieve full agentic legos capability. \ No newline at end of file diff --git a/reports/afi-signal-evaluation-pipehead-system-report.md b/reports/afi-signal-evaluation-pipehead-system-report.md deleted file mode 100644 index 26c7715..0000000 --- a/reports/afi-signal-evaluation-pipehead-system-report.md +++ /dev/null @@ -1,358 +0,0 @@ -# Report β€” AFI Signal Evaluation Pipehead System (non-production POC) - -**Date:** 2026-06-30 -**Repo (implementation):** `afi-reactor` β€” branch `mission/afi-signal-evaluation-pipehead-system` -**Repo (this report):** `afi-docs` β€” branch `mission/afi-signal-evaluation-pipehead-system` -**Type:** Determinism / plumbing proof-of-concept (POC). Demo-only β€” implements no production surface. -**Governance:** Subordinate to `AFI_DROID_CHARTER.v0.1.md` and `AFI_DROID_PIPEHEAD_ADDENDUM.v0.1.md`. Where this report conflicts with governance, governance wins. -**Merge status (2026-07-01 reconciliation):** afi-reactor PR #33 is **merged** to `main` (merge commit `dd15287`, 2026-06-30); the afi-config Pipehead Addendum is **merged** via PR #12 + #13 (`codex/governance/droids/AFI_DROID_PIPEHEAD_ADDENDUM.v0.1.md`). This afi-docs report (PR #5) is the remaining open reconciliation item. The "no changes to afi-config" note below refers to the reactor implementation footprint only; the governance addendum shipped through its own afi-config PRs. - -> **Status: non-production POC / demo.** Nothing in this system is intended for production use, and no output is canonical protocol truth. All scored output, receipts, and audit records are explicitly **demo-only / provisional**. This report describes the code that actually shipped, and records the real gate and demo outcomes captured while writing it. - ---- - -## 1. Executive summary - -This mission made AFI's signal-evaluation DAG **Droid-operable** as a self-contained set of "pipeheads" in `afi-reactor`, **without** making Droids the source of financial truth. Droids operate the machinery β€” schema validation, a five-lane analysis fan-out, fan-in normalization, scoring invocation, a demo receipt, and a content-hashed audit record β€” while the **deterministic kernel** (the afi-core Froggy trend-pullback UWR scorer) remains the source of truth and is **invoked, never replaced**. - -The deliverable is additive and minimal-footprint: all new code lives under `afi-reactor/src/pipeheads/**`, a CLI demo entrypoint, and tests/fixtures under `test/pipeheads/**`, plus a scoped typecheck config and a scoped ESM gate. The only existing file edited is `jest.config.js` (a `testMatch` allowlist addition). No changes were made to `afi-core`, `afi-math`, or `afi-config`, and no scoring/UWR/reputation/token/settlement logic was touched. - -The system preserves the five-lane interface (`technical-indicators`, `pattern-recognition`, `news`, `social`, `ai-ml`) at all times. Two lanes are **wired** (real deterministic math over committed fixture OHLCV); three lanes (`news`, `social`, `ai-ml`) are **provisional** committed fixtures, explicitly labeled. Determinism is mandatory and proven: identical input β‡’ identical output β‡’ identical content hash, anchored to a committed golden fixture. - -Two trust-relevant afi-reactor modules could not be reused **offline**, so self-contained equivalents were used behind clean seams (recorded as Decision Records DR-001 and DR-002 in the mission `AGENTS.md`, and summarized in Β§8 below): the canonical USS validator (blocked by `ajv`/`ajv-formats`) and the canonical technical-indicator kernel (blocked by `trading-signals`). Scoring itself stays 100% afi-core. Both have a documented future restoration path. - -All three verification gates were run while writing this report and passed: scoped typecheck clean, scoped ESM check clean, and `npm test` green at **644 tests / 25 suites** (425 baseline + new pipehead tests). The CLI demo runs offline, exits `0`, and prints an identical `outputHash` across two runs. - ---- - -## 2. Files changed - -All paths are in `afi-reactor` unless noted. Everything below is **new** except `jest.config.js` (modified) and this report + the system doc (new, in their respective repos). - -### Pipehead implementation β€” `src/pipeheads/` (new) - -| File | Role | -| --- | --- | -| `src/pipeheads/types.ts` | Mission-local contracts (`Pipehead`, `AnalysisLaneResult`, `AnalysisBundle`, `DemoScoredSignal`, `DemoReputationReceipt`, `AuditRecord`, the five canonical lane ids). | -| `src/pipeheads/clock.ts` | Injectable frozen-clock factory (`createFrozenClock`, `FROZEN_CLOCK_ISO`) β€” timestamps are human-only and excluded from hashes. | -| `src/pipeheads/canonicalHash.ts` | Recursive key-sorted canonicalizer + sha256 (`canonicalize`, `canonicalHash`, `buildScoringProjection`, `EXCLUDED_TIMESTAMP_KEYS`). | -| `src/pipeheads/schemaValidationPipehead.ts` | Self-contained **OFFLINE structural** USS v1.1 validator (DR-001; NOT canonical `ussValidator`). | -| `src/pipeheads/lanes/technicalLane.ts` | WIRED technical lane (`provisional:false`); self-labels its indicators as non-canonical (DR-002). | -| `src/pipeheads/lanes/technicalIndicators.ts` | Self-contained **OFFLINE** EMA-20/50, RSI-14, ATR-14 + `trendBias`/`emaDistancePct` helper (DR-002). | -| `src/pipeheads/lanes/patternLane.ts` | WIRED pattern lane (`provisional:false`); reuses `src/enrichment/patternRecognition.ts#detectPatterns` (pure, offline). | -| `src/pipeheads/lanes/newsLane.ts` | PROVISIONAL committed news fixture lane (`provisional:true`). | -| `src/pipeheads/lanes/socialLane.ts` | PROVISIONAL committed social/sentiment fixture lane (`provisional:true`; maps to `enrichedView.sentiment`). | -| `src/pipeheads/lanes/aimlLane.ts` | PROVISIONAL committed AI/ML fixture lane (`provisional:true`; no network, no Tiny Brains). | -| `src/pipeheads/fanOut.ts` | Five-lane fan-out coordinator with per-lane error isolation. | -| `src/pipeheads/normalizePipehead.ts` | Fan-in to an `AnalysisBundle` + `FroggyEnrichedView` projection. | -| `src/pipeheads/scoringPipehead.ts` | **Invokes** the afi-core deterministic scorer (`createScoringPipehead`, `buildDemoScoredSignal`); afi-core bound via dynamic ESM import. | -| `src/pipeheads/reputationReceipt.ts` | Demo-only, non-mutating `DemoReputationReceipt`. | -| `src/pipeheads/auditPipehead.ts` | Content-hashed `AuditRecord` (sha256; timestamps excluded). | -| `src/pipeheads/harness.ts` | Composes the full DAG in fixed order and returns one aggregate. | -| `src/pipeheads/index.ts` | Barrel exports. | - -### CLI demo (new) - -- `src/cli/run-pipehead-demo.ts` β€” runnable via `node --loader ts-node/esm`; thin wrapper over the harness; prints a five-lane summary + four labeled JSON blocks. - -### Tests + fixtures β€” `test/pipeheads/` (new) - -- Test suites: `types.test.ts`, `clock.test.ts`, `canonicalHash.test.ts`, `schemaValidation.test.ts`, `lanes.test.ts`, `fanOut.test.ts`, `provisionalLanes.test.ts`, `normalize.test.ts`, `normalizeIdentity.test.ts`, `scoring.test.ts`, `reputationReceipt.test.ts`, `audit.test.ts`, `harness.test.ts`, `crossArea.test.ts`, `cli.test.ts`. -- Fixtures: `fixtures/signal.uss.json` (canonical USS v1.1), `fixtures/signal.invalid.uss.json` (missing `provenance.signalId`), `fixtures/ohlcv.json`, `fixtures/lanes/{news,social,aiml}.json`, and `fixtures/golden.json` (committed replay anchor: `inputHash`/`bundleHash`/`outputHash` + `uwrScore`/`uwrAxes`). - -### Tooling + config - -- `tsconfig.pipeheads.json` (new) β€” scoped typecheck over only the new pipehead/CLI/test code (avoids the pre-existing `AnalystNode β†’ afi-factory` full-build break). -- `scripts/esm-check-pipeheads.sh` (new) β€” scoped ESM-invariant gate over the new files only. -- `jest.config.js` (**modified** β€” the only existing file edited) β€” `testMatch` allowlist addition for `test/pipeheads/**`. - -### Documentation - -- `afi-reactor/docs/PIPEHEAD_SYSTEM.md` (new) β€” the system doc this report summarizes. -- `afi-docs/reports/afi-signal-evaluation-pipehead-system-report.md` (new) β€” this report. - ---- - -## 3. Architecture implemented - -The implemented DAG matches the mission `architecture.md` and is composed by `src/pipeheads/harness.ts` in a fixed order: - -``` -fixture USS v1.1 - β†’ schema-validation pipehead (self-contained OFFLINE structural validator; DR-001) - β†’ fan-out across FIVE lanes: - technical-indicators (WIRED) | pattern-recognition (WIRED) - news (PROVISIONAL) | social (PROVISIONAL) | ai-ml (PROVISIONAL) - β†’ normalize pipehead (fan-in β†’ AnalysisBundle; projects to FroggyEnrichedView) - β†’ scoring pipehead (INVOKE afi-core scoreFroggyTrendPullbackFromEnriched; deterministic) - β†’ reputation receipt (demo-only, non-mutating) - β†’ audit pipehead (canonical sha256: inputHash, bundleHash, outputHash; timestamps excluded) -``` - -Key contracts (from `src/pipeheads/types.ts`): - -- Every pipehead exposes `execute(input, ctx)` returning a typed `PipeheadExecutionResult`, pure given `(input, ctx)` β€” no network, no DB, no `Date.now`/`Math.random`. All timestamps come from the injectable `ctx.clock()`. -- The `AnalysisBundle.lanes` record **always** contains the five canonical lane keys in stable order; `provisionalLanes` is the explicit `["news","social","ai-ml"]` list; `enrichedView` is a `FroggyEnrichedView` the afi-core scorer consumes directly (social β†’ `sentiment`; technical β†’ `technical`; pattern β†’ `pattern`). The bundle carries a `provenance` block binding it to the validated input (`signalId` + `inputHash`). -- A schema-validation failure is returned as a **structured value** (no uncaught throw) and **short-circuits** the pipeline β€” no bundle, scored output, receipt, or audit record is produced for invalid input. -- The `outputHash` is computed over an explicit deterministic projection (`{uwrScore, uwrAxes, analystId, strategyId, direction, riskBucket, conviction}`), never the raw timestamped `analystScore` (which carries an afi-core wall-clock `scoredAt`). - ---- - -## 4. Demo flow - -**How to run** (from the `afi-reactor` repo root, fully offline): - -```bash -node --loader ts-node/esm src/cli/run-pipehead-demo.ts -``` - -Optional flags: `--uss ` / `--ohlcv ` (default to the committed canonical fixtures). - -**What it prints.** First a short human-readable five-lane summary, each lane tagged `[WIRED]` or `[PROVISIONAL]`: - -``` -Analysis lanes (5): - - technical-indicators [WIRED] - - pattern-recognition [WIRED] - - news [PROVISIONAL] - - social [PROVISIONAL] - - ai-ml [PROVISIONAL] -``` - -Then **four** labeled, individually `JSON.parse`-able blocks (each delimited by `===== BEGIN