Skip to content

Commit 4e5f717

Browse files
committed
docs: recover Hwping-native spec and research memo
project: hwping agent: codex role: worker artifacts: LOG-20260409-001, RSH-20260409-001
1 parent e3fadf5 commit 4e5f717

4 files changed

Lines changed: 359 additions & 126 deletions

File tree

SPEC.md

Lines changed: 144 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,173 @@
11
# Hwping Spec
22

3-
This file is the canonical statement of what Hwping is supposed to be.
3+
This file is the canonical durable statement of what Hwping is supposed to be.
44

5-
## Identity
5+
It is not the implementation-status report or milestone tracker. Current state lives in `STATUS.md`; accepted future sequencing lives in `PLANS.md`.
6+
7+
## Project Identity
68

79
- Project: Hwping
810
- Canonical repo: `https://github.com/LPFchan/Hwping`
911
- Project id: `hwping`
1012
- Operator: `LPFchan`
1113
- Last updated: `2026-04-09`
12-
- Related decisions: `DEC-20260409-001`
14+
- Key decisions: `DEC-20260409-001`, `DEC-20260409-002`, `DEC-20260409-003`, `DEC-20260409-004`, `DEC-20260409-005`
15+
16+
## What Hwping Is
17+
18+
Hwping is a native macOS-focused HWP reader product and downstream fork of upstream `rhwp`.
19+
20+
It is meant to let macOS users open `.hwp` and `.hwpx` documents from familiar Apple-platform surfaces, read them comfortably, preview them in Finder, automate simple read-only workflows, and export or print them without turning the shared document engine into app code.
21+
22+
## Product Principles
23+
24+
### v1 Is A Reader
25+
26+
- Prioritize opening, reading, navigation, search, printing, PDF export, Quick Look, and automation.
27+
- Favor Preview-like document viewing and TextEdit-like macOS document-app conventions.
28+
- Keep full editing, annotations, collaboration, cloud sync, and complex authoring workflows out of the v1 promise.
29+
30+
### Keep Engine And Product Separate
31+
32+
- Rust owns the upstream-aligned HWP/HWPX parser, model, layout, renderer, serializer, and CLI behavior.
33+
- Downstream facade and FFI layers own the app-facing capability boundary.
34+
- Swift and Apple-platform targets own document lifecycle, windows, menus, Finder integration, Quick Look, App Intents, Shortcuts, and app UI.
35+
- AppKit, SwiftUI, PDFKit, Quick Look, Finder, App Intents, and Shortcuts behavior must not leak into `crates/rhwp/`.
36+
37+
### Share One Capability Boundary
38+
39+
The main app, Quick Look Preview extension, Quick Look Thumbnail extension, Shortcuts/App Intents, smoke targets, and future automation should reuse one document-loading and rendering capability boundary instead of each surface inventing its own engine path.
40+
41+
## Intended System Shape
42+
43+
```text
44+
user document (.hwp / .hwpx)
45+
-> Hwping.app (NSDocument-based)
46+
-> Quick Look Preview extension
47+
-> Quick Look Thumbnail extension
48+
-> App Intents / Shortcuts
49+
50+
each surface
51+
-> Apple-platform call layer
52+
-> hwping-ffi
53+
-> hwping-core
54+
-> rhwp
55+
-> parser / model / layout / renderer / serializer
56+
```
57+
58+
## Core Surfaces
59+
60+
### `crates/rhwp/`
61+
62+
Upstream-aligned shared engine area.
63+
64+
Owns:
1365

14-
## Product Thesis
66+
- HWP and HWPX parsing
67+
- document model
68+
- layout and pagination
69+
- foundational SVG, PDF, bitmap, or preview-ready rendering paths
70+
- serialization
71+
- platform-independent CLI and debugging paths
1572

16-
Hwping is a macOS-focused downstream fork and product workspace built on top of upstream `rhwp`. It exists to ship a native HWP reader stack for Apple platforms while keeping the shared HWP and HWPX engine as upstream-aligned and syncable as possible.
73+
Default rule: treat changes here as upstreamable unless there is a concrete recorded reason for a local compatibility patch.
1774

18-
## Primary User And Context
75+
### `crates/hwping-core/`
1976

20-
- Primary operator: Hwping maintainer and collaborators
21-
- Primary environment: a Cargo workspace with downstream Rust, FFI, and Apple-platform targets
22-
- Primary problem being solved: deliver reliable HWP and HWPX reading workflows on macOS without letting the fork drift into an unsyncable multi-product repository
23-
- Why this matters: reading correctness, product focus, and upstream sync cost all depend on keeping shared engine work and Apple-platform product work sharply separated
77+
App-facing Rust facade.
2478

25-
## Primary Workspace Object
79+
Expected operation families:
2680

27-
The primary user-facing object is an HWP or HWPX document rendered through an upstream-aligned engine and delivered through native macOS surfaces.
81+
- open a document from bytes or path
82+
- report document info, page count, page size, and first-page metadata
83+
- render preview-ready PDF or page images
84+
- render first-page thumbnail data
85+
- extract text and search for a query
86+
- export PDF
87+
- normalize product-facing errors
2888

29-
## Canonical Interaction Model
89+
### `crates/hwping-ffi/`
3090

31-
1. A user opens an HWP or HWPX document from the app, Finder, or a Quick Look surface.
32-
2. Hwping parses and renders the document through `crates/rhwp/`.
33-
3. Downstream facade and FFI layers expose metadata, page data, and rendered output to Apple-platform callers.
34-
4. The app or extension presents reading, preview, search, export, and system integration workflows.
35-
5. Maintainers preserve shared-core correctness and review upstream changes through `upstream-intake/`.
91+
Swift-facing ABI boundary.
3692

37-
## Core Capabilities
93+
Owns conversion of strings, paths, bytes, handles, errors, metadata structs, preview bytes, ownership, and lifetime rules.
3894

39-
- Capability: upstream-aligned HWP and HWPX parsing and rendering
40-
- Why it exists: Hwping needs accurate document understanding and output while staying cheap to sync with upstream `rhwp`
41-
- What must remain true: shared-core fixes should stay upstreamable or at least upstream-shaped unless a concrete Hwping-only reason exists
42-
- Capability: downstream macOS product boundary
43-
- Why it exists: Hwping needs app, FFI, Quick Look, and Apple integration without contaminating the engine core
44-
- What must remain true: Apple-platform behavior stays outside `crates/rhwp/`
45-
- Capability: disciplined repo operations and upstream intake
46-
- Why it exists: a downstream fork needs explicit truth, plans, decisions, worklogs, and recurring upstream review
47-
- What must remain true: root truth docs, provenance records, and `upstream-intake/` remain canonical
95+
### `apps/` And `extensions/`
4896

49-
## Invariants
97+
Downstream Apple-platform product targets.
5098

51-
- `crates/rhwp/` is the upstream-aligned engine area.
52-
- Apple-platform code lives in downstream layers such as `crates/hwping-core/`, `crates/hwping-ffi/`, `apps/`, and `extensions/`.
53-
- Root `SPEC.md`, `STATUS.md`, and `PLANS.md` hold canonical project truth, current state, and accepted future direction.
54-
- `upstream-intake/` is the canonical recurring upstream-review module.
55-
- `mydocs/` stores shared technical, troubleshooting, and manual material that supports but does not replace the root truth docs.
56-
- Hwping-specific accepted direction and architecture decisions live in root docs and `DEC-*` records, not in a separate `mydocs/hwping/` subtree.
99+
Intended targets:
100+
101+
- main `NSDocument`-based Hwping app
102+
- Quick Look Preview extension
103+
- Quick Look Thumbnail extension
104+
- smoke and integration targets needed to validate the app boundary
105+
106+
## Native Reader Experience
107+
108+
The target app should behave like a normal macOS document app:
109+
110+
- Finder double-click opens a document in Hwping.
111+
- Recent documents, windows, tabs, state restoration, printing, and standard app menus behave consistently with macOS expectations.
112+
- Space bar Quick Look preview works without launching the full app UI.
113+
- Finder thumbnails are fast enough not to make ordinary folder browsing feel broken.
114+
- Search, page movement, zooming, fit behavior, printing, and PDF export use one command model across menus, shortcuts, toolbar actions, intents, and automation when practical.
115+
116+
## Viewing Strategy
117+
118+
The accepted v1 direction favors a PDF-backed viewing path:
119+
120+
```text
121+
.hwp / .hwpx
122+
-> rhwp parsing and layout
123+
-> preview-ready PDF generation
124+
-> native PDF-backed viewing or preview surface
125+
```
126+
127+
This path should get Hwping to native scrolling, zooming, printing, and Preview-like behavior faster than a custom page view. It must not prevent a direct page renderer later if text selection, accessibility, overlays, search quality, or navigation demands it.
128+
129+
## Error, Cache, And Quality Expectations
130+
131+
User-visible errors should stay short and actionable, grouped around cases like open failure, corrupted document, unsupported feature, font substitution difference, render failure, permission failure, or file-access failure.
132+
133+
Likely cache targets include preview PDF, first-page thumbnail, page size, page count, document metadata, and render options. Cache invalidation should be able to account for file identity, file size, modification time, render parameters, and engine version.
134+
135+
Quality expectations:
136+
137+
- Ordinary documents should show a first useful reading surface quickly.
138+
- Quick Look and thumbnail paths should have tighter budgets than the full app.
139+
- App-shell menus, buttons, search UI, zoom, opening, and page movement should be keyboard-accessible and VoiceOver-friendly.
140+
- Document-content accessibility can improve after v1, but app-shell accessibility is part of the baseline product quality.
141+
142+
## Repository Operating Contract
143+
144+
Hwping uses the repo-template model, with Hwping-specific rules in `REPO.md`.
145+
146+
- `SPEC.md`, `STATUS.md`, and `PLANS.md` hold canonical truth, current state, and accepted future direction.
147+
- `records/decisions/` holds durable decisions.
148+
- `records/agent-worklogs/` holds useful execution history.
149+
- `research/` holds reusable exploration.
150+
- `upstream-intake/` holds recurring upstream-review artifacts.
151+
- `mydocs/tech/`, `mydocs/troubleshootings/`, and `mydocs/manual/` hold deeper shared technical, investigation, and manual material.
152+
153+
Do not recreate a dedicated `mydocs/hwping/` tree.
57154

58155
## Non-Goals
59156

60-
- web demo hosting
157+
- full editing for v1
158+
- annotations and collaboration for v1
159+
- cloud sync for v1
160+
- an iOS release alongside the first macOS app
161+
- web demo hosting in the main Hwping tree
61162
- npm package distribution for old web or editor surfaces
62163
- VS Code extension distribution
63-
- legacy browser-only infrastructure
64-
65-
## Main Surfaces
66-
67-
- Surface: `crates/rhwp/`
68-
- Purpose: upstream-aligned parser, model, renderer, serializer, and CLI engine
69-
- Notes: treat engine changes as upstreamable by default
70-
- Surface: `crates/hwping-core/`, `crates/hwping-ffi/`, `apps/`, and `extensions/`
71-
- Purpose: downstream product and Apple-platform integration surfaces
72-
- Notes: keep these boundaries clean and product-owned
73-
- Surface: `SPEC.md`, `STATUS.md`, `PLANS.md`, `INBOX.md`, `research/`, `records/`, and `upstream-intake/`
74-
- Purpose: canonical repo operating surfaces
75-
- Notes: keep truth, intake, research, decisions, logs, and upstream review distinct
76-
- Surface: `mydocs/`
77-
- Purpose: shared technical notes, troubleshooting references, and manuals
78-
- Notes: use these docs for depth, not as a substitute for root truth docs or decision records
164+
- legacy browser-only infrastructure kept only for history
79165

80166
## Success Criteria
81167

82-
- Hwping ships a native macOS reader stack without reabsorbing removed upstream product surfaces.
83-
- Shared engine work remains cheap to sync with upstream `rhwp`.
84-
- Maintainers can answer what Hwping is, what is true now, what is accepted next, what was decided, and what happened by reading the repo itself.
168+
Hwping succeeds when:
169+
170+
- a macOS user can open an HWP/HWPX document, preview it, navigate it, search it, print it, export it, and automate basic read-only tasks through native-feeling surfaces
171+
- shared engine correctness keeps improving without product code contaminating upstream-aligned code
172+
- upstream `rhwp` changes can be reviewed and adapted deliberately
173+
- maintainers can recover current truth, accepted direction, key decisions, research, execution history, and upstream-intake outcomes from the repo itself

records/agent-worklogs/LOG-20260409-001-repo-template-migration-bootstrap.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,12 @@ Implement the full `LPFchan/repo-template` operating model in the Hwping reposit
6565
- Output: confirmed that the repo now contains the root truth stack, provenance directories, and canonical upstream-review subsystem expected by the adopted operating model
6666
- Blockers: none
6767
- Next: keep routing future durable work through the root surfaces and use commit provenance trailers on artifact-bearing commits
68+
69+
## Entry 2026-04-09 17-48-43 KST
70+
71+
- Action: reconciled over-normalized spec and research surfaces against retired `mydocs/hwping/` sources, current root docs, and current lightweight repo-template guides
72+
- Files touched: `SPEC.md`, `research/README.md`, `research/RSH-20260409-001-textedit-menubar-reference.md`, this worklog
73+
- Checks run: `git diff --check`; byte-for-byte comparison of `research/README.md` against repo-template scaffold; candidate doc enumeration; history inspection around `8255216` and `833f402`
74+
- Output: restored Hwping-native architecture, product-scope, reader-experience, repo-boundary, and TextEdit-reference detail while keeping artifact provenance and canonical root-doc routing
75+
- Blockers: none
76+
- Next: commit the reconciliation as a docs/provenance update; leave Rust validation for code-bearing changes

research/README.md

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -25,56 +25,23 @@ Each memo should begin with:
2525
- `Opened: YYYY-MM-DD HH-mm-ss KST`
2626
- `Recorded by agent: <agent-id>`
2727

28-
## Default Shape
28+
## Minimum Content
2929

30-
- Metadata
31-
- Research question
32-
- Why this belongs to this repo
33-
- Findings
34-
- Promising directions
35-
- Dead ends or rejected paths
36-
- Recommended routing
30+
A research memo should usually make these things recoverable:
3731

38-
Use that section order by default unless the research genuinely needs a different structure.
32+
- what question or area was explored
33+
- the findings worth preserving
34+
- any important rejected paths, open questions, or follow-up routes
3935

40-
## Canonical Example
36+
The exact section names and order can vary by project.
4137

42-
```md
43-
# RSH-20260409-001: TextEdit Menu Bar Reference For Hwping
38+
## Suggested Shapes
4439

45-
Opened: 2026-04-09 05-29-07 KST
46-
Recorded by agent: codex-20260409-full-repo-template-migration
40+
Any of these are acceptable when they fit the repo better:
4741

48-
## Metadata
42+
- question -> findings -> next steps
43+
- topic -> evidence -> conclusion
44+
- exploration notes -> recommendations
45+
- short memo with lightweight headings
4946

50-
- Status: completed
51-
- Question: What menu-bar baseline should Hwping use for the first complete macOS reader app?
52-
- Related ids: DEC-20260409-004
53-
54-
## Research Question
55-
56-
What menu-bar baseline should Hwping use for the first complete macOS reader app?
57-
58-
## Why This Belongs To This Repo
59-
60-
Hwping is building a native macOS document app, so a reusable menu-bar baseline belongs in repo research rather than in transient chat notes.
61-
62-
## Findings
63-
64-
- TextEdit is a useful baseline for standard macOS document-app menu ordering and grouping.
65-
- Hwping v1 should preserve native document-app expectations while staying read-only.
66-
67-
## Promising Directions
68-
69-
- Use TextEdit as a baseline when evaluating first-pass Hwping menu structure.
70-
- Capture accepted menu decisions in `records/decisions/` instead of keeping them only in research.
71-
72-
## Dead Ends Or Rejected Paths
73-
74-
- Blind command-for-command copying from TextEdit without checking Hwping's read-only scope.
75-
76-
## Recommended Routing
77-
78-
- Keep this memo as reusable reference material.
79-
- Move accepted product decisions into `DEC-*` records.
80-
```
47+
Keep the memo normalized and readable, but do not force one house style across every repo.

0 commit comments

Comments
 (0)