@windyroad/itil 1.2.0 → 2.0.0-preview.1111
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.
- package/.agents/plugins/marketplace.json +12 -0
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +42 -0
- package/README.md +34 -25
- package/agents/hang-off-check.md +34 -34
- package/bin/install.mjs +71 -5
- package/bin/wr-itil-catchup-scan +4 -4
- package/bin/wr-itil-check-deferred-placeholder-staleness +4 -4
- package/bin/wr-itil-check-fail-soft-skip-discipline +4 -4
- package/bin/wr-itil-check-fix-rfc-trace +4 -4
- package/bin/wr-itil-check-locale-discipline +4 -4
- package/bin/wr-itil-check-outbound-responses-staleness +4 -4
- package/bin/wr-itil-check-problems-readme-budget +4 -4
- package/bin/wr-itil-check-rfc-has-stories +4 -4
- package/bin/wr-itil-check-rfc-stories-ratified +4 -4
- package/bin/wr-itil-check-ticket-jtbd-ratification +4 -4
- package/bin/wr-itil-check-upstream-cache-staleness +4 -4
- package/bin/wr-itil-check-upstream-responses +4 -4
- package/bin/wr-itil-classify-readme-drift +4 -4
- package/bin/wr-itil-derive-release-vehicle +4 -4
- package/bin/wr-itil-detect-unratified-stories-maps +4 -4
- package/bin/wr-itil-effort-tally +4 -4
- package/bin/wr-itil-enumerate-postrelease-kv-candidates +4 -4
- package/bin/wr-itil-evaluate-relevance +4 -4
- package/bin/wr-itil-mark-create-gate +4 -4
- package/bin/wr-itil-mark-story-oversight-confirmed +4 -4
- package/bin/wr-itil-migrate-problems-layout +4 -4
- package/bin/wr-itil-migrate-story-status-mirror +4 -4
- package/bin/wr-itil-next-rfc-id +4 -4
- package/bin/wr-itil-plugin-exercise-index +4 -4
- package/bin/wr-itil-plugin-maturity-populate +4 -4
- package/bin/wr-itil-plugin-maturity-render +4 -4
- package/bin/wr-itil-plugin-validate-ci-gate +4 -4
- package/bin/wr-itil-reconcile-readme +4 -4
- package/bin/wr-itil-reconcile-rfcs +4 -4
- package/bin/wr-itil-reconcile-stories +4 -4
- package/bin/wr-itil-reconcile-story-maps +4 -4
- package/bin/wr-itil-render-story-map +4 -4
- package/bin/wr-itil-resolve-governance-plugin-dirs +4 -4
- package/bin/wr-itil-skill-invocations +4 -4
- package/bin/wr-itil-story-map-edit +4 -4
- package/bin/wr-itil-story-map-query +4 -4
- package/bin/wr-itil-update-jtbd-references-section +4 -4
- package/bin/wr-itil-update-problem-references-section +4 -4
- package/bin/wr-itil-update-problem-rfcs-section +4 -4
- package/bin/wr-itil-update-rfc-commits-section +4 -4
- package/bin/wr-itil-update-rfc-references-section +4 -4
- package/bin/wr-itil-verify-iter-summary +4 -4
- package/hooks/itil-assistant-output-gate.sh +3 -3
- package/hooks/itil-assistant-output-review.sh +5 -5
- package/hooks/itil-bash-polling-antipattern-detect.sh +11 -11
- package/hooks/itil-changeset-discipline.sh +24 -24
- package/hooks/itil-claude-space-protection.sh +21 -14
- package/hooks/itil-codex-dispatch.sh +164 -0
- package/hooks/itil-commit-trailer-transition-advisory.sh +11 -11
- package/hooks/itil-correction-detect.sh +8 -8
- package/hooks/itil-deferral-cadence-gate.sh +23 -23
- package/hooks/itil-fictional-defer-detect.sh +16 -16
- package/hooks/itil-fix-title-lifecycle-advisory.sh +11 -11
- package/hooks/itil-mid-loop-ask-detect.sh +14 -14
- package/hooks/itil-no-implement-draft-gate.sh +18 -18
- package/hooks/itil-pending-questions-surface.sh +11 -11
- package/hooks/itil-readme-refresh-discipline.sh +27 -27
- package/hooks/itil-rfc-oversight-nudge.sh +7 -7
- package/hooks/itil-rfc-trailer-advisory.sh +28 -28
- package/hooks/itil-runtime-sid-marker.sh +11 -11
- package/hooks/itil-story-mirror-migration-nudge.sh +7 -7
- package/hooks/lib/block-list.sh +17 -17
- package/hooks/lib/changeset-detect.sh +27 -27
- package/hooks/lib/claude-space-gate.sh +23 -15
- package/hooks/lib/command-detect.sh +12 -12
- package/hooks/lib/create-gate.sh +9 -39
- package/hooks/lib/detectors.sh +12 -12
- package/hooks/lib/readme-refresh-detect.sh +51 -51
- package/hooks/lib/runtime-sid.sh +12 -12
- package/hooks/lib/session-id.sh +28 -28
- package/hooks/lib/session-marker.sh +1 -1
- package/hooks/lib/staging-detect.sh +13 -13
- package/hooks/manage-problem-enforce-create.sh +16 -27
- package/hooks/p057-staging-trap-detect.sh +18 -18
- package/hooks/pre-publish-intake-gate.sh +5 -5
- package/hooks/staleness-check.sh +6 -6
- package/hooks-codex/hooks.json +57 -0
- package/lib/check-deferred-placeholder-staleness.sh +10 -10
- package/lib/check-outbound-responses-staleness.sh +2 -2
- package/lib/check-upstream-cache-staleness.sh +2 -2
- package/lib/derive-first-dispatch.sh +19 -19
- package/lib/enumerate-postrelease-kv-candidates.sh +18 -18
- package/lib/migrate-problems-layout.sh +12 -12
- package/lib/story-oversight.sh +27 -27
- package/package.json +16 -3
- package/scripts/catchup-scan.sh +25 -25
- package/scripts/check-fail-soft-skip-discipline.sh +10 -10
- package/scripts/check-fix-rfc-trace.sh +8 -8
- package/scripts/check-locale-discipline.sh +13 -13
- package/scripts/check-problems-readme-budget.sh +12 -12
- package/scripts/check-rfc-has-stories.sh +7 -7
- package/scripts/check-rfc-rejected-alternatives.sh +11 -11
- package/scripts/check-rfc-stories-ratified.sh +9 -9
- package/scripts/check-ticket-jtbd-ratification.sh +10 -10
- package/scripts/check-upstream-responses.sh +22 -22
- package/scripts/classify-readme-drift.sh +13 -13
- package/scripts/codex-agent.mjs +104 -0
- package/scripts/derive-release-vehicle.sh +23 -23
- package/scripts/detect-unoversighted-rfcs.sh +3 -3
- package/scripts/detect-unratified-stories-maps.sh +5 -5
- package/scripts/effort-tally.sh +10 -10
- package/scripts/evaluate-relevance.sh +16 -16
- package/scripts/mark-create-gate.sh +4 -4
- package/scripts/mark-story-oversight-confirmed.sh +14 -14
- package/scripts/migrate-story-status-mirror.sh +6 -6
- package/scripts/next-rfc-id.sh +5 -5
- package/scripts/plugin-exercise-index.sh +26 -26
- package/scripts/plugin-maturity-populate.sh +38 -38
- package/scripts/plugin-maturity-render.sh +26 -26
- package/scripts/plugin-validate-ci-gate.sh +14 -14
- package/scripts/reconcile-readme.sh +23 -23
- package/scripts/reconcile-rfcs.sh +13 -13
- package/scripts/reconcile-stories.sh +12 -12
- package/scripts/reconcile-story-maps.sh +6 -6
- package/scripts/render-story-map.mjs +24 -24
- package/scripts/render-story-map.sh +3 -3
- package/scripts/resolve-governance-plugin-dirs.sh +10 -10
- package/scripts/run-check-deferred-placeholder-staleness.sh +3 -3
- package/scripts/run-check-outbound-responses-staleness.sh +3 -3
- package/scripts/run-check-upstream-cache-staleness.sh +3 -3
- package/scripts/run-enumerate-postrelease-kv-candidates.sh +3 -3
- package/scripts/run-migrate-problems-layout.sh +3 -3
- package/scripts/skill-invocations.sh +29 -29
- package/scripts/story-map-edit.mjs +6 -6
- package/scripts/story-map-edit.sh +3 -3
- package/scripts/story-map-query.mjs +8 -8
- package/scripts/story-map-query.sh +3 -3
- package/scripts/update-jtbd-references-section.sh +8 -8
- package/scripts/update-problem-references-section.sh +12 -12
- package/scripts/update-problem-rfcs-section.sh +9 -9
- package/scripts/update-rfc-commits-section.sh +7 -7
- package/scripts/update-rfc-references-section.sh +3 -3
- package/scripts/update-story-references-section.sh +5 -5
- package/scripts/verify-iter-summary.sh +3 -3
- package/skills/capture-problem/REFERENCE.md +33 -33
- package/skills/capture-problem/SKILL.md +108 -108
- package/skills/capture-problem/agents/openai.yaml +3 -0
- package/skills/capture-rfc/SKILL.md +21 -323
- package/skills/capture-rfc/agents/openai.yaml +3 -0
- package/skills/capture-story/SKILL.md +65 -65
- package/skills/capture-story/agents/openai.yaml +3 -0
- package/skills/capture-story-map/SKILL.md +31 -31
- package/skills/capture-story-map/agents/openai.yaml +3 -0
- package/skills/check-upstream-responses/SKILL.md +38 -38
- package/skills/check-upstream-responses/agents/openai.yaml +3 -0
- package/skills/close-incident/SKILL.md +25 -25
- package/skills/close-incident/agents/openai.yaml +3 -0
- package/skills/link-incident/SKILL.md +22 -22
- package/skills/link-incident/agents/openai.yaml +3 -0
- package/skills/list-incidents/SKILL.md +9 -9
- package/skills/list-incidents/agents/openai.yaml +3 -0
- package/skills/list-problems/SKILL.md +17 -17
- package/skills/list-problems/agents/openai.yaml +3 -0
- package/skills/list-stories/SKILL.md +23 -23
- package/skills/list-stories/agents/openai.yaml +3 -0
- package/skills/list-story-maps/SKILL.md +9 -9
- package/skills/list-story-maps/agents/openai.yaml +3 -0
- package/skills/manage-incident/SKILL.md +59 -59
- package/skills/manage-incident/agents/openai.yaml +3 -0
- package/skills/manage-problem/SKILL.md +222 -222
- package/skills/manage-problem/agents/openai.yaml +3 -0
- package/skills/manage-rfc/SKILL.md +62 -62
- package/skills/manage-rfc/agents/openai.yaml +3 -0
- package/skills/manage-story/SKILL.md +49 -49
- package/skills/manage-story/agents/openai.yaml +3 -0
- package/skills/manage-story-map/SKILL.md +30 -30
- package/skills/manage-story-map/agents/openai.yaml +3 -0
- package/skills/mitigate-incident/SKILL.md +40 -40
- package/skills/mitigate-incident/agents/openai.yaml +3 -0
- package/skills/reconcile-readme/SKILL.md +28 -28
- package/skills/reconcile-readme/agents/openai.yaml +3 -0
- package/skills/reconcile-stories/SKILL.md +17 -17
- package/skills/reconcile-stories/agents/openai.yaml +3 -0
- package/skills/reconcile-story-maps/SKILL.md +11 -11
- package/skills/reconcile-story-maps/agents/openai.yaml +3 -0
- package/skills/report-upstream/SKILL.md +73 -73
- package/skills/report-upstream/agents/openai.yaml +3 -0
- package/skills/restore-incident/SKILL.md +28 -28
- package/skills/restore-incident/agents/openai.yaml +3 -0
- package/skills/review-problems/SKILL.md +129 -129
- package/skills/review-problems/agents/openai.yaml +3 -0
- package/skills/scaffold-intake/SKILL.md +26 -26
- package/skills/scaffold-intake/agents/openai.yaml +3 -0
- package/skills/transition-problem/SKILL.md +85 -85
- package/skills/transition-problem/agents/openai.yaml +3 -0
- package/skills/transition-problems/SKILL.md +69 -69
- package/skills/transition-problems/agents/openai.yaml +3 -0
- package/skills/update-upstream/SKILL.md +97 -97
- package/skills/update-upstream/agents/openai.yaml +3 -0
- package/skills/work-problem/SKILL.md +42 -42
- package/skills/work-problem/agents/openai.yaml +3 -0
- package/skills/work-problems/SKILL.md +327 -327
- package/skills/work-problems/agents/openai.yaml +3 -0
- package/skills-codex/capture-problem/REFERENCE.md +139 -0
- package/skills-codex/capture-problem/SKILL.md +438 -0
- package/skills-codex/capture-problem/agents/openai.yaml +3 -0
- package/skills-codex/capture-rfc/SKILL.md +45 -0
- package/skills-codex/capture-rfc/agents/openai.yaml +3 -0
- package/skills-codex/capture-story/SKILL.md +407 -0
- package/skills-codex/capture-story/agents/openai.yaml +3 -0
- package/skills-codex/capture-story-map/SKILL.md +286 -0
- package/skills-codex/capture-story-map/agents/openai.yaml +3 -0
- package/skills-codex/check-upstream-responses/SKILL.md +160 -0
- package/skills-codex/check-upstream-responses/agents/openai.yaml +3 -0
- package/skills-codex/close-incident/SKILL.md +192 -0
- package/skills-codex/close-incident/agents/openai.yaml +3 -0
- package/skills-codex/link-incident/SKILL.md +173 -0
- package/skills-codex/link-incident/agents/openai.yaml +3 -0
- package/skills-codex/list-incidents/SKILL.md +92 -0
- package/skills-codex/list-incidents/agents/openai.yaml +3 -0
- package/skills-codex/list-problems/SKILL.md +126 -0
- package/skills-codex/list-problems/agents/openai.yaml +3 -0
- package/skills-codex/list-stories/SKILL.md +170 -0
- package/skills-codex/list-stories/agents/openai.yaml +3 -0
- package/skills-codex/list-story-maps/SKILL.md +104 -0
- package/skills-codex/list-story-maps/agents/openai.yaml +3 -0
- package/skills-codex/manage-incident/SKILL.md +378 -0
- package/skills-codex/manage-incident/agents/openai.yaml +3 -0
- package/skills-codex/manage-problem/SKILL.md +1180 -0
- package/skills-codex/manage-problem/agents/openai.yaml +3 -0
- package/skills-codex/manage-rfc/SKILL.md +314 -0
- package/skills-codex/manage-rfc/agents/openai.yaml +3 -0
- package/skills-codex/manage-story/SKILL.md +284 -0
- package/skills-codex/manage-story/agents/openai.yaml +3 -0
- package/skills-codex/manage-story-map/SKILL.md +198 -0
- package/skills-codex/manage-story-map/agents/openai.yaml +3 -0
- package/skills-codex/mitigate-incident/SKILL.md +239 -0
- package/skills-codex/mitigate-incident/agents/openai.yaml +3 -0
- package/skills-codex/reconcile-readme/SKILL.md +175 -0
- package/skills-codex/reconcile-readme/agents/openai.yaml +3 -0
- package/skills-codex/reconcile-stories/SKILL.md +124 -0
- package/skills-codex/reconcile-stories/agents/openai.yaml +3 -0
- package/skills-codex/reconcile-story-maps/SKILL.md +81 -0
- package/skills-codex/reconcile-story-maps/agents/openai.yaml +3 -0
- package/skills-codex/report-upstream/SKILL.md +716 -0
- package/skills-codex/report-upstream/agents/openai.yaml +3 -0
- package/skills-codex/restore-incident/SKILL.md +216 -0
- package/skills-codex/restore-incident/agents/openai.yaml +3 -0
- package/skills-codex/review-problems/SKILL.md +524 -0
- package/skills-codex/review-problems/agents/openai.yaml +3 -0
- package/skills-codex/scaffold-intake/SKILL.md +209 -0
- package/skills-codex/scaffold-intake/agents/openai.yaml +3 -0
- package/skills-codex/scaffold-intake/templates/CONTRIBUTING.md.tmpl +31 -0
- package/skills-codex/scaffold-intake/templates/SECURITY.md.tmpl +39 -0
- package/skills-codex/scaffold-intake/templates/SUPPORT.md.tmpl +32 -0
- package/skills-codex/scaffold-intake/templates/config.yml.tmpl +8 -0
- package/skills-codex/scaffold-intake/templates/problem-report.yml.tmpl +114 -0
- package/skills-codex/transition-problem/SKILL.md +371 -0
- package/skills-codex/transition-problem/agents/openai.yaml +3 -0
- package/skills-codex/transition-problems/SKILL.md +310 -0
- package/skills-codex/transition-problems/agents/openai.yaml +3 -0
- package/skills-codex/update-upstream/SKILL.md +583 -0
- package/skills-codex/update-upstream/agents/openai.yaml +3 -0
- package/skills-codex/work-problem/SKILL.md +160 -0
- package/skills-codex/work-problem/agents/openai.yaml +3 -0
- package/skills-codex/work-problems/SKILL.md +58 -0
- package/skills-codex/work-problems/agents/openai.yaml +3 -0
- package/templates/story-map.css +1 -1
- package/bin/wr-itil-mark-rfc-capture-gate +0 -51
- package/scripts/mark-rfc-capture-gate.sh +0 -32
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
2
|
+
# readme-refresh-enforcement-gap-iter-subprocess-commits-can-land-a-verifying-md-rename-without-staging-the-corresponding-verification-queue-row-in-docs-problems-readme-md-problem: shared README-refresh-discipline detection helper.
|
|
3
3
|
#
|
|
4
4
|
# `detect_readme_refresh_required` returns 0 (no change required —
|
|
5
5
|
# allow) / 1 (ticket change staged but README refresh not staged —
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
# on stdout so callers can name it in deny messages without re-parsing
|
|
8
8
|
# diff output.
|
|
9
9
|
#
|
|
10
|
-
# Trap shape (
|
|
11
|
-
# `manage-problem` SKILL.md Step 5 (
|
|
10
|
+
# Trap shape (readme-refresh-enforcement-gap-iter-subprocess-commits-can-land-a-verifying-md-rename-without-staging-the-corresponding-verification-queue-row-in-docs-problems-readme-md-problem):
|
|
11
|
+
# `manage-problem` SKILL.md Step 5 (problem-094-wr-itil-manage-problem-does-not-refresh-docs-problems-readme-md-on-ticket-creation-problem) and Step 7 (problem-062-manage-problem-does-not-refresh-docs-problems-readme-md-on-single-ticket-transitions-fast-path-cache-goes-stale-silently-problem) say every
|
|
12
12
|
# ticket creation, ranking-bearing update, and status transition MUST
|
|
13
13
|
# stage the refreshed `docs/problems/README.md` in the same commit as
|
|
14
|
-
# the ticket change (
|
|
14
|
+
# the ticket change (governance-skills-commit-their-own-completed-work-architecture-rule single-commit grain). The contract is
|
|
15
15
|
# declarative; iter subprocess commits have shipped `.verifying.md`
|
|
16
16
|
# renames or Status edits without the README refresh (observed iter
|
|
17
|
-
# 3 commit d28bd51 —
|
|
17
|
+
# 3 commit d28bd51 — ship-wr-architect-capture-adr-skill-lightweight-aside-invocation-surface-for-adr-capture-during-foreground-work-problem row missing from VQ until iter 4 backfill).
|
|
18
18
|
# Hook-level detection at `git commit` time replaces the declarative-
|
|
19
19
|
# only enforcement.
|
|
20
20
|
#
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
# - `git diff --staged --name-only` enumerates staged paths.
|
|
23
23
|
# - Categorise each path:
|
|
24
24
|
# * `docs/problems/(open|verifying|closed|known-error|parked)/NNN-*.md`
|
|
25
|
-
# (new state-directory layout per
|
|
25
|
+
# (new state-directory layout per problem-ticket-directory-layout-per-state-subdirectories-under-docs-problems-architecture-rule) — counts as a
|
|
26
26
|
# ticket-state-transition surface; records the path.
|
|
27
27
|
# * `docs/problems/NNN-*.(open|verifying|closed|known-error|parked).md`
|
|
28
28
|
# (legacy flat layout) — also counts; supports adopter repos
|
|
29
29
|
# and any residual flat-layout tickets.
|
|
30
30
|
# * `docs/problems/README.md` — counts as a README refresh.
|
|
31
31
|
# * `docs/problems/README-history.md` — ignored (rotated history
|
|
32
|
-
# per
|
|
32
|
+
# per docs-problems-readme-md-line-3-narrative-blob-accumulator-bloat-sibling-to-briefing-tier-3-on-a-different-surface-problem; not a ticket file, not the load-bearing README).
|
|
33
33
|
# * Anything else — ignored (non-ticket surface; the gate has no
|
|
34
34
|
# opinion on retros, ADRs, source, etc.).
|
|
35
35
|
# - If any ticket path is recorded AND README is NOT staged, return
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
# history). Audit-traceable via shell history. Set in
|
|
42
42
|
# `.claude/settings.json` env field or shell `export` before
|
|
43
43
|
# launching `claude` — inline-prefix syntax (`VAR=1 git commit ...`)
|
|
44
|
-
# does NOT propagate from a Bash subshell to PreToolUse hooks (
|
|
45
|
-
# - Registered `RISK_BYPASS: <token>` commit-message trailer (
|
|
44
|
+
# does NOT propagate from a Bash subshell to PreToolUse hooks (bypass-gate-env-vars-do-not-propagate-from-bash-subshell-to-pretooluse-hook-context-problem).
|
|
45
|
+
# - Registered `RISK_BYPASS: <token>` commit-message trailer (hook-does-not-recognise-risk-bypass-adr-031-migration-trailer-blocks-step-0a-auto-migrate-problem) →
|
|
46
46
|
# return 0 (allow). Narrow allow-list: `adr-031-migration` (the
|
|
47
|
-
# standalone
|
|
47
|
+
# standalone problem-ticket-directory-layout-per-state-subdirectories-under-docs-problems-architecture-rule layout-migration commit — a rename-only change
|
|
48
48
|
# that legitimately stages no README refresh; also clears
|
|
49
49
|
# risk-score-commit-gate.sh) and `capture-deferred-readme` (the
|
|
50
50
|
# /wr-itil:capture-problem Step 6 commit, whose README refresh is
|
|
51
|
-
# deferred to /wr-itil:review-problems per
|
|
51
|
+
# deferred to /wr-itil:review-problems per governance-skill-invocation-patterns-foreground-background-with-deferred-question-resumption-architecture-rule — readme-refresh-hook-conflicts-with-capture-problem-skill-s-deferred-readme-refresh-contract-hook-wins-skill-needs-update-or-hook-needs-carve-out-problem; this
|
|
52
52
|
# token clears THIS gate only, not the risk-score gate). The trailer
|
|
53
53
|
# is read from the live `git commit` command string at PreToolUse
|
|
54
54
|
# time (the commit message is not yet written), matching the sibling
|
|
55
|
-
# `risk-score-commit-gate.sh` recognition (
|
|
56
|
-
# `adr-031-migration` token. Registry of record:
|
|
55
|
+
# `risk-score-commit-gate.sh` recognition (problem-tickets-strain-as-fixes-decompose-into-multiple-coordinated-changes-need-an-rfc-framework-that-ties-all-changes-back-to-problems-and-unifies-technical-with-user-business-problems-problem T11) for the shared
|
|
56
|
+
# `adr-031-migration` token. Registry of record: governance-skills-commit-their-own-completed-work-architecture-rule
|
|
57
57
|
# commit-message bypass-token table.
|
|
58
58
|
#
|
|
59
|
-
# Narrative-only short-circuit (
|
|
59
|
+
# Narrative-only short-circuit (readme-refresh-discipline-hook-misfires-on-narrative-only-ticket-edits-when-no-ranking-bearing-field-changed-and-reconcile-readme-sh-exit-0-problem):
|
|
60
60
|
# - When all staged ticket edits are purely narrative — no
|
|
61
61
|
# ranking-bearing field change (Priority / Effort / Status / WSJF /
|
|
62
62
|
# Type field-lines), no title change, no rename between state
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
# the current README, return 0 (allow). Reconcile-readme is the
|
|
66
66
|
# authoritative drift oracle for narrative-only edits.
|
|
67
67
|
# - Ranking-bearing edits still fall through to existing detection
|
|
68
|
-
# regardless of reconcile state, preserving
|
|
68
|
+
# regardless of reconcile state, preserving governance-skills-commit-their-own-completed-work-architecture-rule single-commit
|
|
69
69
|
# grain for the change-set surface (architect verdict: reconcile is
|
|
70
70
|
# a robustness layer on top of per-operation refresh, not a
|
|
71
71
|
# supersession of either).
|
|
@@ -80,44 +80,44 @@
|
|
|
80
80
|
# Cost: one `git diff` invocation per check (~10ms on this repo's
|
|
81
81
|
# working tree). Per-invocation deterministic — runs on every
|
|
82
82
|
# `git commit` invocation rather than relying on per-tool-call session
|
|
83
|
-
# state tracking. Mirrors
|
|
83
|
+
# state tracking. Mirrors staging-trap-recurs-despite-documentation-hook-level-enforcement-candidate-problem `staging-detect.sh` + afk-iter-packages-plugin-commits-without-changesets-orchestrator-main-turn-back-fill-is-fragile-recovery-hook-level-enforcement-preferable-problem
|
|
84
84
|
# `changeset-detect.sh` precedent (architect-approved no-marker design
|
|
85
|
-
# per
|
|
85
|
+
# per gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule carve-out).
|
|
86
86
|
#
|
|
87
87
|
# References:
|
|
88
|
-
#
|
|
89
|
-
# `hooks/test/` per
|
|
90
|
-
#
|
|
88
|
+
# plugin-testing-strategy-architecture-rule — plugin testing strategy (hook bats live under
|
|
89
|
+
# `hooks/test/` per problem-081-structural-source-content-tests-are-wasteful-tdd-agent-should-reject-them-and-require-behavioural-tests-framework-stub-enhancements-problem behavioural-test discipline).
|
|
90
|
+
# gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule — gate marker lifecycle (this helper deliberately does
|
|
91
91
|
# NOT use markers; detection is per-invocation
|
|
92
92
|
# deterministic, not per-session trust window — same
|
|
93
|
-
# precedent as
|
|
94
|
-
#
|
|
93
|
+
# precedent as staging-trap-recurs-despite-documentation-hook-level-enforcement-candidate-problem / afk-iter-packages-plugin-commits-without-changesets-orchestrator-main-turn-back-fill-is-fragile-recovery-hook-level-enforcement-preferable-problem).
|
|
94
|
+
# structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 1 — deny redirects with mechanical recovery (the deny
|
|
95
95
|
# text names the offending ticket path + the literal
|
|
96
96
|
# `git add docs/problems/README.md` recovery command +
|
|
97
97
|
# the BYPASS env var override).
|
|
98
|
-
#
|
|
98
|
+
# governance-skills-commit-their-own-completed-work-architecture-rule — single-commit grain (this hook enforces it for the
|
|
99
99
|
# ticket-state-transition surface).
|
|
100
|
-
#
|
|
100
|
+
# problem-lifecycle-add-a-verification-pending-status-between-known-error-and-closed-architecture-rule — `.verifying.md` lifecycle status (one of the surface
|
|
101
101
|
# shapes the hook detects).
|
|
102
|
-
#
|
|
102
|
+
# problem-ticket-directory-layout-per-state-subdirectories-under-docs-problems-architecture-rule — per-state-subdir problem ticket layout (the new layout
|
|
103
103
|
# the hook detects).
|
|
104
|
-
#
|
|
105
|
-
#
|
|
104
|
+
# progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule — progressive disclosure / deny-message terseness.
|
|
105
|
+
# hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule — hook injection budget (Pattern 1 silent-on-pass; deny
|
|
106
106
|
# band ≤300 bytes for this hook).
|
|
107
|
-
#
|
|
107
|
+
# problem-062-manage-problem-does-not-refresh-docs-problems-readme-md-on-single-ticket-transitions-fast-path-cache-goes-stale-silently-problem — parent (README refresh on transition contract — manage-
|
|
108
108
|
# problem Step 7).
|
|
109
|
-
#
|
|
109
|
+
# problem-094-wr-itil-manage-problem-does-not-refresh-docs-problems-readme-md-on-ticket-creation-problem — parent (README refresh on creation contract — manage-
|
|
110
110
|
# problem Step 5).
|
|
111
|
-
#
|
|
111
|
+
# docs-problems-readme-md-drifts-from-filesystem-truth-across-sessions-despite-refresh-on-create-and-refresh-on-transition-both-closed-problem — sibling reconcile-readme recovery path (the after-the-
|
|
112
112
|
# fact rescue this hook obviates).
|
|
113
|
-
#
|
|
113
|
+
# staging-trap-recurs-despite-documentation-hook-level-enforcement-candidate-problem — sibling staging-trap helper (same enforcement-layer
|
|
114
114
|
# shape — per-invocation deterministic, no markers).
|
|
115
|
-
#
|
|
116
|
-
#
|
|
117
|
-
#
|
|
115
|
+
# afk-iter-packages-plugin-commits-without-changesets-orchestrator-main-turn-back-fill-is-fragile-recovery-hook-level-enforcement-preferable-problem — sibling changeset-discipline helper (same shape).
|
|
116
|
+
# readme-refresh-enforcement-gap-iter-subprocess-commits-can-land-a-verifying-md-rename-without-staging-the-corresponding-verification-queue-row-in-docs-problems-readme-md-problem — this helper.
|
|
117
|
+
# hook-does-not-recognise-risk-bypass-adr-031-migration-trailer-blocks-step-0a-auto-migrate-problem — RISK_BYPASS trailer allow-list bypass (this addition).
|
|
118
118
|
|
|
119
119
|
# Allow-list of registered RISK_BYPASS commit-message trailer tokens
|
|
120
|
-
# (
|
|
120
|
+
# (hook-does-not-recognise-risk-bypass-adr-031-migration-trailer-blocks-step-0a-auto-migrate-problem). A policy-authorised commit may carry `RISK_BYPASS: <token>` in
|
|
121
121
|
# its message body; when <token> is registered here, the README-refresh
|
|
122
122
|
# gate allows the commit even though no README refresh is staged. The
|
|
123
123
|
# allow-list keeps the bypass narrow and auditable — a generic
|
|
@@ -128,30 +128,30 @@
|
|
|
128
128
|
# commit written by lib/migrate-problems-layout.sh. It is a pure
|
|
129
129
|
# rename (no README content change — the table references tickets by
|
|
130
130
|
# ID, not path), so requiring a README refresh would deadlock the
|
|
131
|
-
# migration (
|
|
132
|
-
# risk-score-commit-gate.sh (
|
|
131
|
+
# migration (hook-does-not-recognise-risk-bypass-adr-031-migration-trailer-blocks-step-0a-auto-migrate-problem). The same token clears the sibling
|
|
132
|
+
# risk-score-commit-gate.sh (problem-tickets-strain-as-fixes-decompose-into-multiple-coordinated-changes-need-an-rfc-framework-that-ties-all-changes-back-to-problems-and-unifies-technical-with-user-business-problems-problem T11); both gates recognise it via
|
|
133
133
|
# the identical grep below so one logical migration commit clears
|
|
134
|
-
# both. Registry of record:
|
|
134
|
+
# both. Registry of record: governance-skills-commit-their-own-completed-work-architecture-rule commit-message bypass-token table.
|
|
135
135
|
# capture-deferred-readme — the lightweight /wr-itil:capture-problem
|
|
136
136
|
# Step 6 commit (subject `docs(problems): capture P<NNN> ...`). Per
|
|
137
|
-
#
|
|
137
|
+
# governance-skill-invocation-patterns-foreground-background-with-deferred-question-resumption-architecture-rule the capture variant DEFERS the README refresh to the next
|
|
138
138
|
# /wr-itil:review-problems (capture-time speed is the load-bearing
|
|
139
139
|
# distinction from manage-problem's full-intake path), so the capture
|
|
140
140
|
# commit legitimately stages only the new ticket file. Without this
|
|
141
|
-
# token the
|
|
142
|
-
# every capture commit (
|
|
143
|
-
# adr-031-migration this token clears the
|
|
141
|
+
# token the readme-refresh-enforcement-gap-iter-subprocess-commits-can-land-a-verifying-md-rename-without-staging-the-corresponding-verification-queue-row-in-docs-problems-readme-md-problem gate's new-ticket-is-ranking-bearing rule denied
|
|
142
|
+
# every capture commit (readme-refresh-hook-conflicts-with-capture-problem-skill-s-deferred-readme-refresh-contract-hook-wins-skill-needs-update-or-hook-needs-carve-out-problem — observed 4×/session). UNLIKE
|
|
143
|
+
# adr-031-migration this token clears the readme-refresh-enforcement-gap-iter-subprocess-commits-can-land-a-verifying-md-rename-without-staging-the-corresponding-verification-queue-row-in-docs-problems-readme-md-problem README-refresh gate
|
|
144
144
|
# ONLY — it is intentionally NOT registered in
|
|
145
145
|
# risk-score-commit-gate.sh (a capture commit is real work and must
|
|
146
146
|
# be risk-scored normally; risk-score-commit-gate.sh hard-greps only
|
|
147
|
-
# `adr-031-migration`). Registry of record:
|
|
147
|
+
# `adr-031-migration`). Registry of record: governance-skills-commit-their-own-completed-work-architecture-rule commit-message
|
|
148
148
|
# bypass-token table (which documents the README-gate-only asymmetry).
|
|
149
149
|
_README_REFRESH_BYPASS_TRAILERS=("adr-031-migration" "capture-deferred-readme")
|
|
150
150
|
|
|
151
151
|
# Returns 0 if the given `git commit` command string carries a
|
|
152
152
|
# registered RISK_BYPASS trailer from the allow-list above. The grep
|
|
153
153
|
# pattern is kept byte-identical to risk-score-commit-gate.sh so both
|
|
154
|
-
# commit gates recognise the token the same way (
|
|
154
|
+
# commit gates recognise the token the same way (hook-does-not-recognise-risk-bypass-adr-031-migration-trailer-blocks-step-0a-auto-migrate-problem architect verdict).
|
|
155
155
|
_readme_refresh_command_has_bypass_trailer() {
|
|
156
156
|
local command="${1:-}"
|
|
157
157
|
[ -n "$command" ] || return 1
|
|
@@ -169,8 +169,8 @@ _readme_refresh_command_has_bypass_trailer() {
|
|
|
169
169
|
# is not staged.
|
|
170
170
|
#
|
|
171
171
|
# $1 (optional) — the `git commit` command string. Inspected for a
|
|
172
|
-
# registered RISK_BYPASS trailer (
|
|
173
|
-
# bypass (fail-safe; preserves pre-
|
|
172
|
+
# registered RISK_BYPASS trailer (hook-does-not-recognise-risk-bypass-adr-031-migration-trailer-blocks-step-0a-auto-migrate-problem). Empty/absent → no trailer
|
|
173
|
+
# bypass (fail-safe; preserves pre-hook-does-not-recognise-risk-bypass-adr-031-migration-trailer-blocks-step-0a-auto-migrate-problem behaviour for any caller that
|
|
174
174
|
# does not thread the command through).
|
|
175
175
|
#
|
|
176
176
|
# Echoes the offending ticket path on stdout when detected.
|
|
@@ -187,11 +187,11 @@ detect_readme_refresh_required() {
|
|
|
187
187
|
return 0
|
|
188
188
|
fi
|
|
189
189
|
|
|
190
|
-
# Bypass via registered RISK_BYPASS commit-message trailer (
|
|
191
|
-
# The
|
|
190
|
+
# Bypass via registered RISK_BYPASS commit-message trailer (hook-does-not-recognise-risk-bypass-adr-031-migration-trailer-blocks-step-0a-auto-migrate-problem).
|
|
191
|
+
# The problem-ticket-directory-layout-per-state-subdirectories-under-docs-problems-architecture-rule layout-migration commit is a rename-only change that
|
|
192
192
|
# legitimately stages no README refresh; its `RISK_BYPASS:
|
|
193
193
|
# adr-031-migration` trailer carries the policy authorisation
|
|
194
|
-
# (
|
|
194
|
+
# (problem-ticket-directory-layout-per-state-subdirectories-under-docs-problems-architecture-rule § Backward Compatibility + structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 6).
|
|
195
195
|
if _readme_refresh_command_has_bypass_trailer "$command"; then
|
|
196
196
|
return 0
|
|
197
197
|
fi
|
|
@@ -226,7 +226,7 @@ detect_readme_refresh_required() {
|
|
|
226
226
|
| docs/problems/closed/*.md \
|
|
227
227
|
| docs/problems/known-error/*.md \
|
|
228
228
|
| docs/problems/parked/*.md)
|
|
229
|
-
# New state-directory layout (
|
|
229
|
+
# New state-directory layout (problem-ticket-directory-layout-per-state-subdirectories-under-docs-problems-architecture-rule). Filename must start
|
|
230
230
|
# with digits to be a ticket file — exclude any future
|
|
231
231
|
# state-directory-local README or similar.
|
|
232
232
|
basename="${path##*/}"
|
|
@@ -258,7 +258,7 @@ EOF
|
|
|
258
258
|
# README staged alongside — clean.
|
|
259
259
|
[ "$has_readme" -eq 1 ] && return 0
|
|
260
260
|
|
|
261
|
-
#
|
|
261
|
+
# readme-refresh-discipline-hook-misfires-on-narrative-only-ticket-edits-when-no-ranking-bearing-field-changed-and-reconcile-readme-sh-exit-0-problem narrative-only short-circuit. Detect whether the staged ticket
|
|
262
262
|
# set is purely narrative (no ranking-bearing field change, no rename
|
|
263
263
|
# between state subdirs, no creation/deletion). If so, consult
|
|
264
264
|
# reconcile-readme.sh as the authoritative drift oracle; exit=0 means
|
package/hooks/lib/runtime-sid.sh
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
2
|
+
# phase-4-get-current-session-id-helper-system-priority-bug-subprocess-sids-win-mtime-selection-over-orchestrator-sid-problem (wr-itil-manage-problem-step-2-substep-7-session-id-discovery-is-brittle-agent-has-no-env-var-must-scrape-marker-filenames-problem Phase 4): runtime-SID marker path helper.
|
|
3
3
|
#
|
|
4
4
|
# Computes the per-machine, per-user, per-project marker path that the
|
|
5
5
|
# `itil-runtime-sid-marker.sh` PreToolUse hook writes the runtime
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
#
|
|
11
11
|
# Why this exists:
|
|
12
12
|
# The Phase 3 helper relied on within-system mtime selection across
|
|
13
|
-
#
|
|
13
|
+
# progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule announce markers. In orchestrator main turns AFTER subprocess
|
|
14
14
|
# dispatch, subprocess announce markers had NEWER mtimes than the
|
|
15
15
|
# orchestrator's, so newest-mtime-wins picked the wrong UUID. No pure-
|
|
16
16
|
# helper algorithm can disambiguate orchestrator vs subprocess context
|
|
17
|
-
# from filesystem state alone (
|
|
17
|
+
# from filesystem state alone (phase-4-get-current-session-id-helper-system-priority-bug-subprocess-sids-win-mtime-selection-over-orchestrator-sid-problem ticket Investigation Tasks). The
|
|
18
18
|
# structural fix is to capture the runtime stdin SID — known with
|
|
19
19
|
# certainty by the hook on every tool call — into a discoverable file
|
|
20
|
-
# the helper can read. See
|
|
20
|
+
# the helper can read. See capture-the-runtime-stdin-session-id-via-a-pretooluse-hook-so-the-create-gate-marker-binds-to-the-same-sid-the-runtime-hook-will-see-architecture-rule.
|
|
21
21
|
#
|
|
22
22
|
# Path scoping:
|
|
23
23
|
# When SESSION_MARKER_DIR is set (sandboxed bats per session-id.bats
|
|
@@ -30,22 +30,22 @@
|
|
|
30
30
|
# "/tmp/itil-runtime-sid-${USER}-${proj_hash}.current" where
|
|
31
31
|
# proj_hash = cksum of $PWD. Two Claude Code sessions in DIFFERENT
|
|
32
32
|
# projects do not race (different proj_hash). Two sessions in the
|
|
33
|
-
# SAME project on the same machine still race; per
|
|
33
|
+
# SAME project on the same machine still race; per capture-the-runtime-stdin-session-id-via-a-pretooluse-hook-so-the-create-gate-marker-binds-to-the-same-sid-the-runtime-hook-will-see-architecture-rule this is
|
|
34
34
|
# accepted as a documented limitation — the failure mode is a hook-
|
|
35
35
|
# denied Write that the agent can recover from, not silent corruption.
|
|
36
36
|
#
|
|
37
37
|
# References:
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
38
|
+
# capture-the-runtime-stdin-session-id-via-a-pretooluse-hook-so-the-create-gate-marker-binds-to-the-same-sid-the-runtime-hook-will-see-architecture-rule — runtime-SID instrumentation via PreToolUse (this surface).
|
|
39
|
+
# documented-recovery-from-gate-misfire-is-the-prescribed-surface-not-bypass-architecture-rule — gate-misfire recovery procedure (superseded by capture-the-runtime-stdin-session-id-via-a-pretooluse-hook-so-the-create-gate-marker-binds-to-the-same-sid-the-runtime-hook-will-see-architecture-rule +
|
|
40
|
+
# phase-4-get-current-session-id-helper-system-priority-bug-subprocess-sids-win-mtime-selection-over-orchestrator-sid-problem + this lib).
|
|
41
|
+
# progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule — announce-marker contract (cold-path fallback consumer).
|
|
42
|
+
# gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule — gate marker lifecycle.
|
|
43
|
+
# phase-4-get-current-session-id-helper-system-priority-bug-subprocess-sids-win-mtime-selection-over-orchestrator-sid-problem — this fix's ticket.
|
|
44
44
|
|
|
45
45
|
# Echoes the runtime-SID marker path on stdout. Always exits 0.
|
|
46
46
|
#
|
|
47
47
|
# Usage (resolve relative to the caller's own location — NEVER repo-relative
|
|
48
|
-
# `packages/...`, which only exists in the source monorepo;
|
|
48
|
+
# `packages/...`, which only exists in the source monorepo; capture-problem-capture-rfc-manage-problem-step-2-create-gate-marker-step-sources-repo-relative-packages-itil-hooks-lib-sh-fails-in-adopter-installs-recurring-published-path-class-problem/adopter-safe-path-resolution-in-shipped-skills-24-repo-relative-references-release-design):
|
|
49
49
|
# source "$(dirname "${BASH_SOURCE[0]}")/runtime-sid.sh"
|
|
50
50
|
# path=$(runtime_sid_path)
|
|
51
51
|
runtime_sid_path() {
|
package/hooks/lib/session-id.sh
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
2
|
+
# wr-itil-manage-problem-step-2-substep-7-session-id-discovery-is-brittle-agent-has-no-env-var-must-scrape-marker-filenames-problem: agent-side session-ID discovery helper.
|
|
3
3
|
#
|
|
4
4
|
# `get_current_session_id` returns the canonical Claude Code session UUID
|
|
5
5
|
# for the current invocation, used by /wr-itil:manage-problem Step 2
|
|
@@ -14,27 +14,27 @@
|
|
|
14
14
|
# /wr-itil:manage-problem Step 2's prior fallback `${CLAUDE_SESSION_ID:-default}`
|
|
15
15
|
# wrote the marker under "default" while the hook checked the real UUID.
|
|
16
16
|
# Marker mismatch -> Write deny -> agent had to scrape an existing
|
|
17
|
-
# announce marker filename ad-hoc to recover.
|
|
17
|
+
# announce marker filename ad-hoc to recover. wr-itil-manage-problem-step-2-substep-7-session-id-discovery-is-brittle-agent-has-no-env-var-must-scrape-marker-filenames-problem.
|
|
18
18
|
#
|
|
19
19
|
# Discovery strategy (announce markers preferred over reviewed markers):
|
|
20
20
|
# /tmp/${SYSTEM}-announced-${SESSION_ID} markers are write-once-per-session
|
|
21
|
-
# per
|
|
21
|
+
# per progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule and are emitted on the FIRST UserPromptSubmit of every
|
|
22
22
|
# session by every active plugin (architect, jtbd, tdd, style-guide,
|
|
23
23
|
# voice-tone, itil-assistant-gate, itil-correction-detect). They have
|
|
24
24
|
# no mtime sliding (unlike `-reviewed-` gate markers, which `touch`-refresh
|
|
25
|
-
# on every gate check per
|
|
25
|
+
# on every gate check per gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule sliding TTL + agent-task-subprocess-tool-calls-do-not-refresh-parent-session-s-gate-markers-ttl-inflation-is-a-symptom-treatment-not-the-fix-problem subprocess refresh),
|
|
26
26
|
# so the announce-marker UUID is the most reliable per-session signal
|
|
27
27
|
# reachable from agent-side code without an env var.
|
|
28
28
|
#
|
|
29
|
-
# Why itil-local instead of packages/shared (cf.
|
|
30
|
-
# The discovery direction is the OPPOSITE of
|
|
31
|
-
#
|
|
29
|
+
# Why itil-local instead of packages/shared (cf. shared-code-duplicated-into-per-package-lib-kept-in-sync-by-script-ci-drift-check-architecture-rule):
|
|
30
|
+
# The discovery direction is the OPPOSITE of progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule's announce helper —
|
|
31
|
+
# progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule's session-marker.sh WRITES announce markers from hook side;
|
|
32
32
|
# this helper READS them from agent side. Only manage-problem SKILL.md
|
|
33
33
|
# needs agent-side discovery today (Step 2 substep 7), so the helper
|
|
34
34
|
# is itil-local with read-only fallbacks across other plugins' marker
|
|
35
35
|
# filenames (no write coupling, no sync obligation). If a second skill
|
|
36
36
|
# adopts agent-side SID discovery, promote to packages/shared/ at that
|
|
37
|
-
# point per
|
|
37
|
+
# point per shared-code-duplicated-into-per-package-lib-kept-in-sync-by-script-ci-drift-check-architecture-rule shared-code-sync. Mirrors create-gate.sh's "Why a
|
|
38
38
|
# separate helper from lib/review-gate.sh" precedent.
|
|
39
39
|
#
|
|
40
40
|
# Empty SESSION_ID fallback:
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
# /tmp/manage-problem-grep- which the hook never matches. Fail-closed.
|
|
44
44
|
#
|
|
45
45
|
# References:
|
|
46
|
-
#
|
|
46
|
+
# progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule — progressive disclosure / session-marker pattern (announce
|
|
47
47
|
# markers, /tmp/${SYSTEM}-announced-${SESSION_ID} convention).
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
48
|
+
# gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule — gate marker lifecycle (covers /tmp marker conventions).
|
|
49
|
+
# shared-code-duplicated-into-per-package-lib-kept-in-sync-by-script-ci-drift-check-architecture-rule — shared-code-sync (consulted; itil-local is the right home today).
|
|
50
|
+
# agent-bypasses-wr-itil-manage-problem-step-2-duplicate-check-by-writing-tickets-directly-to-docs-problems-problem — create-gate hook this discovery helper feeds.
|
|
51
|
+
# wr-itil-manage-problem-step-2-substep-7-session-id-discovery-is-brittle-agent-has-no-env-var-must-scrape-marker-filenames-problem — this helper.
|
|
52
52
|
#
|
|
53
53
|
# Test override: SESSION_MARKER_DIR (defaults to /tmp) lets bats run
|
|
54
54
|
# under a sandboxed marker directory without polluting real session
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
# Echoes the UUID on stdout. Exit 0 if discovered, 1 if not.
|
|
59
59
|
#
|
|
60
60
|
# Usage (resolve relative to the caller's own location — NEVER repo-relative
|
|
61
|
-
# `packages/...`, which only exists in the source monorepo;
|
|
61
|
+
# `packages/...`, which only exists in the source monorepo; capture-problem-capture-rfc-manage-problem-step-2-create-gate-marker-step-sources-repo-relative-packages-itil-hooks-lib-sh-fails-in-adopter-installs-recurring-published-path-class-problem/adopter-safe-path-resolution-in-shipped-skills-24-repo-relative-references-release-design):
|
|
62
62
|
# source "$(dirname "${BASH_SOURCE[0]}")/session-id.sh" # or ../hooks/lib/ from a scripts/ wrapper
|
|
63
63
|
# sid=$(get_current_session_id) || { echo "no SID available" >&2; exit 1; }
|
|
64
64
|
get_current_session_id() {
|
|
@@ -70,7 +70,7 @@ get_current_session_id() {
|
|
|
70
70
|
return 0
|
|
71
71
|
fi
|
|
72
72
|
|
|
73
|
-
#
|
|
73
|
+
# phase-4-get-current-session-id-helper-system-priority-bug-subprocess-sids-win-mtime-selection-over-orchestrator-sid-problem / capture-the-runtime-stdin-session-id-via-a-pretooluse-hook-so-the-create-gate-marker-binds-to-the-same-sid-the-runtime-hook-will-see-architecture-rule: runtime-SID marker. The PreToolUse hook
|
|
74
74
|
# (itil-runtime-sid-marker.sh) writes the runtime stdin session_id
|
|
75
75
|
# to a per-machine marker on EVERY tool call. The helper, running
|
|
76
76
|
# inside a Bash tool call, reads the marker that the same Bash
|
|
@@ -123,19 +123,19 @@ get_current_session_id() {
|
|
|
123
123
|
# Multi-session developer machines accumulate one
|
|
124
124
|
# `${system}-announced-${SID}` marker per past session in /tmp;
|
|
125
125
|
# the live session's marker is by construction the most-recently-
|
|
126
|
-
# created one.
|
|
126
|
+
# created one. wr-itil-manage-problem-step-2-substep-7-session-id-discovery-is-brittle-agent-has-no-env-var-must-scrape-marker-filenames-problem Phase 2 used first-glob-match (alphabetical),
|
|
127
127
|
# which returned the lexically-first stale UUID when /tmp had
|
|
128
128
|
# accumulated markers from prior sessions — observed regression
|
|
129
129
|
# 2026-04-28 with 103 stale architect markers selecting the
|
|
130
|
-
# wrong UUID, denying the create-gate (
|
|
130
|
+
# wrong UUID, denying the create-gate (agent-bypasses-wr-itil-manage-problem-step-2-duplicate-check-by-writing-tickets-directly-to-docs-problems-problem).
|
|
131
131
|
#
|
|
132
132
|
# Why mtime is safe here even though Phase 1 architect rejected it:
|
|
133
133
|
# The Phase 1 rejection applied to `-reviewed-` markers, which
|
|
134
|
-
# `touch`-refresh on every gate check (
|
|
135
|
-
#
|
|
134
|
+
# `touch`-refresh on every gate check (gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule sliding TTL +
|
|
135
|
+
# agent-task-subprocess-tool-calls-do-not-refresh-parent-session-s-gate-markers-ttl-inflation-is-a-symptom-treatment-not-the-fix-problem subprocess refresh). Mtime on a `-reviewed-` marker is
|
|
136
136
|
# "last seen", not "first written" — selecting newest-mtime can
|
|
137
137
|
# surface a stale session whose marker was just touch-refreshed.
|
|
138
|
-
# `-announced-` markers are write-once-per-session per
|
|
138
|
+
# `-announced-` markers are write-once-per-session per progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule
|
|
139
139
|
# (no `touch`-refresh, no TTL); their mtime IS the announcing
|
|
140
140
|
# session's first-prompt timestamp. Newest mtime within a single
|
|
141
141
|
# `-announced-` glob unambiguously identifies the live session.
|
|
@@ -155,7 +155,7 @@ get_current_session_id() {
|
|
|
155
155
|
return 1
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
#
|
|
158
|
+
# create-gate-marker-race-between-concurrent-claude-sessions-via-shared-runtime-sid-file-problem / capture-the-runtime-stdin-session-id-via-a-pretooluse-hook-so-the-create-gate-marker-binds-to-the-same-sid-the-runtime-hook-will-see-architecture-rule Option C: bounded multi-UUID candidate enumeration.
|
|
159
159
|
#
|
|
160
160
|
# Echoes EVERY candidate session UUID — one per line, deduplicated — that
|
|
161
161
|
# the create-gate hook (manage-problem-enforce-create.sh) might read from
|
|
@@ -172,8 +172,8 @@ get_current_session_id() {
|
|
|
172
172
|
# proj_hash), last-writer-wins. When the orchestrator captures a ticket
|
|
173
173
|
# while the subprocess holds the runtime-sid, `get_current_session_id`
|
|
174
174
|
# returns the SUBPROCESS SID, but the orchestrator's Write carries the
|
|
175
|
-
# ORCHESTRATOR SID on its stdin — marker mismatch, create-gate deny (
|
|
176
|
-
#
|
|
175
|
+
# ORCHESTRATOR SID on its stdin — marker mismatch, create-gate deny (create-gate-marker-race-between-concurrent-claude-sessions-via-shared-runtime-sid-file-problem).
|
|
176
|
+
# capture-the-runtime-stdin-session-id-via-a-pretooluse-hook-so-the-create-gate-marker-binds-to-the-same-sid-the-runtime-hook-will-see-architecture-rule §Context establishes that no agent-side algorithm can PREDICT
|
|
177
177
|
# the right single SID from filesystem state alone. Option C stops
|
|
178
178
|
# predicting and writes under every recent candidate instead.
|
|
179
179
|
#
|
|
@@ -185,16 +185,16 @@ get_current_session_id() {
|
|
|
185
185
|
# 2. Every announce-marker UUID across ALL systems whose marker mtime is
|
|
186
186
|
# within the window (the concurrently-active sessions: orchestrator +
|
|
187
187
|
# its running subprocess(es)). Announce markers are write-once-per-
|
|
188
|
-
# session (
|
|
188
|
+
# session (progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule, no touch-refresh), so mtime is the announcing
|
|
189
189
|
# session's first-prompt timestamp — a stable bound.
|
|
190
190
|
#
|
|
191
191
|
# Bounding (NOT a global fail-open):
|
|
192
192
|
# The mtime window (SESSION_CANDIDATE_WINDOW_MINS, default 1440 = 24h)
|
|
193
|
-
# bounds the enumeration against the
|
|
193
|
+
# bounds the enumeration against the wr-itil-manage-problem-step-2-substep-7-session-id-discovery-is-brittle-agent-has-no-env-var-must-scrape-marker-filenames-problem stale-marker pathology (103
|
|
194
194
|
# accumulated UUIDs selecting the wrong SID). 24h comfortably covers any
|
|
195
195
|
# realistic single AFK loop while excluding multi-day marker accumulation.
|
|
196
196
|
# Extra markers under recently-stale UUIDs are HARMLESS — empty files; the
|
|
197
|
-
# hook only matches the marker equal to the Write's stdin SID. The
|
|
197
|
+
# hook only matches the marker equal to the Write's stdin SID. The agent-bypasses-wr-itil-manage-problem-step-2-duplicate-check-by-writing-tickets-directly-to-docs-problems-problem
|
|
198
198
|
# audit invariant holds: every marker still records that THIS session ran
|
|
199
199
|
# the duplicate-check grep (the marker is only written because Step 2's
|
|
200
200
|
# grep provably ran this turn; widening WHICH SID files receive that proof
|
|
@@ -206,7 +206,7 @@ get_current_session_id() {
|
|
|
206
206
|
#
|
|
207
207
|
# Usage — SKILLs call the `wr-itil-mark-create-gate` command (it does the
|
|
208
208
|
# source+pipe internally, adopter-safe); direct callers resolve the libs relative
|
|
209
|
-
# to their OWN location, NEVER repo-relative `packages/...` (
|
|
209
|
+
# to their OWN location, NEVER repo-relative `packages/...` (capture-problem-capture-rfc-manage-problem-step-2-create-gate-marker-step-sources-repo-relative-packages-itil-hooks-lib-sh-fails-in-adopter-installs-recurring-published-path-class-problem/adopter-safe-path-resolution-in-shipped-skills-24-repo-relative-references-release-design):
|
|
210
210
|
# LIB="$(dirname "${BASH_SOURCE[0]}")"; source "$LIB/session-id.sh"; source "$LIB/create-gate.sh"
|
|
211
211
|
# get_candidate_session_ids | mark_step2_complete_candidates
|
|
212
212
|
get_candidate_session_ids() {
|
|
@@ -224,7 +224,7 @@ get_candidate_session_ids() {
|
|
|
224
224
|
# `-mmin -N` are portable across BSD (macOS) and GNU find. `-L` follows the
|
|
225
225
|
# start-point symlink — on macOS marker_dir defaults to /tmp, a symlink to
|
|
226
226
|
# /private/tmp, which `find` would otherwise refuse to descend, silently
|
|
227
|
-
# enumerating zero candidates (no-op on Linux where /tmp is a real dir).
|
|
227
|
+
# enumerating zero candidates (no-op on Linux where /tmp is a real dir). wr-architect-mark-oversight-confirmed-shim-s-find-tmp-doesn-t-follow-macos-tmp-private-tmp-symlink-problem.
|
|
228
228
|
# The sed strips the leading path then the `<system>-announced-` prefix,
|
|
229
229
|
# leaving the trailing UUID (UUIDs never contain the literal "-announced-").
|
|
230
230
|
find -L "$marker_dir" -maxdepth 1 -name '*-announced-*' -mmin "-${window_mins}" 2>/dev/null \
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Shared session-announcement marker helpers (
|
|
2
|
+
# Shared session-announcement marker helpers (problem-095-userpromptsubmit-hooks-across-five-windyroad-plugins-re-emit-full-mandatory-prose-on-every-prompt-problem / progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule).
|
|
3
3
|
#
|
|
4
4
|
# Used by UserPromptSubmit hooks to gate verbose MANDATORY instruction
|
|
5
5
|
# prose behind a once-per-session check. First prompt of a session emits
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
2
|
+
# staging-trap-recurs-despite-documentation-hook-level-enforcement-candidate-problem: shared staging-trap detection helper.
|
|
3
3
|
#
|
|
4
4
|
# `detect_p057_trap` returns 0 (no trap detected — allow) / 1 (trap
|
|
5
5
|
# detected — caller should deny). On 1, the trap'd path is echoed on
|
|
6
6
|
# stdout and a one-line recovery hint is emitted on stderr so callers
|
|
7
7
|
# can surface both in deny messages without re-parsing diff output.
|
|
8
8
|
#
|
|
9
|
-
# Trap shape (
|
|
9
|
+
# Trap shape (problem-057-git-mv-edit-git-add-staging-ordering-trap-drops-content-edits-from-the-commit-problem):
|
|
10
10
|
# `git mv A B` stages the rename atomically. If the agent then
|
|
11
11
|
# modifies B via the Edit tool (or any other working-tree edit),
|
|
12
12
|
# git's index still carries only the rename — the post-rename
|
|
13
13
|
# content edit is a working-tree modification needing a separate
|
|
14
14
|
# `git add B`. Without that re-stage, only the rename lands at
|
|
15
15
|
# commit time and the edit leaks into the next commit (audit-trail
|
|
16
|
-
# corruption — the original
|
|
16
|
+
# corruption — the original problem-057-git-mv-edit-git-add-staging-ordering-trap-drops-content-edits-from-the-commit-problem concern).
|
|
17
17
|
#
|
|
18
18
|
# Detection logic:
|
|
19
19
|
# - `git diff --staged --name-status` enumerates staged changes;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
#
|
|
25
25
|
# Cost: two `git diff` invocations per check (~10-50ms on this repo's
|
|
26
26
|
# working tree; bounded by repo size, not commit batch size). Per
|
|
27
|
-
# architect verdict on
|
|
27
|
+
# architect verdict on staging-trap-recurs-despite-documentation-hook-level-enforcement-candidate-problem: cheaper than a session-marker variant
|
|
28
28
|
# and deterministic — runs on every `git commit` invocation rather
|
|
29
29
|
# than relying on per-tool-call session state tracking.
|
|
30
30
|
#
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
# in unrelated contexts).
|
|
39
39
|
#
|
|
40
40
|
# References:
|
|
41
|
-
#
|
|
42
|
-
#
|
|
41
|
+
# plugin-testing-strategy-architecture-rule — plugin testing strategy (hook bats live under hooks/test/).
|
|
42
|
+
# gate-marker-lifecycle-ttl-drift-not-stop-hook-reset-architecture-rule — gate marker lifecycle (this helper deliberately does NOT
|
|
43
43
|
# use markers; detection is per-invocation deterministic,
|
|
44
44
|
# not per-session trust window).
|
|
45
|
-
#
|
|
45
|
+
# structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 1 — deny redirects with mechanical recovery (the deny
|
|
46
46
|
# text names the file + the literal `git add <new>`
|
|
47
47
|
# recovery; no skill round-trip required).
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
48
|
+
# progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule — progressive disclosure / deny-message terseness.
|
|
49
|
+
# problem-057-git-mv-edit-git-add-staging-ordering-trap-drops-content-edits-from-the-commit-problem — original staging-trap ticket (closed; documentation fix).
|
|
50
|
+
# agent-bypasses-wr-itil-manage-problem-step-2-duplicate-check-by-writing-tickets-directly-to-docs-problems-problem — sibling create-gate hook + lib/create-gate.sh helper
|
|
51
51
|
# (precedent for the deny + helper-pair shape).
|
|
52
|
-
#
|
|
52
|
+
# staging-trap-recurs-despite-documentation-hook-level-enforcement-candidate-problem — this helper.
|
|
53
53
|
|
|
54
|
-
# Detect the
|
|
54
|
+
# Detect the problem-057-git-mv-edit-git-add-staging-ordering-trap-drops-content-edits-from-the-commit-problem staging trap in the current git working tree.
|
|
55
55
|
#
|
|
56
56
|
# Echoes the trap'd path on stdout when detected; emits a one-line
|
|
57
57
|
# recovery hint on stderr.
|
|
@@ -94,7 +94,7 @@ detect_p057_trap() {
|
|
|
94
94
|
# Match against working-tree mod list (full-line match).
|
|
95
95
|
if printf '%s\n' "$wt_mods" | grep -Fxq "$new_path"; then
|
|
96
96
|
printf '%s\n' "$new_path"
|
|
97
|
-
echo "
|
|
97
|
+
echo "problem-057-git-mv-edit-git-add-staging-ordering-trap-drops-content-edits-from-the-commit-problem staging-trap: re-stage with: git add $new_path" >&2
|
|
98
98
|
return 1
|
|
99
99
|
fi
|
|
100
100
|
;;
|