Skip to content

fix(config): warn on unknown top-level fields in the focus-manifest validator - #6075

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:fix-focus-manifest-unknown-fields
Jul 15, 2026
Merged

fix(config): warn on unknown top-level fields in the focus-manifest validator#6075
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:fix-focus-manifest-unknown-fields

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

Fixes #5929.

buildFocusManifestValidation (behind the loopover_validate_config MCP tool and POST /v1/validate/focus-manifest, i.e. loopover-mcp validate-config) read only known fields off the parsed manifest, so a typo'd top-level block — e.g. gates: instead of gate:, or preferedLabels: for preferredLabels: — was silently dropped with status: "ok" and zero warnings. The selfhost config-lint validator already flags these.

Reuses config-lint's unknownTopLevelWarnings() (now exported) so both validators share one TOP_LEVEL_FIELDS allowlist + retired-field migration handling, and wires its warnings into the focus-manifest validator. Adds a test (typo'd gates:warn + "unknown top-level field"; clean manifest unaffected). 100% branch coverage on the changed file; config-lint tests still green; typecheck clean.

…alidator

Fixes JSONbored#5929.

buildFocusManifestValidation (behind loopover_validate_config / POST
/v1/validate/focus-manifest) read only known fields, so a typo'd top-level
block (e.g. `gates:` for `gate:`) was silently dropped with status "ok" and
zero warnings — unlike the selfhost config-lint validator, which flags it.
Reuses config-lint's unknownTopLevelWarnings() (now exported) so both
validators share one allowlist + retired-field handling, and adds a test.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.22%. Comparing base (d882f1a) to head (d81005b).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6075   +/-   ##
=======================================
  Coverage   95.22%   95.22%           
=======================================
  Files         595      595           
  Lines       46998    46998           
  Branches    15015    15015           
=======================================
  Hits        44756    44756           
  Misses       1493     1493           
  Partials      749      749           
Flag Coverage Δ
shard-1 43.96% <0.00%> (-0.06%) ⬇️
shard-2 36.56% <0.00%> (+0.07%) ⬆️
shard-3 31.96% <100.00%> (+0.01%) ⬆️
shard-4 33.78% <0.00%> (+0.76%) ⬆️
shard-5 31.46% <100.00%> (-0.04%) ⬇️
shard-6 44.71% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/selfhost/config-lint.ts 100.00% <ø> (ø)
src/services/focus-manifest-validation.ts 100.00% <100.00%> (ø)

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

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tip

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

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-15 08:28:45 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This wires the already-tested, now-exported `unknownTopLevelWarnings()` from `config-lint.ts` into `buildFocusManifestValidation`, so a typo'd top-level manifest key (e.g. `gates:`) now surfaces as a warning instead of being silently dropped with `status: "ok"`. The change is small, additive, and reuses an existing single source of truth (`TOP_LEVEL_FIELDS`) rather than duplicating the allowlist, which is the right layer for this fix. The added test exercises both the typo'd case and confirms a clean manifest is unaffected, matching the stated 100% branch coverage claim.

Nits — 3 non-blocking
  • src/services/focus-manifest-validation.ts:32 — worth confirming `unknownTopLevelWarnings` and `manifest.warnings` can't ever double-report the same unknown field if `parseFocusManifestContent` is later extended to do its own top-level checking, since nothing here dedupes the merged array.
  • The inline comment in focus-manifest-validation.ts is a bit long for a one-line addition; could trim to the essential 'matches config-lint, see fix(config): focus-manifest validator never warns on unknown top-level fields, unlike selfhost config-lint #5929' pointer.
  • Consider a shared test asserting `buildFocusManifestValidation` and `lintManifestText` produce identical unknown-field warnings for the same input, to lock in the 'one allowlist' guarantee going forward.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5929
Related work ⚠️ 2 scoped overlaps 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: 108 registered-repo PR(s), 53 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jaytbarimbao-collab; Gittensor profile; 108 PR(s), 4 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Partially addressed
The PR does add the missing unknown-top-level-field warning to buildFocusManifestValidation and includes a regression test, which addresses the core functional gap. However, it doesn't follow the issue's explicit extraction requirement to move unknownTopLevelWarnings/TOP_LEVEL_FIELDS into a shared module importable by both files (e.g. focus-manifest.ts) — instead it has the core validation service

Review context
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps in the Signals table above.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver 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.

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

@loopover-orb
loopover-orb Bot merged commit e3957da into JSONbored:main Jul 15, 2026
16 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(config): focus-manifest validator never warns on unknown top-level fields, unlike selfhost config-lint

1 participant