Skip to content

test(handoff): pin stale-channel, retention and restore boundaries - #314

Merged
abruption merged 5 commits into
mainfrom
test/181-handoff-negative-fixtures
Oct 16, 2026
Merged

abruption merged 5 commits into
mainfrom
test/181-handoff-negative-fixtures

Conversation

@abruption

Copy link
Copy Markdown
Owner

Summary

Adds offline lifecycle regression tests for the existing experimental POSIX handoff runtime. Refs #181; the issue remains open.

  • Stale and unsafe receipt channels: required ACK is refused before mocked native posting; best-effort ACK can submit without delegated receipt authority. Existing channel entries and other records' authority are not removed or rebound.
  • Same-boot retention: exact 30-day boundary, committed detail preservation then pruning, UTC-independent authority/retention, retained fence quota, no re-prepare, and the knownTombstone public shape.
  • Explicit known-restore quarantine: reconcile-only unknown state, no native calls, no automatic initialization or fabricated epoch for missing/damaged history, idempotence and rejected old receipts. This explicit operation is not normal collector restart.
  • Positive control: a committed late ACK, assurance and terminal wait survive termination/reaping and restart of a real private collector with a new clock epoch. The test harness explicitly removes only its own leftover socket before restarting: this is not automatic crash recovery. Duplicate proof still works; unused authority is revoked separately. Additional advancing clock movement is mocked, not reboot evidence.

Only tests/core/test_handoff_lifecycle.py changes. No runtime, generated standalone, contract document or shared JSON fixture changes. Based on main f3993bf8988dd301b7e14402e63e8ac04e5e2300; independent of unmerged #311.

Review-driven improvements

The first independent reviews identified test-only problems: default unittest comparisons could render private identifiers on failure, collector cleanup lacked kill/reap escalation after a timeout, and a boot-continuity rejection test was confounded by the independent 24-hour TTL. The final tests use non-reflecting comparison helpers with a failure-message regression, bounded clock IPC readiness, terminate/kill/reap cleanup and a boot check inside the TTL. Retention now also checks a populated committed ACK/native/wait record; missing-root public status/wait are covered explicitly; duplicate-rejection cases use fresh records. The quarantine test no longer prescribes destruction of private evidence as a contract requirement.

Validation and review provenance

  • Final PR head d758cc8849b30a70938a7793c10668ddf5658ef1: only one new test file, with 21 lifecycle tests.
  • Root local Python 3.13.7 -X dev -W error::ResourceWarning -m unittest discover -s tests at reviewed candidate 1509ae385b72f51032534906992194e7e53b64b9: 1125 tests OK, 18 skips.
  • Root focused lifecycle + existing handoff runtime: 69 tests OK, repeated on the final head with the task's external-volume temporary root.
  • Generator --check and git diff --check: PASS. Runtime, standalone, contract and JSON fixture unchanged.
  • The contributor's system Python 3.9 full run had one known baseline error from missing packaging; that is not reported as a passing suite. Hosted Python 3.9 and other-platform acceptance remain CI gates.

Both first-round reviews read identical frozen stdin at candidate 6afd59d7ec1d9e00cb3fb745f1e87ae8ee6bfcca (SHA-256 bdbe8ff96ac98b24abf8424f32109a74c2d255391af032987d53e2741204b2cc). Claude Code 2.1.300 requested and confirmed claude-opus-5-5, exit 0 with a valid final review (2026-10-15 01:56:03–02:02:18 UTC). Codex CLI 0.162.1 used isolated default configuration, exit 0 and turn completed (01:56:04–01:56:47 UTC); actual default model not exposed. Static source review only, no reviewer tools/tests/native submissions.

The first input's optional fixture excerpt was unavailable because jq rejected an intentional lone-surrogate negative vector elsewhere in the fixture. The unchanged knownTombstone was subsequently parsed with Node and verified by the actual Python test. Follow-up input includes the correct excerpt and candidate 1509ae3; SHA-256 dd576ce4c6b07e1265644286e3adfaedefe049b5e93aed026311de033624f225.

Both follow-up reviews completed with exit 0 and valid final responses: Claude Opus 5.5, 02:05:41–02:09:29 UTC; Codex, 02:05:42–02:06:12 UTC. Codex found no mandatory defect; Claude requested clarification of public/private quarantine coupling and removal of an unverified argument-redaction claim from a test name. Root accepted those points after checking the actual source. The last small commit changes comments/name and guards an unexpected in-process collector accept loop; it was locally revalidated, not submitted to a third independent review round. This is not an exact-final-head dual-CLI approval claim. Automatic PR review/current-head CI remain separate gates; no manual review mention is posted.

Recommendations not claimed covered: pending-receipt retention with populated unclassified evidence, a second post-kill timeout, exhaustive query-error envelope keys, foreign-UID/dangling-symlink entries, and other native/platform acceptance. Initial ACK commit in the restart control uses the in-process handler with the first collector's epoch; duplicates and rejected receipts after restart use real private IPC.

Limits

  • Offline mocks and private POSIX collector/AF_UNIX resources only; no native Claude/Codex session or model call.
  • Windows, foreign-UID channel ownership and dangling receipt symlinks are not covered. Permissive socket permissions are a separate case, not equivalent foreign-UID proof.
  • No Codex body-free observation/ACK promotion, reverse-SSH bootstrap, device/fanout acceptance or suspended-clock policy change. feat(handoff): expose explicit ACK, deadline, and unknown outcome for unanswered requests #181 is not completed by these tests.
  • Explicit known-restore quarantine currently clears committed ACK detail. Whether private evidence should instead be retained for reconciliation is an unresolved feat(handoff): expose explicit ACK, deadline, and unknown outcome for unanswered requests #181 design/runtime question, not resolved or justified by these tests. Pruning/quarantine is not evidence that no ACK ever occurred.
  • No merge, tag, release, package publication, installation or operations changes.

Add offline negative fixtures for the POSIX handoff runtime: a stale,
non-socket or permissive receipt channel is never rebound or followed and
required ACK is refused before any native post; the 30-day detail
retention boundary, boot-continuity and UTC-jump rules; tombstone quota
and status shape; explicit known-restore quarantine; and a positive
control that a committed ACK survives a collector restart and clock
change on intact history.

Test-only. No runtime, contract or fixture change.

Refs #181
@abruption abruption added this to the v1.2.0 milestone Oct 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-16T11:45:26.895707Z e309157 Manual request
🔒 Security Review ✅ Completed 2026-10-16T11:45:36.133829Z e309157 Manual request
ℹ️ 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

Copy link
Copy Markdown
Owner Author

@codex review

@abruption

Copy link
Copy Markdown
Owner Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: e309157e4d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: e309157e4d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@abruption
abruption merged commit 21a0be0 into main Oct 16, 2026
28 checks passed
@abruption
abruption deleted the test/181-handoff-negative-fixtures branch October 16, 2026 11: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.

1 participant