Pg jev

From akillness/jeo-skills · View interactive version

Pg jev is an AI agent skill from the GitHub repository akillness/jeo-skills. Operate realZachi/pg-jev, the `jev` PostgreSQL extension for plain-language row predicates, probabilities, choices, and scores backed by TypeSafe Jev. Use when a user mentions pg-jev, pgjev, `CREATE EXTENSION jev`, `jev()`, `jev_prob`, `jev_choice`, `jev_score`, `jev_eval`, natural-language SQL filt

How to use this skill

Skill file

pg-jev — PostgreSQL Jev extension operator

When to use this skill

Use this skill for the exact realZachi/pg-jev extension: offline preflight,

approved installation or upgrade, endpoint/key configuration, SQL using public

jev functions, spend/performance checks, smoke-test proof, and troubleshooting.

Do not confuse it with the TypeSafe Jev decision harness: route Jev profile or

decision-service work to CODE0

and explicit remote discovery to CODE0.

Generic PostgreSQL schema, query-planning, or security work belongs in the relevant

PostgreSQL skill.

Instructions

1. Freeze scope and run the offline audit

  1. Name the target server/database, PostgreSQL major, installed extension version,

and endpoint before any action. Never put passwords, password-bearing URIs, or

API keys in prompts, shell history, committed SQL, logs, or this skill.

  1. Run the helper before live work; it opens no PostgreSQL/provider session:

```bash

python3 .agent-skills/pg-jev/scripts/preflight.py --json

python3 .agent-skills/pg-jev/scripts/preflight.py --repo /path/to/pg-jev --expect-commit e3450d44f7f6745aa2d728c9289b9ca4a6feda9a --json

```

From an installed root: python3 "$SKILLS_ROOT/pg-jev/scripts/preflight.py" --json.

It checks Python/current host and pg_config, make, psql, and git, plus

supplied source structure and the caller-supplied commit pin. ok is not proof

of PostgreSQL 14–17 support, matching plpython3u, server permissions/egress,

endpoint compatibility, credentials, or semantic quality; inspect the exact

checks and runtime_verified: false.

  1. Treat CREATE/ALTER EXTENSION, package/PGXN/Docker installation, role/database

GUC changes, ACL changes, smoke tests, and every query that can send row data as

separate approval-gated operations. The helper performs none of them.

2. Keep the four hard safety boundaries inline

TYPESAFE_API_KEY from the PostgreSQL server process; a client-shell variable

is irrelevant. Enter a key privately only after endpoint/scope approval, and never

print, echo, commit, paste, or SHOW the real value.

Require explicit disclosure and cost approval; keep deterministic filters in SQL and

expose only needed columns through a narrow view.

execute ACL. Revoke it and grant only approved roles before allowing provider data;

re-check after upgrades. jev.max_* GUCs are cooperative, not hard security caps.

rows) can reach PL/Python and fail at row_json.encode(). Guard with an inner join,

WHERE joined_alias IS NOT NULL, or a non-null materialized view before jev(...).

3. Reach the detailed operation only when its branch fires

For pinned control/SQL evidence, PGXS/PGXN/Docker commands, ACL SQL, GUC/API payload

contract, public function signatures, spend defaults, smoke proof, and troubleshooting,

read CODE0. It preserves every audited

operation and citation without loading those details for an offline-only check.

Examples

Offline source audit

python3 .agent-skills/pg-jev/scripts/preflight.py --repo /work/pg-jev --expect-commit e3450d44f7f6745aa2d728c9289b9ca4a6feda9a --json

Review blocked checks; do not treat path presence or tool availability as runtime

support or consent to send data.

Approved live workflow

Read the relevant branch in CODE0, then

obtain separate approval for installation, ACL/GUC changes, provider disclosure, and

smoke proof. Keep endpoint class, version, request statistics, and errors—but never

credentials—in the evidence record.

Best practices

major and pg_config path.

row/character spend guards in shared deployments.

provider or semantic correctness from a successful SQL install alone.

failed egress, invalid credentials, local-server contract uncertainty, and nullable

composite hazards plainly.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.