Skip to content

Implement Deployer role and align delivery-phase code with documented Deployer contract #233

@fujiwaranosai850

Description

@fujiwaranosai850

Follow-up from #232 and #218.

Overview

Implement the documented Deployer role so the codebase matches the final operator documentation and Deployer contract.

This work should align the workflow, prompt scaffolding, role registry, bootstrap surfaces, and delivery-phase execution model with the documented target shape.

Known spec gaps to resolve during implementation or operator clarification

Before or during implementation, resolve these explicit contract questions:

  1. Does the Deployer own both promotion and acceptance states, or only promotion?

    • Current code still models promotion under reviewer-owned states and acceptance under tester-owned states.
    • Current docs now describe a dedicated Deployer prompt surface.
  2. What are the Deployer completion results?

    • Examples: done/blocked, or a richer state-specific set.
  3. What level model should the Deployer use?

    • Examples: junior/senior like reviewer, or junior/medior/senior like developer/tester.

If these are not already fully specified by the operator before coding starts, stop and refine the issue with the chosen answers before locking the implementation.

Implementation Checklist

Phase 1: Role model and prompt wiring (~1-2 days)

  • Add a first-class deployer role to the role registry in lib/roles/registry.ts, including display name, levels, models, completion results, emoji, and session key pattern.
  • Update any role-derived helpers and tests so deployer is treated like other first-class roles.
  • Ensure default prompt loading and scaffolding consistently include defaults/devclaw/prompts/deployer.md and project-level prompts/deployer.md.
  • Update any role lists, prompt trees, or scaffold logic that still assume only developer/reviewer/tester/architect.

Phase 2: Workflow and delivery-state ownership (~2-3 days)

  • Align workflow typing and defaults in lib/workflow/defaults.ts, workflow-related types, and supporting helpers so delivery states use the intended Deployer role ownership.
  • Update routing/dispatch logic in lib/dispatch/index.ts, lib/services/tick.ts, and any delivery helpers so delivery-phase work dispatches to the Deployer role rather than legacy reviewer/tester ownership where the spec now says otherwise.
  • Reconcile queue/active state ownership for To Promote, Promoting, To Accept, and Accepting with the chosen Deployer contract.
  • Update any assumptions in workflow label resolution, completion rule derivation, or heartbeat delivery transitions that still hardcode reviewer/tester ownership for delivery phases.

Phase 3: Completion semantics and execution behavior (~2-3 days)

  • Implement the chosen Deployer completion contract in work_finish validation and workflow completion handling.
  • Update any result-validation logic so Deployer sessions can complete delivery work using the intended results.
  • Ensure delivery-phase transitions, candidate provenance updates, acceptance handling, and rollback/demotion paths still behave correctly after the role change.
  • Validate that operator/manual docs and runtime behavior agree on whether Deployer handles promotion only or both promotion and acceptance.

Phase 4: Tooling, docs, and tests (~2 days)

  • Update any setup, onboarding, status, or admin surfaces that display roles, prompt files, or default role instructions.
  • Add or update tests for role registry, template loading, project scaffolding, workflow integrity, delivery dispatch, and completion validation.
  • Add tests proving Deployer prompt loading works at both workspace and project override levels.
  • Add tests covering the delivery-state role ownership and completion semantics chosen for the Deployer.
  • Verify docs remain consistent with the implemented code paths after the role is introduced.

Dependencies & Blockers

Estimated Total: 5-8 days

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions