Skip to content

Commit 869ae1a

Browse files
authored
Merge branch 'main' into codex/fix-vulnerability-in-guardrail-configuration
2 parents a063b7a + ddd7e51 commit 869ae1a

134 files changed

Lines changed: 8948 additions & 1688 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ REDIS_URL=redis://redis:6379 # REQUIRED for the self-host review
394394
# RUNNER_SCOPE=repo # repo | org | enterprise
395395
# RUNNER_NAME=gittensory-runner
396396
# RUNNER_LABELS=self-hosted,linux
397+
# RUNNER_MEM_LIMIT=2g # per-runner-container memory ceiling; raise for memory-heavy CI jobs
397398

398399
# --- Docker disk hygiene (#audit-rate-headroom / #selfhost-runtime-pressure) ---
399400
# Build cache and unused images accumulate fast on a box that builds from source or runs CI runners; a root

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ output/
1616
docker-compose.override.yml
1717
!docker-compose.override.yml.example
1818
*.local
19+
# Alertmanager receiver webhook files used by self-host local configs.
20+
alertmanager/*_url
21+
alertmanager/*_url_file
1922
# Private self-host operator config. Root AGENTS.md/CLAUDE.md are public project docs;
2023
# repo-scoped review instructions live under this ignored mount.
2124
gittensory-config/

.gittensory.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ gate:
3737
duplicates: block # block | advisory | off — block obvious duplicate PRs
3838
readiness:
3939
mode: advisory # advisory | off — readiness score is informational and never blocks the Gate
40-
minScore: 60
40+
minScore: 40 # lowered from 60: 73% false-positive rate showed PRs scoring 40-59 merge freely
4141
# aiReview: # opt-in AI maintainer review (off by default; needs the AI flags enabled)
4242
# mode: advisory # block | advisory | off — block only blocks on a dual-model consensus defect
4343
# byok: false # use a maintainer Anthropic/OpenAI key for the write-up; consensus stays on the free/default reviewer
@@ -55,6 +55,37 @@ gate:
5555
# relatedWork: false # linkedIssue | relatedWork | reviewLoad (Change scope) |
5656
# openPrQueue: false # validationEvidence (Validation posture) | openPrQueue (Contributor workload) | contributorContext | gateResult
5757

58+
# Linked-issue label propagation (#priority-linked-issue-gate, #priority-linked-issue-gate-ownership): a PR
59+
# that closes/fixes/resolves an issue inherits that issue's point-bearing gittensor:* label onto the PR
60+
# itself, instead of the PR's own label being decided purely by its commit-title prefix. bug/feature are
61+
# `trustMaintainerAuthoredIssue: true` (routine categorization, no reward at stake, and the title-based
62+
# fallback already has zero equivalent verification) so they propagate even when the PR author isn't a
63+
# formal GitHub assignee of the issue — our issues are almost always maintainer-authored for open pickup and
64+
# rarely formally assigned. priority intentionally omits the flag: it is the scarce, maintainer-hand-picked
65+
# reward label, and must still require the PR author to be the issue's actual author/assignee.
66+
#
67+
# Review-evasion protection: closing or converting-to-draft your OWN PR while gittensory has an active
68+
# review pass running, a prior recorded gate failure, or a repeated ready<->draft cycle on this PR, is
69+
# treated as dodging the one-shot review rather than an ordinary action (layered OVER the dashboard's
70+
# own default of "off").
71+
settings:
72+
linkedIssueLabelPropagation:
73+
enabled: true
74+
mode: exclusive_type_label
75+
mappings:
76+
- issueLabel: "gittensor:bug"
77+
prLabel: "gittensor:bug"
78+
removeOtherTypeLabels: true
79+
trustMaintainerAuthoredIssue: true
80+
- issueLabel: "gittensor:feature"
81+
prLabel: "gittensor:feature"
82+
removeOtherTypeLabels: true
83+
trustMaintainerAuthoredIssue: true
84+
- issueLabel: "gittensor:priority"
85+
prLabel: "gittensor:priority"
86+
removeOtherTypeLabels: true
87+
reviewEvasionProtection: close
88+
5889
# Repo-doc generation roadmap (#2993/#3002) — opt-in only, off by default. Uncomment to let Gittensory open a
5990
# PR generating AGENTS.md/CLAUDE.md from this repo's own profile.
6091
# repoDocGeneration:

.gittensory.yml.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,13 @@ gate:
342342
# Review output controls. These tune review output without changing the
343343
# deterministic gate policy above. Omit the block to keep the byte-identical
344344
# defaults.
345+
#
346+
# SELF-HOST ONLY (`review.shared_config`, #2046): when `GITTENSORY_REPO_CONFIG_DIR` is mounted,
347+
# place a shared review base at `${GITTENSORY_REPO_CONFIG_DIR}/_shared/.gittensory.yml` (see
348+
# `config/examples/shared.gittensory.yml`). Per-repo `review:` keys overlay it field-by-field —
349+
# repo value wins when set, shared fills gaps, defaults stay byte-identical. Absent shared base is
350+
# the common case and changes nothing. A malformed shared base warns and is ignored (never blocks a
351+
# review). The loader records provenance at runtime in `review.sharedConfigSource` (not a YAML key).
345352
review:
346353
# Deterministic AI review eligibility filters (`review.auto_review`, #1954 / #2038–#2065). Each knob quietly
347354
# skips the advisory AI review for matching PRs — never a gate failure. When the Orb review check is enabled,

apps/gittensory-ui/public/openapi.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8760,6 +8760,9 @@
87608760
},
87618761
"removeOtherTypeLabels": {
87628762
"type": "boolean"
8763+
},
8764+
"trustMaintainerAuthoredIssue": {
8765+
"type": "boolean"
87638766
}
87648767
},
87658768
"required": [
@@ -9085,13 +9088,15 @@
90859088
"type": "integer",
90869089
"nullable": true,
90879090
"minimum": 0,
9088-
"exclusiveMinimum": true
9091+
"exclusiveMinimum": true,
9092+
"maximum": 100
90899093
},
90909094
"contributorOpenIssueCap": {
90919095
"type": "integer",
90929096
"nullable": true,
90939097
"minimum": 0,
9094-
"exclusiveMinimum": true
9098+
"exclusiveMinimum": true,
9099+
"maximum": 100
90959100
},
90969101
"contributorCapLabel": {
90979102
"type": "string",

apps/gittensory-ui/src/routes/docs.tuning.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,11 @@ function Tuning() {
157157
<code>GITTENSORY_REVIEW_MEMORY</code> — repeat-false-positive suppression: matches an
158158
advisory (non-blocking) AI finding against this repo's stored suppression signals (a
159159
maintainer's own past false-positive dismissals) and demotes or drops it before the
160-
unified comment renders. Advisory-only by construction — never applied to gate blockers,
161-
so it can never change the merge/close disposition. Also requires the per-repo{" "}
162-
<code>review.memory: true</code> opt-in in <code>.gittensory.yml</code>. Per-PR.
160+
unified comment renders. A maintainer records a signal with{" "}
161+
<code>@gittensory resolve [finding-code]</code> (or a whole-PR{" "}
162+
<code>@gittensory resolve</code> ack). Advisory-only by construction — never applied to
163+
gate blockers, so it can never change the merge/close disposition. Also requires the
164+
per-repo <code>review.memory: true</code> opt-in in <code>.gittensory.yml</code>. Per-PR.
163165
</li>
164166
<li>
165167
<code>GITTENSORY_REVIEW_REPUTATION</code> — submitter-reputation spend control. A new,

config/examples/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ folded across one more layer; it is not a new merge algorithm.
162162
behavior is byte-identical to the pre-#1959 2-layer chain. A malformed or unreadable shared file
163163
fails safe exactly like a malformed per-repo or global file always has: it is dropped from the
164164
merge and the remaining, still-valid layers combine as if it were never mounted — a broken shared
165-
base never blocks a review.
165+
base never blocks a review. When a shared `review:` block contributes, the parsed manifest carries
166+
`review.sharedConfigSource` (runtime provenance only, #2046) with the relative path of the shared
167+
file that supplied the base layer.
166168

167169
### Example 4 — shared base + global default + a per-repo override, all three present
168170

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,15 @@ services:
809809
# /var/run/docker.sock grants container-escape risk and is intentionally omitted.
810810
volumes:
811811
- runner-work:/tmp/runner
812+
# A memory ceiling so a single runaway CI job can't exhaust host RAM and take down the app alongside
813+
# it (#3893) -- same universal-default treatment every other service in this file already has. This
814+
# is independent of the CPU-priority tuning above: that's host-specific (vCPU count, replica count)
815+
# and stays an opt-in docker-compose.override.yml pattern, but a memory cap needs no host-specific
816+
# sizing to be a safe default.
817+
deploy:
818+
resources:
819+
limits:
820+
memory: "${RUNNER_MEM_LIMIT:-2g}"
812821

813822
# ── Backups (--profile backup) ────────────────────────────────────────────
814823
# Active database backup (Postgres pg_dump or WAL-safe SQLite online backup) + a Qdrant snapshot, on a loop

grafana/dashboards/gittensory.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,6 +3059,41 @@
30593059
"legendFormat": "skew"
30603060
}
30613061
]
3062+
},
3063+
{
3064+
"datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
3065+
"fieldConfig": {
3066+
"defaults": {
3067+
"color": { "mode": "thresholds" },
3068+
"thresholds": {
3069+
"mode": "absolute",
3070+
"steps": [
3071+
{ "color": "green", "value": null },
3072+
{ "color": "yellow", "value": 1 }
3073+
]
3074+
},
3075+
"unit": "short"
3076+
}
3077+
},
3078+
"gridPos": { "h": 4, "w": 4, "x": 0, "y": 209 },
3079+
"id": 161,
3080+
"options": {
3081+
"colorMode": "background",
3082+
"graphMode": "none",
3083+
"justifyMode": "auto",
3084+
"orientation": "auto",
3085+
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
3086+
"textMode": "auto"
3087+
},
3088+
"title": "Review-Floor Bypass Attempts (total, #3901)",
3089+
"type": "stat",
3090+
"targets": [
3091+
{
3092+
"datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
3093+
"expr": "gittensory_ai_review_onmerge_clamped_total or vector(0)",
3094+
"legendFormat": "clamped"
3095+
}
3096+
]
30623097
}
30633098
],
30643099
"refresh": "30s",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Review-evasion: repeated ready<->draft cycling (#gaming-tactic-draft-cycle). A contributor converting their
2+
-- OWN PR to draft more than once is using draft state as a repeated shield to harvest AI-review/CI feedback
3+
-- for free while dodging the one-shot disposition. Counts every converted_to_draft webhook ever processed for
4+
-- this PR NUMBER (not scoped to head SHA -- a new commit between draft cycles is still the same evasion shape).
5+
ALTER TABLE pull_requests ADD COLUMN draft_conversion_count INTEGER NOT NULL DEFAULT 0;

0 commit comments

Comments
 (0)