@cbartens/bkit 0.0.0-stage → 5.0.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 (373) hide show
  1. package/.bkit/README.md +421 -0
  2. package/.bkit/core/.agents/context.md +95 -0
  3. package/.bkit/core/.agents/docs.md +62 -0
  4. package/.bkit/core/.agents/rules.md +147 -0
  5. package/.bkit/core/.agents/skills.md +43 -0
  6. package/.bkit/core/.bkit/LICENSE.md +151 -0
  7. package/.bkit/core/.bkit/README.md +421 -0
  8. package/.bkit/core/.bkit/cloud.md +502 -0
  9. package/.bkit/core/.bkit/comparison.md +318 -0
  10. package/.bkit/core/.bkit/install.md +496 -0
  11. package/.bkit/core/.bkit/jsonl.md +497 -0
  12. package/.bkit/core/.bkit/prompts.md +474 -0
  13. package/.bkit/core/.bkit/providers.md +598 -0
  14. package/.bkit/core/.bkit/templates.md +471 -0
  15. package/.bkit/core/.bkit/trackers.md +95 -0
  16. package/.bkit/core/.bkit/workflows.md +1546 -0
  17. package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +82 -0
  18. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +93 -0
  19. package/.bkit/core/.claude/hooks/bkit-preflight.sh +74 -0
  20. package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +115 -0
  21. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +135 -0
  22. package/.bkit/core/.cursor/hooks/bkit-gateguard.cjs +111 -0
  23. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +169 -0
  24. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +63 -0
  25. package/.bkit/core/.opencode/plugin/bkit-gateguard.js +225 -0
  26. package/.bkit/core/AGENTS.md +77 -0
  27. package/.bkit/core/LICENSE.md +149 -0
  28. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +272 -0
  29. package/.bkit/core/docs/templates/bkit-audit-adoption.md +223 -0
  30. package/.bkit/core/docs/templates/bkit-audit-agents.md +230 -0
  31. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +227 -0
  32. package/.bkit/core/docs/templates/bkit-audit-analytics.md +266 -0
  33. package/.bkit/core/docs/templates/bkit-audit-annotations.md +230 -0
  34. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +270 -0
  35. package/.bkit/core/docs/templates/bkit-audit-app-store.md +254 -0
  36. package/.bkit/core/docs/templates/bkit-audit-architecture.md +221 -0
  37. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +241 -0
  38. package/.bkit/core/docs/templates/bkit-audit-config.md +230 -0
  39. package/.bkit/core/docs/templates/bkit-audit-cost.md +218 -0
  40. package/.bkit/core/docs/templates/bkit-audit-coverage.md +221 -0
  41. package/.bkit/core/docs/templates/bkit-audit-database.md +229 -0
  42. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +251 -0
  43. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +283 -0
  44. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +268 -0
  45. package/.bkit/core/docs/templates/bkit-audit-documentation.md +280 -0
  46. package/.bkit/core/docs/templates/bkit-audit-duplication.md +253 -0
  47. package/.bkit/core/docs/templates/bkit-audit-failures.md +259 -0
  48. package/.bkit/core/docs/templates/bkit-audit-flakes.md +237 -0
  49. package/.bkit/core/docs/templates/bkit-audit-gates.md +250 -0
  50. package/.bkit/core/docs/templates/bkit-audit-issues.md +273 -0
  51. package/.bkit/core/docs/templates/bkit-audit-llm.md +239 -0
  52. package/.bkit/core/docs/templates/bkit-audit-logs.md +266 -0
  53. package/.bkit/core/docs/templates/bkit-audit-models.md +210 -0
  54. package/.bkit/core/docs/templates/bkit-audit-privacy.md +211 -0
  55. package/.bkit/core/docs/templates/bkit-audit-prompts.md +216 -0
  56. package/.bkit/core/docs/templates/bkit-audit-red-team.md +220 -0
  57. package/.bkit/core/docs/templates/bkit-audit-reliability.md +222 -0
  58. package/.bkit/core/docs/templates/bkit-audit-repo.md +224 -0
  59. package/.bkit/core/docs/templates/bkit-audit-security.md +274 -0
  60. package/.bkit/core/docs/templates/bkit-audit-slop.md +200 -0
  61. package/.bkit/core/docs/templates/bkit-audit-testing.md +270 -0
  62. package/.bkit/core/docs/templates/bkit-audit-usability.md +237 -0
  63. package/.bkit/core/docs/templates/bkit-plan.md +476 -0
  64. package/.bkit/core/engine/checks/after/auth.ts +247 -0
  65. package/.bkit/core/engine/checks/after/ci-yml.ts +739 -0
  66. package/.bkit/core/engine/checks/after/github.ts +424 -0
  67. package/.bkit/core/engine/checks/after/index.ts +556 -0
  68. package/.bkit/core/engine/checks/after/managed.ts +217 -0
  69. package/.bkit/core/engine/checks/after/tools.ts +427 -0
  70. package/.bkit/core/engine/checks/after/vercel.ts +101 -0
  71. package/.bkit/core/engine/checks/before/context-fetch.ts +429 -0
  72. package/.bkit/core/engine/checks/before/env.ts +201 -0
  73. package/.bkit/core/engine/checks/before/files.ts +202 -0
  74. package/.bkit/core/engine/checks/before/index.ts +206 -0
  75. package/.bkit/core/engine/checks/before/mcp.ts +127 -0
  76. package/.bkit/core/engine/checks/before/repo.ts +77 -0
  77. package/.bkit/core/engine/checks/before/version.ts +67 -0
  78. package/.bkit/core/engine/checks/status-holes.ts +479 -0
  79. package/.bkit/core/engine/cli.ts +871 -0
  80. package/.bkit/core/engine/commands/analysis.ts +550 -0
  81. package/.bkit/core/engine/commands/ci/ci.ts +483 -0
  82. package/.bkit/core/engine/commands/comply.ts +415 -0
  83. package/.bkit/core/engine/commands/harvest.ts +459 -0
  84. package/.bkit/core/engine/commands/install/check.ts +70 -0
  85. package/.bkit/core/engine/commands/install/doctor.ts +247 -0
  86. package/.bkit/core/engine/commands/install/install.ts +528 -0
  87. package/.bkit/core/engine/commands/install/uninstall.ts +972 -0
  88. package/.bkit/core/engine/commands/install/upgrade.ts +1026 -0
  89. package/.bkit/core/engine/commands/launch.ts +139 -0
  90. package/.bkit/core/engine/commands/lib.ts +494 -0
  91. package/.bkit/core/engine/commands/registry.ts +53 -0
  92. package/.bkit/core/engine/commands/setup/setup.ts +184 -0
  93. package/.bkit/core/engine/commands/telemetry.ts +32 -0
  94. package/.bkit/core/engine/commands/workflow/branches.ts +1514 -0
  95. package/.bkit/core/engine/commands/workflow/context.ts +961 -0
  96. package/.bkit/core/engine/commands/workflow/counters.ts +268 -0
  97. package/.bkit/core/engine/commands/workflow/fids.ts +243 -0
  98. package/.bkit/core/engine/commands/workflow/issues.ts +675 -0
  99. package/.bkit/core/engine/commands/workflow/ledgers.ts +575 -0
  100. package/.bkit/core/engine/commands/workflow/locks.ts +478 -0
  101. package/.bkit/core/engine/commands/workflow/prs.ts +1087 -0
  102. package/.bkit/core/engine/commands/workflow/repo.ts +220 -0
  103. package/.bkit/core/engine/commands/workflow/roadmap.ts +576 -0
  104. package/.bkit/core/engine/commands/workflow/runs.ts +2140 -0
  105. package/.bkit/core/engine/commands/workflow/runtime.ts +300 -0
  106. package/.bkit/core/engine/commands/workflow/skills.ts +118 -0
  107. package/.bkit/core/engine/commands/workflow/status.ts +455 -0
  108. package/.bkit/core/engine/commands/workflow/steps.ts +1300 -0
  109. package/.bkit/core/engine/commands/workflow/tests.ts +161 -0
  110. package/.bkit/core/engine/commands/workflow/workflows.ts +1573 -0
  111. package/.bkit/core/engine/commands/workflow/workstreams.ts +164 -0
  112. package/.bkit/core/engine/commands/workflow/worktrees.ts +534 -0
  113. package/.bkit/core/engine/install/cloud-env.ts +925 -0
  114. package/.bkit/core/engine/install/managed-block.ts +212 -0
  115. package/.bkit/core/engine/install/manifest.ts +448 -0
  116. package/.bkit/core/engine/install/modules/claude.ts +362 -0
  117. package/.bkit/core/engine/install/modules/cloud.ts +174 -0
  118. package/.bkit/core/engine/install/modules/codex.ts +219 -0
  119. package/.bkit/core/engine/install/modules/core.ts +600 -0
  120. package/.bkit/core/engine/install/modules/cursor.ts +231 -0
  121. package/.bkit/core/engine/install/modules/index.ts +242 -0
  122. package/.bkit/core/engine/install/modules/opencode.ts +573 -0
  123. package/.bkit/core/engine/install/placeholders.ts +108 -0
  124. package/.bkit/core/engine/install/template-copies.ts +119 -0
  125. package/.bkit/core/engine/install/version-file.ts +284 -0
  126. package/.bkit/core/engine/install/write.ts +467 -0
  127. package/.bkit/core/engine/ledgers/clamp-log.ts +32 -0
  128. package/.bkit/core/engine/ledgers/status.ts +213 -0
  129. package/.bkit/core/engine/ledgers/telemetry.ts +1143 -0
  130. package/.bkit/core/engine/render/hosts.ts +372 -0
  131. package/.bkit/core/engine/render/models.ts +323 -0
  132. package/.bkit/core/engine/render/parts.ts +38 -0
  133. package/.bkit/core/engine/render/trackers.ts +170 -0
  134. package/.bkit/core/engine/shared/egress.ts +345 -0
  135. package/.bkit/core/engine/shared/json.ts +16 -0
  136. package/.bkit/core/engine/shared/log-prefix.ts +9 -0
  137. package/.bkit/core/engine/shared/package-json.ts +29 -0
  138. package/.bkit/core/engine/shared/package-manager.ts +38 -0
  139. package/.bkit/core/engine/shared/package-roots.ts +163 -0
  140. package/.bkit/core/engine/shared/protected-paths.ts +164 -0
  141. package/.bkit/core/engine/shared/settings.ts +72 -0
  142. package/.bkit/core/engine/shared/timeouts.ts +20 -0
  143. package/.bkit/core/engine/tools/wording.ts +748 -0
  144. package/.bkit/core/hooks/gateguard-edit-payload.js +18 -0
  145. package/.bkit/core/hooks/gateguard-engine.js +193 -0
  146. package/.bkit/core/hooks/guardrails-shell.js +154 -0
  147. package/.bkit/core/hooks/guardrails-tiers.js +68 -0
  148. package/.bkit/core/hooks/preflight-linear.sh +73 -0
  149. package/.bkit/core/prompts/bkit-audit-generate.md +66 -0
  150. package/.bkit/core/prompts/bkit-build-challenge-1.md +79 -0
  151. package/.bkit/core/prompts/bkit-build-challenge-2.md +81 -0
  152. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +68 -0
  153. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +70 -0
  154. package/.bkit/core/prompts/bkit-build-challenge-tests.md +73 -0
  155. package/.bkit/core/prompts/bkit-build-install-skills.md +67 -0
  156. package/.bkit/core/prompts/bkit-build-plan-current.md +75 -0
  157. package/.bkit/core/prompts/bkit-build-plan-execute.md +72 -0
  158. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +73 -0
  159. package/.bkit/core/prompts/bkit-build-plan-verify.md +88 -0
  160. package/.bkit/core/prompts/bkit-build-summary.md +93 -0
  161. package/.bkit/core/prompts/bkit-debug-abort-handover.md +90 -0
  162. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +151 -0
  163. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +78 -0
  164. package/.bkit/core/prompts/bkit-debug-failure-soak.md +73 -0
  165. package/.bkit/core/prompts/bkit-debug-summary.md +95 -0
  166. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +72 -0
  167. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +72 -0
  168. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +75 -0
  169. package/.bkit/core/prompts/bkit-design-generate.md +110 -0
  170. package/.bkit/core/prompts/bkit-design-organise.md +85 -0
  171. package/.bkit/core/prompts/bkit-design-review-1.md +121 -0
  172. package/.bkit/core/prompts/bkit-design-review-2.md +111 -0
  173. package/.bkit/core/prompts/bkit-design-spike.md +97 -0
  174. package/.bkit/core/prompts/bkit-design-summary.md +106 -0
  175. package/.bkit/core/prompts/bkit-design-update.md +66 -0
  176. package/.bkit/core/prompts/bkit-plan-complexity-check.md +66 -0
  177. package/.bkit/core/prompts/bkit-plan-complexity-split.md +87 -0
  178. package/.bkit/core/prompts/bkit-plan-generate.md +74 -0
  179. package/.bkit/core/prompts/bkit-plan-review-1.md +90 -0
  180. package/.bkit/core/prompts/bkit-plan-review-2.md +80 -0
  181. package/.bkit/core/prompts/bkit-plan-review-3.md +92 -0
  182. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +84 -0
  183. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +84 -0
  184. package/.bkit/core/prompts/bkit-plan-summary.md +106 -0
  185. package/.bkit/core/prompts/bkit-plan-update.md +68 -0
  186. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +90 -0
  187. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +94 -0
  188. package/.bkit/core/prompts/bkit-ship-summary.md +77 -0
  189. package/.bkit/core/prompts/bkit-ship-update-docs.md +71 -0
  190. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +91 -0
  191. package/.bkit/core/prompts/bkit-utility-update-decisions.md +75 -0
  192. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +76 -0
  193. package/.bkit/core/prompts/bkit-utility-update-documentation.md +61 -0
  194. package/.bkit/core/prompts/bkit-utility-update-failures.md +76 -0
  195. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +75 -0
  196. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +82 -0
  197. package/.bkit/core/workflows/bkit-auto.md +121 -0
  198. package/.bkit/core/workflows/bkit-build.md +802 -0
  199. package/.bkit/core/workflows/bkit-debug.md +642 -0
  200. package/.bkit/core/workflows/bkit-design.md +495 -0
  201. package/.bkit/core/workflows/bkit-plan.md +510 -0
  202. package/.bkit/core/workflows/bkit-ship.md +650 -0
  203. package/.bkit/shared/.bkit/.env.example +108 -0
  204. package/.bkit/shared/.claude/bkit-cloud.md +117 -0
  205. package/.bkit/shared/.claude/settings.json +88 -0
  206. package/.bkit/shared/.codex/hooks.json +26 -0
  207. package/.bkit/shared/.cursor/bkit-cloud.md +84 -0
  208. package/.bkit/shared/.cursor/hooks.json +26 -0
  209. package/.bkit/shared/.cursor/mcp.json +15 -0
  210. package/.bkit/shared/.cursor/rules/bkit-rules.mdc +12 -0
  211. package/.bkit/shared/.gitattributes +37 -0
  212. package/.bkit/shared/.mcp.json +16 -0
  213. package/.bkit/shared/.opencode/opencode.json +62 -0
  214. package/.bkit/shared/CLAUDE.md +11 -0
  215. package/.bkit/shared/LICENSE.md +22 -0
  216. package/.bkit/shared/docs/architecture.md +19 -0
  217. package/.bkit/shared/docs/data-schema.md +19 -0
  218. package/.bkit/shared/docs/deployments.md +438 -0
  219. package/.bkit/shared/docs/design.md +39 -0
  220. package/.bkit/shared/docs/noise.md +19 -0
  221. package/.bkit/shared/docs/observability.md +25 -0
  222. package/.bkit/shared/docs/security.md +42 -0
  223. package/.bkit/shared/docs/setup.md +30 -0
  224. package/.bkit/shared/docs/technology.md +18 -0
  225. package/.bkit/shared/docs/testing.md +413 -0
  226. package/.bkit/shared/gitignore +92 -0
  227. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +192 -0
  228. package/.bkit/templates/.cursor/Dockerfile +68 -0
  229. package/.bkit/templates/.cursor/environment.json +6 -0
  230. package/.bkit/templates/.cursor/settings.json +11 -0
  231. package/.bkit/templates/.envrc +7 -0
  232. package/.bkit/templates/.github/dependabot.yml +52 -0
  233. package/.bkit/templates/.github/renovate.json5 +239 -0
  234. package/.bkit/templates/.github/workflows/bkit-ci.yml +1082 -0
  235. package/.bkit/templates/.github/workflows/bkit-cloud.yml +566 -0
  236. package/.bkit/templates/.github/workflows/bkit-renovate.yml +107 -0
  237. package/.bkit/templates/.graphifyignore +108 -0
  238. package/.bkit/templates/.husky/pre-commit +16 -0
  239. package/.bkit/templates/.husky/pre-push +91 -0
  240. package/.bkit/templates/.lintstagedrc.json +3 -0
  241. package/.bkit/templates/.prettierignore +41 -0
  242. package/.bkit/templates/.serena/project.yml +243 -0
  243. package/.bkit/templates/.vale/styles/House/Filler.yml +11 -0
  244. package/.bkit/templates/.vale/styles/House/Hedging.yml +12 -0
  245. package/.bkit/templates/.vale/styles/House/LLMSlop.yml +13 -0
  246. package/.bkit/templates/.vale/styles/House/Verbose.yml +12 -0
  247. package/.bkit/templates/.vale.ini +67 -0
  248. package/.bkit/templates/LICENSE.md +22 -0
  249. package/.bkit/templates/context/bkit-cloudrun.md +84 -0
  250. package/.bkit/templates/context/bkit-expo.md +186 -0
  251. package/.bkit/templates/context/bkit-github.md +79 -0
  252. package/.bkit/templates/context/bkit-inngest.md +45 -0
  253. package/.bkit/templates/context/bkit-maestro.md +76 -0
  254. package/.bkit/templates/context/bkit-playwright.md +62 -0
  255. package/.bkit/templates/context/bkit-resend.md +36 -0
  256. package/.bkit/templates/context/bkit-sentry.md +65 -0
  257. package/.bkit/templates/context/bkit-serena.md +33 -0
  258. package/.bkit/templates/context/bkit-stripe.md +36 -0
  259. package/.bkit/templates/context/bkit-supabase.md +59 -0
  260. package/.bkit/templates/context/bkit-tavily.md +49 -0
  261. package/.bkit/templates/context/bkit-vercel.md +64 -0
  262. package/.bkit/templates/docs/capabilities.md +72 -0
  263. package/.bkit/templates/scripts/ci/accepted-divergences.json +21 -0
  264. package/.bkit/templates/scripts/ci/check-accepted-divergences.mjs +152 -0
  265. package/.bkit/templates/scripts/ci/check-accepted-divergences.test.mjs +130 -0
  266. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +98 -0
  267. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +86 -0
  268. package/.bkit/templates/scripts/graphify/bkit-graph-drift-rules.json +23 -0
  269. package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +208 -0
  270. package/.bkit/templates/scripts/graphify/bkit-graph-eager-rules.json +35 -0
  271. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +236 -0
  272. package/.bkit/templates/scripts/graphify/bkit-graph-external-rules.json +17 -0
  273. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +290 -0
  274. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +19 -0
  275. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +120 -0
  276. package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +232 -0
  277. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +36 -0
  278. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +927 -0
  279. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +351 -0
  280. package/.bkit/templates/scripts/launchd/ai.bkit.launchd.plist +26 -0
  281. package/.bkit/templates/scripts/launchd/bkit-launchd-env.sh +53 -0
  282. package/.bkit/templates/scripts/launchd/launchd.env.example +13 -0
  283. package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +275 -0
  284. package/.bkit/templates/scripts/secrets/bkit-secrets.config.mjs +66 -0
  285. package/.bkit/templates/scripts/secrets/bkit-secrets.mjs +785 -0
  286. package/.bkit/templates/scripts/serena/bkit-serena-mcp.sh +30 -0
  287. package/.bkit/templates/scripts/serena/bkit-serena.mcp.json +9 -0
  288. package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +286 -0
  289. package/.bkit/templates/slop-scan.config.json +120 -0
  290. package/CHANGELOG.md +1486 -0
  291. package/LICENSE.md +161 -0
  292. package/README.md +185 -2
  293. package/dist/checks/after/auth.js +232 -0
  294. package/dist/checks/after/ci-yml.js +718 -0
  295. package/dist/checks/after/github.js +400 -0
  296. package/dist/checks/after/index.js +447 -0
  297. package/dist/checks/after/managed.js +187 -0
  298. package/dist/checks/after/tools.js +351 -0
  299. package/dist/checks/after/vercel.js +102 -0
  300. package/dist/checks/before/context-fetch.js +426 -0
  301. package/dist/checks/before/env.js +173 -0
  302. package/dist/checks/before/files.js +185 -0
  303. package/dist/checks/before/index.js +162 -0
  304. package/dist/checks/before/mcp.js +111 -0
  305. package/dist/checks/before/repo.js +71 -0
  306. package/dist/checks/before/version.js +60 -0
  307. package/dist/checks/status-holes.js +393 -0
  308. package/dist/cli.js +692 -0
  309. package/dist/commands/analysis.js +325 -0
  310. package/dist/commands/ci/ci.js +438 -0
  311. package/dist/commands/comply.js +310 -0
  312. package/dist/commands/harvest.js +354 -0
  313. package/dist/commands/install/check.js +61 -0
  314. package/dist/commands/install/doctor.js +207 -0
  315. package/dist/commands/install/install.js +461 -0
  316. package/dist/commands/install/uninstall.js +815 -0
  317. package/dist/commands/install/upgrade.js +771 -0
  318. package/dist/commands/launch.js +118 -0
  319. package/dist/commands/lib.js +362 -0
  320. package/dist/commands/registry.js +50 -0
  321. package/dist/commands/setup/setup.js +158 -0
  322. package/dist/commands/telemetry.js +29 -0
  323. package/dist/commands/workflow/branches.js +1265 -0
  324. package/dist/commands/workflow/context.js +846 -0
  325. package/dist/commands/workflow/counters.js +227 -0
  326. package/dist/commands/workflow/fids.js +224 -0
  327. package/dist/commands/workflow/issues.js +585 -0
  328. package/dist/commands/workflow/ledgers.js +472 -0
  329. package/dist/commands/workflow/locks.js +364 -0
  330. package/dist/commands/workflow/prs.js +904 -0
  331. package/dist/commands/workflow/repo.js +199 -0
  332. package/dist/commands/workflow/roadmap.js +495 -0
  333. package/dist/commands/workflow/runs.js +1717 -0
  334. package/dist/commands/workflow/runtime.js +257 -0
  335. package/dist/commands/workflow/skills.js +110 -0
  336. package/dist/commands/workflow/status.js +392 -0
  337. package/dist/commands/workflow/steps.js +1093 -0
  338. package/dist/commands/workflow/tests.js +144 -0
  339. package/dist/commands/workflow/workflows.js +1342 -0
  340. package/dist/commands/workflow/workstreams.js +141 -0
  341. package/dist/commands/workflow/worktrees.js +473 -0
  342. package/dist/install/cloud-env.js +819 -0
  343. package/dist/install/managed-block.js +182 -0
  344. package/dist/install/manifest.js +376 -0
  345. package/dist/install/modules/claude.js +288 -0
  346. package/dist/install/modules/cloud.js +152 -0
  347. package/dist/install/modules/codex.js +193 -0
  348. package/dist/install/modules/core.js +511 -0
  349. package/dist/install/modules/cursor.js +186 -0
  350. package/dist/install/modules/index.js +152 -0
  351. package/dist/install/modules/opencode.js +504 -0
  352. package/dist/install/placeholders.js +87 -0
  353. package/dist/install/template-copies.js +106 -0
  354. package/dist/install/version-file.js +204 -0
  355. package/dist/install/write.js +342 -0
  356. package/dist/ledgers/clamp-log.js +27 -0
  357. package/dist/ledgers/status.js +156 -0
  358. package/dist/ledgers/telemetry.js +637 -0
  359. package/dist/render/hosts.js +339 -0
  360. package/dist/render/models.js +288 -0
  361. package/dist/render/parts.js +33 -0
  362. package/dist/render/trackers.js +135 -0
  363. package/dist/shared/egress.js +299 -0
  364. package/dist/shared/json.js +16 -0
  365. package/dist/shared/log-prefix.js +7 -0
  366. package/dist/shared/package-json.js +22 -0
  367. package/dist/shared/package-manager.js +32 -0
  368. package/dist/shared/package-roots.js +145 -0
  369. package/dist/shared/protected-paths.js +153 -0
  370. package/dist/shared/settings.js +44 -0
  371. package/dist/shared/timeouts.js +19 -0
  372. package/dist/tools/wording.js +680 -0
  373. package/package.json +101 -4
@@ -0,0 +1,67 @@
1
+ # Example. Copy into the repo and own it.
2
+ # bkit install does not write this file and does not overwrite a copy.
3
+ StylesPath = .vale/styles
4
+ MinAlertLevel = warning
5
+ Packages = write-good
6
+
7
+ [.agents/**]
8
+ BasedOnStyles = House
9
+
10
+ # Vendored skill content — third-party docs loaded under multiple paths
11
+ # depending on harness. Each path needs its own scope block.
12
+ [**/.agents/skills/**/*.md]
13
+ House.LLMSlop = NO
14
+ House.Hedging = NO
15
+ House.Filler = NO
16
+ House.Verbose = NO
17
+
18
+ [**/.claude/skills/**/*.md]
19
+ House.LLMSlop = NO
20
+ House.Hedging = NO
21
+ House.Filler = NO
22
+ House.Verbose = NO
23
+
24
+ [**/.cursor/skills/**/*.md]
25
+ House.LLMSlop = NO
26
+ House.Hedging = NO
27
+ House.Filler = NO
28
+ House.Verbose = NO
29
+
30
+ # Meta-prompt about prose compression: enumerates hedging/verbose phrases
31
+ # verbatim as examples of what to strip, so House rules self-trigger.
32
+ [**/bkit-utility-compress-markdown.md]
33
+ House.LLMSlop = NO
34
+ House.Hedging = NO
35
+ House.Filler = NO
36
+ House.Verbose = NO
37
+
38
+ [*.md]
39
+ BasedOnStyles = write-good, House
40
+ write-good.ThereIs = warning
41
+ write-good.Passive = NO
42
+ write-good.TooWordy = NO
43
+ write-good.Weasel = NO
44
+
45
+ # Plan/working artefacts (docs/plans/YYYYMM/** + nested logs/) intentionally
46
+ # quote LLM-slop tokens, hedging examples, and conjunction-opener prose as
47
+ # documentation of what to avoid — linting them produces only false positives.
48
+ # Vale's empty `BasedOnStyles =` INHERITS from less-specific scopes rather than
49
+ # disabling, so each rule must be turned off explicitly. Leading `**/` so
50
+ # lint-staged's absolute paths also match.
51
+ [**/docs/plans/**/*.md]
52
+ House.LLMSlop = NO
53
+ House.Hedging = NO
54
+ House.Filler = NO
55
+ House.Verbose = NO
56
+ write-good.ThereIs = NO
57
+ write-good.So = NO
58
+
59
+ # bkit's reference copies of its templates (.bkit/templates/) — refreshed by
60
+ # `bkit upgrade`, not this repo's prose. Every rule off, as for docs/plans above.
61
+ [**/.bkit/templates/**/*.md]
62
+ House.LLMSlop = NO
63
+ House.Hedging = NO
64
+ House.Filler = NO
65
+ House.Verbose = NO
66
+ write-good.ThereIs = NO
67
+ write-good.So = NO
@@ -0,0 +1,22 @@
1
+ # Licence for `.bkit/templates/`
2
+
3
+ Everything in this folder is licensed under the MIT No Attribution License (MIT-0) below. You can use, copy, change and share these templates for any purpose, without keeping this notice. A template you copy into your repo is yours.
4
+
5
+ ---
6
+
7
+ MIT No Attribution
8
+
9
+ Copyright 2026 Christian Bartens
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
12
+ software and associated documentation files (the "Software"), to deal in the Software
13
+ without restriction, including without limitation the rights to use, copy, modify,
14
+ merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
15
+ permit persons to whom the Software is furnished to do so.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,84 @@
1
+ <!-- Example. Copy into the repo and own it. -->
2
+ <!-- bkit install does not write this file and does not overwrite a copy. -->
3
+
4
+ # Google Cloud Run — container logs
5
+
6
+ Fits: services running on Google Cloud Run. `context=runtime`: `gcloud logging read` on `cloud_run_revision` — `severity>=ERROR` plus the platform's `Memory limit … exceeded` lines. Those are container kills (503 / SIGKILL exit 137) the app itself never logs and an error tracker never sees: the container dies before its SDK flushes.
7
+
8
+ - Secret: none locally after `gcloud auth login`. Headless (cloud agents): `GCP_CLIENT_EMAIL` + `GCP_PRIVATE_KEY` of a service account with `roles/logging.viewer`; the block activates it only when no gcloud account is active, through a `0600` key file it deletes on exit.
9
+ - Non-secret: `GCP_PROJECT_ID` — uncomment the line in the block so cloud agents inherit it. Separate dev / prod projects: use the id whose logs you want. Optional `GCP_SERVICE` narrows to one service; `SINCE`, `GCP_N`.
10
+ - CLI: `gcloud`; the provision block installs it in cloud (GitHub-hosted Ubuntu runners already ship it). Uses `node` to build the key file.
11
+
12
+ Copy the blocks below into `.agents/context.md`, below `<!-- bkit:end -->`.
13
+
14
+ <!-- context-fetch:start cloudrun context=runtime -->
15
+
16
+ ```bash
17
+ # GCP Cloud Run CONTAINER logs — platform / container errors (read-only), incl. OOM kills
18
+ # ("Memory limit of NNNN MiB exceeded" → 503 / SIGKILL exit 137) that never reach the app's own
19
+ # logs or its error tracker.
20
+ # GCP_PROJECT_ID is non-secret — uncomment + set the line below so cloud agents inherit it.
21
+ # Optional GCP_SERVICE narrows to one service; unset = every cloud_run_revision in the project:
22
+ # GCP_PROJECT_ID="your-gcp-project-id"
23
+ # GCP_SERVICE="your-service-name"
24
+ # Headless auth: with no active gcloud account, activates a service account from
25
+ # GCP_CLIENT_EMAIL + GCP_PRIVATE_KEY (a `\n`-escaped PEM is un-escaped). Locally, `gcloud auth
26
+ # login` once and skip both. PII-safe: projects scalar / id fields only, never the raw payload.
27
+ # Customise: GCP_SERVICE; SINCE freshness; GCP_N; the FILTER (add textPayload:"<prefix>" for app stdout).
28
+ command -v gcloud >/dev/null 2>&1 \
29
+ || { echo "[context-fetch:cloudrun] skipped — gcloud CLI missing" >&2; exit 0; }
30
+ [ -n "${GCP_PROJECT_ID:-}" ] \
31
+ || { echo "[context-fetch:cloudrun] skipped — GCP_PROJECT_ID unset" >&2; exit 0; }
32
+ # Activate the SA only when nothing is authenticated yet (idempotent; an SA never needs reauth).
33
+ if [ -z "$(gcloud auth list --filter=status:ACTIVE --format='value(account)' 2>/dev/null)" ]; then
34
+ [ -n "${GCP_CLIENT_EMAIL:-}" ] && [ -n "${GCP_PRIVATE_KEY:-}" ] \
35
+ || { echo "[context-fetch:cloudrun] skipped — no active gcloud account and GCP_CLIENT_EMAIL/GCP_PRIVATE_KEY unset" >&2; exit 0; }
36
+ KEYFILE="$(mktemp -t gcp-sa-XXXXXX)"; chmod 600 "$KEYFILE"
37
+ trap 'rm -f "$KEYFILE"' EXIT # a live credential — remove on block exit, never print it
38
+ GCP_CLIENT_EMAIL="$GCP_CLIENT_EMAIL" GCP_PRIVATE_KEY="$GCP_PRIVATE_KEY" \
39
+ GCP_PROJECT_ID="$GCP_PROJECT_ID" KEYFILE="$KEYFILE" node -e '
40
+ const crypto=require("crypto"), fs=require("fs");
41
+ // createPrivateKey THROWS on a bad decode → fail here, not as a cryptic gcloud error later
42
+ const pk=crypto.createPrivateKey({key:process.env.GCP_PRIVATE_KEY.replace(/\\n/g,"\n"),format:"pem"})
43
+ .export({type:"pkcs8",format:"pem"});
44
+ fs.writeFileSync(process.env.KEYFILE, JSON.stringify({
45
+ type:"service_account", project_id:process.env.GCP_PROJECT_ID,
46
+ private_key:pk, client_email:process.env.GCP_CLIENT_EMAIL,
47
+ token_uri:"https://oauth2.googleapis.com/token"}), {mode:0o600});
48
+ ' 2>/dev/null || { echo "[context-fetch:cloudrun] skipped — could not build SA key from GCP_PRIVATE_KEY" >&2; exit 0; }
49
+ gcloud auth activate-service-account --key-file="$KEYFILE" --project="$GCP_PROJECT_ID" >/dev/null 2>&1 \
50
+ || { echo "[context-fetch:cloudrun] skipped — gcloud SA activation failed" >&2; exit 0; }
51
+ fi
52
+ FILTER='resource.type="cloud_run_revision" AND (severity>=ERROR OR textPayload:"Memory limit")'
53
+ [ -n "${GCP_SERVICE:-}" ] && FILTER="${FILTER} AND resource.labels.service_name=\"${GCP_SERVICE}\""
54
+ gcloud logging read "$FILTER" \
55
+ --project="$GCP_PROJECT_ID" \
56
+ --freshness="${SINCE:-4h}" \
57
+ --limit="${GCP_N:-50}" \
58
+ --format=json \
59
+ | jq '[.[] | {timestamp, severity,
60
+ service: .resource.labels.service_name,
61
+ revision: .resource.labels.revision_name,
62
+ message: (.jsonPayload.message // .textPayload)}]'
63
+ ```
64
+
65
+ <!-- context-fetch:end -->
66
+
67
+ <!-- context-fetch:provision cloudrun -->
68
+
69
+ ```bash
70
+ # Install the gcloud CLI in cloud if absent (self-guarded; no-op when present).
71
+ # The install script needs no root or apt; --disable-prompts writes the SDK to $HOME and appends
72
+ # it to the shell profile, so later context-fetch shells (profile-sourced) find it.
73
+ command -v gcloud >/dev/null 2>&1 \
74
+ || curl -sSL https://sdk.cloud.google.com | bash -s -- --disable-prompts >/dev/null 2>&1
75
+ ```
76
+
77
+ <!-- context-fetch:end -->
78
+
79
+ <!-- allowed-domains:start -->
80
+
81
+ googleapis.com
82
+ google.com
83
+
84
+ <!-- allowed-domains:end -->
@@ -0,0 +1,186 @@
1
+ <!-- Example. Copy into the repo and own it. -->
2
+ <!-- bkit install does not write this file and does not overwrite a copy. -->
3
+
4
+ # Expo EAS — native builds and Workflow e2e runs (Maestro)
5
+
6
+ Fits: React Native / Expo apps on EAS. `context=runtime` (`expo` block): recent EAS Build status (id, platform, status, profile, commit, error), then the error-level lines of the latest errored builds' logs. `context=e2e` (`expo-workflows` block): for the latest failed EAS Workflow runs (`eas workflow:run`, Maestro) — job status and errors, step-log tails, the per-flow exception for every flow and retry (EAS GraphQL), JUnit, failure screenshot URLs, and from `artifacts.tar.gz` the failing Maestro commands, the view-hierarchy dump list, per-attempt JUnit, the XCUITest runner's own errors and the app's JS console. EAS drains build failures and Workflow runs nowhere else — no host log, no error tracker — so this is the only place they surface.
7
+
8
+ - Secret: `EXPO_TOKEN` (an EAS access token), in the app's env (e.g. `apps/mobile/.env.local`), not `.bkit/.env`.
9
+ - Non-secret: `EXPO_APP_DIR` (the EAS-linked app folder, default `apps/mobile`), both blocks; `expo`: `EAS_PLATFORM`, `EAS_N`, `EAS_ERR_N`; `expo-workflows`: `EAS_WF_N`, `EAS_WF_ERR_N`.
10
+ - CLI: `eas` (`eas-cli`); each block's same-named provision block installs it in cloud, self-guarded, so copying both installs once. `expo` also uses `node` to decompress logs.
11
+ - Domains: `expo.dev` (both), `googleapis.com` (`expo`), `eascdn.net` (`expo-workflows`); each section carries its own `allowed-domains` block.
12
+ - `expo`: build logs are pre-signed, brotli-encoded storage URLs valid ~15 min; macOS curl has no brotli, so the block decompresses with Node zlib and filters the JSON lines with `jq`.
13
+ - `expo-workflows`: pair with the `maestro` block (`maestro.md`) when a GitHub Actions job starts the run: that block reads the GitHub job log, this one reads EAS.
14
+ - `expo-workflows`: read in this order: per-flow exception (2b), then the XCUITest runner errors (2e) for any `DeviceUnreachableException` — Maestro's iOS driver is an XCUITest case hosting the HTTP server, so one failure inside it fails every later flow. Then the view-hierarchy dump (2d) for any selector or visibility failure: it is the tree Maestro actually searched, and it can contradict a screenshot.
15
+ - `expo-workflows`: artifact URLs are pre-signed and expire in ~1 h; EAS keeps the data 90 days. An expired URL means re-run `workflow:status`, not "artifact gone".
16
+
17
+ Copy the blocks below into `.agents/context.md`, below `<!-- bkit:end -->`. The two sections are independent: copy one or both, each with its provision and `allowed-domains` blocks.
18
+
19
+ ## `context=runtime` — EAS Build status and errored-build logs
20
+
21
+ <!-- context-fetch:start expo context=runtime -->
22
+
23
+ ```bash
24
+ # Expo EAS native build status + errored-build logs (read-only).
25
+ # EXPO_TOKEN is an app/stack cred (it builds and ships the native apps) — app env, not .bkit/.env.
26
+ # Run `eas` from the EAS-linked app folder: from anywhere else it writes a stub app.json there.
27
+ # Customise: EXPO_APP_DIR; EAS_PLATFORM (android|ios|all); EAS_N (<= 50); EAS_ERR_N; the log-line filter.
28
+ EXPO_APP_DIR="${EXPO_APP_DIR:-apps/mobile}"
29
+ command -v eas >/dev/null && [ -n "${EXPO_TOKEN:-}" ] \
30
+ || { echo "[context-fetch:expo] skipped — eas CLI / EXPO_TOKEN missing" >&2; exit 0; }
31
+ grep -qs 'projectId' "$EXPO_APP_DIR"/app.json "$EXPO_APP_DIR"/app.config.* \
32
+ || { echo "[context-fetch:expo] skipped — $EXPO_APP_DIR not EAS-linked (run \`eas init\` there)" >&2; exit 0; }
33
+ cd "$EXPO_APP_DIR" || exit 0
34
+ # 1) Recent build status. --status new|in-queue|in-progress|pending-cancel|errored|finished|canceled.
35
+ eas build:list \
36
+ --platform "${EAS_PLATFORM:-all}" \
37
+ --limit "${EAS_N:-10}" \
38
+ --json --non-interactive \
39
+ | jq -c '.[] | {id, platform, status, createdAt, buildProfile, gitCommitHash, error}' # gitCommitHash stitches to the CI run
40
+ # 2) LOGS for recent failures. No `eas build:logs`; build:view exposes `logFiles`: pre-signed
41
+ # URLs (signature in the query string, no auth header), valid ~900s, BROTLI-encoded JSON lines.
42
+ # An install-dependencies failure (e.g. a private-registry 401) shows here.
43
+ for id in $(eas build:list --status errored --limit "${EAS_ERR_N:-2}" --json --non-interactive | jq -r '.[].id'); do
44
+ echo "===== errored build $id ====="
45
+ eas build:view "$id" --json | jq -r '.logFiles[]?' | while read -r u; do
46
+ curl -sS "$u" \
47
+ | node -e "const z=require('zlib'),c=[];process.stdin.on('data',d=>c.push(d)).on('end',()=>{try{process.stdout.write(z.brotliDecompressSync(Buffer.concat(c)))}catch(e){process.stderr.write('[context-fetch:expo] log not brotli — encoding may have changed\n')}})" \
48
+ | jq -rc 'select(.level>=40 or ((.msg//"") | test("ERR_|✗|error"))) | {phase, msg: (.msg // .err.message)}'
49
+ done
50
+ done
51
+ ```
52
+
53
+ <!-- context-fetch:end -->
54
+
55
+ <!-- context-fetch:provision expo -->
56
+
57
+ ```bash
58
+ # Install eas-cli in cloud if absent (self-guarded; no-op when present).
59
+ command -v eas >/dev/null 2>&1 || pnpm add -g eas-cli
60
+ ```
61
+
62
+ <!-- context-fetch:end -->
63
+
64
+ <!-- allowed-domains:start -->
65
+
66
+ expo.dev
67
+ googleapis.com
68
+
69
+ <!-- allowed-domains:end -->
70
+
71
+ ## `context=e2e` — EAS Workflow runs (Maestro)
72
+
73
+ <!-- context-fetch:start expo-workflows context=e2e -->
74
+
75
+ ```bash
76
+ # EAS WORKFLOW runs — the native e2e (Maestro) lane (read-only). SEPARATE from the expo block:
77
+ # that one covers `eas build`, this one covers `eas workflow:run`.
78
+ # Customise: EXPO_APP_DIR; EAS_WF_N; EAS_WF_ERR_N; which artifacts to inline; the log greps.
79
+ EXPO_APP_DIR="${EXPO_APP_DIR:-apps/mobile}"
80
+ command -v eas >/dev/null && [ -n "${EXPO_TOKEN:-}" ] \
81
+ || { echo "[context-fetch:expo-workflows] skipped — eas CLI / EXPO_TOKEN missing" >&2; exit 0; }
82
+ grep -qs 'projectId' "$EXPO_APP_DIR"/app.json "$EXPO_APP_DIR"/app.config.* \
83
+ || { echo "[context-fetch:expo-workflows] skipped — $EXPO_APP_DIR not EAS-linked (run \`eas init\` there)" >&2; exit 0; }
84
+ cd "$EXPO_APP_DIR" || exit 0
85
+ WORK=$(mktemp -d)
86
+ trap 'rm -rf "$WORK"' EXIT
87
+ # 1) Recent workflow runs, newest first. `workflow:runs` does NOT accept --non-interactive
88
+ # (unlike its sibling commands): passing it errors out with no output, which reads exactly
89
+ # like "no runs found". Its flags are only --json --limit --status --workflow.
90
+ eas workflow:runs --json --limit "${EAS_WF_N:-10}" 2>/dev/null \
91
+ | jq -c '.[]? | {id, status, gitCommitHash, createdAt}'
92
+ # 2) Per-run detail. `workflow:status` is the only command that yields BOTH job ids and artifact URLs.
93
+ for run in $(eas workflow:runs --json --status FAILURE --limit "${EAS_WF_ERR_N:-2}" 2>/dev/null \
94
+ | jq -r '.[]?.id'); do
95
+ echo "===== failed workflow run $run ====="
96
+ STATUS="$WORK/status-$run.json"
97
+ eas workflow:status "$run" --json --non-interactive > "$STATUS" 2>/dev/null || continue
98
+ jq -r '.jobs[]? | "job \(.id) key=\(.key // "?") \(.status)", (.turtleJobRun.errors[]? | " \(.errorCode): \(.message)")' "$STATUS"
99
+ # 2a) Step logs. `workflow:logs` takes the JOB id, not the run id (the run id returns "No
100
+ # workflow job found"). --all-steps is required or it prompts for a step and hangs headless.
101
+ for job in $(jq -r '.jobs[]?.id' "$STATUS"); do
102
+ eas workflow:logs "$job" --all-steps --non-interactive 2>/dev/null | tail -60
103
+ done
104
+ # 2b) THE PER-FLOW EXCEPTION. Neither the GitHub job log nor the EAS job log carries it — both
105
+ # stop at EAS's summary line. `allDeviceTestCaseResults.errorMessage` is the only text
106
+ # source; one POST returns every flow and every retry. Read it before theorising.
107
+ curl -sS https://api.expo.dev/graphql \
108
+ -H "authorization: Bearer $EXPO_TOKEN" -H 'content-type: application/json' \
109
+ -d "{\"query\":\"query{workflowRuns{byId(workflowRunId:\\\"$run\\\"){id status jobs{id key status allDeviceTestCaseResults{name path status errorMessage duration retryCount}}}}}\"}" \
110
+ | jq -r '.data.workflowRuns.byId.jobs[]?.allDeviceTestCaseResults[]? | "----- \(.name) \(.status) attempt=\(.retryCount) \(.duration)ms\n\(.errorMessage // "(no error message)")\n"'
111
+ # 2c) Artifacts: pre-signed (no auth header), PLAIN files (not brotli, unlike build logs).
112
+ # The merged JUnit is the per-flow verdict of record; failure screenshots are often the
113
+ # fastest read — URLs only, open them in an image viewer.
114
+ grep -oE 'https://wf-artifacts[^"]*(junit\.xml|failure-attempt[^"]*\.png)[^"]*' "$STATUS" \
115
+ | while read -r u; do
116
+ case "$u" in
117
+ *junit.xml*) echo "===== JUnit ====="; curl -sS "$u" | tr -d '\r' ;;
118
+ *) echo "===== failure screenshot: $u" ;;
119
+ esac
120
+ done
121
+ # 2d) artifacts.tar.gz: commands.json, screen-hierarchy dumps, per-attempt JUnit, simulator and
122
+ # XCUITest runner logs. Excluding *.logarchive* and *.mov keeps the extraction small; the
123
+ # .logarchive reads back empty with `log show --archive` anyway — use
124
+ # <flow>/logs/device-simulator.log (same system log, plain text).
125
+ TARBALL=$(grep -oE 'https://wf-artifacts[^"]*artifacts\.tar\.gz[^"]*' "$STATUS" | head -1)
126
+ [ -n "$TARBALL" ] || continue
127
+ DEST="$WORK/artifacts-$run"
128
+ mkdir -p "$DEST"
129
+ curl -sS "$TARBALL" \
130
+ | tar -xz -C "$DEST" --exclude='*.logarchive*' --exclude='*.mov' 2>/dev/null || true
131
+ # commands.json: every Maestro step with status, duration and the FULL error.message.
132
+ find "$DEST" -name commands.json 2>/dev/null | while read -r c; do
133
+ echo "===== failing steps: ${c#"$DEST"/} ====="
134
+ jq -r '.[]? | select(.error != null or (.status // "") == "FAILED")
135
+ | " \(.command // .name // "?") [\(.status // "?")] \(.error.message // "")"' "$c" 2>/dev/null
136
+ done
137
+ # View-hierarchy dumps are large: list them with sizes. Named step-NNN-<command>-<selector>.json,
138
+ # so the failing step's dump is identifiable by name — cat that one.
139
+ echo "===== screen-hierarchy dumps (cat the one matching the failing step) ====="
140
+ find "$DEST" -path '*screen-hierarchy*' -name '*.json' -exec ls -lh {} \; 2>/dev/null \
141
+ | awk '{print " " $5 " " $NF}'
142
+ # Per-ATTEMPT JUnit: the merged JUnit above hides a flow that failed and then passed on retry.
143
+ find "$DEST" -path '*junit-reports*' -name '*.xml' 2>/dev/null \
144
+ | while read -r j; do echo "===== $(basename "$j") ====="; tr -d '\r' < "$j"; done
145
+ # 2e) WHY THE DRIVER DIED — read first for any DeviceUnreachableException. An `error:` line in
146
+ # xctest_runner_*.log names the cause; neither job log does. A device-unreachable sweep is a
147
+ # symptom shared by several faults, not a diagnosis.
148
+ echo "===== XCUITest runner: the driver's own failure ====="
149
+ find "$DEST" -name 'xctest_runner_*.log' 2>/dev/null | while read -r r; do
150
+ grep -nE 'error:|TEST EXECUTE FAILED|Test Suite .* failed|failed \(' "$r" | tail -25
151
+ done
152
+ # 2f) THE APP'S OWN JS CONSOLE (React Native). RN logs under the framework's os_log subsystem
153
+ # com.facebook.react.log, category javascript — NOT the app's bundle id, which returns OS
154
+ # install / launch chatter and no JS. console.error persists on every run; console.warn /
155
+ # console.log need a `log config --subsystem com.facebook.react.log` step before the tests,
156
+ # so a low count without it is a closed channel, not a quiet app.
157
+ echo "===== app JS console per flow (count, then the lines) ====="
158
+ find "$DEST" -name device-simulator.log 2>/dev/null | while read -r sl; do
159
+ echo " $(grep -c 'com\.facebook\.react\.log:javascript' "$sl") $sl"
160
+ done
161
+ find "$DEST" -name device-simulator.log 2>/dev/null -exec \
162
+ grep -h 'com\.facebook\.react\.log:javascript' {} \; 2>/dev/null | head -60
163
+ echo "===== distinct app messages ====="
164
+ find "$DEST" -name device-simulator.log 2>/dev/null -exec \
165
+ grep -hoE "\[com\.facebook\.react\.log:javascript\] '[^']+'" {} \; 2>/dev/null \
166
+ | sed "s/.*javascript\] //" | sort | uniq -c | sort -rn | head -40
167
+ done
168
+ ```
169
+
170
+ <!-- context-fetch:end -->
171
+
172
+ <!-- context-fetch:provision expo-workflows -->
173
+
174
+ ```bash
175
+ # Install eas-cli in cloud if absent (self-guarded; no-op when present).
176
+ command -v eas >/dev/null 2>&1 || pnpm add -g eas-cli
177
+ ```
178
+
179
+ <!-- context-fetch:end -->
180
+
181
+ <!-- allowed-domains:start -->
182
+
183
+ expo.dev
184
+ eascdn.net
185
+
186
+ <!-- allowed-domains:end -->
@@ -0,0 +1,79 @@
1
+ <!-- Example. Copy into the repo and own it. -->
2
+ <!-- bkit install does not write this file and does not overwrite a copy. -->
3
+
4
+ # GitHub Actions — failing CI run and diff since the last green run
5
+
6
+ Fits: any repo whose CI runs on GitHub Actions. `context=ci`: the failing run on the current branch — failed jobs and steps, `::error` annotations, failed-step logs (bounded whole-run tail when `--log-failed` returns nothing). `context=diff`: `git diff --stat` from the last commit where your CI workflow passed on trunk to `HEAD`.
7
+
8
+ - Secret: `GH_TOKEN` in cloud (local `gh auth login` works too).
9
+ - Non-secret: `context=ci` none, the block discovers its own run. `context=diff`: `BASELINE_BRANCH` (your trunk, default `dev`) and `BASELINE_WORKFLOW` (your CI workflow file, default `bkit-ci.yml`); edit the defaults in the block so cloud agents inherit them.
10
+ - CLI: `gh` — base tooling, no provision block.
11
+ - Domains: none beyond bkit's derived set (`github.com`).
12
+ - `context=diff` needs the last-passing commit locally: a shallow clone self-skips, naming the SHA.
13
+
14
+ Copy the blocks below into `.agents/context.md`, below `<!-- bkit:end -->`. The blocks are independent: copy one or both.
15
+
16
+ ## `context=ci` — failing CI run
17
+
18
+ <!-- context-fetch:start github context=ci -->
19
+
20
+ ```bash
21
+ # GitHub Actions: failing-run job/step failures + error annotations + failed-step logs.
22
+ # Discovers its own run. `gh` is base tooling — no context-fetch:provision sibling.
23
+ # Customise: run (`--branch`, `--limit`, pin RUN_ID); log slice (`--log-failed` vs `--log`); job/step name filter; annotation grep.
24
+ command -v gh >/dev/null 2>&1 \
25
+ || { echo "[context-fetch:github] skipped — gh CLI not installed" >&2; exit 0; }
26
+ gh auth status >/dev/null 2>&1 \
27
+ || { echo "[context-fetch:github] skipped — gh not authenticated (set GH_TOKEN)" >&2; exit 0; }
28
+ RUN_JSON=$(gh run list --branch "$(git branch --show-current)" --limit 1 \
29
+ --json databaseId,conclusion,headSha 2>/dev/null || echo '[]')
30
+ RUN_ID=$(printf '%s' "$RUN_JSON" | jq -r '.[0].databaseId // ""')
31
+ RUN_SHA=$(printf '%s' "$RUN_JSON" | jq -r '.[0].headSha // ""')
32
+ RUN_CONCLUSION=$(printf '%s' "$RUN_JSON" | jq -r '.[0].conclusion // ""')
33
+ [ -n "$RUN_ID" ] \
34
+ || { echo "[context-fetch:github] skipped — no CI run found for this branch" >&2; exit 0; }
35
+ [ "$RUN_CONCLUSION" != "success" ] \
36
+ || { echo "[context-fetch:github] skipped — run $RUN_ID concluded success (nothing failing to fetch)" >&2; exit 0; }
37
+ FAILED_STEPS=$(gh run view "$RUN_ID" --json conclusion,jobs \
38
+ --jq '[.jobs[] | select(.conclusion=="failure") | {job: .name, steps: [.steps[] | select(.conclusion=="failure") | .name]}]' 2>/dev/null)
39
+ CI_LOGS=$(gh run view "$RUN_ID" --log-failed 2>/dev/null)
40
+ # Whole-run fallback is tens of MB — bound it. Raise CI_LOG_TAIL if the cause sits higher.
41
+ CI_LOG_TAIL=2000
42
+ [ -z "$CI_LOGS" ] && CI_LOGS=$(gh run view "$RUN_ID" --log 2>/dev/null | tail -n "$CI_LOG_TAIL")
43
+ [ -n "$CI_LOGS" ] \
44
+ || { echo "[context-fetch:github] skipped — no logs returned for run $RUN_ID" >&2; exit 0; }
45
+ ERR_SUBSET=$(printf '%s' "$CI_LOGS" | grep -E '##\[error\]|::error' 2>/dev/null)
46
+ printf '===== run %s (headSha %s, conclusion %s) =====\n\n' "$RUN_ID" "${RUN_SHA:-unknown}" "$RUN_CONCLUSION"
47
+ printf '===== failed jobs/steps =====\n%s\n\n' "${FAILED_STEPS:-[]}"
48
+ [ -n "$ERR_SUBSET" ] && printf '===== error annotations =====\n%s\n\n' "$ERR_SUBSET"
49
+ printf '===== failed-step logs =====\n%s\n' "$CI_LOGS"
50
+ ```
51
+
52
+ <!-- context-fetch:end -->
53
+
54
+ ## `context=diff` — diff since the last green run on trunk
55
+
56
+ <!-- context-fetch:start github context=diff -->
57
+
58
+ ```bash
59
+ # GitHub Actions: diff HEAD vs last-passing CI on trunk.
60
+ # Set BASELINE_BRANCH / BASELINE_WORKFLOW to YOUR trunk and workflow file; commit them here.
61
+ # Customise: BASELINE_BRANCH / BASELINE_WORKFLOW; last-passing `--limit`; `git diff` pathspec / `--stat` vs full patch.
62
+ BASELINE_BRANCH="${BASELINE_BRANCH:-dev}"
63
+ BASELINE_WORKFLOW="${BASELINE_WORKFLOW:-bkit-ci.yml}"
64
+ command -v gh >/dev/null 2>&1 \
65
+ || { echo "[context-fetch:github] skipped — gh CLI not installed" >&2; exit 0; }
66
+ LAST_PASS_SHA=$(gh run list --branch "$BASELINE_BRANCH" --workflow "$BASELINE_WORKFLOW" \
67
+ --status success --limit 5 --json headSha --jq '.[0].headSha // ""' 2>/dev/null)
68
+ [ -n "$LAST_PASS_SHA" ] \
69
+ || { echo "[context-fetch:github] skipped — no successful $BASELINE_WORKFLOW run on $BASELINE_BRANCH (check both names)" >&2; exit 0; }
70
+ git cat-file -e "${LAST_PASS_SHA}^{commit}" 2>/dev/null \
71
+ || { echo "[context-fetch:github] skipped — last-passing SHA $LAST_PASS_SHA not present locally (shallow clone?)" >&2; exit 0; }
72
+ DIFF_STAT=$(git diff "$LAST_PASS_SHA..HEAD" --stat 2>/dev/null)
73
+ [ -n "$DIFF_STAT" ] \
74
+ || { echo "[context-fetch:github] skipped — no diff between HEAD and last-passing $LAST_PASS_SHA" >&2; exit 0; }
75
+ printf '===== diff vs last-passing CI on %s (last-passing-sha: %s) =====\n\n%s\n' \
76
+ "$BASELINE_BRANCH" "$LAST_PASS_SHA" "$DIFF_STAT"
77
+ ```
78
+
79
+ <!-- context-fetch:end -->
@@ -0,0 +1,45 @@
1
+ <!-- Example. Copy into the repo and own it. -->
2
+ <!-- bkit install does not write this file and does not overwrite a copy. -->
3
+
4
+ # Inngest — failed function runs
5
+
6
+ Fits: apps running durable functions on Inngest Cloud. `context=runtime`: recent `inngest/function.failed` system events — function id, run id, error message, and the opaque `*Id` keys of the triggering event.
7
+
8
+ - Secret: `INNGEST_SIGNING_KEY` — reuse the app's existing key. It is environment-scoped (branch environments and production have separate keys): use the key whose runs you want.
9
+ - Non-secret: `INNGEST_N` (events, default 25).
10
+ - CLI: none (`curl` + `jq`), no provision block.
11
+ - PII: the projection keeps only keys ending in `Id` from the triggering event's data. Keep free text and personal data out of `*Id` keys in your event payloads, or narrow the projection.
12
+
13
+ Copy the blocks below into `.agents/context.md`, below `<!-- bkit:end -->`.
14
+
15
+ <!-- context-fetch:start inngest context=runtime -->
16
+
17
+ ```bash
18
+ # Inngest Cloud — failed durable-function runs, exhausted retries (read-only).
19
+ # INNGEST_SIGNING_KEY is ENV-SCOPED (branch env vs production) — use the key for the env whose
20
+ # runs you want. Lists recent `inngest/function.failed` system events → function_id + run_id + error.
21
+ # PII-safe: surfaces ONLY /Id$/ keys from the triggering event; every other key is dropped.
22
+ # Customise: INNGEST_N; the ids projection (narrow it if any *Id key in your events carries PII).
23
+ [ -n "${INNGEST_SIGNING_KEY:-}" ] \
24
+ || { echo "[context-fetch:inngest] skipped — INNGEST_SIGNING_KEY unset" >&2; exit 0; }
25
+ curl -s "https://api.inngest.com/v1/events?name=inngest/function.failed&limit=${INNGEST_N:-25}" \
26
+ -H "Authorization: Bearer ${INNGEST_SIGNING_KEY}" \
27
+ | jq '[.data[]
28
+ | {id, ts, function_id: .data.function_id, run_id: .data.run_id,
29
+ error: (.data.error.message // .data.error),
30
+ ids: (.data.event.data // {} | with_entries(select(.key | test("Id$"))))}]'
31
+ ```
32
+
33
+ <!-- context-fetch:end -->
34
+
35
+ <!-- allowed-domains:start -->
36
+
37
+ inngest.com
38
+
39
+ <!-- allowed-domains:end -->
40
+
41
+ <!-- mcp-servers:start -->
42
+
43
+ inngest
44
+
45
+ <!-- mcp-servers:end -->
@@ -0,0 +1,76 @@
1
+ <!-- Example. Copy into the repo and own it. -->
2
+ <!-- bkit install does not write this file and does not overwrite a copy. -->
3
+
4
+ # Maestro e2e lanes on GitHub Actions — job logs
5
+
6
+ Fits: native e2e lanes (iOS, Android, or both) whose GitHub Actions jobs run Maestro, on the runner or by handing the run to Expo EAS, and upload no GitHub artifact. `context=e2e`: the full log of every failed Maestro job in the run, sliced to the steps that carry the per-flow result, else each log's tail.
7
+
8
+ - Reads the per-flow result from steps that succeed inside the failed job, which `gh run view --log-failed` (the `context=ci` block) skips; the Playwright block's artifact download finds nothing on these lanes.
9
+ - Secret: `GH_TOKEN` in cloud (local `gh auth login` works too).
10
+ - Non-secret: `MAESTRO_JOB_RE` (anchored regex matching your Maestro lanes' job names, e.g. `^e2e-(ios|android)$`), `MAESTRO_STEPS` (`|`-separated step names that print the result), `MAESTRO_LOG_TAIL`. Edit the defaults in the block.
11
+ - CLI: `gh` — base tooling, no provision block.
12
+ - Domains: none beyond bkit's derived set (`github.com`).
13
+ - Lanes on EAS: screenshots, JUnit and view-hierarchy dumps live on EAS, not in this log; the `expo-workflows` block in `expo.md` fetches them.
14
+
15
+ Copy the block below into `.agents/context.md`, below `<!-- bkit:end -->`.
16
+
17
+ <!-- context-fetch:start maestro context=e2e -->
18
+
19
+ ```bash
20
+ # Maestro e2e (iOS and/or Android): every failed job matching MAESTRO_JOB_RE, one section per job.
21
+ # MAESTRO_JOB_RE matches Maestro lanes only; another lane's job matched here is printed as Maestro evidence.
22
+ # The placeholder matches NO job, so every run self-skips until you edit it.
23
+ # iOS: Maestro's driver is an XCUITest case hosting the HTTP server Maestro talks to, so one
24
+ # failure inside it ends the suite and turns every later flow into DeviceUnreachableException;
25
+ # read the per-flow table before the traces.
26
+ # Customise: MAESTRO_JOB_RE; MAESTRO_STEPS (the steps that print per-flow results); MAESTRO_LOG_TAIL.
27
+ MAESTRO_JOB_RE="${MAESTRO_JOB_RE:-^your-maestro-e2e-job-name$}"
28
+ MAESTRO_STEPS="${MAESTRO_STEPS:-Your per-flow results step|Your failure classification step}"
29
+ MAESTRO_LOG_TAIL="${MAESTRO_LOG_TAIL:-800}"
30
+ command -v gh >/dev/null 2>&1 \
31
+ || { echo "[context-fetch:maestro] skipped — gh CLI not installed" >&2; exit 0; }
32
+ RUN_ID=$(gh run list --branch "$(git branch --show-current)" --limit 1 \
33
+ --json databaseId,conclusion --jq 'if (.[0].conclusion // "") == "success" then "" else (.[0].databaseId // "" | tostring) end' 2>/dev/null)
34
+ [ -n "$RUN_ID" ] \
35
+ || { echo "[context-fetch:maestro] skipped — no failing CI run found for this branch" >&2; exit 0; }
36
+ # `gh --jq` takes no `--arg`, so the regex goes through real jq.
37
+ JOBS=$(gh run view "$RUN_ID" --json jobs 2>/dev/null \
38
+ | jq -r --arg re "$MAESTRO_JOB_RE" '.jobs[] | select(.name | test($re)) | select(.conclusion=="failure") | "\(.databaseId)\t\(.name)"' 2>/dev/null)
39
+ [ -n "$JOBS" ] \
40
+ || { echo "[context-fetch:maestro] skipped — no failed job matching /$MAESTRO_JOB_RE/ in run $RUN_ID" >&2; exit 0; }
41
+ JOB_LOG=$(mktemp)
42
+ trap 'rm -f "$JOB_LOG"' EXIT
43
+ PRINTED=0
44
+ TAB=$(printf '\t')
45
+ while IFS="$TAB" read -r JOB_ID JOB_NAME; do
46
+ gh run view "$RUN_ID" --job "$JOB_ID" --log > "$JOB_LOG" 2>/dev/null
47
+ if [ ! -s "$JOB_LOG" ]; then
48
+ echo "[context-fetch:maestro] job $JOB_NAME ($JOB_ID) returned no log (expired retention?)" >&2
49
+ continue
50
+ fi
51
+ PRINTED=1
52
+ printf '===== Maestro job %s (run %s, job %s) =====\n' "$JOB_NAME" "$RUN_ID" "$JOB_ID"
53
+ # Step names match as fixed strings against the step-name column gh prints; no match falls
54
+ # through to the whole-log tail.
55
+ FOUND=0
56
+ OLD_IFS=$IFS; IFS='|'
57
+ for STEP in $MAESTRO_STEPS; do
58
+ SLICE=$(grep -F "$STEP" "$JOB_LOG" 2>/dev/null)
59
+ [ -n "$SLICE" ] || continue
60
+ FOUND=1
61
+ printf '\n===== step: %s =====\n%s\n' "$STEP" "$SLICE"
62
+ done
63
+ IFS=$OLD_IFS
64
+ if [ "$FOUND" = "0" ]; then
65
+ printf '\n===== step slicing matched nothing — last %s lines of the whole job log =====\n' "$MAESTRO_LOG_TAIL"
66
+ tail -n "$MAESTRO_LOG_TAIL" "$JOB_LOG"
67
+ fi
68
+ printf '\n'
69
+ done <<EOF_JOBS
70
+ $JOBS
71
+ EOF_JOBS
72
+ [ "$PRINTED" = "1" ] \
73
+ || { echo "[context-fetch:maestro] skipped — no matching job in run $RUN_ID returned a log" >&2; exit 0; }
74
+ ```
75
+
76
+ <!-- context-fetch:end -->
@@ -0,0 +1,62 @@
1
+ <!-- Example. Copy into the repo and own it. -->
2
+ <!-- bkit install does not write this file and does not overwrite a copy. -->
3
+
4
+ # Playwright on GitHub Actions — e2e report
5
+
6
+ Fits: a web e2e lane that runs Playwright on GitHub Actions and uploads its report with `actions/upload-artifact`. `context=e2e`: downloads the failing run's report artifact and inlines its text files, failing specs first; lists screenshots, videos and traces by path.
7
+
8
+ - Secret: `GH_TOKEN` in cloud (local `gh auth login` works too).
9
+ - Non-secret: `E2E_ARTIFACT` (your upload-artifact name, default `playwright-report`) and `E2E_JOB_RE` (anchored regex for this lane's job name). Edit the defaults in the block.
10
+ - CLI: `gh` — base tooling, no provision block.
11
+ - Domains: none beyond bkit's derived set (`github.com`).
12
+ - One block per lane. A lane whose evidence does not reach GitHub (a native lane on Expo EAS) needs its own block: see `maestro.md` and the `expo-workflows` block in `expo.md`.
13
+
14
+ Copy the block below into `.agents/context.md`, below `<!-- bkit:end -->`.
15
+
16
+ <!-- context-fetch:start playwright context=e2e -->
17
+
18
+ ```bash
19
+ # Playwright on GitHub Actions: inline text files from the failing run's report artifact.
20
+ # Discovers its own run. E2E_ARTIFACT = YOUR `actions/upload-artifact` name. One block per lane; fetch from where that lane's evidence lives.
21
+ # E2E_JOB_RE ships as a placeholder that matches NO job — anchor it to this lane's exact job
22
+ # name before enabling. A loose pattern also matches sibling e2e lanes, and this block then
23
+ # downloads THIS lane's artifact and files it as that lane's evidence; wrong evidence sends
24
+ # diagnosis after the wrong failure, which is worse than the `NOT CONFIGURED` you get from
25
+ # leaving the placeholder in. Until it is edited every run self-skips, naming the placeholder.
26
+ # Customise: E2E_ARTIFACT; E2E_JOB_RE (anchored, this lane only); run selection; which report files to inline vs list as binary.
27
+ E2E_ARTIFACT="${E2E_ARTIFACT:-playwright-report}"
28
+ E2E_JOB_RE="${E2E_JOB_RE:-^your-e2e-job-name$}"
29
+ command -v gh >/dev/null 2>&1 \
30
+ || { echo "[context-fetch:playwright] skipped — gh CLI not installed" >&2; exit 0; }
31
+ RUN_ID=$(gh run list --branch "$(git branch --show-current)" --limit 1 \
32
+ --json databaseId,conclusion --jq 'if (.[0].conclusion // "") == "success" then "" else (.[0].databaseId // "" | tostring) end' 2>/dev/null)
33
+ [ -n "$RUN_ID" ] \
34
+ || { echo "[context-fetch:playwright] skipped — no failing CI run found for this branch" >&2; exit 0; }
35
+ # Pipe to REAL jq: `gh --jq` takes one expression and no `--arg`, so the `--jq --arg re "$X" '...'`
36
+ # form fails with `accepts at most 1 arg(s), received 4` — and under 2>/dev/null the empty result
37
+ # is indistinguishable from "this lane passed", so a failed lane self-skips in silence.
38
+ E2E_FAILED=$(gh run view "$RUN_ID" --json jobs 2>/dev/null \
39
+ | jq --arg re "$E2E_JOB_RE" '[.jobs[] | select(.name | test($re; "i")) | select(.conclusion=="failure")] | length' 2>/dev/null || echo 0)
40
+ [ "${E2E_FAILED:-0}" -gt 0 ] \
41
+ || { echo "[context-fetch:playwright] skipped — no failed job matching /$E2E_JOB_RE/i in run $RUN_ID" >&2; exit 0; }
42
+ DEST=$(mktemp -d)
43
+ trap 'rm -rf "$DEST"' EXIT
44
+ gh run download "$RUN_ID" -n "$E2E_ARTIFACT" -D "$DEST" 2>/dev/null \
45
+ || { echo "[context-fetch:playwright] skipped — run $RUN_ID published no '$E2E_ARTIFACT' artifact; its e2e evidence is NOT in GitHub" >&2; exit 0; }
46
+ # Failing specs first (`test-results/` holds only failures), then the rest. Bound both counts.
47
+ E2E_MAX_FILES=20; E2E_MAX_LINES=300
48
+ e2e_list() { find "$1" -type f \( -name '*.md' -o -name '*.json' -o -name '*.txt' -o -name '*.log' -o -name '*.xml' \) 2>/dev/null | sort; }
49
+ E2E_FILES=$({ e2e_list "$DEST/test-results"; e2e_list "$DEST"; } | awk '!seen[$0]++')
50
+ E2E_TOTAL=$(printf '%s' "$E2E_FILES" | grep -c . || true)
51
+ printf '===== playwright report (run %s, artifact %s) =====\n' "$RUN_ID" "$E2E_ARTIFACT"
52
+ printf '%s\n' "$E2E_FILES" | head -n "$E2E_MAX_FILES" | while read -r f; do
53
+ [ -n "$f" ] || continue
54
+ printf '\n===== file: %s (first %s lines) =====\n' "${f#"$DEST"/}" "$E2E_MAX_LINES"
55
+ head -n "$E2E_MAX_LINES" "$f"
56
+ done
57
+ [ "$E2E_TOTAL" -gt "$E2E_MAX_FILES" ] && printf '\n===== inlined %s of %s files; the rest were NOT read =====\n' "$E2E_MAX_FILES" "$E2E_TOTAL"
58
+ printf '\n===== binary artifacts (not inlined) =====\n'
59
+ find "$DEST" -type f \( -name '*.html' -o -name '*.png' -o -name '*.webm' -o -name '*.zip' \) | sed "s|^$DEST/||" | sort
60
+ ```
61
+
62
+ <!-- context-fetch:end -->