mustflow 2.22.16 → 2.22.46

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 (67) hide show
  1. package/dist/cli/commands/dashboard.js +51 -4
  2. package/dist/cli/commands/explain.js +3 -2
  3. package/dist/cli/commands/help.js +0 -1
  4. package/dist/cli/commands/run.js +51 -4
  5. package/dist/cli/commands/verify.js +2 -1
  6. package/dist/cli/i18n/en.js +5 -0
  7. package/dist/cli/i18n/es.js +5 -0
  8. package/dist/cli/i18n/fr.js +5 -0
  9. package/dist/cli/i18n/hi.js +5 -0
  10. package/dist/cli/i18n/ko.js +5 -0
  11. package/dist/cli/i18n/zh.js +5 -0
  12. package/dist/cli/lib/cli-output.js +1 -1
  13. package/dist/cli/lib/dashboard-html/client-script.js +9 -0
  14. package/dist/cli/lib/dashboard-html/styles.js +48 -1
  15. package/dist/cli/lib/doc-review-ledger.js +1 -1
  16. package/dist/cli/lib/git-changes.js +2 -0
  17. package/dist/cli/lib/local-index/index.js +324 -298
  18. package/dist/cli/lib/repo-map.js +19 -5
  19. package/dist/cli/lib/run-plan.js +20 -7
  20. package/dist/cli/lib/run-root-trust.js +33 -2
  21. package/dist/cli/lib/validation/index.js +6 -2
  22. package/dist/cli/lib/validation/test-selection.js +11 -1
  23. package/dist/core/active-run-locks.js +36 -8
  24. package/dist/core/atomic-state-write.js +5 -20
  25. package/dist/core/change-verification.js +18 -2
  26. package/dist/core/command-intent-eligibility.js +7 -0
  27. package/dist/core/contract-lint.js +3 -3
  28. package/dist/core/line-endings.js +2 -0
  29. package/dist/core/repeated-failure.js +1 -1
  30. package/dist/core/run-write-drift.js +42 -26
  31. package/dist/core/safe-filesystem.js +54 -5
  32. package/dist/core/skill-route-explanation.js +2 -1
  33. package/dist/core/source-anchors.js +7 -3
  34. package/dist/core/test-selection.js +13 -2
  35. package/dist/core/test-target-paths.js +17 -0
  36. package/dist/core/validation-ratchet.js +62 -17
  37. package/dist/core/verification-decision-graph.js +8 -1
  38. package/package.json +1 -1
  39. package/templates/default/i18n.toml +141 -3
  40. package/templates/default/locales/en/.mustflow/skills/INDEX.md +24 -1
  41. package/templates/default/locales/en/.mustflow/skills/api-contract-change/SKILL.md +212 -0
  42. package/templates/default/locales/en/.mustflow/skills/astro-code-change/SKILL.md +184 -0
  43. package/templates/default/locales/en/.mustflow/skills/auth-permission-change/SKILL.md +194 -0
  44. package/templates/default/locales/en/.mustflow/skills/config-env-change/SKILL.md +189 -0
  45. package/templates/default/locales/en/.mustflow/skills/css-code-change/SKILL.md +199 -0
  46. package/templates/default/locales/en/.mustflow/skills/dart-code-change/SKILL.md +179 -0
  47. package/templates/default/locales/en/.mustflow/skills/database-migration-change/SKILL.md +178 -0
  48. package/templates/default/locales/en/.mustflow/skills/dependency-upgrade-review/SKILL.md +151 -0
  49. package/templates/default/locales/en/.mustflow/skills/elysia-code-change/SKILL.md +115 -0
  50. package/templates/default/locales/en/.mustflow/skills/file-path-cross-platform-change/SKILL.md +147 -0
  51. package/templates/default/locales/en/.mustflow/skills/flutter-code-change/SKILL.md +116 -0
  52. package/templates/default/locales/en/.mustflow/skills/go-code-change/SKILL.md +156 -0
  53. package/templates/default/locales/en/.mustflow/skills/hono-code-change/SKILL.md +117 -0
  54. package/templates/default/locales/en/.mustflow/skills/html-code-change/SKILL.md +173 -0
  55. package/templates/default/locales/en/.mustflow/skills/javascript-code-change/SKILL.md +149 -0
  56. package/templates/default/locales/en/.mustflow/skills/python-code-change/SKILL.md +154 -0
  57. package/templates/default/locales/en/.mustflow/skills/release-publish-change/SKILL.md +172 -0
  58. package/templates/default/locales/en/.mustflow/skills/routes.toml +138 -0
  59. package/templates/default/locales/en/.mustflow/skills/rust-code-change/SKILL.md +154 -0
  60. package/templates/default/locales/en/.mustflow/skills/security-privacy-review/SKILL.md +22 -7
  61. package/templates/default/locales/en/.mustflow/skills/security-regression-tests/SKILL.md +31 -20
  62. package/templates/default/locales/en/.mustflow/skills/svelte-code-change/SKILL.md +186 -0
  63. package/templates/default/locales/en/.mustflow/skills/tailwind-code-change/SKILL.md +164 -0
  64. package/templates/default/locales/en/.mustflow/skills/tauri-code-change/SKILL.md +185 -0
  65. package/templates/default/locales/en/.mustflow/skills/typescript-code-change/SKILL.md +184 -0
  66. package/templates/default/locales/en/.mustflow/skills/unocss-code-change/SKILL.md +186 -0
  67. package/templates/default/manifest.toml +158 -1
@@ -0,0 +1,172 @@
1
+ ---
2
+ mustflow_doc: skill.release-publish-change
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: release-publish-change
9
+ description: Apply this skill when release publishing, package registry publication, remote release channels, Git tags, GitHub Releases, release assets, npm, PyPI, crates.io, Go modules, Docker images, Homebrew formulae or casks, app updater metadata, version bump decisions, artifact inspection, post-publish smoke tests, rollback or yanking plans, or user installation paths are created, changed, reviewed, or reported.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.release-publish-change
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - lint
19
+ - build
20
+ - test_related
21
+ - test
22
+ - docs_validate_fast
23
+ - test_release
24
+ - mustflow_check
25
+ ---
26
+
27
+ # Release Publish Change
28
+
29
+ <!-- mustflow-section: purpose -->
30
+ ## Purpose
31
+
32
+ Keep release work honest by treating a release as a remote state transition, not as a local code edit.
33
+
34
+ The release is not done when tests pass locally, a version string changes, or a workflow succeeds. It is done only when the intended remote channel contains the expected artifact and a user-facing installation or update path has been smoke-tested through configured command intents or explicitly reported as unverified.
35
+
36
+ <!-- mustflow-section: use-when -->
37
+ ## Use When
38
+
39
+ - A task prepares, changes, reviews, or reports package publication, registry publication, Git tag release, GitHub Release creation, release assets, checksums, signatures, Docker image tags, Homebrew formulae, app updater feeds, appcast files, channel metadata, or installer distribution.
40
+ - A change touches version bump logic, package metadata, release workflows, publish workflows, release assets, package contents, changelog-to-release wiring, post-publish smoke tests, or rollback and yanking guidance.
41
+ - A final report claims that a version was published, released, installable, downloadable, updateable, yanked, deprecated, rolled back, or verified by the user installation path.
42
+ - A release target includes npm, PyPI, crates.io, Go modules, Docker registries, GitHub Releases, Homebrew, Electron auto-update, Sparkle, Tauri updater, mobile stores, desktop installers, or another remote distribution channel.
43
+
44
+ <!-- mustflow-section: do-not-use-when -->
45
+ ## Do Not Use When
46
+
47
+ - The task only drafts release notes or changelog wording without publishing, package metadata, release artifact, or install-path claims. Use `release-notes-authoring` instead.
48
+ - The task only changes dependency versions inside a project and does not publish the project. Use `dependency-upgrade-review`.
49
+ - The task only checks local artifact integrity without changing or reporting release publication. Use `artifact-integrity-check` if available.
50
+ - The task asks for a private experiment that must not affect remote tags, registries, release assets, or update channels.
51
+
52
+ <!-- mustflow-section: required-inputs -->
53
+ ## Required Inputs
54
+
55
+ - Release target, version, channel, package name, module path, image name, tag, artifact names, expected assets, and intended audience.
56
+ - Public contract source for versioning: package metadata, manifest, lock or generated metadata, changelog, release workflow, tag policy, and SemVer or project-specific compatibility rules.
57
+ - Artifact source and inspection method: package file list, archive contents, generated distributions, checksums, signatures, SBOM, provenance, installer contents, image digest, updater metadata, or release asset manifest.
58
+ - Remote publication surface: registry, Git tag, GitHub Release, Docker registry, tap, updater feed, appcast, CDN, package index, or store.
59
+ - Recovery model: unpublish, yank, deprecate, republish with new version, move channel pointer, revoke asset, restore from backup, or forward fix.
60
+ - Configured command intents for build, package inspection, release verification, docs validation, and user installation or updater smoke test. If no such intent exists, report the missing intent instead of inventing a raw command.
61
+
62
+ <!-- mustflow-section: preconditions -->
63
+ ## Preconditions
64
+
65
+ - The task matches the Use When conditions and does not match the Do Not Use When exclusions.
66
+ - Higher-priority instructions, release preferences, and the command contract have been checked for the current scope.
67
+ - The release target and version are known, or the work is explicitly limited to authoring a release procedure skill or checklist.
68
+ - Remote publication, tag creation, push, registry upload, production updater change, and destructive yanking or unpublish actions are not executed unless the repository and host rules explicitly authorize them.
69
+
70
+ <!-- mustflow-section: allowed-edits -->
71
+ ## Allowed Edits
72
+
73
+ - Update version metadata, release workflow files, package manifests, artifact manifests, changelog or release-preparation docs, release validation tests, package fixture expectations, and installed-template metadata directly required by the release contract.
74
+ - Update smoke-test expectations and package tests that encode the release or installation contract.
75
+ - Add conservative release procedure text that describes configured command intents and required evidence.
76
+ - Do not publish, tag, push, yank, delete, unpublish, overwrite assets, or alter remote channels unless explicitly requested and authorized by the active command contract and host rules.
77
+
78
+ <!-- mustflow-section: procedure -->
79
+ ## Procedure
80
+
81
+ 1. Classify the release surface.
82
+ - Package registry: npm, PyPI, crates.io, RubyGems, Maven, NuGet, SwiftPM, or similar.
83
+ - Source tag release: Go module, GitHub Release, generated assets, source archive, or checksum manifest.
84
+ - Container release: image tag, digest, multi-platform manifest, base image, provenance, or registry metadata.
85
+ - Installer or updater release: desktop installer, appcast, update feed, channel metadata, signature, release notes, or updater endpoint.
86
+ - Formula or distribution wrapper: Homebrew formula, cask, tap metadata, checksum, bottle, or livecheck.
87
+ 2. Declare the public API before choosing the version bump.
88
+ - Public API includes CLI output, flags, config schema, package exports, templates, generated artifacts, installer behavior, migration contract, deprecation behavior, update channel behavior, and documented examples.
89
+ - Use SemVer only after naming what this project treats as public API.
90
+ - Treat compatibility-affecting behavior, removed assets, changed binary names, moved module paths, changed updater channels, or stricter parsers as release-contract changes even when source APIs look unchanged.
91
+ 3. Inspect the artifact, not only the repository tree.
92
+ - Check package file lists, archive contents, generated distributions, binary entrypoints, README, LICENSE, metadata, generated schemas, template files, checksums, signatures, SBOM, provenance, image digest, and platform matrix as applicable.
93
+ - Do not claim artifact inspection from the source tree alone.
94
+ - Stale `dist`, build output, generated clients, package caches, or old release assets must be cleaned or reported before publication evidence is trusted.
95
+ 4. Classify channel permanence and recovery.
96
+ - npm name and version pairs, PyPI distribution filenames, crates.io versions, and Go module tags are effectively one-way release identifiers for practical purposes.
97
+ - Docker tags can move in many registries, but digests identify content and should be captured when reporting release evidence.
98
+ - GitHub Releases depend on Git tags, but release assets, checksums, signatures, and release body are separate evidence surfaces.
99
+ - App updater channels depend on metadata and signature state, not only uploaded installers.
100
+ 5. For npm-style package publication, verify package metadata, packed file list, entrypoints, bin links, README, LICENSE, access, provenance or trusted publisher setup, registry target, and exact published version behavior through configured intents.
101
+ 6. For PyPI-style publication, verify source distribution, wheel contents, metadata, Python version constraints, entrypoints, README rendering, filename uniqueness, and install smoke path through configured intents.
102
+ 7. For crates.io-style publication, verify manifest metadata, include and exclude rules, packaged file list, feature combinations, docs expectations, and yank-forward-fix policy.
103
+ 8. For Go modules, treat the Git tag as the release. Verify module path, semantic tag, major-version path rules, tag target commit, proxy/cache implications, and module consumer smoke path. Do not move or delete tags as a casual recovery shortcut.
104
+ 9. For Docker images, verify image digest, tag, platform manifest, labels, exposed ports, entrypoint, user, vulnerability or base-image expectations, and pull-run smoke behavior through configured intents.
105
+ 10. For GitHub Releases, verify tag, release body, generated notes policy, asset list, checksum files, signatures, archives, attached binaries, and download smoke behavior.
106
+ 11. For Homebrew, verify formula or cask URL, version, checksum, livecheck, bottle expectations, test block, audit result, and install smoke path through configured intents.
107
+ 12. For app updaters, verify installer artifact, update metadata, channel, minimum version, signature, release notes, feed URL, staged rollout rules, and updater smoke path from an older installed version when configured.
108
+ 13. Keep release notes and release publication separate.
109
+ - Release notes may say what changed only when evidence supports it.
110
+ - Publication evidence must say what remote artifact exists and how a user reaches it.
111
+ 14. Verify remote state after publication when authorized.
112
+ - Check the registry, tag, release page, asset download, digest, updater feed, tap, or package index that users actually consume.
113
+ - Then run the configured user installation, pull, download, or updater smoke intent.
114
+ - If remote publication was not authorized or not performed, report the release as prepared but not published.
115
+ 15. Report immutable or hard-to-recover mistakes honestly.
116
+ - Bad package version: usually deprecate, yank, or release a new version.
117
+ - Bad Go module tag: do not assume moving the tag fixes proxy/cache consumers.
118
+ - Bad Docker tag: distinguish moved tag from old digest still being referenced.
119
+ - Bad updater metadata: treat as a live channel incident if clients may already have seen it.
120
+ 16. Never call a release complete from local tests alone. The completion evidence must name the remote channel and the user installation or update path, or explicitly say that post-publish verification was skipped.
121
+
122
+ <!-- mustflow-section: postconditions -->
123
+ ## Postconditions
124
+
125
+ - Version bump, release notes, package metadata, manifests, artifacts, workflows, tests, and docs agree.
126
+ - The artifact contents have been inspected through configured evidence, not inferred from the source tree.
127
+ - Remote publication status is classified as not started, prepared, published, verified, failed, yanked, deprecated, superseded, or unknown.
128
+ - User installation, pull, download, or updater smoke test status is known or explicitly reported as skipped.
129
+ - Recovery plan matches the channel's actual permanence and rules.
130
+
131
+ <!-- mustflow-section: verification -->
132
+ ## Verification
133
+
134
+ Use configured oneshot command intents when available:
135
+
136
+ - `changes_status`
137
+ - `changes_diff_summary`
138
+ - `lint`
139
+ - `build`
140
+ - `test_related`
141
+ - `test`
142
+ - `docs_validate_fast`
143
+ - `test_release`
144
+ - `mustflow_check`
145
+
146
+ Prefer configured release, package-inspection, artifact-inspection, install-smoke, updater-smoke, checksum, signature, provenance, or registry-verification intents when the command contract exposes them.
147
+
148
+ Do not infer package manager, registry, Docker, Git, Homebrew, or updater commands from project files. If the needed intent is missing, report the missing command contract instead of writing a raw command into the skill or final release procedure.
149
+
150
+ <!-- mustflow-section: failure-handling -->
151
+ ## Failure Handling
152
+
153
+ - If the artifact contents differ from the intended release, stop release claims and fix the source, generated output, or packaging configuration before publication.
154
+ - If the remote registry already contains the version, do not assume overwrite is possible. Report the channel-specific recovery path.
155
+ - If publication succeeds but install smoke fails, treat the release as published but not verified and recommend channel-appropriate mitigation.
156
+ - If a tag, asset, digest, checksum, signature, updater feed, or release body is missing, do not collapse the issue into "workflow failed"; name the missing remote surface.
157
+ - If release evidence comes only from CI logs, report that no independent user-path smoke test was completed unless the configured CI explicitly performs that path.
158
+ - If unpublish, yank, tag movement, channel rollback, or asset deletion is proposed, check host and repository authorization first and report the permanence risk.
159
+
160
+ <!-- mustflow-section: output-format -->
161
+ ## Output Format
162
+
163
+ - Release target, version, and channel
164
+ - Public API and version bump classification
165
+ - Artifact contents inspected
166
+ - Remote publication state
167
+ - User installation, download, pull, or updater smoke path result
168
+ - Synchronized version, docs, manifest, workflow, and test surfaces
169
+ - Recovery or rollback classification
170
+ - Command intents run
171
+ - Skipped remote, publish, or install checks and reasons
172
+ - Remaining release-publish risk
@@ -108,6 +108,60 @@ route_type = "primary"
108
108
  priority = 20
109
109
  applies_to_reasons = ["unknown_change", "code_change"]
110
110
 
111
+ [routes."api-contract-change"]
112
+ category = "general_code"
113
+ route_type = "primary"
114
+ priority = 82
115
+ applies_to_reasons = ["code_change", "public_api_change", "docs_change", "test_change"]
116
+
117
+ [routes."typescript-code-change"]
118
+ category = "general_code"
119
+ route_type = "primary"
120
+ priority = 85
121
+ applies_to_reasons = ["code_change", "public_api_change", "test_change"]
122
+
123
+ [routes."javascript-code-change"]
124
+ category = "general_code"
125
+ route_type = "primary"
126
+ priority = 85
127
+ applies_to_reasons = ["code_change", "public_api_change", "test_change"]
128
+
129
+ [routes."python-code-change"]
130
+ category = "general_code"
131
+ route_type = "primary"
132
+ priority = 85
133
+ applies_to_reasons = ["code_change", "public_api_change", "test_change"]
134
+
135
+ [routes."go-code-change"]
136
+ category = "general_code"
137
+ route_type = "primary"
138
+ priority = 85
139
+ applies_to_reasons = ["code_change", "public_api_change", "test_change"]
140
+
141
+ [routes."rust-code-change"]
142
+ category = "general_code"
143
+ route_type = "primary"
144
+ priority = 85
145
+ applies_to_reasons = ["code_change", "public_api_change", "test_change"]
146
+
147
+ [routes."dart-code-change"]
148
+ category = "general_code"
149
+ route_type = "primary"
150
+ priority = 85
151
+ applies_to_reasons = ["code_change", "public_api_change", "test_change"]
152
+
153
+ [routes."hono-code-change"]
154
+ category = "general_code"
155
+ route_type = "primary"
156
+ priority = 85
157
+ applies_to_reasons = ["code_change", "public_api_change", "security_change"]
158
+
159
+ [routes."elysia-code-change"]
160
+ category = "general_code"
161
+ route_type = "primary"
162
+ priority = 85
163
+ applies_to_reasons = ["code_change", "public_api_change", "security_change"]
164
+
111
165
  [routes."source-anchor-authoring"]
112
166
  category = "general_code"
113
167
  route_type = "primary"
@@ -156,12 +210,30 @@ route_type = "primary"
156
210
  priority = 55
157
211
  applies_to_reasons = ["code_change", "behavior_change"]
158
212
 
213
+ [routes."database-migration-change"]
214
+ category = "data_external"
215
+ route_type = "primary"
216
+ priority = 82
217
+ applies_to_reasons = ["code_change", "data_change", "migration_change", "public_api_change", "test_change", "docs_change", "security_change"]
218
+
219
+ [routes."dependency-upgrade-review"]
220
+ category = "data_external"
221
+ route_type = "primary"
222
+ priority = 75
223
+ applies_to_reasons = ["code_change", "docs_change", "security_change", "package_metadata_change", "release_risk"]
224
+
159
225
  [routes."dependency-reality-check"]
160
226
  category = "data_external"
161
227
  route_type = "adjunct"
162
228
  priority = 45
163
229
  applies_to_reasons = ["code_change", "docs_change", "security_change"]
164
230
 
231
+ [routes."file-path-cross-platform-change"]
232
+ category = "data_external"
233
+ route_type = "primary"
234
+ priority = 78
235
+ applies_to_reasons = ["code_change", "public_api_change", "test_change", "docs_change", "security_change", "package_metadata_change"]
236
+
165
237
  [routes."cross-platform-filesystem-safety"]
166
238
  category = "data_external"
167
239
  route_type = "adjunct"
@@ -174,6 +246,12 @@ route_type = "primary"
174
246
  priority = 55
175
247
  applies_to_reasons = ["code_change", "behavior_change"]
176
248
 
249
+ [routes."tauri-code-change"]
250
+ category = "data_external"
251
+ route_type = "primary"
252
+ priority = 90
253
+ applies_to_reasons = ["code_change", "security_change", "public_api_change"]
254
+
177
255
  [routes."process-execution-safety"]
178
256
  category = "data_external"
179
257
  route_type = "primary"
@@ -222,6 +300,18 @@ route_type = "primary"
222
300
  priority = 30
223
301
  applies_to_reasons = ["security_change", "privacy_change"]
224
302
 
303
+ [routes."config-env-change"]
304
+ category = "security_privacy"
305
+ route_type = "primary"
306
+ priority = 35
307
+ applies_to_reasons = ["code_change", "docs_change", "security_change", "privacy_change", "package_metadata_change", "mustflow_config_change"]
308
+
309
+ [routes."auth-permission-change"]
310
+ category = "security_privacy"
311
+ route_type = "primary"
312
+ priority = 85
313
+ applies_to_reasons = ["code_change", "security_change", "privacy_change", "public_api_change"]
314
+
225
315
  [routes."security-regression-tests"]
226
316
  category = "security_privacy"
227
317
  route_type = "adjunct"
@@ -264,6 +354,48 @@ route_type = "primary"
264
354
  priority = 50
265
355
  applies_to_reasons = ["ui_change"]
266
356
 
357
+ [routes."html-code-change"]
358
+ category = "ui_assets"
359
+ route_type = "primary"
360
+ priority = 85
361
+ applies_to_reasons = ["ui_change", "docs_change", "code_change"]
362
+
363
+ [routes."css-code-change"]
364
+ category = "ui_assets"
365
+ route_type = "primary"
366
+ priority = 85
367
+ applies_to_reasons = ["ui_change", "docs_change", "code_change"]
368
+
369
+ [routes."tailwind-code-change"]
370
+ category = "ui_assets"
371
+ route_type = "primary"
372
+ priority = 85
373
+ applies_to_reasons = ["ui_change", "docs_change", "code_change"]
374
+
375
+ [routes."unocss-code-change"]
376
+ category = "ui_assets"
377
+ route_type = "primary"
378
+ priority = 85
379
+ applies_to_reasons = ["ui_change", "docs_change", "code_change"]
380
+
381
+ [routes."flutter-code-change"]
382
+ category = "ui_assets"
383
+ route_type = "primary"
384
+ priority = 85
385
+ applies_to_reasons = ["ui_change", "code_change", "public_api_change"]
386
+
387
+ [routes."astro-code-change"]
388
+ category = "ui_assets"
389
+ route_type = "primary"
390
+ priority = 85
391
+ applies_to_reasons = ["ui_change", "docs_change", "code_change"]
392
+
393
+ [routes."svelte-code-change"]
394
+ category = "ui_assets"
395
+ route_type = "primary"
396
+ priority = 85
397
+ applies_to_reasons = ["ui_change", "code_change", "public_api_change"]
398
+
267
399
  [routes."pattern-scout"]
268
400
  category = "architecture_patterns"
269
401
  route_type = "adjunct"
@@ -312,6 +444,12 @@ route_type = "primary"
312
444
  priority = 55
313
445
  applies_to_reasons = ["release_risk", "docs_change"]
314
446
 
447
+ [routes."release-publish-change"]
448
+ category = "docs_release"
449
+ route_type = "primary"
450
+ priority = 58
451
+ applies_to_reasons = ["release_risk", "package_metadata_change", "docs_change", "public_api_change"]
452
+
315
453
  [routes."search-ad-content-authoring"]
316
454
  category = "docs_release"
317
455
  route_type = "primary"
@@ -0,0 +1,154 @@
1
+ ---
2
+ mustflow_doc: skill.rust-code-change
3
+ locale: en
4
+ canonical: true
5
+ revision: 2
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: rust-code-change
9
+ description: Apply this skill when Rust source, Cargo metadata, features, traits, errors, ownership, async runtime, unsafe code, tests, examples, or public crate APIs are created or changed.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.rust-code-change
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - lint
19
+ - build
20
+ - test_related
21
+ - test
22
+ - docs_validate_fast
23
+ - mustflow_check
24
+ ---
25
+
26
+ # Rust Code Change
27
+
28
+ <!-- mustflow-section: purpose -->
29
+ ## Purpose
30
+
31
+ Preserve Rust ownership, error, trait, feature, async runtime, unsafe, and public crate boundaries while making a focused change. A Rust change is successful only when it clarifies ownership and contracts, not when it merely silences the borrow checker.
32
+
33
+ <!-- mustflow-section: use-when -->
34
+ ## Use When
35
+
36
+ - `.rs`, `Cargo.toml`, `Cargo.lock`, workspace config, feature flags, public exports, traits, error types, tests, examples, benches, FFI, async runtime, or unsafe code change.
37
+ - The task touches ownership, borrowing, lifetimes, `Clone`, `Arc`, `Mutex`, `unwrap`, or public crate compatibility.
38
+
39
+ <!-- mustflow-section: do-not-use-when -->
40
+ ## Do Not Use When
41
+
42
+ - Rust files are read-only context and no Rust surface changes.
43
+ - A generated Rust file should be regenerated by a declared command rather than edited.
44
+
45
+ <!-- mustflow-section: required-inputs -->
46
+ ## Required Inputs
47
+
48
+ - `Cargo.toml`, workspace manifests, lockfile policy, toolchain config, rustfmt, clippy, feature flags, docs.rs metadata, optional dependencies, and CI hints.
49
+ - Relevant `src/lib.rs`, `src/main.rs`, modules, public re-exports, tests, examples, and docs examples.
50
+ - Existing error handling convention and async runtime.
51
+ - Public crate status, minimum supported Rust version, feature support policy, and downstream compatibility expectations when available.
52
+ - Configured verification intents.
53
+
54
+ <!-- mustflow-section: preconditions -->
55
+ ## Preconditions
56
+
57
+ - Determine whether the change affects ownership flow, public API, feature gates, optional dependencies, error contract, async runtime, or unsafe invariants.
58
+ - Read local patterns before adding traits, lifetimes, clones, locks, boxed errors, feature bounds, or `Send + Sync + 'static` constraints.
59
+ - Treat `clone`, `Arc<Mutex<_>>`, explicit lifetimes, `'static`, `Box<dyn Error>`, `unwrap`, feature changes, and `unsafe` as suspicious until their contract impact is justified.
60
+
61
+ <!-- mustflow-section: allowed-edits -->
62
+ ## Allowed Edits
63
+
64
+ - Prefer truthful ownership and borrowing over broad cloning.
65
+ - Follow the crate's existing application-versus-library error convention.
66
+ - Keep feature-gated code and public re-exports synchronized.
67
+ - Touch unsafe code only with explicit invariants preserved in nearby comments.
68
+ - Add feature, async, or unsafe verification notes when configured command intents are missing.
69
+
70
+ <!-- mustflow-section: procedure -->
71
+ ## Procedure
72
+
73
+ 1. Read Cargo metadata, features, optional dependencies, docs.rs metadata, toolchain config, public exports, relevant modules, and tests.
74
+ 2. Classify the change as ownership, API, error, feature, async, unsafe, dependency, or test-only.
75
+ 3. Resolve ownership problems in this order: identify the real owner, shrink borrow scopes, fix function signatures to accept references or slices when ownership is unnecessary, distinguish transfer from sharing, then consider clone or shared ownership only when the semantics require it.
76
+ 4. Before adding `clone`, verify it is a cheap handle clone such as `Arc`, `Rc`, or `Bytes`, a small intentional value clone, or a true independent ownership split. Reject large collection clones, loop clones, clone-then-borrow code, and whole-state clones made only to satisfy `spawn`.
77
+ 5. Before adding `Arc<Mutex<_>>`, verify multiple owners truly need shared mutable state. Keep critical sections short, document lock order when relevant, and do not hold a lock guard across `.await`, I/O, callbacks, or user code.
78
+ 6. Use explicit lifetimes only to describe real borrow relationships. Do not add `'static` or `T: 'static` to public APIs merely because an internal task boundary requires it.
79
+ 7. Use concrete error enums for library APIs when callers need to classify failures. Keep `Box<dyn Error>` mostly to binaries, examples, tests, prototypes, or explicitly opaque error policies.
80
+ 8. Avoid `unwrap` and vague `expect` in production paths. They are allowed only for tests, examples, startup policy, or invariants already proven by nearby code.
81
+ 9. If feature flags change, treat default features, no-default builds, all-features builds, optional dependency implicit features, public re-exports, docs examples, and feature-gated trait impls as compatibility surfaces. Features should be additive.
82
+ 10. Treat public re-exports, public dependency types, generic bounds, trait item sets, error enum variants, `#[non_exhaustive]`, and MSRV as public API. Tightened bounds, added required trait methods, removed re-exports, or changed error variants require compatibility review.
83
+ 11. Do not mix async runtimes. A Tokio crate should not casually gain `async-std` or runtime-specific APIs in library core. Do not call blocking I/O or CPU-heavy work in async paths without an established boundary such as async-native APIs, a blocking pool, or a dedicated worker.
84
+ 12. For async spawning, avoid leaking internal `Send + Sync + 'static` requirements into public APIs. Prefer owned task state, smaller spawn boundaries, local task structures, or caller-owned runtime decisions.
85
+ 13. Touch `unsafe` only when a safe design cannot express the required behavior. Every unsafe block needs a nearby `SAFETY:` explanation; every public `unsafe fn` needs `# Safety` docs. Keep unsafe scopes small and wrap them in safe abstractions only when callers have no hidden safety obligations.
86
+ 14. For FFI, keep Rust ABI types out of C boundaries. Use explicit ownership, `#[repr(C)]` where required, raw pointer plus length pairs, `CStr`/`CString`, RAII wrappers, null handling, panic boundaries, and documented thread-safety evidence before manual `Send` or `Sync`.
87
+ 15. Choose configured verification intents that cover format, lint, build, tests, feature combinations, docs, public API, unsafe, and FFI risk when available.
88
+
89
+ <!-- mustflow-section: rejection-criteria -->
90
+ ## Review Rejection Criteria
91
+
92
+ Reject or revise the patch when any of these appear without strong local justification:
93
+
94
+ - New large `clone()` calls, clone-then-borrow code, loop clones, or state clones used only to appease ownership errors.
95
+ - New `Arc<Mutex<AppState>>`-style shared bags, locks held across `.await`, or async I/O resources shared mainly by mutex.
96
+ - New public `'static`, `Send`, or `Sync` bounds that exist only because an internal task was spawned.
97
+ - New public `Box<dyn Error>` in a library where callers need typed failures.
98
+ - New production `unwrap` or vague `expect` on I/O, parse, environment, network, FFI, lock, or user input paths.
99
+ - Feature changes that remove APIs, change type meaning, rename features, expose internal optional dependency names, or fail default/no-default/all-features reasoning.
100
+ - Public dependency types, re-exports, trait bounds, trait methods, or error enum variants changed without semver review.
101
+ - Async runtime mixing, blocking I/O in async paths, or runtime ownership moved into a library core without a clear boundary.
102
+ - Unsafe blocks without `SAFETY:` comments, unsafe functions without `# Safety`, undocumented manual `Send`/`Sync`, or FFI that exposes Rust layout types across C ABI.
103
+
104
+ <!-- mustflow-section: postconditions -->
105
+ ## Postconditions
106
+
107
+ - Ownership changes are intentional, not compiler appeasement.
108
+ - Public API, features, optional dependencies, and error contracts are synchronized.
109
+ - Async runtime ownership is preserved and blocking work is isolated.
110
+ - Unsafe and FFI invariants are preserved or no unsafe code was touched.
111
+ - Missing feature, semver, docs, unsafe, or FFI verification is reported.
112
+
113
+ <!-- mustflow-section: verification -->
114
+ ## Verification
115
+
116
+ Use configured oneshot command intents when available:
117
+
118
+ - `lint`
119
+ - `build`
120
+ - `test_related`
121
+ - `test`
122
+ - `docs_validate_fast`
123
+ - `mustflow_check`
124
+
125
+ Report whether configured feature-combination, documentation, semver, Miri, sanitizer, and downstream-style verification exists when those surfaces change.
126
+
127
+ When configured intents exist for these risks, prefer coverage equivalent to:
128
+
129
+ - formatting and linting
130
+ - workspace checks and tests
131
+ - default, no-default, all-features, and relevant feature combinations
132
+ - doctests and docs build for public crates
133
+ - public API or semver compatibility checks for published crates
134
+ - Miri or sanitizer-style checks for unsafe, raw pointer, FFI, or manual concurrency primitives
135
+
136
+ <!-- mustflow-section: failure-handling -->
137
+ ## Failure Handling
138
+
139
+ - If borrow-checker fixes produce broad clones or locks, revisit ownership boundaries before proceeding.
140
+ - If feature-gated code cannot be verified, report the specific unverified feature surface.
141
+ - If public API compatibility cannot be verified, report the exact exported symbols, trait bounds, feature gates, or errors at risk.
142
+ - If async runtime or blocking boundaries are unclear, stop that part and inspect the runtime ownership before editing further.
143
+ - If unsafe invariants are unclear, stop that part and request or inspect stronger evidence.
144
+
145
+ <!-- mustflow-section: output-format -->
146
+ ## Output Format
147
+
148
+ - Boundary checked
149
+ - Ownership, feature, async, or unsafe impact
150
+ - Public API or error impact
151
+ - Files changed
152
+ - Command intents run
153
+ - Skipped checks and reasons
154
+ - Remaining Rust risk
@@ -2,7 +2,7 @@
2
2
  mustflow_doc: skill.security-privacy-review
3
3
  locale: en
4
4
  canonical: true
5
- revision: 17
5
+ revision: 19
6
6
  lifecycle: mustflow-owned
7
7
  authority: procedure
8
8
  name: security-privacy-review
@@ -48,6 +48,7 @@ Catch security, privacy, and disclosure risks introduced by ordinary code, docum
48
48
  - A change uses cache, Redis, generated state, search documents, or read models to make authorization, ownership, subscription, entitlement, payment, inventory, or admin decisions.
49
49
  - A change adds external URL fetching, webhook callbacks, redirects, browser previews, remote downloads, database-as-a-service rules, security headers, CORS, CSRF handling, or rate limits.
50
50
  - A change stores webhook payloads, external API requests or responses, retry errors, dead-letter jobs, AI prompts or outputs, email bodies, or provider diagnostic data.
51
+ - A change adds or modifies public intake surfaces such as action handlers, webhook handlers, callback receivers, job enqueue endpoints, idempotency stores, replay APIs, or default verifier, authenticator, authorizer, normalizer, or deduplication collaborators.
51
52
  - A change records AI usage, model pricing, token counts, cache keys, feature metadata, prompt hashes, provider call metadata, retry cost, or failed AI calls that could include confidential content or identify users.
52
53
  - A change records AI budgets, feature policies, policy decisions, blocked reasons, model downgrades, agent steps, tool calls, provider budget status, or emergency disables that could reveal customer behavior, sensitive feature use, or regulated processing.
53
54
  - A change touches cookies, JWTs, reset tokens, invite tokens, OAuth callbacks, file upload or download, browser storage, business rules, pricing, entitlements, database queries, ORM bulk operations, or deployment configuration.
@@ -56,6 +57,7 @@ Catch security, privacy, and disclosure risks introduced by ordinary code, docum
56
57
  - A change touches cryptography, password hashing, token generation, random number generation, TLS/HTTPS, certificate validation, scanner gates, or a security invariant that could drift across architecture boundaries.
57
58
  - A change adds, imports, recommends, or installs third-party dependencies that may affect the software supply chain.
58
59
  - A change introduces or edits agent configuration, MCP/tool configuration, prompt files, model instructions, or repository-local rule files.
60
+ - A change adds or modifies policy engines, architecture linters, rule catalogs, validators, generated compliance reports, or governance gates that can approve sensitive data, payment, API, AI, tier, or deployment boundaries.
59
61
  - A change affects CI/CD workflow permissions, fork pull-request handling, build scripts, package lifecycle scripts, deployment secrets, container users, storage buckets, debug flags, or public admin, metrics, GraphQL, cache, or search endpoints.
60
62
  - Documentation, templates, examples, tests, or final reports mention sensitive data handling, privacy behavior, secret handling, or user-identifying data.
61
63
  - A diff could expose data through filenames, paths, command output, screenshots, generated artifacts, package contents, or public docs.
@@ -82,6 +84,7 @@ Catch security, privacy, and disclosure risks introduced by ordinary code, docum
82
84
  - Cookie, JWT, OAuth, file upload, file download, business-value, database mutation, ORM bulk operation, CI/CD permission, deployment setting, or secret-source surface involved.
83
85
  - Cryptographic primitive, password hashing, random-token, secure transport, certificate validation, scanner gate, or security invariant involved.
84
86
  - Existing project rules for secrets, privacy, generated state, public docs, package contents, and command output.
87
+ - Policy or rule-catalog source of truth, trusted metadata source, fallback behavior when a rule file is missing, and any untrusted repository-local fields that might be treated as ownership, tier, role, or exemption evidence.
85
88
  - Admin operation list, role or capability model, audit-log fields, cache visibility policy, and cache invalidation surface when those are involved.
86
89
  - Behavior analytics event names, event versions, actor identifiers, anonymous identifiers, properties, retention period, deletion or anonymization policy, and whether event writes can be delayed or lost.
87
90
  - Core event ownership, including which signup, login failure, account recovery, payment, refund, subscription, entitlement, permission, file, search, admin, webhook, queue, and security events must remain internally stored instead of only in a SaaS dashboard.
@@ -91,6 +94,8 @@ Catch security, privacy, and disclosure risks introduced by ordinary code, docum
91
94
  - Data classification policy when available, including sensitive personal data, ordinary personal data, product usage data, public content, AI prompts or outputs, and which classes may enter logs, analytics, support tools, AI providers, or cross-region backups.
92
95
  - Runtime and dependency patch policy, including supported or LTS version requirement, end-of-life ban, lockfile expectation, vulnerability scan source, patch response target, smoke-test surface, canary or rollback route, and whether experimental runtime choices are kept off survival paths.
93
96
  - Webhook and external-call record policy, including signature verification, processed-event deduplication, safe request hashes, redacted provider responses, unknown-result reconciliation, dead-letter retention, and whether raw payloads are needed or should be replaced by bounded metadata.
97
+ - Public intake default policy, including whether verifiers, authenticators, authorizers, deduplication stores, idempotency stores, and normalizers are required by registration, explicit opt-in, or silently replaced by permissive defaults.
98
+ - Attacker-controlled key and header limits for idempotency keys, webhook event ids, provider names, action names, replay ids, dedupe keys, request ids, and any in-memory map or queue keyed by public request data.
94
99
  - AI record policy, including prompt and output retention, cache-key hashing, provider request id handling, feature-key properties, pricing snapshots, token usage, failed-call errors, user or account identifiers, and whether raw prompts or generated text are omitted, redacted, encrypted, or retained under a narrow rule.
95
100
  - AI budget and gateway policy, including whether provider budgets are hard stops or only alerts, whether product-owned hard limits exist, which identifiers are recorded for user, organization, feature, model, request, provider call, policy decision, and whether blocked or downgraded decisions are logged without exposing prompt text.
96
101
  - Cache authority boundary, including which data is final source of truth and which values are disposable, stale, private, or shared.
@@ -154,6 +159,7 @@ Catch security, privacy, and disclosure risks introduced by ordinary code, docum
154
159
  20. For cache purge, search reindex, ranking refresh, and generated-state rebuild endpoints, treat them as privileged state-changing operations with authorization, rate limiting, audit logs, idempotency, and bounded target selection.
155
160
  21. For external URL, webhook, preview, redirect, download, or callback behavior, check allowlists, protocol restrictions, redirect handling, DNS/IP re-resolution, private network ranges, link-local metadata endpoints, webhook signatures, timeout limits, retry limits, and open redirect parameters such as `next` or `redirect`.
156
161
  - For webhooks, verify the signature against the raw body before trusting parsed data. Store only the raw body reference or bounded raw payload when replay, verification, or support needs justify it.
162
+ - Do not silently install allow-all, unsigned, no-op, nil, null-object, or test-only verifiers for public webhook or callback endpoints. Missing verifier, authenticator, or authorization configuration should fail registration unless the caller explicitly selects a clearly named unsafe or local-only mode.
157
163
  - Store processed event identifiers to avoid duplicate effects. Keep provider event payloads, request bodies, and response bodies out of ordinary logs and dead-letter records unless they are redacted and have a retention rule.
158
164
  22. For database-as-a-service, storage bucket, or realtime rules, check that server-side policies are default-deny, ownership-scoped, and not left in public read/write development mode.
159
165
  23. For input sinks, check parameterized queries, ORM binding, static command maps, output encoding, HTML/Markdown rendering boundaries, unsafe dynamic evaluation, XML/YAML/Markdown parser options, redirect and sort parameters, page-size limits, and framework escape hatches.
@@ -163,6 +169,8 @@ Catch security, privacy, and disclosure risks introduced by ordinary code, docum
163
169
  - For direct-to-object-storage uploads, authorize the target resource before issuing the signed upload URL, confirm upload completion before making the asset usable, and keep pending, uploaded, processing, ready, failed, and deleted states separate.
164
170
  - Inspect actual file bytes instead of trusting extension or `Content-Type`. Re-encode images and strip metadata when practical before serving user uploads.
165
171
  25. For business logic, check that server code does not trust client-supplied prices, discounts, roles, owners, entitlement state, plan limits, usage counters, inventory, seats, refunds, credits, or coupon state. Inspect idempotency, transactions, uniqueness, and concurrent requests for repeated side effects.
172
+ - For public action or intake endpoints, validate cheap request shape and attacker-controlled idempotency keys before permanently claiming the key. If a request is rejected before the trusted side effect starts, release or avoid storing the key so malformed traffic cannot poison future valid retries.
173
+ - Bound default in-memory idempotency, deduplication, replay, rate-limit, and request-tracking stores by key length, entry count, TTL, eviction, or a durable backend contract. A process-memory map keyed by unbounded public headers or event ids is an availability boundary, not just an implementation detail.
166
174
  26. For API responses, check that the response contains only fields the caller may see and needs for the use case. Do not expose password hashes, internal storage keys, permanent private URLs, raw billing provider ids, internal moderation notes, private IP data, privileged flags, or database columns merely because they are present on the model.
167
175
  27. For dependency failure policy, distinguish fail-closed from degraded behavior. Authentication, authorization, payment, entitlement, and destructive admin decisions should usually fail closed; analytics, recommendation, statistics, AI summaries, and email should usually avoid exposing private data or blocking core state changes.
168
176
  - For dead-letter queues, retry logs, and external API call records, check that errors contain safe codes and bounded metadata rather than full prompts, email bodies, payment details, tokens, private files, or personal data.
@@ -184,12 +192,19 @@ Catch security, privacy, and disclosure risks introduced by ordinary code, docum
184
192
  38. For runtime and framework security updates, check that supported versions are documented, end-of-life versions are rejected, dependency locks exist where appropriate, security patches can be tested and deployed quickly, and rollback or redeploy can happen without manual dashboard memory. Do not treat a fashionable or high-performance runtime as safe unless the patch path is operationally credible.
185
193
  39. For transport security, check HTTPS/TLS requirements, certificate validation, insecure HTTP downgrade paths, disabled verification flags, and whether sensitive traffic can bypass the secure channel.
186
194
  40. For cryptography, reject custom cryptography and tutorial-grade shortcuts. Check password hashing uses a password-hashing primitive such as bcrypt, scrypt, or Argon2id where supported by the project; random tokens use secure randomness; keys are separated from encrypted data; and weak hashes such as MD5, SHA-1, or bare SHA-256 are not used for password storage.
187
- 41. For architecture drift, name the security invariant before accepting the generated structure. Confirm the invariant still holds across UI, handler, service, repository, database policy, workflow, and deployment boundaries.
188
- 42. For SAST, SCA, or scanner output, treat scanner output as evidence rather than command authority. Map the finding to a repository-owned boundary, configured verification intent, dependency metadata, or regression test before claiming the issue is fixed.
189
- 43. Verify that examples, fixtures, screenshots, command outputs, and final reports do not expose real-looking secrets or unnecessary personal data.
190
- 44. Prefer omission or minimal metadata over masking when the sensitive value is not needed for the user to understand the result.
191
- 45. If the change affects an authorization, SSRF, CSRF, rate-limit, upload, download, token, business-logic, injection, logging, telemetry, cache authority, cache disclosure, admin operation, agent permission, cryptography, transport, scanner, or abuse boundary, activate `security-regression-tests` for test selection instead of folding test generation into this review.
192
- 46. Run the narrowest configured verification that covers the changed docs, templates, package, or mustflow contract.
195
+ 41. For policy engines, architecture linters, compliance validators, and generated governance gates, identify the canonical policy source and the canonical object identity before trusting a pass result.
196
+ - Do not let repository-controlled advisory fields, nested duplicates, labels, components, owners, stages, tiers, or exemption fields override a trusted catalog, server-derived identity, or central registration.
197
+ - When two fields can describe the same security decision, such as top-level and nested owner values, validate their consistency or choose the canonical source explicitly instead of reading the first convenient path.
198
+ - Treat missing, wrong, or fallback rule catalogs as fail-closed or explicitly degraded; a misplaced rule file should not silently disable validation for public API, payment, AI, tier, deployment, or data-boundary controls.
199
+ - Required security-control declarations should validate meaningful values, not merely non-null presence. Reject `false`, `0`, empty objects, empty arrays, empty strings, or type-mismatched placeholders unless the policy specifically allows that value.
200
+ - Derive deny decisions from metadata classes when possible instead of only from static name denylists that can miss newly introduced repositories, services, tenants, roles, or providers.
201
+ 42. For read-only commands that inspect repositories, remember that the underlying tool can still execute configured helpers. Disable or neutralize repository-local hooks, fsmonitor helpers, credential helpers, package lifecycle hooks, and executable lookup through untrusted PATH when the command is meant to be safe inspection.
202
+ 43. For architecture drift, name the security invariant before accepting the generated structure. Confirm the invariant still holds across UI, handler, service, repository, database policy, workflow, and deployment boundaries.
203
+ 44. For SAST, SCA, or scanner output, treat scanner output as evidence rather than command authority. Map the finding to a repository-owned boundary, configured verification intent, dependency metadata, or regression test before claiming the issue is fixed.
204
+ 45. Verify that examples, fixtures, screenshots, command outputs, and final reports do not expose real-looking secrets or unnecessary personal data.
205
+ 46. Prefer omission or minimal metadata over masking when the sensitive value is not needed for the user to understand the result.
206
+ 47. If the change affects an authorization, SSRF, CSRF, rate-limit, upload, download, token, business-logic, injection, logging, telemetry, cache authority, cache disclosure, admin operation, agent permission, cryptography, transport, scanner, policy-engine, rule-catalog, or abuse boundary, activate `security-regression-tests` for test selection instead of folding test generation into this review.
207
+ 48. Run the narrowest configured verification that covers the changed docs, templates, package, or mustflow contract.
193
208
 
194
209
  <!-- mustflow-section: postconditions -->
195
210
  ## Postconditions