Skip to content

Test#1222

Closed
SmelhausJosef wants to merge 7 commits intocoleam00:devfrom
SmelhausJosef:dev
Closed

Test#1222
SmelhausJosef wants to merge 7 commits intocoleam00:devfrom
SmelhausJosef:dev

Conversation

@SmelhausJosef
Copy link
Copy Markdown

@SmelhausJosef SmelhausJosef commented Apr 14, 2026

Summary

Describe this PR in 2-5 bullets:

  • Problem:
  • Why it matters:
  • What changed:
  • What did not change (scope boundary):

UX Journey

Before

(Draw the user-facing flow BEFORE this PR. Show each step the user takes.)

Example:
  User                   Archon                   AI Client
  ────                   ──────                   ─────────
  sends message ──────▶  resolves session
                         loads context
                         streams to AI ──────────▶ processes prompt
                         receives chunks ◀──────── streams response
  sees reply ◀─────────  sends to platform

After

(Draw the user-facing flow AFTER this PR. Highlight what changed with [brackets] or asterisks.)

Architecture Diagram

Before

(Map ALL modules touched or connected to this change. Draw lines between them.)

After

(Same diagram with changes highlighted. Mark new modules with [+], removed with [-],
 modified with [~]. Mark new connections with ===, removed with --x--.)

Connection inventory (list every module-to-module edge, mark changes):

From To Status Notes
unchanged / new / removed / modified

Label Snapshot

  • Risk: risk: low|medium|high
  • Size: size: XS|S|M|L|XL
  • Scope: core|workflows|isolation|git|adapters|server|web|cli|paths|config|docs|dependencies|ci|tests|skills
  • Module: <scope>:<component> (e.g. workflows:executor, adapters:slack, core:orchestrator)

Change Metadata

  • Change type: bug|feature|refactor|docs|security|chore
  • Primary scope: core|workflows|isolation|git|adapters|server|web|cli|paths|multi

Linked Issue

  • Closes #
  • Related #
  • Depends on # (if stacked)
  • Supersedes # (if replacing older PR)

Validation Evidence (required)

Commands and result summary:

bun run type-check
bun run lint
bun run format:check
bun run test
# Or all at once:
bun run validate
  • Evidence provided (test/log/trace/screenshot):
  • If any command is intentionally skipped, explain why:

Security Impact (required)

  • New permissions/capabilities? (Yes/No)
  • New external network calls? (Yes/No)
  • Secrets/tokens handling changed? (Yes/No)
  • File system access scope changed? (Yes/No)
  • If any Yes, describe risk and mitigation:

Compatibility / Migration

  • Backward compatible? (Yes/No)
  • Config/env changes? (Yes/No)
  • Database migration needed? (Yes/No)
  • If yes, exact upgrade steps:

Human Verification (required)

What was personally validated beyond CI:

  • Verified scenarios:
  • Edge cases checked:
  • What was not verified:

Side Effects / Blast Radius (required)

  • Affected subsystems/workflows:
  • Potential unintended effects:
  • Guardrails/monitoring for early detection:

Rollback Plan (required)

  • Fast rollback command/path:
  • Feature flags or config toggles (if any):
  • Observable failure symptoms:

Risks and Mitigations

List real risks in this PR (or write None).

  • Risk:
    • Mitigation:

Summary by CodeRabbit

  • New Features

    • Added webhook rules system for automatic workflow dispatch via slug-based routing
    • Added support for pull/merge request opened events in Gitea and GitLab adapters
    • Added WebhooksPage UI for managing webhook rules
    • Added $CANONICAL_REPO_PATH workflow variable
  • Configuration

    • Updated Codex model to gpt-5.4
    • PostgreSQL now default in Docker Compose deployments
    • Added POSTGRES_* environment variables for local database setup
  • Documentation

    • Updated deployment guides for PostgreSQL defaults and Docker setup
    • Updated adapter documentation for webhook event handling
    • Updated configuration examples for model and environment variables

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a24cdb9a-1488-4b3b-be9e-835341c8f22a

📥 Commits

Reviewing files that changed from the base of the PR and between 73d9240 and a223ee8.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (60)
  • .archon/workflows/defaults/archon-workflow-builder.yaml
  • .codex/config.toml
  • .env.example
  • AGENTS.md
  • CLAUDE.md
  • deploy/.env.example
  • deploy/docker-compose.override.example.yml
  • docker-compose.yml
  • migrations/000_combined.sql
  • migrations/022_webhook_rules.sql
  • packages/adapters/src/community/forge/gitea/adapter.ts
  • packages/adapters/src/community/forge/gitlab/adapter.ts
  • packages/adapters/src/forge/github/adapter.ts
  • packages/adapters/src/forge/github/context.test.ts
  • packages/core/package.json
  • packages/core/src/clients/codex.test.ts
  • packages/core/src/clients/codex.ts
  • packages/core/src/config/config-loader.test.ts
  • packages/core/src/config/config-loader.ts
  • packages/core/src/db/adapters/sqlite.ts
  • packages/core/src/db/webhook-rules.test.ts
  • packages/core/src/db/webhook-rules.ts
  • packages/core/src/index.ts
  • packages/core/src/orchestrator/orchestrator-agent.ts
  • packages/core/src/webhooks/rules-engine.ts
  • packages/core/src/webhooks/types.ts
  • packages/docs-web/src/content/docs/adapters/community/gitea.md
  • packages/docs-web/src/content/docs/adapters/community/gitlab.md
  • packages/docs-web/src/content/docs/adapters/github.md
  • packages/docs-web/src/content/docs/deployment/docker.md
  • packages/docs-web/src/content/docs/deployment/index.md
  • packages/docs-web/src/content/docs/deployment/local.md
  • packages/docs-web/src/content/docs/getting-started/ai-assistants.md
  • packages/docs-web/src/content/docs/getting-started/configuration.md
  • packages/docs-web/src/content/docs/guides/authoring-workflows.md
  • packages/docs-web/src/content/docs/reference/configuration.md
  • packages/docs-web/src/content/docs/reference/database.md
  • packages/server/package.json
  • packages/server/src/routes/api.codebases.test.ts
  • packages/server/src/routes/api.conversations.test.ts
  • packages/server/src/routes/api.health.test.ts
  • packages/server/src/routes/api.messages.test.ts
  • packages/server/src/routes/api.ts
  • packages/server/src/routes/api.webhook-rules.test.ts
  • packages/server/src/routes/api.workflow-runs.test.ts
  • packages/server/src/routes/api.workflows.test.ts
  • packages/server/src/routes/schemas/webhook-rule.schemas.ts
  • packages/web/src/App.tsx
  • packages/web/src/components/layout/TopNav.tsx
  • packages/web/src/lib/api.generated.d.ts
  • packages/web/src/lib/api.ts
  • packages/web/src/routes/SettingsPage.tsx
  • packages/web/src/routes/WebhooksPage.tsx
  • packages/web/vite.config.ts
  • packages/workflows/src/dag-executor.ts
  • packages/workflows/src/executor-preamble.test.ts
  • packages/workflows/src/executor-shared.test.ts
  • packages/workflows/src/executor-shared.ts
  • packages/workflows/src/executor.test.ts
  • packages/workflows/src/executor.ts

📝 Walkthrough

Walkthrough

This PR introduces a webhook rule system enabling automatic workflow dispatch via HTTP endpoints, alongside workflow name validation, PostgreSQL-as-default Docker configuration, Codex model updates (gpt-5.3-codex → gpt-5.4), adapter refinements for PR/MR event handling with mention-based gating, canonical repo path support in workflow execution, and comprehensive documentation updates.

Changes

Cohort / File(s) Summary
Workflow Name Resolution
.archon/workflows/defaults/archon-workflow-builder.yaml
Added resolve-workflow-name bash node validating kebab-case workflow names and updated save-or-report to use resolved names as the source of truth for reporting and file naming.
Database Schema & Migrations
migrations/000_combined.sql, migrations/022_webhook_rules.sql, packages/core/src/db/adapters/sqlite.ts
Added remote_agent_webhook_rules table with codebase foreign key, path slug, workflow name, enabled flag, and timestamps; includes legacy column migration and index management.
Webhook Rules Core
packages/core/src/db/webhook-rules.ts, packages/core/src/db/webhook-rules.test.ts, packages/core/src/webhooks/types.ts, packages/core/src/webhooks/rules-engine.ts
Implemented CRUD and lookup operations for webhook rules, conflict error handling, payload normalization, and workflow dispatch orchestration via slug-based rule matching.
Orchestrator Extensions
packages/core/src/orchestrator/orchestrator-agent.ts
Added dispatchNamedWorkflow function enabling workflow execution by name rather than discovery.
Core Module Exports
packages/core/src/index.ts, packages/core/package.json
Exported new webhook rule DB module and orchestrator functions; added webhook rules test to test script; bumped @openai/codex-sdk from ^0.116.0 to ^0.120.0.
Server API Routes
packages/server/src/routes/api.ts, packages/server/src/routes/schemas/webhook-rule.schemas.ts, packages/server/src/routes/api.webhook-rules.test.ts
Added POST /webhooks/:slug endpoint for webhook dispatch and CRUD endpoints under /api/webhook-rules with OpenAPI schemas; includes conflict-to-409 error mapping and workflow validation.
Server Test Mocks
packages/server/src/routes/api.*.test.ts
Added mocks for dispatchMatchedWebhookRule and @archon/core/db/webhook-rules module across all API test suites; updated test script in packages/server/package.json.
Web UI Routes & API Client
packages/web/src/App.tsx, packages/web/src/routes/WebhooksPage.tsx, packages/web/src/lib/api.ts, packages/web/src/lib/api.generated.d.ts
Added /webhooks route with full-featured CRUD UI for managing webhook rules; generated TypeScript types for API; implemented client functions for list, create, update, delete, and options retrieval.
Web Navigation & Config
packages/web/src/components/layout/TopNav.tsx, packages/web/vite.config.ts
Added Webhooks navigation tab and updated Vite config to prioritize VITE_API_PORT over ARCHON_API_PORT.
Codex Model Updates
packages/core/src/clients/codex.ts, packages/core/src/clients/codex.test.ts, packages/core/src/config/config-loader.ts, packages/core/src/config/config-loader.test.ts, packages/docs-web/src/content/docs/...
Updated default Codex model from gpt-5.3-codex to gpt-5.4; added fallback mappings and improved error handling for model-unavailability scenarios across tests and documentation.
GitHub Adapter Event Handling
packages/adapters/src/forge/github/adapter.ts, packages/adapters/src/forge/github/context.test.ts
Added PR event parsing, refactored codebase lookup into private helper, narrowed mention detection to issue comments only, and added PR payload test helper.
GitLab Adapter Event Handling
packages/adapters/src/community/forge/gitlab/adapter.ts
Expanded MR event parsing, narrowed mention gating to note events, and conditioned downstream dispatch on mention presence.
Gitea Adapter Event Handling
packages/adapters/src/community/forge/gitea/adapter.ts
Added PR event parsing and narrowed mention gating to issue comments; restructured dispatch to execute only for mention-marked events.
Workflow Execution Engine
packages/workflows/src/dag-executor.ts, packages/workflows/src/executor-shared.ts, packages/workflows/src/executor.ts
Added $CANONICAL_REPO_PATH variable support and propagated canonicalRepoPath parameter through all node execution paths; integrated getCanonicalRepoPath from git utilities.
Workflow Test Updates
packages/workflows/src/executor-preamble.test.ts, packages/workflows/src/executor-shared.test.ts, packages/workflows/src/executor.test.ts
Extended test coverage for $CANONICAL_REPO_PATH substitution, added getCanonicalRepoPath mocks, and updated buildPromptWithContext test calls.
Docker & Deployment Configuration
docker-compose.yml, deploy/docker-compose.override.example.yml, .env.example, deploy/.env.example
Moved PostgreSQL from optional profile to default service; added parameterized Dockerfile override; updated environment variable defaults and guidance for local Postgres setup.
Configuration & Documentation
.codex/config.toml, AGENTS.md, CLAUDE.md, packages/docs-web/src/content/docs/...
Added shell environment policy for experimental agent teams, published comprehensive engineering playbook in AGENTS.md, updated deployment and adapter documentation for new webhook/PostgreSQL workflows.

Sequence Diagram(s)

sequenceDiagram
    participant Client as HTTP Client
    participant Routes as Server Routes
    participant DB as Webhook Rules DB
    participant Orchestrator as Orchestrator Engine
    participant WF as Workflow Executor
    
    Client->>Routes: POST /webhooks/:slug
    Routes->>DB: findWebhookRuleBySlug(slug)
    DB-->>Routes: WebhookRule (if enabled)
    
    alt Rule Found
        Routes->>Routes: validateTargetCodebase()
        Routes->>Routes: normalizeWebhookPayload()
        Routes->>Orchestrator: dispatchNamedWorkflow(workflowName)
        Orchestrator->>WF: executeDagWorkflow(workflow)
        WF-->>Orchestrator: result
        Orchestrator-->>Routes: dispatch complete
        Routes-->>Client: 202 Accepted
    else Rule Not Found
        Routes-->>Client: 404 Not Found
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 A webhook hops through slugs so neat,
Rules match paths with workflows meet,
Canonical repos join the game,
PR mentions gate the flame,
Postgres defaults, PostgreSQL's here! 🚀

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant