Review queue: let reviewers add context before approving

未关闭
#77 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript

调研方向

Start by settling the open question on whether context is a scratchpad, a draft-from-context action, or appended to the article, since that decides the work. The UI lives in app/(dashboard)/kb/review-tab.tsx, the API in PATCH /api/kb/review/[id], and the schema change in kb_review_items; check lib/kb/limits.ts for the 2000-article cap. Done means the context field saves without approving, approval still needs a reviewed answer, and the docs in content/docs/product/knowledge-base.mdx are updated.

由索引模型根据 Issue 内容生成。

描述

backend enhancement frontend question

Copied from DeadantCo/answerLoops#67 · originally opened by sethr07 on 2026-11-20

Copied from https://github.com/answerLoops/answerLoops/issues/364 — originally opened by @NathanTarbert on 2026-10-12

Summary

Let a reviewer add free-text context to a review-queue item before approving it, so the published article reflects knowledge the assistant did not have. Follow-up to the review queue in #362. The standalone add-article form shipped in #367; this issue now covers only the Additional context field on the review tab and the optional draft-from-context button.

Problem

Many unseen questions arrive with no usable draft, because the assistant had nothing to ground an answer on. Those items are flagged "No usable answer" and the reviewer has to write the whole answer from scratch in a single textarea. The same reviewer often has useful raw material (a product detail, a link, a policy snippet, an internal explanation) that would be easier to paste than to turn into a finished answer. A Reddit commenter also asked for a way to give the system "direct inputs of additional information" that improve answer quality.

Proposed behavior

  • On each pending item in the Review tab, add an Additional context field next to the question and answer.
  • The context is free text (suggest a max of 8,000 characters, matching the answer limit).
  • On approve, the published article is built from the reviewer's final question and answer; the context is used to help produce that answer (see open question) and is stored with the item for audit.
  • Context is private to the workspace and never served directly. Only the approved article is.

Open questions to settle before building

  1. Does the context get turned into an answer automatically, or is it just a scratchpad? Options: (a) reviewer-only notes that stay on the item, (b) an optional "Draft answer from context" button that asks the model to write an answer from the context, which the reviewer then edits and approves, (c) append the context to the article body. Recommendation: (b), because it keeps a person in the loop and fills the empty-draft case.
  2. Cost and rate limits. Drafting from context calls the model, so it needs the same per-org rate limiting and plan quota treatment as other generation paths.

Implementation notes

  • UI: app/(dashboard)/kb/review-tab.tsx.
  • API: extend PATCH /api/kb/review/[id] (new optional field, or a separate action for drafting). Keep owner/admin-only and Pro-gated.
  • Data: add a nullable context column to kb_review_items via a new idempotent migration.
  • Reuse embedText, the 2000-article cap in lib/kb/limits.ts, and rateLimitShared.
  • Docs: update the Review queue section in content/docs/product/knowledge-base.mdx and reference/data-model.mdx.

Acceptance criteria

  • The Additional context field is saved on the review item without approving it
  • An item with no draft can be answered from context without retyping everything, using the optional draft-from-context button
  • Approving still requires a non-empty reviewed answer
  • Context is never searchable or served until it is part of an approved article
  • Owner/admin only, Pro-gated, rate limited, org-scoped
  • Docs, unit, component and e2e tests updated

Start here: new to the project? Read CONTRIBUTING.md first. It covers the ground rules, running answerLoops locally, and how to open a pull request.

主要语言
TypeScript
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DeadantCo/answerLoopsdev 的其他 Issue

查看 DeadantCo/answerLoopsdev 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。