Skip to content

refactor(settings): converge 4 duplicated settings files onto their loopover-engine shims - #6201

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nghetienhiep:fix/issue-6194
Jul 15, 2026
Merged

refactor(settings): converge 4 duplicated settings files onto their loopover-engine shims#6201
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nghetienhiep:fix/issue-6194

Conversation

@nghetienhiep

Copy link
Copy Markdown
Contributor

What & why

src/settings/autonomy.ts, command-authorization.ts, contributor-blacklist.ts, and pr-type-label.ts were the last four hand-maintained twins of packages/loopover-engine/src/settings/* — byte-for-byte identical apart from the type-import path (../types vs ../types/manifest-deps-types.js). This converts them into thin re-export shims, matching the exact pattern #4879 already applied to auto-close-exempt.ts / moderation-rules.ts / global-contributor-cap.ts, so a future engine-side fix propagates automatically instead of silently drifting.

Verification of "import-path-only" before converting

Confirmed each of the four src/ copies differed from its engine counterpart by exactly one line — the import path — with no src/-side-only behavior (the audit assumption in the issue held). No pending bug-fix (the contributor-blacklist bot-login regex / agent-actions login-parsing work referenced in the issue) has landed in the src/ copy, so nothing is lost by re-exporting the canonical engine implementation.

Behavior preservation

  • All existing tests for the four files pass unchanged (they import through src/settings/*, which the shims re-export in full): autonomy, command-authorization, contributor-blacklist, pr-type-label (+ their -engine suites) and downstream consumers (focus-manifest, settings-preview, config-templates).
  • tsc --noEmit is clean across all consumers.
  • engine-parity:drift-check passes (16 pairs agree); the discovered in-scope twin count drops from 15 → 11, so the check-engine-parity-script regression guard's coarse floor is lowered 14 → 10 (margin preserved; the .some() structural assertions remain the real guard). No settings file remains a hand-duplicated copy.

Coverage

The export * shim lines are non-instrumented (LF:0), identical to the already-merged #4879 shims, so there are no coverable changed lines in src/ to drag down codecov/patch. The only other changed file is a test (codecov ignores test/**).

Closes #6194

…oopover-engine shims

autonomy.ts, command-authorization.ts, contributor-blacklist.ts and
pr-type-label.ts were the last four hand-maintained twins of
packages/loopover-engine/src/settings/* — identical apart from the type-import
path. Convert them into thin re-export shims, matching the JSONbored#4879 pattern already
applied to auto-close-exempt / moderation-rules / global-contributor-cap, so an
engine-side fix propagates automatically instead of silently drifting.

The discovered in-scope twin count drops 15 -> 11, so the check-engine-parity
regression guard's coarse floor is lowered 14 -> 10 (its .some() structural
assertions remain the real guard). Existing tests for all four files pass
unchanged.

Closes JSONbored#6194
@nghetienhiep
nghetienhiep requested a review from JSONbored as a code owner July 15, 2026 21:21
@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.32%. Comparing base (653b621) to head (23dd84f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6201      +/-   ##
==========================================
- Coverage   95.34%   95.32%   -0.02%     
==========================================
  Files         600      596       -4     
  Lines       47308    47091     -217     
  Branches    15085    15010      -75     
==========================================
- Hits        45105    44889     -216     
  Misses       1477     1477              
+ Partials      726      725       -1     
Flag Coverage Δ
shard-1 43.97% <ø> (+0.09%) ⬆️
shard-2 36.69% <ø> (+0.22%) ⬆️
shard-3 32.16% <ø> (+0.07%) ⬆️
shard-4 33.95% <ø> (-0.10%) ⬇️
shard-5 31.70% <ø> (+0.06%) ⬆️
shard-6 45.31% <ø> (+0.05%) ⬆️

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

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x 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 21:28:50 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR replaces the four remaining hand-duplicated settings files (autonomy, command-authorization, contributor-blacklist, pr-type-label) with thin `export *` re-export shims pointing at the byte-identical `packages/loopover-engine/src/settings/*` implementations, following the exact pattern already merged in #4879. The relative path `../../packages/loopover-engine/src/settings/X` correctly resolves from `src/settings/` to the package root, and the engine copy of autonomy.ts shown in context confirms the two files differ only by the type-import path, supporting the 'import-path-only' claim. The test-floor adjustment in check-engine-parity-script.test.ts (14→10) is consistent with converging 4 more twins, and the `.some()` structural assertions remain in place as the real regression guard.

Nits — 4 non-blocking
  • pr-type-label.ts's original file had an explicit `export type { PrTypeLabelSet } from "../types";` re-export; confirm the engine module's own `export *` surface still exposes this type name identically so downstream consumers importing `PrTypeLabelSet` from `src/settings/pr-type-label` don't break.
  • command-authorization.ts's engine counterpart presumably imports from `../types/manifest-deps-types.js` per the stated pattern — worth double-checking that `RepositoryCommandAuthorizationPolicy`/`CommandAuthorizationRole` are structurally identical to the old `../types` versions, since `export *` re-exports whatever the engine module currently defines, not what `src/types.ts` defines.
  • Consider adding a one-line comment or lint rule preventing anyone from re-adding real logic to these shim files, since nothing currently stops future contributors from partially reintroducing a hand-maintained twin.
  • If not already done, verify `tsc --noEmit` and the full test suite were actually run post-conversion for `contributor-blacklist.ts` and `pr-type-label.ts` specifically, since their engine-source line counts (91/182 removed) are the largest and most likely to hide a subtle type-export mismatch.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #6194
Related work ⚠️ 3 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: 90 registered-repo PR(s), 48 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor nghetienhiep; Gittensor profile; 90 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
All four target files (autonomy.ts, command-authorization.ts, contributor-blacklist.ts, pr-type-label.ts) are converted into thin re-export shims pointing at packages/loopover-engine/src/settings/*, matching the #4879 shim pattern exactly as required, and the accompanying regression-guard test is updated to reflect the new twin count.

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 74a79be into JSONbored:main Jul 15, 2026
15 checks passed
loopover-orb Bot pushed a commit that referenced this pull request Jul 15, 2026
…6233)

contributor-blacklist's GITHUB_LOGIN pattern rejected any login ending in
[bot], so a maintainer configuring
settings.contributorBlacklist: [{login: "evilbot[bot]"}] got it silently
dropped with a generic 'not a valid GitHub login' warning — even though
bot accounts are a documented abuse vector and the sibling
auto-close-exempt.ts already accepts the same [bot] App-actor shape for
exemptions.

Extend GITHUB_LOGIN with the same optional (?:\[bot\])? suffix
auto-close-exempt.ts uses. The implementation lives in the
@loopover/engine copy (the src/ file is now a re-export shim after #6201),
so the single edit covers both surfaces. Malformed bot-ish logins (bare
[bot], doubled suffix, wrong-case, mid-string brackets) are still dropped.
Regression tests in both suites assert a blacklisted something[bot] author
is actually matched by isAuthorBlacklisted.

Closes #6190

Co-authored-by: jaytbarimbao-collab <300663773+jaytbarimbao-collab@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

1 participant