@event4u/agent-config 3.0.0 → 3.1.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 (207) hide show
  1. package/.agent-src/commands/install-via-agent.md +129 -0
  2. package/.agent-src/commands/video/from-script.md +1 -1
  3. package/.agent-src/commands/video.md +1 -1
  4. package/.agent-src/contexts/execution/cheap-question-mechanics.md +81 -0
  5. package/.agent-src/rules/caveman-speak.md +2 -2
  6. package/.agent-src/rules/context-hygiene.md +36 -0
  7. package/.agent-src/rules/engineering-safety-floor.md +102 -0
  8. package/.agent-src/rules/finance-safety-floor.md +114 -0
  9. package/.agent-src/rules/git-history-discipline.md +1 -1
  10. package/.agent-src/rules/no-cheap-questions.md +34 -32
  11. package/.agent-src/rules/provider-lifecycle-discipline.md +4 -4
  12. package/.agent-src/rules/strategy-safety-floor.md +114 -0
  13. package/.agent-src/skills/agents-md-thin-root/SKILL.md +15 -9
  14. package/.agent-src/skills/async-python-patterns/SKILL.md +1 -1
  15. package/.agent-src/skills/project-analysis-node-express/SKILL.md +1 -1
  16. package/.agent-src/skills/readme-reviewer/SKILL.md +52 -3
  17. package/.agent-src/skills/readme-writing/SKILL.md +52 -4
  18. package/.agent-src/skills/readme-writing-package/SKILL.md +48 -5
  19. package/.agent-src/skills/systematic-debugging/SKILL.md +41 -0
  20. package/.agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  21. package/.agent-src/templates/hooks/pre-commit-frontmatter +66 -0
  22. package/.agent-src/templates/hooks/pre-commit-roadmap-progress +78 -39
  23. package/.agent-src/templates/scripts/work_engine/_lib/agent_settings.py +4 -1
  24. package/.agent-src/templates/scripts/work_engine/orchestration.py +25 -11
  25. package/.claude-plugin/marketplace.json +2 -1
  26. package/AGENTS.md +10 -8
  27. package/CHANGELOG.md +223 -125
  28. package/README.md +165 -553
  29. package/config/agent-settings.template.yml +0 -7
  30. package/config/discovery/packs.yml +20 -0
  31. package/config/discovery/unassigned-artefacts.yml +2 -0
  32. package/config/gitignore-block.txt +19 -3
  33. package/dist/cli/commands/uiServe.js +13 -4
  34. package/dist/cli/commands/uiServe.js.map +1 -1
  35. package/dist/cli/registry.js +2 -0
  36. package/dist/cli/registry.js.map +1 -1
  37. package/dist/discovery/deprecation-report.md +7 -0
  38. package/dist/discovery/discovery-manifest.json +2107 -1409
  39. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  40. package/dist/discovery/discovery-manifest.summary.md +9 -9
  41. package/dist/discovery/orphan-report.md +10 -0
  42. package/dist/discovery/packs.json +1002 -0
  43. package/dist/discovery/trust-report.md +26 -0
  44. package/dist/discovery/workspaces.json +705 -0
  45. package/dist/mcp/registry-manifest.json +4 -4
  46. package/dist/router.json +1623 -0
  47. package/dist/server/app.js +11 -3
  48. package/dist/server/app.js.map +1 -1
  49. package/dist/server/io/atomicMultiWrite.js +3 -1
  50. package/dist/server/io/atomicMultiWrite.js.map +1 -1
  51. package/dist/server/io/yamlIO.js +22 -0
  52. package/dist/server/io/yamlIO.js.map +1 -1
  53. package/dist/server/routes/ping.js +8 -0
  54. package/dist/server/routes/ping.js.map +1 -1
  55. package/dist/server/routes/schema.js +2 -2
  56. package/dist/server/routes/schema.js.map +1 -1
  57. package/dist/server/routes/settings.js +104 -23
  58. package/dist/server/routes/settings.js.map +1 -1
  59. package/dist/server/routes/userMd.js +37 -27
  60. package/dist/server/routes/userMd.js.map +1 -1
  61. package/dist/server/routes/wizard.js +256 -20
  62. package/dist/server/routes/wizard.js.map +1 -1
  63. package/dist/server/schemas/settings.js +0 -1
  64. package/dist/server/schemas/settings.js.map +1 -1
  65. package/dist/server/token.js +10 -3
  66. package/dist/server/token.js.map +1 -1
  67. package/dist/server/writeRoot.js +28 -11
  68. package/dist/server/writeRoot.js.map +1 -1
  69. package/dist/server/writeRoot.test.js +22 -4
  70. package/dist/server/writeRoot.test.js.map +1 -1
  71. package/dist/shared/userMd/formAdapter.js +29 -51
  72. package/dist/shared/userMd/formAdapter.js.map +1 -1
  73. package/dist/shared/userMd/schema.js +32 -104
  74. package/dist/shared/userMd/schema.js.map +1 -1
  75. package/dist/shared/userMd/utils.js +64 -50
  76. package/dist/shared/userMd/utils.js.map +1 -1
  77. package/dist/ui/assets/index-D-DY1ywI.js +35 -0
  78. package/dist/ui/assets/index-D-DY1ywI.js.map +1 -0
  79. package/dist/ui/index.html +1 -1
  80. package/docs/adrs/router/0001-three-tier-routing.md +5 -5
  81. package/docs/adrs/smoke/0001-per-tier-smoke-scripts.md +1 -1
  82. package/docs/architecture.md +3 -3
  83. package/docs/archive/CHANGELOG-pre-3.1.0.md +167 -0
  84. package/docs/catalog.md +30 -26
  85. package/docs/contracts/CHANGELOG-conventions.md +1 -1
  86. package/docs/contracts/agent-user-schema.md +6 -9
  87. package/docs/contracts/consumer-bridge.md +79 -0
  88. package/docs/contracts/discovery-manifest.md +209 -0
  89. package/docs/contracts/discovery-manifest.schema.json +77 -4
  90. package/docs/contracts/explain-trace.schema.json +1 -1
  91. package/docs/contracts/file-ownership-matrix.json +197 -13
  92. package/docs/contracts/frontmatter-contract.md +140 -0
  93. package/docs/contracts/gui-wizard.md +223 -0
  94. package/docs/contracts/installer-agent-mode.md +137 -0
  95. package/docs/contracts/kernel-membership.md +1 -1
  96. package/docs/contracts/mcp-tool-inventory.md +9 -9
  97. package/docs/contracts/namespace.md +6 -6
  98. package/docs/contracts/provider-lifecycle.md +5 -5
  99. package/docs/contracts/rule-router.md +4 -4
  100. package/docs/contracts/settings-api.md +53 -6
  101. package/docs/contracts/smoke-contracts.md +3 -3
  102. package/docs/contracts/trust-and-safety.md +144 -0
  103. package/docs/customization.md +2 -2
  104. package/docs/decisions/ADR-007-agent-discovery-scopes.md +12 -0
  105. package/docs/decisions/ADR-013-discovery-frontmatter-contract.md +24 -0
  106. package/docs/decisions/ADR-015-discovery-manifest-contract.md +146 -0
  107. package/docs/decisions/ADR-016-installer-architecture.md +189 -0
  108. package/docs/decisions/ADR-017-monorepo-physical-layout.md +261 -0
  109. package/docs/decisions/ADR-018-trust-and-safety-layer.md +159 -0
  110. package/docs/decisions/ADR-019-router-json-dist-location.md +124 -0
  111. package/docs/decisions/ADR-020-global-only-consumer-scope.md +123 -0
  112. package/docs/decisions/ADR-021-deployment-shape.md +153 -0
  113. package/docs/decisions/INDEX.md +7 -0
  114. package/docs/deploy/connector-setup.md +129 -0
  115. package/docs/deploy/env-vars.md +70 -0
  116. package/docs/deploy/policy-cookbook.md +130 -0
  117. package/docs/deploy/quickstart.md +112 -0
  118. package/docs/distribution/public-install-smoke.md +68 -0
  119. package/docs/distribution/registries.md +55 -0
  120. package/docs/distribution/telemetry-privacy.md +128 -0
  121. package/docs/distribution/telemetry-schema.md +174 -0
  122. package/docs/featured-skills.md +95 -0
  123. package/docs/getting-started-by-role.md +19 -1
  124. package/docs/getting-started.md +2 -2
  125. package/docs/guidelines/agent-infra/installed-tools-manifest.md +11 -8
  126. package/docs/guidelines/docs/readme-size-and-splitting.md +53 -1
  127. package/docs/installation.md +27 -14
  128. package/docs/maintainers/dev-mode.md +105 -0
  129. package/docs/setup/per-ide/claude-desktop.md +3 -2
  130. package/docs/wizard.md +39 -4
  131. package/package.json +18 -1
  132. package/scripts/__pycache__/validate_frontmatter.cpython-312.pyc +0 -0
  133. package/scripts/_cli/cmd_doctor.py +150 -2
  134. package/scripts/_cli/cmd_explain.py +2 -1
  135. package/scripts/_cli/cmd_migrate_to_global.py +415 -0
  136. package/scripts/_cli/cmd_settings_migrate.py +146 -0
  137. package/scripts/_cli/explain_last/route.py +2 -1
  138. package/scripts/_dispatch.bash +36 -3
  139. package/scripts/_lib/__pycache__/__init__.cpython-312.pyc +0 -0
  140. package/scripts/_lib/__pycache__/agent_src.cpython-312.pyc +0 -0
  141. package/scripts/_lib/agent_settings.py +4 -1
  142. package/scripts/_lib/agent_src.py +157 -0
  143. package/scripts/agent-config +17 -6
  144. package/scripts/audit_skill_descriptions.py +18 -6
  145. package/scripts/build_discovery_manifest.py +373 -17
  146. package/scripts/check_artefact_checksums.py +104 -0
  147. package/scripts/check_cluster_patterns.py +20 -4
  148. package/scripts/check_command_count_messaging.py +33 -14
  149. package/scripts/check_council_references.py +43 -4
  150. package/scripts/check_overlay_cascade_subdirs.py +7 -3
  151. package/scripts/check_references.py +5 -2
  152. package/scripts/check_reply_consistency.py +32 -9
  153. package/scripts/check_template_pin_drift.py +24 -7
  154. package/scripts/check_token_optimizer_freshness.py +18 -3
  155. package/scripts/compile_router.py +34 -2
  156. package/scripts/compress.py +162 -44
  157. package/scripts/config/presets.py +19 -1
  158. package/scripts/config/profiles.py +16 -1
  159. package/scripts/discovery_stats.py +70 -0
  160. package/scripts/expected_perms.json +47 -0
  161. package/scripts/generate_index.py +78 -46
  162. package/scripts/generate_ownership_matrix.py +98 -43
  163. package/scripts/generate_pack_manifests.py +183 -0
  164. package/scripts/install +18 -1
  165. package/scripts/install.py +934 -59
  166. package/scripts/install.sh +27 -9
  167. package/scripts/lint_agents_layout.py +93 -13
  168. package/scripts/lint_agents_md.py +1 -1
  169. package/scripts/lint_archived_skills.py +32 -16
  170. package/scripts/lint_bench_corpus.py +14 -2
  171. package/scripts/lint_command_tiers.py +15 -2
  172. package/scripts/lint_featured_skills.py +139 -0
  173. package/scripts/lint_framework_leakage.py +33 -6
  174. package/scripts/lint_global_paths.py +147 -0
  175. package/scripts/lint_orchestration_dsl.py +6 -3
  176. package/scripts/lint_pack_boundaries.py +147 -0
  177. package/scripts/lint_pack_first_win.py +103 -0
  178. package/scripts/lint_readme_jargon.py +131 -0
  179. package/scripts/lint_readme_size.py +33 -0
  180. package/scripts/lint_rule_interactions.py +23 -5
  181. package/scripts/lint_rule_tiers.py +12 -3
  182. package/scripts/lint_trust_coherence.py +212 -0
  183. package/scripts/measure_rule_budget.py +22 -4
  184. package/scripts/move_artefact.py +143 -0
  185. package/scripts/new_skill.py +148 -0
  186. package/scripts/plan_physical_move.py +353 -0
  187. package/scripts/refine_ticket_detect.py +30 -7
  188. package/scripts/schemas/command.schema.json +4 -0
  189. package/scripts/skill_linter.py +248 -118
  190. package/scripts/skill_trigger_eval.py +28 -8
  191. package/scripts/smoke/kernel.sh +1 -1
  192. package/scripts/smoke/router.sh +24 -5
  193. package/scripts/smoke/skills.sh +15 -7
  194. package/scripts/smoke_quickstart.py +11 -2
  195. package/scripts/snapshot_agent_outputs.py +144 -0
  196. package/scripts/update_counts.py +45 -17
  197. package/scripts/validate_decision_engine.py +9 -1
  198. package/scripts/validate_discovery_manifest.py +94 -0
  199. package/scripts/validate_frontmatter.py +39 -20
  200. package/scripts/verify_physical_move.py +185 -0
  201. package/templates/agent-user.md +0 -1
  202. package/templates/agent-user.yml +21 -0
  203. package/templates/minimal/agents-overrides-readme.md +46 -0
  204. package/templates/minimal/overrides-gitkeep +2 -0
  205. package/dist/ui/assets/index-BTRcKDlB.js +0 -39
  206. package/dist/ui/assets/index-BTRcKDlB.js.map +0 -1
  207. package/templates/minimal/agents-gitkeep +0 -2
@@ -387,6 +387,12 @@
387
387
  "load_context": [],
388
388
  "load_context_eager": []
389
389
  },
390
+ ".agent-src.uncompressed/commands/install-via-agent.md": {
391
+ "kind": "command",
392
+ "rule_type": null,
393
+ "load_context": [],
394
+ "load_context_eager": []
395
+ },
390
396
  ".agent-src.uncompressed/commands/jira-ticket.md": {
391
397
  "kind": "command",
392
398
  "rule_type": null,
@@ -909,6 +915,12 @@
909
915
  "load_context": [],
910
916
  "load_context_eager": []
911
917
  },
918
+ ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md": {
919
+ "kind": "context",
920
+ "rule_type": null,
921
+ "load_context": [],
922
+ "load_context_eager": []
923
+ },
912
924
  ".agent-src.uncompressed/contexts/execution/interrupt-examples.md": {
913
925
  "kind": "context",
914
926
  "rule_type": null,
@@ -1305,6 +1317,12 @@
1305
1317
  "load_context": [],
1306
1318
  "load_context_eager": []
1307
1319
  },
1320
+ ".agent-src.uncompressed/rules/engineering-safety-floor.md": {
1321
+ "kind": "rule",
1322
+ "rule_type": "auto",
1323
+ "load_context": [],
1324
+ "load_context_eager": []
1325
+ },
1308
1326
  ".agent-src.uncompressed/rules/external-reference-deep-dive.md": {
1309
1327
  "kind": "rule",
1310
1328
  "rule_type": "auto",
@@ -1317,6 +1335,12 @@
1317
1335
  "load_context": [],
1318
1336
  "load_context_eager": []
1319
1337
  },
1338
+ ".agent-src.uncompressed/rules/finance-safety-floor.md": {
1339
+ "kind": "rule",
1340
+ "rule_type": "auto",
1341
+ "load_context": [],
1342
+ "load_context_eager": []
1343
+ },
1320
1344
  ".agent-src.uncompressed/rules/framework-neutrality-in-generic-skills.md": {
1321
1345
  "kind": "rule",
1322
1346
  "rule_type": "auto",
@@ -1540,6 +1564,12 @@
1540
1564
  "load_context": [],
1541
1565
  "load_context_eager": []
1542
1566
  },
1567
+ ".agent-src.uncompressed/rules/strategy-safety-floor.md": {
1568
+ "kind": "rule",
1569
+ "rule_type": "auto",
1570
+ "load_context": [],
1571
+ "load_context_eager": []
1572
+ },
1543
1573
  ".agent-src.uncompressed/rules/symfony-routing.md": {
1544
1574
  "kind": "rule",
1545
1575
  "rule_type": "auto",
@@ -4171,6 +4201,13 @@
4171
4201
  "via": "body_link",
4172
4202
  "depth": 1
4173
4203
  },
4204
+ {
4205
+ "source": ".agent-src.uncompressed/commands/install-via-agent.md",
4206
+ "target": ".agent-src.uncompressed/commands/install-via-agent.md",
4207
+ "type": "WRITE",
4208
+ "via": "self",
4209
+ "depth": 0
4210
+ },
4174
4211
  {
4175
4212
  "source": ".agent-src.uncompressed/commands/jira-ticket.md",
4176
4213
  "target": ".agent-src.uncompressed/commands/jira-ticket.md",
@@ -5851,6 +5888,55 @@
5851
5888
  "via": "body_link",
5852
5889
  "depth": 1
5853
5890
  },
5891
+ {
5892
+ "source": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
5893
+ "target": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
5894
+ "type": "WRITE",
5895
+ "via": "self",
5896
+ "depth": 0
5897
+ },
5898
+ {
5899
+ "source": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
5900
+ "target": ".agent-src.uncompressed/rules/ask-when-uncertain.md",
5901
+ "type": "READ_ONLY",
5902
+ "via": "body_link",
5903
+ "depth": 1
5904
+ },
5905
+ {
5906
+ "source": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
5907
+ "target": ".agent-src.uncompressed/rules/commit-policy.md",
5908
+ "type": "READ_ONLY",
5909
+ "via": "body_link",
5910
+ "depth": 1
5911
+ },
5912
+ {
5913
+ "source": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
5914
+ "target": ".agent-src.uncompressed/rules/no-cheap-questions.md",
5915
+ "type": "READ_ONLY",
5916
+ "via": "body_link",
5917
+ "depth": 1
5918
+ },
5919
+ {
5920
+ "source": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
5921
+ "target": ".agent-src.uncompressed/rules/non-destructive-by-default.md",
5922
+ "type": "READ_ONLY",
5923
+ "via": "body_link",
5924
+ "depth": 1
5925
+ },
5926
+ {
5927
+ "source": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
5928
+ "target": ".agent-src.uncompressed/rules/scope-control.md",
5929
+ "type": "READ_ONLY",
5930
+ "via": "body_link",
5931
+ "depth": 1
5932
+ },
5933
+ {
5934
+ "source": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
5935
+ "target": ".agent-src.uncompressed/rules/security-sensitive-stop.md",
5936
+ "type": "READ_ONLY",
5937
+ "via": "body_link",
5938
+ "depth": 1
5939
+ },
5854
5940
  {
5855
5941
  "source": ".agent-src.uncompressed/contexts/execution/interrupt-examples.md",
5856
5942
  "target": ".agent-src.uncompressed/contexts/execution/interrupt-examples.md",
@@ -6768,6 +6854,13 @@
6768
6854
  "via": "self",
6769
6855
  "depth": 0
6770
6856
  },
6857
+ {
6858
+ "source": ".agent-src.uncompressed/rules/context-hygiene.md",
6859
+ "target": ".agent-src.uncompressed/skills/systematic-debugging/SKILL.md",
6860
+ "type": "READ_ONLY",
6861
+ "via": "body_link",
6862
+ "depth": 1
6863
+ },
6771
6864
  {
6772
6865
  "source": ".agent-src.uncompressed/rules/copilot-routing.md",
6773
6866
  "target": ".agent-src.uncompressed/rules/copilot-routing.md",
@@ -6866,6 +6959,62 @@
6866
6959
  "via": "self",
6867
6960
  "depth": 0
6868
6961
  },
6962
+ {
6963
+ "source": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
6964
+ "target": ".agent-src.uncompressed/rules/commit-policy.md",
6965
+ "type": "READ_ONLY",
6966
+ "via": "body_link",
6967
+ "depth": 1
6968
+ },
6969
+ {
6970
+ "source": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
6971
+ "target": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
6972
+ "type": "WRITE",
6973
+ "via": "self",
6974
+ "depth": 0
6975
+ },
6976
+ {
6977
+ "source": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
6978
+ "target": ".agent-src.uncompressed/rules/non-destructive-by-default.md",
6979
+ "type": "READ_ONLY",
6980
+ "via": "body_link",
6981
+ "depth": 1
6982
+ },
6983
+ {
6984
+ "source": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
6985
+ "target": ".agent-src.uncompressed/rules/scope-control.md",
6986
+ "type": "READ_ONLY",
6987
+ "via": "body_link",
6988
+ "depth": 1
6989
+ },
6990
+ {
6991
+ "source": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
6992
+ "target": ".agent-src.uncompressed/rules/security-sensitive-stop.md",
6993
+ "type": "READ_ONLY",
6994
+ "via": "body_link",
6995
+ "depth": 1
6996
+ },
6997
+ {
6998
+ "source": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
6999
+ "target": ".agent-src.uncompressed/rules/verify-before-complete.md",
7000
+ "type": "READ_ONLY",
7001
+ "via": "body_link",
7002
+ "depth": 1
7003
+ },
7004
+ {
7005
+ "source": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
7006
+ "target": ".agent-src.uncompressed/skills/launch-readiness/SKILL.md",
7007
+ "type": "READ_ONLY",
7008
+ "via": "body_link",
7009
+ "depth": 1
7010
+ },
7011
+ {
7012
+ "source": ".agent-src.uncompressed/rules/engineering-safety-floor.md",
7013
+ "target": ".agent-src.uncompressed/skills/threat-modeling/SKILL.md",
7014
+ "type": "READ_ONLY",
7015
+ "via": "body_link",
7016
+ "depth": 1
7017
+ },
6869
7018
  {
6870
7019
  "source": ".agent-src.uncompressed/rules/external-reference-deep-dive.md",
6871
7020
  "target": ".agent-src.uncompressed/commands/analyze-reference-repo.md",
@@ -6915,6 +7064,20 @@
6915
7064
  "via": "self",
6916
7065
  "depth": 0
6917
7066
  },
7067
+ {
7068
+ "source": ".agent-src.uncompressed/rules/finance-safety-floor.md",
7069
+ "target": ".agent-src.uncompressed/rules/finance-safety-floor.md",
7070
+ "type": "WRITE",
7071
+ "via": "self",
7072
+ "depth": 0
7073
+ },
7074
+ {
7075
+ "source": ".agent-src.uncompressed/rules/finance-safety-floor.md",
7076
+ "target": ".agent-src.uncompressed/skills/runway-cognition/SKILL.md",
7077
+ "type": "READ_ONLY",
7078
+ "via": "body_link",
7079
+ "depth": 1
7080
+ },
6918
7081
  {
6919
7082
  "source": ".agent-src.uncompressed/rules/framework-neutrality-in-generic-skills.md",
6920
7083
  "target": ".agent-src.uncompressed/rules/framework-neutrality-in-generic-skills.md",
@@ -7176,31 +7339,24 @@
7176
7339
  },
7177
7340
  {
7178
7341
  "source": ".agent-src.uncompressed/rules/no-cheap-questions.md",
7179
- "target": ".agent-src.uncompressed/rules/ask-when-uncertain.md",
7342
+ "target": ".agent-src.uncompressed/contexts/execution/cheap-question-mechanics.md",
7180
7343
  "type": "READ_ONLY",
7181
7344
  "via": "body_link",
7182
7345
  "depth": 1
7183
7346
  },
7184
7347
  {
7185
7348
  "source": ".agent-src.uncompressed/rules/no-cheap-questions.md",
7186
- "target": ".agent-src.uncompressed/rules/no-cheap-questions.md",
7187
- "type": "WRITE",
7188
- "via": "self",
7189
- "depth": 0
7190
- },
7191
- {
7192
- "source": ".agent-src.uncompressed/rules/no-cheap-questions.md",
7193
- "target": ".agent-src.uncompressed/rules/non-destructive-by-default.md",
7349
+ "target": ".agent-src.uncompressed/rules/ask-when-uncertain.md",
7194
7350
  "type": "READ_ONLY",
7195
7351
  "via": "body_link",
7196
7352
  "depth": 1
7197
7353
  },
7198
7354
  {
7199
7355
  "source": ".agent-src.uncompressed/rules/no-cheap-questions.md",
7200
- "target": ".agent-src.uncompressed/rules/security-sensitive-stop.md",
7201
- "type": "READ_ONLY",
7202
- "via": "body_link",
7203
- "depth": 1
7356
+ "target": ".agent-src.uncompressed/rules/no-cheap-questions.md",
7357
+ "type": "WRITE",
7358
+ "via": "self",
7359
+ "depth": 0
7204
7360
  },
7205
7361
  {
7206
7362
  "source": ".agent-src.uncompressed/rules/no-roadmap-references.md",
@@ -7545,6 +7701,27 @@
7545
7701
  "via": "self",
7546
7702
  "depth": 0
7547
7703
  },
7704
+ {
7705
+ "source": ".agent-src.uncompressed/rules/strategy-safety-floor.md",
7706
+ "target": ".agent-src.uncompressed/rules/strategy-safety-floor.md",
7707
+ "type": "WRITE",
7708
+ "via": "self",
7709
+ "depth": 0
7710
+ },
7711
+ {
7712
+ "source": ".agent-src.uncompressed/rules/strategy-safety-floor.md",
7713
+ "target": ".agent-src.uncompressed/skills/competitive-moat-analysis/SKILL.md",
7714
+ "type": "READ_ONLY",
7715
+ "via": "body_link",
7716
+ "depth": 1
7717
+ },
7718
+ {
7719
+ "source": ".agent-src.uncompressed/rules/strategy-safety-floor.md",
7720
+ "target": ".agent-src.uncompressed/skills/positioning-strategy/SKILL.md",
7721
+ "type": "READ_ONLY",
7722
+ "via": "body_link",
7723
+ "depth": 1
7724
+ },
7548
7725
  {
7549
7726
  "source": ".agent-src.uncompressed/rules/symfony-routing.md",
7550
7727
  "target": ".agent-src.uncompressed/rules/symfony-routing.md",
@@ -12088,6 +12265,13 @@
12088
12265
  "via": "self",
12089
12266
  "depth": 0
12090
12267
  },
12268
+ {
12269
+ "source": ".agent-src.uncompressed/skills/systematic-debugging/SKILL.md",
12270
+ "target": ".agent-src.uncompressed/rules/context-hygiene.md",
12271
+ "type": "READ_ONLY",
12272
+ "via": "body_link",
12273
+ "depth": 1
12274
+ },
12091
12275
  {
12092
12276
  "source": ".agent-src.uncompressed/skills/systematic-debugging/SKILL.md",
12093
12277
  "target": ".agent-src.uncompressed/skills/blast-radius-analyzer/SKILL.md",
@@ -0,0 +1,140 @@
1
+ ---
2
+ stability: beta
3
+ keep-beta-until: 2026-08-19
4
+ ---
5
+
6
+ # Per-artefact frontmatter contract
7
+
8
+ > Companion to [`ADR-013`](../decisions/ADR-013-discovery-frontmatter-contract.md)
9
+ > and [`discovery-manifest.schema.json`](discovery-manifest.schema.json). The
10
+ > ADR is the decision; this file is the worked-example reference linters,
11
+ > installer, and contributors cite at runtime.
12
+
13
+ Every `.md` artefact under `.agent-src.uncompressed/` MUST declare the five
14
+ ADR-013 discovery keys. The release-time manifest builder
15
+ (`scripts/build_discovery_manifest.py`) derives all workspace/pack assignment
16
+ from these alone — **no manual workspace or pack list is ever maintained**.
17
+
18
+ ## Required keys
19
+
20
+ | Key | Type | Vocabulary | Source |
21
+ |---|---|---|---|
22
+ | `workspaces` | `array<string>`, ≥1 | [`config/discovery/workspaces.yml`](../../config/discovery/workspaces.yml) | role-based axis |
23
+ | `packs` | `array<string>`, ≥1 | [`config/discovery/packs.yml`](../../config/discovery/packs.yml) | functional axis |
24
+ | `lifecycle` | enum | `active` · `experimental` · `deprecated` · `archived` | review cycle |
25
+ | `trust.level` | enum | `core` · `professional` · `experimental` · `advisory` · `restricted` | safety gate |
26
+ | `trust.confidence` | enum | `high` · `medium` · `low` | curator signal |
27
+ | `trust.human_review_required` | bool | — | reviewer routing |
28
+ | `install.default` | bool | — | ships-by-default toggle |
29
+ | `install.removable` | bool | — | core / removable axis |
30
+
31
+ Vocabularies are **closed**. New entries require an amendment to
32
+ [`ADR-013`](../decisions/ADR-013-discovery-frontmatter-contract.md) in the
33
+ same PR. The linter
34
+ ([`scripts/lint_artefact_frontmatter.py`](../../scripts/lint_artefact_frontmatter.py))
35
+ rejects free-text values.
36
+
37
+ ## Worked examples
38
+
39
+ ### Skill — `laravel/SKILL.md`
40
+
41
+ ```yaml
42
+ ---
43
+ name: laravel
44
+ description: "Writes Laravel PHP — Eloquent, Artisan, FormRequests, jobs, policies."
45
+ source: package
46
+ domain: engineering
47
+ workspaces:
48
+ - engineering
49
+ packs:
50
+ - laravel
51
+ lifecycle: active
52
+ trust:
53
+ level: professional
54
+ confidence: high
55
+ human_review_required: false
56
+ install:
57
+ default: false
58
+ removable: true
59
+ ---
60
+ ```
61
+
62
+ ### Rule — `rules/commit-policy.md`
63
+
64
+ ```yaml
65
+ ---
66
+ type: "always"
67
+ tier: "safety-floor"
68
+ description: "Commit policy — never commit unless explicitly authorized this turn."
69
+ alwaysApply: true
70
+ source: package
71
+ workspaces:
72
+ - engineering
73
+ packs:
74
+ - engineering-base
75
+ lifecycle: active
76
+ trust:
77
+ level: core
78
+ confidence: high
79
+ human_review_required: false
80
+ install:
81
+ default: true
82
+ removable: false
83
+ ---
84
+ ```
85
+
86
+ ### Command — `commands/cost-report.md`
87
+
88
+ ```yaml
89
+ ---
90
+ name: cost-report
91
+ tier: 2
92
+ description: "Capture token cost from the active session and surface the 50/75/90/100% budget ladder."
93
+ workspaces:
94
+ - agent-config-maintainer
95
+ packs:
96
+ - meta
97
+ lifecycle: active
98
+ trust:
99
+ level: core
100
+ confidence: high
101
+ human_review_required: false
102
+ install:
103
+ default: true
104
+ removable: false
105
+ ---
106
+ ```
107
+
108
+ ## Quarantine
109
+
110
+ Artefacts that genuinely cannot yet carry frontmatter (early scaffolds,
111
+ generated stubs) MUST be listed in
112
+ [`config/discovery/unassigned-artefacts.yml`](../../config/discovery/unassigned-artefacts.yml)
113
+ with a `reason`. A quarantined entry MUST NOT also carry the five keys —
114
+ the linter rejects that collision.
115
+
116
+ ## Enforcement
117
+
118
+ | Surface | What runs | When |
119
+ |---|---|---|
120
+ | Local | `task lint-artefact-frontmatter` | manual / pre-commit |
121
+ | Pre-commit | `pre-commit-roadmap-progress` template | when `.agent-src.uncompressed/*.md`, `config/discovery/*.yml`, or the linter itself is staged |
122
+ | CI | `task ci` → `lint-artefact-frontmatter` | every push / PR |
123
+
124
+ Install the pre-commit hook with:
125
+
126
+ ```bash
127
+ ./agent-config hooks:install # combined hook (roadmap + frontmatter)
128
+ ./agent-config hooks:install --print # dump to stdout for manual chaining
129
+ ```
130
+
131
+ The hook is opt-in per concern — it short-circuits when no relevant files
132
+ are staged.
133
+
134
+ ## Roundtrip invariant
135
+
136
+ Frontmatter survives the `task sync` compression pipeline. Path-bearing
137
+ keys (`load_context`) may be rewritten relative to the projected location,
138
+ but the five Phase-1 keys above are byte-stable between
139
+ `.agent-src.uncompressed/`, `.agent-src/`, and `.augment/`. Enforced by
140
+ `tests/test_frontmatter_roundtrip.py`.
@@ -0,0 +1,223 @@
1
+ ---
2
+ stability: beta
3
+ keep-beta-until: 2026-08-19
4
+ ---
5
+
6
+ # GUI wizard — local browser installer
7
+
8
+ > Companion to the agent-mode protocol
9
+ > ([`installer-agent-mode.md`](installer-agent-mode.md)) and the
10
+ > trust-and-safety layer ([`trust-and-safety.md`](trust-and-safety.md)).
11
+ > The wizard is a thin HTTP wrapper around the same install plan, the
12
+ > same lockfile, and the same atomic-write semantics as the CLI/TUI
13
+ > paths. It is **optional by design** — the CLI is the canonical entry
14
+ > point; the wizard exists for non-technical users who want a visual
15
+ > picker.
16
+
17
+ ## Source of truth
18
+
19
+ - Server: [`packages/core/installer/src/gui/server.ts`](../../packages/core/installer/src/gui/server.ts)
20
+ - Handlers: [`packages/core/installer/src/gui/handlers.ts`](../../packages/core/installer/src/gui/handlers.ts)
21
+ - Security primitives: [`packages/core/installer/src/gui/security.ts`](../../packages/core/installer/src/gui/security.ts)
22
+ - Inlined SPA: [`packages/core/installer/src/gui/static-assets.ts`](../../packages/core/installer/src/gui/static-assets.ts)
23
+ - Transaction log: [`packages/core/installer/src/gui/transaction-log.ts`](../../packages/core/installer/src/gui/transaction-log.ts)
24
+ - Tests: [`packages/core/installer/tests/gui-*.test.ts`](../../packages/core/installer/tests/)
25
+
26
+ ## Local-only invariant
27
+
28
+ The server **must** bind to `127.0.0.1` and reject any request whose
29
+ `Host` header is not in `{ "127.0.0.1:<port>", "localhost:<port>" }`.
30
+ `Origin` is additionally checked on every POST. No CDN, no analytics,
31
+ no cross-origin asset, no remote endpoint — CSP
32
+ `default-src 'self'` is set on every response.
33
+
34
+ ## Boot sequence
35
+
36
+ ```
37
+ npx @event4u/agent-config init --gui [--gui-port=<n>] [--no-open] [--gui-idle=<s>]
38
+
39
+ ├─► inspect agents/runtime/gui/server.pid → abort if live
40
+ ├─► load dist/discovery/discovery-manifest.json (walks up from CWD)
41
+ ├─► generate per-server CSRF token (64-hex)
42
+ ├─► http.createServer + listen({ host: '127.0.0.1', port: 0 })
43
+ ├─► write agents/runtime/gui/server.pid (POSIX pid, single line)
44
+ ├─► default-spawn the OS browser opener (skipped with --no-open)
45
+ └─► return GuiServerHandle { url, port, csrfToken, pidFile, close }
46
+ ```
47
+
48
+ Idle timeout (default 600 s, configurable via `--gui-idle`) is keyed on
49
+ the **last HTTP request timestamp**, not on SSE event activity.
50
+
51
+ ## Endpoints
52
+
53
+ | Method | Path | Purpose |
54
+ |--------|------------------|------------------------------------------------------|
55
+ | GET | `/` | SPA shell with CSRF token injected via `<meta>` |
56
+ | GET | `/app.css` | Static stylesheet |
57
+ | GET | `/app.js` | Inlined SPA logic |
58
+ | GET | `/api/manifest` | `{ manifest, sha256 }` — bytes-identical to disk |
59
+ | GET | `/api/auto-detect` | `{ signals: { composer, package, pyproject } }` |
60
+ | POST | `/api/preview` | `{ plan, lockfileSha256 }` for current selection |
61
+ | POST | `/api/apply` | SSE: `plan-file`, `progress`, `done`, `error` |
62
+ | POST | `/api/cancel` | Flush in-flight transaction log, close SSE stream |
63
+
64
+ All POSTs require:
65
+
66
+ 1. `Origin` header matching `http://127.0.0.1:<port>` or
67
+ `http://localhost:<port>`.
68
+ 2. Body field `csrf` matching the per-server token (timing-safe
69
+ compare in `security.ts`).
70
+
71
+ A bad CSRF returns `403` with no body. A bad Origin or Host returns
72
+ `403` with a short plaintext reason.
73
+
74
+ ## Transaction log + rollback
75
+
76
+ Every `POST /api/apply` writes append-only JSONL entries to
77
+ `<projectRoot>/agents/runtime/gui/install-<ts>.log`. Shapes are
78
+ declared in
79
+ [`types.ts § TransactionLogEntry`](../../packages/core/installer/src/gui/types.ts):
80
+
81
+ - `start` — workspaces + packs selected
82
+ - `plan` — one entry per planned write (`path`, `pack`)
83
+ - `commit` — `filesWritten`, `lockfileSha256`
84
+ - `cancel` — explicit `POST /api/cancel`
85
+ - `error` — terminating failure with `message`
86
+
87
+ The next `--gui` boot inspects the most recent log and offers to roll
88
+ back if it ended on `start`/`plan`/`error` without a matching
89
+ `commit`/`cancel`. The CLI path consumes the same log, so a mid-install
90
+ crash can be undone from either entry point.
91
+
92
+ ## SSE event framing
93
+
94
+ Every `POST /api/apply` event is `data: <json>\n\n`. The terminal event
95
+ is one of:
96
+
97
+ ```jsonc
98
+ { "type": "done", "filesWritten": 12, "lockfileSha256": "<64-hex>" }
99
+ { "type": "error", "message": "<reason>" }
100
+ ```
101
+
102
+ The browser closes the EventSource on either; the server flushes the
103
+ transaction log and unblocks the idle timer.
104
+
105
+ ## Tarball budget
106
+
107
+ GUI assets under `packages/core/installer/src/gui/` (inlined HTML +
108
+ CSS + JS in `static-assets.ts`) must stay **≤ 200 KB compiled**. The
109
+ constraint is enforced by reviewer judgment for now; a CI check is
110
+ tracked under the Phase 6 follow-ups.
111
+
112
+ ## Security failure modes covered
113
+
114
+ - **Remote exploitation** — loopback bind, Host allowlist, Origin
115
+ allowlist, CSRF token, CSP `default-src 'self'`.
116
+ - **DNS rebinding** — Host header check covers POSTs that omit
117
+ `Origin` (form posts).
118
+ - **Zombie servers** — ephemeral port + PID file + last-request idle
119
+ timer. Stale PIDs (process gone) are silently overwritten on next
120
+ boot; live PIDs block boot with a helpful message.
121
+ - **Mid-install crash** — transaction log + boot-time rollback prompt.
122
+ - **Hidden state** — closing the tab triggers idle timeout; no
123
+ cross-tab session.
124
+
125
+ ## Non-goals (documented contract)
126
+
127
+ - Not a hosted SaaS — no auth, no account model, no telemetry.
128
+ - Not a settings editor — read-only on the lockfile; writes go
129
+ through the same install plan as the CLI.
130
+ - Not a CI surface — every operation is reachable via `--gui-port=0
131
+ --no-open` is supported for headless smoke tests, but the canonical
132
+ CI path is the flag-driven non-interactive CLI.
133
+
134
+ ## Apply payload — versioning handshake (road-to-global-only-install Phase 0.4 · D12)
135
+
136
+ `/api/apply` accepts a discriminated-union body keyed on
137
+ `schema_version`. The full JSON Schema lives at
138
+ [`schemas/wizard-apply-payload.schema.json`](../../schemas/wizard-apply-payload.schema.json).
139
+
140
+ | `schema_version` | Variant | Shape |
141
+ |---|---|---|
142
+ | `"installer-v1"` | `InstallerPayloadV1` | `{ ai_tools[], configs{}, dry_run? }` — legacy Installer-GUI, AI tools only. |
143
+ | `"wizard-v2"` | `WizardPayloadV2` | `{ tools[], packs[], settings{}, scope_to_project_only?, dry_run? }` — unified 9-step wizard. |
144
+
145
+ **D12 (locked).** Single `/api/apply` endpoint with a `schema_version`
146
+ discriminator — **not** two endpoints with a shared Python backend.
147
+ Reasoning: one bind, one CSRF token, one transaction log; the
148
+ Python `scripts/install.py` payload-router branches on
149
+ `schema_version` before any disk write. The dual-endpoint variant was
150
+ considered and rejected for doubling the CSRF + idle-timer surface
151
+ with no observability gain.
152
+
153
+ `schema_version` is **required**. Servers MUST reject any body that
154
+ lacks it (HTTP 400, single-line error pointing at the schema). This
155
+ locks the contract before Phase 1 implementation so no implicit fork
156
+ can sneak in at Phase 1.5.
157
+
158
+ ## Unified 9-step flow (road-to-global-only-install § Phase 1.6)
159
+
160
+ The maintainer-facing wizard at `src/server/routes/wizard.ts` switches
161
+ between two step layouts based on the server-side `extendedSteps`
162
+ flag (default `false` for v2.x users; flipped to `true` by the
163
+ `agent-config setup` CLI when the npm-version kill-switch is in
164
+ effect):
165
+
166
+ | `extendedSteps` | Steps | Layout |
167
+ |---|---|---|
168
+ | `false` | 7 | `editor → personality → cost → roadmap-quality → memory → user-md → review` |
169
+ | `true` | 9 | `ai-tools → packs → editor → personality → cost → roadmap-quality → memory → user-md → review` |
170
+
171
+ The step shapes themselves are declared in
172
+ [`src/ui/wizard/steps.ts`](../../src/ui/wizard/steps.ts) — the two
173
+ prepended lead steps (`ai-tools`, `packs`) carry no `paths` and use
174
+ dedicated renderers in `WizardPage.tsx`. `getWizardSteps({ extended })`
175
+ is the single resolver; the UI consumes the active list via
176
+ `getActiveSteps()` / `activeTotalSteps()` so a server toggle takes
177
+ effect on the next reload without a code change.
178
+
179
+ ### `GET /api/v1/wizard/state` payload
180
+
181
+ ```jsonc
182
+ {
183
+ "step": 0,
184
+ "totalSteps": 9,
185
+ "partial": {},
186
+ "startedAt": null,
187
+ "extendedSteps": true
188
+ }
189
+ ```
190
+
191
+ `extendedSteps` is **advisory** — older server bundles MAY omit it,
192
+ and the UI treats `undefined` as `false`. `totalSteps` reflects the
193
+ flow that was active when the partial was written, which the UI uses
194
+ for resume continuity; the active step set is otherwise derived from
195
+ the current `extendedSteps` flag.
196
+
197
+ ### State persistence + recovery
198
+
199
+ Per-session state is written to `<writeRoot>/state/wizard-state.json`
200
+ (under the global config root, typically
201
+ `~/.event4u/agent-config/state/wizard-state.json`). If the file
202
+ becomes malformed — partial JSON write, orphaned session from a
203
+ previous npm version, manual edit gone wrong — the recovery path is:
204
+
205
+ ```
206
+ agent-config doctor --repair wizard-state
207
+ ```
208
+
209
+ The repair unlinks the file (idempotent; absent files are a no-op
210
+ success). The next `agent-config setup` boots from step 1 with a
211
+ fresh `startedAt`. A matching `wizard-state` health check is part of
212
+ the standard `agent-config doctor` run and surfaces malformed JSON or
213
+ schema-shape drift before the next setup attempt.
214
+
215
+ ### Extended-mode endpoints
216
+
217
+ `extendedSteps: true` activates two additional read-only endpoints:
218
+
219
+ | Method | Path | Purpose |
220
+ |--------|-------------------------------|---------|
221
+ | GET | `/api/v1/wizard/auto-detect` | Project-signal evidence (composer / package / pyproject / artisan / next.config) for the `ai-tools` step. 404 when extended-mode is off. |
222
+ | GET | `/api/v1/wizard/manifest` | Locked discovery-manifest (ADR-015) so the `packs` step can render supported AI IDs + every pack the manifest exposes. 404 when extended-mode is off. |
223
+