You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(agent): address PR #1092 review findings from Bugbot and CodeRabbit
- `sql_explain` analyze-safety guard hardened: string literals are masked
BEFORE comments (comments-first was bypassable via quoted `/*`..`*/` markers
smuggling DML), multi-statement payloads rejected (non-trailing `;`), and
dollar-quoted strings fail closed; adversarial tests added
- rewrite verify gate tightened from `decidable !== false` to
`decidable === true` — the field is required since altimate-core@0.5.1, so a
missing value is a malformed response and fails closed
- `sql_diff` now forwards `schema_context`/`dialect` to the native handler
(equivalence never ran before — no schema ever reached it) and reports
"not assessed" instead of "not proven" when no schema is supplied
- warehouse-write boundary wording aligned: the agent description and prompt
now state that the direct SQL write tool is denied non-overridably while dbt
builds run only as user-approved shell commands against a dev target; a new
test documents the boundary under permissive global + per-agent bash
overrides (builds allowed, DDL and sql_execute_write still denied)
- live eval: tmpdir cleanup via `await using tmpdir()` on all exit paths;
nonzero CLI exit now fails the eval
- docs: https links, one-line reference labels (MD039), Databricks
liquid-clustering citations [14]->[21], and a status note on the catalog
research doc recording the security review's four design requirements for
the future SaaS distribution (not built in this PR)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/internal/2026-08-12-agent-catalog-scaling-research.md
+25-13Lines changed: 25 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,22 @@
1
1
# Scaling Agent Catalogs Without Losing TUI Speed
2
2
3
+
> **Status: research record, not an implementation spec.** The SaaS distribution
4
+
> design sketched below (control plane, signed bundles, capability tiers) is NOT
5
+
> built; nothing in this document changes runtime behavior. Security review
6
+
> flagged four design requirements that any implementation must resolve before
7
+
> shipping, tracked here as design inputs:
8
+
> 1. cache entries partitioned by full authorization scope + policy version, with
9
+
> defined offline/revocation behavior including active sessions;
10
+
> 2. warehouse-write denial for optimizer-class agents expressed as a
11
+
> non-overridable deny state, not an approval tier (the shipped `dbt-optimizer`
12
+
> already enforces this in `agent.ts` — `sql_execute_write` deny is re-applied
13
+
> after all config merges);
14
+
> 3. promotion to primary restricted to `mode: both` definitions with
15
+
> immutable-manifest + session-policy validation, never a safety label alone;
16
+
> 4. a non-self-referential signature envelope (canonical serialization, signature
17
+
> excluded from signed bytes, algorithm + key ID) and redacted, allowlisted
18
+
> audit payloads.
19
+
3
20
## Executive Summary
4
21
5
22
-**Hybrid Selection**: Claude Code, OpenCode, Cursor, Codex, and Cline all expose a user-facing agent that can delegate bounded work to specialists, while also offering explicit ways to invoke or configure specialists. Claude Code uses description-based routing plus explicit `@` selection, and OpenCode uses automatic invocation plus `@` mentions. [16][16][5][5] -> Keep automatic delegation, but always provide an explicit picker and mention syntax.
@@ -192,24 +209,20 @@ On distribution, use the same boundary that the strongest platforms expose: huma
192
209
12. *Configure the sandboxed Bash tool*. https://code.claude.com/docs/en/sandboxing
17. *Discover and install prebuilt plugins through marketplaces*. http://code.claude.com/docs/en/discover-plugins
214
+
17. *Discover and install prebuilt plugins through marketplaces*. https://code.claude.com/docs/en/discover-plugins
198
215
18. *Preparing to use custom agents in your organization*. https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-organization/prepare-for-custom-agents
199
216
19. *Creating and using custom agents for GitHub Copilot CLI*. https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli
56. *Managing GPT access in Enterprise and Edu workspaces | OpenAI Help Center*. https://help.openai.com/en/articles/8555535-managing-gpt-access-in-enterprise-and-edu-workspaces
Copy file name to clipboardExpand all lines: docs/internal/2026-08-12-dbt-optimization-taxonomy-research.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ The key implementation rule is to recommend a strategy together with its failure
65
65
66
66
## 3 Warehouse Physical Design and Storage Taxonomy
67
67
68
-
Physical design should be inferred from recurring filters, join keys, partition coverage, and query profiles. It should not be generated from column names alone. Snowflake's micro-partition metadata supports runtime pruning [33], while Databricks liquid clustering is documented as a data-layout technique that replaces traditional partitioning and ZORDER [14]. Those mechanisms are similar in purpose but not interchangeable.
68
+
Physical design should be inferred from recurring filters, join keys, partition coverage, and query profiles. It should not be generated from column names alone. Snowflake's micro-partition metadata supports runtime pruning [33], while Databricks liquid clustering is documented as a data-layout technique that replaces traditional partitioning and ZORDER [21]. Those mechanisms are similar in purpose but not interchangeable.
69
69
70
70
| Engine and use-case | Detection signal and evidence needed | Proposed fix | Impact | Risk and preconditions | Agent confidence |
71
71
|---|---|---|---|---|---|
@@ -78,7 +78,7 @@ Physical design should be inferred from recurring filters, join keys, partition
78
78
| BigQuery partition pruning defeated | Partition filter is wrapped in a function, uses a mismatched type, or is applied after a broad subquery | Use direct partition-column predicates and push them to the scan | C, R | Correctness depends on timezone and inclusive boundary rules | Medium |
79
79
| BigQuery required partition filter missing | Large partitioned table is queried without a bounded partition predicate | Set `require_partition_filter`; add model/source conventions and tests | C, Q | It can break legitimate unbounded jobs and BI queries, so propose with affected-consumer list | Medium |
80
80
| BigQuery clustering missing or wrong | Repeated filters after partition pruning still scan many blocks; common equality/range columns are visible in query history | Add up to the engine-supported clustering columns in predicate/join order; validate bytes and slot time | C, R | Clustering is not a substitute for partitioning; high-cardinality or unstable keys may not help | Medium |
81
-
| Databricks liquid clustering candidate | Delta table has recurring filters on dimensions, poor data skipping, and frequent schema/query evolution | Use liquid clustering on observed keys; run/monitor `OPTIMIZE` according to platform policy | C, R | Liquid clustering replaces partitioning/ZORDER and is not a drop-in change for all runtimes [14]; maintenance consumes compute | Low to medium |
81
+
| Databricks liquid clustering candidate | Delta table has recurring filters on dimensions, poor data skipping, and frequent schema/query evolution | Use liquid clustering on observed keys; run/monitor `OPTIMIZE` according to platform policy | C, R | Liquid clustering replaces partitioning/ZORDER and is not a drop-in change for all runtimes [21]; maintenance consumes compute | Low to medium |
82
82
| Databricks ZORDER candidate on legacy layout | Legacy Delta table, repeated selective predicates, data-skipping stats show poor locality | ZORDER on a small set of high-value columns, or migrate to liquid clustering | C, R | ZORDER can be inferior to liquid clustering on supported runtimes; avoid piling both without evidence | Medium |
83
83
| Databricks partition explosion | Too many tiny partitions, small files, high task overhead, low rows per file | Remove or coarsen partitions; use liquid clustering or compaction | C, R | File layout and streaming latency can change | Medium |
84
84
| Redshift sort key missing or misordered | Poor sort order, high unsorted region, scans on a recurring time/join predicate, EXPLAIN shows broad scan | Add/reorder sort key; choose compound/interleaved/automatic design appropriate to workload | C, R | Sort maintenance, vacuum, load order, and workload mix matter; use EXPLAIN and history | Medium |
"Scan a dbt project for fixable issues — performance, materialization, repeated logic, missing tests/docs — and propose targeted fixes with cost and impact reporting. File edits and shell commands prompt for approval; warehouse writes are denied.",
386
+
"Scan a dbt project for fixable issues — performance, materialization, repeated logic, missing tests/docs — and propose targeted fixes with cost and impact reporting. File edits and shell commands prompt for approval; the direct SQL write tool is denied non-overridably, and dbt builds against a dev target run only as user-approved shell commands.",
Copy file name to clipboardExpand all lines: packages/opencode/src/altimate/tools/sql-diff.ts
+16-4Lines changed: 16 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,31 @@ import { Dispatcher } from "../native"
4
4
5
5
exportconstSqlDiffTool=Tool.define("sql_diff",{
6
6
description:
7
-
"Compare two SQL queries and show the differences. Returns a line diff plus a semantic-equivalence assessment. Useful for reviewing suggested changes before applying them.",
7
+
"Compare two SQL queries and show the differences. Returns a line diff, plus a semantic-equivalence assessment when schema_context is provided (equivalence needs schema to resolve table/column references). Useful for reviewing suggested changes before applying them.",
8
8
parameters: z.object({
9
9
original: z.string().describe("The original SQL"),
0 commit comments