fix(miner): clamp repo AMS policy defaults#5499
Conversation
|
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 | 3e030a7 | Commit Preview URL Branch Preview URL |
Jul 12 2026, 11:13 PM |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 23:39:13 UTC
⏸️ Suggested Action - Manual Review Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agent
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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.
|
|
Closing: this reverts deliberate, same-day work rather than fixing a live gap. The vulnerability this targets (a target-repo This PR's diff is built against a pre-#5351 snapshot and reintroduces the fetch/clamp machinery that fix deliberately deleted — merging it would be a functional regression to a strictly weaker mitigation (clamping repo-provided values) for a threat model #5351 already closed off entirely (never trusting repo-provided values at all). Its CONFLICTING mergeable state against main reflects exactly this: main no longer has the symbols this diff's hunks reference. |
Motivation
.gittensory-ams.ymlcontent; repo-controlled values must not be allowed to enable live submission or raise resource caps above operator-safe defaults.Description
clampRepoAmsPolicySpecand helpers (SLOP_THRESHOLD_RANK,clampNumberToDefault) and applying it to repo fallbacks inresolveAmsPolicyinpackages/gittensory-miner/lib/ams-policy.js.test/unit/miner-ams-policy.test.tsthat assert permissive repo policies are clamped, restrictive repo policies are allowed, and local files still fully replace repo content.Testing
npx vitest run test/unit/miner-ams-policy.test.ts --pool=forks --reporter=verboseand all tests in that file passed (10/10).npm run build:minerandgit diff --checkcompleted successfully in this environment.npm run test:cibut the run could not complete due to an environment/registry issue (worker-configuration.d.tsdrift requiringnpm run cf-typegenandnpm auditfailing with a registry403 Forbidden).Codex Task