@ccoalm/ccl-skills 0.7.0 → 0.8.0

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 (91) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/SKILL.md +8 -7
  3. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/mobile-quality-release.md +1 -1
  4. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/SKILL.md +16 -17
  5. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/client-routing.md +1 -1
  6. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/staged-review-contract.md +195 -7
  7. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/timeout-auth-and-capabilities.md +3 -3
  8. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/claude_review.sh +13 -5
  9. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/codex_review.sh +9 -3
  10. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/kimi_review.sh +9 -3
  11. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/normalize_review_timeout.sh +22 -0
  12. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/opencode_review.sh +9 -3
  13. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/review_gate.py +1540 -129
  14. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_claude_review_probe.sh +8 -3
  15. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_review_client_compat.py +76 -1
  16. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_review_gate.sh +1858 -3
  17. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_update_review_plan_intent.sh +789 -0
  18. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/update_review_plan_intent.py +513 -0
  19. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/SKILL.md +4 -1
  20. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/SKILL.md +2 -1
  21. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/SKILL.md +11 -10
  22. package/dist/assets/marketplace/plugins/ccl-skills/skills/nodejs-service-dev/SKILL.md +64 -0
  23. package/dist/assets/marketplace/plugins/ccl-skills/skills/nodejs-service-dev/agents/openai.yaml +4 -0
  24. package/dist/assets/marketplace/plugins/ccl-skills/skills/nodejs-service-dev/references/async-lifecycle-and-performance.md +72 -0
  25. package/dist/assets/marketplace/plugins/ccl-skills/skills/nodejs-service-dev/references/runtime-and-project-contract.md +58 -0
  26. package/dist/assets/marketplace/plugins/ccl-skills/skills/nodejs-service-dev/references/source-map.md +41 -0
  27. package/dist/assets/marketplace/plugins/ccl-skills/skills/nodejs-service-dev/references/verification-diagnostics-and-security.md +63 -0
  28. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/SKILL.md +8 -10
  29. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/design-routing-and-readiness.md +10 -14
  30. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/verify-developer-experience.md +1 -1
  31. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/SKILL.md +135 -86
  32. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/behavioral-aesthetic-logic.md +66 -80
  33. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/delivery-contract.md +275 -0
  34. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-execution-checklist.md +88 -214
  35. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-impl-naming-and-versioning.md +2 -2
  36. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-intake-and-acceptance.md +10 -8
  37. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-system-source-of-truth.md +4 -5
  38. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/external-ui-ux-quality-benchmarks.md +112 -95
  39. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/frontend-code-evidence-map.md +30 -21
  40. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/interaction-design-patterns.md +22 -3
  41. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/layout-recipes-and-screenshot-acceptance.md +20 -17
  42. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/multi-project-token-consistency.md +7 -9
  43. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/multi-stack-strategy.md +14 -10
  44. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/operational-processing-workflows.md +2 -0
  45. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/platform-mobile-patterns.md +1 -1
  46. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/product-lifecycle-acceptance-and-iteration.md +9 -6
  47. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/product-surface-patterns.md +3 -0
  48. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/source-map.md +37 -10
  49. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/tokens-and-components.md +7 -1
  50. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/ui-ux-audit.md +8 -5
  51. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/ui-ux-design-development.md +16 -5
  52. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/visual-craft.md +4 -2
  53. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/SKILL.md +4 -1
  54. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/SKILL.md +4 -4
  55. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/dual-track-review-gate.md +95 -5
  56. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/extraction-quickstart.md +11 -9
  57. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/r0-leakage-audit.md +102 -0
  58. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/source-register.md +54 -0
  59. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/source-to-skill-extraction.md +8 -0
  60. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/uiux-judgment-extraction.md +6 -6
  61. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/validation-and-landing.md +4 -3
  62. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-ccl-skills.sh +69 -2
  63. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/extraction_review_gate.sh +22 -0
  64. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/impact-chain-gate.rb +49 -4
  65. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/obligation-ledger.py +2748 -0
  66. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/register-firing-path-resolution.rb +20 -5
  67. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/shared_git_surface_gate.py +1142 -0
  68. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_regressions.sh +17 -0
  69. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_skill_catalog.sh +41 -4
  70. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_ci_checkout_ref_binding.sh +120 -0
  71. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_entrypoint_domain_scan_terms.sh +82 -8
  72. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_extraction_review_gate.sh +336 -0
  73. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_impact_chain_self_adjudication.sh +82 -10
  74. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_obligation_ledger.sh +1416 -0
  75. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_obligation_ledger_repo_audit.sh +57 -0
  76. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_register_firing_path_wiring.sh +141 -4
  77. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_routing_pointer_integrity.sh +3 -1
  78. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_shared_git_surface_gate.sh +1696 -0
  79. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_uiux_delivery_contract.sh +2117 -0
  80. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_uiux_loading_budget.sh +316 -0
  81. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_validate_extraction_review_state.sh +1176 -0
  82. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_validate_skill_cross_refs.sh +31 -1
  83. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/validate-skill.sh +9 -4
  84. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/validate_extraction_review_state.py +980 -0
  85. package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/SKILL.md +8 -6
  86. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/SKILL.md +8 -7
  87. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/client-runtime-test-matrices.md +10 -2
  88. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/SKILL.md +6 -5
  89. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/complex-workspace-patterns.md +1 -1
  90. package/dist/assets/release.json +175 -70
  91. package/package.json +1 -1
@@ -0,0 +1,316 @@
1
+ #!/usr/bin/env bash
2
+ # Deterministic context-loading proxy for the UI/UX skill split.
3
+ #
4
+ # This test counts source bytes, not provider tokens or task quality. It proves
5
+ # exact byte cost of three documented loading profiles versus the immutable
6
+ # origin/dev entry+router path, while keeping the full contract one hop from the
7
+ # entry and every routed reference local and resolvable. Real provider load,
8
+ # token, latency, correction, and task-quality claims still require task trials.
9
+ set -euo pipefail
10
+
11
+ ROOT="${UIUX_LOADING_ROOT:-$(cd "$(dirname "$0")/../../.." && pwd -P)}"
12
+ DEFAULT_BASE_REF="e322db47abe5736e6e1fdf0e73e2ed3eb32c006b"
13
+ BASE_REF="${UIUX_LOADING_BASE_REF:-$DEFAULT_BASE_REF}"
14
+ ENTRY_REL="skills/product-ui-ux-design/SKILL.md"
15
+ ROUTER_REL="skills/product-ui-ux-design/references/design-execution-checklist.md"
16
+ CONTRACT_REL="skills/product-ui-ux-design/references/delivery-contract.md"
17
+ ENTRY="$ROOT/$ENTRY_REL"
18
+ ROUTER="$ROOT/$ROUTER_REL"
19
+ CONTRACT="$ROOT/$CONTRACT_REL"
20
+
21
+ fail() {
22
+ echo "FAIL: $*" >&2
23
+ exit 1
24
+ }
25
+
26
+ for file in "$ENTRY" "$ROUTER" "$CONTRACT"; do
27
+ [ -s "$file" ] || fail "required loading-profile file missing or empty: ${file#$ROOT/}"
28
+ done
29
+
30
+ if [ "$BASE_REF" != "$DEFAULT_BASE_REF" ] && [ "${UIUX_LOADING_FIXTURE_MODE:-}" != "1" ]; then
31
+ fail "UIUX_LOADING_BASE_REF override requires UIUX_LOADING_FIXTURE_MODE=1"
32
+ fi
33
+
34
+ resolved_base_sha=$(git -C "$ROOT" rev-parse --verify "$BASE_REF^{commit}" 2>/dev/null) ||
35
+ fail "immutable loading-budget base is unavailable: $BASE_REF"
36
+ base_entry_blob=$(git -C "$ROOT" rev-parse "$resolved_base_sha:$ENTRY_REL")
37
+ base_router_blob=$(git -C "$ROOT" rev-parse "$resolved_base_sha:$ROUTER_REL")
38
+
39
+ base_bytes() {
40
+ git -C "$ROOT" show "$BASE_REF:$1" | wc -c | tr -d ' '
41
+ }
42
+
43
+ file_bytes() {
44
+ wc -c < "$1" | tr -d ' '
45
+ }
46
+
47
+ active_markdown() {
48
+ ruby -e '
49
+ in_comment = false
50
+ fence = nil
51
+ ARGF.each_line do |raw|
52
+ line = raw.chomp
53
+ if fence
54
+ if (m = line.match(/\A {0,3}(`{3,}|~{3,})[ \t]*\z/))
55
+ run = m[1]
56
+ fence = nil if run[0] == fence[0] && run.length >= fence.length
57
+ end
58
+ next
59
+ end
60
+ loop do
61
+ if in_comment
62
+ close_at = line.index("-->")
63
+ if close_at
64
+ line = line[(close_at + 3)..] || ""
65
+ in_comment = false
66
+ else
67
+ line = ""
68
+ break
69
+ end
70
+ else
71
+ open_at = line.index("<!--")
72
+ break unless open_at
73
+ close_at = line.index("-->", open_at + 4)
74
+ if close_at
75
+ line = line[0...open_at] + (line[(close_at + 3)..] || "")
76
+ else
77
+ line = line[0...open_at]
78
+ in_comment = true
79
+ break
80
+ end
81
+ end
82
+ end
83
+ if (m = line.match(/\A {0,3}(`{3,}|~{3,})(.*)\z/))
84
+ run = m[1]
85
+ info = m[2]
86
+ unless run[0] == "`" && info.include?("`")
87
+ fence = run
88
+ next
89
+ end
90
+ end
91
+ next if line.match?(/\A(?:\t| {4})/)
92
+ puts line unless line.empty?
93
+ end
94
+ ' "$1"
95
+ }
96
+
97
+ active_literal_count() {
98
+ local file="$1" needle="$2"
99
+ active_markdown "$file" | ruby -e '
100
+ needle = ARGV.fetch(0)
101
+ print STDIN.read.scan(Regexp.new(Regexp.escape(needle))).length
102
+ ' "$needle"
103
+ }
104
+
105
+ active_loading_contradiction() {
106
+ active_markdown "$1" | ruby -e '
107
+ text = STDIN.read.downcase
108
+ allowed = [
109
+ "a runtime-visible task enters `references/delivery-contract.md` directly; the specialized router is not a prerequisite to that canonical path.",
110
+ "load `references/design-execution-checklist.md` only when the task needs one or more specialized work-mode, platform, risk, or evidence references whose route is not already unambiguous below.",
111
+ "do not load the router solely to reach `references/delivery-contract.md` or another unambiguous common route.",
112
+ "this router is conditional context, not an always-loaded prerequisite.",
113
+ "load this router when delivery depth must be composed with specialized work-mode, platform, risk, or evidence lenses.",
114
+ "when the router applies, select one delivery-depth profile for runtime work, then add every triggered work-mode and risk lens and load the union of their required references."
115
+ ]
116
+ allowed.each { |sentence| text = text.gsub(sentence, "") }
117
+ text = text.gsub("feature-risk-router", "")
118
+ .gsub("# design execution router", "")
119
+ unapproved_router_language = /(?:design-execution-checklist\.md|router|routing\s+(?:reference|checklist)|路由|分流(?:参考|清单))/
120
+ exit(text.match?(unapproved_router_language) ? 0 : 1)
121
+ '
122
+ }
123
+
124
+ loading_contract_valid() {
125
+ local entry="$1" router="$2"
126
+ [ "$(active_literal_count "$entry" 'A runtime-visible task enters `references/delivery-contract.md` directly; the specialized router is not a prerequisite to that canonical path.')" = "1" ] &&
127
+ [ "$(active_literal_count "$entry" 'Load `references/design-execution-checklist.md` only when the task needs one or more specialized work-mode, platform, risk, or evidence references whose route is not already unambiguous below.')" = "1" ] &&
128
+ [ "$(active_literal_count "$entry" 'Do not load the router solely to reach `references/delivery-contract.md` or another unambiguous common route.')" = "1" ] &&
129
+ [ "$(active_literal_count "$router" 'This router is conditional context, not an always-loaded prerequisite.')" = "1" ] &&
130
+ [ "$(active_literal_count "$router" 'Load this router when delivery depth must be composed with specialized work-mode, platform, risk, or evidence lenses.')" = "1" ] &&
131
+ ! active_loading_contradiction "$entry" &&
132
+ ! active_loading_contradiction "$router"
133
+ }
134
+
135
+ extract_active_references() {
136
+ local file="$1"
137
+ active_markdown "$file" | ruby -e '
138
+ source = ARGV.fetch(0)
139
+ refs = []
140
+ STDIN.read.each_line do |line|
141
+ line = line.gsub(/\[[^\]]*\]\(([^)\s]+\.md(?:#[^)\s]+)?)\)/) do
142
+ refs << Regexp.last_match(1)
143
+ ""
144
+ end
145
+ line = line.gsub(/`([^`\n]+\.md(?:#[^`\n]+)?)`/) do
146
+ refs << Regexp.last_match(1)
147
+ ""
148
+ end
149
+ line.scan(/(?:\.\.?\/)?(?:[A-Za-z0-9_.-]+\/)*[A-Za-z0-9_.-]+\.md(?:#[^\s,;)\]}]+)?/) do |match|
150
+ refs << match
151
+ end
152
+ end
153
+ refs.uniq.sort.each { |ref| puts "#{source}\t#{ref}" }
154
+ ' "$file"
155
+ }
156
+
157
+ reference_integrity_valid() {
158
+ local root="$1" entry="$2" router="$3" source ref
159
+ while IFS=$'\t' read -r source ref; do
160
+ [ -n "$ref" ] || continue
161
+ ruby -e '
162
+ root, source, ref = ARGV
163
+ ref = ref.split("#", 2).first
164
+ exit 1 if ref.nil? || ref.empty? || ref.start_with?("/")
165
+ source_dir = File.dirname(File.expand_path(source))
166
+ candidate = if ref.start_with?("references/")
167
+ File.expand_path(ref, source_dir)
168
+ else
169
+ File.expand_path(ref, source_dir)
170
+ end
171
+ skills_root = File.expand_path("skills", root) + File::SEPARATOR
172
+ exit 1 unless candidate.start_with?(skills_root)
173
+ stat = File.lstat(candidate) rescue exit(1)
174
+ exit 1 unless stat.file? && !stat.symlink?
175
+ real = File.realpath(candidate) rescue exit(1)
176
+ exit 1 unless real.start_with?(skills_root)
177
+ ' "$root" "$source" "$ref" || return 1
178
+ done < <(
179
+ extract_active_references "$entry"
180
+ extract_active_references "$router"
181
+ )
182
+ }
183
+
184
+ loading_contract_valid "$ENTRY" "$ROUTER" ||
185
+ fail "entry/router still make the routing reference unconditional or hide the direct runtime path"
186
+ reference_integrity_valid "$ROOT" "$ENTRY" "$ROUTER" ||
187
+ fail "an active entry/router Markdown reference is missing, a symlink, external, or outside skills/"
188
+
189
+ base_entry_bytes=$(base_bytes "$ENTRY_REL")
190
+ base_router_bytes=$(base_bytes "$ROUTER_REL")
191
+ base_mandatory_bytes=$((base_entry_bytes + base_router_bytes))
192
+ candidate_entry_bytes=$(file_bytes "$ENTRY")
193
+ candidate_router_bytes=$(file_bytes "$ROUTER")
194
+ candidate_contract_bytes=$(file_bytes "$CONTRACT")
195
+ candidate_routing_proxy_bytes=$((candidate_entry_bytes + candidate_router_bytes))
196
+ candidate_direct_runtime_bytes=$((candidate_entry_bytes + candidate_contract_bytes))
197
+ candidate_specialized_runtime_bytes=$((candidate_entry_bytes + candidate_router_bytes + candidate_contract_bytes))
198
+
199
+ # The old entry explicitly required the router for every task. The new direct
200
+ # routing/source-audit proxy must use at most half that deterministic byte
201
+ # proxy; the direct runtime path at most 95%. Complex runtime work loads all
202
+ # three files and may pay a bounded quality-contract cost, capped at 110%.
203
+ # These are migration budgets pinned to the immutable pre-split base, not
204
+ # provider token or task-effect claims. Caps were set from the values measured
205
+ # when the migration landed (routing 45.3%, direct 90.0%, specialized 108.0%)
206
+ # plus headroom for living-document growth; the direct cap was originally 90%
207
+ # with zero headroom, which froze the entry and contract files byte-for-byte.
208
+ # If a cap is hit by ordinary document growth, re-derive the budget from a
209
+ # fresh measurement with recorded rationale — or retire this test once the
210
+ # migration claim is historical — instead of nudging one percentage.
211
+ ROUTING_CAP_PCT=50
212
+ DIRECT_CAP_PCT=95
213
+ SPECIALIZED_CAP_PCT=110
214
+
215
+ budget_holds() { # <candidate_bytes> <cap_pct>
216
+ (( $1 * 100 <= base_mandatory_bytes * $2 ))
217
+ }
218
+
219
+ # Threshold self-probe: pin the contract cap values against silent weakening
220
+ # (they are the documented budget, so a change must edit this pin with a fresh
221
+ # recorded rationale) and prove each predicate rejects one byte over its cap
222
+ # while accepting the exact cap, independent of current document sizes.
223
+ [ "$ROUTING_CAP_PCT/$DIRECT_CAP_PCT/$SPECIALIZED_CAP_PCT" = "50/95/110" ] ||
224
+ fail "threshold probe: budget caps drifted from the recorded 50/95/110 contract; re-derive with rationale and update this pin"
225
+ for pct in "$ROUTING_CAP_PCT" "$DIRECT_CAP_PCT" "$SPECIALIZED_CAP_PCT"; do
226
+ cap=$((base_mandatory_bytes * pct / 100))
227
+ budget_holds "$cap" "$pct" || fail "threshold probe: exact ${pct}% cap must pass"
228
+ if budget_holds $((cap + 1)) "$pct"; then
229
+ fail "threshold probe: ${pct}% predicate failed to reject cap+1 bytes"
230
+ fi
231
+ done
232
+
233
+ budget_holds "$candidate_routing_proxy_bytes" "$ROUTING_CAP_PCT" ||
234
+ fail "routing/source-audit proxy exceeds ${ROUTING_CAP_PCT}% of origin/dev mandatory bytes ($candidate_routing_proxy_bytes > ${ROUTING_CAP_PCT}% of $base_mandatory_bytes)"
235
+ budget_holds "$candidate_direct_runtime_bytes" "$DIRECT_CAP_PCT" ||
236
+ fail "direct-runtime proxy exceeds ${DIRECT_CAP_PCT}% of origin/dev mandatory bytes ($candidate_direct_runtime_bytes > ${DIRECT_CAP_PCT}% of $base_mandatory_bytes)"
237
+ budget_holds "$candidate_specialized_runtime_bytes" "$SPECIALIZED_CAP_PCT" ||
238
+ fail "specialized-runtime proxy exceeds ${SPECIALIZED_CAP_PCT}% of origin/dev mandatory bytes ($candidate_specialized_runtime_bytes > ${SPECIALIZED_CAP_PCT}% of $base_mandatory_bytes)"
239
+
240
+ tmp_dir=$(mktemp -d "${TMPDIR:-/tmp}/uiux-loading-budget.XXXXXX")
241
+ trap 'rm -rf "$tmp_dir"' EXIT
242
+
243
+ sed 's/A runtime-visible task enters `references\/delivery-contract.md` directly; the specialized router is not a prerequisite to that canonical path./A runtime-visible task enters `references\/delivery-contract.md` only after the specialized router./' \
244
+ "$ENTRY" > "$tmp_dir/runtime-through-router.md"
245
+ if loading_contract_valid "$tmp_dir/runtime-through-router.md" "$ROUTER"; then
246
+ fail "direct-runtime-route deletion mutation survived"
247
+ fi
248
+
249
+ sed 's/This router is conditional context, not an always-loaded prerequisite./This router is the always-loaded prerequisite./' \
250
+ "$ROUTER" > "$tmp_dir/always-loaded-router.md"
251
+ if loading_contract_valid "$ENTRY" "$tmp_dir/always-loaded-router.md"; then
252
+ fail "conditional-router deletion mutation survived"
253
+ fi
254
+
255
+ cp "$ENTRY" "$tmp_dir/contradictory-entry.md"
256
+ printf '\nAlways load `references/design-execution-checklist.md` before `references/delivery-contract.md`.\n' >> "$tmp_dir/contradictory-entry.md"
257
+ if loading_contract_valid "$tmp_dir/contradictory-entry.md" "$ROUTER"; then
258
+ fail "contradictory always-load instruction survived"
259
+ fi
260
+
261
+ cp "$ENTRY" "$tmp_dir/synonym-always-load-entry.md"
262
+ printf '\nEvery task must load the specialized router.\n' >> "$tmp_dir/synonym-always-load-entry.md"
263
+ if loading_contract_valid "$tmp_dir/synonym-always-load-entry.md" "$ROUTER"; then
264
+ fail "synonym always-load instruction survived"
265
+ fi
266
+
267
+ cp "$ENTRY" "$tmp_dir/routing-reference-always-load-entry.md"
268
+ printf '\nEvery task starts by consulting the specialized routing reference.\n' >> "$tmp_dir/routing-reference-always-load-entry.md"
269
+ if loading_contract_valid "$tmp_dir/routing-reference-always-load-entry.md" "$ROUTER"; then
270
+ fail "routing-reference always-load instruction survived"
271
+ fi
272
+
273
+ cp "$ENTRY" "$tmp_dir/chinese-always-load-entry.md"
274
+ printf '\n所有任务都必须先加载专用路由。\n' >> "$tmp_dir/chinese-always-load-entry.md"
275
+ if loading_contract_valid "$tmp_dir/chinese-always-load-entry.md" "$ROUTER"; then
276
+ fail "Chinese always-load instruction survived"
277
+ fi
278
+
279
+ sed 's/A runtime-visible task enters `references\/delivery-contract.md` directly; the specialized router is not a prerequisite to that canonical path./<!-- A runtime-visible task enters `references\/delivery-contract.md` directly; the specialized router is not a prerequisite to that canonical path. -->/' \
280
+ "$ENTRY" > "$tmp_dir/comment-only-direct-route.md"
281
+ if loading_contract_valid "$tmp_dir/comment-only-direct-route.md" "$ROUTER"; then
282
+ fail "comment-only direct-runtime carrier survived"
283
+ fi
284
+
285
+ fixture_root="$tmp_dir/reference-fixture"
286
+ mkdir -p "$fixture_root/skills" "$fixture_root/skills/skill-extraction-workflow/references"
287
+ cp -R "$ROOT/skills/product-ui-ux-design" "$fixture_root/skills/product-ui-ux-design"
288
+ cp "$ROOT/skills/skill-extraction-workflow/references/two-source-extraction-pattern.md" \
289
+ "$fixture_root/skills/skill-extraction-workflow/references/two-source-extraction-pattern.md"
290
+ fixture_entry="$fixture_root/$ENTRY_REL"
291
+ fixture_router="$fixture_root/$ROUTER_REL"
292
+ fixture_analytics="$fixture_root/skills/product-ui-ux-design/references/analytics-visualization-interactions.md"
293
+ mv "$fixture_analytics" "$fixture_analytics.absent"
294
+ if reference_integrity_valid "$fixture_root" "$fixture_entry" "$fixture_router"; then
295
+ fail "missing routed reference survived"
296
+ fi
297
+ mv "$fixture_analytics.absent" "$fixture_analytics"
298
+ printf '\nFor every design task, load missing-runtime-guidance.md before proceeding.\n' >> "$fixture_entry"
299
+ if reference_integrity_valid "$fixture_root" "$fixture_entry" "$fixture_router"; then
300
+ fail "missing bare-path reference survived"
301
+ fi
302
+ cp "$ROOT/$ENTRY_REL" "$fixture_entry"
303
+ fixture_contract="$fixture_root/$CONTRACT_REL"
304
+ mv "$fixture_contract" "$fixture_contract.regular"
305
+ ln -s /etc/hosts "$fixture_contract"
306
+ if reference_integrity_valid "$fixture_root" "$fixture_entry" "$fixture_router"; then
307
+ fail "external symlink reference survived"
308
+ fi
309
+
310
+ candidate_entry_sha256=$(shasum -a 256 "$ENTRY" | awk '{print $1}')
311
+ candidate_router_sha256=$(shasum -a 256 "$ROUTER" | awk '{print $1}')
312
+ candidate_contract_sha256=$(shasum -a 256 "$CONTRACT" | awk '{print $1}')
313
+ printf 'uiux_loading_budget_ok base_sha=%s base_entry_blob=%s base_router_blob=%s base_mandatory_bytes=%s routing_proxy_bytes=%s direct_runtime_bytes=%s specialized_runtime_bytes=%s candidate_sha256=%s,%s,%s\n' \
314
+ "$resolved_base_sha" "$base_entry_blob" "$base_router_blob" "$base_mandatory_bytes" \
315
+ "$candidate_routing_proxy_bytes" "$candidate_direct_runtime_bytes" "$candidate_specialized_runtime_bytes" \
316
+ "$candidate_entry_sha256" "$candidate_router_sha256" "$candidate_contract_sha256"