Skip to content
This repository was archived by the owner on Nov 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,5 @@ jobs:
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: python -m pip install lizard==1.23.0
- run: pnpm quality
- run: pnpm exec playwright install --with-deps chromium
- run: pnpm test:local-library
- run: pnpm test:guest-pdf
- run: pnpm test:account-pdf
- run: pnpm test:account-notes
- run: pnpm exec playwright install --with-deps chromium webkit
- run: pnpm test:e2e
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ dist/

# Private Fleet task evidence
.fleet-local/

# Local Worker credentials and browser test outputs
.dev.vars
.dev.vars.*
/test-results/
/playwright-report/
47 changes: 14 additions & 33 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,17 @@

## Purpose

Reader is a personal research library: capture web articles and PDFs, read and
annotate them, organise with tags/lists/boards, search, and AI-chat or
auto-summarise the saved material. Companion Chrome MV3 extension. See
[docs/product/overview.md](docs/product/overview.md).
Reader is a saved-link inbox. Add URLs in the app or Chrome extension; ChatGPT retrieves links and available text and marks them read through MCP. See [docs/product/overview.md](docs/product/overview.md).

## Stack (one-liner)
## Stack

Vite + React 19 SPA (single `app.html` entry) + Hono Worker on Cloudflare
Workers (`src/worker.ts`), Cloudflare D1 via Drizzle ORM, better-auth Google
OAuth, Cloudflare R2 for PDFs, free-ai-gateway + BYOK + local-ai dev bridge.
No SSR, no Next.js, no Firebase.
Vite + React SPA, Hono Cloudflare Worker, D1 via Drizzle, better-auth Google sign-in, and Auth0-backed MCP OAuth. The existing D1 schema and R2 data are preserved. There is no built-in AI, reader, PDF capture, RSS, board, or annotation workflow.

## Essential commands

```bash
pnpm install
pnpm dev # Worker (:8787) + Vite SPA (:5173) + local-ai, concurrently
pnpm dev # Worker (:8787) + Vite SPA (:5173), concurrently
pnpm dev:worker # wrangler dev only
pnpm dev:spa # vite only (proxies /api → 8787)
pnpm build # validate env + vite build → dist/
Expand Down Expand Up @@ -59,8 +53,7 @@ Full command map: [docs/development/commands.md](docs/development/commands.md).
Do not rename without re-provisioning.
- **`wrangler.toml` `run_worker_first` list is required** for agent surfaces
and `/api/*` to reach the Worker before the `ASSETS` binding.
- **BYOK provider keys live in the browser only** — never persist or log
server-side. `rdr_*` API keys are hashed at rest; plaintext shown once.
- **`rdr_*` API keys are hashed at rest; plaintext shown once.** MCP reads require `reader.read`; read-state writes require `reader.write`. Never treat a browser cookie as an MCP credential.
- **Schema changes are additive + deliberate.** Generate and inspect SQL before applying it;
read the SQL under `drizzle/` before applying to production. See
[docs/operations/runbooks/migrate-schema.md](docs/operations/runbooks/migrate-schema.md).
Expand All @@ -83,29 +76,17 @@ Full command map: [docs/development/commands.md](docs/development/commands.md).
- Runtime agent-indexing surfaces are in [public/](public/); see
[docs/product/surfaces.md](docs/product/surfaces.md).

## Repo structure (high level)
## Active source

```
app.html # Single SPA HTML entry (Vite input)
vite.config.ts # Vite SPA build (React, Tailwind v4, Lightning CSS)
wrangler.toml # Worker config: main=src/worker.ts, ASSETS + PDFS_BUCKET
src/
worker.ts # Hono Worker entry — security headers, /api/* routing, asset serving
agent-edge.mjs # Generated agent-edge handler (llms.txt, index.md, api/ai)
worker/routes/ # Hono API route modules (articles, boards, lists, ai, keys, pdf, rss, share, memories, misc)
pages/ # Route page components (lazy-loaded via react-router-dom)
components/ # React components (ReaderView, PDFReaderClient, NotesAIChat, board/, reader/, ui/)
hooks/ # Shared React hooks
lib/ # DB, auth, AI, storage, SSRF validation, RSS, memories, etc.
packages/chrome-extension/ # Chrome MV3 extension (separate Vite build)
landing-astro/ # Astro landing page (overlaid into dist/ during cf:build)
docs/ # Canonical documentation (source of truth)
drizzle/ # Migration SQL files + meta
scripts/ # local-ai.mjs, validate-env.mjs, overlay-astro-landing.mjs, check-docs.mjs
public/ # Agent-indexing surfaces (llms.txt, index.md, api-ai.json, robots.txt, sitemap.xml)
```
- `src/components/HomeClient.tsx`: inbox, URL form, and read-state changes.
- `src/components/ExtensionConnectClient.tsx`: connections and extension keys.
- `src/lib/links-db.ts`: account-scoped link storage over the existing articles table.
- `src/lib/link-content.ts`: bounded web-text retrieval.
- `src/worker/routes/`: links, MCP, keys, and account identity.
- `packages/chrome-extension/`: popup-only URL/title capture.
- `landing-astro/`: landing overlay.

Detailed file map: [docs/architecture/overview.md](docs/architecture/overview.md).
MCP setup and the live verification boundary are in [docs/architecture/overview.md](docs/architecture/overview.md). Legacy schema columns and tables are retained deliberately; do not drop saved data as cleanup.

## Fleet guidance

Expand Down
118 changes: 15 additions & 103 deletions PROJECT_STATUS.md
Original file line number Diff line number Diff line change
@@ -1,111 +1,23 @@
# PROJECT_STATUS — Reader
# Reader — project status

## Free AI gateway source update — 2 October
## Product scope

Managed AI calls now use the Fleet gateway with canonical `reader` attribution.
Explicit BYOK remains first; production requires the service binding, and
gateway-managed SDK retries are disabled. Existing structured-output parsing,
token limits, and streaming responses are preserved. SDK contract tests and full
local `pnpm quality` pass (152 app tests and 20 extension tests); Cloudflare
build and top-level Wrangler dry-run pass. Pending PR review and
production release; no deployment was performed. Tracked in
[Free AI issue #83](https://github.com/sass-maker/free-ai/issues/83).
Saved links, read/unread state, an add-link form, a one-click Chrome capture extension, and ChatGPT MCP access. Nothing else is in the active product.

This is Reader's durable current and shipped product truth. For the full
product, feature, and architecture record, see [`docs/`](docs/index.md).
## Source implementation

## Why / What
- One account inbox: unread/read/all, title/URL search, pagination, and URL capture.
- Extension popup saves only the active tab’s URL and title. No content script, chat, side panel, or Reading List sync.
- Three MCP tools: `search`, `fetch`, and `set_read`.
- Account isolation and separate OAuth read/write permissions.
- Existing web captures retain their content. No schema migration or saved-data deletion.
- Reader, PDF, annotation, board, RSS, memory, and built-in AI modules removed from the active source.

Reader is a personal research library for capturing, reading, annotating, and
AI-assisted work over saved articles and PDFs. It remains in personal-use,
maintenance-first support.
## Release boundary

## Dependencies
The simplification is a source candidate. Production has not been deployed by this change.
OAuth provider setup and an authenticated ChatGPT retrieval/write-back check remain required for live acceptance. Do not describe the connector as working in production without that evidence.

- Vite + React 19 SPA, Hono Worker, Cloudflare D1 + Drizzle, Cloudflare R2,
better-auth Google OAuth, and optional AI providers. D1 is authoritative;
the retired Turso database was deleted on 2026-08-02.
- Ultracite 7.10.2 is an exact development-only Biome preset dependency. Local
exceptions preserve Reader's established SPA, Worker, Astro, and document
processing style without affecting runtime behavior.
## Operational constraints

## Timeline

- **2026-09-08:** Repaired Worker dispatch after live session and snapshot GETs
returned discovery `not_found` responses. Product APIs now reach Hono while
`/api/ai` retains discovery GET/HEAD. Entry-point regression tests exercise
session dispatch, protected snapshot/article reads, and discovery. Release
and full hosted qualification remain tracked in
[#55](https://github.com/Significant-Hobbies/reader/issues/55). Guest URL import
now explains sign-in and preserves the URL/category in tab storage for review
after authentication. Restoring a draft never imports automatically; explicit
cancellation clears it. The built-browser regression covers guest handoff,
simulated account return, extraction failure, reload, and cancellation.
- **2026-09-07:** Fixed a reproduced local IndexedDB lost-update bug: concurrent
title and note edits now merge within one readwrite transaction. Isolated
Chromium proves article content/notes/count and synthetic PDF bytes survive
reload; route fixtures verify guest rejection and account-scoped access calls.
[Evidence and limits](docs/development/testing.md#local-library-persistence).
Live journey qualification remains [#55](https://github.com/Significant-Hobbies/reader/issues/55);
guest PDF page notes are now implemented in [#56](https://github.com/Significant-Hobbies/reader/issues/56).
No deployment or live upload was performed.
- **2026-08-12:** Adopted the Fleet code-health contract across the app,
Worker, landing, and Chrome extension with truthful whole-library coverage,
unused-code, cycle, complexity, duplication, dependency, suppression, build,
docs, and repository-hygiene ratchets in CI. Removed the retired Firebase
migration and unused extension/UI surfaces; remaining debt is in GitHub.
- **2026-08-09:** Adopted the verified Ultracite-backed Biome baseline through
the existing non-writing check, with explicit compatibility exceptions and
no source rewrite, production dependency, storage/auth/AI, migration, or
deployment change.
- **2026-07-31:** Kept the public sitemap limited to the four canonical HTML
pages while retaining six machine resources through robots, llms, and the
agent catalog. Explicit tests now enforce sitemap, catalog, and Markdown
parity; production deployment remains separate.
- **2026-07-31:** Added locally verified Open Graph/Twitter image metadata and
SoftwareApplication structured data to the public landing layout; production
deployment remains separate.
- **2026-07-29:** Added an owned `/changelog` with verified release outcomes and
direct GitHub Roadmap and Source links.
- **2026-07-13:** Shipped authenticated RSS/Atom reading and OPML import.

## Products

- Public research library at `https://read.significanthobbies.com`.
- Chrome MV3 capture extension.

## Features (shipped)

- Guest PDF page notes: local import/render/navigation, note create/edit/delete,
saved page anchors and reload. Existing PDF.js API/worker versions are aligned
to 5.4.624 after a built-browser test exposed a version mismatch.
Notes stay browser-local; they are not text highlights or embedded PDF edits.
Account PDFs now use the same page-note editor with account persistence,
retained page anchors, failed-save draft retention and account-scoped cache/drafts.
A built-browser journey uses real Hono/Drizzle handlers and isolated SQLite to
prove create/edit/delete/reload, a failed save and retry, and Alice/Bob isolation.
Hosted Google/D1/R2 qualification remains #55. Existing background/zoom/page
controls remain supported; mobile panels stack to keep the PDF visible.

- Account article annotations: cached reopen refreshes clean notes before editing,
autosave runs only for dirty notes and serializes in-flight changes, including
marker reanchoring. Failed writes require retry or a new edit. Account/article
cache keys and reader mounts align. Real-handler/SQLite/browser regression
covers stale-cache data loss, fresh server props during a dirty edit, selection
notes, retry, reanchor, reload/delete and delayed-save account isolation.
Concurrent note saves now merge independent changes with an atomic database comparison. Overlapping edits return a conflict and retain the draft. Linked board notes have stable identities and explicit failed-sync retry; the standalone board canvas has a viewport height. Production qualification remains #55.

- Articles and PDFs with highlights, notes, search, boards, lists, and
AI-assisted reading.
- Account-backed and device-local capture paths.
- Owned editorial product changelog at `/changelog`.
- HTML-only public sitemap with cataloged Markdown mirrors for agent discovery.
- Exact Ultracite-backed Biome presets with explicit local compatibility
exceptions; `pnpm check` remains non-writing.
- One `pnpm quality` command reproduces the complete hosted code-health gate.

## Work queue

Open work is tracked only in [GitHub Issues](https://github.com/Significant-Hobbies/reader/issues).
An open issue is a to-do, a linked pull request is in progress, and merge plus
issue closure makes the work done.
The Worker remains named `reader`. Deployment and migrations require explicit owner approval. Legacy D1 tables and R2 data remain intact.
Loading
Loading