Skip to content

[schemas] Fix typed-reasoning-edges COMMENT ON syntax error#303

Merged
justfinethanku merged 3 commits into
NateBJones-Projects:mainfrom
lucifer:contrib/lucifer/typed-reasoning-edges-comment-syntax-fix
Jun 18, 2026
Merged

[schemas] Fix typed-reasoning-edges COMMENT ON syntax error#303
justfinethanku merged 3 commits into
NateBJones-Projects:mainfrom
lucifer:contrib/lucifer/typed-reasoning-edges-comment-syntax-fix

Conversation

@lucifer

@lucifer lucifer commented May 14, 2026

Copy link
Copy Markdown
Contributor

Contribution Type

  • Schema (/schemas)

What does this do?

Fixes a syntax error in schemas/typed-reasoning-edges/schema.sql that prevents the migration from running. The COMMENT ON FUNCTION public.thought_edges_upsert IS ... statement uses the SQL || concatenation operator to join three string literals, but PostgreSQL's COMMENT statement requires a single string literal after IS, not an expression. Pasting the script into the Supabase SQL editor fails with:

ERROR: 42601: syntax error at or near "||"
LINE 258: 'Insert or (on duplicate key) bump support_count + refresh temporal bounds. ' ||

Collapsing the three pieces into one literal lets the schema apply cleanly. No behavior change — same comment text.

Requirements

None beyond what schemas/typed-reasoning-edges/ already lists.

Checklist

  • I've read CONTRIBUTING.md
  • No credentials, API keys, or secrets are included
  • Reproduced the error in Supabase SQL editor and verified the patched script runs

Test plan

  • Apply schemas/typed-reasoning-edges/schema.sql from this branch in Supabase SQL editor against a brain that already has schemas/entity-extraction/ applied
  • Verify the thought_edges table exists, the temporal columns on edges exist, and SELECT obj_description('public.thought_edges_upsert'::regproc); returns the expected comment

🤖 Generated with Claude Code

The COMMENT ON FUNCTION statement for thought_edges_upsert used the SQL
|| concatenation operator to join three string literals. PostgreSQL's
COMMENT statement requires a single string literal after IS, not an
expression, so the migration fails with a syntax error at the first ||.

Collapse the three pieces into one literal so the schema applies cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Hey @lucifer — welcome to Open Brain Source! 👋

Thanks for submitting your first PR. The automated review will run shortly and check things like metadata, folder structure, and README completeness. If anything needs fixing, the review comment will tell you exactly what.

Once the automated checks pass, a human admin will review for quality and clarity. Expect a response within a few days.

If you have questions, check out CONTRIBUTING.md or open an issue.

@github-actions github-actions Bot added the schema Contribution: database extension label May 14, 2026
@lucifer

lucifer commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Have we stalled? This should be a strightforward pass

@alanshurafa alanshurafa added review: ready-for-maintainer Community reviewer recommends maintainer review status: duplicate-candidate Community reviewer believes this duplicates existing work area: schemas Review area: schemas/primitives/data model alan-reviewed Reviewed by Alan Shurafa in Community Reviewer role labels May 20, 2026
@alanshurafa

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. Confirmed the fix: PostgreSQL's COMMENT ON FUNCTION ... IS clause takes a single string literal, not a ||-concatenated expression, so the original three-part version would fail to parse. Collapsing it into one literal resolves the error with no behavior change.

One note for the maintainer: #227 makes the same fix to the same lines of schemas/typed-reasoning-edges/schema.sql. The two diffs are byte-identical. A maintainer will likely land one and close the other. Recommend maintainer review.

— Alan (community reviewer; non-binding)

@justfinethanku justfinethanku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maintainer pass complete. Verified this is a surgical SQL syntax fix to the existing COMMENT ON FUNCTION ... IS string literal, refreshed the branch against current main, and confirmed there are no unresolved review threads to carry forward.

@justfinethanku
justfinethanku merged commit f0ac377 into NateBJones-Projects:main Jun 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alan-reviewed Reviewed by Alan Shurafa in Community Reviewer role area: schemas Review area: schemas/primitives/data model review: ready-for-maintainer Community reviewer recommends maintainer review schema Contribution: database extension status: duplicate-candidate Community reviewer believes this duplicates existing work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants