feat(selfhost): add container-private per-repo config dir - #1390
Merged
Conversation
A self-host operator could only configure per-repo review policy via the
repo's public .gittensory.yml, which contributors can read — and whoever can
see the gate thresholds, autonomy, or label policy can game them. Add
GITTENSORY_REPO_CONFIG_DIR: when set, the focus-manifest loader reads a mounted
{owner}__{repo}.{yml,yaml,json} INSTEAD of fetching the public file, so policy
stays private and never appears in contributor-facing previews. The reader is a
Node-only closure injected at boot via setLocalManifestReader, keeping the
shared loader Workers-safe; unset ⇒ byte-identical public-fetch behavior.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1390 +/- ##
=======================================
Coverage 95.33% 95.33%
=======================================
Files 191 192 +1
Lines 20734 20750 +16
Branches 7495 7500 +5
=======================================
+ Hits 19767 19783 +16
Misses 383 383
Partials 584 584
🚀 New features to boost your workflow:
|
Closed
12 tasks
4 tasks
This was referenced Jul 2, 2026
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.
Summary
A self-host operator could only set per-repo review policy via the repo's public
.gittensory.yml— which contributors can read, and whoever can see the gate thresholds, autonomy, or label policy can game them. This adds a private alternative that lives in the container.GITTENSORY_REPO_CONFIG_DIR— mount a dir and drop one{owner}__{repo}.{yml,yaml,json}per repo (lowercased slug,/→__, e.g.jsonbored__metagraphed.yml). When a file exists for a repo, the focus-manifest loader reads it instead of fetching the public.gittensory.yml.api_record(which the existing public-only preview path already excludes), and never persisted — so it can't leak into contributor-facing previews or the snapshot cache.setLocalManifestReader(server.ts); the shared loader never importsnode:fs. Unset dir ⇒nullreader ⇒ byte-identical public-fetch behavior (cloud unaffected).No issue linked — self-host hardening surfaced while bringing the brokered self-host online; lets metagraphed's gate/autonomy/labels be configured privately.
Scope
src/selfhost/private-config.ts(new) — Node-only{owner}__{repo}reader over the config dirsrc/signals/focus-manifest-loader.ts—setLocalManifestReaderhook + the private-first branch (Workers-safe)src/server.ts— register the reader at boot fromGITTENSORY_REPO_CONFIG_DIRsrc/env.d.ts,docs/self-hosting.md— document the vartest/unit/private-config.test.ts(new) +test/unit/focus-manifest-loader.test.ts— reader + loader-branch coverageValidation
npm run test:ci— green (4433 passed; typecheck, coverage, workers, mcp, ui:*)private-config.ts100% branch (8/8); loader private-branch covered (prefers reader, falls through on null, skips on publicOnly). The publicOnly-preview test asserts the private reader is never consulted.Safety
node:fsis confined to the self-host Node entry (server.tsalready importsnode:fs); the shared loader stays Workers-safe via injection.GITTENSORY_REPO_CONFIG_DIR⇒ no behavior change; cloud is byte-identical.