feat(query): add composite pipeline audit commands#8
Merged
Conversation
4 tasks
alexskatell
added a commit
that referenced
this pull request
May 13, 2026
#9) Bundled skill docs were still telling agents to author a hand-rolled composite SQL string for the standard pipeline audit. Now that `topline --agent query audit|snapshot|freshness` ship as composite warehouse commands (PR #8), the documented contract collapses to: 1. query doctor 2. query audit --pipeline ... --since ... --status open 3. answer Hard ceiling drops from 4 calls to 3. Raw `query sql` is reserved for non-standard analytics only. Adds an explicit pitfall: bash heredocs around `query sql` (`SQL=\$(cat <<'SQL' ... SQL)` or `--sql "\$(cat <<SQL ... SQL)"`) are the bash form of the Python wrapper anti-pattern and are banned in the default flow. If a question is a standard pipeline rollup, the answer is `query audit`, not a hand-built multi-line SQL string. hermes SKILL bumped to v1.5.0; claude-code SKILL keeps no version field but is brought to the same contract. Co-authored-by: Alex Skatell <alex@topline.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
topline query freshnessfor thewarehouse_freshnessview.topline query snapshot --pipeline <id>for stage/value rollups frompipeline_snapshot.topline query audit --pipeline <id>as the single agent-facing audit primitive wrapping freshness, snapshot, activity, active deals, and movement from the composite warehouse views.status=open, with--status allescape hatch.COUNT(DISTINCT source_id)so view fan-out does not inflate touch counts.avg_days_in_stageto integer in CLI output so--agentPII masking cannot corrupt long decimal JSON numbers.Test Plan
go test ./...query auditagainst Sales - Flex - Qualified; output parsed as valid JSON and returned activity/deals/snapshot/movement keys.