Add @obelisk-apps/cli with the existing build, search, query, and attune contract plus official skill installation. Separate the docs-only skill artifact, bootstrap installer, release layout, cross-platform CI, and package-level regression coverage.
2.6 KiB
2.6 KiB
Obelisk Pitfalls
Use this after a query error, suspicious empty result, over-large output, or
unclear helper row shape. For query design, read retrieval-semantics.md first.
Missing Columns And Wrong Aliases
Common wrong guesses:
- Summaries: use
sourceandcontent; do not usesummary_typeortext. - Tool call name: use
tool_calls.name.tool_nameis only an alias inSELECT tc.name AS tool_name;tc.tool_nameis not a column. - Tool call timestamps:
tool_callshas no timestamp. Joinmessages m ON m.uuid = tc.message_uuid. - Tool result timestamps:
tool_resultshas no timestamp. Joinmessages m ON m.uuid = tr.message_uuid. - Workflow agent message counts:
workflowTree()returnsmessageCountfor agents.
When uncertain, inspect a tiny sample instead of guessing:
const rows = summaries({ limit: 1 });
return rows.length ? Object.keys(rows[0]) : [];
FTS5 Syntax Errors
search(text) uses raw FTS5 MATCH. Hyphenated terms and punctuation can be
parsed as syntax.
// tokenized phrase for FTS
search('"workflow script"', { limit: 10 })
For literal punctuation, use SQL LIKE under the same scope:
sql(`
SELECT m.uuid, s.id AS session_id, s.title, substr(m.text,1,180) AS snippet
FROM messages m
JOIN sessions s ON s.id = m.session_id
WHERE s.project LIKE ?
AND m.text LIKE ?
ORDER BY m.timestamp DESC
LIMIT 10
`, '%quiet-zero%', '%workflow-script%')
Over-Large Runtime JSON
If runtime stdout is large, fix the query instead of reading it in chunks.
- Lower
LIMIT. - Shorten snippets to 160-240 chars.
- Group in SQL/JS and return counts plus sparse examples.
- For
fileHistory(), filter toEdit/Writebefore projecting evidence. - For
workflowTree(), omitscript,result_json, and full agent messages unless explicitly requested. - Use
raw(uuid, { offset, limit })only after identifying one specific message UUID.
Empty Results
An empty array can be the correct answer for exact scopes or sentinels.
When the user asks for a scoped project/file/session or exact term:
- run the scoped query;
- return
[]or compact counts; - say no matching prior result was found;
- do not call
recent(), all-projectsummaries(), orthread()as fallback unless the user asks.
Counting From Snippets
If the user asks "how many", "counts", "top N", or "group by", compute it in SQL or in the query script. Do not infer counts from visible snippets.
sql(`
SELECT tc.name AS tool_name, COUNT(*) AS n
FROM tool_results tr
JOIN tool_calls tc ON tc.id = tr.tool_use_id
WHERE tr.is_error = 1
GROUP BY tc.name
ORDER BY n DESC
LIMIT 10
`)