feat(docs): generate the @gittensory command reference from source instead of hand-copying - #3063
Conversation
…stead of hand-copying Docs pages hand-copied the @gittensory command list from src/github/commands.ts's two catalogs, which is exactly how the 9-command maintainer-only queue-digest family went undocumented until caught separately. Add scripts/gen-command-reference.mjs to extract both catalogs and generate apps/gittensory-ui/src/lib/command-reference.ts, then wire the two docs pages to render the generated lists.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 9ab1d60 | Commit Preview URL Branch Preview URL |
Jul 04 2026, 11:14 AM |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-04 11:18:39 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3063 +/- ##
=======================================
Coverage 96.11% 96.11%
=======================================
Files 263 263
Lines 28962 28962
Branches 10538 10538
=======================================
Hits 27836 27836
Misses 492 492
Partials 634 634 🚀 New features to boost your workflow:
|
Summary
docs.maintainer-workflow.tsxanddocs.maintainer-install-trust.tsxeach hand-copied the@gittensorycommand list fromsrc/github/commands.ts's two catalogs (PUBLIC_MENTION_COMMAND_CATALOG,MAINTAINER_QUEUE_DIGEST_COMMAND_CATALOG) — exactly how the 9-command maintainer-only queue-digest family went completely undocumented until a separate audit caught it.scripts/gen-command-reference.mjs, mirroringscripts/gen-selfhost-env-reference.mjs's generate/--checkdual-mode convention: it extracts both catalogs' full{id, title, description}entries fromsrc/github/commands.ts(same catalog-array-slicing regex approach asextractCatalogIds, extended to keep the full entry) and writesapps/gittensory-ui/src/lib/command-reference.ts, exportingPUBLIC_COMMAND_LISTandMAINTAINER_COMMAND_LISTas plain@gittensory <id>-per-line string constants.command-reference/command-reference:checkintopackage.jsonand addscommand-reference:checkto thetest:cichain (beforeui:lint).PUBLIC_COMMAND_LIST/MAINTAINER_COMMAND_LISTfrom@/lib/command-referenceinstead of a hand-writtenCodeBlockstring, bringing both pages to the full 10 public + 9 maintainer-only command set.docs.beta-onboarding.tsxis intentionally left untouched — it curates a smaller 7-command onboarding subset by design, not the full catalog (per the issue).Fixes #3046
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — my diff touches onlyscripts/**,apps/**, andtest/**, all Codecov-ignored paths, so it carries nosrc/**patch-coverage obligation; ran anyway as part of the fullnpm run test:cigate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderatetest/unit/gen-command-reference-script.test.ts: catalog-slicing extraction (including the "two catalogs don't bleed into each other" case), empty-list rendering, the sub-15-total self-defense throw, a fixture with exactly 15 total commands, the real-repo extraction (10 public + 9 maintainer, in source order), a regression guard that the committed generated file is byte-identical to what the generator produces right now, and a subprocess--checkrun against the real repo state.Also ran, additionally, beyond the template's list:
npm run command-reference:check(passes — the generated file matches source), and the fullnpm run test:cichain end-to-end (all steps green, including the newcommand-reference:checkstep in its wired position beforeui:lint).Note on
npm run docs:drift-check: this script does not exist yet onmainat the base commit of this branch — it ships in the still-open sibling issue #3047 (PR #3059). I confirmed the ordering this issue asks for (command-reference:checkimmediately beforeui:lint) is exactly the slotdocs:drift-checkwill also occupy once that PR lands, so no reordering will be needed later. I also confirmed my generated@gittensory <id>lines are literal substringsdocs:drift-check'sextractCatalogIds-based cross-check will look for, once it exists.If any required check was skipped, explain why:
npm run test:release/changelog:checkare release-prep only and not applicable here.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails — see the UI Evidence note below for why screenshots are not attached here.UI Evidence
This PR does change what two docs pages render (
docs.maintainer-workflow.tsx's "On-demand commands" section anddocs.maintainer-install-trust.tsx's "Command authorization" section), but the visible text is byte-identical to what a correctly-completed hand-copy of the current source catalogs would show — I generatedPUBLIC_COMMAND_LIST/MAINTAINER_COMMAND_LISTdirectly from the samesrc/github/commands.tscatalogs the hand-written blocks were always meant to mirror, in the same catalog order, using the same@gittensory <id>line format the existing hand-writtenCodeBlocks already used. A rendered screenshot of the new page would look identical to a correctly-maintained hand-copy of the current 10 public + 9 maintainer-only commands; the change is entirely in how that text is produced (generated from source vs. hand-typed), not in its rendered appearance for a reader looking at the page today. I'm omitting a before/after screenshot table for this reason rather than attaching one of an unchanged render, per the issue's own framing (the goal is generation without changing the intended documented surface).Notes
scripts/check-docs-drift.mjs(the CI check referenced by issue feat(docs): generate the @gittensory command reference from src/github/commands.ts instead of hand-copying #3046 asextractCatalogIds's source) does not exist onmainyet — it is still part of the open sibling issue feat(ci): add a docs-drift check for GITTENSORY_REVIEW_* flags, @gittensory commands, and gate-mode dimensions #3047 / PR docs(gittensory-ui): fix stale website docs and add a CI docs-drift check #3059. I read PR docs(gittensory-ui): fix stale website docs and add a CI docs-drift check #3059's diff to confirm the exactextractCatalogIdsregex shape and reused the same catalog-array-slicing approach (const <NAME> = [...] as const;, non-greedy to the first close) inscripts/gen-command-reference.mjs's ownextractCatalogEntries, extended to capture the full{id, title, description}entry instead of just theid.