Skip to content

Remove DedicatedMachine; re-home PendingQuestion to the daemon Machine #502

@pulzzejason

Description

@pulzzejason

Problem

The project-scoped DedicatedMachine machine-pairing system is superseded by the account-scoped Machine daemon. With the account-level Machines page now live (#143, PR #499), the legacy project machines page should be removed — but the PendingQuestion (machine ask/answer) capability is preserved by re-homing it onto the new Machine.

Task: #144 (remove-legacy-dedicatedmachine-project-machines-implementati)

Confirmed decisions

  • Remove the DedicatedMachine model + enum + Project.dedicatedMachines back-relation, the project-scoped machines list/CRUD routes, companion/pair, the project machines page + src/components/machines/*.
  • Keep + re-home PendingQuestion: repoint its FK from DedicatedMachine → the account-scoped Machine; add account-scoped ping/questions/answer routes under /api/v1/me/machines/[id]/.... (The PM-bridge Sessions question flow is untouched.)
  • Data loss accepted (days-old superseded feature; DROP migration may drop rows).
  • Repoint dangling links to the account-level /machines page (feat: peter-current-working-branch-2 #143). Note NoMachineBanner already points there.

Acceptance criteria

  • DedicatedMachine model + DedicatedMachineStatus enum + Project.dedicatedMachines removed; prisma validate + typecheck pass.
  • PendingQuestion preserved, machineId now → Machine (new Machine.pendingQuestions); PendingQuestionStatus kept.
  • Machine ping/question/answer live under account-scoped /api/v1/me/machines/[id]/...; old project-scoped equivalents gone.
  • Project machines list/CRUD routes, companion/pair, project machines page, and src/components/machines/* deleted.
  • No dangling references; npm run build succeeds.
  • New daemon (/api/v1/me/machines, docker/agent/*), /agent rooms, and the feat: peter-current-working-branch-2 #143 page remain green; CompanionToken/ProjectSyncToken.machineFingerprint untouched.
  • Once re-homed, the feat: peter-current-working-branch-2 #143 drill-in "Pending questions" section populates from real data (closes that dependency).

Notes for the implementer

Security

Account-scoped question routes must use authorizeDaemonOrSession + userId (test non-owner rejection); zod-validate question/answer bodies. DROP migration destroys dedicated_machines + pending_questions rows (accepted).

Rollback

Revert PR; re-run the original migration to recreate the (empty) tables.

Full spec: .tasks/.data/tasks/remove-legacy-dedicatedmachine-project-machines-implementati.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions