From 8ecc42de55283e7737d03d55514b0eb3e1fa5f1c Mon Sep 17 00:00:00 2001 From: Yeachan-Heo Date: Tue, 26 May 2026 00:33:06 +0000 Subject: [PATCH] Protect ROADMAP helper missing-path behavior Add the missing explicit-path regression so operators keep the current fail-fast contract covered, and record the completed ROADMAP follow-up. Constraint: scope limited to ROADMAP helper regression coverage plus the DONE roadmap entry; tests/__init__.py is included so the requested python -m unittest tests.test_roadmap_helpers invocation resolves locally instead of an external tests package. Rejected: changing roadmap-next-id.sh behavior | dogfood showed the script already returns the desired nonzero empty-stdout error. Confidence: high Scope-risk: narrow Directive: Keep stdout reserved for the single next id on successful roadmap-next-id.sh runs. Tested: python -m unittest tests.test_roadmap_helpers -q; scripts/roadmap-check-ids.sh ROADMAP.md; scripts/roadmap-next-id.sh ROADMAP.md; git diff --check -- ROADMAP.md tests/test_roadmap_helpers.py tests/__init__.py --- ROADMAP.md | 2 ++ tests/__init__.py | 0 tests/test_roadmap_helpers.py | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100644 tests/__init__.py diff --git a/ROADMAP.md b/ROADMAP.md index 15f4c28133..d14ab79147 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -7629,3 +7629,5 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed) 730. **`claw plugins list/show --output-format json` had no `path` field — parity gap completing the agents (#728) / skills (#729) trio: callers could not determine which on-disk directory backs each plugin without re-walking discovery roots** — dogfooded 2026-05-26 on `8f44ad30`. `plugin_summary_json` in `rusty-claude-cli/src/main.rs` rendered all `PluginMetadata` fields except `root: Option`, which was already present in the struct. Fix: added `"path": plugin.metadata.root.as_ref().map(|p| p.display().to_string())` to `plugin_summary_json`. Plugins now return e.g. `{path:"/Users/.../.claw/plugins/installed/example-bundled-bundled"}`. Completes path-discoverability across all three extension surfaces (agents, skills, plugins). Source: Jobdori dogfood on `8f44ad30`, 2026-05-26. 731. **`claw sandbox --output-format json` returned `status:"error"` when namespace isolation is unsupported on macOS but filesystem sandbox is active — automation treating `status != "ok"` as a hard error would block on a fully-functional degraded sandbox** — dogfooded 2026-05-26 on `425d94ee`. `sandbox_json_value` derived `status:"error"` when `!status.supported` regardless of whether `filesystem_active:true` (workspace-write containment working). On macOS the typical state is `{supported:false, filesystem_active:true, active_namespace:false}` — namespace isolation is unsupported but the filesystem sandbox IS active. This is degradation, not failure. Fix: added `else if status.filesystem_active { "warn" }` branch before the hard `"error"` arm — `status:"error"` is now reserved for the case where sandbox is enabled, unsupported, AND no filesystem containment is active either. macOS default now correctly returns `status:"warn"`. Source: Jobdori dogfood on `425d94ee`, 2026-05-26. + +732. **DONE — roadmap-next-id helper missing explicit ROADMAP path behavior is regression-tested** — follow-up to #725 after dogfood on origin/main 49d5b3fc showed the helper already failed correctly for `scripts/roadmap-next-id.sh /tmp/nonexistent-roadmap` but tests only covered clean next-id output, duplicate fail-fast behavior, and missing-checker fail-closed behavior. This PR adds focused unittest coverage proving a missing explicit ROADMAP path exits nonzero, keeps stdout empty, and reports both `ROADMAP not found` and the requested path on stderr. **Verification:** `python -m unittest tests.test_roadmap_helpers -q`; `scripts/roadmap-check-ids.sh ROADMAP.md`; `scripts/roadmap-next-id.sh ROADMAP.md`. Source: Jobdori dogfood follow-up on origin/main 49d5b3fc. [SCOPE: docs/scripts] diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/test_roadmap_helpers.py b/tests/test_roadmap_helpers.py index 0169f88cc5..b674836187 100644 --- a/tests/test_roadmap_helpers.py +++ b/tests/test_roadmap_helpers.py @@ -46,6 +46,17 @@ def test_roadmap_next_id_fails_fast_on_helper_era_duplicate(self) -> None: self.assertIn('999', result.stderr) self.assertNotIn('1000', result.stdout) + def test_roadmap_next_id_fails_when_explicit_roadmap_path_is_missing(self) -> None: + with tempfile.TemporaryDirectory() as temp_dir: + roadmap = Path(temp_dir) / 'missing-ROADMAP.md' + + result = run_next_id(roadmap) + + self.assertNotEqual(0, result.returncode) + self.assertEqual('', result.stdout) + self.assertIn('ROADMAP not found', result.stderr) + self.assertIn(str(roadmap), result.stderr) + def test_roadmap_next_id_fails_closed_when_checker_is_unavailable(self) -> None: with tempfile.TemporaryDirectory() as temp_dir: script_dir = Path(temp_dir) / 'scripts'