From 50d8a35bbccfe0c9ec511999e9e7f1fb31f3bdf6 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Fri, 2 Oct 2026 20:38:58 -0400 Subject: [PATCH 01/28] docs: add competitive clean-room research protocol --- CLEAN_ROOM_COMPETITIVE_RESEARCH.md | 76 ++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CLEAN_ROOM_COMPETITIVE_RESEARCH.md diff --git a/CLEAN_ROOM_COMPETITIVE_RESEARCH.md b/CLEAN_ROOM_COMPETITIVE_RESEARCH.md new file mode 100644 index 0000000000..5c451b4236 --- /dev/null +++ b/CLEAN_ROOM_COMPETITIVE_RESEARCH.md @@ -0,0 +1,76 @@ +# Competitive clean-room research protocol + +Status: implementation-side policy. + +This repository may accept independently implemented features that are informed by observable product behavior. Competitive research must use a strict observer/implementer split whenever the observed product contains GPL or other source that is not authorized for reuse in Manabi-owned code. + +## Roles + +### Observer + +The observer may inspect only public user-facing material: + +- README files and end-user documentation +- changelogs and release notes +- store listings, screenshots, and demo videos +- public issues or feature requests, limited to the described user-visible behavior +- ordinary black-box behavior of released applications and hosted demos + +The observer must not copy, summarize, transform, or transmit competitor source code, source-level identifiers, comments, patches, diffs, decompilation, binary inspection, or implementation explanations. + +If a public issue or release page contains code or a patch, the observer records only the externally stated input, user action, and visible result. The code or implementation discussion is ignored. + +### Sanitizer + +The sanitizer converts observer evidence into an independently written product contract. The contract may contain: + +- capabilities +- user journeys +- state transitions +- independently authored sample inputs +- visible expected outputs +- edge-case classes +- externally measurable performance budgets +- accessibility requirements +- acceptance tests + +The contract must not contain competitor names as provenance for individual requirements, source links, quotations from release notes, source symbols, source file names, comments, patches, diffs, or descriptions of how another product implements the behavior. + +### Implementer + +The implementer receives only the sanitized specification and this policy. The implementer may inspect and modify Manabi-owned or otherwise authorized target code as needed, subject to the repository's existing licensing boundaries. + +The implementer must not: + +- open the observer dossier +- browse competitor repositories +- search competitor source +- read competitor patches or source-bearing PRs/issues +- use source symbols, comments, or implementation descriptions from a competitor +- mechanically reproduce a competitor's UI assets or copyrighted expression + +If the specification is insufficient, the implementer must ask for a behavior-level clarification. A clarification must be answered by the observer/sanitizer without exposing source-derived material. + +## Separation + +Named source provenance and observation notes are stored outside this implementation branch. This branch intentionally contains only implementation-side policy plus the sanitized specification. + +The observer record is not an implementation dependency and must not be copied into this repository, linked from implementation comments, or attached to implementation issues. + +## Acceptance evidence + +An implementation PR derived from this program should record: + +1. the sanitized spec revision used; +2. which acceptance-test IDs are implemented or already satisfied; +3. externally observable before/after behavior; +4. benchmark results using the specification's reference workloads; +5. an implementer attestation that no prohibited competitor implementation material was consulted. + +The attestation is process evidence, not a claim that automation can prove copyright provenance. + +## Existing third-party boundaries + +This protocol does not replace the repository's existing license notices, contribution provenance rules, or dictionary-provider boundary. Third-party components already present in the target remain governed by their own licenses and repository policy. + +This document defines the additional separation required for competitive behavior research. From 60a1a5d72abc52974477e5d23e7b354cbf096aad Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Fri, 2 Oct 2026 20:39:00 -0400 Subject: [PATCH 02/28] spec: add sanitized reader competitiveness contract --- specs/clean-room-reader-competitive-spec.md | 876 ++++++++++++++++++++ 1 file changed, 876 insertions(+) create mode 100644 specs/clean-room-reader-competitive-spec.md diff --git a/specs/clean-room-reader-competitive-spec.md b/specs/clean-room-reader-competitive-spec.md new file mode 100644 index 0000000000..3f2b0909fe --- /dev/null +++ b/specs/clean-room-reader-competitive-spec.md @@ -0,0 +1,876 @@ +# Clean-room reader competitiveness specification + +Status: sanitized implementation contract +Revision: 2026-10-02 +Source provenance: intentionally excluded from implementation input + +## 1. Scope + +This specification defines observable behavior for a high-quality Japanese immersion reader across: + +- local book/library management +- EPUB reading and navigation +- Japanese typography and Unicode +- selection and dictionary lookup +- search, highlights, and return navigation +- images and media-heavy publications +- audio/read-along behavior +- mining/export context +- statistics and progress +- offline/recovery behavior +- large-library performance +- manga/OCR interoperability +- input, accessibility, and device behavior + +It does not prescribe architecture, algorithms, libraries, data structures, file names, class names, or implementation techniques. + +Existing product features not covered here remain governed by their existing contracts. An implementation may satisfy a requirement using any independently chosen design that produces the required visible behavior. + +Normative language: +- MUST: release-blocking requirement. +- SHOULD: expected unless a documented platform limitation prevents it. +- MAY: optional behavior. + +## 2. Product-level invariants + +CR-INV-001 — User-selected reading direction wins +A publication may request its own writing mode, spacing, sizing, indentation, columns, or viewport behavior. When the user explicitly selects a reader presentation, the visible reader MUST remain usable and MUST NOT become blank, crash, or jump to a nonsensical progress location because of conflicting publication styling. + +CR-INV-002 — Durable position is semantic, not visual +Changing viewport dimensions, font size, font, spacing, writing direction, page effect, safe-area padding, or orientation MUST preserve the user's logical reading position within reasonable text-anchor recovery. A reflow MAY move the anchor to a different screen, but MUST NOT silently jump chapters or reset to the beginning. + +CR-INV-003 — Text accounting is Unicode-safe +Lookup, search, highlights, progress, subtitle/read-along alignment, and mining context MUST agree on text boundaries for supplementary-plane characters, compatibility characters, ruby, numeric entities, and multi-code-unit characters. + +CR-INV-004 — Ruby is presentation plus annotation +Ruby readings MUST NOT be treated as duplicate book text for progress/search by default. The visible base text remains selectable at sub-ruby granularity. A lookup or highlight of a shorter word inside a ruby base MUST remain that shorter range unless the user explicitly expands it. + +CR-INV-005 — Restore is not reading +Hidden restore landings, preload positions, temporary chapter starts, and canceled navigation MUST NOT be credited as reading progress/statistics. + +CR-INV-006 — Background state has single ownership +Returning from background, media controls, another tab, another route, or crash/process restoration MUST NOT create duplicate playback, duplicate transcription, duplicate timers, or duplicate reader instances that act on the same logical session. + +CR-INV-007 — Partial failure preserves usable content +A broken image, bad cover, failed thumbnail, unavailable remote refresh, malformed optional metadata, or one failed batch item MUST NOT make otherwise valid books/dictionaries/content disappear. + +CR-INV-008 — Selection beats navigation gestures +When the user is selecting text or manipulating selection handles, reader swipe/page-turn gestures MUST NOT steal that gesture. + +CR-INV-009 — User data is recoverable +Reading position, highlights, notes, statistics, audio position, and other durable user state MUST survive ordinary reload/restart and MUST have explicit behavior when a book is temporarily unavailable. + +CR-INV-010 — Observable errors are actionable +For unsupported, missing, corrupt, or unreadable input, the UI MUST expose a stable error state with the item identity and a clear way to dismiss/retry/remove it. Infinite loading is a failure. + +## 3. Capability matrix + +The matrix is normative for the target experience, not a comparison to any external product. + +| Capability | Baseline | Extended acceptance | +| --- | --- | --- | +| EPUB import/open | MUST | batch/folder/provider import SHOULD | +| Plain text / HTML-like book import | existing behavior preserved | SHOULD remain interoperable | +| Vertical and horizontal Japanese | MUST | live switch SHOULD preserve anchor | +| Paginated and continuous reading | MUST | optional additional presentation modes MAY | +| Table of contents | MUST | nested and unusual navigation paths MUST resolve | +| In-book search | MUST | chapter context + active hit + literal punctuation behavior MUST | +| Word lookup | MUST | recursive lookup SHOULD | +| Local dictionary data | existing capability preserved | frequency/pitch/kanji presentation SHOULD | +| Ruby/furigana controls | MUST | show/hide/dim/toggle MAY | +| Highlights | MUST | exact-range recolor/delete SHOULD | +| Saved position/bookmarks | MUST | return stack SHOULD | +| Fullscreen image viewer | SHOULD | gallery SHOULD | +| Reading statistics | MUST if enabled | calendar/goals/edit/archive SHOULD | +| Word audio | SHOULD | multiple sources/source chooser MAY | +| Read-along audio/subtitles | SHOULD where feature enabled | background/resume/export MAY | +| Mining/export context | SHOULD | sentence + image/audio context SHOULD | +| Offline/local reading | MUST for imported local books | provider cache behavior SHOULD | +| Crash/reload restoration | MUST | process-death/background restoration SHOULD | +| E-ink-friendly mode | MAY | high-contrast/reduced animation SHOULD if offered | +| Manga/OCR overlay interoperability | MAY | selectable overlay + progress SHOULD if offered | +| Profiles/language contexts | MAY | same book in multiple contexts MUST not corrupt state if supported | + +## 4. Core user journeys + +### CR-FLOW-001 Import and open + +1. User chooses one or more supported book files. +2. Import begins with visible per-item or aggregate progress. +3. A valid book becomes visible in the library before optional heavy post-processing finishes when safe. +4. Selecting the book opens at the durable saved location, or the beginning for a first read. +5. If one item fails in a multi-item import, later valid items continue. +6. The final result distinguishes imported, duplicate/skipped, and failed items. + +Expected output: +- No valid item is lost because a sibling failed. +- A failed item names the user-visible file/title and provides a reason category. +- Reopening the same logical book does not create accidental duplicate user state unless duplicate copies are an explicit supported concept. + +### CR-FLOW-002 Reader restore + +1. Open a previously read book. +2. The initial visible stable page/viewport contains the saved anchor. +3. No unrelated chapter start flashes long enough to be interpreted as the restored location. +4. Statistics begin only after the final restore location is accepted and the product's tracking policy says reading has started. + +### CR-FLOW-003 Lookup from Japanese text + +1. User taps/selects a word. +2. The source range is visibly marked without reflowing surrounding text. +3. Lookup opens within the usable viewport. +4. The popup preserves enough sentence/source context for mining. +5. User can dismiss it and immediately look up the same range again. +6. If recursive lookup exists, selecting text inside the popup opens a child/result state without losing a deterministic way back. + +### CR-FLOW-004 Search inside a book + +1. User opens Search. +2. Entering literal Japanese text returns matching results grouped/labeled by publication location. +3. Spaces and punctuation are treated literally by default unless the UI clearly exposes another mode. +4. Selecting a result navigates to it and marks the active hit. +5. Navigating the reader clears or updates the active-hit state without leaving stale overlays. +6. Closing/reopening Search during the same book session SHOULD preserve query and selected result. + +### CR-FLOW-005 Highlight exact range + +1. User selects a subrange that may lie inside ruby text. +2. User creates a highlight. +3. The highlight covers exactly the selected base-text range. +4. Reopen/reflow/restart preserves the same semantic range. +5. Selecting that exact saved range permits color change or deletion without widening to adjacent ruby. + +### CR-FLOW-006 Internal link and return + +1. User activates an internal publication link or contents entry. +2. Target resource/fragment is revealed. +3. Progress and visible location agree with the target. +4. A Return action, when offered, restores the pre-jump reading point. +5. A canceled or stale jump MUST NOT replace the latest accepted location. + +### CR-FLOW-007 Audio/read-along + +When read-along is enabled: +1. User associates audio/subtitles/transcript with a book. +2. Playback may begin with or without a complete text match if that mode is supported. +3. Current cue/text is visibly indicated without changing text layout. +4. Backgrounding and returning preserves one playback session and current position. +5. Chapter-crossing cues reveal the correct text without transiently crediting hidden positions. +6. Lookup from currently highlighted text remains available. +7. Delay/speed changes update the active session predictably. + +### CR-FLOW-008 Library scale + +1. Library contains thousands of items. +2. User repeatedly scrolls through covers, changes sort, leaves and returns. +3. Covers may load progressively, but scrolling remains responsive. +4. Re-entering the library MUST NOT repeatedly decode full-resolution cover assets solely because cells were recycled. +5. A corrupt/transient thumbnail does not permanently hide the book or its valid cover source. + +### CR-FLOW-009 Recovery + +1. Reader is open with unsaved-in-UI but durable committed state. +2. Page/process/tab/app is terminated or crashes. +3. User reopens the product. +4. Last committed reading position, highlights and durable media state are restored. +5. No duplicate playback/reader session is created. + +## 5. Independently authored compatibility fixtures + +The fixture suite MUST be created from scratch for this project. It must not copy third-party test books, code, comments, or fixture markup. + +### CR-FIX-001 Ruby boundary book + +Content requirements: +- ruby base containing multiple lexical subranges +- adjacent ruby annotations +- ruby at a line/page/column boundary +- punctuation immediately before and after ruby +- nested emphasis around ruby where valid + +Example visible sentence: +彼は叱られても「本当に?」と聞き返した。 + +Acceptance: +- select only 叱 inside a larger ruby base: lookup/highlight starts and ends at the selected base character +- progress/search do not double-count visible base plus reading annotation +- hiding/showing furigana does not move durable position to another sentence +- vertical layout does not bleed highlight into adjacent column + +### CR-FIX-002 Supplementary Unicode book + +Include: +- 𠮟る +- 𠮷野家 +- 猪 +- ordinary BMP kanji around them +- emoji outside Japanese spans +- combining/variation-selector examples where the renderer supports them + +Acceptance: +- no crash or truncated scan at supplementary CJK +- search finds the exact sequence +- lookup range starts/ends on complete code points +- saving/reopening a location after the characters restores the same following text +- read-along/search/progress offsets do not drift after compatibility characters + +### CR-FIX-003 Entity equivalence book + +Include the same visible Japanese character represented directly and using numeric character references in separate paragraphs. + +Acceptance: +- visible text is identical +- search/progress location remains stable +- moving through the entity-heavy paragraph does not shift later anchors + +### CR-FIX-004 Nested navigation EPUB + +Independently construct: +- package at archive root +- navigation document inside a nested directory +- content resources in multiple sibling directories +- fragment links using relative paths +- a resource without a visible TOC label +- repeated labels and duplicate fragment IDs in different resources +- percent-encoded filename component + +Acceptance: +- contents labels appear in correct order +- nested relative links resolve +- fragment jump chooses the correct resource, not a same-named fragment elsewhere +- unlabeled spine/resource remains readable +- Back/Return restores the origin if supported + +### CR-FIX-005 Publisher-style conflict EPUB + +Publication stylesheet requests: +- vertical writing +- fixed heights +- indentation +- multi-column rules +- large line-height +- rules attached to image pages and nested containers + +Acceptance: +- user choosing horizontal reading gets visible horizontal content +- user choosing vertical reading gets visible vertical content +- neither mode blanks/crashes +- progress remains monotonic and near the previous logical anchor after switching + +### CR-FIX-006 Inline character-image EPUB + +Create a sentence in which one character-like glyph is represented as a small inline image with: +- intrinsic dimensions unlike text +- alt/fallback text +- a deliberately missing alternate copy +- ordinary large illustration elsewhere in the same chapter + +Acceptance: +- inline glyph aligns/sizes like nearby text within reasonable visual tolerance +- inline glyph is not treated as a standalone gallery illustration +- missing glyph shows usable fallback text +- large illustration remains available to image viewer/gallery + +### CR-FIX-007 Vertical punctuation book + +Include line/column-boundary cases for: +- 「」 +- 『』 +- !? +- ?! +- …… +- punctuation immediately after ruby +- very short final paragraph + +Acceptance: +- paired/closing punctuation is not stranded as an isolated visual page/column when avoidable under normal Japanese line-breaking rules +- leftmost final column remains visible +- page direction and controls match selected writing direction +- final partial page remains reachable + +### CR-FIX-008 Media-only sequence EPUB + +Three consecutive resources: +1. full-page image +2. full-page image +3. short text plus image + +Acceptance: +- each resource produces a distinct navigable step +- backward navigation reaches each preceding image in reverse order +- no consecutive image pages collapse into one or get skipped +- progress never exceeds valid book range + +### CR-FIX-009 Broken optional resources EPUB + +Include: +- missing nonessential image +- invalid optional cover reference with a valid text fallback +- one damaged thumbnail/derived cache entry simulated at runtime +- ordinary valid chapter text + +Acceptance: +- book opens and text remains visible +- missing optional resource has a contained placeholder/fallback +- regenerating or bypassing a bad derived thumbnail recovers visible library item + +### CR-FIX-010 Filename/import corpus + +Use display names: +- Book #01.epub +- query?mark.epub on platforms that permit the display name +- 吾輩は猫である・完全版 第01巻[特装].epub +- a title longer than 180 Unicode code points +- decomposed and composed Unicode equivalents +- spaces, parentheses, brackets, percent sign and non-Latin characters + +Acceptance: +- file display name is not interpreted as a URL fragment/query +- no silent truncation that makes distinct items collide +- long/non-Latin names remain identifiable in errors and library UI +- platform-rejected filesystem names are skipped as platform limitations, not simulated as successful filesystem writes + +### CR-FIX-011 Large-library corpus + +Generate synthetic metadata for: +- 5,000 books +- 3,000 distinct covers at realistic thumbnail dimensions +- 25 shelves/collections +- mixed title scripts and long titles +- 10% missing covers +- reading-progress distribution across whole range + +Acceptance: +- see benchmark section +- sorting is deterministic +- leaving/returning does not reset scroll unexpectedly unless product contract says so +- missing/corrupt derived thumbnails never remove book metadata + +### CR-FIX-012 Long/ruby-heavy chapter + +Generate: +- 150,000 visible Unicode code points in one resource +- at least 20,000 ruby annotations +- 2,000 inline emphasis spans +- periodic images +- search targets at start/middle/end + +Acceptance: +- reader eventually becomes interactive without unbounded blank screen +- search returns start/middle/end targets +- repeated lookup/page turns do not progressively degrade from leaked reader/popup instances + +### CR-FIX-013 Selection gesture corpus + +Run on touch/pointer devices: +- slow drag selection +- staggered two-finger taps +- short fast swipe +- diagonal selection-handle movement +- stylus tap/drag where available + +Acceptance: +- selection gestures do not page-turn +- genuine page swipes still work +- two-finger stagger is not misclassified as a page swipe +- swipe threshold zero, if supported, disables swipe but preserves explicit/hardware navigation + +### CR-FIX-014 Read-along boundary corpus + +Book text: +- short replies such as はい。/え? +- long gaps between matching passages +- punctuation split across inline markup +- chapter boundary in the middle of the audio timeline +- one image-only step +- compatibility/supplementary characters before later cues + +Subtitle/transcript: +- multiline cue +- cue around chapter boundary +- cue after long unmatched gap + +Acceptance: +- cue highlight includes intended punctuation without swallowing adjacent sentence +- chapter crossing reveals correct target directly +- later cues remain aligned after unusual Unicode +- image step follows explicit image-hold policy if offered +- lookup remains interactive on highlighted text +- background/resume keeps one active session + +### CR-FIX-015 Same-book multi-context corpus + +If language/profile contexts are supported, attach the same book bytes to two contexts with different display/lookup preferences. + +Acceptance: +- deleting/removing one context does not destroy the other's durable book state +- context-specific preferences do not leak unless documented as global +- global display preferences, if designated global, remain global consistently + +### CR-FIX-016 Manga/OCR overlay corpus + +If manga/OCR reading is in scope: +- five synthetic page images +- independently authored OCR boxes, including vertical, horizontal, overlapping-nearby and off-center text +- one page missing image +- one partial volume placeholder + +Acceptance: +- selectable text remains aligned during viewport resize and page-fit changes +- hidden duplicate OCR text is not exposed as a second lookup target +- missing page has contained error/placeholder +- progress across volume boundaries is deterministic + +## 6. Detailed acceptance tests + +### Typography / Unicode + +CR-AT-001 Ruby subrange selection +Given CR-FIX-001 is open, when the user selects a subrange inside a ruby base and creates a highlight, then the saved and restored highlight equals that exact base-text subrange. + +CR-AT-002 Ruby search accounting +Searching for base text returns one logical match per visible occurrence and does not return an extra match solely from the ruby reading. + +CR-AT-003 Supplementary lookup +Tapping/selecting 𠮟る opens lookup or a clean no-result state. It MUST NOT crash, truncate the following sentence, or select half of the character. + +CR-AT-004 Unicode offset continuity +Save a location immediately after 猪, reload, and compare the next 20 visible code points. They MUST match before/after. + +CR-AT-005 Vertical final column +Navigate to the final partial vertical page. The leftmost visible column and final punctuation MUST remain reachable. + +CR-AT-006 Paired punctuation +At configured boundary widths, closing quotation marks and paired !? sequences SHOULD remain visually attached according to the reader's documented Japanese line-breaking behavior. + +### Navigation / restore + +CR-AT-010 Nested nav resolution +Open each TOC entry from CR-FIX-004. Every entry MUST reveal the intended resource/fragment. + +CR-AT-011 Duplicate fragment isolation +Two resources contain the same fragment id. A link relative to resource B MUST resolve B, never the first global match. + +CR-AT-012 Restore without flash-credit +Persist a location mid-chapter, close, reopen. Tracking/statistics MUST NOT record characters/pages traversed solely during hidden restore. + +CR-AT-013 Reflow anchor +At a distinctive sentence, change font size, viewport width and reading orientation. After each settled reflow, the distinctive sentence or its immediate semantic neighborhood MUST remain the current reading anchor. + +CR-AT-014 Rapid opposing navigation +Trigger next/previous rapidly during a resource boundary. Final visible location MUST match the last accepted command; stale navigation MUST NOT win later. + +CR-AT-015 Internal-link progress +Activate an internal chapter link and then Return. Target and origin progress indicators MUST correspond to their actual text locations. + +### Publisher/media robustness + +CR-AT-020 Style conflict +Open CR-FIX-005 and force the opposite user writing mode from the publication style. Reader remains nonblank, interactive and position-stable. + +CR-AT-021 Broken image isolation +Remove a nonessential image resource. Book text and subsequent chapters still render. + +CR-AT-022 Inline glyph fallback +Break the inline character image in CR-FIX-006. Fallback text remains readable and does not create a gallery item. + +CR-AT-023 Media sequence reversibility +Navigate forward through all resources in CR-FIX-008 and back again. Observe every media-only step exactly once in each direction. + +CR-AT-024 Image zoom bounds +If fullscreen zoom exists, pinch/tap near an edge; zoom centers near the interaction point and panning cannot permanently move all image content outside the viewport. + +### Search / lookup / popup + +CR-AT-030 Literal punctuation search +Search for a string containing Japanese quotes or punctuation. Results MUST distinguish that literal query from the same text with punctuation removed unless an explicit normalization option is enabled. + +CR-AT-031 Leading whitespace +Entering accidental leading whitespace around an otherwise valid query MUST either trim it visibly/consistently or deliberately search it; it MUST NOT silently fail in a way indistinguishable from no matching dictionary data. + +CR-AT-032 Search active result +Select a search result. The target is highlighted/marked. Normal page navigation removes or updates stale active-result marking. + +CR-AT-033 Popup viewport containment +At top, bottom, left/right edges and in vertical text, lookup popup remains reachable and scrollable; no border/action region is permanently beyond viewport. + +CR-AT-034 Repeat same lookup +Lookup a word, dismiss popup, immediately lookup same word. Second popup works as a fresh interaction with no invisible blocker. + +CR-AT-035 Large-result scroll +Populate a lookup result tall enough to exceed viewport. User can reach first and final actions/content by scrolling without moving the underlying reader unexpectedly. + +CR-AT-036 Profile/context switch +If lookup profiles exist, switch profile while results are visible. Subsequent lookup reflects the selected profile; stale result state does not leak into a new query. + +### Selection / input + +CR-AT-040 Selection versus swipe +While dragging selection handles horizontally/diagonally, no page turn occurs. + +CR-AT-041 Multi-touch classification +Staggered two-finger taps on a page do not cause a swipe page turn. + +CR-AT-042 Swipe disable +If a zero swipe-threshold/disable setting exists, gesture page-turn stops while keyboard/hardware/explicit buttons continue. + +CR-AT-043 Hardware long press +If volume/page keys are bound to reader navigation, holding the key repeats the configured reader action predictably and does not switch to system volume after the first event unless the user exits reader ownership. + +CR-AT-044 Orientation +Rotate while reader is open. Reader stays open and restores the semantic anchor after layout settles. + +### Library/import + +CR-AT-050 Batch failure isolation +Import 10 valid items plus one intentionally invalid item in the middle. All later valid items still import; failure summary identifies the bad item. + +CR-AT-051 Special display names +Import files from CR-FIX-010. Names containing #, %, brackets and non-Latin characters remain intact as user-visible identity and never alter navigation as URL syntax. + +CR-AT-052 Long title +Import a title >180 code points. UI may visually ellipsize, but stored/user-accessible title identity MUST not silently collide with a different long title. + +CR-AT-053 Remote refresh resilience +If remote libraries exist, simulate transient refresh failure. Previously cached valid books remain visible; manual retry exposes failure rather than deleting the cache. + +CR-AT-054 Derived-cover recovery +Corrupt/delete one derived thumbnail. The book remains present and its cover can regenerate/fallback. + +### Audio/read-along + +CR-AT-060 Background single session +Begin playback, background/switch away, invoke media controls if available, then return. Exactly one audible session exists and one progress position is authoritative. + +CR-AT-061 Cue Unicode stability +Run CR-FIX-014 through cues before and after supplementary/compatibility characters. Later cue highlight remains on intended text. + +CR-AT-062 Chapter-crossing cue +Seek from a cue in chapter N to a cue in chapter N+1. Reader reveals the destination without visibly settling on chapter N+1 start first unless that is the actual cue. + +CR-AT-063 Lookup during highlight +Tap a word inside the current read-along highlight. Lookup works and closing it restores the current highlight/playback state. + +CR-AT-064 Pause/resume durability +Pause or background during long-running transcript/transcription preparation if feature exists; reopen and verify documented progress resume/reuse behavior. + +CR-AT-065 No-match mode +If playback without matched text is supported, missing/partial match data does not prevent basic audio transport controls. + +### Statistics + +CR-AT-070 Hidden navigation exclusion +Automated restore, hidden preload and canceled navigation do not add reading characters/time beyond the product's explicit tracking rules. + +CR-AT-071 Sheet/image pause +If statistics pause while modal sheets/fullscreen images are open, open one for at least 30 seconds and verify that interval is excluded. + +CR-AT-072 Deleted-book archive +If archived statistics are supported, delete a book, verify history remains in archive, reimport same logical book, and verify restoration follows explicit identity policy. + +CR-AT-073 Edit daily record +If daily editing is supported, changing one record updates period totals deterministically and does not duplicate the original row. + +### Recovery / lifecycle + +CR-AT-080 Reload restore +Reload mid-book after a committed position change. Position, highlights, appearance and other promised durable state restore. + +CR-AT-081 Process/crash recovery +Simulate process termination after state commit. Reopen without duplicate reader/audio instances. + +CR-AT-082 Re-entry leak probe +Open/close the same book and perform 20 lookup cycles, repeated 20 times. Interaction latency and memory SHOULD plateau rather than grow monotonically due to abandoned reader/popup instances. + +CR-AT-083 Stale async result +Start an expensive search/open/navigation, immediately switch book or issue a newer request. Late completion from the old operation MUST NOT overwrite current visible state. + +### Manga/OCR when enabled + +CR-AT-090 Overlay resize +Resize/rotate with OCR overlay visible. Text boxes remain associated with their intended image regions. + +CR-AT-091 Hidden text uniqueness +One visible OCR token should expose one selection/lookup target, not a duplicate offscreen layer. + +CR-AT-092 Partial volume +Open a volume missing one page asset. Reader shows a contained placeholder and can continue to later pages. + +## 7. Input/output examples + +These examples describe visible contracts, not implementation format. + +### Example A — ruby selection + +Input text displayed: +彼は叱られても帰らなかった。 + +Action: +Select only 叱 and create a highlight. + +Expected visible output: +- highlight covers 叱 only +- furigana remains visually associated with its ruby base according to current furigana mode +- reopening highlight editor targets the same range + +Forbidden outcome: +- entire multi-character ruby base is highlighted without user selection +- adjacent column is marked in vertical mode + +### Example B — supplementary character + +Input: +𠮟るのは簡単だ。 + +Action: +Tap 𠮟る, then save reading position after the sentence and reload. + +Expected: +- lookup or explicit no-result state opens +- no crash +- after reload, next sentence remains the same logical next sentence + +### Example C — nested fragment + +Archive-visible conceptual paths: +OPS/nav/nav.xhtml +OPS/text/ch01.xhtml#target +OPS/text/ch02.xhtml#target + +Action: +From ch02, activate relative link to #target intended for ch02. + +Expected: +ch02 target is revealed. Same fragment name in ch01 is irrelevant. + +### Example D — batch import + +Input: +11 selected files: ten valid synthetic EPUBs and one invalid archive in position 6. + +Expected summary: +10 imported +1 failed +failed item shown by display name with stable reason category + +No valid item after position 6 is skipped merely because position 6 failed. + +### Example E — literal search + +Book contains both: +「そうです。」 +そうです + +Query: +「そうです。」 + +Expected: +Literal quoted occurrence matches. The unquoted occurrence is not considered the same match unless the user explicitly chooses a normalization mode that says punctuation is ignored. + +## 8. Benchmark protocol + +Performance results MUST be externally measurable at the product boundary. Internal algorithm timing alone is insufficient. + +Record: +- commit/build identifier +- browser/device + OS +- cold/warm state +- fixture ID and size +- median, p95 and maximum for at least 20 repetitions where practical +- memory before/after long-run scenarios +- failures/timeouts + +Reference environments: +A. Desktop baseline: current stable Chromium on a typical 4-core/8-core consumer machine with 16 GB RAM. +B. Safari baseline: current supported WebKit/Safari desktop or iPhone class device. +C. Constrained mobile: representative mid-range Android device or throttled equivalent. +D. E-ink device only for e-ink-specific UI if the product claims such support. + +Thresholds are product targets, not measurements copied from any other product. + +### CR-BENCH-001 Warm page turn + +Fixture: medium publication already open. +Measure: input event to visually settled next/previous page. + +Desktop: +- median <= 100 ms for no-animation mode +- p95 <= 180 ms for no-animation mode + +Animated mode: +- input feedback begins <= 100 ms +- animation duration may be longer but MUST be deterministic and cancelable + +Constrained mobile: +- p95 <= 300 ms no-animation + +### CR-BENCH-002 Warm lookup + +Fixture: representative installed local dictionary set already initialized. +Measure: tap/selection accepted to first meaningful popup result or explicit no-result state. + +Desktop: +- median <= 120 ms +- p95 <= 250 ms + +Constrained mobile: +- p95 <= 500 ms + +No benchmark pass if the popup appears empty and fills substantially later without a visible loading state. + +### CR-BENCH-003 In-book search + +Fixture: 1,000,000 visible Unicode code points across >=100 resources, including ruby and supplementary CJK. +Query appears near beginning, middle and end. + +Targets: +- UI acknowledges search <=100 ms +- first result batch <=300 ms desktop +- complete literal scan <=2.0 s desktop +- cancellation/new query takes visible precedence <=150 ms +- stale old results never replace the new query + +### CR-BENCH-004 Ruby-heavy chapter open + +Fixture: CR-FIX-012. +Targets: +- first stable readable content <=1.5 s warm desktop +- lookup becomes usable <=2.0 s +- no unbounded blank screen +- after 100 page/lookup interactions, p95 interaction latency is not >2x first-20-interaction p95 without a documented resource reason + +### CR-BENCH-005 Large library + +Fixture: CR-FIX-011, 5,000 books. + +Targets desktop: +- first usable library viewport <=1.0 s from already-open local database +- sort/filter action visibly acknowledged <=100 ms +- p95 time to stable sorted first viewport <=500 ms +- 60-second repeated scroll has <=1% long frames above 100 ms, excluding deliberate image decode started by opening a book +- returning to library does not cause full-size cover re-decode for every previously seen item + +Targets constrained mobile: +- first usable viewport <=2.0 s +- p95 sorted first viewport <=1.0 s + +### CR-BENCH-006 Restore + +Fixture: medium book, saved position at 70%, 50 highlights, optional audio position. + +Targets: +- stable restored text <=1.0 s warm desktop / <=2.0 s constrained mobile +- no visible wrong-chapter steady state >250 ms +- no progress/statistics mutation caused solely by hidden restoration + +### CR-BENCH-007 Re-entry stability + +Scenario: +20 cycles of open book -> 10 lookups -> close, repeated in same process. + +Pass: +- no crash +- no duplicate popup/input layer +- retained memory after GC/idle reaches a bounded plateau appropriate to caches +- final-cycle warm lookup p95 <=2x first-cycle p95 + +The exact memory ceiling is platform-specific; monotonic unbounded growth fails regardless of absolute number. + +### CR-BENCH-008 Audio background return + +Measure 20 background/foreground cycles during playback. + +Pass: +- zero duplicate audible playback sessions +- authoritative position drift <=250 ms beyond normal media clock tolerance after each return +- controls remain responsive +- no progressive UI duplication + +## 9. Accessibility and interaction requirements + +CR-A11Y-001 +All primary reader sheets/tabs/menus MUST have accessible names and stable focus order. + +CR-A11Y-002 +Opening a lookup/search/settings sheet MUST move or expose focus appropriately without losing the semantic reading anchor. + +CR-A11Y-003 +Closing modal reader UI MUST restore focus to a sensible reader control/content location. + +CR-A11Y-004 +High-contrast/e-ink themes MUST preserve selected/unselected distinction without relying solely on subtle color. + +CR-A11Y-005 +Text zoom/font-size increase MUST NOT make compact labels overlap essential controls; oversized popups MUST remain scrollable/reachable. + +CR-A11Y-006 +Reduced-motion preference MUST remove unnecessary motion while preserving navigation feedback. + +CR-A11Y-007 +Hardware keyboard paging/navigation MUST not fire while focus is inside text input, note editor, search field or other control that owns that key. + +## 10. Failure taxonomy + +Tests and telemetry/logs may classify failures with implementation-neutral categories: + +- IMPORT_UNSUPPORTED +- IMPORT_UNREADABLE +- IMPORT_PARTIAL_FAILURE +- RESOURCE_OPTIONAL_MISSING +- RESOURCE_REQUIRED_MISSING +- NAV_TARGET_UNRESOLVED +- NAV_STALE_REQUEST +- LOOKUP_NO_RESULT +- LOOKUP_UNAVAILABLE +- SEARCH_CANCELED +- SEARCH_FAILED +- MEDIA_UNAVAILABLE +- MEDIA_MATCH_PARTIAL +- STORAGE_TEMPORARILY_UNAVAILABLE +- RESTORE_UNRESOLVED +- USER_ACTION_CANCELED + +Exact internal enum names are not mandated. User-visible errors SHOULD use plain language rather than these machine-oriented labels. + +## 11. Implementation sequencing + +This is not an implementation prescription; it is a risk-first acceptance order. + +Phase A — build the independent fixture corpus and executable regressions: +CR-FIX-001 through CR-FIX-015, plus acceptance IDs 001–083 relevant to current features. + +Phase B — make current behavior pass correctness regressions: +Unicode/ruby, navigation/style conflict, selection, restore, batch import, broken resources. + +Phase C — lifecycle and media: +background ownership, crash/reload restoration, stale asynchronous results, read-along boundary cases. + +Phase D — scale: +large library, long chapter, search and re-entry benchmark suite. + +Phase E — optional surfaces: +manga/OCR, e-ink, profile-specific extensions not already present. + +A phase may discover that the current product already passes a requirement. In that case, add or retain a regression test and record it as satisfied; do not rewrite working code merely to mimic another product. + +## 12. Definition of done + +The clean-room competitiveness pass is complete for a feature area when: + +1. every in-scope MUST acceptance test has an automated test or a documented physical-device/manual test where automation is not credible; +2. all independently authored fixtures are stored with project-owned provenance and licenses; +3. benchmark results meet thresholds or a specific exception is documented; +4. no test depends on competitor source, symbols, comments, patches, internal architecture or copied fixture data; +5. implementation PR description references only this sanitized spec and target-side evidence; +6. the implementer attests that prohibited competitor implementation material was not consulted; +7. review confirms the change improves or preserves observable behavior without introducing a second hidden implementation solely for the test. + +## 13. Implementer handoff text + +Use only this specification, the clean-room policy, and authorized target repository material. + +Do not search for or inspect the products that motivated these requirements. Do not open competitor repositories, source-bearing issues/PRs, patches, diffs, symbols, comments, or implementation descriptions. Do not request the observer dossier. + +First create the independent fixtures and acceptance tests. Run them against current target behavior to establish which requirements already pass. Then make the smallest coherent target-owned changes needed to satisfy failing requirements. Preserve existing working behavior and licensing boundaries. Record benchmark methodology and results. + +If a requirement is ambiguous, stop on that requirement and request a behavior-only clarification by acceptance-test ID. Continue with unambiguous requirements rather than researching the external product. From 563a5661bb9e8c8d23d12111225163a74b8190c6 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Fri, 2 Oct 2026 21:47:07 -0400 Subject: [PATCH 03/28] docs: deepen clean-room evidence and taint protocol --- CLEAN_ROOM_COMPETITIVE_RESEARCH.md | 95 ++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/CLEAN_ROOM_COMPETITIVE_RESEARCH.md b/CLEAN_ROOM_COMPETITIVE_RESEARCH.md index 5c451b4236..8a54cd241a 100644 --- a/CLEAN_ROOM_COMPETITIVE_RESEARCH.md +++ b/CLEAN_ROOM_COMPETITIVE_RESEARCH.md @@ -74,3 +74,98 @@ The attestation is process evidence, not a claim that automation can prove copyr This protocol does not replace the repository's existing license notices, contribution provenance rules, or dictionary-provider boundary. Third-party components already present in the target remain governed by their own licenses and repository policy. This document defines the additional separation required for competitive behavior research. + + +## Evidence classification + +Observer notes must distinguish how a behavior was learned: + +- **documented** — explicitly stated in public end-user documentation, store copy, or release notes; +- **reported** — described by a user or maintainer as externally visible behavior in a public issue; +- **observed** — reproduced through ordinary black-box use of a released build or hosted product; +- **inconclusive** — attempted but not reliably reproducible or blocked by environment/device/account requirements. + +A documented or reported behavior must never be rewritten as “observed” unless a black-box run actually reproduced it. + +The sanitizer may promote an edge case into an acceptance requirement even when it is only documented/reported, but the implementation contract must describe the independently chosen desired behavior rather than claiming the external product actually demonstrated it. + +## Screenshot and video rule + +Screenshots and demo videos may be used by the observer to understand: + +- available controls; +- user-visible state transitions; +- information hierarchy; +- interaction sequence; +- error/empty/loading states; +- responsive or device-specific behavior. + +They must not be used to reproduce distinctive visual expression. The sanitizer must translate screenshot evidence into functional requirements and generic usability constraints, not pixel dimensions, proprietary icons, exact copy, distinctive animation choreography, artwork, or a copied menu hierarchy. + +An implementation should follow the target product's own design system even when the behavior was prompted by screenshot evidence. + +## Black-box test boundary + +Ordinary-user testing may exercise public controls and inputs, create synthetic content, record externally visible output, and measure wall-clock latency. + +The observer must not use: + +- decompilation or package extraction; +- debugger or symbol inspection; +- source maps intended for development rather than ordinary users; +- private/internal APIs discovered by reverse engineering; +- DOM/source inspection whose purpose is to reveal implementation rather than verify visible semantics; +- network interception to infer private internal protocols. + +Publicly documented interoperability APIs may be tested as APIs, but their request/response contract must be recorded separately from any client implementation. + +## Observation record minimum fields + +Each observer record should contain: + +1. evidence ID; +2. product/build/version when known; +3. platform/browser/device; +4. evidence class; +5. public source or black-box preconditions; +6. user-visible input; +7. user action; +8. visible output; +9. uncertainty/limitations; +10. sanitized acceptance-family IDs, if any. + +Implementation workers must not receive this record. + +## Taint handling + +If prohibited implementation material is accidentally exposed to an observer note: + +1. mark that note contaminated; +2. do not sanitize from it; +3. independently reacquire the behavior from an allowed user-facing source or black-box run; +4. create a new observation record without copying language from the contaminated note; +5. only then derive or restore the sanitized acceptance requirement. + +If an implementer is exposed to prohibited competitor implementation material for a feature, that worker must not continue as the clean-room implementer for that feature. Preserve target-side work only if its independent provenance can be established by project owners/review. + +## Clarification firewall + +Implementer questions must reference sanitized requirement IDs and ask only about desired observable behavior, for example: + +- “For CR-AT-104, should punctuation remain part of sentence context?” +- “For CR-SYNC-006, should a same-revision conflict prefer local, remote, or explicit user choice?” + +The observer/sanitizer response must not name the motivating competitor or explain its mechanism. It should answer with a target-owned behavioral decision or state that the requirement remains unspecified. + +## Similarity review + +Before merging a competitively motivated UI change, reviewers should separately check: + +- the functional requirement is traceable to the sanitized contract; +- wording is target-authored; +- visual treatment follows the target design system; +- icons/artwork are target-owned or properly licensed; +- control grouping is justified by target workflows rather than copied arrangement; +- test fixtures and example content are independently authored. + +Clean-room process protects implementation provenance; it is not permission to copy protected visual expression. From cb55c0305491efca832396048038d7ada52ea26b Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Fri, 2 Oct 2026 21:50:13 -0400 Subject: [PATCH 04/28] spec: add adversarial clean-room qualification matrix --- ...n-room-reader-adversarial-qualification.md | 760 ++++++++++++++++++ 1 file changed, 760 insertions(+) create mode 100644 specs/clean-room-reader-adversarial-qualification.md diff --git a/specs/clean-room-reader-adversarial-qualification.md b/specs/clean-room-reader-adversarial-qualification.md new file mode 100644 index 0000000000..5a12dad34c --- /dev/null +++ b/specs/clean-room-reader-adversarial-qualification.md @@ -0,0 +1,760 @@ +# Clean-room reader adversarial qualification plan + +Status: sanitized implementation input +Revision: 2026-10-02 deep pass +External source provenance: intentionally absent + +This document supplements `clean-room-reader-competitive-spec.md`. It turns broad behavior requirements into adversarial, metamorphic, cross-engine, state-transition, and scale tests. It does not prescribe implementation. + +## 1. Test philosophy + +A reader should be tested as a long-lived stateful system, not just as a renderer. + +Qualification must cover: + +- the same logical text represented in different legal forms; +- the same semantic position across reflow and device changes; +- overlapping input owners such as selection, popup, reader navigation and browser chrome; +- stale asynchronous work completing after newer intent; +- local/remote state disagreement; +- partial corruption or missing optional resources; +- large-but-valid data; +- long-running repeated use rather than only a fresh launch; +- external integrations entering and leaving the reader. + +Tests should prefer project-authored synthetic fixtures whose expected semantics are obvious from inspection. + +## 2. Additional invariants + +### CR-INV-011 — Semantic context crosses visual boundaries + +Sentence/source context used for lookup, mining, audio or notes MUST be defined from logical text, not from the current page rectangle. A visual page, OCR line, inline span, or temporary render chunk MUST NOT truncate a sentence unless the product explicitly defines that boundary as semantic. + +### CR-INV-012 — Newer user intent supersedes stale work + +When operation B supersedes operation A, any later completion from A MUST NOT replace B's visible state, durable state, progress, popup, cover, query results or media ownership. + +### CR-INV-013 — Sync never silently rolls a newer state backward + +Remote refresh, reconnect, retry, reauthentication or metadata repair MUST NOT silently replace a known-newer local reading state with an older remote state. Ambiguous conflicts require a deterministic documented policy or explicit user resolution. + +### CR-INV-014 — Display identity is not storage escaping + +Filesystem/cloud-safe encoding, path normalization and provider naming constraints MUST NOT silently mutate the user's canonical display title or merge two distinct titles. + +### CR-INV-015 — Context-specific state stays scoped + +If one logical book may be attached to multiple language/profile contexts, removing or editing one context MUST NOT destroy another context's state. Global settings, if any, must be explicitly designated global. + +### CR-INV-016 — Derived caches are disposable + +A thumbnail, search index, render cache, OCR cache, remote-list cache or other derived artifact may improve performance but MUST NOT become the only copy of user-authored or original imported data. + +### CR-INV-017 — Popup interaction owns its pointer stream + +Once an interaction is accepted by an open popup/dialog/selection surface, that same pointer/gesture MUST NOT also trigger the underlying reader's page turn, pan, lookup, dismissal or navigation unless explicitly designed as a chained action. + +### CR-INV-018 — Pagination does not redefine text + +Page count and visual page boundaries may change with layout. They MUST NOT change sentence content, vocabulary-state identity, highlight ranges or the logical order of source text. + +## 3. Additional independent fixtures + +### CR-FIX-017 Cross-page sentence book + +Create paragraphs where one sentence is forced to span: +- two paginated screens; +- multiple inline elements; +- a ruby span; +- an inline image with alt text between clauses. + +Include unique sentinel words at the sentence start and end. + +Acceptance: +- mining/source-context extraction contains both sentinels when the semantic sentence spans the page break; +- visual page change alone does not alter the sentence string; +- returning to the previous page does not duplicate or lose words; +- popup dismissal does not leave stale sentence highlighting. + +### CR-FIX-018 OCR line-break context + +Create a synthetic manga page with one logical sentence split across three OCR rectangles and two visual line breaks. + +Acceptance: +- a lookup in the middle rectangle can expose the complete logical sentence when OCR reading order connects the boxes; +- line breaks used only for geometry do not become mandatory sentence terminators; +- duplicate OCR rectangles do not duplicate sentence text; +- user-selected text still maps to one visual location. + +### CR-FIX-019 Rapid-page-state book + +Create five short pages where each page contains: +- a distinct vocabulary state marker; +- a unique search target; +- a unique cover-like inline image; +- a unique delayed asynchronous decoration request in the test harness. + +Acceptance: +- flip 1→2→3→4 quickly; +- after all delayed tasks settle, page 4 displays only page-4 state; +- late results from pages 1–3 are ignored; +- back to page 3 reconstructs page-3 state from authoritative data, not stale page-3 work retained from the previous visit. + +### CR-FIX-020 Sync conflict corpus + +Generate two replicas of the same logical book state: + +Case A: +- local progress revision 12 at 72%; +- remote progress revision 11 at 64%. + +Case B: +- local revision 12 at 72%; +- remote revision 13 at 75%. + +Case C: +- same revision/timestamp class but conflicting highlight edits. + +Case D: +- provider reconnect occurs after local progress changed while credentials were expired. + +Acceptance: +- A never silently rolls local progress backward; +- B follows documented newer-state policy; +- C follows explicit merge/conflict policy rather than dropping one edit silently; +- D reconnect cannot treat rediscovered older remote metadata as authoritative merely because the connection is new. + +### CR-FIX-021 Rename and storage-safety corpus + +Create a series with local and remote children using titles containing: +- reserved path punctuation; +- leading/trailing spaces; +- composed/decomposed Unicode; +- two titles that sanitize to the same naïve filename; +- one remote-only child; +- one child whose rename operation is forced to fail. + +Acceptance: +- display titles remain the user-authored strings; +- storage names may differ but cannot create undetected collisions; +- parent rename does not strand or hide an undownloaded child; +- partial rename reports per-item results; +- retry is idempotent; +- a failed remote rename does not revert already confirmed unrelated local metadata without policy. + +### CR-FIX-022 Same-book contexts + +Attach one byte-identical book to contexts A and B. + +A: +- Japanese lookup profile; +- vertical layout; +- progress 40%. + +B: +- another language/learning profile; +- horizontal layout; +- progress 10%. + +Acceptance: +- removing context B does not remove A; +- changing B's lookup state does not change A unless the setting is explicitly global; +- any shared physical file ownership remains reference-safe; +- deleting the physical file has an explicit effect on both metadata records without silently merging their personal state. + +### CR-FIX-023 Stale-cache query corpus + +Create three queries whose results intentionally complete out of order: +- Q1 slow; +- Q2 medium; +- Q3 fast. + +Also create optional cached enrichment from a previous query. + +Acceptance: +- issuing Q1→Q2→Q3 rapidly ends with Q3 visible; +- no text/enrichment from Q1 or Q2 appears after Q3 settles; +- clearing search retires all outstanding visible-result work; +- reopening history may restore prior results only as an explicit history action. + +### CR-FIX-024 TTS punctuation corpus + +Sentences end with: +- 。 +- !」 +- ?」 +- …… +- a closing parenthesis; +- ruby immediately before closing punctuation; +- an inline emphasis element wrapping the final phrase. + +Acceptance: +- read-along proceeds to the next sentence for every supported punctuation form; +- closing punctuation is included/excluded consistently according to the product's sentence contract; +- jumping between sentence N and N+2 repeatedly does not prevent later automatic continuation; +- stopping/leaving the reader terminates reader-owned TTS according to lifecycle policy. + +### CR-FIX-025 Final-page pagination corpus + +Generate books whose laid-out lengths produce: +- exactly one full page; +- one full page plus one line; +- N exact full pages; +- N pages plus one glyph; +- a final image-only page; +- a final ruby-only-short-line edge case. + +Acceptance: +- X/Y never reports X > Y; +- the final reachable page reports X = Y; +- no empty ghost page is inserted solely by rounding; +- backward navigation from final page restores all preceding text; +- changing font size may change Y but preserves semantic final content. + +### CR-FIX-026 Provider-placeholder library + +Create 100 local items and 100 metadata-only remote placeholders. + +Acceptance: +- placeholder is visually/semantically distinguishable from offline-readable item; +- opening a placeholder follows download/connect flow rather than an infinite reader load; +- a missing cover does not block the placeholder row/card; +- sorting and searching include/exclude placeholders according to documented policy; +- failed provider refresh does not delete last-known placeholder metadata. + +### CR-FIX-027 Cache corruption matrix + +Independently corrupt one derived artifact at a time: +- cover thumbnail; +- local text search index; +- render snapshot; +- remote listing cache; +- optional media analysis cache; +- OCR derivative. + +Acceptance: +- original book/user state survives; +- product either rebuilds, bypasses or reports the derived failure; +- no corruption is propagated back to the original file solely from a bad cache; +- repair does not duplicate user annotations. + +### CR-FIX-028 Mixed-input interaction page + +Provide a reader page with: +- selectable text; +- an open popup taller than the viewport; +- an internal link; +- a scrollable popup subregion; +- reader page-swipe enabled; +- browser/OS text selection handles; +- mouse, touch, trackpad and stylus test paths where available. + +Acceptance: +- gestures are owned by the surface where they begin unless documented otherwise; +- popup scrolling cannot turn the book page; +- dragging a selection handle cannot pan/turn the page; +- tapping a popup link does not also create a second lookup; +- tap outside dismisses exactly one modal layer according to stack order; +- a close control remains reachable at large text scale. + +### CR-FIX-029 OCR ordering corpus + +Create page files: +- page_001.jpg +- page_002.jpg +- page_010.jpg +- page_4_#001.jpg +- page_4_001.jpg +- page_4_%23001.jpg +- full-width digit variants +- non-Latin stems. + +Define expected order explicitly in fixture metadata rather than relying on lexical sort. + +Acceptance: +- reader honors declared/derived natural order deterministically; +- # and percent sequences are not mistaken for URL fragments; +- reimport produces the same order; +- cloud/local provider round-trip does not change order. + +### CR-FIX-030 Large remote catalog + +Simulate: +- 20,000 remote metadata records; +- 2,000 local items; +- 5% remote-only placeholders; +- 10% missing covers; +- provider pagination; +- credentials expiring during page 3; +- one later reconnect. + +Acceptance: +- first usable viewport does not wait for the entire remote catalog when progressive listing is possible; +- already loaded records remain stable during later-page failure; +- reconnect resumes/reloads according to documented policy without duplicating entries or rolling progress backward; +- visible-first cover loading is bounded. + +## 4. Acceptance suites + +### Semantic context + +CR-AT-100 Cross-page sentence integrity +Create mining/context from the middle of CR-FIX-017. Output MUST contain the same logical sentence before and after a repagination that moves the page break. + +CR-AT-101 OCR line break is not automatically sentence break +Use CR-FIX-018. Geometry-only OCR line breaks MUST NOT truncate context if fixture reading order says the sentence continues. + +CR-AT-102 Context range remains inside intended sentence +A lookup near a paragraph boundary MUST NOT absorb an unrelated next sentence merely to cross a page boundary. + +CR-AT-103 Ruby reading does not replace source phrase +Source-context text uses the canonical visible/base-text policy rather than accidentally substituting ruby readings for ordinary source text. + +CR-AT-104 Alt-text policy is explicit +Inline image alt text that represents a character may participate in logical text according to the publication projection policy; decorative image alt text MUST NOT silently become unrelated mining context. + +### Input ownership + +CR-AT-110 Popup scroll ownership +Open oversized popup and scroll inside it. Underlying reader position MUST NOT change. + +CR-AT-111 Popup link ownership +Activate a link/control inside popup. Exactly the popup's intended action occurs; no simultaneous reader lookup/page action. + +CR-AT-112 Selection-handle ownership +Drag selection handle across more than the configured page-swipe distance. Selection changes, page does not. + +CR-AT-113 Touch dismissal stack +With nested/child popup state, outside tap dismisses only the topmost expected layer; invisible layers MUST NOT remain to block later input. + +CR-AT-114 Trackpad modality +Small trackpad zoom/pan gestures, if supported, SHOULD produce proportional continuous response rather than being coerced into coarse wheel/page steps. + +CR-AT-115 Input inside editable control +Reader/global lookup hotkeys and pointer scanners MUST NOT interfere with cursor placement/editing inside search, note or text-entry controls. + +### Pagination/state fencing + +CR-AT-120 Rapid flip stale-state isolation +Use CR-FIX-019. After rapid navigation settles, no decoration/state from an older page may appear on the final page. + +CR-AT-121 Last-page correctness +Run all CR-FIX-025 variants. Final reachable page displays X = Y and no content is missing. + +CR-AT-122 Backward completeness +Navigate forward then backward through a sentence split across pages. All source text returns in original order. + +CR-AT-123 Malformed-resource containment +A malformed noncritical publication resource may be skipped or shown as an error according to policy, but MUST NOT leave the entire book in infinite loading when later valid resources are independently readable. + +CR-AT-124 Fast repeated navigation persistence +Persisted resume state after a burst reflects the final accepted page/location, not an intermediate callback. + +### Sync and provider state + +CR-SYNC-001 Older remote state cannot win on reconnect +Given local newer progress and remote older progress, reconnect MUST NOT silently roll back local progress. + +CR-SYNC-002 Newer remote state follows policy +Given an unambiguously newer remote state, behavior follows the documented import/merge policy and is visible if it changes local position. + +CR-SYNC-003 Ambiguous edit conflict +Concurrent annotation edits cannot silently discard one side without documented conflict resolution. + +CR-SYNC-004 Provider failure preserves last-known library +Transient automatic provider failure keeps previously known valid items/placeholders visible. + +CR-SYNC-005 Destructive remote overwrite confirmation +If an action replaces an existing remote backup rather than merging/versioning it, explicit confirmation is required. + +CR-SYNC-006 Partial rename truthfulness +If three of five child renames succeed, UI reports three success/two failure (or an equivalent accurate state), never a single unconditional success. + +CR-SYNC-007 Reconnect idempotence +Repeated reconnect/retry does not duplicate books, annotations, statistics or placeholders. + +CR-SYNC-008 Clock skew +If sync policy uses timestamps, run replicas with ±24-hour device skew. Behavior MUST follow a version/content policy that is documented; raw device clock alone MUST NOT cause silent destructive loss where stronger identity/version data exists. + +CR-SYNC-009 Metadata placeholder distinction +Remote metadata without local bytes MUST NOT be represented as fully offline-readable. + +CR-SYNC-010 Context deletion isolation +Deleting one logical context of CR-FIX-022 MUST NOT destroy sibling-context state. + +### Cache isolation + +CR-CACHE-001 Stale query completion +Q3 remains visible after late Q1/Q2 completions. + +CR-CACHE-002 Clear retires visible work +Clear/reset action cannot be followed by a late old result reappearing. + +CR-CACHE-003 Derived cache loss +Deleting any one derived cache from CR-FIX-027 does not delete the book or annotations. + +CR-CACHE-004 Account/provider cache scope +Switching account/provider context MUST NOT display a previous account's cached private library state as current. + +CR-CACHE-005 Cover refresh +A changed authoritative cover eventually replaces stale cached cover while library identity/progress stays unchanged. + +### TTS/read-along + +CR-AT-130 Closing-punctuation continuity +Run CR-FIX-024 and verify next-sentence progression for all supported punctuation forms. + +CR-AT-131 Repeated sentence jumps +Perform 30 alternating sentence jumps, resume automatic playback, and verify progression continues. + +CR-AT-132 Exit ownership +Leave the reader while reader-owned TTS/audio is active. Playback behavior matches explicit background policy; it MUST NOT become an orphan session. + +CR-AT-133 Page transition continuity +Read-along crossing a visual page boundary does not stop solely because layout split the sentence. + +### OCR/manga + +CR-OCR-001 Duplicate box suppression +Two geometrically/equivalently duplicated OCR boxes expose one logical selectable text occurrence according to dedup policy. + +CR-OCR-002 Hit-target stability +Press/hold/tap on the same OCR box without zoom or layout change. Box geometry MUST NOT jump merely because pointer state changed. + +CR-OCR-003 Natural page ordering +CR-FIX-029 opens pages in fixture-declared order across local and provider round-trip. + +CR-OCR-004 User correction durability +If OCR editing is supported, edit text/geometry, close/reopen, and verify correction persists without modifying the original source image. + +CR-OCR-005 Undo/original restoration +If OCR version/edit history is supported, undo/redo and restore-original are deterministic and do not delete unrelated annotations/progress. + +CR-OCR-006 Alternate OCR versions +If multiple OCR versions exist, switching version changes selectable text while preserving page identity/progress. + +### Knowledge overlays when enabled + +CR-KNOW-001 State visual update +Changing a word's learning state updates every currently visible occurrence that shares that vocabulary identity without requiring unrelated navigation. + +CR-KNOW-002 Page isolation +A late state update from previous page cannot recolor a different token on current page merely because indexes coincide. + +CR-KNOW-003 Native ruby compatibility +Generated learner furigana MUST NOT duplicate, corrupt or make native publication ruby unselectable. + +CR-KNOW-004 Unknown-only furigana +If furigana can be limited by learner state, changing a word between known/unknown predictably toggles only the intended reading annotation. + +CR-KNOW-005 Overlay opt-out +Disabling overlay restores readable source presentation and does not require reimporting the book. + +## 5. Metamorphic tests + +Metamorphic testing verifies that transformations which should not change semantics do not change results. + +### CR-META-001 Unicode serialization +Serialize equivalent eligible characters/entities through alternate legal source encodings while keeping canonical visible text constant. + +Expected: +- search match count and logical order remain equivalent; +- saved locator witness resolves to equivalent visible text; +- sentence context is semantically equivalent. + +### CR-META-002 Inline markup fragmentation +Split one sentence into many inline spans/emphasis elements without changing visible text. + +Expected: +- search, sentence extraction, highlight and read-along logical text stay equivalent. + +### CR-META-003 Reflow +Change viewport width, font size, line spacing, safe area and writing direction while remaining on a sentinel paragraph. + +Expected: +- logical anchor remains in the same semantic neighborhood; +- highlights/context strings remain identical; +- page number may change. + +### CR-META-004 Resource rename +Rename archive resource paths and update valid publication references accordingly. + +Expected: +- visible book, navigation and semantic positions remain equivalent; +- no assumption of one conventional folder layout is observable. + +### CR-META-005 Provider round-trip +Export/import or remote/local round-trip without user edits. + +Expected: +- logical book identity, progress and annotations remain equivalent according to documented portable fields; +- provider-specific path/IDs may differ. + +### CR-META-006 Cache deletion +Delete all derived caches between two runs. + +Expected: +- first run after deletion may be slower; +- user-visible durable data remains equivalent after rebuild. + +### CR-META-007 Input modality +Perform semantically equivalent next-page actions via button, keyboard and touch gesture. + +Expected: +- final logical position is equivalent; +- interaction animation may differ. + +## 6. Cross-engine/browser matrix + +For web surfaces, qualify at minimum: + +| Suite | Chromium | WebKit | Firefox | +| --- | --- | --- | --- | +| EPUB open/restore | MUST | MUST | SHOULD | +| vertical/ruby rendering | MUST | MUST | MUST | +| selection + popup | MUST | MUST | MUST | +| keyboard/input ownership | MUST | MUST | MUST | +| touch/pointer emulation | MUST | MUST | SHOULD | +| offline/local persistence | MUST | MUST | SHOULD | +| internal links/navigation | MUST | MUST | MUST | +| search/highlights | MUST | MUST | MUST | +| large-library basic journey | MUST | MUST | SHOULD | +| service-worker/offline if shipped | MUST | MUST | SHOULD | + +Physical-device qualification remains necessary for: +- iOS Safari selection handles and viewport/insets; +- Android browser/host back behavior and IME; +- stylus; +- hardware volume/page keys; +- real background audio/media controls; +- e-ink refresh characteristics. + +An emulated browser pass must not be labeled a physical-device pass. + +## 7. Property/fuzz domains + +Project-owned generators MAY produce additional cases from these domains. + +### Unicode generator +Include: +- BMP and supplementary CJK; +- variation selectors; +- combining marks; +- compatibility ideographs; +- full-width digits/punctuation; +- iteration marks; +- emoji and ZWJ sequences outside Japanese lexical spans; +- decomposed/composed equivalents. + +Properties: +- never split a Unicode scalar/surrogate pair into an invalid lookup boundary; +- no crash; +- forward/backward traversal is stable; +- logical text witness after save/restore remains valid. + +### Archive/path generator +Generate: +- nested directories; +- percent-encoded path components; +- spaces and non-Latin paths; +- same fragment IDs in multiple resources; +- long but bounded paths; +- mixed path case where provider semantics allow; +- optional missing resources. + +Properties: +- valid relative references resolve against their resource; +- names are not interpreted as URL query/fragment accidentally; +- one missing optional asset does not destroy unrelated content. + +### Layout generator +Vary: +- viewport width/height; +- writing direction; +- font size; +- line/paragraph spacing; +- safe areas; +- image aspect ratio; +- ruby density. + +Properties: +- content remains reachable; +- progress remains bounded 0–100%; +- no permanent unreachable final column/page; +- semantic anchor survives reflow. + +## 8. Long-run soak scenarios + +### CR-SOAK-001 Reader reopen +100 open/read/close cycles across 10 books. + +Fail if: +- abandoned interaction layers accumulate; +- memory/latency grows monotonically without bounded cache explanation; +- later restore becomes less accurate. + +### CR-SOAK-002 Lookup +2,000 sequential lookups across repeated and distinct terms. + +Fail if: +- popup no longer opens/dismisses; +- old source context appears on a new term; +- action controls drift outside popup; +- latency trend indicates unbounded leaked work. + +### CR-SOAK-003 Provider refresh +200 refresh/retry cycles with injected transient failures. + +Fail if: +- duplicates accumulate; +- last-known library disappears on transient automatic failure; +- progress moves backward without conflict policy. + +### CR-SOAK-004 Search cancellation +Issue 500 alternating slow/fast queries with cancellation. + +Fail if: +- stale result appears after newer query; +- UI becomes permanently “Searching”; +- memory grows without returning toward a bounded baseline. + +### CR-SOAK-005 Page-turn burst +10,000 next/previous commands in bounded bursts using a synthetic book. + +Fail if: +- final location differs from accepted command history; +- stored resume escapes valid range; +- old callbacks change a later resource. + +## 9. Benchmark extensions + +### CR-BENCH-009 Context extraction +Fixture: CR-FIX-017 and CR-FIX-018. + +Desktop target: +- source-context extraction after accepted lookup <=50 ms median and <=120 ms p95, excluding dictionary query; +- extraction result identical before/after repagination. + +### CR-BENCH-010 Popup interaction +With a result taller than two viewports: +- initial meaningful content within CR-BENCH-002 budget; +- scroll response starts within 100 ms; +- no underlying reader movement during 100 repeated popup scroll gestures. + +### CR-BENCH-011 Provider reconnect +Fixture: CR-FIX-030 with simulated credential expiry. + +Target: +- previously cached/known library remains interactable immediately where safe; +- reconnect action visibly acknowledged <=150 ms; +- no full-catalog duplicate pass after reconnect; +- first refreshed page <=2 s in test network profile unless provider itself is slower, in which case provider time is reported separately. + +### CR-BENCH-012 Continuous long-volume rendering +Synthetic 1,000-page manga/OCR or equivalent long continuous source if feature exists. + +Targets: +- opening at saved page does not require visibly scrolling from page 1; +- first saved-page content <=2 s desktop; +- scrolling for 60 s does not show unbounded retained item growth; +- interaction remains usable under OCR overlay. + +## 10. Optional candidate capability contracts + +These are isolated product opportunities, not requirements to implement in the current PR. + +### CR-CAP-001 Paste/clipboard reader +User can paste plain text into a disposable or saved reading surface and use the same lookup/learning overlays as ordinary text. + +Minimum contract: +- pasted content remains local unless user invokes a network feature; +- clear/new paste cannot be repopulated by stale processing; +- IME/editing remains usable; +- optional auto-paste has an obvious enabled state. + +### CR-CAP-002 Distraction-free parsed-text view +A simplified reading surface may hide surrounding site chrome for user-selected text. + +Minimum contract: +- original source can be exited/restored; +- transformed view does not silently change logical text; +- links/source attribution remain recoverable where relevant. + +### CR-CAP-003 Learner-state furigana +Furigana modes may include all, none, interaction-reveal, or learner-state-driven display. + +Minimum contract: +- publication-native ruby remains semantically distinct from generated learner ruby; +- toggling mode does not corrupt selection/highlights; +- state changes update deterministically. + +### CR-CAP-004 Coverage/comprehension view +A document/book may show coverage based on the user's known-word state. + +Minimum contract: +- calculation version and vocabulary scope are defined; +- recalculation is cancelable; +- large-library recalculation cannot corrupt books on failure; +- score is informational and does not alter source text. + +### CR-CAP-005 Basic PDF reading +If added, PDF is treated as its own source type rather than pretending it has EPUB semantics. + +Minimum contract: +- page identity is stable; +- selectable text/lookup only where text data exists; +- scanned pages expose an explicit OCR path if supported; +- bookmarks/progress remain page/document scoped. + +### CR-CAP-006 OCR corrections and versions +If manga OCR is supported, users may correct recognized text/geometry without modifying original images. + +Minimum contract: +- edits are reversible; +- original version remains recoverable; +- alternate OCR versions do not duplicate reading statistics; +- cloud conflict policy is explicit if edits sync. + +### CR-CAP-007 Reading goals/deadlines +If goal planning is supported: +- goals are user-authored and editable; +- timezone/day-boundary policy is explicit; +- progress cannot double-count hidden restore/navigation; +- cross-device changes reconcile deterministically. + +## 11. Qualification record template + +For every test run record: + +- Requirement ID: +- Build/commit: +- Fixture revision: +- Platform: +- Browser/engine: +- Device class: +- Cold/warm: +- Preconditions: +- User action: +- Expected: +- Observed: +- Result: PASS / FAIL / INCONCLUSIVE / NOT APPLICABLE +- Timing samples where required: +- Screenshot/video reference if permitted: +- Known limitation: +- Follow-up issue/PR: + +Do not place external competitor source/provenance in this record. + +## 12. Release gate + +A release candidate should not claim the clean-room program is complete merely because the new tests exist. + +For each currently shipped feature area, completion requires: +- relevant deterministic acceptance tests pass; +- applicable cross-engine matrix passes; +- soak tests have no unbounded lifecycle defect; +- benchmark regressions are within target budgets; +- device-only behaviors are either physically qualified or explicitly unqualified; +- sync/provider destructive cases have a documented policy; +- fixture provenance is project-owned; +- implementation review confirms no prohibited external implementation material entered the worker context. From f6afc3dd949358334bb90ddb6b4c085850948dde Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Fri, 2 Oct 2026 21:52:37 -0400 Subject: [PATCH 05/28] docs: seal clean-room implementation handoff manifest --- CLEAN_ROOM_HANDOFF.md | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 CLEAN_ROOM_HANDOFF.md diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md new file mode 100644 index 0000000000..43402cb8ad --- /dev/null +++ b/CLEAN_ROOM_HANDOFF.md @@ -0,0 +1,49 @@ +# Clean-room implementation handoff manifest + +Status: sealed implementation input manifest +Revision: 2026-10-02 deep pass + +The implementation worker is authorized to receive exactly the clean-room documents listed below plus ordinary authorized target-repository material. + +| Path | Git blob SHA | Purpose | +| --- | --- | --- | +| `CLEAN_ROOM_COMPETITIVE_RESEARCH.md` | `8a54cd241a587c1a3ba4b5d30280c02f55ced45c` | process boundary, evidence rules, taint handling | +| `specs/clean-room-reader-competitive-spec.md` | `3f2b0909fec61669774063cc3305abb81b18a2d3` | behavior, fixtures, acceptance tests, benchmarks | +| `specs/clean-room-reader-adversarial-qualification.md` | `5a12dad34cae1c3632c959c23e49f665d4afbcac` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | + +## Not authorized + +The worker must not receive or request: + +- observer dossiers or evidence ledgers; +- named-source provenance; +- external implementation repositories; +- external source code, patches, diffs, comments or source-level identifiers; +- contaminated observation notes; +- copied third-party fixtures or distinctive UI assets. + +## Worker startup checklist + +Before implementation work: + +1. confirm the three blob SHAs above match the checked-out handoff; +2. do not perform external competitor research; +3. inventory current target behavior using only target-owned tests/code plus the sanitized CR requirements; +4. create independently authored fixtures before making competitively motivated production changes; +5. record which CR requirements already pass; +6. fix only failing/incomplete requirements using target-owned design; +7. keep benchmark and device evidence separate from unsupported claims. + +## Worker completion attestation + +An implementation PR should include a statement equivalent to: + +> I implemented and qualified the referenced CR requirements using only the sealed clean-room handoff and authorized target-repository material. I did not consult prohibited external implementation material or the observer-side provenance record. + +The exact wording may vary, but the substance must be retained. + +## Manifest updates + +Any change to one of the three authorized documents changes its blob SHA and requires a new manifest revision before a clean implementation handoff. + +This manifest itself contains no external source provenance and may be supplied to the implementation worker. From 8676ef6fe8135d660137a3e10b7433e58a55274f Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:15:11 -0400 Subject: [PATCH 06/28] spec: add sanitized reader feature opportunity backlog --- ...clean-room-reader-feature-opportunities.md | 913 ++++++++++++++++++ 1 file changed, 913 insertions(+) create mode 100644 specs/clean-room-reader-feature-opportunities.md diff --git a/specs/clean-room-reader-feature-opportunities.md b/specs/clean-room-reader-feature-opportunities.md new file mode 100644 index 0000000000..d5c0c2f25a --- /dev/null +++ b/specs/clean-room-reader-feature-opportunities.md @@ -0,0 +1,913 @@ +# Clean-room reader feature opportunities + +Status: sanitized optional product backlog +Revision: 2026-10-03 +External product provenance: intentionally absent + +This document contains product opportunities discovered through behavior-only competitive research. None of these are release requirements unless separately promoted into a scoped implementation plan. + +The purpose is to preserve useful ideas without forcing the implementation worker to inspect external products. + +## 1. Learning-aware reading + +### CR-OPP-001 Chapter preflight + +Before opening a chapter, optionally show: +- estimated unknown vocabulary; +- estimated unknown kanji; +- grammar patterns likely to be unfamiliar; +- reading length; +- expected reading time; +- optional preparation list. + +The preparation list SHOULD be filterable by: +- already known; +- already saved/mined; +- frequency/rank; +- first occurrence in this chapter; +- user-selected difficulty threshold. + +The feature MUST remain optional. A user should always be able to open the chapter immediately. + +### CR-OPP-002 Whole-book vocabulary forecast + +Provide a non-destructive overview of vocabulary/kanji that a user is likely to encounter across the whole book. + +Possible views: +- total unique terms; +- unknown unique terms; +- high-frequency unknown terms; +- first-chapter appearance; +- known-word coverage percentage; +- cumulative coverage curve by chapter. + +A forecast MUST identify its vocabulary source/version and must not alter the book. + +### CR-OPP-003 Adaptive furigana + +Offer learner-aware furigana modes in addition to ordinary publication-ruby controls. + +Potential modes: +- publication only; +- all generated readings; +- unfamiliar words only; +- unfamiliar kanji only; +- reveal on tap/hover; +- dim until interaction. + +Requirements: +- publication-native ruby remains distinct from generated learner assistance; +- toggling mode does not alter saved locators/highlights; +- generated reading never silently replaces source text; +- user can disable the feature completely. + +### CR-OPP-004 Learner-state text styling + +Optional low-noise styling can show known / learning / unknown vocabulary in the reading surface. + +Requirements: +- source text remains selectable; +- dictionary lookup remains available; +- high-contrast themes remain legible; +- the overlay can be disabled instantly; +- state changes do not require book reload; +- late updates from another page/session cannot recolor the wrong token. + +### CR-OPP-005 Inline micro-glosses + +Optionally show short learner glosses inline for selected categories such as unfamiliar vocabulary. + +The mode SHOULD be: +- sparse; +- user-configurable by difficulty/state; +- visually subordinate to source text; +- easy to hide. + +Full dictionary detail remains on demand. + +### CR-OPP-006 Proper-name assistance + +Provide a distinct name-reading layer for likely person/place/organization names. + +Requirements: +- visibly distinguish inferred/generated readings from publication-provided ruby; +- allow quick correction or suppression; +- do not force name readings into exported source text unless user chooses them. + +### CR-OPP-007 Context-ranked dictionary sense + +When a term has many readings/senses, the popup may rank likely senses using the current sentence. + +Requirements: +- preserve access to the complete dictionary entry; +- mark machine-ranked/inferred ordering clearly; +- do not invent definitions; +- allow disabling context ranking. + +### CR-OPP-008 Grammar overlay + +Offer on-demand grammar or part-of-speech annotation for the current sentence/paragraph. + +Potential surfaces: +- subtle POS styling; +- grammar-pattern underlines; +- compact grammar sheet; +- chapter grammar preview. + +Requirements: +- off by default or easily dismissible; +- does not interfere with text selection; +- generated explanations are labeled separately from dictionary/reference facts. + +## 2. Reading planning and habit support + +### CR-OPP-010 Finish-date planner + +Let the user choose either: +- target finish date -> required reading pace; or +- reading pace -> estimated finish date. + +Inputs MAY include: +- reading days per week; +- rest days; +- chapters/pages/characters per session; +- historical reading speed. + +The estimate must be visibly approximate when book structure or speed data is incomplete. + +### CR-OPP-011 Reading queue + +Allow users to queue multiple books and see: +- current priority/order; +- predicted finish dates; +- total remaining reading time; +- cumulative new vocabulary/kanji exposure. + +Queue ordering SHOULD be independent of library folder organization. + +### CR-OPP-012 Coverage projection across queue + +Show how completing selected books may expand coverage of: +- vocabulary; +- kanji; +- frequency bands; +- user-defined study lists. + +Projection must not imply actual acquisition merely from exposure. + +### CR-OPP-013 Habit goals + +Separate habit goals from linguistic progress. + +Possible goals: +- minutes per day; +- reading days per week; +- books finished per year; +- characters/pages per day; +- streaks. + +Notifications/coaching MUST be optional. + +### CR-OPP-014 Time remaining + +Show estimates for: +- current chapter; +- current section; +- current book. + +Use measured personal reading speed when available and fall back to clearly labeled generic estimates. + +## 3. Navigation beyond a normal table of contents + +### CR-OPP-020 Book map + +Provide a bird's-eye visualization of the whole publication. + +Possible layers: +- chapter boundaries; +- read/unread regions; +- current location; +- bookmarks; +- highlights; +- notes; +- time spent; +- search hits. + +The map should be navigational, not merely decorative. + +### CR-OPP-021 Page/section browser + +Expose a visual scrubber for nearby locations. + +For reflowable text this MAY use: +- text snippets; +- chapter labels; +- small rendered previews. + +For fixed-layout/comic content it MAY use page thumbnails. + +### CR-OPP-022 Rich skim sheet + +One compact navigation surface can jump among: +- chapters; +- recent locations; +- bookmarks; +- highlights; +- search hits; +- percentage/character location. + +### CR-OPP-023 Generated table of contents + +When a publication's TOC is missing or unusable, optionally derive a replacement from: +- headings; +- resource boundaries; +- other semantically safe structural cues. + +Generated entries must be labeled as generated. + +### CR-OPP-024 Progress scope + +Allow advanced users to exclude non-reading flows from progress/time estimates, such as: +- appendix; +- bibliography; +- index; +- previews/ads; +- duplicated front matter. + +This must never delete or hide the underlying content permanently. + +### CR-OPP-025 Inline footnotes + +Open eligible footnotes/endnotes in a local popup/sheet rather than forcing a disruptive navigation jump. + +The original linked note remains reachable through ordinary navigation. + +### CR-OPP-026 Navigation history + +Maintain explicit Back/Forward history for intentional reader jumps. + +Potential sources: +- internal links; +- TOC; +- search; +- bookmark; +- highlight; +- dictionary cross-reference back into text. + +Normal page turns should not flood the history unless configured. + +## 4. Reader presentation and control + +### CR-OPP-030 Per-book reader presets + +A title may remember its own: +- writing direction; +- layout mode; +- columns; +- margins; +- font; +- font size; +- line spacing; +- theme; +- image behavior; +- furigana mode. + +Users should be able to: +- reset to global defaults; +- copy a preset; +- export/import presets; +- choose whether edits auto-save to the title. + +### CR-OPP-031 Named global presets + +Provide named presets such as: +- vertical novel; +- horizontal novel; +- manga dual-page; +- webtoon continuous; +- e-ink; +- accessibility large text. + +Names and defaults should be target-authored, not copied from another product. + +### CR-OPP-032 Sentence/block reading mode + +Optional stepped reading mode shows: +- one semantic block; +- one sentence; +- or a configurable small group. + +Potential controls: +- instant reveal; +- paced/typewriter reveal; +- tap/key/controller advance. + +Images, tables and other atomic blocks should remain coherent. + +### CR-OPP-033 Reading ruler / line guide + +Provide a focus aid that emphasizes one line or a narrow band and dims surrounding text. + +Requirements: +- adjustable dim amount; +- keyboard/touch navigation; +- compatible with vertical and horizontal text where practical; +- must not alter source selection or saved location. + +### CR-OPP-034 Quote image + +Turn a selected passage/highlight into a shareable local image. + +Potential options: +- current reader font; +- vertical/horizontal layout; +- book title/author attribution; +- cover/background image; +- background blur/opacity; +- custom output dimensions. + +Generation SHOULD remain local unless the user explicitly chooses a cloud feature. + +### CR-OPP-035 Book notes + +Support notes associated with the whole book independently of passage annotations. + +Examples: +- character list; +- plot notes; +- vocabulary strategy; +- review thoughts. + +### CR-OPP-036 Quick actions / command palette + +Provide a searchable, keyboard-accessible command surface for infrequent reader actions. + +Potential actions: +- appearance toggle; +- search; +- bookmark; +- jump; +- export; +- statistics; +- dictionary profile; +- media controls. + +### CR-OPP-037 Remappable controls + +Allow optional remapping for: +- keyboard; +- controller; +- external page-turn remote; +- mouse side buttons; +- gestures. + +Editable text controls retain ownership of normal editing shortcuts. + +### CR-OPP-038 Controller / remote navigation + +Support game controllers or Bluetooth page-turn remotes for hands-free reading. + +Minimum actions: +- next/previous; +- open/close controls; +- optional lookup navigation. + +Input-repeat/debounce behavior must be deterministic. + +### CR-OPP-039 Continuous chapters + +Offer a true whole-book continuous mode that can cross chapter boundaries without a full visual reset. + +Requirements: +- bounded memory; +- restore to semantic chapter+location; +- cancellable navigation; +- percentage seek; +- chapter boundaries remain visible enough to orient the reader. + +## 5. Library organization + +### CR-OPP-040 Continue dashboard + +Create a library home emphasizing current activity: +- Continue Reading; +- recently added; +- recently finished; +- favourites; +- bookmarked books; +- queued books. + +### CR-OPP-041 Rich book details + +Allow user-editable local metadata such as: +- display title; +- author; +- series; +- tags; +- favourite; +- notes; +- custom cover; +- status. + +Original imported metadata remains recoverable. + +### CR-OPP-042 Include/exclude filters + +Tags and states may support three-way filtering: +- neutral; +- include; +- exclude. + +Filters should compose predictably and remain visible when active. + +### CR-OPP-043 Saved library views + +Save combinations of: +- search; +- sort; +- tags; +- status; +- source/provider; +- local/remote availability. + +### CR-OPP-044 Watched folders + +On supporting platforms, allow one or more folders to be watched or rescanned for new books. + +Features MAY include: +- scan on launch; +- periodic scan; +- manual refresh; +- ignore patterns; +- inherited folder tags. + +### CR-OPP-045 Relink missing books + +If the physical file moves, preserve metadata/progress and let the user locate the new copy. + +Identity matching must follow the product's logical-book policy, not title alone. + +### CR-OPP-046 Pre-migration backup + +Before a local database/schema migration, create a recoverable snapshot when practical. + +A migration failure should offer a clear recovery path. + +### CR-OPP-047 Favourites and collections + +Favourites provide a low-friction single-bit shortcut independent of arbitrary user collections. + +### CR-OPP-048 External tracking + +Optional integrations can synchronize high-level progress/status with external book/manga tracking services. + +External tracking must not become the authority for local reading position. + +### CR-OPP-049 Local/remote placeholders + +Show remote-known titles not currently stored on device while clearly distinguishing them from offline-readable items. + +## 6. Search, annotations, and export + +### CR-OPP-050 Advanced search + +Possible modes: +- literal; +- match case; +- whole word where meaningful; +- regular expression for advanced users; +- search only current chapter; +- search whole book; +- filter by annotation type. + +Regex must have execution safeguards for pathological patterns. + +### CR-OPP-051 Annotation export + +Export bookmarks/highlights/notes to portable formats such as: +- Markdown; +- plain text; +- JSON; +- HTML. + +Export MAY optionally include: +- book metadata; +- chapter; +- location; +- surrounding context; +- creation/edit times. + +### CR-OPP-052 Note-service connectors + +Optional explicit connectors may send annotations to user-selected note/knowledge services. + +Sync/export failures do not endanger local annotations. + +### CR-OPP-053 Highlight-to-card + +Convert a saved highlight into a flashcard/mining draft later, not only at initial lookup time. + +### CR-OPP-054 Search/history persistence + +Preserve search state within a book session and optionally expose recent searches without allowing old asynchronous queries to revive after clear/new search. + +## 7. Dictionary and vocabulary workflow + +### CR-OPP-060 Quick dictionary switching + +Allow a small set of named dictionary/lookup profiles to be switched from the reader without visiting full settings. + +### CR-OPP-061 Vocabulary browser + +Provide a unified view of words: +- encountered; +- looked up; +- saved; +- mined; +- known; +- learning. + +Each word MAY link back to source occurrences. + +### CR-OPP-062 Encounter map + +Visualize encountered kanji/vocabulary and let the user open source sentences/locations where each appeared. + +### CR-OPP-063 Source-linked lookup history + +Keep optional lookup history with: +- term; +- book; +- chapter; +- sentence; +- location; +- timestamp. + +History can be disabled/cleared. + +### CR-OPP-064 Mine from history + +Allow creating a card from a previous lookup/sentence after the reading moment has passed. + +If media context exists, retained media must follow explicit storage/privacy limits. + +### CR-OPP-065 Update existing card + +Where integration permits, allow a newly encountered context to update an existing card rather than always creating a duplicate. + +The user should be able to choose which fields/media are replaced or appended. + +### CR-OPP-066 Context/no-context distinction + +Vocabulary saved from a sentence should retain that source context distinctly from vocabulary manually added without context. + +### CR-OPP-067 Idempotent media reuse + +Repeated mining of the same context should not create unnecessary duplicate image/audio assets when content is identical and the target integration supports reuse. + +## 8. Audio, audiobook, podcast, and video study + +### CR-OPP-070 Sentence playback modes + +For timed transcript/audio: +- auto-pause at start; +- auto-pause at end; +- pause after every cue; +- resume-after-delay; +- loop cue; +- repeat N times. + +### CR-OPP-071 Primed listening + +Optionally hide transcript during playback and reveal it after: +- pause; +- replay; +- user request; +- configured number of listens. + +### CR-OPP-072 Condensed playback + +Optionally skip or speed through: +- silence; +- long gaps without transcript; +- non-target-language segments if confidently identified. + +Users retain easy access to normal playback. + +### CR-OPP-073 Track targeting + +When multiple subtitle/transcript tracks exist, let the user choose: +- visible track; +- lookup/mining track; +- translation/reference track; +- track controlled by shortcuts. + +### CR-OPP-074 Transcript list + +Provide a virtualized transcript list with: +- seek; +- search; +- current-cue follow; +- chapter markers; +- mining action; +- keyboard navigation. + +### CR-OPP-075 Transcript discovery + +Given known media metadata, optionally help locate matching subtitle/transcript resources from configured legal/user-authorized providers. + +No automatic copyrighted-resource acquisition should be assumed. + +### CR-OPP-076 Subtitle timing alignment + +Provide user-controlled timing tools: +- global offset; +- set current cue to current playback time; +- sync against a chosen reference point; +- per-track remembered offset. + +### CR-OPP-077 Voice-activity sentence capture + +Where local media is available, mining MAY capture sentence audio using voice activity around the selected cue. + +Always keep manual trim/preview available. + +### CR-OPP-078 Multi-line context capture + +Allow adjacent transcript/dialogue lines to be intentionally combined into one mining context. + +### CR-OPP-079 Media mining history + +Keep a bounded history of recently seen cues/lines so the user can mine something shortly after it disappears. + +### CR-OPP-080 Context image capture + +Mining from media may include: +- current frame; +- cropped region; +- short animation/GIF where supported. + +Capture must be explicit and respect platform/source restrictions. + +## 9. Manga / OCR + +### CR-OPP-090 On-demand page OCR + +For user-owned or otherwise permitted images/pages, OCR a page at read time rather than requiring whole-volume preprocessing. + +### CR-OPP-091 Region OCR + +Allow the user to restrict OCR to: +- selected rectangle; +- speech-bubble region; +- current panel; +- configurable recurring screen area. + +### CR-OPP-092 Pointer-follow lookup + +When OCR overlay is enabled, a moving pointer/hover may reveal/select text beneath it without a separate mode switch. + +Touch platforms need an equivalent explicit interaction. + +### CR-OPP-093 OCR corrections + +Allow users to correct: +- recognized text; +- reading order; +- text box geometry. + +Original OCR remains recoverable. + +### CR-OPP-094 OCR versions + +Support alternate OCR results for one page/volume and switch without duplicating page identity or reading progress. + +### CR-OPP-095 OCR improvement merge + +When a higher-quality OCR version arrives, preserve user corrections when they can be mapped unambiguously; otherwise surface a conflict rather than silently discarding them. + +### CR-OPP-096 Comic archive support + +Consider local comic formats such as: +- CBZ/ZIP; +- other archive formats where licensing/platform support is acceptable; +- modern image formats. + +Security limits for archive bombs/path traversal are mandatory. + +### CR-OPP-097 Dual-page / webtoon layouts + +Manga reader modes MAY include: +- single page; +- dual-page spread; +- right-to-left spread; +- continuous vertical/webtoon; +- fit width/height. + +### CR-OPP-098 Panel/page zoom + +Support precise zoom/pan with modality-aware controls: +- mouse wheel; +- trackpad; +- pinch; +- double tap; +- keyboard/controller. + +### CR-OPP-099 Manga immersion statistics + +Track manga reading independently using metrics appropriate to image/OCR content rather than pretending page OCR equals prose character counts. + +## 10. Import and external sources + +### CR-OPP-100 Web article / read-later import + +Save a clean readable copy of a web article or user-selected page content for later study. + +Requirements: +- preserve source URL/title; +- sanitize scripts/tracking; +- respect copyright/storage policy; +- imported copy is clearly distinct from live web page. + +### CR-OPP-101 Web novel import + +Support user-initiated import from compatible web-novel pages where terms/site policy allow. + +The parser must fail safely when site markup changes. + +### CR-OPP-102 External catalog connector + +Allow optional connectors to user-authorized catalogs/libraries. + +Examples of generic capability: +- remote book catalogs; +- personal media servers; +- read-later services; +- local desktop library managers. + +The connector boundary must keep provider state distinct from logical book identity. + +### CR-OPP-103 OPDS-like catalog browsing + +Where useful, browse standard/open catalog feeds without adding a bespoke integration for every server. + +### CR-OPP-104 Universal import inbox + +Provide one place to add: +- books; +- plain text; +- article links; +- subtitles; +- audio; +- video; +- manga archives. + +After import, content is routed to the relevant reader while preserving a shared learning identity/history where appropriate. + +## 11. Context capture and flashcards + +### CR-OPP-110 Context bundle + +Represent mining context as a user-reviewable bundle: +- expression; +- reading; +- sentence; +- source title; +- source location/time; +- image; +- audio; +- optional translation; +- optional notes. + +The bundle can be edited before export. + +### CR-OPP-111 One-action mining + +For users who configure a trusted template, allow one action to create/export a complete context bundle. + +A preview/edit flow remains available. + +### CR-OPP-112 Mining presets + +Different content types may use different field mappings: +- novel; +- manga; +- video; +- podcast; +- web. + +### CR-OPP-113 Capture crop + +For image contexts, let the user crop before export. + +### CR-OPP-114 Media privacy + +Provide an option to omit sensitive images/audio from exported cards while retaining the text context. + +## 12. Accessibility and comfort + +### CR-OPP-120 Reading focus modes + +Potential aids: +- line guide; +- dim surrounding text; +- reduced chrome; +- reduced motion; +- larger hit targets; +- high contrast. + +### CR-OPP-121 Theme typography bundle + +A theme MAY optionally include typography/layout settings, not only colors. + +Users should choose whether theme activation changes typography. + +### CR-OPP-122 Per-language font profiles + +Let Japanese, Simplified Chinese, Traditional Chinese, Korean and Latin text choose independent preferred fonts/fallbacks. + +### CR-OPP-123 Page overlap marker + +For long pages/panning or screenful scrolling, a temporary marker can show how the new viewport overlaps the previous one. + +### CR-OPP-124 External page-turn controls + +Treat keyboard/controller/remote page-turn controls as accessibility/comfort inputs with user-remappable actions. + +## 13. Privacy and durability + +### CR-OPP-130 Local-first processing indicator + +When OCR, transcription, dictionary, translation, TTS or AI features can run either locally or remotely, show where processing occurs. + +### CR-OPP-131 Per-feature network permission + +Allow network-backed learning helpers to be independently enabled rather than bundling all network behavior behind one switch. + +### CR-OPP-132 Export/redaction preview + +When exporting settings/backups/diagnostics, preview or automatically redact: +- API keys; +- auth tokens; +- private provider identifiers; +- private book content unless explicitly included. + +### CR-OPP-133 Recovery center + +Centralize: +- local backups; +- migration snapshots; +- failed imports; +- failed remote sync; +- orphaned placeholders; +- cache rebuild actions. + +### CR-OPP-134 Portable data model + +Where feasible, make user-created annotations, notes, reading state and settings exportable in documented formats so users are not trapped by one storage provider. + +## 14. Candidate prioritization rubric + +Evaluate an opportunity on: + +1. immersion interruption reduced; +2. usefulness to existing Reader users; +3. overlap with current Manabi capabilities; +4. implementation complexity; +5. runtime/storage cost; +6. cross-platform feasibility; +7. privacy impact; +8. licensing/provenance risk; +9. long-term maintenance surface; +10. whether the feature creates a reusable platform primitive. + +A feature with strong value but large new product scope should remain in this optional backlog rather than entering a current implementation PR by accident. + +## 15. Particularly strong candidates for separate exploration + +These appear broadly useful enough to justify dedicated product-design investigation: + +- CR-OPP-001 Chapter preflight +- CR-OPP-003 Adaptive furigana +- CR-OPP-010 Finish-date planner +- CR-OPP-020 Book map +- CR-OPP-030 Per-book reader presets +- CR-OPP-033 Reading ruler / line guide +- CR-OPP-034 Quote image +- CR-OPP-040 Continue dashboard +- CR-OPP-045 Relink missing books +- CR-OPP-051 Annotation export +- CR-OPP-061 Vocabulary browser +- CR-OPP-062 Encounter map +- CR-OPP-064 Mine from history +- CR-OPP-070 Sentence playback modes +- CR-OPP-071 Primed listening +- CR-OPP-074 Transcript list +- CR-OPP-090 On-demand page OCR +- CR-OPP-093 OCR corrections +- CR-OPP-100 Web article / read-later import +- CR-OPP-110 Context bundle +- CR-OPP-130 Local-first processing indicator +- CR-OPP-133 Recovery center + +These are exploration candidates, not a ranking or commitment. From afbd7a6682a22b851c57ec947270b17552154693 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:15:40 -0400 Subject: [PATCH 07/28] docs: add feature opportunities to sealed handoff --- CLEAN_ROOM_HANDOFF.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md index 43402cb8ad..0a85f77867 100644 --- a/CLEAN_ROOM_HANDOFF.md +++ b/CLEAN_ROOM_HANDOFF.md @@ -1,7 +1,7 @@ # Clean-room implementation handoff manifest Status: sealed implementation input manifest -Revision: 2026-10-02 deep pass +Revision: 2026-10-03 feature-discovery pass The implementation worker is authorized to receive exactly the clean-room documents listed below plus ordinary authorized target-repository material. @@ -10,6 +10,15 @@ The implementation worker is authorized to receive exactly the clean-room docume | `CLEAN_ROOM_COMPETITIVE_RESEARCH.md` | `8a54cd241a587c1a3ba4b5d30280c02f55ced45c` | process boundary, evidence rules, taint handling | | `specs/clean-room-reader-competitive-spec.md` | `3f2b0909fec61669774063cc3305abb81b18a2d3` | behavior, fixtures, acceptance tests, benchmarks | | `specs/clean-room-reader-adversarial-qualification.md` | `5a12dad34cae1c3632c959c23e49f665d4afbcac` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | +| `specs/clean-room-reader-feature-opportunities.md` | `d5c0c2f25abde10499cbf06208544b3edc8c764f` | optional sanitized feature backlog; not release requirements | + +## Scope distinction + +The competitive and adversarial specifications contain correctness/release-quality contracts for features already in scope. + +The feature-opportunities document is different: its `CR-OPP-*` entries are optional exploration candidates. Their presence in the handoff does not authorize scope expansion in an implementation PR. + +A worker should implement a `CR-OPP-*` only when the user or a separately scoped target-side plan explicitly selects it. ## Not authorized @@ -26,13 +35,14 @@ The worker must not receive or request: Before implementation work: -1. confirm the three blob SHAs above match the checked-out handoff; +1. confirm the four blob SHAs above match the checked-out handoff; 2. do not perform external competitor research; 3. inventory current target behavior using only target-owned tests/code plus the sanitized CR requirements; 4. create independently authored fixtures before making competitively motivated production changes; 5. record which CR requirements already pass; 6. fix only failing/incomplete requirements using target-owned design; -7. keep benchmark and device evidence separate from unsupported claims. +7. treat `CR-OPP-*` as backlog unless separately selected; +8. keep benchmark and device evidence separate from unsupported claims. ## Worker completion attestation @@ -44,6 +54,6 @@ The exact wording may vary, but the substance must be retained. ## Manifest updates -Any change to one of the three authorized documents changes its blob SHA and requires a new manifest revision before a clean implementation handoff. +Any change to one of the four authorized documents changes its blob SHA and requires a new manifest revision before a clean implementation handoff. This manifest itself contains no external source provenance and may be supplied to the implementation worker. From 3d31dc0a75ae3928c5a00c5a748a96280519f591 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:17:50 -0400 Subject: [PATCH 08/28] spec: extend learner workflow feature opportunities --- ...clean-room-reader-feature-opportunities.md | 259 ++++++++++++++++++ 1 file changed, 259 insertions(+) diff --git a/specs/clean-room-reader-feature-opportunities.md b/specs/clean-room-reader-feature-opportunities.md index d5c0c2f25a..3bb774cc21 100644 --- a/specs/clean-room-reader-feature-opportunities.md +++ b/specs/clean-room-reader-feature-opportunities.md @@ -911,3 +911,262 @@ These appear broadly useful enough to justify dedicated product-design investiga - CR-OPP-133 Recovery center These are exploration candidates, not a ranking or commitment. + + +## 16. Second-wave learner workflow opportunities + +### CR-OPP-135 Difficulty preview + +Before opening imported material, estimate difficulty using transparent signals such as: +- known/unknown vocabulary ratio; +- kanji familiarity; +- sentence length; +- lexical frequency; +- grammar-density heuristics; +- text length. + +Requirements: +- show the components behind the estimate; +- do not present one opaque number as objective truth; +- allow recalculation after the user's knowledge state changes; +- keep the estimate local where practical. + +### CR-OPP-136 External knowledge-state import + +Allow the user to seed Reader knowledge state from explicitly connected/imported sources. + +Generic examples: +- kanji level list; +- known-vocabulary export; +- flashcard collection; +- user-supplied word list. + +Requirements: +- source and import time are visible; +- import can be refreshed or removed; +- imported state remains distinguishable from Reader-inferred state; +- conflicts follow an explicit precedence policy. + +### CR-OPP-137 Camera / photo OCR import + +Support one-shot import of Japanese text from: +- printed books; +- physical manga; +- signs; +- screenshots; +- another device's screen. + +Possible output modes: +- extracted clean text; +- page image plus selectable overlay; +- temporary lookup-only scan; +- saved library item. + +Requirements: +- original image remains available when saved; +- OCR confidence/errors are editable or clearly fallible; +- processing location (local/remote) is disclosed; +- no silent upload when local mode is promised. + +### CR-OPP-138 System share/import inbox + +On supporting platforms, accept shared: +- selected text; +- webpage URL; +- image; +- PDF/document; +- subtitle/media file. + +The receiving flow should preview what will be saved and route it to the appropriate content type. + +### CR-OPP-139 Mobile lookup disambiguation + +When a touch lands ambiguously near multiple possible token boundaries, provide a low-friction way to select the intended term. + +Possible target-owned interactions: +- candidate chips; +- drag-to-expand; +- adjacent-term arrows; +- touch magnifier; +- second tap to change segmentation. + +Requirements: +- avoid swallowing unrelated particles unless selected; +- preserve direct lookup speed for unambiguous taps; +- use touch-sized hit targets. + +### CR-OPP-140 Explicit action feedback + +Small one-tap actions such as: +- copy; +- save word; +- mark known; +- add bookmark; +- export card; +- download media + +should give immediate, non-disruptive confirmation. + +Feedback must not obscure reading text for long or steal keyboard focus unnecessarily. + +### CR-OPP-141 Familiarity from reading behavior + +Optionally infer vocabulary familiarity from behavior such as: +- repeated encounters without lookup; +- repeated successful review; +- manual known/learning changes; +- lookups after a period of apparent familiarity. + +Requirements: +- inference rules are inspectable at a high level; +- user can override state; +- one accidental non-lookup does not mark a term known; +- inferred state is distinguishable from explicit user decisions. + +### CR-OPP-142 Knowledge confidence + +Represent familiarity as more than a binary flag when useful. + +Possible states: +- unseen; +- encountered; +- learning; +- familiar; +- known; +- manually pinned. + +A continuous confidence score MAY exist internally or visibly, but the user must not be forced to understand a complex score to use the reader. + +### CR-OPP-143 Sample-content onboarding + +A new user can explore core interactions immediately using a small bundled/project-owned sample instead of needing to import content first. + +The sample should demonstrate: +- lookup; +- furigana controls; +- highlight/bookmark; +- appearance; +- optional mining. + +It must be clearly removable and must not pollute real reading statistics by default. + +### CR-OPP-144 Daily reading recommendation + +If the user opts into planning, suggest a small next reading target based on: +- current queue; +- recent reading; +- stated goal; +- difficulty; +- time available. + +This should guide, not lock the user into a curriculum. + +### CR-OPP-145 Post-session mining queue + +During reading/watch/listen sessions, allow lightweight marking of candidate words/sentences without interrupting flow. + +After the session, present a review queue where the user can: +- discard; +- mark known; +- add to flashcards; +- merge duplicate contexts; +- choose the best source sentence/media. + +### CR-OPP-146 Batch i+1 review + +For users who want it, analyze a chapter/transcript after consumption and produce a bounded candidate list of terms that are: +- unfamiliar; +- high-value/frequent; +- contextually supported by mostly known surrounding text. + +The system should not auto-create cards without explicit user policy. + +### CR-OPP-147 Shadowing mode + +For audio/video/podcast content, provide sentence-level shadowing controls: +- replay; +- adjustable delay before replay; +- hide/reveal transcript; +- optionally record the learner locally; +- compare timing or pitch only when a valid measurement pipeline exists. + +Any pronunciation scoring must communicate uncertainty and avoid presenting a single noisy measurement as authoritative. + +### CR-OPP-148 Dual-text reveal modes + +For content with source plus translation/reference text, support: +- source only; +- both; +- translation blurred; +- translation hidden until tap; +- temporary reveal. + +This can support reading or listening without making translation permanently dominant. + +### CR-OPP-149 Difficulty-aware furigana baseline + +Instead of selecting furigana only from a generic proficiency level, allow the baseline to combine: +- explicit user level; +- imported known kanji/vocabulary; +- Reader familiarity state. + +User always retains a simple global override. + +### CR-OPP-150 Vocabulary export without lock-in + +Allow saved vocabulary/history to export in a simple documented format independently of any flashcard integration. + +At minimum include: +- expression; +- reading if known; +- meaning/source dictionary reference where licensing permits; +- user status; +- optional source context; +- timestamps. + +### CR-OPP-151 Source-specific privacy defaults + +Content types can have different default capture policies. + +For example: +- ordinary EPUB text may allow source sentence retention; +- private document may default to no cloud helper; +- camera OCR may default to local processing; +- streamed video may restrict screenshots/audio based on platform capability. + +The user should see and be able to change applicable policies rather than discovering them after export. + +### CR-OPP-152 Reading-flow friction telemetry — local only + +Optionally compute private local metrics such as: +- lookups per 1,000 characters; +- lookup pause time; +- repeated lookup rate; +- pages/characters between interruptions. + +Use them to help the user understand material difficulty or reading flow. + +No analytics upload is implied; local computation is the default product opportunity. + +### CR-OPP-153 Context quality chooser + +When multiple possible mining contexts exist, allow the user to choose among: +- exact sentence; +- surrounding paragraph; +- adjacent subtitle lines; +- cleaner example sentence from an authorized source; +- manually edited context. + +The chosen context must retain provenance so the user knows whether it came from the source material or a replacement example. + +### CR-OPP-154 Reading-state interoperability + +Expose a documented portable export/import for: +- current location; +- progress; +- bookmarks; +- highlights; +- notes; +- reading sessions/statistics where practical. + +The goal is durable user ownership, not compatibility with any one external product. From 4c9edb7c3114a24b0b87352c141458e7ba57387f Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:18:26 -0400 Subject: [PATCH 09/28] docs: refresh feature opportunity handoff identity --- CLEAN_ROOM_HANDOFF.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md index 0a85f77867..83e4d376f7 100644 --- a/CLEAN_ROOM_HANDOFF.md +++ b/CLEAN_ROOM_HANDOFF.md @@ -1,7 +1,7 @@ # Clean-room implementation handoff manifest Status: sealed implementation input manifest -Revision: 2026-10-03 feature-discovery pass +Revision: 2026-10-03 feature-discovery pass 2 The implementation worker is authorized to receive exactly the clean-room documents listed below plus ordinary authorized target-repository material. @@ -10,7 +10,7 @@ The implementation worker is authorized to receive exactly the clean-room docume | `CLEAN_ROOM_COMPETITIVE_RESEARCH.md` | `8a54cd241a587c1a3ba4b5d30280c02f55ced45c` | process boundary, evidence rules, taint handling | | `specs/clean-room-reader-competitive-spec.md` | `3f2b0909fec61669774063cc3305abb81b18a2d3` | behavior, fixtures, acceptance tests, benchmarks | | `specs/clean-room-reader-adversarial-qualification.md` | `5a12dad34cae1c3632c959c23e49f665d4afbcac` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | -| `specs/clean-room-reader-feature-opportunities.md` | `d5c0c2f25abde10499cbf06208544b3edc8c764f` | optional sanitized feature backlog; not release requirements | +| `specs/clean-room-reader-feature-opportunities.md` | `3bb774cc210ba15dbfc521b1359a418ad1dff7ec` | optional sanitized feature backlog; not release requirements | ## Scope distinction From 86c170885fb77d515c69ce00d561330570c567c3 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:19:11 -0400 Subject: [PATCH 10/28] spec: add personalized material selection opportunities --- ...clean-room-reader-feature-opportunities.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/specs/clean-room-reader-feature-opportunities.md b/specs/clean-room-reader-feature-opportunities.md index 3bb774cc21..5efc465be2 100644 --- a/specs/clean-room-reader-feature-opportunities.md +++ b/specs/clean-room-reader-feature-opportunities.md @@ -1170,3 +1170,113 @@ Expose a documented portable export/import for: - reading sessions/statistics where practical. The goal is durable user ownership, not compatibility with any one external product. + + +## 17. Material selection and pre-learning opportunities + +### CR-OPP-155 Personalized material difficulty + +Estimate difficulty relative to the current user, not only as a global level. + +Potential factors: +- vocabulary coverage; +- kanji coverage; +- grammar familiarity; +- sentence complexity; +- text density; +- user reading speed and lookup rate on similar material. + +Present separate global/content difficulty and personalized difficulty when both exist. + +### CR-OPP-156 Community difficulty metadata + +Optionally display external/community difficulty information when available from an authorized source. + +Requirements: +- label source and freshness; +- distinguish community-relative ratings from formal proficiency levels; +- never imply an approximate JLPT mapping is an official equivalence; +- external data failure does not block local reading. + +### CR-OPP-157 Order-of-appearance vocabulary list + +Generate a book/chapter vocabulary list ordered by first occurrence. + +Allow alternate sort modes such as: +- first occurrence; +- frequency in this book; +- general corpus frequency; +- unknown-first; +- user status. + +Selecting an entry SHOULD jump to or preview its first source occurrence when practical. + +### CR-OPP-158 New-vocabulary delta + +For a selected book, show only terms that are not already: +- known; +- learning; +- in another selected study deck/list; +- blacklisted/ignored. + +This makes preparation cumulative across the user's library. + +### CR-OPP-159 Next-material recommender + +Recommend candidate books/media using explicit criteria such as: +- target vocabulary coverage; +- difficulty range; +- user interests/tags; +- current queue; +- expected new-word count; +- desired challenge level. + +Recommendations must expose why an item was suggested. + +### CR-OPP-160 Trouble-word pinboard + +During reading, automatically or manually pin words that caused friction. + +Possible signals: +- repeated lookup; +- multiple dictionary-sense changes; +- manual pin; +- lookup followed shortly by another lookup of the same term. + +After the session, show a small reviewable list rather than forcing immediate mining. + +### CR-OPP-161 Source-first i+1 examples + +When choosing an example sentence for a target word, prefer source sentences the user actually encountered that are otherwise mostly understood. + +Requirements: +- preserve source provenance; +- let the user choose a different example; +- do not rewrite source sentences to manufacture i+1 status without explicit labeling. + +### CR-OPP-162 Cross-book vocabulary planning + +When several queued books share unknown vocabulary, identify overlap so the user can prioritize high-leverage words that unlock multiple books. + +This is a planning aid, not an automatic mandate to pre-study. + +### CR-OPP-163 Preparation export + +Allow pre-reading vocabulary/grammar candidates to export in a portable format without requiring use of a built-in SRS. + +Export can include: +- source title/chapter; +- first occurrence; +- frequency; +- reading; +- user knowledge state; +- optional example sentence. + +### CR-OPP-164 Reading readiness threshold + +Let users define a personal threshold such as: +- “show books above 90% known vocabulary,” +- “show chapters with fewer than 20 new terms,” +- “show material one difficulty band above my recent average.” + +Thresholds should remain user-facing filters, not claims that one number determines comprehension. From f72f08d619cd58d01af6ec5dd551348b72f5f70a Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:24:19 -0400 Subject: [PATCH 11/28] spec: add contextual assistance and target overlap guard --- ...clean-room-reader-feature-opportunities.md | 226 ++++++++++++++++++ 1 file changed, 226 insertions(+) diff --git a/specs/clean-room-reader-feature-opportunities.md b/specs/clean-room-reader-feature-opportunities.md index 5efc465be2..30d87355d1 100644 --- a/specs/clean-room-reader-feature-opportunities.md +++ b/specs/clean-room-reader-feature-opportunities.md @@ -1280,3 +1280,229 @@ Let users define a personal threshold such as: - “show material one difficulty band above my recent average.” Thresholds should remain user-facing filters, not claims that one number determines comprehension. + + +## 18. Contextual assistance and review opportunities + +### CR-OPP-165 Scoped reading assistant + +Offer an optional assistant whose scope is explicit: + +- selected word or phrase; +- selected passage; +- current chapter/document; +- whole personal library. + +Possible tasks: +- explain grammar; +- define a cultural/reference term; +- simplify an explanation; +- compare two passages; +- summarize what has been read; +- answer a question using source passages. + +Requirements: +- answers cite or link back to the source passages used where possible; +- the UI clearly shows the active scope; +- library-wide mode cannot silently mix unrelated private sources; +- network/model use follows explicit privacy settings. + +### CR-OPP-166 Permissioned assistant actions + +If an assistant can change user data, separate read and write permissions. + +Potential write actions: +- add/remove tags; +- create a note; +- save a highlight; +- edit local metadata; +- add an item to a reading queue. + +Each action can be configured as: +- allowed; +- confirm each time; +- disabled. + +The assistant must not mutate reading state merely because it answered a question. + +### CR-OPP-167 User-defined reading actions + +Allow reusable user-authored actions on a word, passage or document. + +Examples: +- explain this grammar at my level; +- give two contrasting examples; +- identify names in this paragraph; +- produce a short chapter recap; +- extract unresolved questions; +- create a study note from this highlight. + +Actions should be portable/exportable as plain configuration where possible and should declare whether they use local or network processing. + +### CR-OPP-168 Highlight resurfacing + +Optionally resurface saved highlights/notes after reading using a lightweight spaced-review flow. + +This is distinct from vocabulary SRS. + +Requirements: +- users can disable it; +- source book/location is always visible; +- deleting the review item does not delete the underlying highlight unless explicitly chosen; +- review scheduling is independent from reading statistics. + +### CR-OPP-169 Scaffolding intensity control + +Provide a simple session-level control for how much assistance is visible. + +A target-owned design could vary some combination of: +- generated furigana; +- inline micro-glosses; +- translation reveal; +- grammar hints; +- learner-state color; +- audio prompts. + +Requirements: +- each underlying assistance type remains independently configurable; +- the high-level control must not silently override permanent preferences; +- changing assistance intensity does not change source text or durable location. + +### CR-OPP-170 Translation reveal density + +For bilingual or translated content, allow the learner to choose how often translation is shown by default. + +Possible policies: +- source only; +- translation only on request; +- selected sentences/panels translated; +- mixed/scaffolded mode; +- full parallel text. + +The user can reveal the original/translation for any individual unit regardless of the default policy. + +### CR-OPP-171 Post-reading comprehension check + +After a chapter/session, optionally generate or present a small active-recall check. + +Possible prompts: +- factual comprehension; +- who/what/where; +- sequence of events; +- meaning of a phrase in context; +- short summary. + +Requirements: +- every answer can be traced to the source passage; +- generated questions are clearly identified as generated; +- this never blocks continuing the book; +- the user can disable automatic prompts entirely. + +### CR-OPP-172 Layered annotation packs + +Treat explanatory annotations as a separate layer from the book bytes. + +Potential layers: +- personal notes; +- teacher/editor notes; +- grammar/culture explanations; +- shared study-group notes. + +Requirements: +- each layer can be enabled/disabled; +- provenance is visible; +- annotations cannot silently rewrite source text; +- imported/shared packs have a version/identity independent of the book. + +### CR-OPP-173 Feed subscriptions + +Optional read-later subscriptions can bring recurring content into the library from explicitly subscribed feeds. + +Examples: +- RSS/Atom; +- newsletters through an authorized connector; +- user-selected publication feeds. + +Requirements: +- subscription content is clearly distinguishable from owned local books; +- unsubscribe stops future import without deleting prior saved items unless chosen; +- feed fetch failure cannot damage the main library. + +### CR-OPP-174 Multi-page camera capture + +Extend one-shot camera OCR into a batch flow for a physical chapter/article. + +Possible workflow: +1. capture/import several photos; +2. reorder/retake; +3. deskew/crop; +4. OCR; +5. review uncertain text; +6. save as temporary study set or library item. + +Original images remain available if the user saves the result. + +### CR-OPP-175 Auto-detect OCR after page change + +For a user-authorized live screen/camera OCR mode, optionally detect that the page has settled and refresh OCR automatically. + +Requirements: +- repeated failures pause rather than retry forever; +- the user can stop auto-detect immediately; +- stale OCR from the prior page cannot overlay the new page; +- capture/privacy permissions remain explicit. + +### CR-OPP-176 Source-linked daily review + +Provide an optional daily review combining a bounded sample of: +- difficult highlights; +- pinned trouble words; +- saved source sentences; +- recent notes. + +Every item links back to its original book/media location when still available. + +This is a review surface over existing user data, not a duplicate copy of the library. + +## 19. Target overlap guard + +The following capabilities are already implemented, already specified, or have an established target-side data model in the current Reader repository. They must not be treated as greenfield competitive features merely because they also appear in this opportunity catalog. + +### Already target-specified / existing + +- reader-scoped search; +- bookmarks and resume state; +- highlights and passage notes; +- book-wide notes; +- return navigation / durable jump history foundation; +- scrubber/navigation foundation; +- Line Guide; +- reading statistics and reading goals; +- local-first annotation/account data; +- annotation export/import paths; +- local/provider library and folder organization; +- direct WebDAV support; +- snippets and stable source-selection capture; +- optional video/transcript learning stack; +- dictionary search with frequency/media presentation; +- reading progress/completion state. + +### Opportunity entries that are extensions, not new primitives + +- CR-OPP-013 expands existing goals into broader habit goals. +- CR-OPP-022 expands existing navigation/scrubbing into a richer skim surface. +- CR-OPP-026 expands existing jump/return concepts into explicit Back/Forward history. +- CR-OPP-033 overlaps the already-specified Line Guide; use the existing Line Guide contract rather than building a second feature. +- CR-OPP-035 overlaps existing book-wide notes; only additional UX should be considered. +- CR-OPP-051 extends existing annotation export with additional portable formats/fields. +- CR-OPP-052 extends existing annotation storage with optional connectors. +- CR-OPP-053 extends existing highlights into a later mining action. +- CR-OPP-070 through CR-OPP-080 should compose with the existing video/transcript/audio architecture rather than introduce a parallel media stack. +- CR-OPP-133 should orchestrate existing backup/recovery/sync surfaces rather than duplicate their underlying stores. + +Before selecting any CR-OPP for implementation, the worker must inspect current target-owned architecture and determine whether the correct work is: +- no work; +- test coverage; +- UX exposure; +- extension of an existing primitive; +- or a genuinely new primitive. From 83ba071a0ce4255a5771e73b29e9578341c2f664 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:24:58 -0400 Subject: [PATCH 12/28] docs: refresh sealed opportunity backlog identity --- CLEAN_ROOM_HANDOFF.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md index 83e4d376f7..ddbe15c44c 100644 --- a/CLEAN_ROOM_HANDOFF.md +++ b/CLEAN_ROOM_HANDOFF.md @@ -1,7 +1,7 @@ # Clean-room implementation handoff manifest Status: sealed implementation input manifest -Revision: 2026-10-03 feature-discovery pass 2 +Revision: 2026-10-03 feature-discovery pass 3 The implementation worker is authorized to receive exactly the clean-room documents listed below plus ordinary authorized target-repository material. @@ -10,7 +10,7 @@ The implementation worker is authorized to receive exactly the clean-room docume | `CLEAN_ROOM_COMPETITIVE_RESEARCH.md` | `8a54cd241a587c1a3ba4b5d30280c02f55ced45c` | process boundary, evidence rules, taint handling | | `specs/clean-room-reader-competitive-spec.md` | `3f2b0909fec61669774063cc3305abb81b18a2d3` | behavior, fixtures, acceptance tests, benchmarks | | `specs/clean-room-reader-adversarial-qualification.md` | `5a12dad34cae1c3632c959c23e49f665d4afbcac` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | -| `specs/clean-room-reader-feature-opportunities.md` | `3bb774cc210ba15dbfc521b1359a418ad1dff7ec` | optional sanitized feature backlog; not release requirements | +| `specs/clean-room-reader-feature-opportunities.md` | `30d87355d138e808d7952b2b588f22fc9261468c` | optional sanitized feature backlog; not release requirements | ## Scope distinction From b32eb791de4feb4a8025d26c72bf20d69758b3a8 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:26:43 -0400 Subject: [PATCH 13/28] spec: add entity and deep-reference opportunities --- ...clean-room-reader-feature-opportunities.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/specs/clean-room-reader-feature-opportunities.md b/specs/clean-room-reader-feature-opportunities.md index 30d87355d1..7e581fcc75 100644 --- a/specs/clean-room-reader-feature-opportunities.md +++ b/specs/clean-room-reader-feature-opportunities.md @@ -1506,3 +1506,138 @@ Before selecting any CR-OPP for implementation, the worker must inspect current - UX exposure; - extension of an existing primitive; - or a genuinely new primitive. + + +## 20. Deep-reference and entity navigation opportunities + +### CR-OPP-177 Character and entity index + +Build a book-scoped reference view for recurring entities such as: +- characters; +- places; +- organizations; +- named events; +- user-pinned terms. + +For each entity, optionally show: +- short user-authored/imported description; +- first occurrence; +- recent occurrence; +- all occurrence locations; +- aliases/readings; +- user notes. + +Requirements: +- extracted/inferred entity identity is editable; +- generated descriptions are labeled; +- source occurrences link back to exact passages; +- no external biography/knowledge lookup is required for the basic local feature. + +### CR-OPP-178 Vocabulary occurrence timeline + +For a selected word/kanji, show where it has appeared across: +- the current chapter; +- current book; +- optionally the user's library. + +Potential signals: +- first encounter; +- lookup events; +- saved/mined events; +- later unassisted encounters. + +This can support familiarity decisions without automatically changing them. + +### CR-OPP-179 User-facing reference anchors + +Expose a stable human-shareable reference for a passage in addition to internal durable locators. + +Possible forms: +- chapter + paragraph reference; +- resource + paragraph ordinal; +- target-owned opaque reference token. + +Requirements: +- remains resolvable across ordinary reflow; +- clearly fails or degrades when the underlying edition/text changed too much; +- never exposes a private filesystem/provider path; +- copy/share is explicit. + +### CR-OPP-180 Deep links to reading locations + +Allow a target-owned link/reference to reopen a book at a saved location when the recipient/device has authorized access to the same logical book. + +Potential uses: +- lesson notes; +- personal notes; +- study-group discussion; +- external knowledge-base links. + +The link must not grant access to book bytes the recipient does not already have permission to read. + +### CR-OPP-181 Progress-linked reading journal + +Let users record freeform journal entries associated with: +- a point in the book; +- a progress percentage; +- a chapter; +- a reading session; +- the whole book. + +Journal entries remain separate from passage highlights so the user can log reactions without selecting text. + +### CR-OPP-182 Spoiler-aware shared discussion + +If social/shared annotations are ever added, gate visibility by reading progress. + +Possible policy: +- comments attached beyond the user's current position are hidden; +- user can explicitly reveal later discussion; +- current-position discussion is visible. + +Shared discussion must be opt-in and must not upload private book content beyond what the user explicitly shares. + +### CR-OPP-183 Semantic library search + +Complement literal full-text search with optional concept-level retrieval across the user's library. + +Requirements: +- every result cites the originating book and passage; +- literal search remains separately available; +- local embedding/indexing is preferred when feasible; +- remote semantic processing is explicit; +- deleting a book removes its semantic index without affecting other books. + +## 21. Library lifecycle and physical-book bridge opportunities + +### CR-OPP-184 Paused / did-not-finish state + +Distinguish: +- actively reading; +- paused; +- finished; +- did not finish. + +This is separate from deleting the book or resetting progress. + +### CR-OPP-185 Physical-book catalog entry + +Optionally let users add a metadata-only physical book via: +- ISBN/barcode scan; +- manual metadata. + +A physical entry may link to camera OCR sessions/notes without pretending that full digital book bytes are available. + +### CR-OPP-186 Reading report + +Generate a private per-book or period report from existing data: +- time read; +- reading days; +- progress; +- speed trend; +- lookups; +- highlights/notes; +- difficult terms; +- completion date. + +Reports should reflect existing statistics rather than inventing a second accounting system. From c011a0536477b840a1a21f1e8ee6c7f6d3abfef7 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 02:27:09 -0400 Subject: [PATCH 14/28] docs: seal expanded feature discovery handoff --- CLEAN_ROOM_HANDOFF.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md index ddbe15c44c..9008289ff7 100644 --- a/CLEAN_ROOM_HANDOFF.md +++ b/CLEAN_ROOM_HANDOFF.md @@ -1,7 +1,7 @@ # Clean-room implementation handoff manifest Status: sealed implementation input manifest -Revision: 2026-10-03 feature-discovery pass 3 +Revision: 2026-10-03 feature-discovery pass 4 The implementation worker is authorized to receive exactly the clean-room documents listed below plus ordinary authorized target-repository material. @@ -10,7 +10,7 @@ The implementation worker is authorized to receive exactly the clean-room docume | `CLEAN_ROOM_COMPETITIVE_RESEARCH.md` | `8a54cd241a587c1a3ba4b5d30280c02f55ced45c` | process boundary, evidence rules, taint handling | | `specs/clean-room-reader-competitive-spec.md` | `3f2b0909fec61669774063cc3305abb81b18a2d3` | behavior, fixtures, acceptance tests, benchmarks | | `specs/clean-room-reader-adversarial-qualification.md` | `5a12dad34cae1c3632c959c23e49f665d4afbcac` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | -| `specs/clean-room-reader-feature-opportunities.md` | `30d87355d138e808d7952b2b588f22fc9261468c` | optional sanitized feature backlog; not release requirements | +| `specs/clean-room-reader-feature-opportunities.md` | `7e581fcc75da9dad4d050e85d74adfab2a25deb5` | optional sanitized feature backlog; not release requirements | ## Scope distinction From b98edf7ade16d899ce3b48915243d5112fc3752f Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 10:46:44 -0400 Subject: [PATCH 15/28] docs: add explicit per-feature approval gate --- CLEAN_ROOM_APPROVALS.md | 155 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 CLEAN_ROOM_APPROVALS.md diff --git a/CLEAN_ROOM_APPROVALS.md b/CLEAN_ROOM_APPROVALS.md new file mode 100644 index 0000000000..d1f24f6bff --- /dev/null +++ b/CLEAN_ROOM_APPROVALS.md @@ -0,0 +1,155 @@ +# Clean-room feature approval gate + +Status: CLOSED BY DEFAULT +Revision: 2026-10-03 + +This file is the authorization gate for work derived from the clean-room competitive-reader program. + +## Default rule + +**No feature, acceptance suite, benchmark-driven fix, fixture suite, or product change is approved for implementation merely because it appears in this branch or PR #260.** + +The clean-room documents are research/specification inputs. They are not a standing work order. + +Unless an approval is recorded below, a worker may only: + +- review and refine the clean-room research/specification documents on this draft branch; +- deduplicate or clarify requirements; +- inspect authorized Manabi target code to identify overlap when the user explicitly asks for review; +- report what would need approval. + +Without an approval, a worker must not: + +- add CR-derived test fixtures to the product test suite; +- add CR-derived automated/browser/device tests; +- modify product/runtime code; +- implement a `CR-OPP-*` feature; +- open an implementation PR based on this program; +- mark PR #260 ready for review; +- merge or close PR #260 as “finished”; +- infer approval from a previous worker's activity. + +## Approval levels + +An approval must identify a bounded feature or CR ID set and one of these levels. + +### DISCOVERY_ONLY + +Default state. Research/spec refinement only. No product/test mutation is authorized. + +### APPROVED_FOR_TESTS + +Authorizes only independently authored fixtures and tests for the named feature/CR IDs. + +It does **not** authorize production behavior changes, even if tests fail. + +### APPROVED_FOR_IMPLEMENTATION + +Authorizes production changes only for the named feature/CR IDs and only within the stated scope. + +It includes the minimum tests needed for that implementation unless the approval explicitly says otherwise. + +### APPROVED_FOR_INTEGRATION + +Authorizes integration/merge work for the named implementation PR or bounded feature change. + +This does not authorize unrelated features. + +## What counts as explicit per-feature approval + +A valid approval must come from the user/project owner and must unambiguously identify the feature. + +Preferred forms: + +- `Approve CR-OPP-001 for implementation.` +- `Approve CR-OPP-003 and CR-OPP-149 for a design/test prototype only.` +- `Approve the chapter-preflight feature (CR-OPP-001) for implementation in Manabi Reader Web.` +- `Approve CR-AT-001..006 for tests only; do not change production code.` + +A named feature may be accepted without the literal CR ID only when the mapping is unique and the worker records the mapped CR ID before starting. + +## What does not count as approval + +None of the following authorizes implementation: + +- the feature appearing in this branch; +- the feature being marked MUST/SHOULD/MAY; +- the feature being described as high value, strong, important, or a candidate; +- a benchmark or acceptance test failing; +- a prior worker creating research/spec text; +- a prior worker creating PR #260; +- approval of a neighboring or related feature; +- approval of the same feature in another repository/platform; +- generic instructions such as “continue,” “go deeper,” “review,” “refine,” “finish the clean-room work,” or “work through the backlog”; +- a request to investigate or compare a feature; +- an implementation worker deciding that a feature is easy or obviously beneficial. + +Approval is non-transitive and non-inferential. + +## Approval scope requirements + +Each approval record must state: + +- approval ID; +- date; +- feature/CR IDs; +- approval level; +- target repository/platform; +- bounded deliverable; +- explicit exclusions or constraints; +- status: active, completed, revoked, or superseded. + +If any of those materially affect what can be changed and are unspecified, use the narrowest reasonable interpretation and do not expand scope. + +## PR #260 state gate + +PR #260 is a **research/specification draft**. + +It must remain a GitHub Draft until the user/project owner explicitly authorizes a PR-state transition referring to PR #260 or this clean-room research PR. + +Per-feature implementation approvals do **not** implicitly authorize marking PR #260 ready, merging it, or declaring the overall program complete. + +Examples of valid PR-state authorization: + +- `Mark PR #260 ready for review.` +- `Merge PR #260.` +- `Finalize the clean-room research PR.` + +Absent such an instruction, future workers must preserve Draft state. + +## Active approvals + +**None.** + +Therefore, at this revision: + +- no `CR-OPP-*` feature is approved for tests or implementation; +- no correctness/acceptance suite is approved for target-code mutation under this program; +- no implementation PR is authorized; +- PR #260 is not authorized to leave Draft state. + +## Recording a future approval + +Append a record in this format: + +```text +Approval ID: CR-AUTH-001 +Date: YYYY-MM-DD +Feature/CR IDs: ... +Level: APPROVED_FOR_TESTS | APPROVED_FOR_IMPLEMENTATION | APPROVED_FOR_INTEGRATION +Target: ... +Deliverable: ... +Exclusions: ... +Status: active +Evidence of approval: concise paraphrase of the explicit user/project-owner instruction +``` + +Do not include competitor provenance in an approval record. + +## Revocation and completion + +The user/project owner may revoke or narrow approval at any time. + +When a bounded approved feature is completed, mark that approval record completed. Completion does not authorize the next feature. + +A new feature requires a new explicit approval. From d14df6db0a5bed3c7567ec9ef90dce165210e750 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 10:47:08 -0400 Subject: [PATCH 16/28] docs: separate approval authority from clean-room specification --- CLEAN_ROOM_COMPETITIVE_RESEARCH.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/CLEAN_ROOM_COMPETITIVE_RESEARCH.md b/CLEAN_ROOM_COMPETITIVE_RESEARCH.md index 8a54cd241a..6cb64cd454 100644 --- a/CLEAN_ROOM_COMPETITIVE_RESEARCH.md +++ b/CLEAN_ROOM_COMPETITIVE_RESEARCH.md @@ -38,7 +38,11 @@ The contract must not contain competitor names as provenance for individual requ ### Implementer -The implementer receives only the sanitized specification and this policy. The implementer may inspect and modify Manabi-owned or otherwise authorized target code as needed, subject to the repository's existing licensing boundaries. +The implementer receives only the sanitized specification, this policy, the approval gate, and authorized target-repository material. + +**Receipt of the clean-room handoff is not authorization to implement anything.** Before creating fixtures/tests or modifying target product code, the implementer must read `CLEAN_ROOM_APPROVALS.md` and confirm that the exact feature/CR IDs and requested work level are actively approved. + +An implementer may inspect and modify Manabi-owned or otherwise authorized target code only within an active approval, subject to the repository's existing licensing boundaries. The implementer must not: @@ -169,3 +173,24 @@ Before merging a competitively motivated UI change, reviewers should separately - test fixtures and example content are independently authored. Clean-room process protects implementation provenance; it is not permission to copy protected visual expression. + + +## Authorization is separate from specification severity + +Normative words in the sanitized specifications describe desired behavior **if and when that feature or qualification scope is approved**. + +They do not authorize work: + +- MUST does not mean “implement now”; +- a failing acceptance test does not authorize a fix; +- a benchmark target does not authorize optimization work; +- an optional opportunity does not authorize a prototype; +- a feature being already partially present does not authorize completion. + +`CLEAN_ROOM_APPROVALS.md` is the sole branch-local record of approval state for this program. When it says no active approvals, no target test or product mutation is authorized by these clean-room documents. + +## Research PR state + +PR #260 is a research/specification draft. Research/spec refinement may continue when explicitly requested, but workers must preserve Draft state unless the user/project owner explicitly authorizes changing PR #260 to ready, merging it, or otherwise finalizing it. + +Per-feature approval is not PR-finalization approval, and PR-finalization approval is not per-feature implementation approval. From 0fa7fb37b6ec45a6383ac9ae18144ad2edd269e9 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 10:47:41 -0400 Subject: [PATCH 17/28] spec: gate qualification and implementation on explicit approval --- specs/clean-room-reader-competitive-spec.md | 42 +++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/specs/clean-room-reader-competitive-spec.md b/specs/clean-room-reader-competitive-spec.md index 3f2b0909fe..fd1269b042 100644 --- a/specs/clean-room-reader-competitive-spec.md +++ b/specs/clean-room-reader-competitive-spec.md @@ -3,6 +3,7 @@ Status: sanitized implementation contract Revision: 2026-10-02 Source provenance: intentionally excluded from implementation input +Authorization: **no implementation authority is granted by this document. Read `../CLEAN_ROOM_APPROVALS.md` before any CR-derived target tests or product changes.** ## 1. Scope @@ -26,10 +27,12 @@ It does not prescribe architecture, algorithms, libraries, data structures, file Existing product features not covered here remain governed by their existing contracts. An implementation may satisfy a requirement using any independently chosen design that produces the required visible behavior. -Normative language: -- MUST: release-blocking requirement. -- SHOULD: expected unless a documented platform limitation prevents it. -- MAY: optional behavior. +Normative language describes desired quality only inside an explicitly approved feature/suite: +- MUST: release-blocking for that approved scope. +- SHOULD: expected for that approved scope unless a documented platform limitation prevents it. +- MAY: optional behavior within that approved scope. + +MUST/SHOULD/MAY never grant permission to implement, test, optimize, or expand a feature. Approval is governed separately by `CLEAN_ROOM_APPROVALS.md`. ## 2. Product-level invariants @@ -832,30 +835,29 @@ Tests and telemetry/logs may classify failures with implementation-neutral categ Exact internal enum names are not mandated. User-visible errors SHOULD use plain language rather than these machine-oriented labels. -## 11. Implementation sequencing +## 11. Qualification sequencing after approval + +This is a risk-first order for a **separately approved** feature or suite. It is not standing authorization to execute these phases. -This is not an implementation prescription; it is a risk-first acceptance order. +Possible sequence after the approval gate is satisfied: -Phase A — build the independent fixture corpus and executable regressions: -CR-FIX-001 through CR-FIX-015, plus acceptance IDs 001–083 relevant to current features. +Phase A — for the named approved scope, build only the independently authored fixtures/tests permitted by that approval. -Phase B — make current behavior pass correctness regressions: -Unicode/ruby, navigation/style conflict, selection, restore, batch import, broken resources. +Phase B — if production implementation is also explicitly approved, address failing correctness requirements for the named scope. -Phase C — lifecycle and media: -background ownership, crash/reload restoration, stale asynchronous results, read-along boundary cases. +Phase C — if included in the approval, qualify lifecycle/media behavior. -Phase D — scale: -large library, long chapter, search and re-entry benchmark suite. +Phase D — if included in the approval, run scale and benchmark work. -Phase E — optional surfaces: -manga/OCR, e-ink, profile-specific extensions not already present. +Phase E — optional surfaces require their own explicit feature approval; they are never pulled in merely because an earlier phase completed. -A phase may discover that the current product already passes a requirement. In that case, add or retain a regression test and record it as satisfied; do not rewrite working code merely to mimic another product. +A phase may discover that the current product already passes a requirement. In that case, preserve working behavior. Do not rewrite it merely to mimic another product. + +If the approval is tests-only, stop after tests/qualification and report failures; do not modify production behavior. ## 12. Definition of done -The clean-room competitiveness pass is complete for a feature area when: +For an explicitly approved feature area, qualification is complete when: 1. every in-scope MUST acceptance test has an automated test or a documented physical-device/manual test where automation is not credible; 2. all independently authored fixtures are stored with project-owned provenance and licenses; @@ -867,7 +869,9 @@ The clean-room competitiveness pass is complete for a feature area when: ## 13. Implementer handoff text -Use only this specification, the clean-room policy, and authorized target repository material. +Use only this specification, the clean-room policy, `CLEAN_ROOM_APPROVALS.md`, the sealed handoff, and authorized target repository material. + +First verify that an active approval names the exact feature/CR IDs and work level. If no matching approval exists, do not create target fixtures/tests or modify product code; restrict work to requested research/spec refinement. Do not search for or inspect the products that motivated these requirements. Do not open competitor repositories, source-bearing issues/PRs, patches, diffs, symbols, comments, or implementation descriptions. Do not request the observer dossier. From 63fd7ccf834a510a71d9475bb641938649004115 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 10:48:02 -0400 Subject: [PATCH 18/28] spec: add approval and stop gates to adversarial qualification --- ...n-room-reader-adversarial-qualification.md | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/specs/clean-room-reader-adversarial-qualification.md b/specs/clean-room-reader-adversarial-qualification.md index 5a12dad34c..b424948102 100644 --- a/specs/clean-room-reader-adversarial-qualification.md +++ b/specs/clean-room-reader-adversarial-qualification.md @@ -3,6 +3,7 @@ Status: sanitized implementation input Revision: 2026-10-02 deep pass External source provenance: intentionally absent +Authorization: **qualification work in this document is dormant unless the relevant feature/suite is explicitly approved in `../CLEAN_ROOM_APPROVALS.md`.** This document supplements `clean-room-reader-competitive-spec.md`. It turns broad behavior requirements into adversarial, metamorphic, cross-engine, state-transition, and scale tests. It does not prescribe implementation. @@ -747,9 +748,11 @@ Do not place external competitor source/provenance in this record. ## 12. Release gate -A release candidate should not claim the clean-room program is complete merely because the new tests exist. +This gate applies only to a feature/suite that has explicit approval at the required work level. It does not authorize testing, implementation, integration, or release work by itself. -For each currently shipped feature area, completion requires: +A release candidate should not claim an approved clean-room scope is complete merely because tests exist. + +For each approved shipped feature area, completion requires: - relevant deterministic acceptance tests pass; - applicable cross-engine matrix passes; - soak tests have no unbounded lifecycle defect; @@ -758,3 +761,17 @@ For each currently shipped feature area, completion requires: - sync/provider destructive cases have a documented policy; - fixture provenance is project-owned; - implementation review confirms no prohibited external implementation material entered the worker context. + + +## 13. Stop conditions + +A worker must stop target-side execution for a CR area when: + +- no active approval names that feature/suite; +- the approval is tests-only and a production failure is discovered; +- resolving the failure would require an adjacent unapproved feature; +- the worker would need external competitor research to clarify behavior; +- device qualification is required but unavailable; +- the approved scope has been completed. + +The worker should report the finding and the CR IDs that would require a new approval. It must not “finish nearby work while here.” From b7df70178e1806ea008cec0940ffee0f00182fbf Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 10:48:47 -0400 Subject: [PATCH 19/28] spec: make opportunity backlog discovery-only by default --- ...clean-room-reader-feature-opportunities.md | 52 +++++++++++++++++-- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/specs/clean-room-reader-feature-opportunities.md b/specs/clean-room-reader-feature-opportunities.md index 7e581fcc75..0563e33fe2 100644 --- a/specs/clean-room-reader-feature-opportunities.md +++ b/specs/clean-room-reader-feature-opportunities.md @@ -1,12 +1,17 @@ # Clean-room reader feature opportunities -Status: sanitized optional product backlog +Status: DISCOVERY_ONLY sanitized optional product backlog Revision: 2026-10-03 External product provenance: intentionally absent +Authorization: **none of the CR-OPP entries in this document are approved for tests or implementation by inclusion here. `../CLEAN_ROOM_APPROVALS.md` currently controls promotion.** -This document contains product opportunities discovered through behavior-only competitive research. None of these are release requirements unless separately promoted into a scoped implementation plan. +This document contains product opportunities discovered through behavior-only competitive research. It is an idea registry, not a roadmap, queue, work order, or release plan. -The purpose is to preserve useful ideas without forcing the implementation worker to inspect external products. +The purpose is to preserve useful ideas without forcing an implementation worker to inspect external products. + +Every CR-OPP entry defaults to DISCOVERY_ONLY. A future worker may refine an entry when explicitly asked to review this research PR, but must not create target tests, prototypes, production changes, or implementation PRs for it unless a separate explicit per-feature approval names that entry (or an unambiguous mapped feature) and approval level. + +Order in this file, section placement, detail level, mention in a “candidate” subset, or overlap with current target primitives does not imply priority or approval. ## 1. Learning-aware reading @@ -883,9 +888,9 @@ Evaluate an opportunity on: A feature with strong value but large new product scope should remain in this optional backlog rather than entering a current implementation PR by accident. -## 15. Particularly strong candidates for separate exploration +## 15. Cross-cutting candidates retained for possible separate exploration -These appear broadly useful enough to justify dedicated product-design investigation: +These entries touch reusable target primitives and may be worth discussing separately **if the user explicitly selects them for further product-design investigation**. This section is not an approval list or priority ranking: - CR-OPP-001 Chapter preflight - CR-OPP-003 Adaptive furigana @@ -1641,3 +1646,40 @@ Generate a private per-book or period report from existing data: - completion date. Reports should reflect existing statistics rather than inventing a second accounting system. + + +## 22. Promotion rules + +A CR-OPP item can move out of DISCOVERY_ONLY only through an explicit approval recorded in `../CLEAN_ROOM_APPROVALS.md`. + +Promotion is granular: + +- approving one CR-OPP does not approve adjacent entries; +- approving design exploration does not approve tests; +- approving tests does not approve production implementation; +- approving implementation does not approve integration/merge; +- approving a feature for one platform/repository does not automatically approve another; +- approving an existing primitive's extension does not authorize replacing that primitive. + +When a selected feature overlaps existing Reader architecture, the approved worker must first state which category applies: + +1. already satisfied — no target change; +2. missing qualification — tests/evidence only if approved; +3. UX exposure of an existing primitive; +4. bounded extension of an existing primitive; +5. genuinely new primitive. + +If the category itself is unclear, report that uncertainty before changing target code. + +## 23. Non-goals for this backlog + +This backlog does not authorize: + +- implementing all 186 ideas; +- converging Manabi toward a competitor's aggregate feature set; +- recreating a competitor's workflow wholesale; +- replacing current target architecture because another product uses a different model; +- starting a feature because a future worker believes it is obvious, easy, or valuable; +- treating an observer-source update as a request to implement what was observed. + +The branch remains research/specification material until per-feature approval says otherwise. From fe4a960cea66961a8502d0346fc990a6473d6f27 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 10:49:43 -0400 Subject: [PATCH 20/28] docs: seal handoff behind explicit per-feature approval --- CLEAN_ROOM_HANDOFF.md | 116 ++++++++++++++++++++++++++++++++---------- 1 file changed, 90 insertions(+), 26 deletions(-) diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md index 9008289ff7..8faa2663ed 100644 --- a/CLEAN_ROOM_HANDOFF.md +++ b/CLEAN_ROOM_HANDOFF.md @@ -1,24 +1,78 @@ # Clean-room implementation handoff manifest -Status: sealed implementation input manifest -Revision: 2026-10-03 feature-discovery pass 4 +Status: SEALED RESEARCH HANDOFF — NO ACTIVE IMPLEMENTATION APPROVALS +Revision: 2026-10-03 approval-gated refinement -The implementation worker is authorized to receive exactly the clean-room documents listed below plus ordinary authorized target-repository material. +PR #260 is a research/specification Draft. This manifest identifies the clean documents a future worker may read. **It does not authorize that worker to implement, test, prototype, integrate, mark ready, merge, or finish any feature.** + +## Approval gate comes first + +Before doing any CR-derived target work, read: | Path | Git blob SHA | Purpose | | --- | --- | --- | -| `CLEAN_ROOM_COMPETITIVE_RESEARCH.md` | `8a54cd241a587c1a3ba4b5d30280c02f55ced45c` | process boundary, evidence rules, taint handling | -| `specs/clean-room-reader-competitive-spec.md` | `3f2b0909fec61669774063cc3305abb81b18a2d3` | behavior, fixtures, acceptance tests, benchmarks | -| `specs/clean-room-reader-adversarial-qualification.md` | `5a12dad34cae1c3632c959c23e49f665d4afbcac` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | -| `specs/clean-room-reader-feature-opportunities.md` | `7e581fcc75da9dad4d050e85d74adfab2a25deb5` | optional sanitized feature backlog; not release requirements | +| `CLEAN_ROOM_APPROVALS.md` | `d1f24f6bff15663474b40e68fdc8e63772c3ba0d` | explicit per-feature/work-level authorization ledger | + +At this revision, `CLEAN_ROOM_APPROVALS.md` states **Active approvals: None**. + +Therefore no target fixtures/tests, production changes, implementation PRs, integration, or PR #260 finalization are authorized by this clean-room program. + +## Sanitized research inputs + +Subject to the approval gate above, the worker may receive these documents plus ordinary authorized target-repository material: + +| Path | Git blob SHA | Purpose | +| --- | --- | --- | +| `CLEAN_ROOM_COMPETITIVE_RESEARCH.md` | `6cb64cd45478906d3648860945b33c35f75e450d` | process boundary, evidence rules, taint handling, authorization separation | +| `specs/clean-room-reader-competitive-spec.md` | `fd1269b0426ce7b526a99f985c15b4192634fcdd` | behavior contracts, fixtures, acceptance tests, benchmarks | +| `specs/clean-room-reader-adversarial-qualification.md` | `b4249481022cb010cfcee89d5263c3766201208b` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | +| `specs/clean-room-reader-feature-opportunities.md` | `0563e33fe230eb627210c839ed1cc80b8a17c00e` | DISCOVERY_ONLY optional feature registry | + +## Default worker authority + +With no active approval, a worker may only do research/specification work that the user explicitly requests on this draft branch, such as: + +- review wording; +- deduplicate requirements; +- identify target-side overlap; +- refine acceptance criteria; +- report which feature/CR IDs would need approval. + +The worker must not create target fixtures/tests or modify product/runtime code from these documents. -## Scope distinction +## Per-feature approval rule -The competitive and adversarial specifications contain correctness/release-quality contracts for features already in scope. +A target-side action requires an active approval that names: -The feature-opportunities document is different: its `CR-OPP-*` entries are optional exploration candidates. Their presence in the handoff does not authorize scope expansion in an implementation PR. +- the feature/CR IDs; +- approval level; +- target repository/platform; +- bounded deliverable. -A worker should implement a `CR-OPP-*` only when the user or a separately scoped target-side plan explicitly selects it. +Approval is non-transitive. + +In particular: + +- `CR-OPP-*` remains DISCOVERY_ONLY until individually selected; +- MUST/SHOULD language is not authorization; +- a failing test/benchmark is not authorization; +- approval of tests is not approval of fixes; +- approval of one feature is not approval of an adjacent feature; +- approval on one platform is not approval on another; +- a generic instruction such as “continue,” “go deeper,” “review,” or “finish” is not per-feature implementation approval. + +## PR #260 state gate + +PR #260 must remain a GitHub Draft unless the user/project owner explicitly authorizes a PR-state transition referring to PR #260 or this clean-room research PR. + +Per-feature approvals do not imply permission to: + +- mark PR #260 ready for review; +- merge PR #260; +- close it as completed; +- declare the overall clean-room program finished. + +Likewise, permission to finalize PR #260 would not by itself authorize any product feature implementation. ## Not authorized @@ -31,29 +85,39 @@ The worker must not receive or request: - contaminated observation notes; - copied third-party fixtures or distinctive UI assets. +The worker must not independently research the external products that motivated the sanitized requirements. + ## Worker startup checklist -Before implementation work: +Before any target-side work: -1. confirm the four blob SHAs above match the checked-out handoff; -2. do not perform external competitor research; -3. inventory current target behavior using only target-owned tests/code plus the sanitized CR requirements; -4. create independently authored fixtures before making competitively motivated production changes; -5. record which CR requirements already pass; -6. fix only failing/incomplete requirements using target-owned design; -7. treat `CR-OPP-*` as backlog unless separately selected; -8. keep benchmark and device evidence separate from unsupported claims. +1. verify the approval-ledger blob SHA and read it; +2. verify the sanitized research blob SHAs above; +3. confirm an active approval exactly covers the requested CR IDs and work level; +4. if no matching approval exists, stop target-side execution and report the required approval; +5. do not perform external competitor research; +6. inspect current target-owned architecture for overlap only within the user's requested review scope; +7. preserve existing working primitives rather than rebuilding them to resemble another product. -## Worker completion attestation +## Approved-work execution -An implementation PR should include a statement equivalent to: +Only after a matching approval exists: + +1. restate the approval ID, CR IDs, work level, target, deliverable and exclusions; +2. if approved for tests, create only independently authored fixtures/tests and stop at reported failures; +3. if approved for implementation, make only the bounded target-owned changes needed for the approved IDs; +4. if adjacent unapproved work is discovered, report it rather than “finishing it while here”; +5. run only the qualification/benchmark/device work included in approval; +6. mark the approval record completed when the bounded work is done. + +## Worker completion attestation -> I implemented and qualified the referenced CR requirements using only the sealed clean-room handoff and authorized target-repository material. I did not consult prohibited external implementation material or the observer-side provenance record. +An implementation PR for an approved feature should include a statement equivalent to: -The exact wording may vary, but the substance must be retained. +> I implemented and qualified only the approved CR scope using the sealed clean-room handoff and authorized target-repository material. I did not consult prohibited external implementation material or the observer-side provenance record, and I did not expand into unapproved adjacent features. ## Manifest updates -Any change to one of the four authorized documents changes its blob SHA and requires a new manifest revision before a clean implementation handoff. +Any change to the approval ledger or one of the four sanitized research documents changes its blob SHA and requires a new manifest revision before handoff. -This manifest itself contains no external source provenance and may be supplied to the implementation worker. +This manifest itself contains no external source provenance and may be supplied to a future worker. From 9be38b4eac8c5854b2d7f530765424f936181155 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 10:51:36 -0400 Subject: [PATCH 21/28] docs: harden per-feature scope and shared-primitive rules --- CLEAN_ROOM_APPROVALS.md | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/CLEAN_ROOM_APPROVALS.md b/CLEAN_ROOM_APPROVALS.md index d1f24f6bff..fd6b1ea7c7 100644 --- a/CLEAN_ROOM_APPROVALS.md +++ b/CLEAN_ROOM_APPROVALS.md @@ -153,3 +153,61 @@ The user/project owner may revoke or narrow approval at any time. When a bounded approved feature is completed, mark that approval record completed. Completion does not authorize the next feature. A new feature requires a new explicit approval. + + +## Approval validation checklist + +Before target-side work, a worker must validate all of the following: + +1. the approval record exists in this file; +2. its status is active; +3. the requested CR ID/feature is explicitly covered; +4. the requested action is permitted by the approval level; +5. the target repository/platform matches; +6. the requested deliverable fits the bounded deliverable text; +7. no exclusion forbids the requested change; +8. the approval has not been superseded by a narrower/later record. + +If any check fails, target-side work is not authorized. + +## Per-feature scope packet + +Before starting an approved feature, the worker should state a compact scope packet in its implementation PR or working notes: + +- Approval ID +- CR IDs +- target repo/platform +- existing target primitive(s) reused +- user-visible behavior being changed +- data/storage migrations, if any +- privacy/network effect, if any +- test/benchmark IDs in scope +- explicit non-goals +- adjacent CR IDs discovered but not approved + +The scope packet is derived only from the sanitized handoff plus authorized target code. + +## Minimal shared-primitive rule + +An approved feature may require a shared target-owned primitive. + +That does not create authority to implement other features that could also use the primitive. + +A worker may add/refine a shared primitive only when all of these are true: + +- it is necessary for the approved behavior; +- its API/scope is the minimum coherent target-owned abstraction needed; +- it does not expose unrelated new user-visible features; +- it does not pre-implement unapproved feature-specific behavior; +- its tests are limited to the primitive's contract and the approved feature; +- adjacent opportunities are recorded for later approval rather than bundled in. + +A broad refactor justified mainly by future unapproved CR-OPP entries requires separate approval. + +## No batch approval by implication + +Even if several CR entries share one subsystem, approval remains per named feature/suite. + +For example, approval of one audio mode does not authorize every `CR-OPP-070..` media feature; approval of one OCR feature does not authorize the entire OCR opportunity section. + +A user/project owner may explicitly approve a bounded bundle, but the bundle must be named or enumerated. Workers may not construct the bundle themselves. From 166c3c231daacfe4197042603eddd5758862982c Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 10:53:24 -0400 Subject: [PATCH 22/28] docs: refresh approval-ledger handoff identity --- CLEAN_ROOM_HANDOFF.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md index 8faa2663ed..5fd7a2335b 100644 --- a/CLEAN_ROOM_HANDOFF.md +++ b/CLEAN_ROOM_HANDOFF.md @@ -11,7 +11,7 @@ Before doing any CR-derived target work, read: | Path | Git blob SHA | Purpose | | --- | --- | --- | -| `CLEAN_ROOM_APPROVALS.md` | `d1f24f6bff15663474b40e68fdc8e63772c3ba0d` | explicit per-feature/work-level authorization ledger | +| `CLEAN_ROOM_APPROVALS.md` | `fd6b1ea7c76097bf81b5a456fc8eaa0951681cae` | explicit per-feature/work-level authorization ledger | At this revision, `CLEAN_ROOM_APPROVALS.md` states **Active approvals: None**. From 1d326dfdcb3ffdc4bdb04818078bcc9a4a252d40 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 11:06:01 -0400 Subject: [PATCH 23/28] docs: prevent self-approval and gate design separately --- CLEAN_ROOM_APPROVALS.md | 81 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/CLEAN_ROOM_APPROVALS.md b/CLEAN_ROOM_APPROVALS.md index fd6b1ea7c7..cd3219f3ef 100644 --- a/CLEAN_ROOM_APPROVALS.md +++ b/CLEAN_ROOM_APPROVALS.md @@ -37,6 +37,17 @@ An approval must identify a bounded feature or CR ID set and one of these levels Default state. Research/spec refinement only. No product/test mutation is authorized. +### APPROVED_FOR_DESIGN + +Authorizes only target-side product/design exploration for the named feature/CR IDs, such as: +- target-owned UX flows; +- wire-level behavior descriptions; +- target architecture impact analysis; +- data/privacy decisions; +- acceptance-criteria refinement. + +It does **not** authorize adding product fixtures/tests, changing production behavior, or opening an implementation PR. + ### APPROVED_FOR_TESTS Authorizes only independently authored fixtures and tests for the named feature/CR IDs. @@ -62,7 +73,7 @@ A valid approval must come from the user/project owner and must unambiguously id Preferred forms: - `Approve CR-OPP-001 for implementation.` -- `Approve CR-OPP-003 and CR-OPP-149 for a design/test prototype only.` +- `Approve CR-OPP-003 and CR-OPP-149 for design exploration only.` - `Approve the chapter-preflight feature (CR-OPP-001) for implementation in Manabi Reader Web.` - `Approve CR-AT-001..006 for tests only; do not change production code.` @@ -136,7 +147,7 @@ Append a record in this format: Approval ID: CR-AUTH-001 Date: YYYY-MM-DD Feature/CR IDs: ... -Level: APPROVED_FOR_TESTS | APPROVED_FOR_IMPLEMENTATION | APPROVED_FOR_INTEGRATION +Level: APPROVED_FOR_DESIGN | APPROVED_FOR_TESTS | APPROVED_FOR_IMPLEMENTATION | APPROVED_FOR_INTEGRATION Target: ... Deliverable: ... Exclusions: ... @@ -211,3 +222,69 @@ Even if several CR entries share one subsystem, approval remains per named featu For example, approval of one audio mode does not authorize every `CR-OPP-070..` media feature; approval of one OCR feature does not authorize the entire OCR opportunity section. A user/project owner may explicitly approve a bounded bundle, but the bundle must be named or enumerated. Workers may not construct the bundle themselves. + + +## Approval-ledger mutation rule + +Workers are not authorized to create, broaden, reactivate, or upgrade an approval record on their own. + +An approval record may be added or changed to `active` only when the current user/project-owner instruction explicitly grants that approval. + +A worker must not mutate this ledger merely because: + +- a task was assigned by another worker; +- an issue/PR says a feature should be implemented; +- a project document recommends the feature; +- CI/test output suggests a fix; +- a previous assistant claimed approval existed; +- the feature appears in an implementation branch; +- the worker believes approval is implied. + +When recording a new approval, the worker must be able to point to the explicit owner instruction in the current conversational/task context. If that evidence is absent, leave the ledger unchanged and report that approval is missing. + +A worker may update an existing record to `completed`, `revoked`, or `superseded` only when: +- the bounded approved work has actually completed; or +- the user/project owner explicitly revokes/supersedes it. + +Completion may never broaden scope. + +## Approval precedence + +When approval records overlap: + +1. explicit revocation wins over earlier approval; +2. a later narrower approval constrains an earlier broader one when it says it supersedes it; +3. explicit exclusions win over general deliverable language; +4. repository/platform-specific scope wins over generic scope; +5. the lower work level wins when ambiguity remains. + +If precedence cannot be resolved deterministically, stop and request explicit owner clarification before target-side work. + +## Prerequisite and bug-fix boundary + +An approved feature may expose an unrelated bug, missing prerequisite, migration, refactor opportunity, or infrastructure weakness. + +The worker may fix it under the existing approval only when the change is both: + +- necessary to deliver the approved user-visible behavior safely; and +- the smallest coherent change that does not add unrelated user-visible capability. + +Otherwise it requires separate approval. + +In particular, these are not automatic scope: +- broad cleanup/refactoring; +- framework migrations; +- “while here” performance work; +- unrelated accessibility fixes; +- unrelated security hardening; +- new telemetry/analytics; +- new data migrations for future features; +- generalized provider abstractions primarily justified by unapproved future work. + +If a severe unrelated security/data-loss issue is discovered, report it immediately and follow the repository's normal emergency process; do not use the clean-room feature approval as implied authorization. + +## Design-to-implementation handoff + +An `APPROVED_FOR_DESIGN` result may recommend implementation, tests, or a changed architecture. That recommendation is not an approval upgrade. + +The worker must stop after the approved design deliverable and obtain a new approval level before target fixtures/tests or production changes. From 624c5a8ba5154a43afe738649de23d839d4a1604 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 11:07:20 -0400 Subject: [PATCH 24/28] docs: bind approvals to spec revisions and owner authority --- CLEAN_ROOM_APPROVALS.md | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/CLEAN_ROOM_APPROVALS.md b/CLEAN_ROOM_APPROVALS.md index cd3219f3ef..233c10acda 100644 --- a/CLEAN_ROOM_APPROVALS.md +++ b/CLEAN_ROOM_APPROVALS.md @@ -107,6 +107,7 @@ Each approval record must state: - approval level; - target repository/platform; - bounded deliverable; +- approval basis: relevant CR IDs plus the sanitized spec blob/revision, or equivalent explicit scope text; - explicit exclusions or constraints; - status: active, completed, revoked, or superseded. @@ -150,6 +151,7 @@ Feature/CR IDs: ... Level: APPROVED_FOR_DESIGN | APPROVED_FOR_TESTS | APPROVED_FOR_IMPLEMENTATION | APPROVED_FOR_INTEGRATION Target: ... Deliverable: ... +Approval basis: CR IDs + spec blob/revision, or explicit bounded scope text Exclusions: ... Status: active Evidence of approval: concise paraphrase of the explicit user/project-owner instruction @@ -288,3 +290,45 @@ If a severe unrelated security/data-loss issue is discovered, report it immediat An `APPROVED_FOR_DESIGN` result may recommend implementation, tests, or a changed architecture. That recommendation is not an approval upgrade. The worker must stop after the approved design deliverable and obtain a new approval level before target fixtures/tests or production changes. + + +## Spec-change invalidation rule + +Approval applies to the behavior/scope that existed when it was granted. + +If a later research/spec edit materially expands an approved CR entry or changes its behavior, data model, privacy implications, platform reach, migration requirements, or acceptance surface, the prior approval does not automatically cover the new material. + +Use this rule: + +- editorial clarification with no scope change: approval remains valid; +- stricter test wording for the same approved behavior: approval may remain valid at the same work level; +- material behavior/scope expansion: new approval required; +- new CR ID split out of an approved feature: not approved unless the approval explicitly covered the broader named feature and the new ID is only a non-expanding subdivision; +- merged/broadened CR IDs: require reapproval when scope increases. + +When in doubt, treat the changed portion as unapproved. + +## Approval evidence sources + +Explicit approval may be recorded from: +- the user's direct instruction in the current ChatGPT/task context; +- an explicit GitHub comment/review from the project owner that clearly grants the feature/work level; +- another authenticated project-owner channel only when its content is directly available to the worker and unambiguous. + +A recommendation, review approval, emoji/reaction, label, assignment, milestone, branch name, mergeability state, or CI status is not per-feature clean-room approval by itself. + +## Delegation rule + +A project owner may explicitly delegate approval authority to another named person/role for this program. + +Absent explicit delegation, another worker/agent/contributor cannot approve features on the owner's behalf. + +Delegation must itself be recorded with: +- delegator; +- delegate; +- allowed approval levels; +- allowed repositories/platforms; +- allowed feature scope; +- expiration/revocation rule if any. + +There is currently no delegated approval authority recorded. From f216482025c29b0919691be0f5dbf7304fafd8d5 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 11:08:55 -0400 Subject: [PATCH 25/28] docs: add research-only review checklist --- CLEAN_ROOM_REVIEW.md | 278 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 CLEAN_ROOM_REVIEW.md diff --git a/CLEAN_ROOM_REVIEW.md b/CLEAN_ROOM_REVIEW.md new file mode 100644 index 0000000000..6066bbcd69 --- /dev/null +++ b/CLEAN_ROOM_REVIEW.md @@ -0,0 +1,278 @@ +# Clean-room research PR review checklist + +Status: research-review aid only +Revision: 2026-10-03 + +This checklist is for reviewing PR #260 as a research/specification artifact. + +It is not an implementation plan, approval record, or completion signal. + +## 1. GitHub state + +Verify: + +- PR #260 is open; +- PR #260 is still GitHub Draft; +- title visibly identifies it as Draft/research/per-feature approval gated; +- no auto-merge is enabled; +- no implementation work is being represented as part of this PR; +- no reviewer/worker has marked it ready merely because research documents are coherent. + +If Draft state changed without explicit project-owner authorization referring to PR #260, restore Draft state before further research refinement. + +## 2. Approval gate + +Read `CLEAN_ROOM_APPROVALS.md` before interpreting any CR document. + +Verify: + +- active approvals are exactly what explicit owner instructions support; +- workers have not self-created/broadened approval; +- approval levels match the allowed deliverable; +- approval basis still matches the current relevant spec revision/scope; +- completed/revoked/superseded records cannot be reused as active authority; +- no implicit delegation exists. + +When Active approvals is None, no CR-derived target tests, fixtures, product changes, implementation PRs, or integration are authorized. + +## 3. Separation of authority and quality language + +Check that: + +- MUST/SHOULD/MAY only express quality inside approved scope; +- failed tests do not imply permission to fix; +- benchmarks do not imply optimization authority; +- a feature being easy/high-value does not imply approval; +- an opportunity being detailed does not imply priority; +- optional opportunity entries remain DISCOVERY_ONLY. + +Search for newly added wording that could accidentally read like: +- “implement next”; +- “worker should now build”; +- “finish these phases”; +- “release blocker” without approval context; +- “strong candidates” as implied queue; +- “all remaining work”. + +Repair ambiguous authority language before expanding the research. + +## 4. Per-feature boundary + +For any active approval, verify: + +- exact CR IDs or uniquely mapped named feature; +- approval level; +- target repository/platform; +- bounded deliverable; +- approval basis/spec revision; +- exclusions; +- status. + +Check that adjacent work is listed as unapproved rather than bundled. + +Check the minimal-shared-primitive rule: +- required for approved behavior; +- minimum coherent abstraction; +- no unrelated user-visible capability; +- no speculative preimplementation; +- no broad future-facing refactor hidden inside the approved change. + +## 5. Observer / implementer firewall + +Implementation-side files must contain no named-source provenance. + +Verify: +- no motivating product/vendor names; +- no external source URLs; +- no external GitHub links; +- no copied screenshots/assets; +- no source symbols/file paths from competitors; +- no implementation descriptions from external projects; +- no observer evidence IDs that reveal named provenance. + +The observer dossier/evidence ledger must remain outside the implementation repository. + +A clean implementation worker must not receive those observer artifacts. + +## 6. Evidence hygiene + +Observer-side review should distinguish: + +- documented; +- reported; +- observed; +- inconclusive. + +Do not promote release-note or issue claims into black-box observations. + +If prohibited material contaminated an observation: +- quarantine it; +- reacquire from allowed behavior/user-facing evidence; +- sanitize from the new clean observation only. + +## 7. CR namespace integrity + +For the three CR specification files: + +- every CR definition heading is unique; +- references may repeat IDs, but definitions must not; +- intentional numeric gaps are acceptable; +- counts in PR prose must describe actual entries accurately; +- adding/splitting/merging CR IDs must not silently change approval scope. + +The opportunity registry currently uses topical numeric bands, so the largest CR-OPP number is not the number of entries. + +## 8. Target overlap + +Before calling an opportunity “new,” inspect authorized target-owned architecture. + +Classify it as: + +1. already satisfied; +2. qualification/test gap; +3. UX exposure of existing primitive; +4. bounded extension of existing primitive; +5. genuinely new primitive. + +Do not create a second implementation of an existing target primitive to mirror external products. + +Keep overlap notes target-side and source-clean. + +## 9. Opportunity backlog quality + +Each CR-OPP should: + +- describe user value; +- remain implementation-neutral; +- state important privacy/durability constraints; +- avoid distinctive copied UI wording; +- avoid bundling several unrelated features into one approval unit; +- be separable enough for per-feature approval; +- identify when it is an extension of existing target architecture. + +If two opportunities cannot realistically be approved independently, consider merging or explicitly declaring their dependency. + +## 10. Correctness-spec quality + +Acceptance requirements should be: + +- externally observable; +- deterministic where practical; +- independent of competitor implementation; +- testable with project-owned fixtures; +- explicit about optional/platform-specific behavior; +- careful about Unicode and semantic-vs-visual boundaries; +- explicit about cancellation/stale async state; +- explicit about destructive/sync conflict behavior. + +Avoid turning one product's historical bug wording into a permanent target requirement unless the desired behavior independently makes sense for Manabi. + +## 11. Benchmark quality + +Benchmark targets should: + +- measure the product boundary; +- state environment/fixture; +- separate cold/warm; +- report median/p95/max where appropriate; +- avoid pretending one machine threshold is universal; +- distinguish provider/network latency from local application latency; +- never create approval to optimize merely because a threshold is missed. + +## 12. Data, privacy, and migration review + +For any opportunity/spec change involving data: + +- identify durable vs derived state; +- define deletion semantics; +- define account/profile scope; +- define exportability where relevant; +- identify network processing; +- define migration/backward compatibility implications; +- avoid making a derived cache authoritative. + +Any material new privacy/network/migration implication invalidates prior approval unless already included in its bounded scope. + +## 13. Platform review + +Do not treat: +- browser emulation as physical-device qualification; +- web approval as Android approval; +- Android approval as iOS approval; +- desktop input assumptions as touch/controller behavior. + +Platform expansion requires explicit scope. + +## 14. Research-PR shape + +PR #260 should remain research/specification only. + +If product code, target test fixtures, implementation workflows, generated binary assets, or feature-specific runtime changes appear in this PR, treat that as a scope violation unless the project owner explicitly re-scoped PR #260 itself. + +Prefer separate approved implementation PRs for target changes. + +## 15. Handoff manifest + +After any authorized research-document change: + +1. recompute/fetch changed Git blob SHAs; +2. update `CLEAN_ROOM_HANDOFF.md`; +3. verify the approval-ledger SHA first; +4. verify sanitized research hashes; +5. rerun contamination checks; +6. update the pinned handoff PR comment. + +A stale manifest must not be used for implementation handoff. + +## 16. PR description / handoff comment + +Verify they state: + +- Draft; +- Active approvals; +- no implied implementation authority; +- per-feature approval requirement; +- exact current manifest/approved input identity; +- opportunity count accurately; +- no competitor provenance; +- no product code changes; +- adjacent work stop rule. + +Old handoff comments should be superseded rather than leaving conflicting current instructions. + +## 17. No-finish rule + +Research refinement has no autonomous “complete the whole backlog” step. + +A future worker may finish only the bounded research task explicitly requested in its turn. + +It must not: + +- decide that PR #260 is mature enough to leave Draft; +- implement the backlog to make the PR “complete”; +- mark every CR as handled; +- merge because the checklist passes; +- convert research recommendations into a roadmap without explicit owner direction. + +A passing review means only that the research artifact is internally consistent at that revision. + +## 18. Review record template + +For a research review, record: + +- PR head SHA: +- GitHub Draft status: +- approval-ledger SHA: +- active approvals: +- handoff-manifest SHA: +- CR definition duplicate check: +- contamination scan: +- target-overlap changes: +- authority-language findings: +- stale-hash findings: +- research-only file-shape check: +- corrections made: +- unresolved questions: +- result: CONSISTENT / NEEDS_REFINEMENT + +Do not use PASS/READY/MERGE language for the overall PR. From 54819ded4cf7442092e90b14f90be7ec596d17d4 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 11:09:57 -0400 Subject: [PATCH 26/28] docs: refresh sealed handoff after governance review --- CLEAN_ROOM_HANDOFF.md | 71 ++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md index 5fd7a2335b..deeaa7fbdc 100644 --- a/CLEAN_ROOM_HANDOFF.md +++ b/CLEAN_ROOM_HANDOFF.md @@ -1,9 +1,9 @@ # Clean-room implementation handoff manifest Status: SEALED RESEARCH HANDOFF — NO ACTIVE IMPLEMENTATION APPROVALS -Revision: 2026-10-03 approval-gated refinement +Revision: 2026-10-03 approval-gated refinement 2 -PR #260 is a research/specification Draft. This manifest identifies the clean documents a future worker may read. **It does not authorize that worker to implement, test, prototype, integrate, mark ready, merge, or finish any feature.** +PR #260 is a research/specification Draft. This manifest identifies clean documents a future worker may read. **It does not authorize that worker to design, implement, test, prototype, integrate, mark ready, merge, or finish any feature.** ## Approval gate comes first @@ -11,15 +11,15 @@ Before doing any CR-derived target work, read: | Path | Git blob SHA | Purpose | | --- | --- | --- | -| `CLEAN_ROOM_APPROVALS.md` | `fd6b1ea7c76097bf81b5a456fc8eaa0951681cae` | explicit per-feature/work-level authorization ledger | +| `CLEAN_ROOM_APPROVALS.md` | `233c10acda33879c36b829d23b8492ac7de1f413` | explicit per-feature/work-level authorization ledger | -At this revision, `CLEAN_ROOM_APPROVALS.md` states **Active approvals: None**. +At this revision, `CLEAN_ROOM_APPROVALS.md` states **Active approvals: None** and records **no delegated approval authority**. -Therefore no target fixtures/tests, production changes, implementation PRs, integration, or PR #260 finalization are authorized by this clean-room program. +Therefore no target design, fixtures/tests, production changes, implementation PRs, integration, or PR #260 finalization are authorized by this clean-room program. ## Sanitized research inputs -Subject to the approval gate above, the worker may receive these documents plus ordinary authorized target-repository material: +Subject to the approval gate above, a future worker may receive these documents plus ordinary authorized target-repository material: | Path | Git blob SHA | Purpose | | --- | --- | --- | @@ -28,6 +28,14 @@ Subject to the approval gate above, the worker may receive these documents plus | `specs/clean-room-reader-adversarial-qualification.md` | `b4249481022cb010cfcee89d5263c3766201208b` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | | `specs/clean-room-reader-feature-opportunities.md` | `0563e33fe230eb627210c839ed1cc80b8a17c00e` | DISCOVERY_ONLY optional feature registry | +Research reviewers may also use: + +| Path | Git blob SHA | Purpose | +| --- | --- | --- | +| `CLEAN_ROOM_REVIEW.md` | `6066bbcd69a9512b57a58d232156140fc0deef3e` | research-only consistency/review checklist | + +The review checklist is not an implementation authority or approval source. + ## Default worker authority With no active approval, a worker may only do research/specification work that the user explicitly requests on this draft branch, such as: @@ -36,9 +44,22 @@ With no active approval, a worker may only do research/specification work that t - deduplicate requirements; - identify target-side overlap; - refine acceptance criteria; +- audit approval/manifest consistency; - report which feature/CR IDs would need approval. -The worker must not create target fixtures/tests or modify product/runtime code from these documents. +The worker must not create target design deliverables, fixtures/tests, or modify product/runtime code from these documents. + +## Approval levels + +Only `CLEAN_ROOM_APPROVALS.md` defines authority. Current levels are: + +- `DISCOVERY_ONLY` +- `APPROVED_FOR_DESIGN` +- `APPROVED_FOR_TESTS` +- `APPROVED_FOR_IMPLEMENTATION` +- `APPROVED_FOR_INTEGRATION` + +A higher level is not inferred from a lower one. Design does not authorize tests; tests do not authorize production fixes; implementation does not authorize integration. ## Per-feature approval rule @@ -47,9 +68,11 @@ A target-side action requires an active approval that names: - the feature/CR IDs; - approval level; - target repository/platform; -- bounded deliverable. +- bounded deliverable; +- approval basis/spec revision or equivalent explicit scope; +- exclusions/constraints. -Approval is non-transitive. +Approval is non-transitive and cannot be self-created by a worker. In particular: @@ -59,7 +82,8 @@ In particular: - approval of tests is not approval of fixes; - approval of one feature is not approval of an adjacent feature; - approval on one platform is not approval on another; -- a generic instruction such as “continue,” “go deeper,” “review,” or “finish” is not per-feature implementation approval. +- a generic instruction such as “continue,” “go deeper,” “review,” “refine,” “finish,” or “work through the backlog” is not per-feature implementation approval; +- a later material spec expansion is not automatically covered by an older approval. ## PR #260 state gate @@ -94,21 +118,24 @@ Before any target-side work: 1. verify the approval-ledger blob SHA and read it; 2. verify the sanitized research blob SHAs above; 3. confirm an active approval exactly covers the requested CR IDs and work level; -4. if no matching approval exists, stop target-side execution and report the required approval; -5. do not perform external competitor research; -6. inspect current target-owned architecture for overlap only within the user's requested review scope; -7. preserve existing working primitives rather than rebuilding them to resemble another product. +4. verify that the approval basis still matches the current relevant spec revision/scope; +5. if no matching approval exists, stop target-side execution and report the required approval; +6. do not perform external competitor research; +7. inspect current target-owned architecture for overlap only within the user's requested review/approved scope; +8. preserve existing working primitives rather than rebuilding them to resemble another product. ## Approved-work execution Only after a matching approval exists: -1. restate the approval ID, CR IDs, work level, target, deliverable and exclusions; -2. if approved for tests, create only independently authored fixtures/tests and stop at reported failures; -3. if approved for implementation, make only the bounded target-owned changes needed for the approved IDs; -4. if adjacent unapproved work is discovered, report it rather than “finishing it while here”; -5. run only the qualification/benchmark/device work included in approval; -6. mark the approval record completed when the bounded work is done. +1. restate the approval ID, CR IDs, work level, target, approval basis, deliverable and exclusions; +2. if approved for design, stop after the bounded design deliverable; +3. if approved for tests, create only independently authored fixtures/tests and stop at reported failures; +4. if approved for implementation, make only the bounded target-owned changes needed for the approved IDs; +5. if adjacent unapproved work is discovered, report it rather than “finishing it while here”; +6. obey the minimal-shared-primitive rule in the approval ledger; +7. run only qualification/benchmark/device work included in approval; +8. mark the approval record completed when the bounded work is done. ## Worker completion attestation @@ -118,6 +145,8 @@ An implementation PR for an approved feature should include a statement equivale ## Manifest updates -Any change to the approval ledger or one of the four sanitized research documents changes its blob SHA and requires a new manifest revision before handoff. +Any change to the approval ledger, research-review checklist, or one of the four sanitized research documents changes its blob SHA and requires a new manifest revision before handoff. + +A stale manifest is invalid for clean implementation handoff. This manifest itself contains no external source provenance and may be supplied to a future worker. From 06f5c2181ec1a6dfcf86a9245a34ec953523834c Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 11:13:20 -0400 Subject: [PATCH 27/28] spec: map shared primitives without granting bundle scope --- ...clean-room-reader-feature-opportunities.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) diff --git a/specs/clean-room-reader-feature-opportunities.md b/specs/clean-room-reader-feature-opportunities.md index 0563e33fe2..61383888e9 100644 --- a/specs/clean-room-reader-feature-opportunities.md +++ b/specs/clean-room-reader-feature-opportunities.md @@ -1683,3 +1683,221 @@ This backlog does not authorize: - treating an observer-source update as a request to implement what was observed. The branch remains research/specification material until per-feature approval says otherwise. + + +## 24. Shared-primitives dependency map + +This section is informative only. It identifies likely target-owned primitives that multiple opportunities may reuse. + +**It is not a bundle definition and does not create approval for any primitive or neighboring feature.** The minimal-shared-primitive rule in `../CLEAN_ROOM_APPROVALS.md` remains controlling. + +### Knowledge-state primitive + +Potential consumers: +- CR-OPP-001 Chapter preflight +- CR-OPP-002 Whole-book vocabulary forecast +- CR-OPP-003 Adaptive furigana +- CR-OPP-004 Learner-state text styling +- CR-OPP-005 Inline micro-glosses +- CR-OPP-012 Coverage projection +- CR-OPP-061 Vocabulary browser +- CR-OPP-062 Encounter map +- CR-OPP-135 Difficulty preview +- CR-OPP-136 External knowledge-state import +- CR-OPP-141 Familiarity from reading behavior +- CR-OPP-142 Knowledge confidence +- CR-OPP-149 Difficulty-aware furigana baseline +- CR-OPP-155 Personalized material difficulty +- CR-OPP-158 New-vocabulary delta +- CR-OPP-164 Reading readiness threshold +- CR-OPP-178 Vocabulary occurrence timeline + +Approval of any one consumer authorizes only the minimum knowledge-state behavior required for that consumer. + +### Semantic source-text primitive + +Potential consumers: +- CR-OPP-006 Proper-name assistance +- CR-OPP-007 Context-ranked dictionary sense +- CR-OPP-008 Grammar overlay +- CR-OPP-053 Highlight-to-card +- CR-OPP-063 Source-linked lookup history +- CR-OPP-065 Update existing card +- CR-OPP-153 Context quality chooser +- CR-OPP-157 Order-of-appearance vocabulary list +- CR-OPP-161 Source-first i+1 examples +- CR-OPP-165 Scoped reading assistant +- CR-OPP-171 Post-reading comprehension check +- CR-OPP-177 Character/entity index +- CR-OPP-178 Vocabulary occurrence timeline +- CR-OPP-183 Semantic library search + +This should reuse existing durable text/location infrastructure where possible rather than creating a second competing text model. + +### Durable-location / navigation primitive + +Potential consumers: +- CR-OPP-020 Book map +- CR-OPP-021 Page/section browser +- CR-OPP-022 Rich skim sheet +- CR-OPP-026 Navigation history +- CR-OPP-053 Highlight-to-card +- CR-OPP-062 Encounter map +- CR-OPP-063 Source-linked lookup history +- CR-OPP-168 Highlight resurfacing +- CR-OPP-176 Source-linked daily review +- CR-OPP-177 Character/entity index +- CR-OPP-179 User-facing reference anchors +- CR-OPP-180 Deep links to reading locations +- CR-OPP-181 Progress-linked reading journal + +Existing Reader locator/navigation architecture should be evaluated first. + +### Context-bundle / mining primitive + +Potential consumers: +- CR-OPP-053 Highlight-to-card +- CR-OPP-064 Mine from history +- CR-OPP-065 Update existing card +- CR-OPP-067 Idempotent media reuse +- CR-OPP-077 Voice-activity sentence capture +- CR-OPP-078 Multi-line context capture +- CR-OPP-079 Media mining history +- CR-OPP-080 Context image capture +- CR-OPP-110 Context bundle +- CR-OPP-111 One-action mining +- CR-OPP-112 Mining presets +- CR-OPP-113 Capture crop +- CR-OPP-114 Media privacy +- CR-OPP-145 Post-session mining queue +- CR-OPP-146 Batch i+1 review +- CR-OPP-153 Context quality chooser + +Approval of one mining workflow does not authorize a universal mining subsystem rewrite unless separately approved. + +### OCR document primitive + +Potential consumers: +- CR-OPP-090 On-demand page OCR +- CR-OPP-091 Region OCR +- CR-OPP-092 Pointer-follow lookup +- CR-OPP-093 OCR corrections +- CR-OPP-094 OCR versions +- CR-OPP-095 OCR improvement merge +- CR-OPP-137 Camera/photo OCR import +- CR-OPP-174 Multi-page camera capture +- CR-OPP-175 Auto-detect OCR after page change +- CR-OPP-185 Physical-book catalog entry + +A read-only OCR approval does not authorize editable/versioned OCR. + +### Timed-media / transcript primitive + +Potential consumers: +- CR-OPP-070 Sentence playback modes +- CR-OPP-071 Primed listening +- CR-OPP-072 Condensed playback +- CR-OPP-073 Track targeting +- CR-OPP-074 Transcript list +- CR-OPP-075 Transcript discovery +- CR-OPP-076 Subtitle timing alignment +- CR-OPP-077 Voice-activity sentence capture +- CR-OPP-078 Multi-line context capture +- CR-OPP-079 Media mining history +- CR-OPP-147 Shadowing mode +- CR-OPP-148 Dual-text reveal modes + +These should compose with existing target media/transcript architecture when present. + +### Library metadata / lifecycle primitive + +Potential consumers: +- CR-OPP-010 Finish-date planner +- CR-OPP-011 Reading queue +- CR-OPP-013 Habit goals +- CR-OPP-014 Time remaining +- CR-OPP-040 Continue dashboard +- CR-OPP-041 Rich book details +- CR-OPP-042 Include/exclude filters +- CR-OPP-043 Saved library views +- CR-OPP-047 Favourites and collections +- CR-OPP-048 External tracking +- CR-OPP-049 Local/remote placeholders +- CR-OPP-144 Daily reading recommendation +- CR-OPP-159 Next-material recommender +- CR-OPP-181 Progress-linked reading journal +- CR-OPP-184 Paused / did-not-finish state +- CR-OPP-185 Physical-book catalog entry +- CR-OPP-186 Reading report + +Adding one lifecycle field must not silently require redesigning the entire library model. + +### Ingestion / source-link primitive + +Potential consumers: +- CR-OPP-044 Watched folders +- CR-OPP-045 Relink missing books +- CR-OPP-049 Local/remote placeholders +- CR-OPP-100 Web article/read-later import +- CR-OPP-101 Web novel import +- CR-OPP-102 External catalog connector +- CR-OPP-103 Catalog feed browsing +- CR-OPP-104 Universal import inbox +- CR-OPP-137 Camera/photo OCR import +- CR-OPP-138 System share/import inbox +- CR-OPP-173 Feed subscriptions +- CR-OPP-174 Multi-page camera capture +- CR-OPP-185 Physical-book catalog entry + +Each source type retains explicit provenance and capability; generic ingestion must not collapse logical identity into provider path. + +### Assistance / model boundary primitive + +Potential consumers: +- CR-OPP-006 Proper-name assistance +- CR-OPP-007 Context-ranked dictionary sense +- CR-OPP-008 Grammar overlay +- CR-OPP-165 Scoped reading assistant +- CR-OPP-166 Permissioned assistant actions +- CR-OPP-167 User-defined reading actions +- CR-OPP-171 Post-reading comprehension check +- CR-OPP-183 Semantic library search + +Read-only retrieval, generative explanation, and write-capable actions are distinct approval surfaces. + +### Presentation / scaffolding primitive + +Potential consumers: +- CR-OPP-003 Adaptive furigana +- CR-OPP-004 Learner-state text styling +- CR-OPP-005 Inline micro-glosses +- CR-OPP-008 Grammar overlay +- CR-OPP-030 Per-book reader presets +- CR-OPP-031 Named global presets +- CR-OPP-032 Sentence/block reading mode +- CR-OPP-033 Reading ruler / line guide +- CR-OPP-121 Theme typography bundle +- CR-OPP-122 Per-language font profiles +- CR-OPP-149 Difficulty-aware furigana baseline +- CR-OPP-169 Scaffolding intensity control +- CR-OPP-170 Translation reveal density + +A high-level scaffolding control should compose existing presentation features rather than create duplicate settings authorities. + +## 25. Approval dependency rule + +When an approved opportunity has a dependency on another CR-OPP: + +- the dependency does not become approved automatically; +- if the approved feature can be delivered with a narrow internal primitive that exposes no dependent user-facing feature, the minimal-shared-primitive rule may permit that internal work; +- if delivery requires the dependent opportunity's user-visible behavior, separate approval is required; +- if the dependency changes privacy, durable data, migration, platform reach, or external integrations, treat it as material and require explicit approval unless already included in the original bounded scope. + +Before implementation, record dependencies in the per-feature scope packet as: + +- `required internal primitive`; +- `existing target primitive`; +- `approved dependent feature`; +- or `unapproved dependency / blocker`. + +Do not convert an unapproved dependency into a broad prerequisite project. From 3d897ebab2c03c3c8af4739afcf2d5873076b6b8 Mon Sep 17 00:00:00 2001 From: Alex Ehlke Date: Sat, 3 Oct 2026 11:13:51 -0400 Subject: [PATCH 28/28] docs: refresh manifest after dependency-map review --- CLEAN_ROOM_HANDOFF.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLEAN_ROOM_HANDOFF.md b/CLEAN_ROOM_HANDOFF.md index deeaa7fbdc..e59220344d 100644 --- a/CLEAN_ROOM_HANDOFF.md +++ b/CLEAN_ROOM_HANDOFF.md @@ -1,7 +1,7 @@ # Clean-room implementation handoff manifest Status: SEALED RESEARCH HANDOFF — NO ACTIVE IMPLEMENTATION APPROVALS -Revision: 2026-10-03 approval-gated refinement 2 +Revision: 2026-10-03 approval-gated refinement 3 PR #260 is a research/specification Draft. This manifest identifies clean documents a future worker may read. **It does not authorize that worker to design, implement, test, prototype, integrate, mark ready, merge, or finish any feature.** @@ -26,7 +26,7 @@ Subject to the approval gate above, a future worker may receive these documents | `CLEAN_ROOM_COMPETITIVE_RESEARCH.md` | `6cb64cd45478906d3648860945b33c35f75e450d` | process boundary, evidence rules, taint handling, authorization separation | | `specs/clean-room-reader-competitive-spec.md` | `fd1269b0426ce7b526a99f985c15b4192634fcdd` | behavior contracts, fixtures, acceptance tests, benchmarks | | `specs/clean-room-reader-adversarial-qualification.md` | `b4249481022cb010cfcee89d5263c3766201208b` | adversarial, sync, cache, fuzz, soak, cross-engine qualification | -| `specs/clean-room-reader-feature-opportunities.md` | `0563e33fe230eb627210c839ed1cc80b8a17c00e` | DISCOVERY_ONLY optional feature registry | +| `specs/clean-room-reader-feature-opportunities.md` | `61383888e92c7d56959ed70d71d8a54230c60be8` | DISCOVERY_ONLY optional feature registry | Research reviewers may also use: