Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ npm pack --dry-run
### v5.0.16

- Fixed `gx doctor` runtime crash (`parseDoctorArgs is not defined`) by restoring the doctor argument parser for `--target` and `--strict`.
- Fixed `gx doctor` command routing so the repair-first doctor flow remains the active command path (duplicate legacy doctor definition no longer overrides it).
- Updated worktree change detection to run `git status --porcelain --untracked-files=normal --` for consistent normal untracked-file behavior.
- Added regression coverage that asserts the doctor parser function exists in `bin/multiagent-safety.js`.
- Bumped package version from `5.0.15` to `5.0.16`.

Expand Down
11 changes: 9 additions & 2 deletions bin/multiagent-safety.js
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,14 @@ function mapWorktreePathsByBranch(repoRoot) {
}

function hasSignificantWorkingTreeChanges(worktreePath) {
const result = run('git', ['-C', worktreePath, 'status', '--porcelain']);
const result = run('git', [
'-C',
worktreePath,
'status',
'--porcelain',
'--untracked-files=normal',
'--',
]);
if (result.status !== 0) {
return true;
}
Expand Down Expand Up @@ -4659,7 +4666,7 @@ function initWorkspace(rawArgs) {
}
}

function doctor(rawArgs) {
function doctorAudit(rawArgs) {
const options = parseDoctorArgs(rawArgs);
const repoRoot = resolveRepoRoot(options.target);
const failures = [];
Expand Down
16 changes: 15 additions & 1 deletion test/metadata.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,19 @@ test('doctor CLI parser exists to prevent runtime ReferenceError regressions', (
const cliPath = path.join(repoRoot, 'bin', 'multiagent-safety.js');
const cliSource = fs.readFileSync(cliPath, 'utf8');
assert.match(cliSource, /function parseDoctorArgs\(rawArgs\)/);
assert.match(cliSource, /const options = parseDoctorArgs\(rawArgs\);/);
assert.match(cliSource, /function doctorAudit\(rawArgs\)/);
});

test('active doctor command remains single-source and runs the repair-first path', () => {
const cliPath = path.join(repoRoot, 'bin', 'multiagent-safety.js');
const cliSource = fs.readFileSync(cliPath, 'utf8');
const doctorDefs = cliSource.match(/function doctor\(rawArgs\)/g) || [];
assert.equal(doctorDefs.length, 1, 'doctor() must not be duplicated');
assert.match(cliSource, /printOperations\('Doctor\/fix', fixPayload, options\.dryRun\);/);
});

test('worktree-change detection uses normal untracked-file mode', () => {
const cliPath = path.join(repoRoot, 'bin', 'multiagent-safety.js');
const cliSource = fs.readFileSync(cliPath, 'utf8');
assert.match(cliSource, /'status',\s*'--porcelain',\s*'--untracked-files=normal',\s*'--'/s);
});