Skip to content

Add Program Status Protocol support - #8

Merged
tmosleyIII merged 3 commits into
mainfrom
chore/tmosley/protocol-updates
Oct 7, 2026
Merged

tmosleyIII merged 3 commits into
mainfrom
chore/tmosley/protocol-updates

Conversation

@tmosleyIII

Copy link
Copy Markdown
Contributor

Summary

  • report nebu-sql query lifecycle through OSC 7501 with auto, always, and never modes
  • suppress child processor status so query-level state remains authoritative
  • use file-descriptor terminal detection and document the behavior
  • cover success, error, cancellation, protocol encoding, and child environment handling

Verification

  • go test ./...
  • go build ./...
  • go vet ./...
  • git diff --check

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

User-facing mode documentation is incomplete, and the core auto/never mode behavior lacks coverage.

2 open findings
What changed in this PR

Adds OSC 7501 query lifecycle reporting while keeping query output and child processor statuses isolated.

Changes:

  • Adds configurable auto, always, and never status modes.
  • Reports query success, failure, and cancellation states.
  • Disables child processor status and adds supporting tests.
File Description
README.md Introduces terminal status reporting.
internal/​programstatus/​programstatus.go Encodes and sanitizes OSC 7501 reports.
internal/​programstatus/​programstatus_test.go Tests encoding and sanitization.
internal/​processor/​exec.go Disables status in processor subprocesses.
internal/​processor/​exec_test.go Tests child environment handling.
internal/​app/​run.go Integrates status configuration and lifecycle reporting.
internal/​app/​run_test.go Tests parsing, reporting, and terminal detection.
go.mod Adds the terminal-detection dependency.
go.sum Updates dependency checksums.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/app/run_test.go Outdated
Comment on lines +269 to +270
if !strings.Contains(stderr.String(), "state=working") || !strings.Contains(stderr.String(), "state=done") {
t.Fatalf("status output = %q, want working and done", stderr.String())
Comment thread README.md
- **Less query boilerplate** — you write `FROM nebu('token-transfer', ...)` instead of rebuilding the same `read_json('/dev/stdin')` pattern every time.
- **Schema-aware discovery** — `nebu-sql` uses `--describe-json` to expose processor-specific top-level columns, so the query surface follows the processor contract.
- **One SQL surface for many processors** — every installed processor that supports `--describe-json` becomes queryable through the same function shape.
- **Terminal-aware status** — long-running queries report `working`, `done`, `idle`, and `error` through OSC 7501 without mixing status into query results.
@tmosleyIII
tmosleyIII merged commit ddd0271 into main Oct 7, 2026
2 checks passed
@tmosleyIII
tmosleyIII deleted the chore/tmosley/protocol-updates branch October 7, 2026 19:47
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.

2 participants