ShtukbaseStandard
包页面→ /runs.md

pages/runs.md

76 行, 3.1 KB. 以页面形式查看.

  1. ---
  2. type: Collection
  3. title: "运行"
  4. icon: "🏃"
  5. description: "运行日志:运行了什么,谁或什么唤醒了它,何时开始与结束,如何结束,以及什么证实了它。"
  6. itemType: Run
  7. items: {mode: path, path: /runs, recursive: false}
  8. writeTo: /runs
  9. staleAfterHours: 24
  10. properties:
  11. status: {kind: phase, contour: /runs/contours/runs, label: "状态"}
  12. action: {kind: relation, collection: /actions, label: "动作"}
  13. automation: {kind: relation, collection: /automations, label: "自动化"}
  14. agent: {kind: relation, collection: /agents, label: "智能体"}
  15. about: {kind: text, label: "关于什么(记录、任务)"}
  16. woke: {kind: text, label: "谁唤醒了它(人工、时钟、变更……)"}
  17. started: {kind: text, label: "开始(ISO)"}
  18. ended: {kind: text, label: "结束(ISO)"}
  19. ending: {kind: text, label: "结束方式(完成、拒绝、停止……)"}
  20. evidence: {kind: text, label: "由以下证实(提交、路径、链接)"}
  21. message: {kind: text, label: "失败的原因"}
  22. wrote: {kind: number, label: "改动了多少页面"}
  23. retryOf: {kind: text, label: "重试的运行"}
  24. views:
  25. - id: runs--table
  26. name: "全部运行"
  27. layout: table
  28. fields: {}
  29. sorting:
  30. - {propertyId: started, direction: descending}
  31. properties:
  32. - {name: title, visible: true, width: 320}
  33. - {name: status, visible: true}
  34. - {name: action, visible: true}
  35. - {name: automation, visible: true}
  36. - {name: started, visible: true}
  37. - {name: evidence, visible: true}
  38. - id: runs--board
  39. name: "按状态"
  40. layout: board
  41. fields: {}
  42. board:
  43. preview: page-content
  44. cardSize: small
  45. wrap: true
  46. grouping:
  47. by: status
  48. colorBy: status
  49. properties:
  50. - {name: title, visible: true}
  51. - {name: started, visible: true}
  52. ---
  53. 一次运行即一个页面。它在运行开始时写入,在结束时补全一次。它由发起运行的一方写入:智能体、脚本、自动化,或 Shtukbase 节点(节点会自行写入这类页面)。
  54. 运行的页眉:
  55. ```yaml
  56. type: Run
  57. title: "夜间检查"
  58. action: /actions/nightly-check # 运行的内容(或自动化,或智能体)
  59. automation: /automations/nightly # 若为自动化,由谁唤醒
  60. woke: clock # hand, clock, change, phase, sensor ...
  61. started: 2026-11-28T03:00:00Z
  62. status: done # running, waiting, done, failed, cancelled
  63. ended: 2026-11-28T03:04:12Z
  64. evidence: ["commit 1a2b3c4", /work/tasks/t-12.md]
  65. ```
  66. 已完成的运行须附有证明:提交、文件路径、链接或输出行。失败和取消的运行,在 `message` 中写明理由。状态见[运行流程轮廓](/runs/contours/runs.md)。
  67. 记录一次运行:`shtuk run runs start --title "..." --action /actions/<name>`(输出页面地址),然后 `shtuk run runs finish <地址> --status done --evidence "..."`。
  68. 本页页眉中的 `staleAfterHours` 是一个小时数:处于“运行中”状态的运行,超过这个时数后即视为挂起。
  69. 规范:[RUN-R01](/norms/rules/runs/RUN-R01.md) 规定运行须被完整记录;[RUN-R02](/norms/rules/runs/RUN-R02.md) 规定运行的结束须有说明。