Next task ID: T-008
Open tasks: 0 (In Progress: 0, Next Today: 0, Next This Week: 0, Next Later: 0, Blocked: 0) Done tasks: 7
Completed: 2026-06-16 Outcome:
path=<file>is accepted as a first-class narrow target.- Single-file mode uses the file's parent directory as the scan root and processes only that file when its extension matches the active options or preset.
- README, agent skill, reference docs, and changelog document the single-file workflow. Proof:
- PASS:
.\bin\EncodingFixTool.Tests.exe --include:SingleFileResult: exit=0, 1 passed, 0 failed - PASS:
.\bin\EncodingFixTool.Tests.exeResult: exit=0, 31 passed, 0 failed - PASS:
powershell -NoProfile -ExecutionPolicy Bypass -File tests\Invoke-EncodingFixTool.Tests.ps1Result: exit=0, output containsEncodingFixTool CLI tests passed. - PASS:
Invoke-ScriptAnalyzer -Path .\tests\Invoke-EncodingFixTool.Tests.ps1 -Severity Warning,ErrorResult: exit=0, no findings - PASS:
cmd /s /c '"C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" && msbuild src\EncodingFixTool.dproj /t:Build /p:Config=Debug /p:Platform=Win32'Result: exit=0, zero warnings, zero errors - PASS:
cmd /s /c '"C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" && msbuild tests\EncodingFixTool.Tests.dproj /t:Build /p:Config=Debug /p:Platform=Win32'Result: exit=0, zero warnings, zero errors - PASS:
& 'F:\projects\MaxLogic\DelphiAiKit\bin\DelphiAIKit.exe' build --project src\EncodingFixTool.dproj --delphi 23.0 --platform Win32 --config Debug --target Build --aiResult: success - PASS:
& 'F:\projects\MaxLogic\DelphiAiKit\bin\DelphiAIKit.exe' build --project tests\EncodingFixTool.Tests.dproj --delphi 23.0 --platform Win32 --config Debug --target Build --aiResult: success - PASS:
.\bin\EncodingFixTool.exe path=. preset=delphi-ai scope=git-changed format=jsonResult: exit=0,failed=0Touches: src/EncodingFixToolCore.pas, tests/EncodingFixTool.IntegrationTests.pas, tests/Invoke-EncodingFixTool.Tests.ps1, README.md, agent-skill/encodingfix-delphi-cleanup/SKILL.md, agent-skill/encodingfix-delphi-cleanup/references/encodingfix-tool.md, CHANGELOG.md Verify: integration-test, cli-proof, build Notes: Strict TDD followed for the DUnitX single-file regression. Initial RED was exit code 2 forpath=<file>; GREEN passed after normalizing file paths into explicit single-file scan mode.
Completed: 2026-06-11 Outcome:
- README describes the current CLI surface, including CRLF normalization, binary DFM behavior, AI workflow usage, scopes, formats, and configurable presets once implemented.
- README includes a short "AI/agent usage" section with the intended command shape for Delphi projects.
- README explains preset config precedence and the recommended locations for repo-local and user-global JSON configuration.
- README examples stay copy-pasteable on Windows PowerShell and preserve conservative defaults. Proof:
- PASS:
Select-String -Path .\README.md -Pattern 'preset=delphi-ai','scope=git-changed','format=json','.encodingfix.json','%APPDATA%','eol=crlf'Result: all patterns found - PASS:
python -c "from pathlib import Path; p=Path('README.md'); b=p.read_bytes(); assert b.count(b'\n') == b.count(b'\r\n')"Result: exit=0 - PASS:
cmd /s /c '"C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" && msbuild tests\EncodingFixTool.Tests.dproj /t:Build /p:Config=Debug /p:Platform=Win32'Result: exit=0, zero warnings, zero errors - PASS:
.\bin\EncodingFixTool.Tests.exeResult: exit=0, 30 passed, 0 failed - PASS:
powershell -NoProfile -ExecutionPolicy Bypass -File tests\Invoke-EncodingFixTool.Tests.ps1Result: exit=0, output containsEncodingFixTool CLI tests passed. - PASS:
& 'F:\projects\MaxLogic\DelphiAiKit\bin\DelphiAIKit.exe' build --project src\EncodingFixTool.dproj --delphi 23.0 --platform Win32 --config Debug --target Build --aiResult: success - PASS:
& 'F:\projects\MaxLogic\DelphiAiKit\bin\DelphiAIKit.exe' build --project tests\EncodingFixTool.Tests.dproj --delphi 23.0 --platform Win32 --config Debug --target Build --aiResult: success Touches: README.md, CHANGELOG.md Deps: T-001, T-002, T-003, T-004 Verify: cli-proof Ceremony: reduced Notes: Documentation-only task; strict RED/GREEN production-code TDD does not apply. Local acceptance audit confirmed the README covers the current CLI surface, AI workflow, scopes, formats, presets, and PowerShell examples.
Completed: 2026-06-11 Outcome:
- A repo-local skill exists under
agent-skill/with aSKILL.mdthat teaches AI agents when and how to use EncodingFixTool for Delphi cleanup. - The skill instructs agents to prefer the AI workflow command after Delphi edits, especially for CRLF and encoding repair caused by code generation tools.
- The skill documents safe defaults, dry-run/check behavior, changed-file scope, JSON summary output, and when not to run the tool.
- The skill includes a concise install/use note so it can be copied into an agent skill directory without needing repo-specific context. Proof:
- PASS:
Test-Path .\agent-skill\SKILL.mdResult:True - PASS:
Select-String -Path .\agent-skill\SKILL.md -Pattern 'preset=delphi-ai','scope=git-changed','format=json','CRLF','Delphi'Result: all patterns found - PASS:
python -c "from pathlib import Path; p=Path('agent-skill/SKILL.md'); b=p.read_bytes(); assert b.count(b'\n') == b.count(b'\r\n')"Result: exit=0 - PASS:
cmd /s /c '"C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" && msbuild tests\EncodingFixTool.Tests.dproj /t:Build /p:Config=Debug /p:Platform=Win32'Result: exit=0, zero warnings, zero errors - PASS:
.\bin\EncodingFixTool.Tests.exeResult: exit=0, 30 passed, 0 failed - PASS:
powershell -NoProfile -ExecutionPolicy Bypass -File tests\Invoke-EncodingFixTool.Tests.ps1Result: exit=0, output containsEncodingFixTool CLI tests passed. - PASS:
& 'F:\projects\MaxLogic\DelphiAiKit\bin\DelphiAIKit.exe' build --project src\EncodingFixTool.dproj --delphi 23.0 --platform Win32 --config Debug --target Build --aiResult: success - PASS:
& 'F:\projects\MaxLogic\DelphiAiKit\bin\DelphiAIKit.exe' build --project tests\EncodingFixTool.Tests.dproj --delphi 23.0 --platform Win32 --config Debug --target Build --aiResult: success Touches: agent-skill/SKILL.md, CHANGELOG.md Deps: T-003 Verify: cli-proof Ceremony: reduced Notes: Documentation-only task; strict RED/GREEN production-code TDD does not apply. Subagent acceptance audit returned REVISE for dry-run/check and rewrite-safety wording; both findings were fixed before completion.
Completed: 2026-06-11 Outcome:
- The CLI loads user-defined presets from JSON configuration in a predictable precedence order: CLI args, explicit
config=..., repo config, user config, built-in defaults. - Repo-local config is discovered from the scan root upward using
.encodingfix.json. - User-global config is loaded from
%APPDATA%\MaxLogic\EncodingFixTool\config.jsonwhen present. - Invalid preset names, malformed JSON, and invalid preset option values fail with clear errors before any files are rewritten.
- README documents preset configuration, precedence, and a Delphi-focused example. Proof:
- PASS:
cmd /s /c '"C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" && msbuild tests\EncodingFixTool.Tests.dproj /t:Build /p:Config=Debug /p:Platform=Win32'Result: exit=0, zero warnings, zero errors - PASS:
.\bin\EncodingFixTool.Tests.exe --include:PresetConfigResult: exit=0, 8 passed, 0 failed - PASS:
powershell -NoProfile -ExecutionPolicy Bypass -File tests\Invoke-EncodingFixTool.Tests.ps1Result: exit=0, output containsEncodingFixTool CLI tests passed. - PASS:
.\bin\EncodingFixTool.Tests.exeResult: exit=0, 30 passed, 0 failed - PASS:
& $env:DAK_EXE build --project src\EncodingFixTool.dproj --delphi 23.0 --platform Win32 --config Debug --target Build --aiResult: success - PASS:
& $env:DAK_EXE build --project tests\EncodingFixTool.Tests.dproj --delphi 23.0 --platform Win32 --config Debug --target Build --aiResult: success Touches: src/EncodingFixToolCore.pas, tests/EncodingFixTool.IntegrationTests.pas, tests/Invoke-EncodingFixTool.Tests.ps1, README.md, CHANGELOG.md Deps: T-003 Verify: integration-test, cli-proof Notes: Config JSON supports named presets underpresets; explicit config overrides repo config, repo config overrides user config, CLI arguments override all config values.
Completed: 2026-06-11 Outcome:
- The CLI provides a built-in
preset=delphi-aiworkflow for agent-driven Delphi cleanup. preset=delphi-aiexpands to Delphi source/project extensions, UTF-8 BOM for non-ASCII files, CRLF normalization, recursive scan, and binary DFM safety once the dependent features exist.scope=git-changedlimits cleanup to modified and untracked Delphi files in a Git worktree, resolving Git paths from the worktree root and filtering back to the requested scan path.format=jsonreports scanned, changed, skipped, and failed files without verbose per-file chatter. Proof:- PASS:
cmd /s /c '"C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" && msbuild tests\EncodingFixTool.Tests.dproj /t:Build /p:Config=Debug /p:Platform=Win32'Result: exit=0, zero warnings, zero errors - PASS:
.\bin\EncodingFixTool.Tests.exe --include:AiWorkflowResult: exit=0, 2 passed, 0 failed - PASS:
powershell -NoProfile -ExecutionPolicy Bypass -File tests\Invoke-EncodingFixTool.Tests.ps1Result: exit=0, output containsEncodingFixTool CLI tests passed. - PASS:
.\bin\EncodingFixTool.Tests.exeResult: exit=0, 22 passed, 0 failed - PASS:
& $env:DAK_EXE build --project src\EncodingFixTool.dproj --delphi 23.0 --platform Win32 --config Debug --target Rebuild --aiResult: success - PASS:
& $env:DAK_EXE build --project tests\EncodingFixTool.Tests.dproj --delphi 23.0 --platform Win32 --config Debug --target Rebuild --aiResult: success Touches: src/EncodingFixToolCore.pas, tests/EncodingFixTool.IntegrationTests.pas, tests/Invoke-EncodingFixTool.Tests.ps1, README.md, CHANGELOG.md Deps: T-001, T-002 Verify: integration-test, cli-proof Notes: Target command shape isEncodingFixTool path=. preset=delphi-ai scope=git-changed format=json. The preset is explicitly opt-in for AI/editor cleanup after code generation.
Completed: 2026-06-11 Outcome:
- When
extincludesdfm, binary DFM files are detected from raw bytes before decoding and are skipped without modification. - Skipped binary DFM files are reported in verbose mode and do not count as failures.
- Text DFM files remain eligible for the normal encoding and optional line-ending repair path. Proof:
- PASS:
cmd /s /c '"C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" && msbuild tests\EncodingFixTool.Tests.dproj /t:Build /p:Config=Debug /p:Platform=Win32'Result: exit=0, zero warnings, zero errors - PASS:
.\bin\EncodingFixTool.Tests.exe --include:DfmResult: exit=0, 3 passed, 0 failed - PASS:
powershell -NoProfile -ExecutionPolicy Bypass -File tests\Invoke-EncodingFixTool.Tests.ps1Result: exit=0, output containsEncodingFixTool CLI tests passed. - PASS:
.\bin\EncodingFixTool.Tests.exeResult: exit=0, 20 passed, 0 failed - PASS:
& $env:DAK_EXE build --project src\EncodingFixTool.dproj --delphi 23.0 --platform Win32 --config Debug --target Rebuild --aiResult: success - PASS:
& $env:DAK_EXE build --project tests\EncodingFixTool.Tests.dproj --delphi 23.0 --platform Win32 --config Debug --target Rebuild --aiResult: success Touches: src/EncodingFixToolCore.pas, tests/EncodingFixTool.IntegrationTests.pas, tests/Invoke-EncodingFixTool.Tests.ps1, README.md, CHANGELOG.md Verify: integration-test, cli-proof Notes: Fix-CRLF skips binary DFM files before repair; implemented as a raw-byteTPF0check before decoding. Text DFM encoding andeol=crlfpaths remain covered.
Completed: 2026-06-11 Outcome:
- The CLI accepts an opt-in
eol=preserve|crlfoption, defaulting to the currentpreservebehavior. eol=crlfrewrites solitaryLFand solitaryCRline separators to WindowsCRLF, including files that are otherwise valid ASCII or UTF-8.- Dry-run and verbose output report when a file would change only because of line-ending normalization.
- Existing encoding repair still preserves line endings unless
eol=crlfis explicitly requested. Proof: - PASS:
cmd /s /c '"C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat" && msbuild tests\EncodingFixTool.Tests.dproj /t:Build /p:Config=Debug /p:Platform=Win32'Result: exit=0, zero warnings, zero errors - PASS:
.\bin\EncodingFixTool.Tests.exe --include:LineEndingResult: exit=0, 8 passed, 0 failed - PASS:
powershell -NoProfile -ExecutionPolicy Bypass -File tests\Invoke-EncodingFixTool.Tests.ps1Result: exit=0, output containsEncodingFixTool CLI tests passed. - PASS:
.\bin\EncodingFixTool.Tests.exeResult: exit=0, 17 passed, 0 failed - PASS:
& $env:DAK_EXE build --project src\EncodingFixTool.dproj --delphi 23.0 --platform Win32 --config Debug --target Rebuild --aiResult: success - PASS:
& $env:DAK_EXE build --project tests\EncodingFixTool.Tests.dproj --delphi 23.0 --platform Win32 --config Debug --target Rebuild --aiResult: success Touches: src/EncodingFixToolCore.pas, tests/EncodingFixTool.IntegrationTests.pas, tests/Invoke-EncodingFixTool.Tests.ps1, README.md, CHANGELOG.md Verify: integration-test, cli-proof Notes: Inspired by Fix-CRLF's solitary CR/LF normalization; implemented in our byte-based pipeline, not by importing its GUI/string helpers.