Skip to content

chore(selfhost): wire up the unwired config-lint.ts manifest validator - #2923

Merged
JSONbored merged 1 commit into
mainfrom
claude/wire-config-lint-2906
Jul 4, 2026
Merged

chore(selfhost): wire up the unwired config-lint.ts manifest validator#2923
JSONbored merged 1 commit into
mainfrom
claude/wire-config-lint-2906

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • src/selfhost/config-lint.ts's lintManifestText was a complete, well-tested manifest validator (parses a .gittensory.yml-shaped file, flags unknown top-level fields and parser warnings, redacts supplied values) with zero production callers — no CLI, API route, or boot-time check invoked it.
  • Adds scripts/gittensory-config-lint.ts, run via npm run selfhost:config-lint -- [path] (defaults to .gittensory.yml in the current directory). Thin CLI wrapper only: reads the file, calls the existing lintManifestText, prints a report, exits non-zero on any warning. Follows the same shape as the repo's other tsx scripts/*.ts self-host CLI (selfhost:postgres:migrate) and its main() v8-ignore convention (see scripts/validate-observability-configs.mjs).
  • Manually verified end-to-end against this repo's real .gittensory.yml (see Validation) and against a missing-file path and --help.

Resolves #2906. Part of the #1667 self-host review-stack roadmap (follow-up to #2912).

Scope

Validation

  • git diff --check
  • npm run typecheck
  • vitest run test/unit/gittensory-config-lint-script.test.ts test/unit/selfhost-config-lint.test.ts — 16 tests passed
  • npm run test:changed — 1 file / 3 tests in scope, passed
  • Manual end-to-end smoke test: npx tsx scripts/gittensory-config-lint.ts .gittensory.yml (parsed 9 recognized fields, exit 0), a missing path (clear error + usage, exit 1), and --help
  • npm run actionlint / npm run test:workers / npm run build:mcp / npm run test:mcp-pack / npm audit / ui:* — not run locally; no workflow, worker-pool, MCP-package, or UI files touched. CI runs the full gate.

If any required check was skipped, explain why:

  • test:coverage/test:ci not run locally — scripts/** is Codecov-ignored per this repo's gate, and the one src/**-adjacent test file added has 100% of its own logic covered by the 3 new test cases (the CLI's main() is v8-ignored, matching the existing validate-observability-configs.mjs convention). CI runs the full gate.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed. (The validator itself already redacts supplied config values from its output; the CLI wrapper adds no new value-echoing.)
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/schema/MCP surface touched, this is a standalone dev-time CLI script.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (Deferred: none of this repo's sibling selfhost:* scripts are currently documented in README either; a README/self-host-docs mention is folded into the upcoming self-host config-docs issue (docs(selfhost): fill config/env doc gaps and reconcile checkRunDetailLevel default mismatch #2907) instead of duplicated here.)

Notes

  • Deliberately did not also add an API route in this PR — the issue allowed either a CLIor a route (or both), and a CLI is the better fit for a self-hoster validating a local file before deploying, without ballooning this PR's scope.

lintManifestText was a complete, tested manifest validator with zero
production callers -- no CLI, route, or boot check invoked it. Adds
scripts/gittensory-config-lint.ts (npm run selfhost:config-lint -- [path]) so
a self-hoster can actually run it against a real .gittensory.yml or
private-config file and get actionable, secret-redacted feedback.
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-04 05:27:43 UTC

3 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
This change wires the existing manifest linter into a runnable self-host CLI via `npm run selfhost:config-lint` and keeps the formatting logic small and test-covered. The diff is coherent with the PR description, the imports and script wiring are present in the full files, and the visible behavior exits non-zero when the validator reports warnings. The main remaining concerns are CLI polish rather than correctness defects.

Nits — 7 non-blocking
  • nit: `scripts/gittensory-config-lint.ts:2` has a long issue-narrative comment in executable code; this would be easier to maintain as a short purpose comment or in docs/PR history.
  • nit: `scripts/gittensory-config-lint.ts:29` silently ignores extra positional arguments, so `npm run selfhost:config-lint -- a.yml b.yml` lints only `a.yml` without telling the user.
  • nit: `scripts/gittensory-config-lint.ts:35` handles missing paths but lets read failures such as directories or permissions throw a raw stack trace instead of the CLI-style error used for missing files.
  • In `scripts/gittensory-config-lint.ts:29`, reject `args.length > 1` with usage output so accidental extra paths do not get ignored.
  • In `scripts/gittensory-config-lint.ts:35`, wrap `readFileSync` in a small `try/catch` and print `gittensory-config-lint: cannot read file: ${path}` before exiting 1.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2906
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 60 registered-repo PR(s), 51 merged, 436 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 60 PR(s), 436 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: Python, TypeScript, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 60 PR(s), 436 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • No action.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 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.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.05%. Comparing base (3b068f9) to head (fa0e74b).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2923   +/-   ##
=======================================
  Coverage   96.05%   96.05%           
=======================================
  Files         258      258           
  Lines       28423    28423           
  Branches    10341    10341           
=======================================
  Hits        27301    27301           
  Misses        489      489           
  Partials      633      633           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit b469e5a into main Jul 4, 2026
11 checks passed
@JSONbored
JSONbored deleted the claude/wire-config-lint-2906 branch July 4, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(selfhost): wire up or retire the unwired config-lint.ts manifest validator

1 participant