agentopology 0.2.4 → 0.3.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.
- package/README.md +92 -10
- package/dist/bindings/__tests__/bindings.test.js +2 -2
- package/dist/bindings/__tests__/claude-code-hybrid.test.d.ts +2 -0
- package/dist/bindings/__tests__/claude-code-hybrid.test.d.ts.map +1 -0
- package/dist/bindings/__tests__/claude-code-hybrid.test.js +152 -0
- package/dist/bindings/__tests__/claude-code-hybrid.test.js.map +1 -0
- package/dist/bindings/__tests__/claude-workflow.test.d.ts +2 -0
- package/dist/bindings/__tests__/claude-workflow.test.d.ts.map +1 -0
- package/dist/bindings/__tests__/claude-workflow.test.js +204 -0
- package/dist/bindings/__tests__/claude-workflow.test.js.map +1 -0
- package/dist/bindings/__tests__/hybrid-e2e.test.d.ts +15 -0
- package/dist/bindings/__tests__/hybrid-e2e.test.d.ts.map +1 -0
- package/dist/bindings/__tests__/hybrid-e2e.test.js +94 -0
- package/dist/bindings/__tests__/hybrid-e2e.test.js.map +1 -0
- package/dist/bindings/claude-code.d.ts.map +1 -1
- package/dist/bindings/claude-code.js +407 -3
- package/dist/bindings/claude-code.js.map +1 -1
- package/dist/bindings/claude-workflow.d.ts +28 -0
- package/dist/bindings/claude-workflow.d.ts.map +1 -0
- package/dist/bindings/claude-workflow.js +684 -0
- package/dist/bindings/claude-workflow.js.map +1 -0
- package/dist/bindings/index.d.ts +1 -0
- package/dist/bindings/index.d.ts.map +1 -1
- package/dist/bindings/index.js +3 -0
- package/dist/bindings/index.js.map +1 -1
- package/dist/bindings/lib/seam.d.ts +35 -0
- package/dist/bindings/lib/seam.d.ts.map +1 -0
- package/dist/bindings/lib/seam.js +42 -0
- package/dist/bindings/lib/seam.js.map +1 -0
- package/dist/cli/index.js +195 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/parser/__tests__/parser.test.js +170 -0
- package/dist/parser/__tests__/parser.test.js.map +1 -1
- package/dist/parser/ast.d.ts +39 -0
- package/dist/parser/ast.d.ts.map +1 -1
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +58 -2
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/validator.d.ts.map +1 -1
- package/dist/parser/validator.js +66 -3
- package/dist/parser/validator.js.map +1 -1
- package/dist/visualizer/__tests__/brain.test.d.ts +2 -0
- package/dist/visualizer/__tests__/brain.test.d.ts.map +1 -0
- package/dist/visualizer/__tests__/brain.test.js +138 -0
- package/dist/visualizer/__tests__/brain.test.js.map +1 -0
- package/dist/visualizer/__tests__/topology-brain-link.test.d.ts +2 -0
- package/dist/visualizer/__tests__/topology-brain-link.test.d.ts.map +1 -0
- package/dist/visualizer/__tests__/topology-brain-link.test.js +41 -0
- package/dist/visualizer/__tests__/topology-brain-link.test.js.map +1 -0
- package/dist/visualizer/brain.d.ts +97 -0
- package/dist/visualizer/brain.d.ts.map +1 -0
- package/dist/visualizer/brain.js +473 -0
- package/dist/visualizer/brain.js.map +1 -0
- package/dist/visualizer/index.d.ts +19 -1
- package/dist/visualizer/index.d.ts.map +1 -1
- package/dist/visualizer/index.js +26 -11
- package/dist/visualizer/index.js.map +1 -1
- package/examples/company-brain-team.at +241 -0
- package/examples/company-brain.at +104 -0
- package/examples/logos/gmail.svg +1 -0
- package/examples/logos/slack.svg +1 -0
- package/examples/matchmat-ship.at +249 -0
- package/package.json +1 -1
- package/spec/grammar.md +42 -3
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# company-brain-team.at — A team of agents that build & maintain a company brain
|
|
2
|
+
#
|
|
3
|
+
# The flagship "company brain" topology. A folder of Obsidian-format markdown,
|
|
4
|
+
# fed and maintained by a TEAM — not one librarian:
|
|
5
|
+
#
|
|
6
|
+
# 📧 gmail-ingester ─┐
|
|
7
|
+
# 💬 slack-ingester ─┼─► drop raw notes into brain/ ─► 👤 librarian wires them
|
|
8
|
+
# 📅 calendar-ingester ─┘ (each owns ONE source) (links, tags, hubs)
|
|
9
|
+
# ─► 🔍 auditor heals the graph
|
|
10
|
+
#
|
|
11
|
+
# - Ingesters are scheduled — they pull from their source and write raw markdown.
|
|
12
|
+
# - The librarian is custodian-of the brain: it wires dropped notes into the graph.
|
|
13
|
+
# - The auditor is custodian-of the brain too: it heals broken links, surfaces
|
|
14
|
+
# ghost nodes, and flags duplicates.
|
|
15
|
+
# - A researcher reads the brain to answer questions.
|
|
16
|
+
#
|
|
17
|
+
# This is the whitespace: declarative + multi-agent team + Obsidian-portable +
|
|
18
|
+
# agents own memory layers. Demonstrates `brain` + `custodian-of` + ingestion.
|
|
19
|
+
|
|
20
|
+
topology company-brain-team : [brain, event-driven, human-gate] {
|
|
21
|
+
|
|
22
|
+
meta {
|
|
23
|
+
version: "0.1.0"
|
|
24
|
+
description: "A team of agents that ingest, wire, and maintain a company brain"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
# --- The brain: one Obsidian-format markdown vault, no database ---
|
|
28
|
+
|
|
29
|
+
memory {
|
|
30
|
+
store brain {
|
|
31
|
+
type: brain
|
|
32
|
+
description: "The company brain — fed by ingesters, wired by the librarian"
|
|
33
|
+
path: "brain/"
|
|
34
|
+
format: obsidian
|
|
35
|
+
scope: org
|
|
36
|
+
|
|
37
|
+
# Presentation only — colors/icons for the graph view, by provenance.
|
|
38
|
+
# A note's `source:` frontmatter (stamped by its ingester) maps to a look.
|
|
39
|
+
# Cosmetic: bindings ignore this; delete it and the brain works the same.
|
|
40
|
+
sources {
|
|
41
|
+
gmail {
|
|
42
|
+
color: "#EA4335"
|
|
43
|
+
icon: "./logos/gmail.svg"
|
|
44
|
+
}
|
|
45
|
+
slack {
|
|
46
|
+
color: "#4A154B"
|
|
47
|
+
icon: "./logos/slack.svg"
|
|
48
|
+
}
|
|
49
|
+
calendar {
|
|
50
|
+
color: "#4285F4"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
# --- Ingesters: each owns ONE external source, writes raw notes ---
|
|
57
|
+
|
|
58
|
+
agent gmail-ingester {
|
|
59
|
+
model: sonnet
|
|
60
|
+
description: "Pulls notable emails and writes them as raw notes into the brain"
|
|
61
|
+
tools: [Read, Write, Grep, Glob]
|
|
62
|
+
mcp-servers: [gmail]
|
|
63
|
+
writes: ["brain/"]
|
|
64
|
+
|
|
65
|
+
prompt {
|
|
66
|
+
You ingest email into the brain. On each run:
|
|
67
|
+
- Pull recent notable threads (decisions, deals, intros, commitments).
|
|
68
|
+
- For each, write ONE raw markdown note into `brain/` with a clear title
|
|
69
|
+
and YAML frontmatter (date, source: gmail, participants).
|
|
70
|
+
- Do NOT wire links or tags — that is the librarian's job. Just capture
|
|
71
|
+
the content faithfully. Skip noise (newsletters, automated mail).
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
agent slack-ingester {
|
|
76
|
+
model: sonnet
|
|
77
|
+
description: "Captures key Slack decisions and threads as raw notes"
|
|
78
|
+
tools: [Read, Write, Grep, Glob]
|
|
79
|
+
mcp-servers: [slack]
|
|
80
|
+
writes: ["brain/"]
|
|
81
|
+
|
|
82
|
+
prompt {
|
|
83
|
+
You ingest Slack into the brain. On each run, capture threads where a
|
|
84
|
+
decision was made, a commitment given, or knowledge shared. Write each
|
|
85
|
+
as ONE raw markdown note in `brain/` with frontmatter (date, source:
|
|
86
|
+
slack, channel). Leave linking and tagging to the librarian.
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
agent calendar-ingester {
|
|
91
|
+
model: sonnet
|
|
92
|
+
description: "Turns meetings into raw notes (attendees, outcomes)"
|
|
93
|
+
tools: [Read, Write, Grep, Glob]
|
|
94
|
+
mcp-servers: [calendar]
|
|
95
|
+
writes: ["brain/"]
|
|
96
|
+
|
|
97
|
+
prompt {
|
|
98
|
+
You ingest calendar events into the brain. For meetings that mattered,
|
|
99
|
+
write ONE raw markdown note in `brain/` with frontmatter (date, source:
|
|
100
|
+
calendar, attendees) and any outcomes/notes you can infer. No linking —
|
|
101
|
+
that is the librarian's job.
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
# --- Librarian: custodian that WIRES dropped notes into the graph ---
|
|
106
|
+
|
|
107
|
+
agent librarian {
|
|
108
|
+
model: sonnet
|
|
109
|
+
description: "Wires raw notes into the brain graph — links, tags, hubs"
|
|
110
|
+
tools: [Read, Write, Edit, Grep, Glob]
|
|
111
|
+
|
|
112
|
+
custodian-of: [brain] {
|
|
113
|
+
does: [link, tag, index, dedupe]
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
prompt {
|
|
117
|
+
You are the brain's librarian. Raw notes arrive from the ingesters and
|
|
118
|
+
from humans. You never invent content — you wire what is dropped in.
|
|
119
|
+
Resolve mentions into [[wikilinks]], assign #nested/tags, keep the hub
|
|
120
|
+
notes current, and flag duplicates. Leave ghost links to mark gaps.
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
# --- Auditor: custodian that keeps the whole graph HEALTHY ---
|
|
125
|
+
|
|
126
|
+
agent auditor {
|
|
127
|
+
model: opus
|
|
128
|
+
description: "Heals the brain — broken links, ghost nodes, orphans, dupes"
|
|
129
|
+
tools: [Read, Edit, Grep, Glob]
|
|
130
|
+
|
|
131
|
+
custodian-of: [brain] {
|
|
132
|
+
does: [heal, dedupe, index]
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
prompt {
|
|
136
|
+
You audit the brain's health. Find and repair broken [[links]] after
|
|
137
|
+
renames, surface ghost nodes (links to notes that don't exist), flag
|
|
138
|
+
orphan notes (nothing links to them), and propose merges for duplicates.
|
|
139
|
+
Conservative: repair links and report issues — never delete a human's note.
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
# --- Researcher: READS the brain to answer questions ---
|
|
144
|
+
|
|
145
|
+
agent researcher {
|
|
146
|
+
model: sonnet
|
|
147
|
+
description: "Answers questions by traversing the brain"
|
|
148
|
+
tools: [Read, Grep, Glob]
|
|
149
|
+
memory: [brain]
|
|
150
|
+
|
|
151
|
+
prompt {
|
|
152
|
+
Answer questions using only the brain in `brain/`. Grep for relevant
|
|
153
|
+
notes, follow their [[wikilinks]] and #tags, and cite notes by filename.
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
# --- Actions (flow entry/exit points) ---
|
|
158
|
+
|
|
159
|
+
action wire-in {
|
|
160
|
+
kind: inline
|
|
161
|
+
description: "Fold a dropped or freshly-ingested note into the brain"
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
action audit {
|
|
165
|
+
kind: report
|
|
166
|
+
description: "Report the brain's health: ghosts, orphans, broken links, dupes"
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
action query {
|
|
170
|
+
kind: inline
|
|
171
|
+
description: "Ask the brain a question"
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
# --- Flow: ingesters feed the librarian; auditor runs after; researcher reads ---
|
|
175
|
+
|
|
176
|
+
flow {
|
|
177
|
+
gmail-ingester -> wire-in
|
|
178
|
+
slack-ingester -> wire-in
|
|
179
|
+
calendar-ingester -> wire-in
|
|
180
|
+
wire-in -> librarian
|
|
181
|
+
librarian -> auditor
|
|
182
|
+
auditor -> audit
|
|
183
|
+
query -> researcher
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
# --- Schedule: ingesters and the auditor run on their own cadence ---
|
|
187
|
+
|
|
188
|
+
schedule {
|
|
189
|
+
job pull-email {
|
|
190
|
+
cron: "0 */2 * * *"
|
|
191
|
+
agent: gmail-ingester
|
|
192
|
+
}
|
|
193
|
+
job pull-slack {
|
|
194
|
+
cron: "0 */2 * * *"
|
|
195
|
+
agent: slack-ingester
|
|
196
|
+
}
|
|
197
|
+
job pull-calendar {
|
|
198
|
+
cron: "0 8 * * *"
|
|
199
|
+
agent: calendar-ingester
|
|
200
|
+
}
|
|
201
|
+
job nightly-audit {
|
|
202
|
+
cron: "0 3 * * *"
|
|
203
|
+
agent: auditor
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
# --- Triggers: humans can wire a file or ask the brain anytime ---
|
|
208
|
+
|
|
209
|
+
triggers {
|
|
210
|
+
command wire-in {
|
|
211
|
+
pattern: "/wire-in <FILE>"
|
|
212
|
+
argument: FILE
|
|
213
|
+
description: "Fold a dropped markdown file into the brain"
|
|
214
|
+
}
|
|
215
|
+
command query {
|
|
216
|
+
pattern: "/ask <QUESTION>"
|
|
217
|
+
argument: QUESTION
|
|
218
|
+
description: "Ask the brain a question"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
# --- External sources the ingesters connect to ---
|
|
223
|
+
|
|
224
|
+
mcp-servers {
|
|
225
|
+
gmail {
|
|
226
|
+
type: stdio
|
|
227
|
+
command: "npx"
|
|
228
|
+
args: ["-y", "gmail-mcp-server"]
|
|
229
|
+
}
|
|
230
|
+
slack {
|
|
231
|
+
type: stdio
|
|
232
|
+
command: "npx"
|
|
233
|
+
args: ["-y", "slack-mcp-server"]
|
|
234
|
+
}
|
|
235
|
+
calendar {
|
|
236
|
+
type: stdio
|
|
237
|
+
command: "npx"
|
|
238
|
+
args: ["-y", "calendar-mcp-server"]
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# company-brain.at — A plug-and-play company brain
|
|
2
|
+
#
|
|
3
|
+
# A folder of Obsidian-format markdown, maintained by agents, not by hand.
|
|
4
|
+
# - Humans drop a new note and run /wire-in. The librarian links & tags it.
|
|
5
|
+
# - The researcher traverses the [[link]] graph (with grep) to answer questions.
|
|
6
|
+
# - No vector DB, no MCP server. The brain is a folder you can git clone and
|
|
7
|
+
# open in Obsidian for the graph view.
|
|
8
|
+
#
|
|
9
|
+
# Demonstrates the `brain` PATTERN + the `custodian-of` PRIMITIVE.
|
|
10
|
+
|
|
11
|
+
topology company-brain : [brain, human-gate] {
|
|
12
|
+
|
|
13
|
+
meta {
|
|
14
|
+
version: "0.1.0"
|
|
15
|
+
description: "An agent-maintained, Obsidian-portable company brain"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
# --- The brain itself: one markdown store, no backend ---
|
|
19
|
+
|
|
20
|
+
memory {
|
|
21
|
+
store brain {
|
|
22
|
+
type: brain # NEW store type — no DB, just files
|
|
23
|
+
description: "The company brain — a folder of linked markdown"
|
|
24
|
+
path: "brain/" # this folder IS a valid Obsidian vault
|
|
25
|
+
format: obsidian # [[wikilinks]], #nested/tags, YAML frontmatter
|
|
26
|
+
scope: org
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# --- The librarian: KEEPER of the brain (the new primitive) ---
|
|
31
|
+
|
|
32
|
+
agent librarian {
|
|
33
|
+
model: sonnet
|
|
34
|
+
description: "Maintains the brain — wires new notes into the graph"
|
|
35
|
+
tools: [Read, Write, Edit, Grep, Glob]
|
|
36
|
+
|
|
37
|
+
custodian-of: [brain] { # owns upkeep, not just read access
|
|
38
|
+
does: [link, tag, index, dedupe] # OPTIONAL verbs — visible strategy
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
prompt {
|
|
42
|
+
You are the brain's librarian. The brain lives in `brain/` as Obsidian
|
|
43
|
+
markdown. You never invent content — you wire what's dropped in.
|
|
44
|
+
|
|
45
|
+
When a note is added or changed:
|
|
46
|
+
- link: find mentions of existing notes and turn them into [[wikilinks]]
|
|
47
|
+
- tag: add #nested/tags consistent with the existing tag hierarchy
|
|
48
|
+
- index: update the relevant hub note (a Map-of-Content that [[links]]
|
|
49
|
+
the cluster) so the new note is reachable
|
|
50
|
+
- dedupe: flag near-duplicate notes for human review; never auto-delete
|
|
51
|
+
|
|
52
|
+
Backlinks are computed from the [[links]] you write — never author them
|
|
53
|
+
by hand. If a note links to something that doesn't exist yet, leave the
|
|
54
|
+
ghost link; it marks a gap to fill later.
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
# --- The researcher: READS the brain to answer questions ---
|
|
59
|
+
|
|
60
|
+
agent researcher {
|
|
61
|
+
model: sonnet
|
|
62
|
+
description: "Answers questions by traversing the brain"
|
|
63
|
+
tools: [Read, Grep, Glob]
|
|
64
|
+
memory: [brain] # read access — the ordinary wiring
|
|
65
|
+
|
|
66
|
+
prompt {
|
|
67
|
+
Answer questions using only the brain in `brain/`. Start by grepping for
|
|
68
|
+
relevant notes, then follow their [[wikilinks]] and #tags to gather the
|
|
69
|
+
full picture. Cite the notes you used by filename.
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# --- What the human can do (actions are the flow entry points) ---
|
|
74
|
+
|
|
75
|
+
action wire-in {
|
|
76
|
+
kind: inline
|
|
77
|
+
description: "Fold a dropped markdown file into the brain"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
action query {
|
|
81
|
+
kind: inline
|
|
82
|
+
description: "Ask the brain a question"
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
triggers {
|
|
86
|
+
command wire-in {
|
|
87
|
+
pattern: "/wire-in <FILE>"
|
|
88
|
+
argument: FILE
|
|
89
|
+
description: "Fold a dropped markdown file into the brain"
|
|
90
|
+
}
|
|
91
|
+
command query {
|
|
92
|
+
pattern: "/ask <QUESTION>"
|
|
93
|
+
argument: QUESTION
|
|
94
|
+
description: "Ask the brain a question"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
# --- Flow ---
|
|
99
|
+
|
|
100
|
+
flow {
|
|
101
|
+
wire-in -> librarian # human drops a file → librarian wires it
|
|
102
|
+
query -> researcher # human asks → researcher traverses & answers
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48"><path fill="#fff" d="M6 12h36v26H6z"/><path fill="#EA4335" d="M6 14v3l18 12L42 17v-3l-18 12z"/><path fill="#FBBC04" d="M6 14v22h6V18l12 8 12-8v18h6V14l-18 12z" opacity=".9"/><path fill="#34A853" d="M6 36h6V18l-6-4z"/><path fill="#4285F4" d="M42 36h-6V18l6-4z"/><path fill="#C5221F" d="M6 14l18 12L42 14v-2H6z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48"><path fill="#36C5F0" d="M18 6a4 4 0 100 8h4V10a4 4 0 00-4-4z"/><path fill="#2EB67D" d="M42 18a4 4 0 10-8 0v4h4a4 4 0 004-4z"/><path fill="#ECB22E" d="M30 42a4 4 0 100-8h-4v4a4 4 0 004 4z"/><path fill="#E01E5A" d="M6 30a4 4 0 108 0v-4h-4a4 4 0 00-4 4z"/><path fill="#36C5F0" d="M18 18h8v8h-8z" opacity=".7"/></svg>
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# matchmat-ship.at — MatchMat autonomous ship-harness (HYBRID host + embedded workflow)
|
|
2
|
+
#
|
|
3
|
+
# The declarative source of truth for MatchMat's fast ship pipeline. Compiles via
|
|
4
|
+
# a DUAL emitter: claude-code (the HOST — roles, flow, hooks, Blackboard) + the
|
|
5
|
+
# claude-workflow binding (the BUILD phase → an embedded workflow.js for
|
|
6
|
+
# deterministic parallel fan-out). They couple through the Blackboard (workspace
|
|
7
|
+
# files; see memory.workspace + each agent's reads/writes).
|
|
8
|
+
#
|
|
9
|
+
# Methodology: contract-driven development + closed-loop regression. NO TDD.
|
|
10
|
+
# Autonomous up to the HUMAN promote boundary; regression is a downstream workflow.
|
|
11
|
+
#
|
|
12
|
+
# Seam marking: agents that should compile to the embedded deterministic Workflow
|
|
13
|
+
# carry `extensions { claude-workflow { execution: workflow } }`. Everything else
|
|
14
|
+
# stays on the host session (hooks/gates/branching/observability).
|
|
15
|
+
|
|
16
|
+
topology matchmat-ship : [pipeline, fan-out, blackboard, human-gate] {
|
|
17
|
+
|
|
18
|
+
meta {
|
|
19
|
+
version: "1.1.0"
|
|
20
|
+
description: "Hybrid ship pipeline: contract-research fan-out (host) -> parallel build in worktrees (embedded workflow) -> adversarial verify (host) -> human promote. Blackboard couples the layers. Regression is downstream."
|
|
21
|
+
domain: devops
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
providers {
|
|
25
|
+
anthropic {
|
|
26
|
+
api-key: "${ANTHROPIC_API_KEY}"
|
|
27
|
+
models: [opus, sonnet]
|
|
28
|
+
default: true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
orchestrator {
|
|
33
|
+
model: opus
|
|
34
|
+
handles: [intake, ship-report]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
roles {
|
|
38
|
+
contract-scout: "Find existing contracts/boundaries the ticket touches"
|
|
39
|
+
blast-radius-mapper: "Map the files and components the change affects"
|
|
40
|
+
boundary-drafter: "Draft the new boundaries/contracts the change requires"
|
|
41
|
+
builder: "Implement against the contract delta in an isolated worktree (no TDD); also write the paired regression spec"
|
|
42
|
+
security-verifier: "Adversarially scan the diff for security red flags"
|
|
43
|
+
contract-verifier: "Verify the code honors the contract invariants it claims (no drift)"
|
|
44
|
+
closed-loop-verifier: "Verify a paired regression spec exists and asserts in contract vocabulary"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# --- Actions ---
|
|
48
|
+
|
|
49
|
+
action intake {
|
|
50
|
+
kind: external
|
|
51
|
+
source: "trello"
|
|
52
|
+
description: "Fetch the Trello ticket and seed the Blackboard (workspace/ticket.md)"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
action ship-report {
|
|
56
|
+
kind: report
|
|
57
|
+
description: "Compile contract delta, build summary, and verify verdicts for the human"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
# --- Phase 1: CONTRACT RESEARCH (host fan-out) ---
|
|
61
|
+
# Stays on the host: reads/writes the Blackboard; observability hooks watch it.
|
|
62
|
+
|
|
63
|
+
agent contract-scout {
|
|
64
|
+
role: contract-scout
|
|
65
|
+
model: sonnet
|
|
66
|
+
permissions: supervised
|
|
67
|
+
phase: 1
|
|
68
|
+
prompt {
|
|
69
|
+
Find every existing contract (contracts/C-*.yaml) and boundary
|
|
70
|
+
(contracts/B-*.yaml) the ticket touches. List each with the invariant
|
|
71
|
+
at stake. Write findings to the Blackboard.
|
|
72
|
+
}
|
|
73
|
+
tools: [Read, Grep, Glob, Write]
|
|
74
|
+
reads: ["workspace/ticket.md"]
|
|
75
|
+
writes: ["workspace/contracts-touched.md"]
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
agent blast-radius-mapper {
|
|
79
|
+
role: blast-radius-mapper
|
|
80
|
+
model: sonnet
|
|
81
|
+
permissions: supervised
|
|
82
|
+
phase: 1
|
|
83
|
+
prompt {
|
|
84
|
+
Map the blast radius: which src/ files, edge functions, migrations, and
|
|
85
|
+
components the change affects. Produce an ordered file list with rationale.
|
|
86
|
+
}
|
|
87
|
+
tools: [Read, Grep, Glob, Write]
|
|
88
|
+
reads: ["workspace/ticket.md"]
|
|
89
|
+
writes: ["workspace/blast-radius.md"]
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
agent boundary-drafter {
|
|
93
|
+
role: boundary-drafter
|
|
94
|
+
model: opus
|
|
95
|
+
permissions: supervised
|
|
96
|
+
phase: 1
|
|
97
|
+
prompt {
|
|
98
|
+
Draft the NEW boundaries/contracts the change requires (or version bumps
|
|
99
|
+
to existing ones). Output the exact contract delta the build phase will
|
|
100
|
+
implement against.
|
|
101
|
+
}
|
|
102
|
+
tools: [Read, Grep, Glob, Write]
|
|
103
|
+
reads: ["workspace/ticket.md"]
|
|
104
|
+
writes: ["workspace/contract-delta.md"]
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
# --- Phase 2: BUILD (embedded WORKFLOW — deterministic parallel fan-out) ---
|
|
108
|
+
# execution: workflow → this phase compiles to an embedded workflow.js. Agents
|
|
109
|
+
# run in parallel worktrees, read the Blackboard (contract delta + blast radius),
|
|
110
|
+
# write build results back to the Blackboard so host hooks observe progress.
|
|
111
|
+
|
|
112
|
+
agent builder {
|
|
113
|
+
role: builder
|
|
114
|
+
model: opus
|
|
115
|
+
permissions: autonomous
|
|
116
|
+
phase: 2
|
|
117
|
+
isolation: worktree
|
|
118
|
+
prompt {
|
|
119
|
+
Implement your assigned slice of the contract delta in an isolated git
|
|
120
|
+
worktree. Code against the contract as the spec (NO TDD). In the SAME
|
|
121
|
+
change, write or extend the paired regression spec under e2e/walkthroughs/
|
|
122
|
+
in contract vocabulary. Touch the contract YAML if it evolves. Write a
|
|
123
|
+
build report to the Blackboard.
|
|
124
|
+
}
|
|
125
|
+
tools: [Read, Grep, Glob, Write, Edit, Bash]
|
|
126
|
+
reads: ["workspace/contract-delta.md", "workspace/blast-radius.md", "workspace/contracts-touched.md"]
|
|
127
|
+
writes: ["workspace/build-report.md"]
|
|
128
|
+
scale {
|
|
129
|
+
mode: auto
|
|
130
|
+
by: source-count
|
|
131
|
+
min: 1
|
|
132
|
+
max: 6
|
|
133
|
+
}
|
|
134
|
+
extensions {
|
|
135
|
+
claude-workflow {
|
|
136
|
+
execution: workflow
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
# --- Phase 3: ADVERSARIAL VERIFY (host fan-out) ---
|
|
142
|
+
|
|
143
|
+
agent security-verifier {
|
|
144
|
+
role: security-verifier
|
|
145
|
+
model: opus
|
|
146
|
+
permissions: supervised
|
|
147
|
+
phase: 3
|
|
148
|
+
prompt {
|
|
149
|
+
Adversarially scan the diff for red flags: hardcoded secrets, RLS holes,
|
|
150
|
+
SQL string concat, missing role checks, service-role key in client code.
|
|
151
|
+
Default to fail if uncertain.
|
|
152
|
+
}
|
|
153
|
+
tools: [Read, Grep, Glob, Bash]
|
|
154
|
+
reads: ["workspace/build-report.md"]
|
|
155
|
+
writes: ["workspace/verify-security.md"]
|
|
156
|
+
outputs: {
|
|
157
|
+
verdict: pass | fail
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
agent contract-verifier {
|
|
162
|
+
role: contract-verifier
|
|
163
|
+
model: sonnet
|
|
164
|
+
permissions: supervised
|
|
165
|
+
phase: 3
|
|
166
|
+
prompt {
|
|
167
|
+
Verify the code honors the contract invariants it claims. Check for drift
|
|
168
|
+
between implemented behavior and the contract/boundary YAML. Default to
|
|
169
|
+
fail if the code diverges from a declared invariant.
|
|
170
|
+
}
|
|
171
|
+
tools: [Read, Grep, Glob]
|
|
172
|
+
reads: ["workspace/build-report.md", "workspace/contract-delta.md"]
|
|
173
|
+
writes: ["workspace/verify-contract.md"]
|
|
174
|
+
outputs: {
|
|
175
|
+
verdict: pass | fail
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
agent closed-loop-verifier {
|
|
180
|
+
role: closed-loop-verifier
|
|
181
|
+
model: sonnet
|
|
182
|
+
permissions: supervised
|
|
183
|
+
phase: 3
|
|
184
|
+
prompt {
|
|
185
|
+
Verify a paired regression spec exists under e2e/walkthroughs/ for the
|
|
186
|
+
change and that its assertions use contract vocabulary (the same invariant
|
|
187
|
+
IDs). Default to fail if no spec pairs the change.
|
|
188
|
+
}
|
|
189
|
+
tools: [Read, Grep, Glob]
|
|
190
|
+
reads: ["workspace/build-report.md"]
|
|
191
|
+
writes: ["workspace/verify-closed-loop.md"]
|
|
192
|
+
outputs: {
|
|
193
|
+
verdict: pass | fail
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
# --- Human promote boundary (the deliberate workflow-split point) ---
|
|
198
|
+
|
|
199
|
+
human promote {
|
|
200
|
+
description: "Human reviews the contract delta + verify verdicts in the ship-report, then promotes to staging (which triggers the SEPARATE downstream regression workflow). Not in the autonomous loop until here."
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
# --- Flow (the execution DAG) ---
|
|
204
|
+
|
|
205
|
+
flow {
|
|
206
|
+
intake -> [contract-scout, blast-radius-mapper, boundary-drafter]
|
|
207
|
+
contract-scout -> builder
|
|
208
|
+
blast-radius-mapper -> builder
|
|
209
|
+
boundary-drafter -> builder
|
|
210
|
+
builder -> [security-verifier, contract-verifier, closed-loop-verifier]
|
|
211
|
+
security-verifier -> ship-report
|
|
212
|
+
contract-verifier -> ship-report
|
|
213
|
+
closed-loop-verifier -> ship-report
|
|
214
|
+
ship-report -> promote
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
# --- Gates (auto-injected; halt the autonomous run on verify failure) ---
|
|
218
|
+
|
|
219
|
+
gates {
|
|
220
|
+
gate verify-gate {
|
|
221
|
+
after: closed-loop-verifier
|
|
222
|
+
before: ship-report
|
|
223
|
+
run: "scripts/verify-gate.sh"
|
|
224
|
+
checks: [security, contract-conformance, closed-loop]
|
|
225
|
+
retry: 2
|
|
226
|
+
on-fail: bounce-back
|
|
227
|
+
behavior: blocking
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
# --- Blackboard (the substrate coupling host + embedded workflow) ---
|
|
232
|
+
|
|
233
|
+
memory {
|
|
234
|
+
workspace {
|
|
235
|
+
path: "workspace/"
|
|
236
|
+
structure: [ticket, contracts-touched, blast-radius, contract-delta, build-report, verify-security, verify-contract, verify-closed-loop]
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
# --- Hooks (host-layer concurrent observability — watch the Blackboard live) ---
|
|
241
|
+
|
|
242
|
+
hooks {
|
|
243
|
+
PostToolUse {
|
|
244
|
+
matcher: "Write"
|
|
245
|
+
type: command
|
|
246
|
+
command: "scripts/observe-blackboard.sh"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|