fabro/lib/components/fabro-interview/src
Bryan Helmkamp 8e066ecf7b
refactor: remove duplicated review target rendering and validation
The review question sentence was written in four places and the URL
safety rules in three. Collapse each to one definition.

- Add `ReviewTarget::question_text_with_link` as the single definition of
  the question wording. `question_text()` and the Slack header both use
  it, so a wording change is now one edit.
- Delete `ReviewTargetKind::noun()`. The enum already derives
  `strum::Display` with the same snake_case output.
- Share one `review_target_line` helper between the console interviewer
  and the CLI attach client, which held a byte-identical copy. Print only
  the URL: `question.text` already carries the label and the noun.
- Trim the web-side check to the URL scheme, host, and credentials, which
  are what a raw `href` can act on. Label length and control characters
  cannot affect the DOM and stay server-side.
- Split validation from presentation in the web UI. `safeReviewTarget`
  returns the target or null, and each caller picks its own fallback, so
  an unsafe target now falls back to the same Markdown rendering as a
  question with no target.
- Derive the resource noun from `kind` in the web UI instead of
  hardcoding "document".
- Use `ReviewTargetKind.DOCUMENT` and the shared `isRecord` guard when
  parsing events, instead of a raw string and a hand-rolled object check
  that accepted arrays.
- Drop `deny_unknown_fields` from the wire struct. The OpenAPI schema
  leaves `additionalProperties` permissive, so an added field would
  otherwise make persisted events unreadable.
- Import `ReviewTarget` by name, and stop naming Slack in a fabro-types
  error message.
- Document that `review_target=true` replaces the gate's `label`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 15:14:23 -04:00
..
auto_approve.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
callback.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
console.rs refactor: remove duplicated review target rendering and validation 2026-07-28 15:14:23 -04:00
control.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
control_protocol.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
lib.rs refactor: remove duplicated review target rendering and validation 2026-07-28 15:14:23 -04:00
queue.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
recording.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
replay.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00