Skip to content

fix: preserve Linear publication evidence for recovery - #482

Open
mldangelo-oai wants to merge 12 commits into
mainfrom
mdangelo/codex/verify-publication-receipts
Open

fix: preserve Linear publication evidence for recovery#482
mldangelo-oai wants to merge 12 commits into
mainfrom
mdangelo/codex/verify-publication-receipts

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve recovery evidence when a connected Linear publication completes but the SDK cannot verify every issue creation. Verified issues still reach local history and partial receipts. Unverified completions keep the private handoff and event evidence so users can inspect Linear before retrying.

Changes

  • Compare each completed connected-app issue creation with the prepared destination and payload.
  • Distinguish rejected retries from completed mutations, and treat conflicting or nested issue identities as recovery evidence.
  • Persist independently verified issues while retaining unverified handoffs, relevant event records, and partial receipts.
  • Preserve event evidence before the initial indeterminate receipt, without letting optional recovery logging failures discard verified history.
  • Report connected-app progress from verified or reconciled outcomes and keep the canonical publication paths and shared Linear client from main.

Testing

  • On exact head f7ecc7bc, the seven-file publication suite passed 168 tests with 1,512 assertions and no failures.
  • pnpm run types
  • pnpm run format
  • pnpm pack followed by pnpm run check:package: validated the build, 255 archive entries, 111 bundled plugin files, public imports, consumer types, CLI behavior, and the installed-package worker smoke.
  • Before the final two non-overlapping main commits, the full seeded suite passed 1,567 tests with 30 expected skips, 21,548 assertions, and no failures across 86 files on 87598157.
  • git diff --check origin/main...HEAD
  • No live Linear issues were created.

Risk and rollout

Default issue creation, the database schema, and credential handling are unchanged. This does not add automatic retries or remote readback. Exact argument verification fails closed, so an unexpected connector response is retained for manual recovery instead of being treated as a confirmed publication.

Recovery artifacts can contain issue descriptions and source evidence. They remain in private local state only when manual recovery is needed.

Public disclosure review

Automated comments already on this public pull request contain access-restricted report links, and three older commit objects retain their original corporate author identity. Those artifacts predate this update and remain visible in public history, so the second attestation stays open for maintainer review. New commits use the GitHub noreply identity.

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Aug 16, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head aa3e774.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: aa3e7749ea

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa3e7749ea

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

Comment thread sdk/typescript/src/publish.ts Outdated
Comment thread sdk/typescript/src/publication-events.ts Outdated
@mldangelo-oai
mldangelo-oai marked this pull request as ready for review August 16, 2026 07:21

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa3e7749ea

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

Comment thread sdk/typescript/src/publication-events.ts Outdated
Comment thread sdk/typescript/src/publish.ts Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the updated head 9d4578f. The first two recovery comments are fixed; I am also addressing the later comments about unfamiliar completed results and rejected success-shaped handoffs.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 9d4578f36b

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

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

Reviewed commit: 9d4578f36b

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.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 1c1fa6b. The follow-up retains unresolved completed calls and rejected success-shaped handoffs, while preserving independently verified partial results. Focused publication and CLI tests, types, and formatting pass; the full package suite is running.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 1c1fa6bf45

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

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

Reviewed commit: 1c1fa6bf45

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.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Validation-only description update; the code remains at 1c1fa6b. The full and randomized suites each passed 1,304 tests with 11 expected skips, and the fresh installed-package smoke passed. Please retain review on this exact head.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 1c1fa6bf45

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 1c1fa6bf45

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

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, df6e4c4de65201bb54f5ee9f7fc770de914c655b.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: df6e4c4de6

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

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

Reviewed commit: df6e4c4de6

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.

zcrab-oai
zcrab-oai previously approved these changes Aug 16, 2026

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed publication receipt verification, destination binding, event accounting, and recovery behavior.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head 990b35cb4ce0c4a5d2131b1eab40a6c5f649e363.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 990b35cb4c

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 990b35cb4c

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

@mldangelo-oai mldangelo-oai changed the title fix: verify Linear publication receipts fix: preserve Linear publication evidence for recovery Aug 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 21, 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 🔄 Running since 2026-08-21T22:57:50.931977Z f7ecc7b 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.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head f7ecc7bc36f5d020ccf1e5712030550e718ac11f, focusing on completed versus rejected attempts, conflicting or nested issue identities, reconciled progress, and recovery evidence ordering.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review exact head f7ecc7bc36f5d020ccf1e5712030550e718ac11f, focusing on fail-closed publication verification, private recovery artifacts, and redacted recovery errors.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7ecc7bc36

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

Comment on lines +858 to +860
events.unresolvedCompletions?.some(
(findingId) => !created.has(findingId),
) === true ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep conflicting connector identities indeterminate

When a completed tool result contains conflicting recognizable identities—for example, structured_content.identifier is SEC-1 while JSON text reports SEC-2savedIssue classifies it as unresolved, but a model-written handoff selecting either value populates created, making this predicate false. Publication then accepts the selected identity and deletes the event evidence even though the trusted connector output was ambiguous; distinguish results with no recognizable identity from results with conflicting identities, and keep the latter indeterminate regardless of the handoff.

AGENTS.md reference: sdk/typescript/AGENTS.md:L8-L12

Useful? React with 👍 / 👎.

@kmbroai kmbroai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Critical review

Reviewed head f7ecc7bc36f5d020ccf1e5712030550e718ac11f, including the existing recovery comments, and compared #624.

Recommendation: do not merge this head independently; supersede it with the reconciled #624 implementation. Preserving evidence for uncertain mutations is necessary, but a model-written handoff can still erase a conflict in the connector's own result.

[P2] A handoff must not resolve contradictory connector identities by choosing one

I reproduced the current indeterminate predicate through publishScanInternal, not just the parser. The synthetic completed connector call had the exact expected mutation arguments, structured_content.identifier = SYNTH-1, and JSON text containing identifier = SYNTH-2. A matching handoff selected SYNTH-1.

At this head the operation returned success, passed SYNTH-1 to the persistence callback, and reported no indeterminate outcome. savedIssue collapses both “no recognizable identity” and “conflicting identities” to an unresolved completion; the handoff then fills created, making the unresolved-completion check false. This is the same unresolved issue described in the existing public review, independently confirmed at the current head.

Keep those states distinct. An unfamiliar result may be accounted for by an otherwise valid handoff, but contradictory recognized claims must remain uncertain regardless of which claim the handoff repeats. On the same fixture, #624 throws with an indeterminate receipt, records no success, and retains connector evidence.

Simplification and existing fixes

The shared exact mutation-argument builder and nonfatal event-log preservation are good changes. Earlier comments about auxiliary log failures, unfamiliar completed results, and success-shaped invalid handoffs have substantive fixes here; they should not all be reposted as unresolved. However, continuing to patch parallel created, failed, claimedIssues, and unresolvedCompletions collections makes the state distinctions fragile. Consolidate on #624's explicit evidence/reconciliation path instead of carrying both implementations.

Verification

Ran the three publication-event, integration, and publisher suites: 90 passed, 0 failed, plus the cross-head synthetic conflict reproduction. Linux, Bun 1.3.14 / Node 22.13.1 with cached dependencies. The reproduction used actual local handoff/reconciliation code and mocked connector/persistence boundaries; no Linear issue was created and no real credential was used.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants