Skip to content

Sprint 3071 Task B — @domscribe/runtime ScreenshotCapturer + @domscribe/relay verify_after_edit MCP tool #52

@Narrator

Description

@Narrator

Sprint 3071 — Task B (parallel with Task A; depends on A2 schema and A3 package for final integration)

Goal

Expose verify_after_edit as the new MCP tool on @domscribe/relay, fed by an element-scoped screenshot capturer in @domscribe/runtime. Strongly recommend verify in MCP prompts; do not gate the lifecycle on it (per RFC 0002 §Decision — deliberate divergence from the DOP memo).

Refs: RFC 0002, commit e8d452d (underscore MCP tool-name grammar).

Scope

B1. @domscribe/runtime — element-scoped ScreenshotCapturer

  • Add ScreenshotCapturer alongside StyleCapturer in ContextCapturer.
  • Element-scoped via boundingRect; cap per-capture payload at ≤200 KB.
  • Returns a blob reference streamed to the relay — never inlined into the annotation payload (preserves the 4 KB-per-element serialization budget from RFC 0001).
  • Adapter changes flow through @domscribe/core only — no per-adapter work in domscribe-react, -vue, -next, -nuxt.

B2. @domscribe/relayverify_after_edit MCP tool

  • Register under the underscore tool-name grammar from commit e8d452d (MCP tool count goes from 13 → 14).
  • Input: { annotationId: string }. Output: VerifyResult (from Task A2; if A2 has not merged yet, stub locally from RFC 0002 §Decision and reconcile in final PR).
  • Implementation: re-capture post-edit componentStyles via existing StyleCapturer + new ScreenshotCapturer, run @domscribe/verify comparator (Task A3) against the pre-edit baseline, return verdict.

B3. MCP prompt + tool description updates (soft-recommend, no gate)

  • Update process-next.prompt to recommend calling verify_after_edit after annotation_respond and before annotation_update_status.
  • Update the annotation_respond tool description with the same recommendation.
  • No lifecycle gateannotation_update_status accepts PROCESSED regardless of whether verify ran (per RFC 0002 §Decision; the gate is the falsifier-trip escalation path, not the v1 design).

Acceptance

  • verify_after_edit registered and visible in the MCP tool list (count 13 → 14)
  • End-to-end test: annotation → annotation_respondverify_after_edit returns a structured VerifyResult on at least one RFC 0001 fixture
  • Blob-reference contract: screenshot payload never appears inline in Annotation (assert via serialization-size test)
  • process-next.prompt and annotation_respond description updated; matched by an MCP integration test
  • tsc and npm test pass; relay startup smoke test green

Out of scope

  • Lifecycle gate on PROCESSED (explicit RFC 0002 §Decision — escalation path only if falsifier trips)
  • Overlay sidebar rendering of VerifyResult (P1 follow-up, next sprint)
  • Per-property source-map back-references (escalation path only)

Coordination with Task A

  • A2 schema is the source of truth for VerifyResult. If A's PR lands first, import directly. If B's PR is ready first, stub locally from RFC 0002 §Decision and reconcile in review.
  • The @domscribe/verify comparator from A3 must be available before relay implementation can land green; if A is still in flight when B is otherwise ready, vendor a local copy and replace in a follow-up PR.

Effort estimate

~32 hours (≤90% of one staff-swe sprint capacity).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:P1High — significant user impact or adoption blocker

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions