@boyingliu01/xp-gate 0.39.0 → 0.39.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.
Files changed (150) hide show
  1. package/package.json +1 -1
  2. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  3. package/plugins/claude-code/skills/delphi-review/AGENTS.md +1 -1
  4. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +1 -1
  5. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +1 -1
  6. package/plugins/dsh/package.json +1 -1
  7. package/plugins/dsh/skills/delphi-review/AGENTS.md +1 -1
  8. package/plugins/dsh/skills/sprint-flow/AGENTS.md +1 -1
  9. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +1 -1
  10. package/plugins/opencode/package.json +1 -1
  11. package/plugins/opencode/skills/delphi-review/AGENTS.md +1 -1
  12. package/plugins/opencode/skills/sprint-flow/AGENTS.md +1 -1
  13. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +1 -1
  14. package/plugins/qoder/plugin.json +1 -1
  15. package/plugins/qoder/skills/delphi-review/AGENTS.md +1 -1
  16. package/plugins/qoder/skills/sprint-flow/AGENTS.md +1 -1
  17. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +1 -1
  18. package/skills/delphi-review/AGENTS.md +1 -1
  19. package/skills/sprint-flow/AGENTS.md +1 -1
  20. package/skills/test-specification-alignment/AGENTS.md +1 -1
  21. package/plugins/claude-code/skills/reinstall-xp-gate/.architecture-skip +0 -8
  22. package/plugins/claude-code/skills/reinstall-xp-gate/.github/workflows/test.yml +0 -106
  23. package/plugins/claude-code/skills/reinstall-xp-gate/CHANGELOG.md +0 -379
  24. package/plugins/claude-code/skills/reinstall-xp-gate/LICENSE +0 -21
  25. package/plugins/claude-code/skills/reinstall-xp-gate/QUALITY-OVERVIEW.md +0 -173
  26. package/plugins/claude-code/skills/reinstall-xp-gate/README.md +0 -167
  27. package/plugins/claude-code/skills/reinstall-xp-gate/SKILL.md +0 -271
  28. package/plugins/claude-code/skills/reinstall-xp-gate/TODO.md +0 -253
  29. package/plugins/claude-code/skills/reinstall-xp-gate/VERSION +0 -1
  30. package/plugins/claude-code/skills/reinstall-xp-gate/package.json +0 -28
  31. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/audit.mjs +0 -193
  32. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/coverage.mjs +0 -140
  33. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/hp-gate.mjs +0 -175
  34. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/install.mjs +0 -64
  35. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/agent-paths.mjs +0 -67
  36. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/agents.mjs +0 -247
  37. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/backups.mjs +0 -96
  38. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/baseline.mjs +0 -101
  39. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/ccn.mjs +0 -124
  40. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/delphi.mjs +0 -61
  41. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/fs-tree.mjs +0 -108
  42. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/gatecheck.mjs +0 -290
  43. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/json-file.mjs +0 -37
  44. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/mutations.mjs +0 -154
  45. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/platform.mjs +0 -92
  46. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/probes.mjs +0 -102
  47. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/proc.mjs +0 -33
  48. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/report.mjs +0 -29
  49. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/residue.mjs +0 -188
  50. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/selfsync.mjs +0 -75
  51. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/skills.mjs +0 -121
  52. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/spawn.mjs +0 -161
  53. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/testreport.mjs +0 -26
  54. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/tools.mjs +0 -238
  55. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/util.mjs +0 -33
  56. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/verdict.mjs +0 -45
  57. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/version.mjs +0 -29
  58. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/lib/xp-cli.mjs +0 -66
  59. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/mutation.mjs +0 -132
  60. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/preflight.mjs +0 -75
  61. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/reinstall.mjs +0 -297
  62. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/setup-wsl.sh +0 -633
  63. package/plugins/claude-code/skills/reinstall-xp-gate/scripts/verify.mjs +0 -222
  64. package/plugins/claude-code/skills/reinstall-xp-gate/tests/agents.test.mjs +0 -168
  65. package/plugins/claude-code/skills/reinstall-xp-gate/tests/baseline.test.mjs +0 -104
  66. package/plugins/claude-code/skills/reinstall-xp-gate/tests/ccn.test.mjs +0 -87
  67. package/plugins/claude-code/skills/reinstall-xp-gate/tests/cleanup.test.mjs +0 -128
  68. package/plugins/claude-code/skills/reinstall-xp-gate/tests/coverage.test.mjs +0 -69
  69. package/plugins/claude-code/skills/reinstall-xp-gate/tests/delphi.test.mjs +0 -78
  70. package/plugins/claude-code/skills/reinstall-xp-gate/tests/fixtures.mjs +0 -61
  71. package/plugins/claude-code/skills/reinstall-xp-gate/tests/gatecheck-audit.test.mjs +0 -157
  72. package/plugins/claude-code/skills/reinstall-xp-gate/tests/gatecheck.test.mjs +0 -57
  73. package/plugins/claude-code/skills/reinstall-xp-gate/tests/mutation-anchors.test.mjs +0 -49
  74. package/plugins/claude-code/skills/reinstall-xp-gate/tests/proc-contract.test.mjs +0 -58
  75. package/plugins/claude-code/skills/reinstall-xp-gate/tests/proc.test.mjs +0 -243
  76. package/plugins/claude-code/skills/reinstall-xp-gate/tests/report.test.mjs +0 -66
  77. package/plugins/claude-code/skills/reinstall-xp-gate/tests/residue.test.mjs +0 -278
  78. package/plugins/claude-code/skills/reinstall-xp-gate/tests/selfsync.test.mjs +0 -70
  79. package/plugins/claude-code/skills/reinstall-xp-gate/tests/skills.test.mjs +0 -171
  80. package/plugins/claude-code/skills/reinstall-xp-gate/tests/testreport.test.mjs +0 -40
  81. package/plugins/claude-code/skills/reinstall-xp-gate/tests/timeout-budgets.test.mjs +0 -38
  82. package/plugins/claude-code/skills/reinstall-xp-gate/tests/tools-leaf.test.mjs +0 -323
  83. package/plugins/claude-code/skills/reinstall-xp-gate/tests/tools-probe.test.mjs +0 -350
  84. package/plugins/claude-code/skills/reinstall-xp-gate/tests/tools.test.mjs +0 -131
  85. package/plugins/claude-code/skills/reinstall-xp-gate/tests/util.test.mjs +0 -154
  86. package/plugins/opencode/skills/reinstall-xp-gate/.architecture-skip +0 -8
  87. package/plugins/opencode/skills/reinstall-xp-gate/.github/workflows/test.yml +0 -106
  88. package/plugins/opencode/skills/reinstall-xp-gate/CHANGELOG.md +0 -379
  89. package/plugins/opencode/skills/reinstall-xp-gate/LICENSE +0 -21
  90. package/plugins/opencode/skills/reinstall-xp-gate/QUALITY-OVERVIEW.md +0 -173
  91. package/plugins/opencode/skills/reinstall-xp-gate/README.md +0 -167
  92. package/plugins/opencode/skills/reinstall-xp-gate/SKILL.md +0 -271
  93. package/plugins/opencode/skills/reinstall-xp-gate/TODO.md +0 -253
  94. package/plugins/opencode/skills/reinstall-xp-gate/VERSION +0 -1
  95. package/plugins/opencode/skills/reinstall-xp-gate/package.json +0 -28
  96. package/plugins/opencode/skills/reinstall-xp-gate/scripts/audit.mjs +0 -193
  97. package/plugins/opencode/skills/reinstall-xp-gate/scripts/coverage.mjs +0 -140
  98. package/plugins/opencode/skills/reinstall-xp-gate/scripts/hp-gate.mjs +0 -175
  99. package/plugins/opencode/skills/reinstall-xp-gate/scripts/install.mjs +0 -64
  100. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/agent-paths.mjs +0 -67
  101. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/agents.mjs +0 -247
  102. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/backups.mjs +0 -96
  103. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/baseline.mjs +0 -101
  104. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/ccn.mjs +0 -124
  105. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/delphi.mjs +0 -61
  106. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/fs-tree.mjs +0 -108
  107. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/gatecheck.mjs +0 -290
  108. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/json-file.mjs +0 -37
  109. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/mutations.mjs +0 -154
  110. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/platform.mjs +0 -92
  111. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/probes.mjs +0 -102
  112. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/proc.mjs +0 -33
  113. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/report.mjs +0 -29
  114. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/residue.mjs +0 -188
  115. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/selfsync.mjs +0 -75
  116. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/skills.mjs +0 -121
  117. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/spawn.mjs +0 -161
  118. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/testreport.mjs +0 -26
  119. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/tools.mjs +0 -238
  120. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/util.mjs +0 -33
  121. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/verdict.mjs +0 -45
  122. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/version.mjs +0 -29
  123. package/plugins/opencode/skills/reinstall-xp-gate/scripts/lib/xp-cli.mjs +0 -66
  124. package/plugins/opencode/skills/reinstall-xp-gate/scripts/mutation.mjs +0 -132
  125. package/plugins/opencode/skills/reinstall-xp-gate/scripts/preflight.mjs +0 -75
  126. package/plugins/opencode/skills/reinstall-xp-gate/scripts/reinstall.mjs +0 -297
  127. package/plugins/opencode/skills/reinstall-xp-gate/scripts/setup-wsl.sh +0 -633
  128. package/plugins/opencode/skills/reinstall-xp-gate/scripts/verify.mjs +0 -222
  129. package/plugins/opencode/skills/reinstall-xp-gate/tests/agents.test.mjs +0 -168
  130. package/plugins/opencode/skills/reinstall-xp-gate/tests/baseline.test.mjs +0 -104
  131. package/plugins/opencode/skills/reinstall-xp-gate/tests/ccn.test.mjs +0 -87
  132. package/plugins/opencode/skills/reinstall-xp-gate/tests/cleanup.test.mjs +0 -128
  133. package/plugins/opencode/skills/reinstall-xp-gate/tests/coverage.test.mjs +0 -69
  134. package/plugins/opencode/skills/reinstall-xp-gate/tests/delphi.test.mjs +0 -78
  135. package/plugins/opencode/skills/reinstall-xp-gate/tests/fixtures.mjs +0 -61
  136. package/plugins/opencode/skills/reinstall-xp-gate/tests/gatecheck-audit.test.mjs +0 -157
  137. package/plugins/opencode/skills/reinstall-xp-gate/tests/gatecheck.test.mjs +0 -57
  138. package/plugins/opencode/skills/reinstall-xp-gate/tests/mutation-anchors.test.mjs +0 -49
  139. package/plugins/opencode/skills/reinstall-xp-gate/tests/proc-contract.test.mjs +0 -58
  140. package/plugins/opencode/skills/reinstall-xp-gate/tests/proc.test.mjs +0 -243
  141. package/plugins/opencode/skills/reinstall-xp-gate/tests/report.test.mjs +0 -66
  142. package/plugins/opencode/skills/reinstall-xp-gate/tests/residue.test.mjs +0 -278
  143. package/plugins/opencode/skills/reinstall-xp-gate/tests/selfsync.test.mjs +0 -70
  144. package/plugins/opencode/skills/reinstall-xp-gate/tests/skills.test.mjs +0 -171
  145. package/plugins/opencode/skills/reinstall-xp-gate/tests/testreport.test.mjs +0 -40
  146. package/plugins/opencode/skills/reinstall-xp-gate/tests/timeout-budgets.test.mjs +0 -38
  147. package/plugins/opencode/skills/reinstall-xp-gate/tests/tools-leaf.test.mjs +0 -323
  148. package/plugins/opencode/skills/reinstall-xp-gate/tests/tools-probe.test.mjs +0 -350
  149. package/plugins/opencode/skills/reinstall-xp-gate/tests/tools.test.mjs +0 -131
  150. package/plugins/opencode/skills/reinstall-xp-gate/tests/util.test.mjs +0 -154
@@ -1,106 +0,0 @@
1
- name: test
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- schedule:
8
- # A green suite proves the tests agree with the code on the day it was
9
- # written. The gate audit below depends on the *installed* xp-gate release,
10
- # which changes without this repo changing -- hence the weekly run.
11
- - cron: '0 3 * * 1'
12
-
13
- # Least privilege: this workflow only reads the repo and runs local commands.
14
- # Without an explicit block GitHub defaults to write-all, which is CKV2_GHA_1.
15
- permissions:
16
- contents: read
17
-
18
- jobs:
19
- test:
20
- name: tests (node ${{ matrix.node }})
21
- runs-on: ubuntu-latest
22
- strategy:
23
- fail-fast: false
24
- matrix:
25
- # Node 18 EOL 2025-04-30, Node 20 EOL 2026-04-30: neither gets security
26
- # patches any more, and setup-node keeps dropping prebuilt EOL releases,
27
- # which would turn this matrix red for reasons unrelated to this repo.
28
- # 22 is supported to 2027-04-30, 24 to 2028-04-30, 26 to 2029-04-30.
29
- node: ['22', '24', '26']
30
- steps:
31
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
32
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
33
- with:
34
- node-version: ${{ matrix.node }}
35
- # No `npm install`: the suite uses the built-in node:test runner and has
36
- # no dependencies. An empty install step would only add a failure mode.
37
- - run: node --test tests/*.test.mjs
38
- # The coverage floor Gate 5 enforces locally. Node 22+ prints the numbers;
39
- # scripts/coverage.mjs translates them to the istanbul artefact the gate
40
- # reads, so this repo does not need vitest just to satisfy a file shape.
41
- # Runs on the LTS line only: --experimental-test-coverage is still flagged
42
- # experimental, and its exact percentages drift between majors, so
43
- # reporting from a single version keeps the number reproducible.
44
- - if: matrix.node == '26'
45
- run: node scripts/coverage.mjs
46
-
47
- mutation:
48
- name: mutation gate
49
- runs-on: ubuntu-latest
50
- steps:
51
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
52
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
53
- with:
54
- node-version: '26'
55
- # Fails if any injected defect survives the suite, i.e. if a property this
56
- # skill exists to guarantee has stopped being tested. See scripts/mutation.mjs.
57
- - run: node scripts/mutation.mjs
58
-
59
- hp-gate:
60
- name: complexity of .mjs sources
61
- runs-on: ubuntu-latest
62
- steps:
63
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
64
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
65
- with:
66
- node-version: '26'
67
- - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
68
- with:
69
- python-version: '3.12'
70
- - run: pip install lizard
71
- # xp-gate's Gate 3 never looks at this repo. Its LIZARD_EXTENSIONS and
72
- # SEMGREP_EXTENSIONS are /\.(ts|tsx|js|jsx|py|go|java|...)$/ -- neither
73
- # lists mjs -- so a pure-ESM project reports "no source files to check"
74
- # and passes Gate 3 on complexity without measuring a single function
75
- # (xp-gate#732, reproduced: the same code as src/a.js is checked and the
76
- # same code as src/a.mjs is skipped). hp-gate runs lizard over
77
- # .mjs/.cjs with the same CCN 5 threshold Gate 3 uses, so the number that
78
- # would have been checked is now checked here.
79
- - run: node scripts/hp-gate.mjs
80
-
81
- gate-audit:
82
- name: gates actually block
83
- runs-on: ubuntu-latest
84
- if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
85
- steps:
86
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
87
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
88
- with:
89
- node-version: '26'
90
- - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
91
- with:
92
- python-version: '3.12'
93
- - name: Install xp-gate
94
- run: npm install -g @boyingliu01/xp-gate
95
- - name: Install gate tools
96
- run: |
97
- pip install semgrep lizard
98
- npm install -g jscpd
99
- # Gray-box: plant a defect the gate is responsible for catching and require
100
- # the gate to say so. A gate that passes a dirty tree is broken, and no
101
- # amount of hash comparison in verify.mjs would reveal it.
102
- #
103
- # Skipped on push/PR because it installs a toolchain and runs the real CLI;
104
- # the point is to catch an upstream regression after it ships, not to gate
105
- # this repo's own commits.
106
- - run: node scripts/audit.mjs --gates
@@ -1,379 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this skill are documented here.
4
- Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
5
- versioning is [Semantic Versioning](https://semver.org/).
6
-
7
- ## [2.0.2] - 2026-11-24
8
-
9
- ### Fixed
10
-
11
- - **An uninstalled agent stayed "live" because xp-gate's own writes looked like
12
- the user coming back** (issue #4). `probeLiveness` falls through to a recency
13
- check once the app directory and the CLI are both gone, and that check reads
14
- the config directory's mtime. xp-gate itself writes `tui.json` and `skills/`
15
- there, and creating either refreshes the mtime -- so the evidence of use was
16
- the checker's own output, and a removed OpenCode kept receiving twelve skills
17
- on every install forever.
18
-
19
- A home holding only those two entries is now treated as residue. A home that
20
- also contains something the agent or its user made still counts as live, and
21
- so does an empty home: that is a fresh install with no skills yet, which is
22
- the machine that most needs them.
23
-
24
- This release exists because 2.0.1 was tagged before the fix landed; the six
25
- installed copies on this machine were verified to move to it.
26
-
27
- ## [2.0.1] - 2026-11-24
28
-
29
- ### Fixed
30
-
31
- - **The mutation gate reported a clean run while silently skipping eight of its
32
- own checks.** Refactoring `util.mjs` into `fs-tree.mjs`, and moving
33
- `cmpVersion` to `version.mjs`, left eight mutations anchored to text that had
34
- moved. Each printed `[skip] anchor not found`, and the script still ended with
35
- "every mutated defect was caught" and exit code 0 -- so eight of nineteen
36
- property checks disappeared and the gate looked healthier than before. Since
37
- this project exists to catch exactly "the gate passed but measured nothing",
38
- that was the worst possible failure mode for it to have.
39
-
40
- Fixed at both ends: the table moved to `scripts/lib/mutations.mjs` so it can
41
- be imported (the mutator has top-level side effects and cannot be), and
42
- `tests/mutation-anchors.test.mjs` now fails when an anchor or its target file
43
- is gone. A skipped mutation also exits 1 and no longer prints the all-clear.
44
- Verified by planting a bogus anchor and watching the run fail.
45
-
46
- - **`pipLatest` exceeded the CCN ceiling while being moved.** Spelling its
47
- injectable defaults as `deps.x || realX` cost three branches and reached CCN 7
48
- against a limit of 5; they are a lookup table now.
49
-
50
- ### Changed
51
-
52
- - **Four modules were split by responsibility**, which cleared Gate 4's last
53
- four `many-exports` findings (4 -> 0):
54
- `proc.mjs` -> `platform.mjs` / `spawn.mjs` / `xp-cli.mjs`;
55
- `util.mjs` -> `fs-tree.mjs` / `json-file.mjs` / `backups.mjs`;
56
- `tools.mjs` -> `version.mjs` / `probes.mjs`;
57
- `agents.mjs` -> `agent-paths.mjs`.
58
-
59
- The original four remain the import surface and re-export everything, so no
60
- import site changed and the public API is byte-for-byte the same. That is
61
- pinned by `tests/proc-contract.test.mjs` rather than left to review.
62
-
63
- ### Documentation
64
-
65
- - Corrected the quality overview's Gate 3 claim. It said Gate 3 cannot see this
66
- repo because `LIZARD_EXTENSIONS` lacks `mjs`/`cjs`; a control experiment shows
67
- the opposite -- with one staged `.mjs` it prints "All functions within
68
- complexity threshold", and a fixture containing only an over-complex `.mjs` is
69
- BLOCKED. The `SKIPPED` on a clean tree means "nothing changed", not "cannot
70
- see". No upstream issue was filed for it.
71
-
72
- ## [2.0.0] - 2026-11-23
73
-
74
- ### Changed (BREAKING)
75
-
76
- - **Renamed the skill and the repository `xp-gate-reinstall` ->
77
- `reinstall-xp-gate`.**
78
-
79
- The old name read as if this skill belonged to xp-gate, and that reading is
80
- not harmless: the whole point of the skill is to uninstall and reinstall
81
- xp-gate, so shipping it as part of xp-gate would mean the tool removes itself
82
- mid-run. It has to live outside. The name now says what it does instead of
83
- what it acts on.
84
-
85
- What changed: the `name:` in `SKILL.md`, the directory `install.mjs` writes
86
- into each agent root, the canonical copy under
87
- `~/.local/share/xp-gate/skills/`, the repo URL, and the `.bashrc` block
88
- markers written by `setup-wsl.sh`.
89
-
90
- ### Added
91
-
92
- - **Automatic cleanup of the pre-2.0.0 copies.** Renaming the directory would
93
- otherwise leave an `xp-gate-reinstall/` in every agent root on every machine
94
- that had run the old installer, and nothing would ever update it again -- the
95
- package no longer ships anything under that name -- so each box would
96
- accumulate a permanent stale skill that still looks live.
97
- `pruneDeadRoots` now sweeps both names.
98
-
99
- The sweep matches on the `SKILL.md` `name:` marker, not on the directory name
100
- alone. The previous version deleted `xp-gate-reinstall/` unconditionally, so a
101
- user who had edited their copy would have lost those edits with no warning;
102
- that is now covered by a test.
103
-
104
- - `setup-wsl.sh` recognises the old `# >>> xp-gate-reinstall >>>` block in
105
- `~/.bashrc` as already present. Without it, a re-run on an existing machine
106
- would append a second block with competing `EDITOR` and alias definitions.
107
-
108
- ### Notes
109
-
110
- - `setup-wsl.sh` claimed xp-gate's package had shipped this skill since v1.2.2.
111
- Measured on 0.38.125: its `skills/` holds 12 skills and this is not one of
112
- them. The comment now records that, while keeping the "sync last" ordering so
113
- machines still on an older package are unaffected.
114
-
115
- ## [1.3.3] - 2026-02-21
116
-
117
- ### Fixed
118
-
119
- - **A doctor FAIL that could only be fixed by reinstalling the editor the user
120
- deliberately removed.** `doctor-tui.js` requires `~/.config/opencode/tui.json`
121
- unconditionally and reports `TUI registration: FAIL / Not registered` when it
122
- is absent, without ever asking whether OpenCode exists. Once OpenCode was
123
- uninstalled the check became unsatisfiable by design, and `verify.mjs` passed
124
- every doctor FAIL straight through — so a correct configuration reported as a
125
- broken one.
126
-
127
- `agentInstalled` (new, in `lib/agents.mjs`) resolves the agent's CLI, and
128
- `verify.mjs` now reports this one check as `SKIP` with the reason attached
129
- rather than `FAIL`. The branch is gated on the CLI actually being absent, so a
130
- machine that still uses OpenCode keeps failing loudly when its TUI is
131
- unregistered. Dropping the FAIL silently was the alternative and was rejected:
132
- the SKIP names the check and says why, so a tolerated gap is distinguishable
133
- from a clean run.
134
-
135
- ## [1.3.2] - 2026-02-21
136
-
137
- ### Fixed
138
-
139
- - **The audit reported a stronger gate as broken.** xp-gate 0.38.75 added
140
- `--threshold 15` to Gate 2's jscpd invocation; before that jscpd was called
141
- without a threshold, returned 0 no matter how much duplication it found, and
142
- the gate passed unconditionally — which is why the case could only ever expect
143
- `detected`. Once the gate started failing, the stale expectation reported it as
144
- FAILED. Verified on 0.38.75 with the planted fixture: `Found 1 clones`, then
145
- `ERROR: jscpd found too many duplicates (50.0%) over threshold (15.0%)`. The
146
- control tree still passes, so the case separates rather than failing always.
147
-
148
- ### Changed
149
-
150
- - This closes the Gate 2 gap recorded in 1.3.0, where the audit called Gate 2
151
- permanently UNMEASURABLE on Windows with jscpd >= 5. It now measures, and
152
- measures correctly: audit 13/13 PASS with 3/3 cases separating.
153
-
154
- ## [1.3.1] - 2026-02-21
155
-
156
- The theme: **the installer's own maintenance state had no bound.**
157
-
158
- ### Fixed
159
-
160
- - **`install.mjs` grew its backup directory without limit.** Every run backs up
161
- each agent copy it is about to overwrite and nothing ever removed one.
162
- Measured before the policy existed: 50 backups / 11 MB dating back to v1.1.0,
163
- growing by one set per install. `pruneBackups` now keeps the newest 3 stamped
164
- backups **per agent**. The cap is per label rather than per directory because
165
- one run backs up all nine agents with the same timestamp, so a global cap of 3
166
- would delete six of the backups that run had just written — the retain count
167
- would be spent on simultaneity instead of history, and rolling back one agent
168
- would be impossible while its siblings survived.
169
- - **`toolReport()` crashed with "lookup is not a function".** `rows.map(classify)`
170
- passes `(value, index, array)`, so the index landed in the `lookup` parameter.
171
- `verify.mjs` died outright while every unit test stayed green, because they all
172
- passed `lookup` explicitly. The map call is now an explicit arrow.
173
-
174
- ### Added
175
-
176
- - `tests/cleanup.test.mjs`: 7 cases covering pruning (per-agent cap, name-stamp
177
- ordering over mtime, unrecognised directories spared, no-op guards) and the
178
- map-arity regression. An earlier version of the arity test called
179
- `toolReport()` and hung the suite for 60 s shelling out to npm/pip for all
180
- eight tools; it now drives `classify` through `map` with a fake lookup.
181
- - 3 mutation entries for the pruning rules, so the retention policy cannot
182
- regress silently. 19/19 mutations killed.
183
-
184
- ## [1.3.0] - 2026-02-19
185
-
186
- The theme: **make the quality claims measurable.** Three separate checks in this
187
- repo reported "clean" while measuring nothing, and each was found only by
188
- re-deriving the number by hand.
189
-
190
- ### Added
191
-
192
- - **`scripts/hp-gate.mjs` — complexity for the files xp-gate cannot see.**
193
- xp-gate's `LIZARD_EXTENSIONS` and `SEMGREP_EXTENSIONS` (`gates/common.ts`)
194
- both omit `mjs`/`cjs`, so a pure-ESM project passes Gate 3 with the message
195
- "⏭️ SKIPPED – Complexity (no source files to check)" and no function measured
196
- (xp-gate#732). Measured control: the same CCN-22 file is checked as `src/a.js`
197
- and skipped as `src/a.mjs`. `hp-gate` runs lizard over `.mjs`/`.cjs` at the
198
- same CCN 5 threshold Gate 3 uses, plus `node --check` per file (Gate 1 also
199
- skips `.mjs`). Wired into CI and `npm run hp-gate`.
200
-
201
- - **`scripts/lib/ccn.mjs` — the CSV contract, testable.** `parseLizardCsv`,
202
- `splitCsvLine`, `ccnViolations`, with `tests/ccn.test.mjs` pinning all three
203
- numeric columns. Field order verified against lizard 1.26.1
204
- `lizard_ext/csvoutput.py`: `nloc, cyclomatic_complexity, token_count, …`.
205
-
206
- - **`tests/gatecheck-audit.test.mjs`** — pins the audit's own bookkeeping: a
207
- blocked control is `unmeasurable`, not a gate failure, and a known upstream
208
- gap neither counts as a pass nor turns the audit permanently red.
209
-
210
- ### Fixed
211
-
212
- - **`hp-gate` passed a tree containing a CCN-22 function, twice.** First because
213
- lizard was run without `--csv` (empty stdout); then because the parser read
214
- column 0 (NLOC) instead of column 1 (CCN), yielding zero rows. Both surfaced
215
- as "every function within CCN 5". There is now a hard `scanBroken` failure
216
- when a non-empty source set parses to zero rows, plus a mutation for each of
217
- the three ways to misread the columns.
218
-
219
- - **`audit.mjs` reported a blocking control as a gate failure.** Gate 2's clean
220
- tree prints `Gate 2 FAILED: spawnSync npx ENOENT` even with jscpd 5.4.3 on
221
- PATH, because `lib/gate-runner.js` probes `<root>/node_modules/jscpd/bin/jscpd`
222
- and jscpd 5.x moved its bin to `run-jscpd.js`; the three fallbacks fail on
223
- Windows for three different reasons (`jscpd.cmd` EINVAL, `jscpd` ENOENT,
224
- `npx` ENOENT) — all through `execFileSync` without a shell. Reported as
225
- `UNMEASURABLE` now; the root cause is documented in `lib/gatecheck.mjs`.
226
-
227
- - **`cmpVersion` mutation was equivalent to the original** and could never be
228
- killed, so it tested nothing while looking like coverage. Replaced with two
229
- mutations that do change behaviour (first-component-only, string compare).
230
-
231
- - **Four `residue.mjs` mutation anchors went stale** during refactoring and were
232
- silently reported as `SKIPPED`. Re-anchored, and the anchors now target the
233
- named helpers (`classifyCopy`, `isIdenticalCopy`) so a future split is more
234
- likely to fail loudly than to pass quietly.
235
-
236
- - **Every production function in this repo was above CCN 5.** 14 functions
237
- exceeded the threshold the repo's own gates would enforce (had they looked);
238
- the worst was `runCase` at 27. All 414 functions are now within CCN 5,
239
- including the tests. The refactors split behaviour, they did not delete it —
240
- the suite grew from 97 to 114 cases and mutation coverage from 8 to 16
241
- mutations while the violation count went to zero.
242
-
243
- - **Version bump to 1.3.0** and `VERSION` now matches `package.json`.
244
-
245
- ## [1.2.0] - 2026-11-17
246
-
247
- ### Added
248
-
249
- - **`scripts/audit.mjs` — ask "are the gates still effective" without
250
- reinstalling.** `reinstall.mjs` used to be the only entry point, so the only
251
- way to check whether the gates still block was to tear down and rebuild the
252
- installation. Those are different questions. Two layers, reported separately:
253
- on-disk parity, and whether the gates actually reject a planted defect.
254
-
255
- - **`scripts/lib/gatecheck.mjs` — gray-box gate verification.** Builds a
256
- throwaway git repo, plants a defect the gate is responsible for catching, and
257
- requires the gate to say so. Every case runs twice: the same gate on the same
258
- tree without the defect. Recall alone is not a verdict — a gate that blocks
259
- everything would otherwise score as perfect.
260
-
261
- Measured on 0.38.9:
262
-
263
- | Gate | clean | planted | verdict |
264
- |---|---|---|---|
265
- | 8 — secret scan | passed | blocked | ok |
266
- | 3 — complexity | skipped | blocked | ok |
267
- | 2 — duplicates | passed | detected | ok |
268
-
269
- `detected` is a separate verdict from `blocked` because the gates disagree
270
- about severity: Gate 8 exits 1 on a secret, while Gate 2 reports
271
- `Found N clones` and exits 0 with or without clones.
272
-
273
- - **`scripts/mutation.mjs` — `npm run mutation`.** Eight injected defects that
274
- must all be caught, each tied to a property this skill exists to guarantee
275
- (wrong directory deleted, user's edit overwritten, outdated tool reported
276
- current). Turns the one-off mutation pass from 1.1.1 into a repeatable gate.
277
- Currently 8/8 killed.
278
-
279
- - **CI** (`.github/workflows/test.yml`): tests on Node 18/20/22, the mutation
280
- gate on every push, and the gray-box gate audit weekly — the last one because
281
- it depends on the *installed* xp-gate release, which changes without this
282
- repository changing.
283
-
284
- ### Fixed
285
-
286
- - `verdictOf` read `./failed-tests.js` as `blocked`: `FAILED` was matched as a
287
- substring, so a filename containing "failed" turned a clean gate run into a
288
- failure. Now matched as a standalone token. A false alarm is how an audit
289
- stops being read at all.
290
- - `verdictOf` returned `unknown` for a clean Gate 2 run, because Gate 2 prints
291
- no is okay-marker at all. "Cannot read the output" and "the gate is fine" must
292
- not look the same.
293
- - The mutation runner spawned the test suite through a shell, so
294
- `C:\Program Files\nodejs\node.exe` was split at the space and every mutation
295
- reported as SURVIVED because the suite never ran. Added a distinct `ERROR`
296
- outcome for "the runner failed", so a broken invocation is no longer
297
- indistinguishable from a missing test.
298
- - The mutation runner could not read CI's test output. Node picks its reporter
299
- by whether stdout is a TTY, so a terminal prints `ℹ fail 0` and a piped run
300
- prints TAP `# fail 0`; the runner matched only the first, so every CI run
301
- reported "the runner failed" while the counts were right there under a
302
- different name. The parse now lives in `lib/testreport.mjs` with tests for both
303
- formats, instead of being a regex buried in the runner.
304
- - `node --test "tests/*.test.mjs"` (quoted) only works on Windows: Node's test
305
- runner expands the glob there but not on Linux, where it fails with
306
- `Could not find '.../tests/*.test.mjs'`. Verified only on Windows before
307
- pushing, which is exactly the gap. The glob is now unquoted so the shell
308
- expands it, and `mutation.mjs` enumerates the files itself instead of relying
309
- on anyone to expand anything.
310
-
311
- ### Upstream
312
-
313
- - Filed [xp-gate#840](https://github.com/boyingliu01/xp-gate/issues/840): on a
314
- machine without OpenCode, `doctor` reports `✗ TUI registration: Not
315
- registered` and exits 1, because the check never asks whether the platform
316
- exists. Found by the new audit — it was the only FAIL on an otherwise clean
317
- machine.
318
-
319
- ## [1.1.1] - 2026-11-17
320
-
321
- ### Fixed
322
-
323
- - `tests/residue.test.mjs`: "pruneDeadRoots removes only copies identical to the
324
- published package" asserted nothing about the hash comparison it is named
325
- after. It deployed the untouched copy as `alpha` and the edited one as `beta`,
326
- but `contentHashes()` only iterates names present in the package, so `beta`
327
- was skipped before any hash was computed — the assertion held either way.
328
-
329
- Found by mutation testing: removing the hash check from `pruneDeadRoots`
330
- (`isDir(dest) && hashFn(dest) === expected` → `isDir(dest)`), which makes it
331
- delete user-edited skill copies, left the suite 84/84 green. The test now
332
- places the same skill name in two dead roots, one untouched and one edited.
333
- The same mutation now fails one test.
334
-
335
- ### Changed
336
-
337
- - Extracted `tests/fixtures.mjs` with `tmpDir`, `fakePkg`, `deploySkill` and
338
- `editSkill`, previously copy-pasted into four test files. They track the
339
- package layout, temp-dir cleanup and drift simulation, all of which must
340
- change together. jscpd clone pairs: 3 → 0.
341
-
342
- ## [1.1.0] - 2026-11-17
343
-
344
- ### Added
345
-
346
- - 84 tests across 8 files using the built-in `node:test` runner (zero
347
- dependencies, no `npm install`). Priority follows blast radius: the four
348
- destructive helpers in `lib/residue.mjs` are covered first.
349
- - `lib/residue.mjs`, extracted from `reinstall.mjs` (364 → 292 lines) so that
350
- backup-then-delete, marker detection and dead-root pruning became testable.
351
- - `package.json` with `test`, `install-skill`, `preflight`, `reinstall` and
352
- `verify` scripts; `node >= 18`.
353
-
354
- ### Changed
355
-
356
- - Cyclomatic complexity brought below Gate 3's block threshold of 10:
357
-
358
- | function | before | after | how |
359
- |---|---:|---:|---|
360
- | `probeLiveness` | 13 | 7 | split into `appEvidence` / `cliEvidence` / `idleDays` |
361
- | `collectBaseline` | 11 | ~3 | split into `xpGateInfo` / `configInfo` / `delphiInfo` / `doctorInfo` |
362
- | `upgradeTool` | 10 | ~2 | if-chain replaced by an `UPGRADERS` dispatch table |
363
-
364
- Function rate 0.56 → 0.60.
365
-
366
- ### Fixed
367
-
368
- - `SKILL.md` gained a note on DSH erasing credential-shaped environment
369
- variables (`KEY`/`PASSWORD`/`SECRET`/`TOKEN`) before spawning subprocesses,
370
- which makes `delphi-external-review` report a missing API key on a machine
371
- where it is set. It is a security design, not a misconfiguration.
372
-
373
- ## [1.0.0] - 2026-11-16
374
-
375
- ### Added
376
-
377
- - Initial release: snapshot config → purge with residue cleanup → install the
378
- latest npm release → upgrade gate tools → verify each agent's skills, plugins
379
- and hooks.
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 boyingliu01
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,173 +0,0 @@
1
- # reinstall-xp-gate 质量全视图
2
-
3
- 实测时间:2026-11-24 00:05 版本:v2.0.1
4
- 工作区:干净 CI:node 22/24/26 + complexity + mutation 全绿
5
-
6
- ---
7
-
8
- ## 一、门禁总览(19 个)
9
-
10
- | # | 门禁 | 结果 | 实测依据 | 备注 |
11
- |---|---|---|---|---|
12
- | 0 | 版本一致性 | ✅ PASS | VERSION=package.json=2.0.0 | pre-commit 路径实测 |
13
- | 1 | 代码质量 | ✅ PASS | adapter lint 通过 | pre-commit 路径 |
14
- | 2 | 重复代码 | ✅ **0 clones** | jscpd 29→41 文件 | CLI 实测可跑 |
15
- | 3 | 圈复杂度 | ✅ PASS | 暂存 `.mjs` 后实测 PASSED | 干净树上的 SKIPPED 是「无变更」,见 §四 |
16
- | 4 | 整洁代码+SOLID | ✅ **0 ERROR** | 49 INFO / 21 WARNING | 明细见 §三 |
17
- | 5 | 测试+覆盖率 | ✅ **92.59%** | floor 80% | pre-commit 路径 |
18
- | 6 | 架构+Boy Scout | ⏭️ SKIP | `.architecture-skip` | 已声明豁免,见 §四 |
19
- | 7 | IaC 安全 | ✅ PASS | 无 IaC 文件 | — |
20
- | 8 | 密钥扫描 | ✅ PASS | gitleaks:no leaks | 427KB 扫完 |
21
- | 9 | 构建完整性 | ⏭️ SKIP | 无构建产物 | 纯脚本项目,合理 |
22
- | 10 | SAST | ✅ **0 findings** | semgrep --config=auto | 修掉 1 条,见 §五 |
23
- | 11 | Sprint Flow | ⏭️ SKIP | 无 `.sprint-state/` | 未用 sprint 流程 |
24
- | 12 | 文件卫生 | ✅ PASS | 真实 hook 实测 | 需 `LC_ALL=C`,见 §四 |
25
- | 12b | 镜像一致性 | ⏭️ SKIP | 无 staged 对 | — |
26
- | 12c | 探针纪律 | ⏭️ SKIP | 无 staged 对 | — |
27
- | 13 | 编译器严格度 | ⏭️ SKIP | 无 tsconfig/eslint | 无声明检查器 |
28
- | M | 变异测试 | ✅ **19/19** | 全部被捕获 | `npm run mutation` |
29
- | MW | Code Walkthrough | ✅ PASS | pre-push 实测 | — |
30
- | S | prepush-sprint | ⏭️ SKIP | 无 sprint | — |
31
-
32
- **判定:0 FAIL。** 5 个硬核门禁(2/4/8/10/M)全部满足。
33
-
34
- ---
35
-
36
- ## 二、核心指标
37
-
38
- | 指标 | 实测 | 阈值 | 余量 |
39
- |---|---|---|---|
40
- | 测试 | **242 / 242 通过** | 全通过 | — |
41
- | 行覆盖 | **93.80%** | 80% | +13.80 |
42
- | 函数复杂度 | **792 个全 ≤ CCN 5** | 5 | 0 超标 |
43
- | 变异测试 | **19 / 19 捕获** | 全捕获 | 0 遗漏 |
44
- | 重复代码 | **0 clones**(3940 行 / 24954 token) | — | — |
45
- | SAST | **0 findings** | 0 | — |
46
- | 密钥 | **0 leaks** | 0 | — |
47
- | 语法错误 | **0**(41 文件) | 0 | — |
48
- | CRLF 文件 | **0** | — | autocrlf=input |
49
- | 跟踪的运行时产物 | **0** | — | `.xp-gate/` 已忽略 |
50
-
51
- ---
52
-
53
- ## 三、技术债全貌(17 WARNING / 49 INFO)
54
-
55
- ### 3.1 模块导出过多(**0 条 · 已清零**)
56
-
57
- 上一版是 4 条(`proc` 20 / `tools` 18 / `util` 13 / `agents` 11)。本轮按**职责**拆分,
58
- 不是按数字凑数:
59
-
60
- | 原模块 | 拆出 | 剩余职责 |
61
- |---|---|---|
62
- | `proc.mjs` | `platform.mjs`(平台事实)、`spawn.mjs`(子进程)、`xp-cli.mjs`(定位并调用 xp-gate) | 统一导入面 |
63
- | `util.mjs` | `fs-tree.mjs`(树遍历)、`json-file.mjs`(JSON/时间戳)、`backups.mjs`(保留策略) | 统一导入面 |
64
- | `tools.mjs` | `version.mjs`(纯版本运算)、`probes.mjs`(各生态查询) | 报告编排 |
65
- | `agents.mjs` | `agent-paths.mjs`(标签、根、相对 HOME 的路径) | 活性探测与发现 |
66
-
67
- 四个原模块**仍是导入面**(re-export),所以没有任何一处 import 语句被改动。
68
- `tests/proc-contract.test.mjs` 钉住 `proc.mjs` 的 20 个导出名 ——
69
- 重构会移动实现,若某个调用方悄悄丢了一个符号,否则只会在运行时才发现。
70
-
71
- ### 3.2 缺错误处理(17 条 · **判定为误报**)
72
-
73
- `run`/`probe`/`copyTree`/`writeJson` 等全部被点名。**逐条核实过调用方**:
74
-
75
- - `run()` 是 `spawnSync` 薄封装,**所有调用方都用 `r.status !== 0` 判断**
76
- (`proc.mjs:49/169/207/242/246`、`tools.mjs:37/260`、`gatecheck.mjs:125`);
77
- - 加 try/catch 反而会把"命令失败"伪装成"命令成功"。
78
-
79
- Gate 4 只做模式匹配,看不懂这个契约。**不建议改**。
80
-
81
- ### 3.3 魔数(49 条 · 混合)
82
-
83
- - **已命名 10 处**(`PROBE_TIMEOUT_MS` / `XP_GATE_SLOW_OP_TIMEOUT_MS` /
84
- `PACKAGE_INSTALL_TIMEOUT_MS` / `VERIFY_TIMEOUT_MS`),从 58 降到 49;
85
- - 剩余大多是 `timeout:` 旁的毫秒值,字段名已表达语义;
86
- - **刻意没合并** 4 处 `30000`:语义各异(node --check / npm root / npm view / pip show),
87
- 合并会制造假 DRY。
88
-
89
- ---
90
-
91
- ## 四、门禁无法覆盖的部分(诚实声明)
92
-
93
- **Gate 3 的 `SKIPPED` 是「改动集为空」,不是「看不见 .mjs」——此处更正我先前的错误结论。**
94
-
95
- 我此前声称「上游 `LIZARD_EXTENSIONS` 不含 `mjs`,Gate 3 对本项目整棵树视而不见」。**这是错的**,
96
- 本轮做了对照实验证伪:
97
-
98
- | 实验 | 结果 |
99
- |---|---|
100
- | 工作区干净时 `xp-gate check 3` | `SKIPPED - no source files to check`(因为没有变更文件) |
101
- | 暂存一个 `.mjs` 后 `xp-gate check 3` | ✅ `PASSED - All functions within complexity threshold (5)` |
102
- | 独立 fixture,只放一个超标 `.mjs` | ❌ `BLOCKED - 1 functions with CCN > 5` |
103
-
104
- 结论:Gate 3 **确实检查 `.mjs`**。干净树上的 `SKIPPED` 是正确的「无变更可查」语义,
105
- 不是缺陷,也不该据此给上游提 issue(已确认未提)。
106
-
107
- 不过本项目仍然保留 `npm run hp-gate` 作为独立兜底:它不依赖变更集,
108
- 是全量扫描(53 文件,792 函数,同 CCN 5 阈值),比按变更集抽查更严格。
109
- 两者分工是「Gate 3 防增量回归,hp-gate 防存量」,不是「Gate 3 坏了」。
110
-
111
- **Gate 6 的跳过是已声明的**,不是悄悄放过。`.architecture-skip` 写明理由:
112
- 本项目是可移植 skill,`scripts/lib/` 是平铺辅助模块,无分层可约束。
113
-
114
- **Gate 12 需 `LC_ALL=C`。** 上游 `gate-12-blob-scan.awk` 混用字节数与字符数
115
- (`length($0)` 在 UTF-8 下返回字符数),**任何含中文的文件都会被误报缺 EOF 换行**。
116
- 已隔离复现、已记录待提 issue。当前用 `LC_ALL=C git commit` 规避。
117
-
118
- ---
119
-
120
- ## 四点五、本轮修复中最重要的一条:门禁曾自己吃掉 8 个变异体
121
-
122
- 重构 `util.mjs` 拆成 `fs-tree.mjs`、`cmpVersion` 移到 `version.mjs` 之后,
123
- 变异测试报出:
124
-
125
- ```
126
- 11/19 mutations killed
127
- 8 skipped (stale anchor -- update the mutation)
128
- 每一条被变异的缺陷都被捕获 ← 同时打印这句,且退出码 0
129
- ```
130
-
131
- **8 个属性检查静默消失了,而门禁看起来比之前更健康。** 这与本项目存在的理由直接冲突:
132
- 它的职责就是发现「门禁通过了但其实什么都没测」。
133
-
134
- 两处一起修:
135
-
136
- 1. **数据**:变异表抽到 `scripts/lib/mutations.mjs`,**可被 import**(原脚本有顶层副作用,
137
- 无法测试)。新增 `tests/mutation-anchors.test.mjs`:锚点或目标文件消失即失败。
138
- 2. **门禁**:`skipped` 现在退出 1,且不再打印「every mutated defect was caught」。
139
-
140
- 验证方式是**故意植入一个假锚点**,确认退出码变成 1、输出明确指明「skipped 不等于通过」。
141
- 恢复后 19/19 全捕获、0 skip。
142
-
143
- ---
144
-
145
- ## 五、本次发版做的事
146
-
147
- **发版**:`v2.0.0` 已打 tag + GitHub Release。
148
- 破坏性变更:skill 与仓库改名 `xp-gate-reinstall` → `reinstall-xp-gate`。
149
-
150
- **清理**:
151
- - 删除 Gate 12 复现用的 4 个临时仓库;
152
- - 删除 184 个 `/tmp/gate7-*` 门禁运行残留;
153
- - 删除临时脚本与备份;确认无已合并分支残留。
154
-
155
- **检查中发现并修掉 1 个自己引入的问题**:
156
- SAST 报 `residue.mjs:174` 用变量构造 `RegExp`。无注入风险(名字是内部常量),
157
- 但改为按字段精确比较,更快且避免每轮都需压制告警。行为由新测试锁定
158
- (`name: reinstall-xp-gate-fork` 不会被误删)。
159
-
160
- ---
161
-
162
- ## 六、外部质量
163
-
164
- | 项 | 状态 |
165
- |---|---|
166
- | Open issues | **1**(#4,有意保留) |
167
- | Closed | #1 #2 #3 #5 |
168
- | CI | 全绿 |
169
- | Release | v2.0.1 已发布 |
170
-
171
- **#4 为何仍开**:本机不复现(OpenCode 靠 CLI 证据判活,判定正确),但 `idleDays()`
172
- 读目录 mtime 的缺陷机制**未改**,实测仅 5 天——CLI 一消失就会误判。
173
- 按"不复现就关闭"处理等于掩盖问题,已在 issue 内附实测证据与收口建议。