Source support: bounded post-reply assessment runner

Aperta
#104 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
next.js, typescript
Ambito
api, backend

Direzione di ricerca

This is blocked on #433 and depends on #431, #443 and the library, storage and judge issues, so do not start yet. Once unblocked, read node_modules/next/dist/docs for the after-response mechanism used by route handlers, then find the answer-generation call sites that #431 touches. Done means the reply is returned before assessment starts, and each bound and switch records skipped or failed as specified.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

backend enhancement help wanted

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

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

Part of #437. Depends on the library, storage and judge issues, and on the answer-reference call sites (#431). Blocked on the cost and sampling decisions recorded in #433.

Problem

Assessment must never slow or change a reply, and must not grow an unbounded backlog or keep conversation text.

Scope

Reuses the answer id generated in #431; adds no new call-site plumbing beyond the post-reply hook.

  • In-process, after the reply. When an answer is generated, build the snapshot while the inputs are still in memory, send the reply, then run the assessment with the platform's after-response hook. There is no durable queue and no stored inputs. If the process stops first, the answer stays "not assessed", and that is shown honestly. State per surface which mechanism is used. Surfaces that are not request handlers (the Discord bot process) use a guarded in-process fire-and-forget. Read the Next.js docs in node_modules/next/dist/docs before choosing the after-response mechanism for route handlers.
  • Bounds. Per-workspace daily budget, a sampling rate, a per-call timeout, a cap on articles and claims per snapshot, and a cap on concurrent assessments per process. Anything over a bound is recorded as skipped with a reason, not dropped silently.
  • Switches. Off by default. Enabled per workspace and per surface (widget, ticket, Discord, Agent API). Excerpt storage is a separate per-workspace opt-in, off by default, independent of turning assessment on. The settings screen for the per-surface switches belongs to this issue (reading the columns #443 adds). Disabled and budget-limited answers count as not assessed.
  • Idempotency. Keyed on answer id, article id and method version, so repeated callbacks do nothing.
  • Failure isolation. Any error is caught, logged without answer text, recorded as failed, and never reaches the customer or changes the reply, the confidence score or auto-deflection.
  • No retry of expired inputs. There is no re-run from storage. A manual re-assessment is only possible when the inputs still exist, which after the reply they do not; say so in the docs.

Acceptance criteria

  • A reply's content and timing are identical with assessment on, off, failing or timing out (tests assert the reply is returned before the assessment starts).
  • Over-budget, disabled and unsampled answers are recorded with the right reason and counted as not assessed.
  • Repeating a completion callback creates no second assessment.
  • Logs and stored rows contain no question or answer text beyond the approved bounded excerpts.
  • Works on every enabled surface behind its own switch.
  • pnpm test and pnpm build pass; docs updated (knowledge-base.mdx, pipeline and data-model pages).

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.

Lingua principale
TypeScript
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DeadantCo/answerLoopsdev

Tutte le issue di DeadantCo/answerLoopsdev

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.