Implement proper buffering for PASS lines in summary mode:
- PASS lines are buffered when -Summary/--summary is active
- WARN and FAIL lines print immediately (never buffered)
- On success: buffer is discarded, print tally line only
- On failure: buffer is flushed before tally line
Revert out-of-scope try/catch around Python command (not part of Task 4).
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Bash's manifest reader stripped only the trailing newline, so a
CRLF-terminated manifest left a stray \r on every hash, a UTF-8 BOM on the
header line was folded into the "path" field, and an uppercase hash never
matched sha256sum's lowercase output. Reproduced against a real
manifest written by an earlier version of the PowerShell installer, where
every single managed file was misreported as locally modified.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Windows PowerShell 5.1's -Encoding UTF8 always prepends a BOM, and
Get-FileHash returns uppercase hex. Bash's manifest reader expects neither,
so a manifest written by this module and later read by the Bash
equivalent (or vice versa) mismatched on every single entry: the BOM
folded into the header's first field, and every hash comparison failed on
case alone. Hashes are now lowercased on read and write, and the manifest
file itself is written UTF-8 without a BOM.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
doctor.ps1 already exited 1 on failure but relied on the implicit process
exit code on success, which a stale $LASTEXITCODE from an earlier native
call (e.g. codex --version) could turn into a false failure in CI.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Without it, a stale $LASTEXITCODE left over from an earlier native
command in the same PowerShell session could cause a CI step to be
reported as failed even though the script itself completed successfully.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
All tracked .sh files were stored as mode 100644 (non-executable), even
though the CI workflow and normal usage invoke several of them directly
(./scripts/build.sh) rather than through `bash`. On a fresh Linux
checkout this fails with a permission error.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bash equivalent of the PowerShell build-validation test, using a tar-based
repo copy per case to check the same four rejected-defect scenarios.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Runs the build against temporary full-repo copies, each with one injected
defect, and asserts the build rejects it: invalid Claude settings.json,
a duplicate agent name, a duplicate plugin name, and a leftover template
placeholder.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bash equivalent of the PowerShell managed-manifest test, covering the same
idempotency, stale-removal, modified-file-protection, foreign-file, and
side-effect-free dry-run scenarios against sync_managed_destination.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Exercises Sync-ManagedDestination directly against a throwaway
source/destination pair: idempotent second install (no writes, no
backups), removal of a stale-and-untouched file, protection of a
stale-but-locally-modified file (backed up, left in place, warned), a
foreign file that was never installed staying untouched, and a dry run
that reports the planned removal without any side effects.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bash equivalent of the PowerShell doctor change: dynamic agent/skill count
checks, JSON validation of installed settings.json (jq, falling back to a
functional python3 probe), a config.toml balance check, a fast tree-wide
placeholder scan, and managed-manifest missing/modified-file reporting.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Doctor now compares generated agent/skill counts against the source
directories and the rule-skills manifest, parses installed settings.json
as JSON, sanity-checks installed config.toml for balanced quotes and
brackets, scans generated output for leftover template placeholders, and
reports missing or locally modified files from each destination's managed
manifest. All checks stay local and file-based; no network calls.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>