Skip to content

Per-chapter unlock: share a voice to open each next chapter - #73

Merged
fromknowware merged 1 commit into
mainfrom
claude/per-chapter-unlock-share
Nov 9, 2026
Merged

fromknowware merged 1 commit into
mainfrom
claude/per-chapter-unlock-share

Conversation

@fromknowware

Copy link
Copy Markdown
Owner

Before: one email unlocked every chapter site-wide. After: email opens Chapter 1 only; Chapters 2–9 and the capstone each open after the reader posts one of that chapter's voices on Instagram, LinkedIn, X or TikTok and pastes the post URL back.

  • lib/server/share.js: pure helpers (platform regexes, canonical URL, reader id, claimShare, hasUnlock, ensureSubscriberShape). Tested with a fake KV in tests/share.test.mjs.
  • functions/api/reader/claim.js: POST endpoint, rate-limited per reader, refuses bad platforms, duplicate URLs, and repeat claims per chapter.
  • functions/api/reader/me.js: GET endpoint used by the gate component to pick between the email form, the share pane, and "continue".
  • functions/api/reader.js: issues readerId + unlocks['01']=true on sign-up; back-fills the same shape on link verification; the welcome email now explains the share flow.
  • functions/read/[slug]/full.js: reads subscriber.unlocks[slug] via ensureSubscriberShape (back-fills legacy records for chapter 1).
  • src/components/ReaderGate.astro: three states — email form (Ch.1 or unsigned), share pane with voice picker + platform tabs + quote textarea with signature + URL paste form (Ch.2+), "continue reading" (unlocked). Includes a quiet "Just get the book →" escape to /order.
  • Copy updates in agents.txt, llms.txt, and the well-known manifest so the new flow is explained to crawlers and agents; agents are told they must never share for a person.

KV shape (CLAIMS namespace):
reader:<sha256(token)> — per-device access (unchanged)
subscriber:<sha256(email)> — adds readerId and unlocks{slug}
receipt:<url_hash> — one per shared post
reader-receipts:: — guards one-per-chapter

Out of scope for this PR: on-request quote-card image renderer (functions/v/[slug].js), cron verification of receipts, /stitch and /receipts public pages. The backlink format knowware.systems/v/?r= is already baked into signatures so those can land later without a copy change.

Before: one email unlocked every chapter site-wide. After: email opens
Chapter 1 only; Chapters 2–9 and the capstone each open after the
reader posts one of that chapter's voices on Instagram, LinkedIn, X or
TikTok and pastes the post URL back.

- lib/server/share.js: pure helpers (platform regexes, canonical URL,
  reader id, claimShare, hasUnlock, ensureSubscriberShape). Tested with
  a fake KV in tests/share.test.mjs.
- functions/api/reader/claim.js: POST endpoint, rate-limited per reader,
  refuses bad platforms, duplicate URLs, and repeat claims per chapter.
- functions/api/reader/me.js: GET endpoint used by the gate component
  to pick between the email form, the share pane, and "continue".
- functions/api/reader.js: issues readerId + unlocks['01']=true on
  sign-up; back-fills the same shape on link verification; the welcome
  email now explains the share flow.
- functions/read/[slug]/full.js: reads subscriber.unlocks[slug] via
  ensureSubscriberShape (back-fills legacy records for chapter 1).
- src/components/ReaderGate.astro: three states — email form (Ch.1 or
  unsigned), share pane with voice picker + platform tabs + quote
  textarea with signature + URL paste form (Ch.2+), "continue reading"
  (unlocked). Includes a quiet "Just get the book →" escape to /order.
- Copy updates in agents.txt, llms.txt, and the well-known manifest so
  the new flow is explained to crawlers and agents; agents are told
  they must never share for a person.

KV shape (CLAIMS namespace):
  reader:<sha256(token)>              — per-device access (unchanged)
  subscriber:<sha256(email)>          — adds readerId and unlocks{slug}
  receipt:<url_hash>                  — one per shared post
  reader-receipts:<readerId>:<chap>   — guards one-per-chapter

Out of scope for this PR: on-request quote-card image renderer
(functions/v/[slug].js), cron verification of receipts, /stitch and
/receipts public pages. The backlink format knowware.systems/v/<id>?r=<readerId>
is already baked into signatures so those can land later without a
copy change.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@fromknowware
fromknowware merged commit 620df1c into main Nov 9, 2026
2 checks passed
fromknowware pushed a commit that referenced this pull request Nov 10, 2026
The voices are synthesized text attributed to real people. The share
pane shipped in #73 let readers copy a voice's cold-open and post it
on Instagram/LinkedIn/X/TikTok with the person's real name on the
byline. A methodology link in a hashtag does not undo that: to a
scrolling viewer it reads as a direct quote from Kate Crawford, Timnit
Gebru, Stuart Russell, Shannon Vallor, etc. — words they never wrote.

- src/components/ReaderGate.astro: remove the voice picker and the
  "Pick a voice" UI block. The share pane now shows platform tabs, a
  single read-only textarea with the chapter-level post, and the URL
  paste form. buildPost() writes the book's own words, no person named:
      Reading Knowware · Chapter N.
      A field guide for coordination between people, machines and context.
      #knowware-c<slug>-r/<readerId>  https://knowware.systems/r/<readerId>?c=<slug>
  Signature switches from #knowware-v<voice>- to #knowware-c<chapter>-;
  backlink switches from /v/<voice> to /r/<readerId>?c=<slug>.
- lib/server/share.js: accept voice=0 as the chapter-level share
  sentinel (1..81 stays validated for a future book-authored per-voice
  share that never names a person).
- functions/api/reader.js welcome email: drop "share one of its voices".
- llms.txt, agents.txt, .well-known manifest: explain the share is the
  book's words, never attributed to one of the 81 synthesized voices.

Tests unchanged, still 59/59.

Follow-up PR will do the clever version: chapter questions and the
chapter's causal diagram as the two things a reader can share. Both
are the book's own work. Neither is attributed to a person.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

2 participants