Skip to content

Commit fe973f7

Browse files
authored
Merge pull request #22 from full-stack-plugins/feat/finalize-plan-bookkeeping-v0.6.9
chore(openspec): 计划簿记收尾 + M1 hook 注释 (v0.6.9)
2 parents 5ed05a9 + f2d349b commit fe973f7

11 files changed

Lines changed: 112 additions & 112 deletions

File tree

‎hooks/env_check.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
PLUGIN_ROOT = Path(__file__).resolve().parents[1] # hooks/ 的上级 = 插件根(不依赖宿主环境变量)
1515
sys.path.insert(0, str(PLUGIN_ROOT / "scripts"))
1616

17-
from detect_lang import (
17+
from detect_lang import ( # ensure_user_path/load_user_config 实际定义:scripts/paths.py、scripts/user_config.py
1818
LANG_COMMANDS,
1919
REGISTRY,
2020
detect_languages,

‎hooks/post_tool_lint.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
PLUGIN_ROOT = Path(__file__).resolve().parents[1] # hooks/ 的上级 = 插件根
1919
sys.path.insert(0, str(PLUGIN_ROOT / "scripts"))
2020

21-
from detect_lang import (
21+
from detect_lang import ( # ensure_user_path/load_user_config 实际定义:scripts/paths.py、scripts/user_config.py
2222
LANG_COMMANDS,
2323
detect_language,
2424
ensure_user_path,

‎hooks/pre_tool_git_guard.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
sys.path.insert(0, str(PLUGIN_ROOT / "scripts"))
2121
sys.path.insert(0, str(PLUGIN_ROOT / "hooks"))
2222

23-
from detect_lang import ensure_user_path, load_user_config
23+
from detect_lang import ensure_user_path, load_user_config # # ensure_user_path/load_user_config 实际定义:scripts/paths.py、scripts/user_config.py
2424
from gate_lib import (
2525
check_commit_safety,
2626
format_safety_report,

‎hooks/user_prompt_validator.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# 必须静默(子串匹配曾把它们当提交意图跑全仓 lint)。
2626
import re as _re
2727

28-
from detect_lang import (
28+
from detect_lang import ( # # ensure_user_path/load_user_config 实际定义:scripts/paths.py、scripts/user_config.py
2929
detect_languages,
3030
ensure_user_path,
3131
find_project_root,
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
## 1. New files
22

3-
- [ ] 1.1 Create `scripts/paths.py` with `ensure_user_path(from_login_shell=False)` plus its internal static-dir and node-availability helpers, copied verbatim from `scripts/detect_lang.py`.
4-
- [ ] 1.2 Create `scripts/user_config.py` with `load_user_config`, `load_project_overrides`, `get_overrides`, copied verbatim from `scripts/detect_lang.py`.
3+
- [x] 1.1 Create `scripts/paths.py` with `ensure_user_path(from_login_shell=False)` plus its internal static-dir and node-availability helpers, copied verbatim from `scripts/detect_lang.py`.
4+
- [x] 1.2 Create `scripts/user_config.py` with `load_user_config`, `load_project_overrides`, `get_overrides`, copied verbatim from `scripts/detect_lang.py`.
55

66
## 2. detect_lang.py refactor
77

8-
- [ ] 2.1 Delete the implementation bodies of `ensure_user_path` and configuration helpers from `scripts/detect_lang.py`.
9-
- [ ] 2.2 Replace them with re-exports (`from paths import ensure_user_path`, `from user_config import load_user_config, load_project_overrides, get_overrides`) and add `__all__` enumerating all externally imported symbols (existing + new re-exports).
8+
- [x] 2.1 Delete the implementation bodies of `ensure_user_path` and configuration helpers from `scripts/detect_lang.py`.
9+
- [x] 2.2 Replace them with re-exports (`from paths import ensure_user_path`, `from user_config import load_user_config, load_project_overrides, get_overrides`) and add `__all__` enumerating all externally imported symbols (existing + new re-exports).
1010

1111
## 3. Hooks annotation
1212

13-
- [ ] 3.1 In each of `hooks/env_check.py`, `hooks/pre_tool_git_guard.py`, `hooks/post_tool_lint.py`, `hooks/user_prompt_validator.py`, append an inline comment to the existing `from detect_lang import ...` line noting the source file (`paths.py` or `user_config.py`).
13+
- [x] 3.1 In each of `hooks/env_check.py`, `hooks/pre_tool_git_guard.py`, `hooks/post_tool_lint.py`, `hooks/user_prompt_validator.py`, append an inline comment to the existing `from detect_lang import ...` line noting the source file (`paths.py` or `user_config.py`).
1414

1515
## 4. Validation
1616

17-
- [ ] 4.1 Run `python3 tests/run_all.py` — all hook simulation, language-registry, unit, CVE, edges, and field-regression subsets must pass.
18-
- [ ] 4.2 Run `python3 -m unittest discover -s tests -p 'test_*.py' -v` — `test_plugin_manifests.py` and `test_skill_vendor.py` must pass (pre-existing baseline).
19-
- [ ] 4.3 Run `git diff --check` — must be clean.
20-
- [ ] 4.4 Run `openspec validate --all --strict` — must pass (3 pre-existing specs + new `language-gate-commands`).
21-
- [ ] 4.5 Run `ruff check scripts/paths.py scripts/user_config.py scripts/detect_lang.py hooks/` — zero lint issues.
17+
- [x] 4.1 Run `python3 tests/run_all.py` — all hook simulation, language-registry, unit, CVE, edges, and field-regression subsets must pass.
18+
- [x] 4.2 Run `python3 -m unittest discover -s tests -p 'test_*.py' -v` — `test_plugin_manifests.py` and `test_skill_vendor.py` must pass (pre-existing baseline).
19+
- [x] 4.3 Run `git diff --check` — must be clean.
20+
- [x] 4.4 Run `openspec validate --all --strict` — must pass (3 pre-existing specs + new `language-gate-commands`).
21+
- [x] 4.5 Run `ruff check scripts/paths.py scripts/user_config.py scripts/detect_lang.py hooks/` — zero lint issues.
2222

2323
## 5. Graph evidence
2424

25-
- [ ] 5.1 Rebuild `code-review-graph` and verify the cross-community edge count between `hooks-gate` and `scripts-scan` drops to ≤4 (was 19).
25+
- [x] 5.1 Rebuild `code-review-graph` and verify the cross-community edge count between `hooks-gate` and `scripts-scan` drops to ≤4 (was 19).
2626

2727
## 6. Release
2828

29-
- [ ] 6.1 `node scripts/bump-plugin.mjs codeguard patch` — bump 0.6.0 → 0.6.1.
30-
- [ ] 6.2 Commit plugin repo change, push `main` + tag `v0.6.1`.
31-
- [ ] 6.3 In `full-stack-plugins` market repo, sync catalog `codeguard` to `0.6.1` and regenerate three marketplace manifests; commit and push.
32-
- [ ] 6.4 `openspec archive add-detect-lang-splits` after all tasks above are checked.
29+
- [x] 6.1 `node scripts/bump-plugin.mjs codeguard patch` — bump 0.6.0 → 0.6.1.
30+
- [x] 6.2 Commit plugin repo change, push `main` + tag `v0.6.1`.
31+
- [x] 6.3 In `full-stack-plugins` market repo, sync catalog `codeguard` to `0.6.1` and regenerate three marketplace manifests; commit and push.
32+
- [x] 6.4 `openspec archive add-detect-lang-splits` after all tasks above are checked.
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
## 1. Document
22

3-
- [ ] 1.1 Create `hooks/__protocol__.md` with the 6 sections (protocol table / three-host compatibility / fail-open / new-hook checklist / change policy / spec mapping).
4-
- [ ] 1.2 Verify every documented exit code / JSON schema matches the actual implementation in `hooks/*.py` (post_tool_lint.py:226 etc.) — record the matching line numbers.
3+
- [x] 1.1 Create `hooks/__protocol__.md` with the 6 sections (protocol table / three-host compatibility / fail-open / new-hook checklist / change policy / spec mapping).
4+
- [x] 1.2 Verify every documented exit code / JSON schema matches the actual implementation in `hooks/*.py` (post_tool_lint.py:226 etc.) — record the matching line numbers.
55

66
## 2. tests/run_all.py annotation
77

8-
- [ ] 2.1 Add a one-line reference to `hooks/__protocol__.md` in the top-of-file docstring of `tests/run_all.py`..
8+
- [x] 2.1 Add a one-line reference to `hooks/__protocol__.md` in the top-of-file docstring of `tests/run_all.py`..
99

1010
## 3. Validation
1111

12-
- [ ] 3.1 `python3 -m unittest discover -s tests -p 'test_*.py' -v` — both tests pass.
13-
- [ ] 3.2 `python3 tests/run_all.py` — full 141 / 0 / 0 must hold (hooks/manifests/vendored skills).
14-
- [ ] 3.3 `git diff --check` — clean.
15-
- [ ] 3.4 `openspec validate --all --strict` — pass (3 pre-existing + new `hook-protocol`).
16-
- [ ] 3.5 `grep -c 'exit code\|additionalContext' hooks/__protocol__.md` ≥ 5 (sanity that document has substance).
12+
- [x] 3.1 `python3 -m unittest discover -s tests -p 'test_*.py' -v` — both tests pass.
13+
- [x] 3.2 `python3 tests/run_all.py` — full 141 / 0 / 0 must hold (hooks/manifests/vendored skills).
14+
- [x] 3.3 `git diff --check` — clean.
15+
- [x] 3.4 `openspec validate --all --strict` — pass (3 pre-existing + new `hook-protocol`).
16+
- [x] 3.5 `grep -c 'exit code\|additionalContext' hooks/__protocol__.md` ≥ 5 (sanity that document has substance).
1717

1818
## 4. Release
1919

20-
- [ ] 4.1 `node scripts/bump-plugin.mjs codeguard patch` — bump 0.6.2 → 0.6.3.
21-
- [ ] 4.2 Fix in-repo `.agents/plugins/marketplace.json` ref/icon to `v0.6.3`.
22-
- [ ] 4.3 Open PR, wait for vendor-check, merge.
23-
- [ ] 4.4 Push tag `v0.6.3`.
24-
- [ ] 4.5 Sync market repo catalog + README codeguard row to `0.6.3` and push.
25-
- [ ] 4.6 `openspec archive add-host-protocol-cheatsheet` after all tasks above are checked.
20+
- [x] 4.1 `node scripts/bump-plugin.mjs codeguard patch` — bump 0.6.2 → 0.6.3.
21+
- [x] 4.2 Fix in-repo `.agents/plugins/marketplace.json` ref/icon to `v0.6.3`.
22+
- [x] 4.3 Open PR, wait for vendor-check, merge.
23+
- [x] 4.4 Push tag `v0.6.3`.
24+
- [x] 4.5 Sync market repo catalog + README codeguard row to `0.6.3` and push.
25+
- [x] 4.6 `openspec archive add-host-protocol-cheatsheet` after all tasks above are checked.
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
## 1. Validator
22

3-
- [ ] 1.1 Create `scripts/validate_languages_json.py` with the 11-rule set per design.md.
4-
- [ ] 1.2 `python3 scripts/validate_languages_json.py` on current registry must exit 0 (baseline).
5-
- [ ] 1.3 Document CLI flags + exit codes in the script's top docstring.
3+
- [x] 1.1 Create `scripts/validate_languages_json.py` with the 11-rule set per design.md.
4+
- [x] 1.2 `python3 scripts/validate_languages_json.py` on current registry must exit 0 (baseline).
5+
- [x] 1.3 Document CLI flags + exit codes in the script's top docstring.
66

77
## 2. Unit tests
88

9-
- [ ] 2.1 Create `tests/test_validate_languages_json.py` with the 10-test matrix per design.md.
10-
- [ ] 2.2 All tests must pass with the current registry as the baseline fixture.
9+
- [x] 2.1 Create `tests/test_validate_languages_json.py` with the 10-test matrix per design.md.
10+
- [x] 2.2 All tests must pass with the current registry as the baseline fixture.
1111

1212
## 3. CI wiring
1313

14-
- [ ] 3.1 Edit `.github/workflows/skills-check.yml` to add two new steps (validator + unit tests) after the existing unittest discovery.
14+
- [x] 3.1 Edit `.github/workflows/skills-check.yml` to add two new steps (validator + unit tests) after the existing unittest discovery.
1515

1616
## 4. Validation
1717

18-
- [ ] 4.1 `python3 -m unittest discover -s tests -p 'test_*.py' -v` — all pass (existing + new).
19-
- [ ] 4.2 `python3 tests/run_all.py` — full 141 / 0 / 0 must hold.
20-
- [ ] 4.3 `git diff --check` — clean.
21-
- [ ] 4.4 `openspec validate --all --strict` — pass (5 pre-existing + new `languages-registry-contract`).
22-
- [ ] 4.5 `ruff check scripts/validate_languages_json.py tests/test_validate_languages_json.py` — zero new errors.
18+
- [x] 4.1 `python3 -m unittest discover -s tests -p 'test_*.py' -v` — all pass (existing + new).
19+
- [x] 4.2 `python3 tests/run_all.py` — full 141 / 0 / 0 must hold.
20+
- [x] 4.3 `git diff --check` — clean.
21+
- [x] 4.4 `openspec validate --all --strict` — pass (5 pre-existing + new `languages-registry-contract`).
22+
- [x] 4.5 `ruff check scripts/validate_languages_json.py tests/test_validate_languages_json.py` — zero new errors.
2323

2424
## 5. Release
2525

26-
- [ ] 5.1 `node scripts/bump-plugin.mjs codeguard patch` — bump 0.6.3 → 0.6.4.
27-
- [ ] 5.2 Fix in-repo `.agents/plugins/marketplace.json` ref/icon to `v0.6.4`.
28-
- [ ] 5.3 Open PR, wait for vendor-check, merge.
29-
- [ ] 5.4 Push tag `v0.6.4`.
30-
- [ ] 5.5 Sync market repo catalog + README codeguard row to `0.6.4` and push.
31-
- [ ] 5.6 `openspec archive add-languages-schema-validator` after all tasks above are checked.
26+
- [x] 5.1 `node scripts/bump-plugin.mjs codeguard patch` — bump 0.6.3 → 0.6.4.
27+
- [x] 5.2 Fix in-repo `.agents/plugins/marketplace.json` ref/icon to `v0.6.4`.
28+
- [x] 5.3 Open PR, wait for vendor-check, merge.
29+
- [x] 5.4 Push tag `v0.6.4`.
30+
- [x] 5.5 Sync market repo catalog + README codeguard row to `0.6.4` and push.
31+
- [x] 5.6 `openspec archive add-languages-schema-validator` after all tasks above are checked.
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
## 1. Registry migration
22

3-
- [ ] 1.1 In `scripts/languages.json`, add `"linter_config_files": [".pre-commit-config.yaml", "checkstyle.xml", "pmd.xml"]` to the `java` entry.
4-
- [ ] 1.2 Same for `rust`, `typescript`, `python` (copy from current `hooks/env_check.py::LINTER_CONFIG_FILES`).
5-
- [ ] 1.3 All other language entries already default to `[]` via validation; explicitly verify no regression.
3+
- [x] 1.1 In `scripts/languages.json`, add `"linter_config_files": [".pre-commit-config.yaml", "checkstyle.xml", "pmd.xml"]` to the `java` entry.
4+
- [x] 1.2 Same for `rust`, `typescript`, `python` (copy from current `hooks/env_check.py::LINTER_CONFIG_FILES`).
5+
- [x] 1.3 All other language entries already default to `[]` via validation; explicitly verify no regression.
66

77
## 2. env_check refactor
88

9-
- [ ] 2.1 In `hooks/env_check.py`, delete the `LINTER_CONFIG_FILES` constant (lines 23-30).
10-
- [ ] 2.2 Add `REGISTRY` to the `from detect_lang import ...` block.
11-
- [ ] 2.3 Rewrite `detect_linter_config` to iterate over `REGISTRY.items()` and read each entry's `linter_config_files`.
12-
- [ ] 2.4 Verify `python3 tests/run_all.py` env_check subset passes (still 5/5 of the existing checks).
9+
- [x] 2.1 In `hooks/env_check.py`, delete the `LINTER_CONFIG_FILES` constant (lines 23-30).
10+
- [x] 2.2 Add `REGISTRY` to the `from detect_lang import ...` block.
11+
- [x] 2.3 Rewrite `detect_linter_config` to iterate over `REGISTRY.items()` and read each entry's `linter_config_files`.
12+
- [x] 2.4 Verify `python3 tests/run_all.py` env_check subset passes (still 5/5 of the existing checks).
1313

1414
## 3. Validator rule
1515

16-
- [ ] 3.1 Add `_check_linter_config_files` to `scripts/validate_languages_json.py` and wire it into `check()`.
17-
- [ ] 3.2 Add 2 unittest cases to `tests/test_validate_languages_json.py`:
16+
- [x] 3.1 Add `_check_linter_config_files` to `scripts/validate_languages_json.py` and wire it into `check()`.
17+
- [x] 3.2 Add 2 unittest cases to `tests/test_validate_languages_json.py`:
1818
- `test_linter_config_files_must_be_list_of_str`
1919
- `test_linter_config_files_can_be_empty`
2020

2121
## 4. Validation
2222

23-
- [ ] 4.1 `python3 scripts/validate_languages_json.py` — exit 0.
24-
- [ ] 4.2 `python3 -m unittest discover -s tests -p 'test_*.py' -v` — pass.
25-
- [ ] 4.3 `python3 tests/run_all.py` — 141 / 0 / 0.
26-
- [ ] 4.4 `git diff --check` — clean.
27-
- [ ] 4.5 `openspec validate --all --strict` — pass.
23+
- [x] 4.1 `python3 scripts/validate_languages_json.py` — exit 0.
24+
- [x] 4.2 `python3 -m unittest discover -s tests -p 'test_*.py' -v` — pass.
25+
- [x] 4.3 `python3 tests/run_all.py` — 141 / 0 / 0.
26+
- [x] 4.4 `git diff --check` — clean.
27+
- [x] 4.5 `openspec validate --all --strict` — pass.
2828

2929
## 5. Release
3030

31-
- [ ] 5.1 `node scripts/bump-plugin.mjs codeguard patch` — bump 0.6.4 → 0.6.5.
32-
- [ ] 5.2 Fix in-repo `.agents/plugins/marketplace.json` ref/icon to `v0.6.5`.
33-
- [ ] 5.3 Open PR, wait for vendor-check, merge.
34-
- [ ] 5.4 Tag v0.6.5 (use the `--force-with-lease` workflow if origin tag v0.6.4 is stale).
35-
- [ ] 5.5 Sync market repo catalog + README codeguard row to `0.6.5` and push.
36-
- [ ] 5.6 `openspec archive add-linter-config-from-registry`.
31+
- [x] 5.1 `node scripts/bump-plugin.mjs codeguard patch` — bump 0.6.4 → 0.6.5.
32+
- [x] 5.2 Fix in-repo `.agents/plugins/marketplace.json` ref/icon to `v0.6.5`.
33+
- [x] 5.3 Open PR, wait for vendor-check, merge.
34+
- [x] 5.4 Tag v0.6.5 (use the `--force-with-lease` workflow if origin tag v0.6.4 is stale).
35+
- [x] 5.5 Sync market repo catalog + README codeguard row to `0.6.5` and push.
36+
- [x] 5.6 `openspec archive add-linter-config-from-registry`.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
## 1. Test refactor
22

3-
- [ ] 1.1 In `tests/test_plugin_manifests.py`, rename `test_each_released_manifest_points_to_the_68_skill_bundle` to `test_each_released_manifest_points_to_the_lock_union_plus_local_skills`.
4-
- [ ] 1.2 Replace `self.assertEqual(68, expected)` with the three-source union assertion: `on_disk == lock_union | local`.
3+
- [x] 1.1 In `tests/test_plugin_manifests.py`, rename `test_each_released_manifest_points_to_the_68_skill_bundle` to `test_each_released_manifest_points_to_the_lock_union_plus_local_skills`.
4+
- [x] 1.2 Replace `self.assertEqual(68, expected)` with the three-source union assertion: `on_disk == lock_union | local`.
55

66
## 2. Validation
77

8-
- [ ] 2.1 Run `python3 -m unittest discover -s tests -p 'test_*.py' -v` — both `test_plugin_manifests.py` and `test_skill_vendor.py` pass.
9-
- [ ] 2.2 Run `git diff --check` — must be clean.
10-
- [ ] 2.3 Run `openspec validate --all --strict` — must pass (3 pre-existing + `language-gate-commands` + new `plugin-manifest-contracts`).
8+
- [x] 2.1 Run `python3 -m unittest discover -s tests -p 'test_*.py' -v` — both `test_plugin_manifests.py` and `test_skill_vendor.py` pass.
9+
- [x] 2.2 Run `git diff --check` — must be clean.
10+
- [x] 2.3 Run `openspec validate --all --strict` — must pass (3 pre-existing + `language-gate-commands` + new `plugin-manifest-contracts`).
1111

1212
## 3. Release
1313

14-
- [ ] 3.1 Commit as part of the same release commit as HIGH 1 (single `release: v0.6.1` covers both changes).
15-
- [ ] 3.2 After archive of `add-detect-lang-splits`, archive `add-manifest-bundle-dynamic` together with it (single release flow).
14+
- [x] 3.1 Commit as part of the same release commit as HIGH 1 (single `release: v0.6.1` covers both changes).
15+
- [x] 3.2 After archive of `add-detect-lang-splits`, archive `add-manifest-bundle-dynamic` together with it (single release flow).

0 commit comments

Comments
 (0)