fix(api): block maintainer freeze override manifests - #4453
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4453 +/- ##
=======================================
Coverage 94.11% 94.11%
=======================================
Files 432 432
Lines 38348 38354 +6
Branches 13979 13981 +2
=======================================
+ Hits 36091 36097 +6
Misses 1600 1600
Partials 657 657
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-10 08:38:16 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | ac648b5 | Commit Preview URL Branch Preview URL |
Jul 10 2026, 08:26 AM |
…guards codecov/patch was failing at 85.71% -- only the "settings has the override key" happy path was tested. Adds cases for a non-object/array top-level body and a null/non-object/array/no-override-key settings value, so every OR-chain operand is independently exercised. Splits out the null-raw check (genuinely unreachable via the route's own prior 400-on-null-body guard) with a targeted v8-ignore rather than leaving it silently uncovered.
Motivation
settings.agentGlobalFreezeOverride(sourceapi_record) and thereby bypass the operator's DB-backed global agent freeze for that repo.Description
stripMaintainerFocusManifestSettings(raw)insrc/api/routes.tsto remove the operator-onlysettings.agentGlobalFreezeOverridefield from incoming maintainer PUT payloads before parsing/persisting.PUT /v1/repos/:owner/:repo/focus-manifesthandler so maintainer-supplied JSON is stripped of the operator-only override prior toupsertRepoFocusManifest(..., "api_record").test/unit/routes-focus-manifest.test.tsthat proves a repo owner with live GitHub write permission can set ordinary manifest settings such asagentDryRunwhile an attemptedagentGlobalFreezeOverride: trueis dropped and the DB-backed freeze remains effective.src/api/routes.tsandtest/unit/routes-focus-manifest.test.tsonly to minimally remediate the trust-boundary issue without changing settings resolution logic elsewhere.Testing
git diff --checkwith no problems.npx tsc --noEmitsucceeded.npm run build:minersucceeded.npx vitest run test/unit/routes-focus-manifest.test.tspassed (15 tests in the file all green).ast-v8-to-istanbul/jsTokens is not a functiontooling error (tests still passed); full repo coverage (npm run test:coverage) was not executed in this environment.Codex Task