From e9302cbb271f97abd7bdf84fae70c16ba099ed9a Mon Sep 17 00:00:00 2001 From: Test Date: Sun, 15 Nov 2026 05:34:06 -0500 Subject: [PATCH] fix(derive-monitoring): stop claiming the audit checks "five properties" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3586. Step 2 of the derive-monitoring skill (SKILL.md and PROMPT.md) said it audits the design-for-diagnosis rule's "five properties" while it audits eight: version-stamping, data-store-signals (#3578) and backlog-emission (#3576) were added without updating the count, and PROMPT.md's reading list carried the same number. Both files now name all eight properties and state no count, so adding one cannot make the sentence stale again. Tests: - tests/test_derive_monitoring_property_count.py — neither skill file states a numeric property count; the detector catches the old wording. Verification: - scripts/smoke-test.sh green: 5074 tests OK, all declared gates pass. Co-Authored-By: Claude Opus 5.5 --- .specfuse/skills/derive-monitoring/PROMPT.md | 7 ++-- .specfuse/skills/derive-monitoring/SKILL.md | 6 ++-- ...he-derive-monitoring-skill-no-longer-cl.md | 5 +++ .../skills/derive-monitoring/PROMPT.md | 7 ++-- .../skills/derive-monitoring/SKILL.md | 6 ++-- .../test_derive_monitoring_property_count.py | 35 +++++++++++++++++++ 6 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 changelog.d/3586-the-derive-monitoring-skill-no-longer-cl.md create mode 100644 tests/test_derive_monitoring_property_count.py diff --git a/.specfuse/skills/derive-monitoring/PROMPT.md b/.specfuse/skills/derive-monitoring/PROMPT.md index 1ebe7910..7336242e 100644 --- a/.specfuse/skills/derive-monitoring/PROMPT.md +++ b/.specfuse/skills/derive-monitoring/PROMPT.md @@ -31,7 +31,7 @@ stdout for the user to review. Read these in the loop scaffold under this repo's `.specfuse/` before acting: - `.specfuse/skills/derive-monitoring/SKILL.md` — the binding method. -- `.specfuse/rules/design-for-diagnosis.md` — the five diagnosability +- `.specfuse/rules/design-for-diagnosis.md` — the diagnosability properties the audit checks against. - `.specfuse/monitoring.yml.example` and `.specfuse/monitoring.overrides.yml.example` — the file shapes. @@ -74,9 +74,10 @@ check — its `query` is operator-supplied by definition. ### Step 2 — Diagnosability audit Audit the discovered components against -`.specfuse/rules/design-for-diagnosis.md`'s five properties: correlation-ID +`.specfuse/rules/design-for-diagnosis.md`'s properties: correlation-ID propagation, structured logging, per-component role names, heartbeat -emission, DLQ failure-context capture. A component given `heartbeat` +emission, DLQ failure-context capture, version stamping, data-store signals, +backlog-snapshot emission (each detailed below). A component given `heartbeat` targets whose own code emits no `ScheduleHeartbeat` event (schedule name in a `scheduleName` property, under its role name) gets a `heartbeat-emission` finding — those targets would all report silent. An HTTP-serving component showing no per-deployment version stamp (`version-stamping`) gets one finding and no `http-status-regression` check; with the stamp it gets that check (`deploy_signal: {kind: app-version}`, a `window_after_deploy`). diff --git a/.specfuse/skills/derive-monitoring/SKILL.md b/.specfuse/skills/derive-monitoring/SKILL.md index 501e8ca6..c17d4a2b 100644 --- a/.specfuse/skills/derive-monitoring/SKILL.md +++ b/.specfuse/skills/derive-monitoring/SKILL.md @@ -133,9 +133,11 @@ diverging into two different things. ### Step 2 — Diagnosability audit Audit the discovered components against -`.specfuse/rules/design-for-diagnosis.md` (T04)'s five properties: correlation-ID +`.specfuse/rules/design-for-diagnosis.md` (T04)'s properties: correlation-ID propagation, structured logging, per-component role names matching -`monitoring.yml`, heartbeat emission, and DLQ failure-context capture. The +`monitoring.yml`, heartbeat emission, DLQ failure-context capture, version +stamping, data-store signals, and backlog-snapshot emission. The per-component +ones are detailed below. The `heartbeat-emission` property is per-component: any component Step 1 gives `heartbeat` targets (it has discovered schedules) must show, in its own code, an emission of the rule's heartbeat event — a `ScheduleHeartbeat` custom event diff --git a/changelog.d/3586-the-derive-monitoring-skill-no-longer-cl.md b/changelog.d/3586-the-derive-monitoring-skill-no-longer-cl.md new file mode 100644 index 00000000..632eb3b6 --- /dev/null +++ b/changelog.d/3586-the-derive-monitoring-skill-no-longer-cl.md @@ -0,0 +1,5 @@ +--- +class: fixed +trace: #3586 +--- +The derive-monitoring skill no longer claims its diagnosability audit checks "five properties"; it names all eight it audits and states no count diff --git a/plugins/specfuse/skills/derive-monitoring/PROMPT.md b/plugins/specfuse/skills/derive-monitoring/PROMPT.md index 1ebe7910..7336242e 100644 --- a/plugins/specfuse/skills/derive-monitoring/PROMPT.md +++ b/plugins/specfuse/skills/derive-monitoring/PROMPT.md @@ -31,7 +31,7 @@ stdout for the user to review. Read these in the loop scaffold under this repo's `.specfuse/` before acting: - `.specfuse/skills/derive-monitoring/SKILL.md` — the binding method. -- `.specfuse/rules/design-for-diagnosis.md` — the five diagnosability +- `.specfuse/rules/design-for-diagnosis.md` — the diagnosability properties the audit checks against. - `.specfuse/monitoring.yml.example` and `.specfuse/monitoring.overrides.yml.example` — the file shapes. @@ -74,9 +74,10 @@ check — its `query` is operator-supplied by definition. ### Step 2 — Diagnosability audit Audit the discovered components against -`.specfuse/rules/design-for-diagnosis.md`'s five properties: correlation-ID +`.specfuse/rules/design-for-diagnosis.md`'s properties: correlation-ID propagation, structured logging, per-component role names, heartbeat -emission, DLQ failure-context capture. A component given `heartbeat` +emission, DLQ failure-context capture, version stamping, data-store signals, +backlog-snapshot emission (each detailed below). A component given `heartbeat` targets whose own code emits no `ScheduleHeartbeat` event (schedule name in a `scheduleName` property, under its role name) gets a `heartbeat-emission` finding — those targets would all report silent. An HTTP-serving component showing no per-deployment version stamp (`version-stamping`) gets one finding and no `http-status-regression` check; with the stamp it gets that check (`deploy_signal: {kind: app-version}`, a `window_after_deploy`). diff --git a/plugins/specfuse/skills/derive-monitoring/SKILL.md b/plugins/specfuse/skills/derive-monitoring/SKILL.md index 501e8ca6..c17d4a2b 100644 --- a/plugins/specfuse/skills/derive-monitoring/SKILL.md +++ b/plugins/specfuse/skills/derive-monitoring/SKILL.md @@ -133,9 +133,11 @@ diverging into two different things. ### Step 2 — Diagnosability audit Audit the discovered components against -`.specfuse/rules/design-for-diagnosis.md` (T04)'s five properties: correlation-ID +`.specfuse/rules/design-for-diagnosis.md` (T04)'s properties: correlation-ID propagation, structured logging, per-component role names matching -`monitoring.yml`, heartbeat emission, and DLQ failure-context capture. The +`monitoring.yml`, heartbeat emission, DLQ failure-context capture, version +stamping, data-store signals, and backlog-snapshot emission. The per-component +ones are detailed below. The `heartbeat-emission` property is per-component: any component Step 1 gives `heartbeat` targets (it has discovered schedules) must show, in its own code, an emission of the rule's heartbeat event — a `ScheduleHeartbeat` custom event diff --git a/tests/test_derive_monitoring_property_count.py b/tests/test_derive_monitoring_property_count.py new file mode 100644 index 00000000..78912e6c --- /dev/null +++ b/tests/test_derive_monitoring_property_count.py @@ -0,0 +1,35 @@ +# Copyright 2026 Specfuse Contributors +# Licensed under the Apache License, Version 2.0. See LICENSE. +"""#3586: the derive-monitoring skill must not state a fixed count of the +design-for-diagnosis properties its audit checks. Step 2 said "five +properties" while auditing eight; every property added since made the count +staler. With no number in the prose, adding a property cannot make it wrong.""" + +from __future__ import annotations + +import pathlib +import re +import unittest + +_SKILL_DIR = pathlib.Path(__file__).parent.parent / "plugins" / "specfuse" / "skills" / "derive-monitoring" + +_NUMBER_WORDS = "one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve" +_COUNTED_PROPERTIES = re.compile( + rf"\b(?:{_NUMBER_WORDS}|\d+)\s+(?:diagnosability\s+)?properties\b", re.IGNORECASE +) + + +class TestNoFixedPropertyCount(unittest.TestCase): + def test_skill_files_state_no_property_count(self): + for name in ("SKILL.md", "PROMPT.md"): + with self.subTest(name): + text = (_SKILL_DIR / name).read_text(encoding="utf-8") + self.assertEqual(_COUNTED_PROPERTIES.findall(text), []) + + def test_detector_catches_the_original_wording(self): + self.assertTrue(_COUNTED_PROPERTIES.search("the rule's five properties: correlation-ID")) + self.assertTrue(_COUNTED_PROPERTIES.search("the five diagnosability\n properties")) + + +if __name__ == "__main__": + unittest.main()