@venizia/vulcan 0.4.10-2 → 0.4.10-21

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 (208) hide show
  1. package/README.md +30 -23
  2. package/base/checks/wiki-source-links.ts +17 -1
  3. package/base/claude/events.json +1 -11
  4. package/base/claude/settings.json +5 -76
  5. package/base/extensions/vulcan-guards.ts +81 -18
  6. package/base/hooks/guard-git.ts +95 -19
  7. package/base/hooks/guard-outside.ts +163 -43
  8. package/base/hooks/guard-writes.ts +15 -36
  9. package/base/hooks/session-start.ts +1 -1
  10. package/base/make/vulcan.mk +8 -5
  11. package/base/packs/venizia.md +16 -0
  12. package/base/references/delegation-brief.md +3 -5
  13. package/base/references/testing.md +1 -9
  14. package/base/rules.md +33 -38
  15. package/base/skills/build-a-feature/SKILL.md +4 -4
  16. package/base/skills/docs-update/SKILL.md +19 -8
  17. package/base/skills/fix-a-bug/SKILL.md +4 -2
  18. package/base/skills/plan-a-change/SKILL.md +1 -1
  19. package/base/skills/research/SKILL.md +1 -1
  20. package/base/skills/retro/SKILL.md +2 -2
  21. package/base/skills/review-a-change/SKILL.md +1 -1
  22. package/base/skills/visualize-work/SKILL.md +3 -3
  23. package/base/skills/visualize-work/references/spec.md +6 -3
  24. package/base/templates/AGENTS.md +9 -7
  25. package/base/templates/board.html +10 -110
  26. package/package.json +3 -3
  27. package/src/agents/atlas-block.ts +8 -31
  28. package/src/agents/codex-hooks.ts +1 -1
  29. package/src/agents/generated-block.ts +52 -0
  30. package/src/agents/hooks-json.ts +22 -3
  31. package/src/agents/index.ts +2 -0
  32. package/src/agents/render.ts +15 -2
  33. package/src/agents/resolve.ts +1 -0
  34. package/src/agents/rules-block.ts +92 -0
  35. package/src/board/command.ts +92 -30
  36. package/src/board/common/constants.ts +26 -0
  37. package/src/board/common/types.ts +10 -3
  38. package/src/board/fold.ts +1 -1
  39. package/src/board/github.ts +1 -2
  40. package/src/board/gitlab.ts +436 -0
  41. package/src/board/index.ts +1 -0
  42. package/src/board/logo.ts +49 -0
  43. package/src/board/open-file.ts +110 -0
  44. package/src/board/page.ts +57 -5
  45. package/src/board/schema.ts +4 -1
  46. package/src/board/server.ts +87 -3
  47. package/src/board/settings.ts +21 -24
  48. package/src/commands/changelog.command.ts +40 -0
  49. package/src/commands/clean.command.ts +6 -1
  50. package/src/commands/help.command.ts +2 -63
  51. package/src/commands/index.ts +6 -1
  52. package/src/commands/migrate.command.ts +71 -0
  53. package/src/commands/profile.command.ts +1 -1
  54. package/src/commands/runners.command.ts +43 -0
  55. package/src/commands/sync.command.ts +8 -4
  56. package/src/commands/table.ts +362 -0
  57. package/src/commit/check.ts +1 -0
  58. package/src/commit/common/constants.ts +4 -0
  59. package/src/commit/hook.ts +112 -8
  60. package/src/common/constants.ts +11 -9
  61. package/src/common/env-variables.ts +41 -0
  62. package/src/common/index.ts +1 -0
  63. package/src/common/layout-folder.ts +3 -4
  64. package/src/common/record.ts +5 -0
  65. package/src/config/common/constants.ts +28 -22
  66. package/src/config/loader.ts +22 -0
  67. package/src/config/schema.ts +330 -146
  68. package/src/create/add-app.ts +7 -2
  69. package/src/create/add-lib.ts +2 -4
  70. package/src/create/common/constants.ts +5 -3
  71. package/src/create/preset.ts +1 -0
  72. package/src/create/scratch.ts +2 -1
  73. package/src/doctor/checks.ts +277 -448
  74. package/src/doctor/common/constants.ts +27 -19
  75. package/src/doctor/private-values.ts +4 -1
  76. package/src/doctor/runner.ts +5 -12
  77. package/src/doctor/schema.ts +4 -0
  78. package/src/events/common/actor-names.ts +12 -0
  79. package/src/events/common/constants.ts +65 -38
  80. package/src/events/common/index.ts +1 -0
  81. package/src/events/hook.ts +5 -56
  82. package/src/events/text.ts +41 -6
  83. package/src/hooks/command-view.ts +80 -19
  84. package/src/hooks/common/constants.ts +26 -17
  85. package/src/hooks/common/types.ts +13 -24
  86. package/src/hooks/decision.ts +30 -12
  87. package/src/hooks/git-queries.ts +113 -0
  88. package/src/hooks/guard-git.ts +76 -24
  89. package/src/hooks/guard-outside.ts +334 -311
  90. package/src/hooks/guard-runner.ts +206 -0
  91. package/src/hooks/guard-writes.ts +87 -184
  92. package/src/hooks/hook-input.ts +57 -0
  93. package/src/hooks/index.ts +3 -6
  94. package/src/hooks/link-makers.ts +315 -0
  95. package/src/hooks/package-runners.ts +268 -0
  96. package/src/hooks/project-guards.ts +81 -44
  97. package/src/hooks/project-tmp.ts +39 -4
  98. package/src/hooks/runner-scan.ts +257 -0
  99. package/src/hooks/script-runners.ts +400 -0
  100. package/src/hooks/session-digest.ts +27 -117
  101. package/src/hooks/shell-folders.ts +760 -0
  102. package/src/hooks/shell-writes.ts +646 -0
  103. package/src/hooks/shell.ts +1421 -194
  104. package/src/hooks/subagent-card.ts +2 -2
  105. package/src/hooks/write-commands.ts +898 -0
  106. package/src/init/scaffold.ts +2 -3
  107. package/src/local/auto-clean.ts +2 -1
  108. package/src/local/browser-socket.ts +33 -0
  109. package/src/local/clean.ts +37 -6
  110. package/src/local/constants.ts +15 -1
  111. package/src/local/index.ts +1 -0
  112. package/src/local/scan.ts +41 -10
  113. package/src/manifest/render.ts +84 -30
  114. package/src/owner/constants.ts +4 -5
  115. package/src/owner/index.ts +0 -2
  116. package/src/owner/profile.ts +1 -0
  117. package/src/owner/schema.ts +51 -27
  118. package/src/owner/survey.ts +0 -3
  119. package/src/owner/view.ts +0 -9
  120. package/src/router.ts +8 -132
  121. package/src/rules/base.ts +12 -7
  122. package/src/rules/index.ts +1 -0
  123. package/src/rules/packs.ts +44 -0
  124. package/src/runners/check.ts +130 -0
  125. package/src/skills/frontmatter.ts +1 -0
  126. package/src/sync/agents-block.ts +104 -0
  127. package/src/sync/base-rules.ts +3 -3
  128. package/src/sync/claude-launch.ts +12 -12
  129. package/src/sync/common/constants.ts +0 -2
  130. package/src/sync/index.ts +1 -1
  131. package/src/sync/local-choice.ts +32 -3
  132. package/src/sync/planner.ts +2 -15
  133. package/src/sync/settings.ts +0 -17
  134. package/src/theme/index.ts +1 -0
  135. package/src/theme/tokens.ts +410 -0
  136. package/src/ui/prompt.ts +1 -0
  137. package/src/visualize/architecture.ts +504 -0
  138. package/src/visualize/assets.ts +41 -30
  139. package/src/visualize/compare-render.ts +22 -24
  140. package/src/visualize/constants.ts +27 -0
  141. package/src/visualize/diagrams.ts +13 -121
  142. package/src/visualize/kinds-render.ts +2 -2
  143. package/src/visualize/kinds-schema.ts +49 -0
  144. package/src/visualize/labels-vi.ts +25 -0
  145. package/src/visualize/labels.ts +2 -0
  146. package/src/visualize/layout.ts +415 -66
  147. package/src/visualize/page.ts +82 -15
  148. package/src/visualize/render.ts +2 -1
  149. package/src/visualize/schema.ts +29 -1
  150. package/src/visualize/sections.ts +78 -9
  151. package/src/visualize/theme.ts +49 -18
  152. package/src/wiki/anchors.ts +1 -0
  153. package/src/wiki/command.ts +10 -3
  154. package/src/wiki/source-links.ts +57 -18
  155. package/base/ci-global.json +0 -13
  156. package/base/claude/remote-hosts.json +0 -15
  157. package/base/hooks/guard-manifest.ts +0 -27
  158. package/base/hooks/guard-package.ts +0 -30
  159. package/base/hooks/guard-remote-hosts.ts +0 -70
  160. package/base/hooks/guard-scripting.ts +0 -32
  161. package/base/hooks/post-tool.ts +0 -37
  162. package/base/hooks/prompt-submit.ts +0 -54
  163. package/base/hooks/stop.ts +0 -40
  164. package/base/skills/build-a-feature/evals/evals.json +0 -29
  165. package/base/skills/docs-update/evals/evals.json +0 -23
  166. package/base/skills/docs-writing/evals/evals.json +0 -17
  167. package/base/skills/fix-a-bug/evals/evals.json +0 -17
  168. package/base/skills/knowledge-sync/SKILL.md +0 -81
  169. package/base/skills/knowledge-sync/knowledge-sync.workflow.js +0 -291
  170. package/base/skills/knowledge-sync/references/workflow.md +0 -44
  171. package/base/skills/plan-a-change/evals/evals.json +0 -47
  172. package/base/skills/report-back/evals/evals.json +0 -23
  173. package/base/skills/research/evals/evals.json +0 -17
  174. package/base/skills/retro/evals/evals.json +0 -17
  175. package/base/skills/review-a-change/evals/evals.json +0 -17
  176. package/base/skills/ship/evals/evals.json +0 -23
  177. package/base/skills/visualize-work/evals/evals.json +0 -17
  178. package/base/templates/ci/github-actions.yml +0 -75
  179. package/base/templates/ci/gitlab-ci.yml +0 -52
  180. package/base/templates/trusted-hosts.local.example +0 -11
  181. package/src/ci/affected.ts +0 -176
  182. package/src/ci/command.ts +0 -166
  183. package/src/ci/common/constants.ts +0 -76
  184. package/src/ci/common/index.ts +0 -2
  185. package/src/ci/common/types.ts +0 -37
  186. package/src/ci/git.ts +0 -72
  187. package/src/ci/global.ts +0 -48
  188. package/src/ci/graph.ts +0 -43
  189. package/src/ci/index.ts +0 -7
  190. package/src/ci/workspace.ts +0 -119
  191. package/src/commands/ci.command.ts +0 -4
  192. package/src/hooks/guard-manifest.ts +0 -109
  193. package/src/hooks/guard-package.ts +0 -226
  194. package/src/hooks/guard-scripting.ts +0 -36
  195. package/src/hooks/host-pattern.ts +0 -17
  196. package/src/hooks/owner-reply.ts +0 -162
  197. package/src/hooks/post-tool.ts +0 -138
  198. package/src/hooks/remote-hosts.ts +0 -1013
  199. package/src/hooks/trusted-scripts.ts +0 -212
  200. package/src/owner/shape.ts +0 -496
  201. package/src/owner/violations.ts +0 -332
  202. package/src/signals/claims.ts +0 -73
  203. package/src/signals/classify.ts +0 -137
  204. package/src/signals/constants.ts +0 -88
  205. package/src/signals/index.ts +0 -5
  206. package/src/signals/loop.ts +0 -48
  207. package/src/signals/state.ts +0 -271
  208. package/src/sync/atlas-block.ts +0 -56
@@ -1,138 +0,0 @@
1
- import {
2
- EntryKinds,
3
- SignalClassifier,
4
- SignalConstants,
5
- SignalLoop,
6
- SignalState,
7
- WatchedKinds,
8
- } from '../signals/index.ts';
9
- import type { ISignalState } from '../signals/index.ts';
10
-
11
- const FILE_TOOLS = new Set(['Write', 'Edit', 'MultiEdit', 'NotebookEdit']);
12
- const FAILURE_EVENT = 'PostToolUseFailure';
13
-
14
- const recordOf = (opts: { value: unknown }): Record<string, unknown> =>
15
- typeof opts.value === 'object' && opts.value !== null && !Array.isArray(opts.value)
16
- ? Object.fromEntries(Object.entries(opts.value))
17
- : {};
18
-
19
- const stringOf = (opts: { value: unknown }): string =>
20
- typeof opts.value === 'string' ? opts.value : '';
21
-
22
- /** Whether the tool reported a failure in its own result: an exit code, an error flag, an interruption. */
23
- const reportsFailure = (opts: { response: Record<string, unknown> }): boolean => {
24
- const { response } = opts;
25
- const code = response['exitCode'] ?? response['exit_code'];
26
-
27
- return (
28
- (typeof code === 'number' && code !== 0) ||
29
- response['is_error'] === true ||
30
- response['isError'] === true ||
31
- response['interrupted'] === true
32
- );
33
- };
34
-
35
- export class PostToolOutput {
36
- /**
37
- * What the model is told after a tool call, and the line it adds to the turn's notes: whether the turn
38
- * asked public state, which gate commands ran and passed or failed, the calls themselves, so a loop shows.
39
- * It speaks only to say that the agent seems stuck, or that a skill or rules file was just changed; it
40
- * never blocks. Notes are kept per session, and a loop per agent. Input it cannot read gives no answer.
41
- */
42
- static build(opts: {
43
- projectRoot: string;
44
- input: unknown;
45
- now?: number;
46
- }): Record<string, unknown> | undefined {
47
- const input = recordOf({ value: opts.input });
48
- const tool = stringOf({ value: input['tool_name'] });
49
-
50
- if (tool === '') {
51
- return undefined;
52
- }
53
-
54
- const now = opts.now ?? Date.now();
55
- const session = stringOf({ value: input['session_id'] });
56
- const agent = stringOf({ value: input['agent_id'] });
57
- const toolInput = recordOf({ value: input['tool_input'] });
58
- const event = input['hook_event_name'] === FAILURE_EVENT ? FAILURE_EVENT : 'PostToolUse';
59
- const isOk =
60
- event !== FAILURE_EVENT &&
61
- !reportsFailure({ response: recordOf({ value: input['tool_response'] }) });
62
- const command = stringOf({ value: toolInput['command'] });
63
- // A command sent to the background has not finished: its result is not known here.
64
- const isBackground = toolInput['run_in_background'] === true;
65
- const path = stringOf({ value: toolInput['file_path'] });
66
- const gates = tool === 'Bash' && !isBackground ? SignalClassifier.gatesOf({ command }) : [];
67
-
68
- try {
69
- SignalState.append({
70
- root: opts.projectRoot,
71
- entry: {
72
- kind: EntryKinds.CALL,
73
- session,
74
- agent,
75
- at: now,
76
- tool,
77
- key: SignalClassifier.callKeyOf({ tool, input: toolInput }),
78
- isOk,
79
- isProbe: tool === 'Bash' && isOk && SignalClassifier.isPublicProbe({ command }),
80
- gates,
81
- isEdit: FILE_TOOLS.has(tool) && isOk,
82
- },
83
- });
84
- } catch {
85
- // The notes are advisory: a failed write costs a hint, never the call.
86
- }
87
-
88
- const state: ISignalState = SignalState.read({ root: opts.projectRoot, session, agent });
89
- const lines: string[] = [];
90
- const say = (name: string, line: string): void => {
91
- const last = state.notedAt[name];
92
-
93
- if (last !== undefined && now - last < SignalConstants.DEBOUNCE_MS) {
94
- return;
95
- }
96
-
97
- lines.push(line);
98
-
99
- try {
100
- SignalState.append({
101
- root: opts.projectRoot,
102
- entry: { kind: EntryKinds.NOTE, at: now, name },
103
- });
104
- } catch {
105
- // Without the note the advisory may repeat; nothing worse.
106
- }
107
- };
108
-
109
- if (FILE_TOOLS.has(tool) && isOk) {
110
- const watched = SignalClassifier.watchedFileOf({ path });
111
-
112
- if (watched?.kind === WatchedKinds.SKILL) {
113
- say(
114
- `skill:${watched.name}`,
115
- `You changed the skill ${watched.name}. Before you rely on it, run its evals (evals/evals.json) and read the transcripts: a skill change that no eval saw is a guess.`,
116
- );
117
- } else if (watched?.kind === WatchedKinds.RULES) {
118
- say(
119
- `rules:${watched.name}`,
120
- 'You changed a rules file. A rule needs an observed failure and a named enforcement, and a mechanical check where one is possible (the retro skill states the admission bar).',
121
- );
122
- }
123
- }
124
-
125
- const loop = SignalLoop.loopOf({ events: state.events });
126
-
127
- if (loop !== undefined) {
128
- say(
129
- `loop:${agent}`,
130
- `Loop check: ${loop}. Stop repeating it: read the error, change the approach (the fix-a-bug skill builds the loop first), or ask the owner.`,
131
- );
132
- }
133
-
134
- return lines.length === 0
135
- ? undefined
136
- : { hookSpecificOutput: { hookEventName: event, additionalContext: lines.join(' ') } };
137
- }
138
- }