Skip to content

feat(miner-hands): add shared subprocess redaction/env-allowlist helper to gittensory-engine (#4284) - #4442

Closed
nickmopen wants to merge 1 commit into
JSONbored:mainfrom
nickmopen:feat/engine-subprocess-env-helper
Closed

feat(miner-hands): add shared subprocess redaction/env-allowlist helper to gittensory-engine (#4284)#4442
nickmopen wants to merge 1 commit into
JSONbored:mainfrom
nickmopen:feat/engine-subprocess-env-helper

Conversation

@nickmopen

Copy link
Copy Markdown
Contributor

Closes #4284.

Promotes the review-CLI subprocess safety pattern — a strict allowlisted child env + secret redaction — out of src/selfhost/ai.ts into @jsonbored/gittensory-engine, so the coming gittensory-miner coding-agent drivers depend on one source of truth instead of copy-pasting it (the drift risk #2353's Phase 7 note flags).

What's here

  • packages/gittensory-engine/src/subprocess-env.ts
    • SUBPROCESS_CLI_ENV_ALLOWLIST — the standard home/proxy/TLS/locale/XDG list.
    • buildAllowlistedEnv(parent, allowlist, extra)parameterized (a caller passes its own allowlist — a coding-agent driver may need a larger one — not hardcoded); drops undefined, extra overlays.
    • SECRET_PATTERNS (OpenAI/Anthropic, GitHub PAT + fine-grained, JWT, AWS — ported verbatim, not weakened) + redactSecrets(text, knownSecrets).
    • Re-exported from the engine barrel.
  • src/selfhost/ai.ts — migration story documented (the issue requires a deliberate choice): its copy is kept parallel for now (its subscriptionCliEnv also folds in CLI-specific PATH resolution), with a cross-reference comment to the shared helper — shim later if it drifts, like predicted-gate.ts. No behavior change.

Validation

  • Engine node:test: 324/324 pass (incl. the new parameterized-allowlist + every-SECRET_PATTERNS-family + known-secret-length-guard tests).
  • App typecheck clean; full suite:
Test Files  641 passed | 2 skipped (643)
     Tests  12674 passed | 12 skipped   (0 failed)

…er to gittensory-engine (JSONbored#4284)

Promotes the review-CLI subprocess safety pattern (a strict allowlisted child env +
secret redaction) out of src/selfhost/ai.ts into the engine, so the coming
gittensory-miner coding-agent drivers depend on one source of truth instead of
copy-pasting it.

- packages/gittensory-engine/src/subprocess-env.ts: SUBPROCESS_CLI_ENV_ALLOWLIST (the
  standard list) + a PARAMETERIZED buildAllowlistedEnv(parent, allowlist, extra) (a
  caller can pass a different/larger allowlist — not hardcoded), plus SECRET_PATTERNS
  (OpenAI/Anthropic, GitHub PAT/fine-grained, JWT, AWS — ported verbatim, not weakened)
  and redactSecrets(text, knownSecrets). Re-exported from the engine barrel.
- src/selfhost/ai.ts: migration story documented — its copy is deliberately kept
  PARALLEL for now (its subscriptionCliEnv also folds in CLI-specific PATH resolution),
  with a cross-reference comment to the shared engine helper (shim later if it drifts,
  like predicted-gate.ts). No behavior change to ai.ts.
- Tests (node:test): parameterized allowlist honored + extra/undefined handling; every
  SECRET_PATTERNS family redacted + the known-secret length guard.

Verified: engine 324/324 pass; app typecheck clean; full suite 12674 passed, 0 failed.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.50000% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.92%. Comparing base (564a27c) to head (eaea6c9).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
packages/gittensory-engine/src/subprocess-env.ts 12.50% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4442      +/-   ##
==========================================
- Coverage   93.95%   93.92%   -0.04%     
==========================================
  Files         412      413       +1     
  Lines       37212    37228      +16     
  Branches    13591    13595       +4     
==========================================
+ Hits        34963    34965       +2     
- Misses       1594     1608      +14     
  Partials      655      655              
Files with missing lines Coverage Δ
src/selfhost/ai.ts 98.65% <ø> (ø)
packages/gittensory-engine/src/subprocess-env.ts 12.50% <12.50%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-09 18:59:43 UTC

4 files · 1 blocker · readiness 100/100 · CI failing · unstable

🛑 Suggested Action - Reject/Close

  • AI review already in progress for this PR head: Another Gittensory pass is already running the AI review for this exact PR head. This pass is skipping to avoid a duplicate LLM call.

Review summary
AI review is already running for this PR head in another Gittensory pass. Gittensory is holding this PR for manual review until that pass completes.

Nits — 1 non-blocking
  • AI review already in progress for this PR head — The gate is held for a human reviewer rather than passed automatically; it re-evaluates once the in-flight review completes or on the next update.

Why this is blocked

  • Possible leaked secret in the diff (aws_access_key, generic_secret_assignment, github_pat, github_token) — Remove the secret from the diff, rotate the exposed credential, then re-run the gate.

CI checks failing

  • codecov/patch — 12.50% of diff hit (target 99.00%)
Signal Result Evidence
Code review ❌ 1 blocker No AI review summary
Linked issue ✅ Linked #4284
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: 158 registered-repo PR(s), 100 merged, 11 issue(s).
Contributor context ✅ Confirmed Gittensor contributor nickmopen; Gittensor profile; 158 PR(s), 11 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Linked issue satisfaction

Addressed
The PR adds packages/gittensory-engine/src/subprocess-env.ts with a parameterized buildAllowlistedEnv, a ported SECRET_PATTERNS family, and redactSecrets, re-exports them from the engine barrel, includes tests confirming a caller-supplied allowlist is honored and full SECRET_PATTERNS coverage, and documents a deliberate 'leave ai.ts parallel with cross-reference comment' migration choice mirroring

Review context
  • Author: nickmopen
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 158 PR(s), 11 issue(s).
  • 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.

🟩 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 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch); Possible leaked secret in the diff (aws_access_key, generic_secret_assignment, github_pat, github_token)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-hands): shared subprocess redaction/env-allowlist helper in gittensory-engine

1 participant