79 Commits

Author SHA1 Message Date
Nathan Castaldi
88089d712c fix: change username field in CanonicalUser to required for better data integrity 2026-04-15 14:37:19 -04:00
Nathan Castaldi
db3b49624c fix: update source_system fields to use Literal types for stricter validation 2026-04-15 14:36:17 -04:00
Nathan Castaldi
a5ad2bca11 feat: add plan for repository naming normalization and phased rename strategy 2026-04-15 14:11:46 -04:00
Nathan Castaldi
6bf5d8dd05
fix(ad): normalize ADUserAdapter to snake_case contract (#4)
- ad_adapter.py: emit snake_case keys from PS queries and surface
  email via the `mail` attribute in both get_user and search paths
- adapters.py: update ADUserAdapter.to_canonical to consume
  normalized keys (e.g. `username`, `last_logon_utc`, `ou`) instead
  of raw LDAP names (sAMAccountName, lastLogonTimestamp, dn)
- Resolves field-name alignment tech debt noted in SESSION_SNAPSHOT_2026-04-15
2026-04-15 13:29:04 -04:00
Nathan Castaldi
f6cfd17e30 docs(ops): add session snapshot for 2026-04-15
- Resolved 7 Pylance errors in identity shard (async/to_thread misuse, missing AD adapter methods)
- Remapped search_users, get_stale_accounts, get_disabled_accounts, get_user_by_email call sites
- Added structured logging to identity shard
- Verified 0 diagnostics and 19/19 unit tests passing
- Live mock validation: status reconciliation, disabled accounts, audit log queries
- Deferred: WIS-018 (get_groups backend method), field-name alignment audit
2026-04-15 10:57:08 -04:00
Nathan Castaldi
f4ec8b1d9a
feat: implement AD backend aliases and fix identity shard async calls (#3)
* docs: add comprehensive Nexus MCP test cases for identity shards

* fix: enhance Active Directory user retrieval methods and logging
2026-04-15 10:44:58 -04:00
Nathan Castaldi
0d5c921a94 fix: update Active Directory adapter to use ActiveDirectoryIdentityBackend 2026-04-15 09:11:58 -04:00
Nathan Castaldi
7fb1231f29 fix: correct agent designation in code review prompt 2026-04-15 08:36:04 -04:00
Nathan Castaldi
ce3fe0de6b docs: update title case in demo and setup guide 2026-04-15 08:25:32 -04:00
Nathan Castaldi
de3a780ecf docs: update README to remove outdated status page and improve clarity 2026-04-15 08:25:05 -04:00
Nathan Castaldi
c3754d9c8e docs: remove outdated tools reference section from README 2026-04-15 08:11:50 -04:00
Nathan Castaldi
d6e93c976a Merge branch 'main' of https://github.com/Castn1_Wheels/mcp_servers 2026-04-14 17:12:31 -04:00
Nathan Castaldi
86187a8acd docs(ops): add session snapshot for 2026-04-14
- Document full repo restructure: DEMO_GUIDE, TOOL_INVENTORY promoted to root
- Capture README overhaul, reports/ folder consolidation, and work item register creation
- Record prompt model alignment to claude-sonnet-4.6 and enterprise .gitignore hardening
- Note outstanding: git pull required for dependabot.yml, .venv bash activation failure, unmerged resilience branches
2026-04-14 17:12:27 -04:00
Nathan Castaldi
7d0c114c4d
Create dependabot.yml 2026-04-14 16:00:25 -04:00
bd25bf7dbb chore: apply enterprise gitignore and re-index project structure 2026-04-14 15:54:54 -04:00
f408203b44 docs: update README and DEMO_GUIDE links for improved navigation and clarity 2026-04-14 15:16:36 -04:00
dec6f4d2ff Refactor documentation: Remove outdated README and Tool Inventory, add comprehensive DEMO_GUIDE and new Tool Inventory file 2026-04-14 15:14:17 -04:00
f19fcc8f0b docs(docs): consolidate setup guide into DEMO_GUIDE
- Merge all content from Local-Setup.md into DEMO_GUIDE.md:
  installation, venv activation, .env config, feature flags,
  Claude Desktop integration, mock drift scenarios, SOC 2 audit
  logging, troubleshooting, and dev workflow
- Delete Local-Setup.md (now redundant)
- Correct stale tool count: 48 → 50 (verified from @mcp.tool() grep)
- Fix audit tool names: replaced removed audit_user_drift references
  with current scan_* tool names
- Add working-directory callout (scripts require nexus-mcp/ as cwd)

Continues doc reorganization from SESSION_SNAPSHOT_2026-04-13_2
2026-04-14 15:08:43 -04:00
f040ac2d07 feat(docs): add comprehensive documentation for Nexus work item register, read-only verification, resilience features, and test validation report
- Created `nexus-work-item-register.md` to establish a canonical registry for NEXUS-XXX work items, including shard assignments and a full work item backlog.
- Added `READ_ONLY_VERIFICATION.md` detailing the results of a security audit confirming zero write capabilities across integrated systems.
- Introduced `RESILIENCE.md` outlining the new enterprise system resilience feature, including automatic retry logic, circuit breaker pattern, and graceful degradation strategies.
- Developed `TEST_VALIDATION_REPORT.md` summarizing the successful rebuild of the Nexus MCP server with full audit shard functionality and comprehensive test results.
2026-04-14 15:00:15 -04:00
e6e4810e47 feat(docs): update tool inventory and add resilience documentation
- Updated Nexus MCP Tool Inventory with new NEXUS references and improved tool descriptions.
- Added comprehensive README.md for Nexus MCP, detailing architecture, folder structure, and tool references.
- Introduced RESILIENCE.md to document the new enterprise system resilience features, including automatic retry logic and circuit breaker patterns.
- Created TEST_VALIDATION_REPORT.md summarizing test results and server capabilities post-rebuild.
- Established a canonical work item register (nexus-work-item-register.md) to track NEXUS-XXX work items and their statuses.
- Updated scripts to reflect changes in work item references from WIS to NEXUS.
2026-04-14 14:53:02 -04:00
5c90bdbd04 chore(prompts): align model tags and add report plan
- Update prompt model frontmatter in code-review and feature-add prompts to Claude Sonnet 4.6 (copilot)
- Add a save_report implementation plan prompt to support next-session delivery and clearer handoff context
2026-04-14 14:33:20 -04:00
8727257605 chore(prompts): align model tags and add report plan
- Update prompt model frontmatter in code-review and feature-add prompts to Claude Sonnet 4.6 (copilot)
- Add a save_report implementation plan prompt to support next-session delivery and clearer handoff context
2026-04-14 12:06:56 -04:00
4f3be4cb4c feat: add code review prompt for MCP server analysis 2026-04-14 10:39:23 -04:00
2d61165f46 docs: add Read-Only Security Verification Report 2026-04-13 16:09:09 -04:00
aa0ada8366 finalized snapshot for the day 2026-04-13 15:08:02 -04:00
3e779a5273 docs(repo): reorganize setup docs and drop MCP probes
- Move setup docs into documentation/ and remove legacy MCP troubleshooting content and ad hoc probe files
- Support the session goal of a cleaner, gated workflow with clearer restart context and less maintenance noise
2026-04-13 14:49:23 -04:00
e7cc0385b7 chore(release): bump version to 0.1.3 2026-04-13 14:41:10 -04:00
7701fcd479 chore(ci): remove obsolete GitHub Actions workflows 2026-04-13 14:37:29 -04:00
27f6a543be version bump 2026-04-13 14:34:50 -04:00
fbb90e2500 feat(docs): automate managed README status page
- Add scripts/update_readme_status.py to generate a deterministic status block, enforce traffic-light shard tables, and validate/fix internal links
- Refactor nexus-mcp/README.md into a managed status layout with standardized WIS traceability and Discipline Drives Quality sections
- Aligns with session goals for operational readiness and disciplined documentation as Nexus-MCP scales

Ref: SESSION_SNAPSHOT_2026-04-13
2026-04-13 14:33:14 -04:00
eb209eedc4 chore(release): bump version to 0.1.1 2026-04-13 14:04:02 -04:00
f5a02ae790 chore(git): untrack python build artifacts
- Remove generated package outputs from nexus-mcp/dist/*.whl and *.tar.gz
- Remove generated metadata from nexus-mcp/src/nexus_mcp.egg-info/*
- Keep repository source-only and rely on local/CI builds for artifacts
2026-04-13 13:40:13 -04:00
dcd562c269 Added "Build artifacts" section 2026-04-13 13:38:25 -04:00
c2338ecbb9 build(nexus-mcp): refresh dist and test metadata
- Update nexus-mcp/pyproject.toml to register the integration pytest marker and keep test execution policy explicit
- Regenerate package metadata and distribution artifacts in nexus-mcp/src/nexus_mcp.egg-info/* and nexus-mcp/dist/*

Ref: Session Snapshot 2026-04-13 — close out pending pytest validation hygiene
2026-04-13 13:35:41 -04:00
cc00efc4c1 fix(ci): resolve test collection and async failures
- Add conftest.py to inject lib/ onto sys.path, fixing
  ModuleNotFoundError on identity test collection
- Add pytest-asyncio to CI install step and pyproject.toml
  test extras; set asyncio_mode=auto to resolve 31 async
  test failures flagged in session tech debt backlog
- All 35 tests now pass; 8 skipped (live API, expected)

Ref: Session Snapshot 2026-04-13 — "Pytest validation incomplete"
2026-04-13 13:22:00 -04:00
25d8af869f docs: Update README with enhanced shard status details and async execution improvements 2026-04-13 13:12:55 -04:00
203c0cb87e Merge rebuild-audit-tools: Complete audit shard with async drift detection tools 2026-04-13 13:08:41 -04:00
3114f86fe8 feat(audit): implement asynchronous execution for audit scans and add verification script for MCP protocol 2026-04-13 13:06:06 -04:00
a961e241cd feat(audit): complete drift detection shard implementation (Yellow → Green)
- Implement 4 production-ready audit scan tools in src/shards/audit.py
  - scan_status_reconciliation: detect terminated users still enabled in AD
  - scan_job_title_drift: detect title mismatches between Workday and AD
  - scan_department_mismatches: detect department/cost center drift
  - scan_name_variance_mismatches: detect display name inconsistencies
- Add comprehensive integration test suite (tests/integration_test_audit_shard.py)
- Create demo client (test_client.py) and MCP protocol simulator (test_mcp_protocol.py)
- Add tool catalog generator (list_tools.py) for visibility across all 33 registered tools
- Fix Windows console encoding in src/main.py to support emoji in shard status output
- Add version management utility (scripts/bump_version.py) for release automation
- Update workday test imports to use new drift_detection module path

Completes session goal of establishing SOC 2-compliant cross-system drift detection
per SESSION_SNAPSHOT_2026-04-13.md. All audit tools validated against mock data
with expected mismatch scenarios (Bob Martinez, Carol Chen, David Kim cases).

Refs: WIS-014, WIS-015, WIS-016, WIS-017, WIS-018
2026-04-13 13:02:03 -04:00
e1612ff59d docs: Enhance feature addition prompt with testing and documentation instructions 2026-04-13 11:38:06 -04:00
15a63015fd docs: Update README with shard status details and resilience improvements 2026-04-13 11:35:32 -04:00
8240d1b6b3 fix(audit): replace broken audit shard with minimal stub for server startup
- nexus-mcp/src/shards/audit.py: Replaced corrupted file (unterminated triple-quoted strings, Unicode encoding issues with em dashes) with minimal working stub
- nexus-mcp/src/shards/audit.py.fresh: Backup of previous corrupted version from git history
- nexus-mcp/src/shards/audit_minimal.py: Alternative version with client imports for future expansion
- egg-info metadata: Added from `pip install -e .` installation in isolated venv

Resolves server startup failure where Python parser could not handle malformed docstrings in original audit.py. The previous committed version (fe77b0f) contained syntax errors that prevented initialization of the audit shard. This minimal stub allows nexus-mcp orchestrator to load and register all 5 working shards successfully.

Ref: Server initialization restored - all shards loading (identity, workday, itsm, assets, logistics, audit)
2026-04-13 11:31:04 -04:00
15a0007367 docs: Add comprehensive resilience feature documentation
- Overview of feature (why it matters, what it solves)
- Features explanation (retry logic, circuit breaker, graceful degradation, health check)
- Implementation details (modified files, decorators)
- Testing instructions (unit tests, manual test scenarios)
- Deployment guide
- Troubleshooting section
- Configuration options
- Future enhancements
2026-04-13 11:05:12 -04:00
eb8b14b86f fix: Correct retry logic for 4xx errors and update deprecated datetime calls
- Fixed resilient_http_call decorator to NOT retry on 4xx client errors (only 5xx)
- Changed retry condition from retry_if_exception_type to retry_if_exception with custom logic
- Updated datetime.utcnow() to datetime.now(UTC) to fix deprecation warnings
- Fixed test imports to add lib/ to sys.path

All 12 unit tests now pass with no warnings.
2026-04-13 11:00:47 -04:00
6337182226 feat: Add enterprise system resilience and graceful degradation
Resolves CRITICAL #1 from code-health-report-2026-04-13.md

Changes:
- Add tenacity dependency for retry logic
- Create lib/resilience.py with:
  - resilient_http_call decorator (3 retries, exponential backoff 2s→4s→8s)
  - CircuitBreaker class (opens after 5 consecutive failures)
  - handle_404_gracefully decorator for safe resource lookups
- Apply retry decorators to all HTTP clients:
  - workday_client.py: get(), raas()
  - entra_client.py: get(), get_all_pages()
  - helix_client.py: get(), post()
  - intune_client.py: get()
  - lansweeper_client.py: gql()
  - fedex_client.py: post()
- Add graceful degradation to audit tools:
  - audit_user_drift(): Wrap Workday, AD, Entra calls separately
  - audit_device_drift(): Wrap Lansweeper, Intune, Helix calls separately
  - Both now return systems_available and systems_failed fields
- Create check_system_health() tool for proactive monitoring
- Add comprehensive unit tests for resilience module

Benefits:
- HTTP clients now automatically retry transient failures (5xx, timeouts)
- Circuit breaker prevents hammering failing services (fast-fail after threshold)
- Audit tools continue with partial data if some systems unavailable
- Health check tool enables proactive system monitoring before bulk audits
2026-04-13 10:54:06 -04:00
b23cd1f2e2 Added new 'feature-add' prompt 2026-04-13 10:34:49 -04:00
076484d775 feat(report): add comprehensive code health report with actionable improvements and resilience recommendations 2026-04-13 10:28:06 -04:00
fe77b0f69f feat(nexus): implement canonical pydantic schemas for cross-system data transformation
Addresses technical debt where data objects (User, Worker, Device) were using
fragile dict access patterns instead of validated pydantic models.

- Add nexus-mcp/lib/schemas.py: Canonical domain models (CanonicalUser, CanonicalDevice,
  FieldDrift) with automatic field normalization and validation
- Add nexus-mcp/lib/adapters.py: System-specific adapters (ADUserAdapter, EntraUserAdapter,
  WorkdayWorkerAdapter) to transform native API responses into canonical format
- Update identity.py: ad_get_user, ad_search_users, entra_list_users now return
  normalized CanonicalUser objects with consistent field names
- Update workday.py: workday_list_workers, workday_get_worker return canonical format
  for seamless cross-system comparison
- Update audit.py: Refactor audit_user_drift to use type-safe _compare_users() helper
  with FieldDrift schema instead of manual dict comparisons

Benefits:
  • Type safety: IDE autocomplete, runtime validation, eliminates fragile _pick() calls
  • Consistent field names: user.job_title works across AD/Entra/Workday (was 3 different paths)
  • Automatic validation: Email normalization, status enum enforcement
  • Drift detection: Validated Bob Martinez title mismatch (AD "Sr. Software Engineer"
    vs Workday "Software Engineer")

Ref: Session goal "implement atomic, piece-at-a-time shard deployment capability"
requiring robust data contracts between systems.
2026-04-13 10:04:20 -04:00
f83ab597f0 feat(config): refactor configuration classes to use pydantic-settings for better validation and management 2026-04-13 09:54:25 -04:00
479df6bd8a chore: archive legacy Identity, Workday, and Intune folders
- Move Identity/, Workday/, Intune/ to archive/ (superseded by nexus-mcp shards)
- Move 'Local Setup.md' to archive/ (superseded by nexus-mcp/Local-Setup.md)
- Add archive/README.md explaining migration and preserved content
- Clean repository structure: only nexus-mcp, documentation, and .github remain active

All legacy functionality migrated to nexus-mcp sharded architecture.
Archived folders preserved for reference and historical context.

Refs: SESSION_SNAPSHOT_2026-04-13.md
2026-04-13 09:38:42 -04:00