libredb / libredb/libredb-studio

Add a live-PostgreSQL regression check for the agent read-only profile to functional-smoke.sh

Open
#547 1 comment 0 reactions 1 assignee Claimed by @Vardhan2006 View on GitHub
hacktoberfest help wanted
Dominant language
TypeScript
Stars
726
Forks
119
Avg merge
7h 41m
Merged PRs (30d)
284

Description

The agent's PostgreSQL read-only execution profile is regression-tested against a hand-written mock of the server in `tests/integration/db/postgres-provider.test.ts`. The mock matched live PostgreSQL behaviour when the profile was written, but a mock cannot catch a regression on the other side of the seam: a `pg` driver upgrade, a PostgreSQL version that behaves differently, or a connection option that quietly changes meaning.

The repo already has one piece of live-database CI infrastructure: a throwaway PostgreSQL container behind `loop/scripts/functional-smoke.sh`.

**Fix.** Extend that script (do not add a database service to every test job) with a check that starts the container, connects through the resolved agent read-only role, and asserts that (a) a direct write statement is rejected and (b) a multi-command string (two statements separated by `;`) is rejected, both through the real profile.

**Done when** the new check fails against an intentionally broken profile (prove it catches something first) and passes against the real one. Additive test-only work; local reproduction needs Docker and nothing else.

Context: `docs/BACKLOG.md`, entry A5.

---
Curated for Hacktoberfest 2026. Comment to claim it before you start so two people do not work on the same issue. A PR must reference this issue and land with its tests in the same change; see CONTRIBUTING.md. Repo rules that apply: write the failing test first, run `bun run test` (never bare `bun test`), and the 100% line-coverage gate must stay green.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.