Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
929ba28
feat(postgres-adapter): implement message bus bridge for PostgreSQL o…
jonahgabriel Sep 11, 2025
fb3c57a
fix(postgres-adapter): correct naming to tool_infrastructure_postgres…
jonahgabriel Sep 11, 2025
84d967c
feat(postgres-adapter): add comprehensive tests and structured logging
jonahgabriel Sep 11, 2025
e255c51
fix(postgres-adapter): remove incorrect standalone service architecture
jonahgabriel Sep 11, 2025
2802d15
"Claude PR Assistant workflow"
jonahgabriel Sep 11, 2025
b09bc30
"Claude Code Review workflow"
jonahgabriel Sep 11, 2025
1500d98
Merge pull request #2 from jonahgabriel/add-claude-github-actions-175…
jonahgabriel Sep 11, 2025
5aa58f6
refactor: Replace custom health check with proper MixinHealthCheck pa…
jonahgabriel Sep 11, 2025
4d2ea50
fix: address all PR review comments for PostgreSQL adapter node
jonahgabriel Sep 11, 2025
7f53a41
fix: implement proper UUID typing and ONEX naming conventions
jonahgabriel Sep 11, 2025
b1fb62a
fix: remove legacy tool structure and complete migration to node arch…
jonahgabriel Sep 11, 2025
7edc36b
fix: resolve Claude Code CI authentication issues
jonahgabriel Sep 11, 2025
14d271d
fix: move enums to separate directory following ONEX conventions
jonahgabriel Sep 11, 2025
41cf65c
feat(infra): implement containerized PostgreSQL adapter with ONEX fra…
jonahgabriel Sep 11, 2025
c882f9d
fix(security): address critical security vulnerabilities and ONEX com…
jonahgabriel Sep 11, 2025
4f32dd4
fix(node): address comprehensive PR review deficiencies
jonahgabriel Sep 11, 2025
46fd74d
fix(critical): resolve all automated PR review deficiencies
jonahgabriel Sep 11, 2025
cde63cf
feat: comprehensive PR review fixes for postgres adapter security and…
jonahgabriel Sep 11, 2025
d17cc93
perf: comprehensive performance and configuration improvements for po…
jonahgabriel Sep 11, 2025
c08cd28
security: comprehensive security hardening and edge case coverage for…
jonahgabriel Sep 11, 2025
0feda89
fix: resolve async/sync mixing in health checks
jonahgabriel Sep 11, 2025
04ab261
refactor: move test files from project root to tests directory
jonahgabriel Sep 11, 2025
69fc55e
docs: add comprehensive implementation plan for unified ONEX architec…
jonahgabriel Sep 11, 2025
fab4409
refactor: organize database assets into proper directory structure
jonahgabriel Sep 11, 2025
a6b6f08
fix: ONEX protocol compliance in PostgreSQL adapter node
jonahgabriel Sep 11, 2025
b34a4c1
fix: address PR review issues in PostgreSQL adapter
jonahgabriel Sep 11, 2025
f9fc491
refactor: remove legacy BaseOnexRegistry and use standard ONEXContain…
jonahgabriel Sep 12, 2025
b62e9e9
feat: Add configuration subcontract and fix container imports
jonahgabriel Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"allow": [
"mcp__archon__perform_rag_query",
"mcp__serena__find_file",
"mcp__serena__think_about_collected_information"
"mcp__serena__think_about_collected_information",
"mcp__serena__find_symbol",
"mcp__archon__create_document",
"mcp__archon__search_code_examples",
"mcp__archon__create_version",
"Bash(POSTGRES_HOST=localhost POSTGRES_PORT=5435 POSTGRES_PASSWORD=\"9#mK2$vP8@xL3&nQ7*wR5!zE6^uY4%tA1$bN3\" poetry run python test_postgres_connection.py)"
],
"deny": [],
"ask": []
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"

jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
prompt: |
Please review this pull request and provide feedback on:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage

Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.

Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.

# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'

50 changes: 50 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read

# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,4 @@ kibana/data/

# Container registry credentials
config.json
auth.json
auth.json.env
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Claude Code operates in agent-driven mode for ONEX infrastructure development. F

### ONEX Architecture
- **Contract-Driven** - All tools/services follow contract patterns
- **Registry Injection** - All dependencies injected via registry: `def __init__(self, registry: BaseOnexRegistry)`
- **Container Injection** - All dependencies injected via container: `def __init__(self, container: ONEXContainer)`
- **Protocol Resolution** - Use duck typing through protocols, never isinstance
- **OnexError Only** - All exceptions converted to OnexError with chaining: `raise OnexError(...) from e`

Expand Down Expand Up @@ -433,7 +433,7 @@ For each infrastructure node:
**Step 5: Registry Creation**
- Create registry/ directory with dependency injection setup
- Define protocol dependencies and injection patterns
- Follow registry injection pattern: `def __init__(self, registry: BaseOnexRegistry)`
- Follow container injection pattern: `def __init__(self, container: ONEXContainer)`

### Phase 3: Target Directory Structure

Expand Down
79 changes: 79 additions & 0 deletions CONFIGURATION_SUBCONTRACT_PLACEMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Configuration Subcontract Model - Core Placement Required

## 📍 Target Location
The configuration subcontract model should be placed in:
```
omnibase_core/core/subcontracts/model_configuration_subcontract.py
```

## 🎯 Rationale
- **Foundational Pattern**: Configuration management is needed across ALL node types (AI, infrastructure, business logic)
- **Standards Consistency**: All other subcontract models are in `omnibase_core.core.subcontracts`
- **Reusability**: Infrastructure, compute, reducer, orchestrator, and gateway nodes all need standardized configuration
- **Architecture Compliance**: Follows established ONEX subcontract placement patterns

## 📦 Current Status
- ✅ **Model Created**: Complete 342-line Pydantic model with validation
- ✅ **Contract Updated**: PostgreSQL adapter references temporary local location
- ✅ **Working Implementation**: Model imports and validates successfully
- ⏳ **Migration Pending**: Awaiting omnibase_core merge for final placement

## 🔄 Migration Strategy
**Phase 1 (Current)**: Use temporary local copy
- Location: `omnibase_infra.models.infrastructure.model_configuration_subcontract`
- Status: ✅ Working and tested
- Import: `from omnibase_infra.models.infrastructure.model_configuration_subcontract import ModelConfigurationSubcontract`

**Phase 2 (After omnibase_core merge)**: Switch to core reference
- Location: `omnibase_core.core.subcontracts.model_configuration_subcontract`
- Simple contract update: Change module path only
- Import: `from omnibase_core.core.subcontracts.model_configuration_subcontract import ModelConfigurationSubcontract`

## 🔄 Integration Pattern
Once placed in core, this subcontract will be available for:

### Infrastructure Nodes
- `postgres_adapter`, `consul_adapter`, `kafka_adapter`, `vault_adapter`
- Service discovery, message queues, secret management

### AI Processing Nodes
- LLM processors, embedding services, model inference nodes
- Configuration for model endpoints, API keys, compute resources

### Business Logic Nodes
- Compute nodes, reducer nodes, orchestrator nodes
- Domain-specific configuration patterns

### Gateway Nodes
- API gateways, service proxies, load balancers
- Network configuration, routing rules, security policies

## 📋 File Content
The complete model is currently located at:
```
/Volumes/PRO-G40/Code/omnibase_infra/src/omnibase_infra/models/infrastructure/model_configuration_subcontract.py
```

This file contains:
- `ConfigurationSourceType` enum (container, environment, defaults, file)
- `ValidationRuleType` enum (format, range, enum, required)
- `ModelConfigurationSource` - Source priority and validation
- `ModelEnvironmentConfiguration` - Environment variable patterns
- `ModelValidationRule` - Individual validation rules with type-specific logic
- `ModelConfigurationValidation` - Validation rule collections
- `ModelConfigurationIntegration` - Container/environment integration
- `ModelConfigurationSecurity` - Security and sanitization
- `ModelConfigurationSubcontract` - Main subcontract model

## ✅ Next Steps
1. Copy the model file to `omnibase_core/core/subcontracts/`
2. Update `omnibase_core/core/subcontracts/__init__.py` to include the new model
3. Test import in PostgreSQL adapter: `from omnibase_core.core.subcontracts.model_configuration_subcontract import ModelConfigurationSubcontract`
4. Remove temporary file from `omnibase_infra/models/infrastructure/`

## 🎯 Impact
This establishes the foundational configuration management pattern for the entire ONEX architecture, ensuring consistent configuration handling across all node types with:
- Standardized environment variable prefixing (`ONEX_INFRA_{NODE_NAME}_`)
- Container service resolution with fallback
- Comprehensive validation with security sanitization
- Proper error handling and detailed messages
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM python:3.12-slim

# GitHub token will be provided via Docker secret

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
&& rm -rf /var/lib/apt/lists/*

# Configure git with GitHub token for private repos (using mount to avoid layer exposure)
RUN --mount=type=secret,id=github_token \
GITHUB_TOKEN=$(cat /run/secrets/github_token) && \
git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"

# Install Poetry
RUN pip install poetry

# Copy poetry files and README
COPY pyproject.toml poetry.lock README.md ./

# Copy source code first
COPY src/ ./src/

# Configure poetry and install dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --only main

# Set Python path
ENV PYTHONPATH=/app/src

# Expose port
EXPOSE 8080

# Run the PostgreSQL adapter
CMD ["python", "-m", "omnibase_infra.nodes.node_postgres_adapter_effect.v1_0_0.node"]
Loading