Add df.status_by_label() and clarify df.status() requires instance_id#181
Add df.status_by_label() and clarify df.status() requires instance_id#181Copilot wants to merge 4 commits into
Conversation
… not label - Add `df.status_by_label(label TEXT)` Rust function in src/monitoring.rs that returns the status of the most recently started instance with the given label, returning NULL when no match exists (respects RLS) - Register the function in sql/pg_durable--0.1.1.sql - Update docs/api-reference.md: add note on df.status() warning about label vs instance_id confusion, and add full df.status_by_label() documentation entry - Update USER_GUIDE.md Quick Status Check section with df.status_by_label() example and a tip explaining the label vs instance_id distinction - Update .github/skills/pg-durable-sql/SKILL.md with status_by_label reference - Extend tests/e2e/sql/05_monitoring_and_explain.sql to exercise status_by_label for both a known label and an unknown label Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
- Add CREATE OR REPLACE FUNCTION df.status_by_label to the 0.2.1→0.2.2 upgrade script so users upgrading from 0.2.1 also receive the new function - Update docs/upgrade-testing.md to include df.status_by_label() in the monitoring functions table for upgrade scenario tests Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
…error handling note - docs/api-reference.md: remove 'eight-character hex' from df.status() note; use 'unique identifier returned by df.start()' instead - tests/e2e/sql/05_monitoring_and_explain.sql: add comment clarifying status_by_label test uses the same label as the df.start() call above it - src/monitoring.rs: document the NULL-on-error behaviour of status_by_label and note its intentional consistency with df.status() Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
PR #181 — Society of Thought Review (parallel) + Independent Opus 4.8 Self-ReviewTarget: microsoft/pg_durable PR #181 (Issue #167 — "Clarify that Review Summary
Independent Self-Review Reconciliation (Opus 4.8)An independent pass re-derived every claim from the raw diff, schema SQL, and sibling source — no specialist conclusion overturned.
🔴 Must-FixMF-1 — Install/upgrade paths don't register the function; PR edits obsolete history. MF-2 — Status casing contract mismatch. 🟡 Should-FixSF-1 — Duplicate-label nondeterminism. SF-2 — NULL conflates no-match vs SPI error. SF-3 — No index for label lookup. Only SF-4 — Hardcoded 🔵 Consider
Observations
|
There was a problem hiding this comment.
see above review comments. @pinodeca let me know i can start a fresh PR to close this issue, as this PR 181 is behind the main by 74 commits.
df.status()accepts aninstance_id, not a label — passing a label silently returnsNULL, making it easy for callers who usedf.start(..., 'my-label')to unknowingly query the wrong identifier.New function:
df.status_by_label(label TEXT)Returns the status of the most recently started instance matching the given label. Respects RLS (queries via SPI). Returns
NULLwhen no visible instance matches.Changes
src/monitoring.rs—status_by_labelimplementation; documents NULL-on-error behaviour (consistent withdf.status())sql/pg_durable--0.1.1.sql— C wrapper registration for fresh installssql/pg_durable--0.2.1--0.2.2.sql—CREATE OR REPLACE FUNCTIONfor the upgrade pathdocs/api-reference.md— warning note ondf.status()clarifying it needs aninstance_id; full entry fordf.status_by_label()USER_GUIDE.md— updated Quick Status Check section with label-based example and tipdocs/upgrade-testing.md— addeddf.status_by_label()to the monitoring functions tabletests/e2e/sql/05_monitoring_and_explain.sql— tests correct status for a known label andNULLfor an unknown one