Skip to content

Experimental Alexandria syntax - #283

Merged
developersdigest merged 1 commit into
mainfrom
feat/experimental-alexandria-syntax
Sep 25, 2026
Merged

developersdigest merged 1 commit into
mainfrom
feat/experimental-alexandria-syntax

Conversation

@developersdigest

@developersdigest developersdigest commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Adds an undocumented experimental Alexandria command.

Validation: focused tests, typecheck, build, and live preview.


Summary by cubic

Adds a hidden, experimental sql command that forwards raw SQL to the existing Alexandria handler for the firecrawl provider.

  • Accepts a query as an argument, via --file, or from stdin, with a 16,000-character limit.
  • Rejects ambiguous and empty input before dispatching.
  • Added tests for dispatch and input validation; command is hidden from help output.

Written for commit 015f8e8. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Confidence score: 3/5

  • In src/commands/sql.ts, --file reads the entire file before applying the 16,000-character limit, so a very large file could exhaust memory or hang the command; read at most 16,001 characters and reject oversized input.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/commands/sql.ts">

<violation number="1" location="src/commands/sql.ts:12">
P2: `--file` loads the entire file before enforcing the 16,000-character limit, so a large path can exhaust memory or hang instead of being rejected. Read at most 16,001 characters from the file and reject oversized input before accumulating it.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/sql.ts
): Promise<string> {
if (query !== undefined && file !== undefined)
throw new Error('Use either a query or --file.');
if (file !== undefined) query = await readFile(file, 'utf8');

@cubic-dev-ai cubic-dev-ai Bot Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: --file loads the entire file before enforcing the 16,000-character limit, so a large path can exhaust memory or hang instead of being rejected. Read at most 16,001 characters from the file and reject oversized input before accumulating it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/sql.ts, line 12:

<comment>`--file` loads the entire file before enforcing the 16,000-character limit, so a large path can exhaust memory or hang instead of being rejected. Read at most 16,001 characters from the file and reject oversized input before accumulating it.</comment>

<file context>
@@ -0,0 +1,57 @@
+): Promise<string> {
+  if (query !== undefined && file !== undefined)
+    throw new Error('Use either a query or --file.');
+  if (file !== undefined) query = await readFile(file, 'utf8');
+  if (query === undefined) {
+    if (stdin.isTTY) throw new Error('Provide a query, --file, or stdin.');
</file context>
Fix with cubic

@developersdigest
developersdigest merged commit a8b9aea into main Sep 25, 2026
8 checks passed
@developersdigest
developersdigest deleted the feat/experimental-alexandria-syntax branch September 25, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant