Skip to content

fix: invalidate stale reconciliation proof - #75

Merged
roodboi merged 10 commits into
mainfrom
codex/HACK-1033-review-fixes
Jul 29, 2026
Merged

fix: invalidate stale reconciliation proof#75
roodboi merged 10 commits into
mainfrom
codex/HACK-1033-review-fixes

Conversation

@roodboi

@roodboi roodboi commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • supersede historical terminal proof when linked work is reopened
  • revalidate Git containment against the current default branch on every run
  • treat pruned persisted commits as uncontained instead of aborting reconciliation
  • recover abandoned reconciliation locks left by a hard-crashed enrollment writer

Review follow-up

Addresses all four P2 findings from the adversarial review of #74.

Verification

  • bun test src/reconciliation.test.ts (47 pass)
  • bun test src/evolution-loop.test.ts (45 pass)
  • bun test src/projects.test.ts (127 pass)
  • bun run type-check
  • bun run check

Linear: HACK-1033


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

HACK-1033

@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: c7d9464029

ℹ️ 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 src/reconciliation.ts Outdated
Comment thread src/reconciliation.ts Outdated
Comment thread src/reconciliation.ts Outdated

@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: 4a079e5126

ℹ️ 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 src/reconciliation.ts

@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: 654c705db2

ℹ️ 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 src/reconciliation.ts Outdated

@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: 33e6b5383f

ℹ️ 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 src/reconciliation.ts Outdated
Comment thread src/projects.ts Outdated

@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: 6b5a29fc63

ℹ️ 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 src/projects.ts Outdated
Comment thread src/process-identity.ts

@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: 5b9005621d

ℹ️ 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 src/reconciliation.ts
@roodboi
roodboi merged commit 75922e6 into main Jul 29, 2026
4 checks passed
@roodboi
roodboi deleted the codex/HACK-1033-review-fixes branch July 29, 2026 20:36

@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: fce5cb2c05

ℹ️ 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 src/reconciliation.ts
Comment on lines +1360 to +1364
const latestStatuses = latestLinkedWorkStatuses({
config: args.config,
state: args.state,
observations: args.linkedWorkStatuses,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use the latest status when classifying current signals

When a cumulative evidence export contains an older terminal event and a later reopen for the same issue, this correctly keeps the family out of resolvedSignalFamilies, but the current signal is still classified by dispositionFor, which considers every terminal record and returns resolve-watch; rawQueue consequently marks that signal resolved despite the reopen. Fresh evidence beyond the prior thread is that latestLinkedWorkStatuses is consulted only in this family-resolution path and never influences the current signal's disposition, so the later reopen still removes active work from the queue.

Useful? React with 👍 / 👎.

Comment thread src/reconciliation.ts
Comment on lines +1311 to +1314
if (latest?.ordering === "unknown") {
if (
observation.sourceId === latest.sourceId &&
observation.sourceRecordId === latest.sourceRecordId

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow new records to replace unknown-order legacy status

When migrating pre-change state whose terminal proof lacks observedAt, the synthesized status has ordering: "unknown"; this branch then ignores every new authoritative observation unless it reuses the terminal event's exact record ID. A later reopen normally has a different ID, so the migrated terminal status remains permanent and the family stays falsely resolved. Fresh evidence contradicting the prior thread response is the explicit sourceRecordId equality requirement here, which prevents the claimed supersession by current authoritative observations.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.29.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant