Skip to content

feat(selfhost): per-repo feature config + all-authors AI review + RAG embed stack - #1555

Merged
JSONbored merged 1 commit into
mainfrom
chore/reconcile-features
Jun 26, 2026
Merged

feat(selfhost): per-repo feature config + all-authors AI review + RAG embed stack#1555
JSONbored merged 1 commit into
mainfrom
chore/reconcile-features

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Reconciles bb90b64e onto main. Per-repo features.{rag,reputation,unifiedComment,safety} overrides (manifest → GITTENSORY_REVIEW_REPOS allowlist default, byte-identical when unset), the aiReviewAllAuthors opt-in, and a dedicated RAG embed provider (AI_EMBED_BASE_URL).

Resolution: kept main's #1462 AI-review cache + #1425 blacklist + inline-comments on the review path; dropped the batch's head-SHA dedup as superseded by #1462. Migration renumbered 0072→0075. Verified by an adversarial multi-agent review (6 findings, all fixed) + full suite (4733) + 100% patch coverage on measured files. Final batch piece.

… embed stack

Reconciles bb90b64e onto current main. Per-repo `features.{rag,reputation,unifiedComment,safety}`
overrides (manifest → GITTENSORY_REVIEW_REPOS allowlist default, byte-identical when unset), the
`aiReviewAllAuthors` opt-in (review every author, not only confirmed contributors), and a dedicated
RAG embed provider (AI_EMBED_BASE_URL) so the review chain stays frontier-only.

Resolution notes: KEPT main's #1462 AI-review cache, #1425 contributor blacklist, and inline-comments
on the review path; DROPPED the batch's head-SHA dedup (ai-review-dedup) as superseded by #1462.
Migration renumbered 0072→0075 (0072 was taken by contributor_blacklist on main).
@dosubot dosubot Bot added the size:L label Jun 26, 2026
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.42%. Comparing base (9e1c351) to head (24ab6af).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1555      +/-   ##
==========================================
+ Coverage   95.38%   95.42%   +0.04%     
==========================================
  Files         201      202       +1     
  Lines       21598    21672      +74     
  Branches     7807     7831      +24     
==========================================
+ Hits        20601    20681      +80     
  Misses        416      416              
+ Partials      581      575       -6     
Files with missing lines Coverage Δ
src/api/routes.ts 94.62% <100.00%> (+0.02%) ⬆️
src/db/repositories.ts 96.12% <100.00%> (+<0.01%) ⬆️
src/db/schema.ts 68.32% <ø> (ø)
src/queue/processors.ts 87.61% <100.00%> (+0.18%) ⬆️
src/review/adapters.ts 93.75% <100.00%> (+0.41%) ⬆️
src/review/cutover-gate.ts 100.00% <100.00%> (ø)
src/review/feature-activation.ts 100.00% <100.00%> (ø)
src/selfhost/ai.ts 99.36% <100.00%> (+0.02%) ⬆️
src/selfhost/private-config.ts 100.00% <100.00%> (ø)
src/services/ai-review.ts 98.55% <100.00%> (ø)
... and 3 more
🚀 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 2909063 into main Jun 26, 2026
18 of 19 checks passed
@JSONbored
JSONbored deleted the chore/reconcile-features branch June 26, 2026 22:51
// 1. owner-qualified folder — `{owner}__{repo}/.gittensory.{yml,yaml,json}`
...CONFIG_BASENAMES.map((base) => join(slug, base)),
// 2. bare repo-name folder — `{repo}/.gittensory.{yml,yaml,json}`
...CONFIG_BASENAMES.map((base) => join(repo, base)),

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.

P1: Path traversal in local manifest reader via unsanitized repo name segments

Unsanitized repoFullName substrings are passed to path.join, allowing directory traversal outside the intended config directory.

Sanitize owner and repo components before using them in filesystem paths, rejecting path traversal sequences.

AI prompt
Check if this security scanner issue is valid. If so, understand the root cause and fix it. If appropriate, update or add tests. Keep the change focused and preserve intended behavior.

<file name="src/selfhost/private-config.ts">
<violation number="1" location="src/selfhost/private-config.ts:42">
<priority>P1</priority>
<title>Path traversal in local manifest reader via unsanitized repo name segments</title>
<evidence>In localConfigCandidates, the repo variable from repoFullName.slice(slash + 1) is passed directly to path.join(...). A malicious repoFullName like "a/../../../etc/passwd" produces candidates such as "../../../etc/passwd/.gittensory.yml", which path.join resolves outside the intended GITTENSORY_REPO_CONFIG_DIR when makeLocalManifestReader later joins it with the base directory. This allows reading arbitrary .yml/.yaml/.json files on the filesystem if the repoFullName can be attacker-controlled.</evidence>
<recommendation>Sanitize the owner and repo segments extracted from repoFullName in localConfigCandidates before using them in path components. Reject any segment containing path traversal sequences (e.g., ".." or path separators). Consider validating each component against /^[a-z0-9_.-]+$/ (GitHub naming rules) and returning an empty candidate list for invalid inputs. Add unit tests covering path traversal payloads.</recommendation>
</violation>
</file>

@superagent-security superagent-security Bot added the pr:flagged PR flagged for review by security analysis. label Jun 26, 2026
JSONbored added a commit that referenced this pull request Jun 27, 2026
JSONbored added a commit that referenced this pull request Jun 27, 2026
#1393)

* fix(orb): bind enrollment admin checks to account ids

* fix(migrations): renumber orb account_id migration to 0077 (resolve 0075/0076 collision with #1555/#1556)
@github-actions github-actions Bot mentioned this pull request Jun 27, 2026
12 tasks
tmimmanuel added a commit to tmimmanuel/gittensory that referenced this pull request Jun 28, 2026
Main added 0075_ai_review_all_authors.sql (JSONbored#1555) before this PR landed, so
the original 0075_global_contributor_blacklist.sql collides with it. The
db:migrations:check step in the CI lint job fails on the duplicate. Rename
to 0082 (next free number) so both migrations can coexist.
JSONbored added a commit that referenced this pull request Jun 28, 2026
* Add shared/global contributor blacklist and settings merge

* test: cover global blacklist fallback and row-missing paths

* fix(db): renumber the global contributor blacklist migration to 0082

Main added 0075_ai_review_all_authors.sql (#1555) before this PR landed, so
the original 0075_global_contributor_blacklist.sql collides with it. The
db:migrations:check step in the CI lint job fails on the duplicate. Rename
to 0082 (next free number) so both migrations can coexist.

---------

Co-authored-by: Tyler Thomas <tylerthomas62239@gmail.com>
Co-authored-by: ghost <49853598+JSONbored@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:flagged PR flagged for review by security analysis.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant