Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ uses [Semantic Versioning](https://semver.org/).

### Added

- **New `rosetta export <dir>` command writes a DB-only dataset directory for local audit** (issue #101, the B-0022 export track). Produces `manifest.toml` plus seven flat TSVs — `changelog.tsv`, `callouts.tsv`, `properties.tsv` (joined to pages with a resolved `section_anchor`), `videos.tsv` (metadata + per-video transcript segment/word/byte counts), `commands.tsv`, and the paired `pages.tsv` (one row per section) / `pages_summary.tsv` (per-page rollup) — from the runtime SQLite database alone — dataset generation reads only the resolved DB, with no caches or re-extraction (startup may still download/refresh the DB, as every command does). The serialization contract is a reversible Postgres-COPY-style escape (`\t`/`\n`/`\r`/`\\` backstopped on every value, whole-field `\N` for SQL NULL as distinct from the empty string) with stable ordering so a rebuild on the same DB is byte-identical, and `manifest.toml` carries `db_meta` provenance, per-file row counts, and honest disclosures of what the DB cannot provide (transcript provenance #21, per-version architecture #91). A column the DB cannot produce is omitted and disclosed, never recovered from a source artifact.

- **Every Docusaurus pipe table is now retained as normalized, queryable data in schema v10** (issue #92). `page_tables` keeps raw Markdown plus page order, nearest h1–h6 heading, enclosing h1–h3 `section_id`, width, and raggedness; `page_table_rows`/`page_table_cells` preserve every header/data cell at its actual width with escaped pipes decoded. Table-derived `properties` now point to their exact source row through `source_table_row_id`, while bullet-derived and historical properties remain honestly NULL. Property output is byte-for-byte unchanged; the shared fence-aware parser also corrects the B-0022 census counting error caused by an ordered-list code fence in `zerotier.md` (the rc.98 corpus contains 855 tables / 8,287 data rows, not 852 / 8,258).

- **README.md and DESIGN.md now describe the live Docusaurus corpus as current, not a pending migration** (issue #77). README's intro and "What's Inside" table dropped the "still needs a major migration away from the retired Confluence export" framing and refreshed prose-corpus figures for the actual Docusaurus build (363 pages/~653K words, 4,402 properties, 943 callouts), and gained a "Hardware overlay" row for `hardware_catalog`/`device_aliases` (255 devices incl. legacy/EOL + accessories, ~750 alias mappings) that was previously absent from the feature list entirely. DESIGN.md's "Corpus Snapshot" section is retitled "Historical Corpus Snapshot (legacy Confluence)" to stop reading as current-state to a skimmer; its already-caveated legacy figures are otherwise untouched.
Expand Down
32 changes: 32 additions & 0 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Download a compiled binary from [Releases](https://github.com/tikoci/rosetta/rel
| `browse` | Interactive terminal browser (REPL) |
| `browse <cmd> [args]` | Run any TUI command once, then open REPL (e.g. `browse changelog 7.20..7.22`) |
| `browse --once <cmd>` | Execute any TUI command and exit — no REPL (for piping) |
| `export <dir>` | Write DB-only dataset directory (TSV + manifest.toml) |
| `--setup` | Download DB + print MCP config |
| `--setup --force` | Re-download DB |
| `--refresh` | Shortcut for `--setup --force` (refresh DB) |
Expand Down Expand Up @@ -281,6 +282,37 @@ For a **prerelease** version specifically, `republish_assets: true` has extra ru
- `package.json` is **not** rewritten in this mode.
- No `npm dist-tag add` calls happen (npm publish is already fully skipped in `republish_assets` mode).

## Dataset Export

`rosetta export <dir>` writes a deterministic directory of spreadsheet-friendly datasets derived from the runtime database **alone** — dataset generation reads only the resolved SQLite DB, with no caches, no source artifacts, and no re-extraction. (Like every rosetta command, startup first ensures the DB is present and current, which may download or refresh it; that readiness step is the only network activity, and never a source for the exported data.) It is an audit surface for the artifact rosetta actually ships (rationale: `briefings/B-0022-runtime-sqlite-dataset-exports.md`).

```sh
bunx @tikoci/rosetta export /tmp/rosetta-datasets
```

The current pass writes one flat TSV per subject:

```text
rosetta-datasets/
├── manifest.toml # provenance (from db_meta) + serialization contract + per-file row counts + disclosures
├── changelog.tsv # changelogs: version, released, category, is_breaking, description, sort_order
├── callouts.tsv # callouts: page_id, section_id, type, content, sort_order
├── properties.tsv # properties joined to pages + resolved section_anchor
├── videos.tsv # video metadata + per-video transcript segment/word/byte counts
├── commands.tsv # command glossary: path, name, type, parent_path, page_id, description, ros_version
├── pages.tsv # one row per section: sizing (word/byte counts) + table counts (the granular view)
└── pages_summary.tsv # one row per page: rollup totals (section/table counts, bytes) — GitHub-readable
```

`pages.tsv` and `pages_summary.tsv` are the same core data for two audiences: the flat per-section rows suit a spreadsheet where you sort and group yourself, while the per-page rollup is small enough to read directly on GitHub. Product specs (`products/**`) and per-fragment table files (`pages/<slug>/**`) are not yet exported.

Serialization contract (stated in full in `manifest.toml`):

- **TSV**, UTF-8, LF line endings, a header row, and stable row/column ordering — a rebuild on the same DB is byte-identical.
- **Escaping** follows the Postgres COPY text convention: `\\`=backslash, `\t`=tab, `\n`=LF, `\r`=CR, applied as a general backstop to every value. A field exactly equal to `\N` is SQL NULL; an empty field is the empty string. This keeps the one-line-equals-one-record property (parseable by `awk -F '\t'`) while remaining losslessly reversible.

Because the export reads only the DB, a column it cannot produce is omitted and disclosed in `manifest.toml` rather than recovered from a source artifact. Overwriting a previous export is the working assumption; the command only rewrites the files it owns and never deletes anything it did not create.

## Database (Standalone)

The SQLite database is downloadable on its own from [GitHub Releases](https://github.com/tikoci/rosetta/releases):
Expand Down
Loading
Loading