Skip to content

refactor(verify): enforce bold=k identity, multi-line l arrays, hard brevity rules#15

Merged
bensonwong merged 9 commits intomainfrom
refactor/verify-citation-data-block
Apr 6, 2026
Merged

refactor(verify): enforce bold=k identity, multi-line l arrays, hard brevity rules#15
bensonwong merged 9 commits intomainfrom
refactor/verify-citation-data-block

Conversation

@bensonwong
Copy link
Copy Markdown
Contributor

Summary

  • Bold = k identity: Bold text in the body and k in CITATION_DATA must now be identical verbatim phrases — the reader clicks the bold term and sees those exact words highlighted in the evidence popover. Previously these could diverge (different paraphrase vs. source phrase).
  • Hard ≤4-word limit: Clarified this is a hard limit on both bold text and k, not a suggestion. Added concrete truncation examples showing how to reduce long evidence phrases to their 2–3 most distinctive words.
  • Multi-line l arrays: l must now include the anchor's line plus 1–2 adjacent lines. A single-line l risks the anchor filling the entire evidence paragraph, which renders with no visible highlight.
  • Layer 2/3 UX explanation: Rewrote the progressive-disclosure section to explain what actually happens at each layer — including that a full-paragraph k produces no highlight, and that very long anchors lose readability in the keyhole strip.
  • Sub-agent prompt updated: The inline citation format instructions passed to sub-agents now reflect all three rules above.

Test plan

  • Run /verify on a document with long evidence phrases — confirm bold terms are ≤4 words and match k exactly
  • Confirm l arrays in generated CITATION_DATA include 2–3 lines, not a single line
  • Verify the evidence popover highlights the bold term (not a different phrase)

bensonwong and others added 7 commits April 6, 2026 15:35
Ensures consistent use of @latest tag across all npx commands, switches
--summary to --text flag, adds "Update available" handling, and
simplifies the version note.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces the two-format citation system (Format 1 short verbatim,
Format 2 label+anchor) with a simpler approach: bold key terms as
inline markers, then append a <<<CITATION_DATA>>> JSON block with
explicit page_id and line_ids coordinates. This gives the CLI exact
evidence locations instead of relying on heuristic anchor search.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace vague "name, value, or right" with explicit list of what to
bold (claim, value, fact, entity, date, price) in both the in-text
markers section and the sub-agent citation instructions. Adds an
inline example to the sub-agent prompt for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix six review findings from format migration to CITATION_DATA block:
- Invariant line: replace old auto-generate description with new format
- "What goes in each file": update marker syntax to **bold** [N]
- Remove defunct "Format 1" fallback reference in verify step
- Harmonize k field word count to "1–4" (was "1–3" then "Max 4")
- Triage table: remove old [anchor](cite:N) syntax from condition
- Citation density: update reuse idiom to [N] style

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The single-topic verify command referenced {draft}.md but the body
is written to {draft}-body.md. Now consistent with the multi-topic
merge path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Frames bold terms, yellow highlights, and evidence popovers as three
distinct reader layers so the agent understands *why* short k-values
matter. Adds BAD/GOOD examples to the k-field spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Apr 6, 2026

PR Review: refactor(verify)

Overall a well-reasoned refactor. The three-layer disclosure explanation is genuinely helpful for grounding the rules. A few issues worth addressing before merging:

Bug: Invariant uses wrong command name

The updated Invariants section says to "only run deepcitation auth if prepare or verify output contains the exact phrase 'action needed'" — but deepcitation auth is not the command used anywhere else in this skill. Every other reference uses deepcitation login (auth.md Step 1, the login block in Step 1). Looks like an accidental substitution during the refactor.

Inconsistency: --summary to --text change not fully reflected downstream

The prepare command changed from --summary to --text, but Step 2 still refers to "the summary" and "the summary JSON", and the CLI-version note still references deepTextPromptPortion as a fallback indicator. If --text produces plain text rather than structured JSON, the instructions for reading attachmentId and deepTextPages are potentially wrong. Worth clarifying whether --text still produces the same structured output and updating Step 2 references accordingly.

Stale reference in auth.md

The auth-failure block still says: "Do NOT generate citation markers (anchor)". Should be updated to the new bold term [N] format for consistency with the rest of the skill.

Minor: Sub-agent prompt verbosity

The sub-agent citation instructions are now one long dense paragraph vs. the original two-sentence bullet. Functionally fine for an LLM-facing prompt — just noting it if readability is revisited later.

Positives

  • The three-layer progressive disclosure explanation (Scan / Highlight / Explore) maps cleanly to the hard rules and makes the "why" easy to internalize.
  • Concrete truncation examples are far more useful than abstract word-count rules.
  • The multi-line l requirement with the rendering explanation (single-line array causes no visible highlight) is a great addition.
  • Pinning deepcitation@latest across all commands is the right call for a prompt-based skill.

The wrong command name in Invariants and the --summary/--text consistency gap are the two must-fix items. The auth.md stale reference is low-risk but easy to clean up.

bensonwong and others added 2 commits April 6, 2026 20:42
…h.md format

- Fix: `deepcitation auth` → `deepcitation login` in Invariants (wrong command name)
- Fix: "summary JSON" → "prepare output" in citation block and sub-agent prompts
- Fix: stale `[anchor](cite:N)` citation format in auth.md → bold term [N] / CITATION_DATA

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ommand name

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bensonwong bensonwong merged commit e067bc3 into main Apr 6, 2026
@bensonwong bensonwong deleted the refactor/verify-citation-data-block branch April 6, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant