@yottagraph-app/aether-instructions 1.1.30 → 1.1.32

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.
@@ -210,7 +210,7 @@ Implement the plan:
210
210
 
211
211
  ---
212
212
 
213
- ## Step 7: Verify
213
+ ## Step 7: Verify and Commit
214
214
 
215
215
  After building, check dependencies are installed and run a build:
216
216
 
@@ -221,27 +221,51 @@ npm run build
221
221
 
222
222
  Fix any build errors.
223
223
 
224
- Then suggest the user run `npm run dev` to preview their app locally.
224
+ Then format and commit:
225
+
226
+ ```bash
227
+ npm run format
228
+ git add -A
229
+ git commit -m "[Agent commit] Initial app build from project brief"
230
+ ```
231
+
232
+ **Push directly to main.** Vercel auto-deploys on push to main, so this
233
+ gets the app live immediately. Do NOT try to create a pull request via
234
+ `gh pr create` — in Cursor Cloud environments, the GitHub integration
235
+ token lacks PR permissions (known Cursor issue). Pushing to main is the
236
+ correct workflow.
237
+
238
+ ```bash
239
+ git push origin main
240
+ ```
241
+
242
+ If running locally (not in Cursor Cloud), the user may prefer a PR-based
243
+ workflow — ask before pushing directly to main in that case.
225
244
 
226
245
  ---
227
246
 
228
247
  ## Step 8: Deploy Agents and Next Steps
229
248
 
230
- If the app includes agents in `agents/`, offer to deploy them now:
249
+ If the app includes agents in `agents/`, **deploy them automatically** —
250
+ don't ask for confirmation. Run `/deploy_agent` for each agent immediately
251
+ after pushing. The brief asked you to build an app with agents; deploying
252
+ them is part of delivering a working app.
253
+
254
+ **Skip `example_agent`** — this is a template placeholder, not a real
255
+ agent. Only deploy agents you actually built for this project.
231
256
 
232
- > Your app is built! I see you have an agent in `agents/`. Want me to
233
- > deploy it now? I can run the deployment for you.
257
+ After triggering deployment, monitor it yourself (see `/deploy_agent`
258
+ Step 6 for how to poll). Only escalate to the user if deployment fails
259
+ and you can't resolve it.
234
260
 
235
- If the user agrees (or if this is an automated build), run `/deploy_agent`
236
- to deploy each agent. Don't just tell the user to type the command — do it
237
- for them.
261
+ If DESIGN.md explicitly says NOT to deploy, or says to wait for user
262
+ confirmation, respect that. Otherwise, deploy without asking.
238
263
 
239
264
  Then present next steps:
240
265
 
241
266
  > Here's what you can do next:
242
267
  >
243
- > - **Preview locally** with `npm run dev`
244
- > - **Push to deploy** -- Vercel auto-deploys on push to main
245
- > - **Deploy agents** -- I can deploy them for you, or use the Deploy
246
- > button on the Broadchurch portal's project page
247
- > - **Deploy MCP servers** -- same as above, from the portal or ask me
268
+ > - **Preview the app** Vercel auto-deployed on push to main
269
+ > - **Agents are deploying** I triggered deployment; it typically
270
+ > takes 2-5 minutes. I'll let you know when they're registered.
271
+ > - **MCP servers** — deploy from the Broadchurch portal or ask me
@@ -4,7 +4,7 @@ Deploy an ADK agent from the `agents/` directory to Vertex AI Agent Engine via t
4
4
 
5
5
  ## Overview
6
6
 
7
- This command deploys a Python ADK agent by triggering a GitHub Actions workflow through the Portal API. No local GCP credentials are needed -- the workflow authenticates via Workload Identity Federation.
7
+ This command deploys a Python ADK agent by triggering a Cloud Build job through the Portal API. No local GCP credentials are needed Cloud Build authenticates via the project's service account.
8
8
 
9
9
  The agent must live in `agents/<name>/` with the standard ADK structure (`agent.py`, `__init__.py`, `requirements.txt`).
10
10
 
@@ -56,9 +56,13 @@ ls -d agents/*/
56
56
 
57
57
  Stop here.
58
58
 
59
- **If multiple agents exist:** Ask the user which one to deploy.
59
+ **Skip `example_agent`** this is a template placeholder and should
60
+ never be deployed. Filter it out before proceeding.
60
61
 
61
- **If only one agent exists:** Confirm with the user.
62
+ **If multiple agents remain:** Deploy all of them. If called interactively
63
+ (not from `/build_my_app`), ask the user which one to deploy.
64
+
65
+ **If only one agent remains:** Proceed with it — no confirmation needed.
62
66
 
63
67
  **Important:** Agent directory names must use underscores, not hyphens (e.g., `my_agent` not `my-agent`).
64
68
 
@@ -110,35 +114,88 @@ curl -sf -X POST "<GATEWAY_URL>/api/projects/<ORG_ID>/deploy" \
110
114
 
111
115
  **If this fails with 404:** The agent directory may not exist on GitHub yet. Push your code first.
112
116
 
113
- **If this succeeds:** The Portal has triggered the `deploy-agent.yml` GitHub Actions workflow.
117
+ **If this succeeds:** The response will look like:
118
+
119
+ ```json
120
+ {
121
+ "ok": true,
122
+ "method": "cloud-build",
123
+ "build_id": "...",
124
+ "log_url": "https://console.cloud.google.com/cloud-build/builds/...",
125
+ "target": "agents/<name>",
126
+ "repo": "<owner>/<repo>"
127
+ }
128
+ ```
129
+
130
+ Save the `build_id` — you'll need it for monitoring.
114
131
 
115
132
  ---
116
133
 
117
- ## Step 6: Monitor Progress
134
+ ## Step 6: Monitor Progress and Confirm Registration
118
135
 
119
- > Deployment triggered! The agent is being deployed via GitHub Actions.
120
- >
121
- > - **Agent:** <name>
122
- > - **Workflow:** deploy-agent.yml
123
- >
124
- > This typically takes 2-5 minutes. You can monitor progress:
125
- >
126
- > - In the Broadchurch Portal under your project's Deployment Status section
127
- > - On GitHub: `https://github.com/<REPO>/actions`
128
- >
129
- > Once complete, the agent will automatically appear in your app's `/chat` page.
136
+ Deployment uses Cloud Build and typically takes 2-5 minutes. Monitor it
137
+ yourself rather than asking the user to check.
138
+
139
+ ### 6a. Poll build status
140
+
141
+ Use the deploy-status endpoint to check whether the build has finished:
142
+
143
+ ```bash
144
+ curl -sf "<GATEWAY_URL>/api/projects/<ORG_ID>/deploy-status" | jq '.cloud_builds[]'
145
+ ```
146
+
147
+ Each build entry has a `status` field. Terminal statuses are: `SUCCESS`,
148
+ `FAILURE`, `CANCELLED`, `TIMEOUT`, `INTERNAL_ERROR`, `EXPIRED`.
149
+
150
+ Poll every 30 seconds until the build reaches a terminal status (up to
151
+ 5 minutes). If it's still running after 5 minutes, tell the user and
152
+ share the `log_url` from the deploy response.
153
+
154
+ ### 6b. Confirm agent registration
155
+
156
+ A successful build doesn't guarantee the agent is usable yet — it also
157
+ needs to be registered with the tenant config. Poll the config endpoint
158
+ until the agent appears:
159
+
160
+ ```bash
161
+ curl -sf "<GATEWAY_URL>/api/config/<ORG_ID>" | jq '.agents'
162
+ ```
163
+
164
+ Check that the `agents` array contains an entry whose name matches your
165
+ agent. Poll every 30 seconds for up to 3 minutes after the build
166
+ succeeds.
167
+
168
+ ### 6c. Report result
169
+
170
+ **If the agent appears in config:**
171
+
172
+ > Agent `<name>` is deployed and registered. It should now be available
173
+ > in the app's chat interface.
174
+
175
+ **If the build succeeded but the agent doesn't appear in config after
176
+ 3 minutes:**
177
+
178
+ > The Cloud Build job succeeded, but the agent hasn't appeared in the
179
+ > tenant config yet. This may indicate the registration step failed
180
+ > silently. Check the build logs: <log_url>
181
+
182
+ **If the build failed:**
183
+
184
+ > Agent deployment failed with status `<status>`. Check the build logs
185
+ > for details: <log_url>
130
186
 
131
187
  ---
132
188
 
133
189
  ## Troubleshooting
134
190
 
135
- ### Deployment workflow fails
191
+ ### Cloud Build fails
136
192
 
137
- Check the GitHub Actions logs for the `Deploy Agent` workflow. Common issues:
193
+ Check the build logs at the `log_url` returned by the deploy endpoint.
194
+ Common issues:
138
195
 
139
196
  - **"agent.py does not export root_agent"**: Ensure your agent module defines `root_agent`.
140
197
  - **"Module not found"**: All dependencies must be in the agent's `requirements.txt`.
141
- - **WIF auth failure**: The Broadchurch admin needs to run the WIF setup script (`portal/scripts/setup-wif.sh`).
198
+ - **Service account permissions**: The Broadchurch admin may need to verify the project's service account has the required IAM roles.
142
199
 
143
200
  ### Agent directory naming
144
201
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yottagraph-app/aether-instructions",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
4
4
  "description": "Cursor rules, commands, and skills for Aether development",
5
5
  "files": [
6
6
  "rules",
@@ -70,3 +70,19 @@ In production, all Elemental API calls go through the Portal Gateway at
70
70
  `{gateway_url}/api/qs/{org_id}/...`. The agent sends `X-Api-Key` (from
71
71
  `broadchurch.yaml`) and the portal injects its own Auth0 M2M token
72
72
  upstream.
73
+
74
+ ## Reliability invariants (REST-backed agents)
75
+
76
+ These constraints reduce failure modes when building graph-aware agents on
77
+ the Query Server API:
78
+
79
+ - **Resolve entities first.** For named-entity questions, do explicit entity
80
+ resolution before deeper property/relationship/event retrieval.
81
+ - **Prefer domain endpoints over heuristic matching.** Use dedicated event or
82
+ relationship APIs instead of inferring semantics from property/PID names.
83
+ - **Keep IDs internal to tool calls.** Use NEIDs/EIDs internally for precise
84
+ requests, and render human-readable names in user-facing output.
85
+ - **Dereference linked values before display.** Reference-like property
86
+ values should be resolved into entity names when shown to users.
87
+ - **Treat 404 as not-found data by default.** Validate server health
88
+ separately before classifying these as connectivity failures.
package/rules/agents.mdc CHANGED
@@ -316,6 +316,24 @@ LLMs are better at parsing prose than nested JSON. The difference between
316
316
  a tool that works reliably and one that confuses the agent often comes down
317
317
  to how the tool formats its output. Follow these principles:
318
318
 
319
+ ### Runtime invariants for data-heavy agents
320
+
321
+ These are generic constraints that improve reliability across graph-backed
322
+ agents (MCP or REST-backed):
323
+
324
+ - **Resolve entities before domain fan-out.** For user prompts about named
325
+ entities, do explicit entity resolution first, then run domain-specific
326
+ retrieval (events, filings, relationships, sanctions, etc.).
327
+ - **Use internal IDs only for precision.** Keep stable IDs (NEID/EID/etc.)
328
+ in tool calls and state, but do not expose raw internal IDs in
329
+ user-facing prose unless the user explicitly asks for them.
330
+ - **Prefer canonical APIs over heuristic parsing.** For domain concepts
331
+ like events, use the dedicated API/tool and its typed fields; do not infer
332
+ semantics from property name substring matching.
333
+ - **Separate gather from synthesize.** Retrieval tools should gather and
334
+ format reliable intermediate outputs; the final user answer should be
335
+ composed after all relevant tool outputs are available.
336
+
319
337
  ### Return formatted strings, not raw JSON
320
338
 
321
339
  This applies to ADK agent tools, where the LLM reads tool output directly.
package/rules/data.mdc CHANGED
@@ -249,6 +249,20 @@ types or property names. Instead, discover them at runtime:
249
249
  This pattern lets agents work with any dataset without needing hardcoded
250
250
  knowledge of what's in the graph.
251
251
 
252
+ ## Semantics-First Data Handling
253
+
254
+ For reliable agent behavior, prefer typed semantics over string heuristics:
255
+
256
+ - **Use canonical endpoints/tools for each domain.** Example: fetch events
257
+ from event APIs (`elemental_get_events` / event endpoints), not by scanning
258
+ unrelated property names for words like "event" or "filing".
259
+ - **Treat reference-typed properties as links, not display text.** For
260
+ relationship/reference values (`data_nindex` and similar), resolve linked
261
+ entities before presenting user-facing output.
262
+ - **Interpret 404s as data absence first.** A 404 on entity/property lookups
263
+ usually means "not found in current data," not transport failure. Validate
264
+ connectivity separately (for example, with health endpoints).
265
+
252
266
  ## API Gotchas
253
267
 
254
268
  ### `getSchema()` response structure differs by endpoint
@@ -121,7 +121,7 @@ Match the brief: dashboards from `/api/...`, **chat** as primary, or both. No El
121
121
 
122
122
  ---
123
123
 
124
- ## Step 7: Verify
124
+ ## Step 7: Verify and Commit
125
125
 
126
126
  After building, ensure dependencies are installed and run a production build:
127
127
 
@@ -130,7 +130,26 @@ test -d node_modules || npm install
130
130
  npm run build
131
131
  ```
132
132
 
133
- Fix any build errors. Then suggest the user run `npm run dev` to preview locally.
133
+ Fix any build errors. Then format and commit:
134
+
135
+ ```bash
136
+ npm run format
137
+ git add -A
138
+ git commit -m "[Agent commit] Initial app build from project brief"
139
+ ```
140
+
141
+ **Push directly to main.** Vercel auto-deploys on push to main, so this
142
+ gets the app live immediately. Do NOT try to create a pull request via
143
+ `gh pr create` — in Cursor Cloud environments, the GitHub integration
144
+ token lacks PR permissions (known Cursor issue). Pushing to main is the
145
+ correct workflow.
146
+
147
+ ```bash
148
+ git push origin main
149
+ ```
150
+
151
+ If running locally (not in Cursor Cloud), the user may prefer a PR-based
152
+ workflow — ask before pushing directly to main in that case.
134
153
 
135
154
  Deploy agents as needed; if the brief relies on **materialized** data, run or schedule the relevant agents before expecting full UI data.
136
155
 
@@ -138,21 +157,26 @@ Deploy agents as needed; if the brief relies on **materialized** data, run or sc
138
157
 
139
158
  ## Step 8: Deploy Agents and Next Steps
140
159
 
141
- If the app includes agents in `agents/`, offer to deploy them now:
160
+ If the app includes agents in `agents/`, **deploy them automatically** —
161
+ don't ask for confirmation. Run `/deploy_agent` for each agent immediately
162
+ after pushing. The brief asked you to build an app with agents; deploying
163
+ them is part of delivering a working app.
164
+
165
+ **Skip `example_agent`** — this is a template placeholder, not a real
166
+ agent. Only deploy agents you actually built for this project.
142
167
 
143
- > Your app is built! I see you have an agent in `agents/`. Want me to
144
- > deploy it now? I can run the deployment for you.
168
+ After triggering deployment, monitor it yourself (see `/deploy_agent`
169
+ Step 6 for how to poll). Only escalate to the user if deployment fails
170
+ and you can't resolve it.
145
171
 
146
- If the user agrees (or if this is an automated build), run `/deploy_agent`
147
- to deploy each agent. Don't just tell the user to type the command — do it
148
- for them. Ensure MCP is configured for the agent runtime per `agents-data`.
172
+ If DESIGN.md explicitly says NOT to deploy, or says to wait for user
173
+ confirmation, respect that. Otherwise, deploy without asking.
149
174
 
150
175
  Then present next steps:
151
176
 
152
177
  > Here's what you can do next:
153
178
  >
154
- > - **Preview locally** with `npm run dev`
155
- > - **Push to deploy** — Vercel auto-deploys on push to main
156
- > - **Deploy agents** — I can deploy them for you, or use the Deploy
157
- > button on the Broadchurch portal's project page
158
- > - **MCP servers** — same as above, from the portal or ask me
179
+ > - **Preview the app** Vercel auto-deployed on push to main
180
+ > - **Agents are deploying** — I triggered deployment; it typically
181
+ > takes 2-5 minutes. I'll let you know when they're registered.
182
+ > - **MCP servers** — deploy from the Broadchurch portal or ask me
@@ -34,6 +34,22 @@ export DATABASE_URL="postgresql://..."
34
34
 
35
35
  MCP tools handle schema, entity resolution, related entities, events, sentiment, etc. Use them for **discovery** in research agents and for **batch extraction** in sync agents. Match tool choice to the pattern (A/B/C) in each agent’s `instruction`.
36
36
 
37
+ ## Reliability invariants (MCP agents)
38
+
39
+ For MCP-first agents, enforce these runtime rules:
40
+
41
+ - **Resolve first, then fan out.** Start with explicit entity resolution
42
+ before domain-specific calls (events, filings, relationships, sanctions).
43
+ - **Use canonical MCP tools for domain data.** Prefer dedicated tools such as
44
+ `elemental_get_events` for events; avoid deriving domain semantics from
45
+ PID/property-name substring matching.
46
+ - **Use IDs internally, names externally.** Pass NEIDs/entity IDs to tools
47
+ for precision, but present user-facing output using resolved names.
48
+ - **Dereference linked values before display.** If a returned property value
49
+ points to another entity, resolve it to a display name in final output.
50
+ - **Gather, then synthesize.** Let tools gather structured evidence first;
51
+ produce final narrative only after retrieval steps complete.
52
+
37
53
  ## When HTTP `elemental_client` still appears
38
54
 
39
55
  **api-mcp** agents often use **`broadchurch_auth`** + REST. In **mcp-only**, prefer **MCP** for graph access unless you have a concrete reason to call REST from Python (e.g. legacy batch job). Do not route **Vue** through REST for the primary architecture — that contradicts mcp-only.