fix(miner): derive sdk changed files from git#5362
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 2ff997e | Commit Preview URL Branch Preview URL |
Jul 12 2026, 10:10 PM |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 22:15:23 UTC
⏸️ Suggested Action - Manual Review Review summary Blockers
Nits — 5 non-blocking
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.
|
438f581 to
4ef33f2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5362 +/- ##
=======================================
Coverage 94.72% 94.72%
=======================================
Files 559 559
Lines 44664 44673 +9
Branches 14664 14667 +3
=======================================
+ Hits 42308 42317 +9
Misses 1621 1621
Partials 735 735
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
4ef33f2 to
c86d328
Compare
…path too Reconciling this branch with #5356 (costUsd wiring) surfaced a gap: the new changed-file-enumeration-failure return statement ran after the SDK result message (and its billed total_cost_usd) was already available, but omitted costUsd -- silently undercounting real spend for that one failure path in budgetSpent. Added it, plus regression coverage in both the node:test source and its vitest/Codecov mirror.
c86d328 to
bcce71c
Compare
…eal test seam Reconciling this branch's default agent-sdk changed-file enumeration (now a real git diff/ls-files read) surfaced that createCodingAgentDriver, constructProductionCodingAgentDriver, and runCodingAgentAttempt never forwarded an injectable enumerator -- every pre-existing test that constructs a real agent-sdk driver against a fake (non-git) working directory now fails closed via the real default, since there was no seam to opt out with. Threaded listChangedFiles through all three layers (same pattern as query/hooks) and updated the 4 affected test files (contract parity, coding-agent-miner, miner-coding-agent-construction, miner-coding-agent-house-rules) to inject a no-op enumerator where they test other behavior.
Motivation
tool_useevents, which allowed edits made by other mutating tools (e.g.Bash,MultiEdit) to go unreported and bypass downstream lint/typecheck guards.changedFilesarray as nothing-to-check, so incomplete changed-file tracking is a security risk and must be derived from the actual worktree.Description
git diff --name-only HEAD --+git ls-files --others --exclude-standard) and merge those with anyfile_pathobserved in assistanttool_useblocks; added an injectablelistChangedFileshook for testability inpackages/gittensory-engine/src/miner/agent-sdk-driver.ts.agent_sdk_changed_files_unavailable) so downstream guards cannot be skipped on an incomplete signal.foldAssistantMessageto record anyinput.file_pathseen (supplemental metadata) and merge it with the git-derived file list before returning successful results.packages/gittensory-engine/test/agent-sdk-driver.test.ts,test/unit/agent-sdk-driver.test.ts).cf-typegendrift check reported stale output (worker-configuration.d.ts).Testing
npm --workspace @jsonbored/gittensory-engine test, and all package tests passed.npm test -- --run test/unit/agent-sdk-driver.test.ts, and the unit tests passed (new tests included and green).--coverage.thresholds.*=0) to validate coverage and test behavior locally, which completed successfully for the exercised tests.npm run test:ci; the run progressed through many early checks but the unsharded coverage phase did not complete in this environment (execution was terminated), so the full gate was not finished locally.npm audit --audit-level=moderate; the registry audit endpoint returned403 Forbiddenin this environment so the dependency audit could not be completed.Codex Task