feat(miner-hands): add shared subprocess redaction/env-allowlist helper to gittensory-engine (#4284) - #4442
Conversation
…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 didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
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
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-09 18:59:43 UTC
🛑 Suggested Action - Reject/Close
Review summary Nits — 1 non-blocking
Why this is blocked
CI checks failing
Linked issue satisfactionAddressed 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.
|
|
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. |
Closes #4284.
Promotes the review-CLI subprocess safety pattern — a strict allowlisted child env + secret redaction — out of
src/selfhost/ai.tsinto@jsonbored/gittensory-engine, so the cominggittensory-minercoding-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.tsSUBPROCESS_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); dropsundefined,extraoverlays.SECRET_PATTERNS(OpenAI/Anthropic, GitHub PAT + fine-grained, JWT, AWS — ported verbatim, not weakened) +redactSecrets(text, knownSecrets).src/selfhost/ai.ts— migration story documented (the issue requires a deliberate choice): its copy is kept parallel for now (itssubscriptionCliEnvalso folds in CLI-specific PATH resolution), with a cross-reference comment to the shared helper — shim later if it drifts, likepredicted-gate.ts. No behavior change.Validation
node:test: 324/324 pass (incl. the new parameterized-allowlist + every-SECRET_PATTERNS-family + known-secret-length-guard tests).