Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-3349Done

motir-core: the setting field through all four layers, defaulting to ON with no backfill

The stored setting, through the stack that already exists for AI-planning settings — route → service → repository → Prisma, with the DTO, mapper and limits beside them.

The shape to follow is entirely there: projectAiSettingsService already owns the value checks and the admin gate, projectRepository.findAiSettings / updateAiSettings already read and write the group, and the PATCH is already sparse (an omitted field is left untouched). Add one boolean into that machinery — do not build a parallel path for it.

Default ON, without a backfill. Existing projects must read as enabled from the day this ships, and new ones too. A nullable column read as "on when unset" gets there with no data migration and no window where a project's capture is silently off because nobody has written a row yet. Whichever mechanism is chosen, the criterion is the behaviour: no project is ever in a state where capture is off because the setting has not been written.

Nothing reads it yet. This card lands the field and its API. The toggle, the envelope and the gate are siblings — keeping them apart means the review here is only about the storage and the default.

Acceptance criteria

  • The boolean is in the Prisma model, the DTO, the mapper and the limits/validation, and is readable and writable through the existing ai-settings route.
  • Every existing project reads as ON with no backfill migration, asserted against rows created before the change.
  • A new project reads as ON.
  • The PATCH stays sparse — updating another field in the group does not disturb this one, asserted.
  • The admin gate already on the service covers the new field; no second gate is introduced.
  • Migration applies cleanly; prisma generate clean.
  • No UI and no envelope change in this card.

Context refs

  • motir-core app/api/projects/[key]/ai-settings/route.ts — the GET/PATCH and its sparse-patch contract.
  • motir-core lib/services/projectAiSettingsService.ts — the value checks and the admin gate.
  • motir-core lib/repositories/projectRepository.tsfindAiSettings, updateAiSettings.
  • motir-core lib/dto/projectAiSettings.ts, lib/mappers/projectAiSettingsMappers.ts, lib/projectAiSettings/limits.ts.