|
| 1 | +# Task 1 Report: Establish the Release Contract |
| 2 | + |
| 3 | +## Result |
| 4 | + |
| 5 | +Implemented the desktop release-config validator, its behavioral tests, and the two requested npm scripts. The final package matrix was not added; that remains owned by Task 3. |
| 6 | + |
| 7 | +## TDD evidence |
| 8 | + |
| 9 | +### RED |
| 10 | + |
| 11 | +Command: |
| 12 | + |
| 13 | +```bash |
| 14 | +node --test scripts/verify-desktop-release-config.test.mjs |
| 15 | +``` |
| 16 | + |
| 17 | +Output: |
| 18 | + |
| 19 | +```text |
| 20 | +TAP version 13 |
| 21 | +# Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/cc/Documents/Codex/codex-pet-pause-desktop/.worktrees/cross-platform-release/scripts/verify-desktop-release-config.mjs' imported from /Users/cc/Documents/Codex/codex-pet-pause-desktop/.worktrees/cross-platform-release/scripts/verify-desktop-release-config.test.mjs |
| 22 | +# Subtest: scripts/verify-desktop-release-config.test.mjs |
| 23 | +not ok 1 - scripts/verify-desktop-release-config.test.mjs |
| 24 | +1..1 |
| 25 | +# tests 1 |
| 26 | +# pass 0 |
| 27 | +# fail 1 |
| 28 | +``` |
| 29 | + |
| 30 | +The test failed because the contract module did not exist, as required for the RED step. |
| 31 | + |
| 32 | +### GREEN |
| 33 | + |
| 34 | +Command: |
| 35 | + |
| 36 | +```bash |
| 37 | +npm run test:desktop-release-config |
| 38 | +``` |
| 39 | + |
| 40 | +Output: |
| 41 | + |
| 42 | +```text |
| 43 | +> codex-pet-pause@0.2.0 test:desktop-release-config |
| 44 | +> node --test scripts/verify-desktop-release-config.test.mjs |
| 45 | +
|
| 46 | +TAP version 13 |
| 47 | +# Subtest: accepts the approved desktop release contract |
| 48 | +ok 1 - accepts the approved desktop release contract |
| 49 | +# Subtest: rejects an identity, target, or icon regression |
| 50 | +ok 2 - rejects an identity, target, or icon regression |
| 51 | +1..2 |
| 52 | +# tests 2 |
| 53 | +# pass 2 |
| 54 | +# fail 0 |
| 55 | +``` |
| 56 | + |
| 57 | +## Files |
| 58 | + |
| 59 | +- `scripts/verify-desktop-release-config.mjs`: Exports `verifyDesktopReleaseConfig(packageJson, fileExists)`, validates the approved identity, platform targets, and icon existence, and provides the standalone `check:desktop-release-config` entry point. |
| 60 | +- `scripts/verify-desktop-release-config.test.mjs`: Covers acceptance of the approved contract and rejection of identity, target, and icon regressions. |
| 61 | +- `package.json`: Adds `test:desktop-release-config` and `check:desktop-release-config`. |
| 62 | + |
| 63 | +## Self-review |
| 64 | + |
| 65 | +- The implementation follows the exact validator shape and values from the task brief. |
| 66 | +- The injected `fileExists` function keeps the validator deterministic and directly testable. |
| 67 | +- Missing target entries and missing architecture entries produce human-readable failures rather than throwing. |
| 68 | +- No final Electron Builder package matrix or generated icon assets were added. |
| 69 | + |
| 70 | +## Concerns |
| 71 | + |
| 72 | +- `check:desktop-release-config` is expected to fail in this task state because `package.json` does not yet contain the final macOS, Windows, and Linux target configuration and the required icon assets are not present. Those changes belong to later release tasks. |
| 73 | +- Artifact-name templates are present in the behavioral fixture but are not validated by the prescribed validator implementation. |
| 74 | + |
| 75 | +## Fix round 1 evidence |
| 76 | + |
| 77 | +### RED mutations |
| 78 | + |
| 79 | +Added mutations for wrong configured native icon paths with `fileExists` returning `true`, plus extra `zip`, `nsis-web`, and `snap` targets. Before the validator changes: |
| 80 | + |
| 81 | +```bash |
| 82 | +node --test scripts/verify-desktop-release-config.test.mjs |
| 83 | +``` |
| 84 | + |
| 85 | +```text |
| 86 | +TAP version 13 |
| 87 | +# Subtest: accepts the approved desktop release contract |
| 88 | +ok 1 - accepts the approved desktop release contract |
| 89 | +# Subtest: rejects an identity, target, or icon regression |
| 90 | +ok 2 - rejects an identity, target, or icon regression |
| 91 | +# Subtest: rejects wrong configured native icon paths even when expected files exist |
| 92 | +not ok 3 - rejects wrong configured native icon paths even when expected files exist |
| 93 | +# Subtest: rejects unintended extra target formats on every platform |
| 94 | +not ok 4 - rejects unintended extra target formats on every platform |
| 95 | +1..4 |
| 96 | +# tests 4 |
| 97 | +# pass 2 |
| 98 | +# fail 2 |
| 99 | +``` |
| 100 | + |
| 101 | +### GREEN focused test |
| 102 | + |
| 103 | +```bash |
| 104 | +npm run test:desktop-release-config |
| 105 | +``` |
| 106 | + |
| 107 | +```text |
| 108 | +TAP version 13 |
| 109 | +# Subtest: accepts the approved desktop release contract |
| 110 | +ok 1 - accepts the approved desktop release contract |
| 111 | +# Subtest: rejects an identity, target, or icon regression |
| 112 | +ok 2 - rejects an identity, target, or icon regression |
| 113 | +# Subtest: rejects wrong configured native icon paths even when expected files exist |
| 114 | +ok 3 - rejects wrong configured native icon paths even when expected files exist |
| 115 | +# Subtest: rejects unintended extra target formats on every platform |
| 116 | +ok 4 - rejects unintended extra target formats on every platform |
| 117 | +1..4 |
| 118 | +# tests 4 |
| 119 | +# pass 4 |
| 120 | +# fail 0 |
| 121 | +``` |
| 122 | + |
| 123 | +### Direct check |
| 124 | + |
| 125 | +```bash |
| 126 | +npm run check:desktop-release-config |
| 127 | +``` |
| 128 | + |
| 129 | +Expected current-package failure (exit code 1): |
| 130 | + |
| 131 | +```text |
| 132 | +Error: macOS targets must be exactly dmg |
| 133 | +macOS DMG must target arm64 and x64 |
| 134 | +Windows targets must be exactly nsis |
| 135 | +Windows NSIS must target x64 |
| 136 | +Linux targets must be exactly AppImage and deb |
| 137 | +Linux AppImage must target x64 |
| 138 | +Linux DEB must target x64 |
| 139 | +macOS icon must be configured as build/icons/icon.icns |
| 140 | +macOS icon is missing: build/icons/icon.icns |
| 141 | +Windows icon must be configured as build/icons/icon.ico |
| 142 | +Windows icon is missing: build/icons/icon.ico |
| 143 | +Linux icon must be configured as build/icons/png |
| 144 | +Linux icon is missing: build/icons/png |
| 145 | +``` |
| 146 | + |
| 147 | +## Fix round 1 changes |
| 148 | + |
| 149 | +- Native icon validation now compares each configured platform icon with its expected native path before checking file existence. |
| 150 | +- Target validation now rejects any platform target-name set other than macOS `dmg`, Windows `nsis`, and Linux `AppImage` plus `deb`, while retaining the required architecture checks. |
0 commit comments