feat(selfhost): per-repo feature config + all-authors AI review + RAG embed stack - #1555
Merged
Conversation
… 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).
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
| // 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)), |
Contributor
There was a problem hiding this comment.
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>
Closed
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>
12 tasks
This was referenced Jul 8, 2026
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reconciles bb90b64e onto main. Per-repo
features.{rag,reputation,unifiedComment,safety}overrides (manifest →GITTENSORY_REVIEW_REPOSallowlist default, byte-identical when unset), theaiReviewAllAuthorsopt-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.