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-2283Done

11.5.14 Apply Amendment 9 Q1 to the COMMENT author — the one activity shape that kept the overturned rationale

⚠️ CORRECTED 2026-08-06 at the start of its own run — THREE of the four gaps this card claimed DO NOT EXIST. The card was written from a sweep that listed only person-NAMED keys (userId, authorId, …); name was not in the pattern, so a nested { userId, name } looked like { userId }. Reading the schemas settled it. Same shape as notes.html #229 — a conclusion drawn from a tool's output without opening the file — caught this time before any code was written.

Verified against lib/api/v1/workLoop/schema.ts and workItems/schema.ts:

Claimed gapRealityVerdict
ActivityEntry change variant: actor has no nameactivityChangeSchema:452actor: { userId, name }already correct
the user-typed change VALUES have no nameactivityValueSchema:401{ type: 'user', userId, name }already correct
(the sprint-typed values, by the same token){ type: 'sprint', sprintId, name }already correct
CommentThread.authorId — id onlycommentSchemaauthorId only, and presentComment narrows CommentAuthorDTO down to .idREAL — the whole card

The activity CHANGE side already got this right. Only the COMMENT side applied the rationale Amendment 9 Q1 overturned — and presentComment's own comment says so verbatim: "a public API must not acquire a second, accidental user resource."

So this card is ONE widening, not four.

What to build

commentSchema gains author: { id, name } beside authorId. That is the entire change. It reaches both consumers at once, because commentThreadSchema extends commentSchema and activityEntrySchema's comment variant reuses it verbatim.

  • actorRefSchema MOVES from lib/api/v1/ready/schema.ts to lib/api/v1/workItems/schema.ts, and ready/schema.ts imports it from there. Required, not cosmetic: ready/schema.ts already imports FROM workItems/schema.ts, so declaring the shared shape in ready would invert the dependency.
  • CommentSource.author widens from { id: string } to { id: string; name: string } — the narrowing that caused this lives in that interface, not in the service. CommentAuthorDTO already carries name (lib/dto/comments.ts:8), so no new query: it is a mapper widening exactly like 11.5.13's.
  • presentComment's comment is rewritten — it currently states the overturned rationale as fact. A schema whose prose contradicts the ADR is the defect 11.5.13's own criteria named.
  • Keep authorId. Removing it is a §8 violation.
  • V1_CONTRACT_VERSION1.3.0 (1.1.0 was MOTIR-2275's header, 1.2.0 was 11.5.13's ready-row actor).

Scope BOUNDARY

Ends at commentSchema + the actorRefSchema move. ONE repo, motir-core. It does NOT change the CLI (11.5.4 consumes it), does NOT touch the change/value schemas (verified correct above), and does NOT add a user endpoint.

Acceptance criteria

  • commentSchema carries author: { id, name } beside authorId, and a test asserts author.id === authorId.
  • actorRefSchema is declared once, in workItems/schema.ts, and ready/schema.ts imports it — no duplicate declaration.
  • render.ts's renderComment / renderCommentThread are driven from a REAL GET /api/v1/work-items/{key}/comments and a REAL …/activity?view=all response and print the author's NAME — added to tests/api/v1/cli-renderers-from-v1.test.ts.
  • No new service call: asserted by spying on the comments read over a multi-comment page.
  • The field appears in the emitted document; V1_CONTRACT_VERSION moves to 1.3.0 in the same PR.
  • 11.6's MCP drift guard still passes.
  • presentComment's prose agrees with Amendment 9 afterwards.
  • The per-file coverage floor (≥90%) holds.

Context refs

  • docs/decisions/public-api-conventions.md Amendment 9 Q1 — the rule this applies.
  • lib/api/v1/workItems/schema.tscommentSchema, CommentSource, presentComment, and actorRefSchema's new home.
  • lib/dto/comments.ts:8CommentAuthorDTO, which already carries the name.
  • lib/api/v1/workLoop/schema.ts:401 · :452 — the two shapes that were ALREADY right; do not touch.
  • packages/cli/src/render.ts:915 — the reader.
  • Blocks: 11.5.4.