Skip to content

feat(config): validate .gittensory.yml against schema (fail clearly pre-review) - #3823

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
philluiz2323:feat/manifest-validation-notice-2056
Jul 6, 2026
Merged

feat(config): validate .gittensory.yml against schema (fail clearly pre-review)#3823
JSONbored merged 1 commit into
JSONbored:mainfrom
philluiz2323:feat/manifest-validation-notice-2056

Conversation

@philluiz2323

Copy link
Copy Markdown
Contributor

Summary

  • Adds an explicit manifest-validation surface: every parseFocusManifest parse warning (an unrecognized field, a malformed value that got dropped) is now collected into a single grouped, deduped "Manifest validation" collapsible in the unified PR review comment, so an invalid .gittensory.yml value fails clearly instead of silently falling back to a default.
  • Reuses the warnings every parser already accumulates (FocusManifest.warnings) — no parallel schema.
  • Always on; not a new config knob. A fully valid manifest produces zero warnings, so the section is omitted entirely (byte-identical to today).
  • Rendered ahead of every other content-shape collapsible (Changed files, Finding categories, etc.), since a config problem is more foundational than what changed in the PR.

Closes #2056.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint (not run locally; change touches no workflow files)
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp (not run locally; change touches no MCP server/CLI code)
  • npm run test:mcp-pack (not run locally; change touches no MCP server/CLI code)
  • npm run ui:openapi:check / ui:openapi:settings-parity spot-checked (no API/OpenAPI/settings-schema surface touched)
  • npm run ui:lint (not run locally; change touches no apps/gittensory-ui files)
  • npm run ui:typecheck (not run locally; change touches no apps/gittensory-ui files)
  • npm run ui:build (not run locally; change touches no apps/gittensory-ui files)
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • The skipped checks above (actionlint, build:mcp/test:mcp-pack, ui:*) have zero surface overlap with this diff, which only touches src/signals/focus-manifest.ts, src/review/unified-comment-bridge.ts, src/queue/processors.ts, .gittensory.yml.example + config/examples/gittensory.full.yml (kept byte-identical from the WHERE IT LIVES marker onward, verified via test/unit/config-templates.test.ts), and their unit tests — no workflow, MCP, or UI files changed. docs:drift-check was run directly and passes.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • 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 — no such surface touched.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/OpenAPI/MCP surface touched.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Visible UI changes include a UI Evidence section... (N/A — this only changes GitHub PR-comment markdown, not apps/gittensory-ui.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (.gittensory.yml.example + config/examples/gittensory.full.yml updated; no changelog touched.)

UI Evidence

N/A — this PR only changes deterministic markdown rendering of the GitHub PR review comment (src/review/unified-comment-bridge.ts), not apps/gittensory-ui. No visible web UI surface changed.

Notes

  • Traced two existing analogues before implementing: buildChangedFilesSummaryCollapsible (the collapsible-builder pattern in src/review/unified-comment-bridge.ts, including its own dedicated test file convention) and the already-loaded FocusManifest object in src/queue/processors.ts (restructured one .review-only load into a full-manifest variable so .warnings is available at the comment-build site, without an extra fetch).
  • Unlike this repo's other recent review.* display knobs (max_findings, comment_verbosity), this feature is intentionally not gated behind a new .gittensory.yml key — the issue's acceptance criterion is that an invalid config fails clearly unconditionally, matching #1670's epic goal.

…re-review)

Surface every parseFocusManifest parse warning as a single grouped,
deduped "Manifest validation" collapsible in the unified PR review
comment, so an invalid or malformed .gittensory.yml value fails
clearly instead of silently falling back to a default. Reuses the
warnings every parser already accumulates (no parallel schema).
Always on, no new config knob; a fully valid manifest renders
byte-identically (no section).

Closes JSONbored#2056
@philluiz2323
philluiz2323 requested a review from JSONbored as a code owner July 6, 2026 12:55
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.41%. Comparing base (fd8b3da) to head (bb329dd).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3823   +/-   ##
=======================================
  Coverage   93.41%   93.41%           
=======================================
  Files         325      325           
  Lines       32844    32859   +15     
  Branches    12030    12035    +5     
=======================================
+ Hits        30680    30695   +15     
  Misses       1530     1530           
  Partials      634      634           
Files with missing lines Coverage Δ
src/queue/processors.ts 94.44% <100.00%> (+<0.01%) ⬆️
src/review/unified-comment-bridge.ts 99.48% <100.00%> (+0.01%) ⬆️
src/signals/focus-manifest.ts 99.13% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 6, 2026
@loopover-orb

loopover-orb Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-06 19:21:42 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR surfaces every FocusManifest parse warning into a new grouped, deduped "Manifest validation" collapsible in the unified PR comment, reusing the warnings each parser already accumulates rather than introducing a parallel schema. The wiring in unified-comment-bridge.ts correctly prepends the new collapsible ahead of extraCollapsibles/Changed files (verified by the added ordering test), and processors.ts now reuses the single already-loaded manifest object for both reviewConfig and manifestWarnings instead of discarding it after the .review access, avoiding a second load. formatManifestValidationNotice's trim+Set dedup and null-on-empty behavior are directly and thoroughly exercised by both new test files, and the byte-identical (no-section) case for a fully valid manifest is explicitly tested.

Nits — 5 non-blocking
  • src/review/unified-comment-bridge.ts: the `args.manifestWarnings && args.manifestWarnings.length > 0` guard before calling buildManifestValidationCollapsible is redundant since the function already returns null on an empty/blank array — could simplify to just call it and check the result.
  • src/queue/processors.ts: `repoFocusManifestForComment` is a verbose local name; something like `focusManifestForComment` or `manifestForComment` would read cleaner.
  • The doc comments in .gittensory.yml.example and config/examples/gittensory.full.yml are near-duplicated blocks — fine for now, but worth a shared source if these example files diverge further.
  • Consider whether warnings should be capped/truncated for manifests with a pathological number of malformed fields, to keep the collapsible readable, though this is speculative and not required now.
  • The magic issue-number references (feat(config): validate .gittensory.yml against schema (fail clearly pre-review) #2056) sprinkled through comments are fine as-is per repo convention; no change needed.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2056
Related work ⚠️ 1 scoped overlap Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High 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: 961 registered-repo PR(s), 557 merged, 107 issue(s).
Contributor context ✅ Confirmed Gittensor contributor philluiz2323; Gittensor profile; 961 PR(s), 107 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: philluiz2323
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Python, MDX, TypeScript, Cuda, HTML, Kotlin, Rust
  • Official Gittensor activity: 961 PR(s), 107 issue(s).
  • Related work: Titles/paths share 8 meaningful terms. (issue #2057, issue #2308)
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Check active issues and PRs before submitting.
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

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@JSONbored
JSONbored merged commit df6ba9a into JSONbored:main Jul 6, 2026
8 checks passed
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. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

feat(config): validate .gittensory.yml against schema (fail clearly pre-review)

2 participants