xtrm-tools 2.3.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +132 -111
- package/cli/dist/index.cjs +142 -53
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/config/pi/extensions/beads.ts +24 -0
- package/hooks/beads-gate-core.mjs +6 -4
- package/hooks/beads-memory-gate.mjs +12 -5
- package/hooks/hooks.json +126 -0
- package/package.json +3 -1
- package/skills/test-planning/SKILL.md +208 -0
- package/skills/test-planning/evals/evals.json +23 -0
- package/skills/using-xtrm/SKILL.md +5 -27
- package/project-skills/tdd-guard/.claude/hooks/tdd-guard-pretool-bridge.cjs +0 -103
- package/project-skills/tdd-guard/.claude/settings.json +0 -38
- package/project-skills/tdd-guard/.claude/skills/using-tdd-guard/SKILL.md +0 -79
- package/project-skills/tdd-guard/CLAUDE.md +0 -98
- package/project-skills/tdd-guard/CONTRIBUTING.md +0 -38
- package/project-skills/tdd-guard/DEVELOPMENT.md +0 -127
- package/project-skills/tdd-guard/LICENSE +0 -21
- package/project-skills/tdd-guard/README.md +0 -398
- package/project-skills/tdd-guard/docs/adr/001-claude-session-subdirectory.md +0 -52
- package/project-skills/tdd-guard/docs/adr/002-secure-claude-binary-path.md +0 -56
- package/project-skills/tdd-guard/docs/adr/003-remove-configurable-data-directory.md +0 -56
- package/project-skills/tdd-guard/docs/adr/004-monorepo-architecture.md +0 -64
- package/project-skills/tdd-guard/docs/adr/005-claude-project-dir-support.md +0 -55
- package/project-skills/tdd-guard/docs/adr/006-phpunit-separate-repository.md +0 -93
- package/project-skills/tdd-guard/docs/adr/007-golangci-lint-path-support.md +0 -83
- package/project-skills/tdd-guard/docs/adr/008-storybook-reporter-design.md +0 -182
- package/project-skills/tdd-guard/docs/assets/tdd-guard-demo-screenshot.gif +0 -0
- package/project-skills/tdd-guard/docs/config-migration.md +0 -143
- package/project-skills/tdd-guard/docs/configuration.md +0 -137
- package/project-skills/tdd-guard/docs/custom-instructions.md +0 -43
- package/project-skills/tdd-guard/docs/enforcement.md +0 -46
- package/project-skills/tdd-guard/docs/ignore-patterns.md +0 -81
- package/project-skills/tdd-guard/docs/linting.md +0 -109
- package/project-skills/tdd-guard/docs/quick-commands.md +0 -52
- package/project-skills/tdd-guard/docs/session-management.md +0 -75
- package/project-skills/tdd-guard/docs/storybook-vitest-addon.md +0 -120
- package/project-skills/tdd-guard/docs/validation-model.md +0 -63
- package/project-skills/tdd-guard/eslint.config.mjs +0 -140
- package/project-skills/tdd-guard/package-lock.json +0 -16937
- package/project-skills/tdd-guard/package.json +0 -102
- package/project-skills/tdd-guard/reporters/go/README.md +0 -67
- package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main.go +0 -127
- package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main_test.go +0 -280
- package/project-skills/tdd-guard/reporters/go/go.mod +0 -3
- package/project-skills/tdd-guard/reporters/go/go.sum +0 -0
- package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter.go +0 -126
- package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter_test.go +0 -264
- package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader.go +0 -26
- package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader_test.go +0 -37
- package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader.go +0 -94
- package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader_test.go +0 -198
- package/project-skills/tdd-guard/reporters/go/internal/parser/parser.go +0 -245
- package/project-skills/tdd-guard/reporters/go/internal/parser/parser_test.go +0 -547
- package/project-skills/tdd-guard/reporters/go/internal/storage/storage.go +0 -35
- package/project-skills/tdd-guard/reporters/go/internal/storage/storage_test.go +0 -113
- package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer.go +0 -103
- package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer_test.go +0 -303
- package/project-skills/tdd-guard/reporters/jest/README.md +0 -102
- package/project-skills/tdd-guard/reporters/jest/package.json +0 -38
- package/project-skills/tdd-guard/reporters/jest/src/JestReporter.test-data.ts +0 -199
- package/project-skills/tdd-guard/reporters/jest/src/JestReporter.test.ts +0 -302
- package/project-skills/tdd-guard/reporters/jest/src/JestReporter.ts +0 -201
- package/project-skills/tdd-guard/reporters/jest/src/index.ts +0 -4
- package/project-skills/tdd-guard/reporters/jest/src/types.ts +0 -42
- package/project-skills/tdd-guard/reporters/jest/tsconfig.json +0 -11
- package/project-skills/tdd-guard/reporters/phpunit/.php-cs-fixer.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/README.md +0 -97
- package/project-skills/tdd-guard/reporters/phpunit/SYNC_README.md +0 -29
- package/project-skills/tdd-guard/reporters/phpunit/composer.json +0 -55
- package/project-skills/tdd-guard/reporters/phpunit/phpunit.xml.dist +0 -19
- package/project-skills/tdd-guard/reporters/phpunit/psalm.xml +0 -44
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/ErroredTestSubscriber.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/FailedTestSubscriber.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/IncompleteTestSubscriber.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/PassedTestSubscriber.php +0 -27
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/SkippedTestSubscriber.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/TestRunnerFinishedSubscriber.php +0 -24
- package/project-skills/tdd-guard/reporters/phpunit/src/PathValidator.php +0 -88
- package/project-skills/tdd-guard/reporters/phpunit/src/Storage.php +0 -26
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardExtension.php +0 -33
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardListener.php +0 -158
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardSubscriber.php +0 -35
- package/project-skills/tdd-guard/reporters/phpunit/src/TestResultCollector.php +0 -105
- package/project-skills/tdd-guard/reporters/phpunit/tests/PathValidatorTest.php +0 -74
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionFailedTest.php +0 -241
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionTest.php +0 -84
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardStorageLocationTest.php +0 -71
- package/project-skills/tdd-guard/reporters/pytest/README.md +0 -77
- package/project-skills/tdd-guard/reporters/pytest/pyproject.toml +0 -43
- package/project-skills/tdd-guard/reporters/pytest/pytest.ini.example +0 -7
- package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/__init__.py +0 -1
- package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/pytest_reporter.py +0 -134
- package/project-skills/tdd-guard/reporters/pytest/tests/__init__.py +0 -1
- package/project-skills/tdd-guard/reporters/pytest/tests/conftest.py +0 -3
- package/project-skills/tdd-guard/reporters/pytest/tests/helpers.py +0 -293
- package/project-skills/tdd-guard/reporters/pytest/tests/test_config_option.py +0 -38
- package/project-skills/tdd-guard/reporters/pytest/tests/test_path_validation.py +0 -59
- package/project-skills/tdd-guard/reporters/pytest/tests/test_plugin_config.py +0 -32
- package/project-skills/tdd-guard/reporters/pytest/tests/test_project_root.py +0 -296
- package/project-skills/tdd-guard/reporters/pytest/tests/test_pytest_reporter.py +0 -137
- package/project-skills/tdd-guard/reporters/rspec/Gemfile +0 -3
- package/project-skills/tdd-guard/reporters/rust/Cargo.lock +0 -458
- package/project-skills/tdd-guard/reporters/rust/Cargo.toml +0 -33
- package/project-skills/tdd-guard/reporters/rust/Makefile.example +0 -95
- package/project-skills/tdd-guard/reporters/rust/README.md +0 -88
- package/project-skills/tdd-guard/reporters/rust/src/error_parser.rs +0 -309
- package/project-skills/tdd-guard/reporters/rust/src/main.rs +0 -464
- package/project-skills/tdd-guard/reporters/rust/src/parser.rs +0 -225
- package/project-skills/tdd-guard/reporters/rust/src/transformer.rs +0 -409
- package/project-skills/tdd-guard/reporters/storybook/README.md +0 -108
- package/project-skills/tdd-guard/reporters/storybook/package-lock.json +0 -9482
- package/project-skills/tdd-guard/reporters/storybook/package.json +0 -43
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test-data.ts +0 -22
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test.ts +0 -190
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.ts +0 -88
- package/project-skills/tdd-guard/reporters/storybook/src/index.ts +0 -12
- package/project-skills/tdd-guard/reporters/storybook/src/types.ts +0 -37
- package/project-skills/tdd-guard/reporters/storybook/tsconfig.json +0 -11
- package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/go.mod +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/single_failing_test.go +0 -13
- package/project-skills/tdd-guard/reporters/test/artifacts/go/import/go.mod +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/go/import/single_import_error_test.go +0 -17
- package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/go.mod +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/single_passing_test.go +0 -13
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-failing.test.js +0 -5
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-import-error.test.js +0 -8
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-passing.test.js +0 -5
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleFailingTest.php +0 -11
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleImportErrorTest.php +0 -14
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SinglePassingTest.php +0 -11
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_failing.py +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_import_error.py +0 -6
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_passing.py +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.lock +0 -7
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.toml +0 -4
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/src/lib.rs +0 -14
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.lock +0 -7
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.toml +0 -4
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/src/lib.rs +0 -13
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.lock +0 -7
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.toml +0 -4
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/src/lib.rs +0 -14
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/Calculator.js +0 -4
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-failing.stories.js +0 -15
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-import-error.stories.js +0 -14
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-passing.stories.js +0 -15
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-failing.test.js +0 -7
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-import-error.test.js +0 -9
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-passing.test.js +0 -7
- package/project-skills/tdd-guard/reporters/test/factories/go.ts +0 -59
- package/project-skills/tdd-guard/reporters/test/factories/helpers.ts +0 -48
- package/project-skills/tdd-guard/reporters/test/factories/index.ts +0 -7
- package/project-skills/tdd-guard/reporters/test/factories/jest.ts +0 -51
- package/project-skills/tdd-guard/reporters/test/factories/phpunit.ts +0 -63
- package/project-skills/tdd-guard/reporters/test/factories/pytest.ts +0 -41
- package/project-skills/tdd-guard/reporters/test/factories/rust.ts +0 -158
- package/project-skills/tdd-guard/reporters/test/factories/storybook.ts +0 -198
- package/project-skills/tdd-guard/reporters/test/factories/vitest.ts +0 -51
- package/project-skills/tdd-guard/reporters/test/reporters.integration.test.ts +0 -735
- package/project-skills/tdd-guard/reporters/test/types.ts +0 -28
- package/project-skills/tdd-guard/reporters/vitest/README.md +0 -64
- package/project-skills/tdd-guard/reporters/vitest/package.json +0 -35
- package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.test-data.ts +0 -85
- package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.test.ts +0 -446
- package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.ts +0 -110
- package/project-skills/tdd-guard/reporters/vitest/src/index.ts +0 -4
- package/project-skills/tdd-guard/reporters/vitest/src/types.ts +0 -39
- package/project-skills/tdd-guard/reporters/vitest/tsconfig.json +0 -11
- package/project-skills/tdd-guard/src/cli/buildContext.test.ts +0 -200
- package/project-skills/tdd-guard/src/cli/buildContext.ts +0 -48
- package/project-skills/tdd-guard/src/cli/tdd-guard.test.ts +0 -159
- package/project-skills/tdd-guard/src/cli/tdd-guard.ts +0 -48
- package/project-skills/tdd-guard/src/config/Config.test.ts +0 -538
- package/project-skills/tdd-guard/src/config/Config.ts +0 -172
- package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.test.ts +0 -58
- package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.ts +0 -8
- package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.test.ts +0 -347
- package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.ts +0 -61
- package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.test.ts +0 -24
- package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.ts +0 -7
- package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.test.ts +0 -377
- package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.ts +0 -75
- package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.test.ts +0 -563
- package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.ts +0 -140
- package/project-skills/tdd-guard/src/contracts/types/ClientType.ts +0 -1
- package/project-skills/tdd-guard/src/contracts/types/ConfigOptions.ts +0 -12
- package/project-skills/tdd-guard/src/contracts/types/Context.ts +0 -16
- package/project-skills/tdd-guard/src/contracts/types/ModelClient.ts +0 -3
- package/project-skills/tdd-guard/src/contracts/types/ValidationResult.ts +0 -6
- package/project-skills/tdd-guard/src/guard/GuardManager.test.ts +0 -336
- package/project-skills/tdd-guard/src/guard/GuardManager.ts +0 -83
- package/project-skills/tdd-guard/src/hooks/HookEvents.test.ts +0 -107
- package/project-skills/tdd-guard/src/hooks/HookEvents.ts +0 -39
- package/project-skills/tdd-guard/src/hooks/fileTypeDetection.ts +0 -16
- package/project-skills/tdd-guard/src/hooks/postToolLint.test.ts +0 -327
- package/project-skills/tdd-guard/src/hooks/postToolLint.ts +0 -165
- package/project-skills/tdd-guard/src/hooks/processHookData.test.ts +0 -465
- package/project-skills/tdd-guard/src/hooks/processHookData.ts +0 -203
- package/project-skills/tdd-guard/src/hooks/sessionHandler.test.ts +0 -136
- package/project-skills/tdd-guard/src/hooks/sessionHandler.ts +0 -31
- package/project-skills/tdd-guard/src/hooks/userPromptHandler.test.ts +0 -131
- package/project-skills/tdd-guard/src/hooks/userPromptHandler.ts +0 -55
- package/project-skills/tdd-guard/src/index.ts +0 -19
- package/project-skills/tdd-guard/src/linters/Linter.ts +0 -5
- package/project-skills/tdd-guard/src/linters/eslint/ESLint.test.ts +0 -183
- package/project-skills/tdd-guard/src/linters/eslint/ESLint.ts +0 -82
- package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.test.ts +0 -170
- package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.ts +0 -148
- package/project-skills/tdd-guard/src/processors/index.ts +0 -1
- package/project-skills/tdd-guard/src/processors/lintProcessor.ts +0 -77
- package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.test.ts +0 -303
- package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.ts +0 -255
- package/project-skills/tdd-guard/src/providers/LinterProvider.test.ts +0 -43
- package/project-skills/tdd-guard/src/providers/LinterProvider.ts +0 -20
- package/project-skills/tdd-guard/src/providers/ModelClientProvider.test.ts +0 -68
- package/project-skills/tdd-guard/src/providers/ModelClientProvider.ts +0 -22
- package/project-skills/tdd-guard/src/storage/FileStorage.test.ts +0 -76
- package/project-skills/tdd-guard/src/storage/FileStorage.ts +0 -108
- package/project-skills/tdd-guard/src/storage/MemoryStorage.ts +0 -57
- package/project-skills/tdd-guard/src/storage/Storage.test.ts +0 -227
- package/project-skills/tdd-guard/src/storage/Storage.ts +0 -17
- package/project-skills/tdd-guard/src/validation/context/context.test.ts +0 -364
- package/project-skills/tdd-guard/src/validation/context/context.ts +0 -155
- package/project-skills/tdd-guard/src/validation/models/AnthropicApi.test.ts +0 -171
- package/project-skills/tdd-guard/src/validation/models/AnthropicApi.ts +0 -49
- package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.test.ts +0 -167
- package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.ts +0 -54
- package/project-skills/tdd-guard/src/validation/models/ClaudeCli.test.ts +0 -239
- package/project-skills/tdd-guard/src/validation/models/ClaudeCli.ts +0 -57
- package/project-skills/tdd-guard/src/validation/prompts/file-types.ts +0 -52
- package/project-skills/tdd-guard/src/validation/prompts/operations/edit.ts +0 -58
- package/project-skills/tdd-guard/src/validation/prompts/operations/multi-edit.ts +0 -54
- package/project-skills/tdd-guard/src/validation/prompts/operations/write.ts +0 -54
- package/project-skills/tdd-guard/src/validation/prompts/response.ts +0 -40
- package/project-skills/tdd-guard/src/validation/prompts/rules.ts +0 -51
- package/project-skills/tdd-guard/src/validation/prompts/system-prompt.ts +0 -10
- package/project-skills/tdd-guard/src/validation/prompts/tools/lint-results.ts +0 -15
- package/project-skills/tdd-guard/src/validation/prompts/tools/test-output.ts +0 -14
- package/project-skills/tdd-guard/src/validation/prompts/tools/todos.ts +0 -9
- package/project-skills/tdd-guard/src/validation/validator.test.ts +0 -268
- package/project-skills/tdd-guard/src/validation/validator.ts +0 -159
- package/project-skills/tdd-guard/test/artifacts/go/.golangci.yml +0 -6
- package/project-skills/tdd-guard/test/artifacts/go/with-issues/file-with-issues.go +0 -12
- package/project-skills/tdd-guard/test/artifacts/go/with-issues/go.mod +0 -3
- package/project-skills/tdd-guard/test/artifacts/go/without-issues/file-without-issues.go +0 -7
- package/project-skills/tdd-guard/test/artifacts/go/without-issues/go.mod +0 -3
- package/project-skills/tdd-guard/test/artifacts/javascript/eslint.config.js +0 -20
- package/project-skills/tdd-guard/test/artifacts/javascript/file-with-issues.js +0 -12
- package/project-skills/tdd-guard/test/artifacts/javascript/file-without-issues.js +0 -10
- package/project-skills/tdd-guard/test/hooks/fileTypeDetection.test.ts +0 -26
- package/project-skills/tdd-guard/test/hooks/processHookData.fileType.test.ts +0 -46
- package/project-skills/tdd-guard/test/hooks/processHookData.python.test.ts +0 -68
- package/project-skills/tdd-guard/test/integration/test-context.test.ts +0 -66
- package/project-skills/tdd-guard/test/integration/validator.core.test.ts +0 -96
- package/project-skills/tdd-guard/test/integration/validator.scenarios.test.ts +0 -497
- package/project-skills/tdd-guard/test/utils/assertions.ts +0 -29
- package/project-skills/tdd-guard/test/utils/factories/contextFactory.ts +0 -30
- package/project-skills/tdd-guard/test/utils/factories/editFactory.ts +0 -82
- package/project-skills/tdd-guard/test/utils/factories/helpers.test.ts +0 -46
- package/project-skills/tdd-guard/test/utils/factories/helpers.ts +0 -46
- package/project-skills/tdd-guard/test/utils/factories/lintFactory.ts +0 -352
- package/project-skills/tdd-guard/test/utils/factories/modelClientProviderFactory.ts +0 -21
- package/project-skills/tdd-guard/test/utils/factories/multiEditFactory.ts +0 -79
- package/project-skills/tdd-guard/test/utils/factories/operations.ts +0 -57
- package/project-skills/tdd-guard/test/utils/factories/reporterFactory.ts +0 -55
- package/project-skills/tdd-guard/test/utils/factories/scenarios/index.ts +0 -22
- package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/python.ts +0 -745
- package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/typescript.ts +0 -767
- package/project-skills/tdd-guard/test/utils/factories/scenarios/types.ts +0 -77
- package/project-skills/tdd-guard/test/utils/factories/scenarios/utils.ts +0 -15
- package/project-skills/tdd-guard/test/utils/factories/sessionStartFactory.ts +0 -36
- package/project-skills/tdd-guard/test/utils/factories/testDefaults.ts +0 -90
- package/project-skills/tdd-guard/test/utils/factories/testResultsFactory.ts +0 -234
- package/project-skills/tdd-guard/test/utils/factories/todoFactory.ts +0 -99
- package/project-skills/tdd-guard/test/utils/factories/userPromptSubmitFactory.ts +0 -39
- package/project-skills/tdd-guard/test/utils/factories/writeFactory.ts +0 -70
- package/project-skills/tdd-guard/test/utils/index.ts +0 -131
- package/project-skills/tdd-guard/tsconfig.build.json +0 -16
- package/project-skills/tdd-guard/tsconfig.eslint.json +0 -17
- package/project-skills/tdd-guard/tsconfig.json +0 -32
- package/project-skills/tdd-guard/tsconfig.node.json +0 -10
- package/project-skills/tdd-guard/vitest.config.ts +0 -85
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
package parser
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"strings"
|
|
5
|
-
"testing"
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
func TestMixedReader_PassesJSONToParser(t *testing.T) {
|
|
9
|
-
input := `{"Action":"pass","Package":"example.com/pkg","Test":"TestExample"}`
|
|
10
|
-
reader := strings.NewReader(input)
|
|
11
|
-
|
|
12
|
-
mr := NewMixedReader(reader)
|
|
13
|
-
|
|
14
|
-
if len(mr.JSONLines) != 1 {
|
|
15
|
-
t.Fatalf("Expected 1 JSON line, got %d", len(mr.JSONLines))
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if mr.JSONLines[0] != input {
|
|
19
|
-
t.Errorf("Expected JSON line to be %q, got %q", input, mr.JSONLines[0])
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
func TestMixedReader_ReadsActualInput(t *testing.T) {
|
|
24
|
-
input := `{"Action":"fail","Package":"test/pkg","Test":"TestFail"}`
|
|
25
|
-
reader := strings.NewReader(input)
|
|
26
|
-
|
|
27
|
-
mr := NewMixedReader(reader)
|
|
28
|
-
|
|
29
|
-
if mr.JSONLines[0] != input {
|
|
30
|
-
t.Errorf("Expected JSON line to be %q, got %q", input, mr.JSONLines[0])
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
func TestMixedReader_BuffersNonJSONLines(t *testing.T) {
|
|
35
|
-
input := "# command-line-arguments\n"
|
|
36
|
-
reader := strings.NewReader(input)
|
|
37
|
-
|
|
38
|
-
mr := NewMixedReader(reader)
|
|
39
|
-
|
|
40
|
-
if len(mr.NonJSONLines) != 1 {
|
|
41
|
-
t.Fatalf("Expected 1 non-JSON line, got %d", len(mr.NonJSONLines))
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if mr.NonJSONLines[0] != "# command-line-arguments" {
|
|
45
|
-
t.Errorf("Expected non-JSON line to be %q, got %q", "# command-line-arguments", mr.NonJSONLines[0])
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
func TestMixedReader_SeparatesJSONFromNonJSON(t *testing.T) {
|
|
50
|
-
input := `{"Action":"pass","Package":"test"}
|
|
51
|
-
# error line
|
|
52
|
-
{"Action":"fail","Package":"test2"}`
|
|
53
|
-
reader := strings.NewReader(input)
|
|
54
|
-
|
|
55
|
-
mr := NewMixedReader(reader)
|
|
56
|
-
|
|
57
|
-
if len(mr.JSONLines) != 2 {
|
|
58
|
-
t.Fatalf("Expected 2 JSON lines, got %d", len(mr.JSONLines))
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if len(mr.NonJSONLines) != 1 {
|
|
62
|
-
t.Fatalf("Expected 1 non-JSON line, got %d", len(mr.NonJSONLines))
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if mr.NonJSONLines[0] != "# error line" {
|
|
66
|
-
t.Errorf("Expected non-JSON line to be %q, got %q", "# error line", mr.NonJSONLines[0])
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
func TestMixedReader_DetectsCompilationError(t *testing.T) {
|
|
71
|
-
input := `# command-line-arguments
|
|
72
|
-
single_import_error_test.go:5:2: no required module provides package github.com/non-existent/module
|
|
73
|
-
FAIL command-line-arguments [setup failed]`
|
|
74
|
-
reader := strings.NewReader(input)
|
|
75
|
-
|
|
76
|
-
mr := NewMixedReader(reader)
|
|
77
|
-
|
|
78
|
-
if mr.CompilationError == nil {
|
|
79
|
-
t.Fatal("Expected compilation error to be detected")
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
func TestMixedReader_NoCompilationErrorForNormalOutput(t *testing.T) {
|
|
84
|
-
input := `{"Action":"pass","Package":"test","Test":"TestSomething"}`
|
|
85
|
-
reader := strings.NewReader(input)
|
|
86
|
-
|
|
87
|
-
mr := NewMixedReader(reader)
|
|
88
|
-
|
|
89
|
-
if mr.CompilationError != nil {
|
|
90
|
-
t.Fatal("Expected no compilation error for normal JSON output")
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
func TestMixedReader_ExtractsPackageName(t *testing.T) {
|
|
95
|
-
input := `# command-line-arguments
|
|
96
|
-
single_import_error_test.go:5:2: no required module provides package github.com/non-existent/module
|
|
97
|
-
FAIL command-line-arguments [setup failed]`
|
|
98
|
-
reader := strings.NewReader(input)
|
|
99
|
-
|
|
100
|
-
mr := NewMixedReader(reader)
|
|
101
|
-
|
|
102
|
-
if mr.CompilationError == nil {
|
|
103
|
-
t.Fatal("Expected compilation error")
|
|
104
|
-
}
|
|
105
|
-
if mr.CompilationError.Package != "command-line-arguments" {
|
|
106
|
-
t.Errorf("Expected package name %q, got %q", "command-line-arguments", mr.CompilationError.Package)
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
func TestMixedReader_ExtractsDifferentPackageName(t *testing.T) {
|
|
111
|
-
input := `# github.com/example/pkg
|
|
112
|
-
error.go:10:5: undefined: SomeFunction`
|
|
113
|
-
reader := strings.NewReader(input)
|
|
114
|
-
|
|
115
|
-
mr := NewMixedReader(reader)
|
|
116
|
-
|
|
117
|
-
if mr.CompilationError == nil {
|
|
118
|
-
t.Fatal("Expected compilation error")
|
|
119
|
-
}
|
|
120
|
-
if mr.CompilationError.Package != "github.com/example/pkg" {
|
|
121
|
-
t.Errorf("Expected package name %q, got %q", "github.com/example/pkg", mr.CompilationError.Package)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
func TestMixedReader_GetCompilationErrorMessage(t *testing.T) {
|
|
126
|
-
input := `# command-line-arguments
|
|
127
|
-
single_import_error_test.go:5:2: no required module provides package github.com/non-existent/module
|
|
128
|
-
FAIL command-line-arguments [setup failed]`
|
|
129
|
-
reader := strings.NewReader(input)
|
|
130
|
-
|
|
131
|
-
mr := NewMixedReader(reader)
|
|
132
|
-
|
|
133
|
-
if mr.CompilationError == nil {
|
|
134
|
-
t.Fatal("Expected compilation error")
|
|
135
|
-
}
|
|
136
|
-
expected := "single_import_error_test.go:5:2: no required module provides package github.com/non-existent/module"
|
|
137
|
-
if len(mr.CompilationError.Messages) != 1 || mr.CompilationError.Messages[0] != expected {
|
|
138
|
-
t.Errorf("Expected error message %q, got %v", expected, mr.CompilationError.Messages)
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
func TestMixedReader_GetDifferentCompilationErrorMessage(t *testing.T) {
|
|
143
|
-
input := `# github.com/example/pkg
|
|
144
|
-
main.go:10:5: undefined: SomeFunction`
|
|
145
|
-
reader := strings.NewReader(input)
|
|
146
|
-
|
|
147
|
-
mr := NewMixedReader(reader)
|
|
148
|
-
|
|
149
|
-
if mr.CompilationError == nil {
|
|
150
|
-
t.Fatal("Expected compilation error")
|
|
151
|
-
}
|
|
152
|
-
expected := "main.go:10:5: undefined: SomeFunction"
|
|
153
|
-
if len(mr.CompilationError.Messages) != 1 || mr.CompilationError.Messages[0] != expected {
|
|
154
|
-
t.Errorf("Expected error message %q, got %v", expected, mr.CompilationError.Messages)
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
func TestMixedReader_CapturesMultipleErrorLines(t *testing.T) {
|
|
159
|
-
// Test that multiple error lines are captured
|
|
160
|
-
input := `# example.com/pkg
|
|
161
|
-
example.go:9:8: undefined: NewFormatter
|
|
162
|
-
example.go:10:12: undefined: TestEvent
|
|
163
|
-
{"Action":"fail","Package":"example.com/pkg","Elapsed":0}`
|
|
164
|
-
reader := strings.NewReader(input)
|
|
165
|
-
|
|
166
|
-
mr := NewMixedReader(reader)
|
|
167
|
-
|
|
168
|
-
if mr.CompilationError == nil {
|
|
169
|
-
t.Fatal("Expected compilation error")
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Should capture both error lines
|
|
173
|
-
if len(mr.CompilationError.Messages) != 2 {
|
|
174
|
-
t.Fatalf("Expected 2 error messages, got %d", len(mr.CompilationError.Messages))
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if mr.CompilationError.Messages[0] != "example.go:9:8: undefined: NewFormatter" {
|
|
178
|
-
t.Errorf("Expected first error message to be 'example.go:9:8: undefined: NewFormatter', got %q", mr.CompilationError.Messages[0])
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if mr.CompilationError.Messages[1] != "example.go:10:12: undefined: TestEvent" {
|
|
182
|
-
t.Errorf("Expected second error message to be 'example.go:10:12: undefined: TestEvent', got %q", mr.CompilationError.Messages[1])
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
func TestMixedReader_HandlesShortLines(t *testing.T) {
|
|
187
|
-
// This could cause a panic if we try to access line[:4] on "OK"
|
|
188
|
-
input := `# pkg
|
|
189
|
-
OK`
|
|
190
|
-
reader := strings.NewReader(input)
|
|
191
|
-
|
|
192
|
-
mr := NewMixedReader(reader)
|
|
193
|
-
|
|
194
|
-
// Should not panic
|
|
195
|
-
if mr.CompilationError != nil {
|
|
196
|
-
// OK is not an error message, just checking it doesn't panic
|
|
197
|
-
}
|
|
198
|
-
}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
package parser
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"bufio"
|
|
5
|
-
"encoding/json"
|
|
6
|
-
"io"
|
|
7
|
-
"strings"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
// TestEvent represents a test event from go test -json
|
|
11
|
-
type TestEvent struct {
|
|
12
|
-
Action string `json:"Action"`
|
|
13
|
-
Package string `json:"Package"`
|
|
14
|
-
Test string `json:"Test"`
|
|
15
|
-
Elapsed float64 `json:"Elapsed"`
|
|
16
|
-
Output string `json:"Output"`
|
|
17
|
-
ImportPath string `json:"ImportPath"`
|
|
18
|
-
FailedBuild string `json:"FailedBuild"`
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// TestState represents the state of a test
|
|
22
|
-
type TestState string
|
|
23
|
-
|
|
24
|
-
const (
|
|
25
|
-
StatePassed TestState = "passed"
|
|
26
|
-
StateFailed TestState = "failed"
|
|
27
|
-
StateSkipped TestState = "skipped"
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
// PackageResults holds test results for a package
|
|
31
|
-
type PackageResults map[string]TestState
|
|
32
|
-
|
|
33
|
-
// Results holds all package results
|
|
34
|
-
type Results map[string]PackageResults
|
|
35
|
-
|
|
36
|
-
// Parser parses go test JSON output
|
|
37
|
-
type Parser struct {
|
|
38
|
-
results Results
|
|
39
|
-
errorOutputs map[string]string
|
|
40
|
-
testOutputs map[string]map[string]string // Track test output content
|
|
41
|
-
buildFailures map[string]string // Track build failures and their output
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// NewParser creates a new parser
|
|
45
|
-
func NewParser() *Parser {
|
|
46
|
-
return &Parser{
|
|
47
|
-
results: make(Results),
|
|
48
|
-
errorOutputs: make(map[string]string),
|
|
49
|
-
testOutputs: make(map[string]map[string]string),
|
|
50
|
-
buildFailures: make(map[string]string),
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Parse reads from the provided reader
|
|
55
|
-
func (p *Parser) Parse(reader io.Reader) error {
|
|
56
|
-
scanner := bufio.NewScanner(reader)
|
|
57
|
-
|
|
58
|
-
for scanner.Scan() {
|
|
59
|
-
var event TestEvent
|
|
60
|
-
if err := json.Unmarshal(scanner.Bytes(), &event); err != nil {
|
|
61
|
-
continue // Skip malformed JSON
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
p.processEvent(&event)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return scanner.Err()
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// processEvent handles a single test event
|
|
71
|
-
func (p *Parser) processEvent(event *TestEvent) {
|
|
72
|
-
// Handle build events (they have ImportPath instead of Package)
|
|
73
|
-
if event.ImportPath != "" && event.Action == "build-output" {
|
|
74
|
-
p.buildFailures[event.ImportPath] += event.Output
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Handle build failure events
|
|
79
|
-
if event.Action == "fail" && event.FailedBuild != "" {
|
|
80
|
-
p.ensurePackageExists(event.Package)
|
|
81
|
-
p.results[event.Package]["CompilationError"] = StateFailed
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Skip events without package
|
|
86
|
-
if event.Package == "" {
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
p.ensurePackageExists(event.Package)
|
|
91
|
-
|
|
92
|
-
if event.Test == "" {
|
|
93
|
-
p.processPackageEvent(event)
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
p.processTestEvent(event)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// ensurePackageExists creates package maps if they don't exist
|
|
101
|
-
func (p *Parser) ensurePackageExists(pkg string) {
|
|
102
|
-
if p.results[pkg] == nil {
|
|
103
|
-
p.results[pkg] = make(PackageResults)
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// processPackageEvent handles package-level events (no test name)
|
|
108
|
-
func (p *Parser) processPackageEvent(event *TestEvent) {
|
|
109
|
-
if event.Action == "output" {
|
|
110
|
-
p.errorOutputs[event.Package] += event.Output
|
|
111
|
-
}
|
|
112
|
-
// Handle package-level fail (build failure without FailedBuild flag)
|
|
113
|
-
if event.Action == "fail" {
|
|
114
|
-
// Package failed but has no tests - this is a build failure
|
|
115
|
-
if len(p.results[event.Package]) == 0 {
|
|
116
|
-
p.results[event.Package]["CompilationError"] = StateFailed
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// processTestEvent handles test-specific events
|
|
122
|
-
func (p *Parser) processTestEvent(event *TestEvent) {
|
|
123
|
-
switch event.Action {
|
|
124
|
-
case "output":
|
|
125
|
-
p.captureTestOutput(event)
|
|
126
|
-
case "pass", "fail", "skip":
|
|
127
|
-
p.recordTestState(event)
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// captureTestOutput captures output for a specific test
|
|
132
|
-
func (p *Parser) captureTestOutput(event *TestEvent) {
|
|
133
|
-
if p.testOutputs[event.Package] == nil {
|
|
134
|
-
p.testOutputs[event.Package] = make(map[string]string)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Skip RUN and FAIL lines
|
|
138
|
-
if strings.HasPrefix(event.Output, "=== RUN") || strings.HasPrefix(event.Output, "--- FAIL") {
|
|
139
|
-
return
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Trim leading whitespace and append to existing output
|
|
143
|
-
p.testOutputs[event.Package][event.Test] += strings.TrimLeft(event.Output, " \t")
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// recordTestState records the final state of a test
|
|
147
|
-
func (p *Parser) recordTestState(event *TestEvent) {
|
|
148
|
-
var state TestState
|
|
149
|
-
switch event.Action {
|
|
150
|
-
case "pass":
|
|
151
|
-
state = StatePassed
|
|
152
|
-
p.ensureTestOutputExists(event.Package, event.Test)
|
|
153
|
-
case "fail":
|
|
154
|
-
state = StateFailed
|
|
155
|
-
case "skip":
|
|
156
|
-
state = StateSkipped
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
p.results[event.Package][event.Test] = state
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// ensureTestOutputExists ensures test output map exists for passed tests
|
|
163
|
-
func (p *Parser) ensureTestOutputExists(pkg, test string) {
|
|
164
|
-
if p.testOutputs[pkg] == nil {
|
|
165
|
-
p.testOutputs[pkg] = make(map[string]string)
|
|
166
|
-
}
|
|
167
|
-
if _, exists := p.testOutputs[pkg][test]; !exists {
|
|
168
|
-
p.testOutputs[pkg][test] = ""
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// GetResults returns the parsed results with parent tests filtered out
|
|
173
|
-
func (p *Parser) GetResults() Results {
|
|
174
|
-
filtered := make(Results)
|
|
175
|
-
|
|
176
|
-
for pkg, tests := range p.results {
|
|
177
|
-
filtered[pkg] = filterParentTests(tests)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return filtered
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// filterParentTests removes tests that have subtests from the results
|
|
184
|
-
func filterParentTests(tests PackageResults) PackageResults {
|
|
185
|
-
filtered := make(PackageResults)
|
|
186
|
-
|
|
187
|
-
for testName, testState := range tests {
|
|
188
|
-
if !hasSubtests(testName, tests) {
|
|
189
|
-
filtered[testName] = testState
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return filtered
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// hasSubtests checks if a test has any subtests
|
|
197
|
-
func hasSubtests(testName string, allTests PackageResults) bool {
|
|
198
|
-
for otherTest := range allTests {
|
|
199
|
-
if isSubtestOf(otherTest, testName) {
|
|
200
|
-
return true
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return false
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// isSubtestOf checks if child is a subtest of parent
|
|
207
|
-
func isSubtestOf(child, parent string) bool {
|
|
208
|
-
return len(child) > len(parent) &&
|
|
209
|
-
child[:len(parent)] == parent &&
|
|
210
|
-
child[len(parent)] == '/'
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// GetErrorOutput returns captured error output for a package
|
|
214
|
-
func (p *Parser) GetErrorOutput(pkg string) string {
|
|
215
|
-
return p.errorOutputs[pkg]
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// GetTestOutput returns captured output for a specific test
|
|
219
|
-
func (p *Parser) GetTestOutput(pkg, test string) string {
|
|
220
|
-
// Special case for CompilationError - get build failure message
|
|
221
|
-
if test == "CompilationError" {
|
|
222
|
-
// Find the build failure for this package
|
|
223
|
-
for _, msg := range p.buildFailures {
|
|
224
|
-
// The build failure message contains the error details
|
|
225
|
-
if msg != "" {
|
|
226
|
-
return strings.TrimSpace(msg)
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if p.testOutputs[pkg] == nil {
|
|
232
|
-
return ""
|
|
233
|
-
}
|
|
234
|
-
output, exists := p.testOutputs[pkg][test]
|
|
235
|
-
if !exists {
|
|
236
|
-
return ""
|
|
237
|
-
}
|
|
238
|
-
// Trim trailing whitespace/newlines
|
|
239
|
-
return strings.TrimRight(output, "\n")
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// GetBuildFailure returns captured build failure output for a package
|
|
243
|
-
func (p *Parser) GetBuildFailure(importPath string) string {
|
|
244
|
-
return p.buildFailures[importPath]
|
|
245
|
-
}
|