Skip to content

docs(miner): document and test .gittensory-miner.yml config precedence (#5198) - #5500

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
RealDiligent:feat/config-precedence-5198
Jul 12, 2026
Merged

docs(miner): document and test .gittensory-miner.yml config precedence (#5198)#5500
JSONbored merged 2 commits into
JSONbored:mainfrom
RealDiligent:feat/config-precedence-5198

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Add \docs/config-precedence.md\ documenting the actual yml vs \GITTENSORY_MINER_/\MINER_\ env vs CLI precedence for kill-switch, governor live mode, coding-agent mode, and discover forge settings.
  • Add \lib/config-precedence.js\ thin wrappers + \ est/unit/miner-config-precedence.test.ts\ pinning resolver behavior (three-source discover token env, two-source fallbacks, production call-site invariants).
  • Cross-link from miner README.

Closes #5198

Test plan


  • pm test -- test/unit/miner-config-precedence.test.ts\ (15 tests green locally)
  • CI validate-code + validate-tests shards

Made with Cursor

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 12, 2026 23:18
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

Pin down the actual yml vs env vs CLI resolution order for kill-switch, governor live mode, coding-agent mode, and discover forge settings so future changes cannot silently drift precedence.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.75%. Comparing base (c533294) to head (6aac6ef).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5500   +/-   ##
=======================================
  Coverage   94.75%   94.75%           
=======================================
  Files         564      565    +1     
  Lines       44894    44903    +9     
  Branches    14673    14673           
=======================================
+ Hits        42538    42547    +9     
  Misses       1621     1621           
  Partials      735      735           
Flag Coverage Δ
shard-1 43.79% <0.00%> (-0.51%) ⬇️
shard-2 35.40% <0.00%> (+0.04%) ⬆️
shard-3 32.14% <0.00%> (+0.12%) ⬆️
shard-4 31.21% <0.00%> (-0.69%) ⬇️
shard-5 33.32% <100.00%> (+0.61%) ⬆️
shard-6 43.78% <0.00%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/gittensory-miner/lib/config-precedence.js 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Cursor <cursoragent@cursor.com>
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-12 23:38:50 UTC

5 files · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a docs+test PR that adds thin wrapper functions in config-precedence.js re-exporting existing engine resolvers (resolveMinerKillSwitch, resolveMinerActionMode, resolveCodingAgentExecutionMode) plus a documented markdown precedence table and a 15-test vitest suite, including two 'invariant' tests that assert the documented wrappers match the real attempt-cli/discover-cli production call sites. It introduces no new precedence logic — it's read-only documentation of existing behavior — and closes issue #5198 as required. The wrapper logic for kill-switch/governor/coding-agent modes correctly forwards to the existing engine functions with no transformation errors visible in the diff.

Nits — 5 non-blocking
  • config-precedence.d.ts and config-precedence.js are hand-maintained in parallel with no build step shown enforcing they stay in sync — consider generating the .d.ts or adding a type-check test that imports both.
  • The 'canary' test block duplicates assertions already covered by the earlier describe blocks (e.g. 'does not treat absent CLI --live as live' repeats the 'CLI --live absent defaults to dry_run' case) — consider merging to avoid redundant coverage.
  • docs/config-precedence.md is a static snapshot with a fragile self-maintenance note ('If a future change adds yml or CLI for a setting documented here as env-only, update this file') — there's no automated check enforcing this, unlike env-reference.md's generated regeneration script.
  • Consider wiring a coverage check or lint rule to catch drift between config-precedence.d.ts and config-precedence.js signatures.
  • The invariant tests (lines 96-119) are the most valuable part of this PR — consider extending that pattern to governor action mode and kill-switch scope against their real production call sites too, since only coding-agent mode and discover token-env currently get call-site parity tests.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #5198
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 0 registered-repo PR(s), 0 merged, 0 issue(s).
Contributor context ❌ No public Gittensor match RealDiligent; not a blocker.
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: minor — The PR adds valuable documentation and pins existing resolver behavior with tests but introduces zero new production logic, so it consolidates understanding rather than moving functionality forward.
Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Contributor context: Public profile only; not a blocker.
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask 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.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

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.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 12, 2026
@JSONbored
JSONbored merged commit 97476d9 into JSONbored:main Jul 12, 2026
16 checks passed
JSONbored added a commit that referenced this pull request Jul 12, 2026
…ITCH (#5510)

#5198/#5500 added the env.GITTENSORY_MINER_KILL_SWITCH read in
lib/config-precedence.js without regenerating this generated doc,
so npm run miner:env-reference:check has been failing on main since.
JSONbored added a commit that referenced this pull request Jul 13, 2026
…me.storage.sync (#5511)

#5343 removed the discoveryIndexUrl UI field and stopped reading/writing
it, but chrome.storage.sync.set only merges keys -- it never deletes ones
an earlier extension version already synced. Without an active purge, a
value synced before #5343 stays in a user's account indefinitely, which
is a real privacy/data-retention gap #5343 didn't close.

Add removeLegacyDiscoveryIndexUrl(), called from refreshSettings() (which
runs on every options-page load and again at the end of every save), so
any stale value is cleared regardless of which path a user hits first.
Extends the existing dead-field regression test with coverage for the
purge on both load and save.

Also regenerates packages/gittensory-miner/docs/env-reference.md, which
was already stale on main (GITTENSORY_MINER_KILL_SWITCH from #5198/#5500
was never regenerated in) -- unrelated to this fix but required for
miner:env-reference:check to pass in this PR's own CI; also fixed
standalone in #5507.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document and test .gittensory-miner.yml config precedence against MINER_* env vars and CLI flags

2 participants