From 0a31ae8e47de7f46b946d46c3cd236485146355b Mon Sep 17 00:00:00 2001 From: TIKOCI RouterOS Bots Date: Tue, 1 Dec 2026 15:06:55 -0800 Subject: [PATCH 1/2] QA floors follow the CLI Reference migration; remove stale and future-tense claims QA (run 46683801736) failed on 2026-12-01 because MikroTik moved the Bridging, Bridge IGMP/MLD snooping, legacy CAPsMAN and Wi-Fi CAPsMAN property tables (and their descriptions) into the CLI Reference. Nothing regressed in rosetta. - qa.yml: table floors rebased ~10% under the 2026-12-01 corpus (page_tables 475, data rows 4750, table-linked properties 1250); the page spot check pins Ethernet instead of Bridging; MIGRATED_FIELDS grows to 6 menus, adding interface/bridge ageing-time, caps-man/manager enabled and interface/wifi/capsman enabled. release.test.ts pins and VALIDATION updated. - #259: README "What's inside" uses rough sizes plus routeros_stats instead of 0.11.3-era counts; version examples become X.Y.Z; MANUAL stale "today" claims fixed; explain_command's `model` description and warning no longer promise a future feature. - BACKLOG: Trigger for closed #186, Inbox line for closed #21. Closes #259 Refs #269 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/qa.yml | 52 +++++++++++++++++++++++----------------- BACKLOG.md | 2 ++ CHANGELOG.md | 5 ++++ MANUAL.md | 12 +++++----- README.md | 29 +++++++++++----------- VALIDATION.md | 2 +- src/mcp.ts | 2 +- src/query.ts | 2 +- src/release.test.ts | 25 ++++++++++++------- 9 files changed, 77 insertions(+), 54 deletions(-) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index f24850c..e3f7560 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -291,44 +291,52 @@ jobs: # services, packet-sniffer, cloud, … — lost their tables: 661 / 6,764 / 2,745; # November 2026, after User Manager, HotSpot, certificates, PPP AAA, dot1x, RADIUS, # queues, connection tracking, containers, VXLAN, MACVLAN, MACsec, … were rewritten - # to link the CLI Reference instead: 554 / 5,659 / 1,763). - # These floors retain roughly 9-11% headroom while proving the prose parser, + # to link the CLI Reference instead: 554 / 5,659 / 1,763; 2026-12-01, after Bridging, + # Bridge IGMP/MLD snooping, legacy CAPsMAN and Wi-Fi CAPsMAN moved: 531 / 5,289 / 1,414). + # These floors retain roughly 10-12% headroom while proving the prose parser, # normalized storage, and property provenance all reached the artifact. CLI-Reference # has separate floors and exact discovery/link integrity gates below. - if [ "${PAGE_TABLES:-0}" -lt 500 ]; then - echo "::error::DB has only ${PAGE_TABLES} page_tables rows — expected ≥500." + if [ "${PAGE_TABLES:-0}" -lt 475 ]; then + echo "::error::DB has only ${PAGE_TABLES} page_tables rows — expected ≥475 (531 on 2026-12-01)." fail=1 fi - if [ "${PAGE_TABLE_DATA_ROWS:-0}" -lt 5100 ]; then - echo "::error::DB has only ${PAGE_TABLE_DATA_ROWS} generic table data rows — expected ≥5100." + if [ "${PAGE_TABLE_DATA_ROWS:-0}" -lt 4750 ]; then + echo "::error::DB has only ${PAGE_TABLE_DATA_ROWS} generic table data rows — expected ≥4750 (5,289 on 2026-12-01)." fail=1 fi - if [ "${TABLE_PROPERTIES:-0}" -lt 1600 ]; then - echo "::error::DB has only ${TABLE_PROPERTIES} properties linked to source table rows — expected ≥1600." + # Table-linked prose properties shrink as MikroTik moves property tables into the + # CLI Reference (3,357 Sept → 1,763 at 0.12.1 → 1,414 on 2026-12-01, after Bridging + # and CAPsMAN moved). This floor catches a parser loss, not the migration: lower it + # when a live page confirms another move. The CLI-Reference floors below and + # MIGRATED_FIELDS carry the property contract for the moved menus (#269). + if [ "${TABLE_PROPERTIES:-0}" -lt 1250 ]; then + echo "::error::DB has only ${TABLE_PROPERTIES} properties linked to source table rows — expected ≥1250." fail=1 fi # Page-level spot checks (0.12.1 review): the corpus-wide table floors keep ~10% - # headroom, so losing every table on one large page (Bridging alone is ~20 tables / - # ~160 properties) would still pass them. These pin pages that kept their tables - # through the November 2026 rewrite. If MikroTik later moves one of them into the - # CLI Reference too, confirm that on the live page and update the check. - BRIDGE_PROPS=$(sqlite3 ros-help.db "SELECT COUNT(*) FROM properties r JOIN pages p ON p.id = r.page_id WHERE (p.url LIKE '%/docs/bridging-and-switching' OR p.url LIKE '%/docs/bridging-and-switching/') AND r.source_table_row_id IS NOT NULL" 2>/dev/null || echo 0) + # headroom, so losing every table on one large page would still pass them. These pin + # pages that still carry their tables. Bridging was the pin until it moved to the CLI + # Reference on 2026-11-30 (158 → 0); Ethernet (155 on 2026-11-28) replaces it. If + # MikroTik moves this page too, confirm that on the live page and pin another. + ETHERNET_PROPS=$(sqlite3 ros-help.db "SELECT COUNT(*) FROM properties r JOIN pages p ON p.id = r.page_id WHERE (p.url LIKE '%/docs/wired-connections/ethernet' OR p.url LIKE '%/docs/wired-connections/ethernet/') AND r.source_table_row_id IS NOT NULL" 2>/dev/null || echo 0) UM_TABLES=$(sqlite3 ros-help.db "SELECT COUNT(*) FROM page_tables t JOIN pages p ON p.id = t.page_id WHERE p.url LIKE '%/docs/authentication-authorization-accounting/user-manager' OR p.url LIKE '%/docs/authentication-authorization-accounting/user-manager/'" 2>/dev/null || echo 0) - echo "✓ spot checks: bridging-and-switching ${BRIDGE_PROPS} properties, user-manager ${UM_TABLES} tables" - if [ "${BRIDGE_PROPS:-0}" -lt 100 ]; then - echo "::error::bridging-and-switching has only ${BRIDGE_PROPS} table-linked properties — expected ≥100 (158 on 2026-11-28). Did its property tables stop parsing?" + echo "✓ spot checks: wired-connections/ethernet ${ETHERNET_PROPS} properties, user-manager ${UM_TABLES} tables" + if [ "${ETHERNET_PROPS:-0}" -lt 100 ]; then + echo "::error::wired-connections/ethernet has only ${ETHERNET_PROPS} table-linked properties — expected ≥100 (155 on 2026-11-28). Did its property tables stop parsing, or did MikroTik move them to the CLI Reference (check the live page)?" fail=1 fi if [ "${UM_TABLES:-0}" -lt 3 ]; then echo "::error::user-manager has only ${UM_TABLES} generic tables — expected ≥3 (7 on 2026-11-28). Did its State/Meaning-style tables stop parsing?" fail=1 fi - # Properties that left the prose pages in November 2026 must still answer from the - # default CLI-Reference tree, with a description (routeros_lookup_property's fallback). - MIGRATED_FIELDS=$(sqlite3 ros-help.db "SELECT COUNT(DISTINCT e.source_path || ' ' || f.name) FROM cliref_fields f JOIN cliref_entries e ON e.id = f.entry_id JOIN cliref_pages p ON p.id = e.page_id JOIN cliref_trees t ON t.manual_version = p.manual_version WHERE t.is_default = 1 AND length(trim(f.description_markdown)) > 20 AND ((e.source_path = 'user-manager/user' AND f.name = 'shared-users') OR (e.source_path = 'ip/hotspot/user/profile' AND f.name = 'rate-limit') OR (e.source_path = 'queue/simple' AND f.name = 'max-limit'))" 2>/dev/null || echo 0) - echo "✓ spot checks: ${MIGRATED_FIELDS}/3 migrated properties answer from the default CLI-Reference tree" - if [ "${MIGRATED_FIELDS:-0}" -lt 3 ]; then - echo "::error::Only ${MIGRATED_FIELDS}/3 of user-manager/user shared-users, ip/hotspot/user/profile rate-limit, queue/simple max-limit have a described default-tree CLI-Reference field. Their prose property tables are gone, so this is their only answer." + # Properties that left the prose pages must still answer from the default + # CLI-Reference tree, with a description (routeros_lookup_property's overlay). One field + # per moved menu: November 2026 (User Manager, HotSpot, queues) and 2026-11-30 + # (Bridging, legacy CAPsMAN, Wi-Fi CAPsMAN), whose descriptions MikroTik moved too. + MIGRATED_FIELDS=$(sqlite3 ros-help.db "SELECT COUNT(DISTINCT e.source_path || ' ' || f.name) FROM cliref_fields f JOIN cliref_entries e ON e.id = f.entry_id JOIN cliref_pages p ON p.id = e.page_id JOIN cliref_trees t ON t.manual_version = p.manual_version WHERE t.is_default = 1 AND length(trim(f.description_markdown)) > 20 AND ((e.source_path = 'user-manager/user' AND f.name = 'shared-users') OR (e.source_path = 'ip/hotspot/user/profile' AND f.name = 'rate-limit') OR (e.source_path = 'queue/simple' AND f.name = 'max-limit') OR (e.source_path = 'interface/bridge' AND f.name = 'ageing-time') OR (e.source_path = 'caps-man/manager' AND f.name = 'enabled') OR (e.source_path = 'interface/wifi/capsman' AND f.name = 'enabled'))" 2>/dev/null || echo 0) + echo "✓ spot checks: ${MIGRATED_FIELDS}/6 migrated properties answer from the default CLI-Reference tree" + if [ "${MIGRATED_FIELDS:-0}" -lt 6 ]; then + echo "::error::Only ${MIGRATED_FIELDS}/6 of user-manager/user shared-users, ip/hotspot/user/profile rate-limit, queue/simple max-limit, interface/bridge ageing-time, caps-man/manager enabled, interface/wifi/capsman enabled have a described default-tree CLI-Reference field. Their prose property tables are gone, so this is their only answer." fail=1 fi # Hardware overlay floors (B-0017/B-0018, PR #41 / issue #38): the tables diff --git a/BACKLOG.md b/BACKLOG.md index 4ed2ea9..ebe8fc9 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -27,6 +27,7 @@ Drop one-line thoughts here. Promote later — to an issue if it gains shape, to - Extractor rebuild isn't atomic: an insert error mid-rebuild leaves a wiped DB, and the naive fix (wrap in a transaction) silently re-enables FK enforcement because `PRAGMA foreign_keys` is a no-op inside a transaction. Moved here from the closed #95 umbrella. Separate failure mode [#178](https://github.com/tikoci/rosetta/issues/178) is fixed: per-version extraction failures now fail the build (#179). That fail-closed release behavior does not make local rebuilds atomic. - `routeros_command_tree` path ergonomics: requires exact slash-delimited REST-like paths (e.g. `/ip/address/add/address`) and rejects natural forms like `ip address`; shape is tightly bound to `inspect.json`'s parts, some of which (e.g. `page_title`/`page_url`/`dir_role`/`data_type`/`_arch`/`completion`, often all `null`) may not carry their weight. Surfaced while reviewing B-0004 (2026-07-14), which is otherwise superseded/resolved — not yet scoped as its own issue. +- Video quality signals: transcript-source classification and whether `view_count`/`upload_date` should affect ranking (closed #21 as not planned, 2026-12-01). Reopen if a retrieval or eval result shows they would change answers. - Manual doc-changes watcher: Docusaurus extraction has landed, so the old prerequisite is satisfied. Decide whether RSS-driven refresh adds value before scheduling it; reverify the feed before implementation. ## Triggers @@ -44,6 +45,7 @@ Items waiting on a specific external event. Not tracked as issues because the wa | Video extraction retry | At each scheduled transcript refresh — re-run consistent-fail videos after 48–72h gaps; add to `known-bad.json` after repeated failures. | | LSP consumer artifacts | When `lsp-routeros-ts` is ready for static manifests. The path→URL/title half is now [#173](https://github.com/tikoci/rosetta/issues/173) (publish `rosetta export` output); a `verbs.json` manifest (#5 H4) would ride the same publishing path. | | bench-routeros-tools merge | When `agents/grounded-data-collection-agents` and the pending Claude matrix work land, review benchmark reports for stable external-eval fixtures and decide whether to promote a rosetta task. | +| Per-version manual prose (closed [#186](https://github.com/tikoci/rosetta/issues/186)) | When a concrete version-scoped prose question appears that the default tree plus per-version CLI Reference and `command_versions` cannot answer. | | Overlay-as-base path vocabulary (B-0024 step 8) | When `centrs`' `explain` canonicalization work settles whether the CLI-Reference path vocabulary can host inspect's verbs without a new alias layer. Until then rosetta keeps the overlay beside `schema_nodes`, not under it. Do not preempt with a rosetta-local alias scheme. | Fired 2026-10-20: **versioned manual** — `/docs/7.24/` and `/docs/7.25/` now serve `llms.txt` + `.md`, and the default tree declares itself 7.26 (development), not stable. Delivered: [#187](https://github.com/tikoci/rosetta/issues/187) (stamp the ingested manual version) and [#188](https://github.com/tikoci/rosetta/issues/188) (per-version CLI Reference as a published dataset for centrs). Remaining: [#186](https://github.com/tikoci/rosetta/issues/186) (per-version prose). diff --git a/CHANGELOG.md b/CHANGELOG.md index 3758896..71c99f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,11 @@ uses [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Changed + +- **QA content floors follow MikroTik's move of property tables into the CLI Reference.** On 2026-11-30 the Bridging, Bridge IGMP/MLD snooping, legacy CAPsMAN and Wi-Fi CAPsMAN pages lost their property tables, and their descriptions moved to the CLI Reference. The table floors now sit about 10% under the current corpus (≥475 page tables, ≥4,750 data rows, ≥1,250 table-linked properties). The page spot check pins Ethernet instead of Bridging. The migrated-property check now requires six moved menus, adding `interface/bridge`, `caps-man/manager` and `interface/wifi/capsman`, to answer from described CLI Reference fields. +- **`routeros_explain_command`'s `model` argument no longer promises a future feature.** Its description and the `model-context-unused` warning now say that rosetta has no per-device command data, and point to `routeros_device_lookup` for hardware and to centrs for validation against a real router. + ## [0.12.1] — 2026-11-28 ### Changed diff --git a/MANUAL.md b/MANUAL.md index 57557a9..0a1ebf1 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -159,7 +159,7 @@ The database combines multiple MikroTik data sources into a single SQLite file w - **Legacy HTML Documentation** — Confluence space export from help.mikrotik.com (March 2026, frozen). 317 pages broken into sections, callouts, and property tables (~515K words). Kept only for rebuilding historical pre-migration release DBs — see "Re-extracting a Local Database" below. -- **Command Tree** — `inspect.json` / `deep-inspect.json` from [tikoci/restraml](https://github.com/tikoci/restraml), generated by running `/console/inspect` against RouterOS CHR under QEMU for every version since 7.9 (67 versions with command data, 7.9–7.25rc1, as of 0.11.3). The MCP tool descriptions read that range from `command_versions` at startup. `routeros_stats`' `ros_version_min`/`ros_version_max` come from `ros_versions` instead, which also holds metadata-only rows with no command data (7.1.1, 7.8), so its minimum reads lower. `command_versions` keeps full version history; `schema_node_presence` is release-pruned to active channel heads (stable, long-term, testing, development) to bound DB growth. +- **Command Tree** — `inspect.json` / `deep-inspect.json` from [tikoci/restraml](https://github.com/tikoci/restraml), generated by running `/console/inspect` against RouterOS CHR under QEMU for every version since 7.9, more than 70 versions with command data; `routeros_stats` reports the exact range. The MCP tool descriptions read that range from `command_versions` at startup. `routeros_stats`' `ros_version_min`/`ros_version_max` come from `ros_versions` instead, which also holds metadata-only rows with no command data (7.1.1, 7.8), so its minimum reads lower. `command_versions` keeps full version history; `schema_node_presence` is release-pruned to active channel heads (stable, long-term, testing, development) to bound DB growth. - **Product Matrix** — CSV export from mikrotik.com/products/matrix (about 155 products, 34 columns; `routeros_stats` has the count). Hardware specs, license levels, and pricing. The snapshot in use is `MATRIX_CSV_RELATIVE_PATH` in `src/paths.ts`. @@ -318,7 +318,7 @@ Published artifacts come from the GitHub Actions `Release` workflow (`workflow_d - **`promote-oci`:** needs both `smoke-oci` legs, then copies the smoke-tested multi-arch manifest onto `$VERSION` (+ `:next`/`:latest` per the npm scheme) via `imagetools` — nothing is rebuilt. A failure in either leg leaves `:latest` / `:next` untouched. - **`verify-dist-tags`:** reads the npm dist-tags back (up to 15 minutes; see "npm channel" below). It is a separate job so that slow registry propagation fails the run without skipping the install smoke. - **`smoke`:** `uses: ./.github/workflows/release-smoke.yml`, the three-OS `bunx-smoke` and `bunx-upgrade-smoke` jobs. Both wait through the abbreviated install manifest Bun resolves from (`scripts/wait-for-registry.ts`, same 900s budget) — the full packument `npm view` sees can lead it, and that gap failed two releases (#202). `bunx-smoke` waits for the exact version, and its `--version` probe asserts the exact executed version; `bunx-upgrade-smoke` waits for the channel tag (`latest`/`next`) to resolve to the just-published version, then invokes the explicit-tag form with no `--refresh` and requires the new-release DB banner. The bare form is deliberately not gated: a warm bare `bunx` serves its cache with zero registry requests (decision B, #226); bare-form staleness is accepted behavior — see "How Updates Work". -- **Re-running a skipped smoke:** `release-smoke.yml` is also dispatchable on its own against an already-published version, e.g. `gh workflow run release-smoke.yml -f version=v0.11.3-next.116 -f previous_version=v0.11.3-next.115`. Leave `previous_version` empty to run `bunx-smoke` only. `bunx-upgrade-smoke` resolves the dist-tag, so it can only pass for the version that is currently the tag's head. +- **Re-running a skipped smoke:** `release-smoke.yml` is also dispatchable on its own against an already-published version, e.g. `gh workflow run release-smoke.yml -f version=vX.Y.Z-next.N -f previous_version=vX.Y.Z-next.M`. Leave `previous_version` empty to run `bunx-smoke` only. `bunx-upgrade-smoke` resolves the dist-tag, so it can only pass for the version that is currently the tag's head. - **Release notes (#22):** the GitHub Release body starts with the version's `CHANGELOG.md` block on a latest release, or the `[Unreleased]` block (headed "Changes since *last release* (unreleased)") on a `-next` release, then the DB stats and build info. `scripts/release-notes.ts` builds it from the checked-out `CHANGELOG.md`, so a `republish_assets` run from the same commit writes the same body. - **Provenance:** release notes include DB stats, and the stamped `db_meta` keys (`release_tag`, `built_at`, `source_commit`, `schema_version`) let runtime surfaces report exactly what shipped. - **Test coverage:** the fast-fail `bun test` step runs with `--coverage`, prints a per-file table to the workflow's step summary, and uploads `coverage/lcov.info` as a `coverage-lcov` workflow artifact. Informational only — not a gate. @@ -345,7 +345,7 @@ Inputs: There is a third `db_source` — `artifact` — but it is **`workflow_call`-only** (no dispatch dropdown entry): `release.yml`'s `build` job uploads its freshly extracted DB and the `qa` job pulls it via `artifact_name`, so the gates validate the exact bytes about to publish. A manual dispatch has no upstream artifact, so it stays on `local-build`/`published`. -Caveat: `db_source: published` downloads the latest *non-prerelease* Release DB, which may predate a floor's introduction (today's latest predates the hardware overlay). `db-content` is therefore excluded from an `all` run on `published` and is only meaningful on `local-build` (or the release `artifact` path); requesting `test_scope: db-content db_source: published` explicitly will honestly report the unmet floor. +Caveat: `db_source: published` downloads the latest *non-prerelease* Release DB, which may predate a floor's introduction, or carry manual content MikroTik has since moved (property tables migrating into the CLI Reference). `db-content` is therefore excluded from an `all` run on `published` and is only meaningful on `local-build` (or the release `artifact` path); requesting `test_scope: db-content db_source: published` explicitly will honestly report the unmet floor. ### Version bumps are a manual step @@ -362,7 +362,7 @@ The existing "already published" npm preflight (`npm view @`) rema There are exactly two channels, `latest` and `next` (#152). `package.json`'s committed version is the **single source of truth for channel** — no separate CI input duplicates this: -- A **bare** version (`0.11.3`) means the **latest** channel: `npm publish` runs with no `--tag` (defaults to the `latest` dist-tag), and the OCI `:latest` tag pushes. +- A **bare** version (`X.Y.Z`) means the **latest** channel: `npm publish` runs with no `--tag` (defaults to the `latest` dist-tag), and the OCI `:latest` tag pushes. - A **prerelease** version of the form `MAJOR.MINOR.PATCH-next` or `MAJOR.MINOR.PATCH-next.N` means the **next** channel. Any other prerelease identifier — including the retired `alpha` / `beta` / `rc` — fails the workflow with a clear error. **`next` is never behind `latest`.** Every run enforces it: @@ -378,7 +378,7 @@ For prerelease dispatches, the workflow's very first extraction-pipeline step re - **Leave the `version` input blank for prerelease dispatches.** The true published version (with its run-number suffix) can't be predicted ahead of dispatch. Supplying `version` anyway will fail the npm publish-access preflight loudly rather than silently publishing under the wrong version. - OCI images get a floating `:next`, alongside the always-on `$VERSION` and `sha-$SHORT_SHA` tags. The bare `:latest` OCI tag **never** pushes on a prerelease run — this is the fix for the OCI-latest-clobber risk (an unguarded prerelease dispatch used to silently overwrite the production `/app` container's `:latest`). - The GitHub Release is created with `--prerelease` so it doesn't show as "Latest" on the repo's Releases page. -- `^0.11.3-next`-style semver ranges are **not** a substitute for dist-tags — see the caveat in [README.md](README.md#prerelease-channel-optional). +- `^X.Y.Z-next`-style semver ranges are **not** a substitute for dist-tags — see the caveat in [README.md](README.md#prerelease-channel-optional). ### Prerelease republish semantics @@ -388,7 +388,7 @@ For prerelease dispatches, the workflow's very first extraction-pipeline step re For a **prerelease** version specifically, `republish_assets: true` has extra rules, since CI cannot recompute a past run's `$GITHUB_RUN_NUMBER`: -- `version` **must** be supplied as the exact already-published run-numbered version (e.g. `v0.11.3-next.42`) — the workflow fails fast if it's blank. +- `version` **must** be supplied as the exact already-published run-numbered version (e.g. `vX.Y.Z-next.42`) — the workflow fails fast if it's blank. - `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). diff --git a/README.md b/README.md index 001b68e..04e1045 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,18 @@ Instead of vector embeddings, rosetta uses **SQLite [FTS5](https://www.sqlite.or | Data Source | Coverage | |-------------|----------| -| Documentation pages | 369 pages (~641K words) from MikroTik's live Docusaurus manual | -| Property definitions | 2,799 from manual tables, plus 10,833 fields from the CLI Reference (1,062 menus and commands) | -| Command tree | 5,333 commands, 576 dirs, 37K arguments | -| Version history | 67 RouterOS versions with command data (7.9–7.25rc1) | -| Hardware products | 155 current matrix devices — specs, pricing, block diagrams | -| Hardware overlay | 258 devices (matrix + legacy/EOL + accessories), resolved via ~1,280 curated alias mappings for cross-source device lookup | -| Performance benchmarks | 3,162 tests across 143 devices (ethernet + IPSec) | -| YouTube transcripts | 746 videos, ~2,479 transcript segments | -| Callout blocks | 880 warnings, notes, and tips | - -Counts are from the 0.11.3-next.114 release DB; `routeros_stats` reports the live numbers for the DB you're running. +| Documentation pages | ~400 pages from MikroTik's live Docusaurus manual | +| Property definitions | Every menu's arguments and flags from MikroTik's CLI Reference, plus the property tables still on manual pages (fewer each release as MikroTik moves them into the CLI Reference) | +| Command tree | Every menu, command and argument from `/console/inspect` (~5,000 commands) | +| Version history | Command data for 70+ RouterOS 7 releases from 7.9 on, stable and development | +| Changelogs | Every RouterOS 7 changelog entry, by version and category | +| Hardware products | The current product matrix (~150 devices): specs, pricing, block diagrams | +| Hardware overlay | ~250 devices (matrix + legacy/EOL + accessories), with ~1,300 curated aliases for cross-source device lookup | +| Performance benchmarks | ~3,000 ethernet and IPSec test results from product pages | +| YouTube transcripts | ~750 MikroTik videos with chapter-level transcript segments | +| Callout blocks | ~800 warnings, notes, and tips | + +Sizes are rough; `routeros_stats` reports exact counts for the DB you're running. Documentation covers RouterOS **v7 only**. Prose is extracted live from on each release build — no more stale export to keep in sync. MikroTik is moving property tables from the manual pages into its CLI Reference, which rosetta also ingests: property lookups and command explanations use the CLI Reference entry for a menu when it has the better answer, and say which source each answer came from (see `DESIGN.md`). The command tree itself comes from inspect.json. @@ -134,10 +135,10 @@ Rosetta answers the MCP handshake, and some clients time out while it downloads. For a pinned install, use the same exact package version as the client's config: ```sh -bunx @tikoci/rosetta@0.11.3 --setup +bunx @tikoci/rosetta@X.Y.Z --setup ``` -Replace `0.11.3` with your configured version and use the same `--db` / `DB_PATH` +Replace `X.Y.Z` with your configured version and use the same `--db` / `DB_PATH` if overridden. Each package version has its own default DB, so setting up one version does not prepare another. Setup still prints floating stable config snippets: for a pinned or prerelease install, edit the package argument to retain @@ -164,7 +165,7 @@ bunx @tikoci/rosetta@next # newest build: a prerelease, or latest when none `@next` is never behind `latest`: each stable release also moves `next` unless a newer prerelease is already there, so it is safe to leave `@next` in an MCP config. `bunx @tikoci/rosetta` (no tag) and `bunx @tikoci/rosetta@latest` always resolve to the default, non-prerelease channel — publishing a prerelease never moves `latest`. -> **Dist-tags, not semver ranges.** A version range like `^0.11.3-next` is **not** equivalent to a dist-tag. npm's prerelease range matching only spans the exact `[major,minor,patch]` tuple written in the range, so it stops tracking new prereleases the moment a patch/minor bump happens. `@next` is the "follow forever" mechanism. The older `@alpha` / `@beta` / `@rc` tags are retired and no longer receive updates — switch any config using them to `@next`. +> **Dist-tags, not semver ranges.** A version range like `^X.Y.Z-next` is **not** equivalent to a dist-tag. npm's prerelease range matching only spans the exact `[major,minor,patch]` tuple written in the range, so it stops tracking new prereleases the moment a patch/minor bump happens. `@next` is the "follow forever" mechanism. The older `@alpha` / `@beta` / `@rc` tags are retired and no longer receive updates — switch any config using them to `@next`. ### Configure your MCP client diff --git a/VALIDATION.md b/VALIDATION.md index 4371f84..e109e46 100644 --- a/VALIDATION.md +++ b/VALIDATION.md @@ -28,7 +28,7 @@ Tasks in `tasks/` reference these IDs in their `validation:` frontmatter. When a | V-property-confidence | `routeros_lookup_property` confidence grades the **row** against the requested menu, not the query branch: `high` requires the row's own section to name that menu, to be the menu the section is about (support gate), and the command tree not to contradict it; page alignment alone can only reach `medium`; absent evidence is `low`; rows are returned best tier first (B-0024 step 4) | `src/property-confidence.test.ts` (tier decision table + support gate) and `src/query.test.ts` (`lookupProperty confidence`) via `bun test` in `.github/workflows/test.yml` | blocking | #131 | | V-retrieval-floor | Recall/MRR/classifier meet absolute floors AND stay within 2pp of baseline on 35 hand-curated golden queries (27 search-surface, gated — the corpus-swap-sensitive `routeros_search` entry point); a separate **informational** `surface_matrix` tracks per-surface hit@5 for the dedicated tools (property/changelog/video), kept OUT of the gated aggregates (#53) | `src/eval/retrieval.ts`, `qa.yml` eval-golden gate (run by `release.yml`'s `qa` job) | blocking (search aggregates) / non-blocking (surface_matrix) | — | | V-retrieval-self | Self-supervised eval (~200 auto-generated queries) holds within 5pp of baseline (baseline regenerated against the Docusaurus corpus in #53 — the April-2026 Confluence-era baseline was stale, so every post-swap run showed a false regression) | `qa.yml` eval-self gate (run by `release.yml`'s `qa` job; `continue-on-error` unless `eval_self_blocking`) | non-blocking (pending promotion) | — | -| V-db-min-content | Built DB has ≥200 pages, ≥1000 commands, ≥100 devices, ≥2000 device_test_results, ≥1000 properties, ≥500 generic page tables, ≥5100 table data rows, ≥1600 properties linked to exact table rows, ≥200 hardware_catalog, ≥600 device_aliases, ≥80 devices with block diagrams, ≥2500 sections, ≥600 callouts, ≥4000 changelog entries (≥1000 only on a single-version local-build rehearsal), ≥600 videos, ≥50 Dude pages, ≥10 skills before publish, plus page-level spot checks (≥100 Bridging properties, ≥3 User Manager tables, 3 migrated properties described in the default CLI-Reference tree); a latest release must be a full-version build; CLI-Reference content is floored and integrity-checked separately | `qa.yml` db-content gate (single definition of the floors; run by `release.yml`'s `qa` job with `db_source=artifact`, so it floors the exact DB about to publish) | blocking | #139, #218, #231 | +| V-db-min-content | Built DB has ≥200 pages, ≥1000 commands, ≥100 devices, ≥2000 device_test_results, ≥1000 properties, ≥475 generic page tables, ≥4750 table data rows, ≥1250 properties linked to exact table rows (prose tables shrink as MikroTik moves properties to the CLI Reference; these floors catch parser loss, #269), ≥200 hardware_catalog, ≥600 device_aliases, ≥80 devices with block diagrams, ≥2500 sections, ≥600 callouts, ≥4000 changelog entries (≥1000 only on a single-version local-build rehearsal), ≥600 videos, ≥50 Dude pages, ≥10 skills before publish, plus page-level spot checks (≥100 Ethernet properties, ≥3 User Manager tables, 6 migrated properties described in the default CLI-Reference tree); a latest release must be a full-version build; CLI-Reference content is floored and integrity-checked separately | `qa.yml` db-content gate (single definition of the floors; run by `release.yml`'s `qa` job with `db_source=artifact`, so it floors the exact DB about to publish) | blocking | #139, #218, #231 | | V-extract-test-results-fail-loud | `extract-test-results` exits non-zero with the previous `device_test_results` table untouched on an empty result, >10% hard fetch errors, >15% missing (404) pages, or the 15-minute global fetch deadline; a 200 page with no benchmark rows and no block diagram counts as a hard error, and retries cover 5xx/429 (Retry-After ≤30s)/network/timeout while 403 fails at once | `src/extract-test-results.test.ts` (verdict table + failure classification + hermetic verdict-to-exit subprocess pin) and `src/restraml.test.ts` (429/403 policy) via `bun test` in `test.yml`; `qa.yml` db-content floor backstops row-count drift | blocking | #218 | | V-extract-changelogs-fail-loud | `extract-changelogs` exits non-zero with the previous `changelogs` table untouched on an empty result, >10% hard fetch errors, >15% missing (404) or unparsed versions, or 5 consecutive hard errors; retries match V-extract-test-results-fail-loud | `src/extract-changelogs.test.ts` (verdict table + fetch classification) via `bun test` in `test.yml`; `qa.yml` db-content changelog floor backstops it | blocking | #231 | | V-db-wipe-guard | Tests cannot accidentally open and overwrite the on-disk DB | `src/query.test.ts` `:memory:` guard + post-extraction guard in CI | blocking | — | diff --git a/src/mcp.ts b/src/mcp.ts index e86d12c..e5937a1 100644 --- a/src/mcp.ts +++ b/src/mcp.ts @@ -959,7 +959,7 @@ Boundaries: Documentation is RouterOS v7 from the manual export this DB was buil model: z .string() .optional() - .describe("Optional device model context. Accepted for future use; device-specific validation is not implemented."), + .describe("Optional device model. Not used to check the command: rosetta has no per-device command data. Use routeros_device_lookup for hardware specs; validating against a real router belongs to centrs."), }, }, async ({ command, ros_version, model }) => { diff --git a/src/query.ts b/src/query.ts index 376baba..90a6baa 100644 --- a/src/query.ts +++ b/src/query.ts @@ -710,7 +710,7 @@ export function explainCommand(command: string, rosVersion?: string, model?: str if (model) { warnings.push({ kind: "model-context-unused", - message: `Model context "${model}" was accepted but device-specific command validation is not implemented yet.`, + message: `Model context "${model}" is not used: rosetta has no per-device command data, so the command is explained the same for every device.`, suggestion: "Use routeros_device_lookup separately for hardware specs; this tool stays read-only and documentation-backed.", }); } diff --git a/src/release.test.ts b/src/release.test.ts index 3a95404..52cda56 100644 --- a/src/release.test.ts +++ b/src/release.test.ts @@ -1358,9 +1358,9 @@ describe("qa.yml", () => { /COMMANDS.*-lt 1000/, /DEVICES.*-lt 100/, /PROPERTIES.*-lt 1000/, - /PAGE_TABLES.*-lt 500/, - /PAGE_TABLE_DATA_ROWS.*-lt 5100/, - /TABLE_PROPERTIES.*-lt 1600/, + /PAGE_TABLES.*-lt 475/, + /PAGE_TABLE_DATA_ROWS.*-lt 4750/, + /TABLE_PROPERTIES.*-lt 1250/, /HARDWARE_CATALOG.*-lt 200/, /DEVICE_ALIASES.*-lt 600/, /TEST_RESULTS.*-lt 2000/, @@ -1383,15 +1383,22 @@ describe("qa.yml", () => { test("pins page-level spot checks the corpus-wide table floors are too loose to catch", () => { const qa = readText(".github/workflows/qa.yml"); - expect(qa).toMatch(/BRIDGE_PROPS.*-lt 100/); + expect(qa).toMatch(/ETHERNET_PROPS.*-lt 100/); expect(qa).toMatch(/UM_TABLES.*-lt 3/); - expect(qa).toMatch(/MIGRATED_FIELDS.*-lt 3/); - // Bridging counts table-linked rows only (bullet-list properties would mask a table loss), - // and each requested CLI-Reference field counts once however often the parser stored it. - expect(qa).toMatch(/BRIDGE_PROPS=.*LIKE '%\/docs\/bridging-and-switching' OR p\.url LIKE '%\/docs\/bridging-and-switching\/'\) AND r\.source_table_row_id IS NOT NULL/); + expect(qa).toMatch(/MIGRATED_FIELDS.*-lt 6/); + // The pinned page counts table-linked rows only (bullet-list properties would mask a table + // loss), and each requested CLI-Reference field counts once however often the parser stored it. + expect(qa).toMatch(/ETHERNET_PROPS=.*LIKE '%\/docs\/wired-connections\/ethernet' OR p\.url LIKE '%\/docs\/wired-connections\/ethernet\/'\) AND r\.source_table_row_id IS NOT NULL/); expect(qa).toMatch(/UM_TABLES=.*user-manager' OR p\.url LIKE '%\/docs\/authentication-authorization-accounting\/user-manager\/'/); expect(qa).toMatch(/MIGRATED_FIELDS=.*COUNT\(DISTINCT e\.source_path \|\| ' ' \|\| f\.name\)/); - for (const field of ["'user-manager/user' AND f.name = 'shared-users'", "'ip/hotspot/user/profile' AND f.name = 'rate-limit'", "'queue/simple' AND f.name = 'max-limit'"]) { + for (const field of [ + "'user-manager/user' AND f.name = 'shared-users'", + "'ip/hotspot/user/profile' AND f.name = 'rate-limit'", + "'queue/simple' AND f.name = 'max-limit'", + "'interface/bridge' AND f.name = 'ageing-time'", + "'caps-man/manager' AND f.name = 'enabled'", + "'interface/wifi/capsman' AND f.name = 'enabled'", + ]) { expect(qa).toContain(field); } }); From d031f93cecec035da8c0b3fbc13d3af178c3293b Mon Sep 17 00:00:00 2001 From: TIKOCI RouterOS Bots Date: Tue, 1 Dec 2026 15:07:08 -0800 Subject: [PATCH 2/2] DESIGN: point remaining surface work at #269 Co-Authored-By: Claude Opus 5.5 --- DESIGN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESIGN.md b/DESIGN.md index 269fa65..85be03c 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -37,7 +37,7 @@ This pattern is used across several `tikoci` projects (forum archives, documenta - **Identity:** `pages.rosetta_id` — a lowercased, trailing-slash-stripped, `.md`/`.mdx`-suffix-stripped, version-prefix-tolerant URL path (e.g. `docs/network-management/dhcp`). See "H7 — Identity / rosetta-id design" in `briefings/B-0012-docusaurus-manual-migration.md` for the full derivation rationale and the T-0034 spike that validated it before T-0035 built on it. Legacy Confluence-sourced `pages` rows keep `rosetta_id = NULL` and their original Confluence-numbered `id`; the two identity shapes coexist in the schema but a single build populates one or the other, never both. - **Parsing:** Every Markdown pipe table is retained generically in normalized `page_tables` → rows → cells storage (raw Markdown remains alongside decoded cells); table-derived properties consume that shared parse and link to the exact source row, while bullet properties stay a separate path. The property classifier remains intentionally narrow (`| Property |` or `| Parameter |`, both seen live) and tolerant of dhcp.md's malformed `check-gateway` emphasis (B-0012 H4). `:::type ... :::` admonitions → `callouts`; non-empty prose before the first real h1–h3 heading becomes a synthetic lead section (`level = 0`, `anchor_id = "_lead"`), followed by the ordinary h1–h3 `sections`. The parser excludes a real source quirk where the raw `.md` repeats the page's H1 title after the AI-generated summary blockquote. Relative Markdown links inside property descriptions are rewritten to live `manual.mikrotik.com` URLs (anchor fragment preserved) instead of left as broken relative paths. - **CLI Reference:** handled by the separate, shipped `src/extract-cliref.ts` extractor and inspect crosswalk. It preserves menus, fields, flags, source Markdown and the landing page for each manual tree. The source-faithful overlay stays separate from inspect identity; see "CLI-Reference overlay: source vs inspect identity" below and MANUAL's data-source/export reference. -- **Remaining surface work:** CLI Reference and `/hardware` extraction have landed, and property lookup/explain already consume the overlay. Broader tool consolidation remains a separate decision in B-0011/B-0025, informed by #54's current-surface inventory. Standard landing-page rows are exported but not yet consumed by runtime answers (#203). +- **Remaining surface work:** CLI Reference and `/hardware` extraction have landed, and property lookup/explain already consume the overlay. Aligning answers, derived datasets and the tool surface with the new manual (CLI Reference first, MikroTik's own prose→CLI-Reference links) is tracked in #269, which supersedes the open B-0011/B-0025 questions. Standard landing-page rows are exported but not consumed by runtime answers (#203). Directional options and the full research trail are recorded in `briefings/B-0012-docusaurus-manual-migration.md`.