feat(miner-hands): add shared subprocess redaction/env-allowlist helper to gittensory-engine (#4284) - #4451
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.
…nv helper codecov/patch is computed from the app vitest run (vitest.config coverage includes packages/gittensory-engine/src/**), and the engine's own node:test doesn't feed it. Add an app-vitest test importing the engine SRC directly (the opportunity-ranker convention) so the changed engine lines are covered. Confirmed locally: lcov shows subprocess-env.ts LF:14/LH:14 (100%, 0 uncovered).
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4451 +/- ##
=======================================
Coverage 93.95% 93.95%
=======================================
Files 412 413 +1
Lines 37212 37228 +16
Branches 13591 13595 +4
=======================================
+ Hits 34963 34979 +16
Misses 1594 1594
Partials 655 655
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-09 19:27:52 UTC
🛑 Suggested Action - Reject/Close
Review summary Nits — 5 non-blocking
Why this is blocked
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 (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. Re-submit of #4442, which the gate auto-closed on a stale codecov/patch — it closed the PR before codecov recomputed from the fixed coverage upload. The coverage fix is included and confirmed locally (lcov:
subprocess-env.tsLF:14/LH:14 = 100%, zero uncovered).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.What's here
packages/gittensory-engine/src/subprocess-env.ts—SUBPROCESS_CLI_ENV_ALLOWLIST+ a parameterizedbuildAllowlistedEnv(parent, allowlist, extra)(caller passes its own allowlist, not hardcoded) +SECRET_PATTERNS(OpenAI/Anthropic, GitHub PAT + fine-grained, JWT, AWS — ported verbatim) +redactSecrets(text, knownSecrets). Re-exported from the barrel.src/selfhost/ai.ts— migration story documented: its copy kept parallel for now (itssubscriptionCliEnvalso folds in CLI-specific PATH resolution), with a cross-reference comment. No behavior change.node:test(324/324) and an app-vitest test importing the engine src (socodecov/patchcounts it — theopportunity-rankerconvention).Validation
codecov/patchconfirmed locally via lcov (14/14 lines hit on the changed file).