Skip to content

feat(handoff): add read-only status and bounded request watch - #329

Merged
abruption merged 6 commits into
mainfrom
feat/296-handoff-status-view
Oct 23, 2026
Merged

abruption merged 6 commits into
mainfrom
feat/296-handoff-status-view

Conversation

@abruption

@abruption abruption commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a read-only local handoff status view and bounded sampled handoff watch for #296. No new receipt, native submission or observation capability is introduced.

  • Status shows submission, injection observation, receipt assurance/lateness, latest stored wait and permitted next actions. It reads one ledger snapshot without saving retention, creating waits, submitting or launching a collector. Its optional collector-clock query is read-only; older collectors may reject it, with no writing-query fallback.
  • handoff watch --correlation-id UUID [--watch-timeout 1..60] [--interval-ms 1000..5000] [--json] observes one existing local POSIX intent. Defaults are 30 seconds/1,000 ms; only ASCII integer tokens are accepted. It emits the first valid snapshot if budget permits, then changed public metadata/history phase, and an end frame when output permits. This is polling, not a lossless event feed.
  • JSON watch uses a new NDJSON envelope; nested handoff schema and ordinary status JSON are unchanged. Completion exit 0 means watching finished, not ACK or successful wait; SIGINT is 130, operational failure 1 and invalid flags 2. Missing/corrupt history never creates a ledger or invents an epoch; an epoch change stops before showing the new history.
  • The original total deadline covers setup, lock waiting, read/validation boundaries, collector IPC and output. An owned isolated output-only Python helper performs blocking stdout writes without changing inherited descriptor flags. Its private IPC carries bounded public frames only. The final 100 ms of the total budget is reserved for final output/cleanup, so sampling may finish earlier. At most 61 samples, 16 KiB/frame, 256 KiB total, with 2 KiB reserved for the final frame. Uninterruptible OS operations are not a hard-real-time guarantee. Partial or unacknowledged output is not salvaged or followed with another frame; consumers must reject truncated final NDJSON and nonzero exit. A helper completion reply proves OS-write completion, not recipient consumption.
  • Status preserves known submission and a failed/history-unavailable wait after clock recovery, without offering keep_waiting. Receipt lateness relative to the first wait remains distinct from the separately shown latest wait.
  • Four-language documentation and generated standalone CLI are updated. No changes to the frozen handoff contract or golden fixture.

Refs #296. Candidate functionality; no version bump or release is included.

Validation

  • Final generated candidate: Python 3.13.7 with optional extras, development mode and ResourceWarning-as-error: 1,378 tests pass (19 skipped).
  • Python 3.9.6: 128 combined watch/CLI/status/runtime/lifecycle tests pass. Documentation manifest and generator checks pass.
  • Fixtures cover read-only byte/inode/mtime preservation; initial/change-only sampling; epoch change; missing/corrupt/quarantined history; ACK versus latest wait; no native submission/wait/collector startup; budget exhaustion during lookup, lock acquisition and parsing; unsafe/busy errors; output limits; pipe failures; interruption and inherited descriptor integrity. Real temporary Unix sockets/pipes are used in some fixtures; clocks are mocked where stated. The sole output helper is not a native agent or collector.
  • Two parallel independent noninteractive CLI rounds completed before pushing this watch implementation. Claude Code 2.1.308 used confirmed claude-opus-5-5; Codex CLI 0.163.0 used its isolated default (actual model name was not exposed). Both had the same frozen sanitized input per round, successful completion and no tool/test/network authority. Input SHA-256: 336ec24930a54ef662dbef901647a33d00806619e211a79ce45a1d1c80beefcb and d15033c2881081b5f84d2bc548f49b253a1cb3b5353b0b1c4f32d242c50cd900.
  • Verified findings drove fixes for expired-budget reads, shared stdout flag effects, false success on unexpected exceptions, child-registration/cleanup SIGINT races, interrupted final-output delay, and misleading corruption/missing contexts. Narrow final corrections were checked against source and dedicated real-process regressions, then independently audited by a separate subagent (read-only, no blocking defect found); this is not a claim that the CLI reviewers reran the final revision.
  • One review disagreement is explicit: cleanup failure still returns nonzero even if an observation-end frame was already fully written. Successful consumption requires both complete output and exit 0; ignoring cleanup failure or resending would be wrong. A regression pins this combined contract. Real tty/pipe/SIGINT and parent SIGKILL/SIGSTOP fixtures verify helper lifecycle; the helper and parent use the shared Mach clock on Darwin, including Python 3.9.

Translation quality review (2026-10-23)

At the user's request, Antigravity CLI 1.4.5 explicitly selected available gemini-3.8-flash-medium, medium effort, plan mode and sandbox with a five-minute limit. A task-local runner omitted permission-bypass flags. One fresh read-only review completed with exit 0 and structured output (160.625 seconds). It covered all 152 added/changed lines across eight English/Korean/Japanese/Simplified Chinese CLI reference/runtime guide files at b3c4929, plus heading/context, preserving code and links. Frozen evidence SHA-256: 7c43a4a465784dacf087eed07afa208c8e557b34f6d14c23674536df5c7b7e0e; full prompt SHA-256: 3bb94a8909bf7e01f507386c04492ac88443ea14c073dc663d895b2de04838d6. The model selector is recorded; independent backend identity is not exposed by the normalized result.

Codex verified the suggestions against source and applied four narrow Korean wording changes: submission terminology, snapshot/no-lossless-stream separation, and two OS real-time-limit sentences. No runtime, numbers, flags, code blocks, links, English source or manifest change. Inherited consumed-intent wording and an unsupported inferred state distinction were not changed. Final documentation tests: 65 OK on both Python 3.9 and 3.13; diff check clean. Static translation QA only, not native/runtime/security validation; earlier CLI code-review evidence remains scoped to its recorded input, not a re-review of this documentation-only follow-up.

Remaining limits (unchanged)

  • feat(handoff): expose explicit ACK, deadline, and unknown outcome for unanswered requests #181: explicit restore quarantine removes ACK detail while retaining a satisfied wait. The frozen public schema rejects this combination. This PR preserves refusal/history rather than changing receipt semantics.
  • Ledger and collector-clock observations remain separate snapshots. Same-epoch rollback/clones are not attested. The observer cannot cancel a blocked filesystem syscall or guarantee final-frame delivery after output failure.
  • Synthetic/offline evidence only; no real agent consumption, native ACK, remote or hosted deployment claim. Legacy collector rejection is a handler fixture, not a deployed old-collector integration run.
  • Local POSIX only. Windows watching, host/device routing and Codex ACK remain unsupported. Existing submission-versus-consumption and no-automatic-resend boundaries are unchanged.

@abruption abruption added this to the v1.3.0 milestone Oct 22, 2026
@abruption abruption added enhancement New feature or request priority:P2 Planned reliability, acceptance or feature work; priority does not authorize implementation. labels Oct 22, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T09:53:30.856270Z bc7ec8c PR opened
🔒 Security Review ✅ Completed 2026-10-22T09:53:57.011579Z bc7ec8c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@abruption abruption changed the title feat(handoff): show read-only single-request status details feat(handoff): add read-only status and bounded request watch Oct 23, 2026
@abruption

Copy link
Copy Markdown
Owner Author

CI follow-up: 9000ef6 bounds each sleep slice while retaining the same sampling interval, original total deadline, 100ms finish reserve, exit contract and no-submit boundary. A deterministic 10% sleep-slack model fails on the original code and passes after the change; it demonstrates a counterexample, not proof of the historical CI scheduler cause. Bounded output-phase/remaining-budget/helper-exit diagnostics were added to the two real-output assertions. e69e582 removes an expired relay room before asynchronous cancellation cleanup can yield, and rejects new arrivals against the original room deadline. Two deterministic regressions cover cleanup-yield and delayed timeout callback races; one was confirmed failing against the original code. The separate native relay-send failure did not reproduce in 30 fresh isolated executions; its assertion now reports only protocol diagnostics, without weakening success requirements or adding retries. Validation: Python 3.13 extras full suite 1,381 OK (19 skips); Python 3.9 watch/CLI 36 OK; relay suite 238 OK; generator/diff checks clean. Read-only subagent audit found no blockers. No claim that all historical CI causes are proven. New exact-head CI is required before merge.

@abruption

Copy link
Copy Markdown
Owner Author

Exact-head CI verification: e69e582 now has 28/28 successful checks, including macOS Python 3.9/3.13, both macOS relay jobs and the release gate. The Python 3.13 log explicitly records both previously failing real-output tests and the new sleep-slack regression as OK. The separate native relay-send test also passed in the new run; its original failure reason remains unproven, so this is not a claim that every historical failure cause has been established. No CI protection bypass or test-success weakening was used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority:P2 Planned reliability, acceptance or feature work; priority does not authorize implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant