Skip to content

feat(station-host): expand black-box HTTP parity suites (Batch 4), map default-visibility, and fix status watch & deleted-session policy scope - #10466

Open
CommaBot wants to merge 1 commit into
mainfrom
feat/pion-blackbox-http-batch4
Open

CommaBot wants to merge 1 commit into
mainfrom
feat/pion-blackbox-http-batch4

Conversation

@CommaBot

@CommaBot CommaBot commented Dec 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Expands the real-binary black-box HTTP parity runner (pion/station-host/tests/run-node-http-blackbox.mjs) from 43/43 (12 suites) to 53/53 PASS across 19 suites (+7 new suites, +10 tests), maps #10448 station/test/default-visibility.test.ts to restore full-repo unmapped: 0, and fixes 2 production HTTP parity bugs uncovered against stillfail-station-pion.

Production Bugs Fixed

  1. Unix status.sock GET /v1/status?watch=1 NDJSON streaming (pion/station-host/host_http/src/server.pion, connected.pion, http_test.pion):
    • Previously LocalStatus's Status route ignored ?watch=1, returned text/plain without a trailing newline, and closed the connection immediately.
    • Now supports ?watch=1 (any watch other than 0/false) as an event-driven application/x-ndjson stream (Cache-Control: no-store) emitting the initial snapshot immediately and pushing changed status snapshots on self.history publications with backpressure-safe cursor advancement, while non-watch GET /v1/status returns application/json, Cache-Control: no-store, and a trailing \n.
  2. Home-workspace deleted-session inclusion in decision_checks (pion/station-host/host_sessions/src/decisions_member.pion):
    • Previously dec_query_recent_and_summary used JOIN sessions s ON s.key = d.session (INNER JOIN), dropping decision_checks rows for deleted sessions even for the home workspace (diverging from Node's LATEST_DECISIONS_SCOPED).
    • Changed to LEFT JOIN sessions s ON s.key = d.session, matching dec_scope_sql and dec_session_visible so home-workspace managers include deleted-session checks while joined workspaces remain strictly isolated.

New Black-Box HTTP Suites (Batch 4)

  • pion/station-host/tests/e2e/blackbox-http-default-visibility.test.ts: PUT /connects/:id defaultVisibility validation/persistence/GET /overview projection + threads.default_hidden and per-viewer shown_chats/hidden_chats via PUT /threads/:id/hidden
  • pion/station-host/tests/e2e/blackbox-http-local-status.test.ts: Unix status.sock GET /healthz, GET /v1/status, GET /v1/status?watch=0|1 NDJSON streaming, 404/405 rejection, and enrolled: false with removed_at
  • pion/station-host/tests/e2e/blackbox-http-renewal-role.test.ts: real QUIC member-door lock-refused renewal preserving prior workspace/role, admitted renewal upgrading role, and lock-refused hello returning lock_unconfirmed + lock + entries
  • pion/station-host/tests/e2e/blackbox-http-compress.test.ts: real-wire zstd negotiation (>=512B JSON compressed with content-encoding: zstd and no content-length, gzip-only/absent/small/image/png bypass, live zstd SSE GET /events)
  • pion/station-host/tests/e2e/blackbox-http-host-resources.test.ts: GET /host live + STILLFAIL_TEST_HOST=1 fictional sample, GET /workspaces & POST /workspaces/join RBAC, POST /resources/processes/:pid/end RBAC & non-chat pid refusal
  • pion/station-host/tests/e2e/blackbox-http-projects-presets.test.ts: GET/PUT /projects/info, PUT /threads/:id/classification, POST /projects/rename, POST /projects/merge, RBAC, PROJECTS.jsonl persistence, and joined-workspace isolation
  • pion/station-host/tests/e2e/blackbox-http-decisions-scope.test.ts: PUT /automatic-decisions/policy validation/RBAC, concurrent GET /overview isolation across home managers / members / viewers / joined admin (including deleted-session home-workspace count), and policy-change refresh

Honest Ledger Updates

  • station/test/default-visibility.test.ts: unmapped -> partial (full-repo unmapped: 1 -> 0)
  • station/test/overview-decisions-dedup.test.ts: deferred_gap -> partial (deferred_gap: 78 -> 77)
  • Narrowed partial gaps: local-status.test.ts, renewal-role.test.ts, compress.test.ts, policy-decisions-scope.test.ts, projects-classification.test.ts, resources-watch.test.ts, multi-workspace.test.ts

Verification

  • pionc fmt --check on touched .pion files: PASS
  • pionc check --json pion/station-host: {"ok":true,"diagnostics":[]}
  • pionc test --json pion/station-host -p host_http: 7/7 PASS
  • pionc test --json pion/station-host -p host_sessions --filter dec_: 8/8 PASS
  • bash pion/station-host/scripts/build.sh linux-x64 + node pion/station-host/tests/run-node-http-blackbox.mjs: 53 passed, 0 failed across 19 suite(s)
  • python3 pion/station-host/scripts/parity_audit.py --self-test & --json: 152 checks OK, unmapped: 0, ledger_errors: []
  • sh scripts/undone.sh origin/main HEAD & sh scripts/check.sh push origin/main..HEAD: PASS

Model: Gemini 4 Neon. Test frameworks: node --test, pionc test, parity_audit.py --self-test.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@CommaBot
CommaBot force-pushed the feat/pion-blackbox-http-batch4 branch from 055fb37 to bf6bbd6 Compare December 6, 2026 01:21
@zanwei
zanwei enabled auto-merge (squash) December 6, 2026 01:25
…p default-visibility, and fix status watch & deleted-session policy scope

Add 7 real-binary black-box HTTP parity suites (53/53 PASS across 19 suites) against `stillfail-station-pion` and fix 2 production HTTP parity bugs uncovered during verification:
- host_http/src/server.pion + connected.pion + http_test.pion + host_main/{main,rig}.pion + host_sessions/{actor,member_events}.pion: wire session/turn/overview and cloud roster changes into LocalStatus (`boxes[2]`), support `GET /v1/status?watch=1` 500ms-debounced NDJSON streaming (`application/x-ndjson`, `Cache-Control: no-store`, single `status()` per settle window, chunked `c.response` delivery with slow-reader coalescing, immediate EOF fd reclamation under the 128-client cap), and return `application/json` + `no-store` + trailing newline on `GET /v1/status`
- host_sessions/src/decisions_member.pion: use `LEFT JOIN sessions` in `dec_query_recent_and_summary` so deleted-session `decision_checks` remain included for the home workspace while excluded from joined workspaces

Honest ledger updates (zero overlap with in-flight PRs):
- station/test/default-visibility.test.ts: unmapped -> partial (full-repo unmapped 1 -> 0)
- station/test/overview-decisions-dedup.test.ts: deferred_gap -> partial
- station/test/local-status.test.ts, renewal-role.test.ts, compress.test.ts, policy-decisions-scope.test.ts, projects-classification.test.ts, resources-watch.test.ts, multi-workspace.test.ts: narrowed partial gaps with real-binary HTTP coverage

Co-authored-by: zuozijian <26162189+zuozijian@users.noreply.github.com>
@CommaBot
CommaBot force-pushed the feat/pion-blackbox-http-batch4 branch from bf6bbd6 to bd2ee47 Compare December 6, 2026 01:35

This branch has not been deployed

No deployments
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