document-centered evidence workspace for capturing, managing, presenting, and re-opening citations
Find a file
tegwick f0af8887d1 Strengthen text-layer debug + log highlight render path
The first cut of "Debug text layer" only painted direct `<span>`
children of `.textLayer`. PDF.js 4.x wraps marked content in nested
spans/divs, so the entire selectable area wasn't visible — making it
hard to tell whether a region is "no text layer at all" vs. "text
layer present but small/dense".

Changes:
- CSS now targets every descendant of `.textLayer`, dims the canvas
  underneath, and outlines the `.textLayer` container itself so its
  full extent is obvious.
- TextHighlight rectangles flip to green in debug mode so saved
  highlights don't get washed out by the debug yellow.
- The viewer now logs:
    [ce] viewer highlights        — which annotations rendered, which
                                    were skipped, with rects + page
    [ce] scrollToAnnotation       — whether the target was found in
                                    the highlights array when an
                                    activation arrived

This is the diagnostic loop for the "viewport scrolls but the
highlight doesn't appear" report — if highlight count is > 0 in the
first log but the green rectangle is off-screen, the saved rects
inherited the same text-layer misalignment that caused the partial
selection captures in the first place.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:05:13 +02:00
docs/decisions Implement CE-WP-0005 T01-T08: demo app — sessions, uploads, ZIP archive 2026-05-26 14:57:28 +02:00
fixtures/pdfs Implement CE-WP-0002 T03-T09: ingest, anchor resolution, engine, UI, persistence, e2e 2026-05-25 10:58:11 +02:00
history Establish shared-contracts home, dependency map, MVP workplans, and umbrella-first strategy 2026-05-24 16:42:25 +02:00
src Strengthen text-layer debug + log highlight render path 2026-05-26 22:05:13 +02:00
tests/integration Implement CE-WP-0005 T01-T08: demo app — sessions, uploads, ZIP archive 2026-05-26 14:57:28 +02:00
wiki Implement CE-WP-0005 T01-T08: demo app — sessions, uploads, ZIP archive 2026-05-26 14:57:28 +02:00
workplans Implement CE-WP-0005 T01-T08: demo app — sessions, uploads, ZIP archive 2026-05-26 14:57:28 +02:00
.gitignore Implement CE-WP-0001 Foundations: TS scaffold, lint boundaries, normalize v1, fixtures 2026-05-25 00:13:03 +02:00
.nvmrc Implement CE-WP-0001 Foundations: TS scaffold, lint boundaries, normalize v1, fixtures 2026-05-25 00:13:03 +02:00
eslint.config.js Implement CE-WP-0001 Foundations: TS scaffold, lint boundaries, normalize v1, fixtures 2026-05-25 00:13:03 +02:00
index.html Implement CE-WP-0002 T03-T09: ingest, anchor resolution, engine, UI, persistence, e2e 2026-05-25 10:58:11 +02:00
INTENT.md Establish shared-contracts home, dependency map, MVP workplans, and umbrella-first strategy 2026-05-24 16:42:25 +02:00
LICENSE Initial commit 2026-05-24 13:20:45 +00:00
Makefile Add Makefile with preview target 2026-05-26 15:17:33 +02:00
package.json Implement CE-WP-0005 T01-T08: demo app — sessions, uploads, ZIP archive 2026-05-26 14:57:28 +02:00
pnpm-lock.yaml Implement CE-WP-0005 T01-T08: demo app — sessions, uploads, ZIP archive 2026-05-26 14:57:28 +02:00
README.md Implement CE-WP-0001 Foundations: TS scaffold, lint boundaries, normalize v1, fixtures 2026-05-25 00:13:03 +02:00
tsconfig.json Implement CE-WP-0002 T03-T09: ingest, anchor resolution, engine, UI, persistence, e2e 2026-05-25 10:58:11 +02:00
vite.config.ts Implement CE-WP-0002 T01-T02: engine types + PDF viewer adapter spike 2026-05-25 02:21:31 +02:00
vitest.config.ts Implement CE-WP-0002 T03-T09: ingest, anchor resolution, engine, UI, persistence, e2e 2026-05-25 10:58:11 +02:00

citation-evidence

A document-centered evidence workspace for capturing, managing, presenting, and re-opening citations. The umbrella over the six-package design described in INTENT.md and wiki/ArchitectureOverview.md.

During the MVP all code lives here under src/ (see "Repository layout" below). Sister repos hold INTENT only — code migrates outward when each subsystem stabilises.

Documentation

Where What
INTENT.md Project intent, scope, the umbrella-first decision
wiki/ PRD, Architecture, SharedContracts, DependencyMap
docs/decisions/ ADRs (architecturally significant decisions)
workplans/ Ralph-driven workplans that implement the MVP slice
history/ Time-stamped assessments and post-mortems

The canonical contracts are in wiki/SharedContracts.md; the partition boundaries are in wiki/DependencyMap.md. Both are referenced from every workplan and from each sister repo's INTENT.md.

Repository layout

src/
  shared/   # vocabulary, types, pure helpers      → becomes part of citation-engine
  engine/   # services, repositories, event bus    → becomes part of citation-engine
  anchor/   # selector creation/resolution, viewer adapter contract → becomes evidence-anchor
  source/   # ingest, fingerprint, extraction, recovery → becomes evidence-source
  binder/   # evidence-to-target binding, visual guide → becomes evidence-binder
  work/     # review UI (sidebar, viewer shell)    → becomes citation-work
  app/      # the reference workspace shell        → stays in citation-evidence

The dependency-edge rules between partitions are enforced by ESLint via eslint-plugin-boundaries (see eslint.config.js). Extraction to a sister repo is intended to be a git mv plus a package.json cut — nothing more.

Sister repos

Peers under ~/; each holds INTENT.md only during MVP:

Dev workflow

Requirements: Node 20 LTS (see .nvmrc) and pnpm 9.

pnpm install
pnpm dev        # vite dev server (once src/app/ has a real entry)
pnpm test       # vitest one-shot
pnpm test:watch
pnpm lint       # eslint with boundary rules
pnpm typecheck  # tsc --noEmit
pnpm build      # production bundle

Workplans (Ralph)

Workplans drive incremental implementation through the ralph loop. The harness lives in ~/ralph-workplan/; see workplans/README.md for the active list and ordering.

/ralph-workplan workplans/CE-WP-0001-foundations.md

The loop self-retires when every task in the file has status: done and the workplan's frontmatter status: done.