Skip to content

feat(finish): reconcile OpenSpec task progress conflicts - #753

Merged
NagyVikt merged 5 commits into
devfrom
agent/codex/auto-reconcile-openspec-tasks-conflicts-2026-08-31-16-17
Aug 31, 2026
Merged

NagyVikt merged 5 commits into
devfrom
agent/codex/auto-reconcile-openspec-tasks-conflicts-2026-08-31-16-17

Conversation

@NagyVikt

Copy link
Copy Markdown
Collaborator

Summary

  • feat(finish): reconcile OpenSpec task progress conflicts

Test plan

  • verified locally

Constraint: Merge only identical task documents whose checkbox states differ; fail closed on structural or evidence changes.

Tested: npm test; npm run test:coverage; npm run lint; npm run package:check; npm run format:check:changed.

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🛡️ GitGuardex code-assist

1 finding(s) — 🟡 1 medium

✅ Merge gate: pass — no blocking findings (blocks on high/critical).

Severity Location Finding
🟡 medium templates/scripts/agent-branch-finish.sh:563-564 The post-reconciliation validation excludes the reconciled change.

Provider codex · commit 8ab7fd0

@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 14:39
Review: Codex noted that --specs does not validate change tasks; use strict non-interactive change validation.

Tested: node --test test/openspec-tasks-reconcile.test.js; openspec validate --changes --strict --no-interactive; npm run lint.
@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 14:41

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🛡️ GitGuardex code-assist

✅ No findings. Nothing worth an inline comment in this diff.


Provider codex · commit 0747af2

@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 14:43
@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 14:49

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🛡️ GitGuardex code-assist

✅ No findings. Nothing worth an inline comment in this diff.


Provider codex · commit 0747af2

@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 14:50
Root cause: outer GUARDEX_FINISH_* state leaked into nested finish fixtures during npm test, causing extra preflights, event-stream pollution, and timing failures.

Tested: finish-env agent-preflight.sh run; node --test test/agent-preflight-quiet.test.js; npm run lint.
@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 15:06

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🛡️ GitGuardex code-assist

1 finding(s) — 🟡 1 medium

✅ Merge gate: pass — no blocking findings (blocks on high/critical).

Severity Location Finding
🟡 medium templates/scripts/agent-branch-finish.sh:563 The reconciliation validates every OpenSpec change instead of only the reconciled change.

Provider codex · commit 35d16aa

@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 15:07
Constraint: unrelated OpenSpec changes must not block safe task-progress reconciliation.\nTested: bash -n templates/scripts/agent-branch-finish.sh; node --test test/openspec-tasks-reconcile.test.js; npm run format:check:changed
@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 15:12

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🛡️ GitGuardex code-assist

✅ No findings. Nothing worth an inline comment in this diff.


Provider codex · commit 04fff8d

@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 15:13
@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 15:18

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

⛔ Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-reconcile-openspec-tasks.js:43 The reconciler silently discards intentional task reopenings by treating completion as a monotonic OR.

Provider codex · commit 04fff8d


taskCount += 1;
const checked = /x/i.test(oursTask[2]) || /x/i.test(theirsTask[2]);
return `${oursTask[1]}${checked ? 'x' : ' '}${oursTask[3]}`;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Warning

🟠 HIGH · correctness

The reconciler silently discards intentional task reopenings by treating completion as a monotonic OR. Without comparing both sides to index stage 1, it cannot distinguish newly completed work from a task deliberately changed from checked to unchecked, so an automatic merge or rebase can incorrectly mark unresolved work complete; the tests also omit this three-way regression case.

- HIGH templates/scripts/agent-reconcile-openspec-tasks.js:43 The reconciler silently discards intentional task reopenings by treating completion as a monotonic OR. Without comparing both sides to index stage 1, it cannot distinguish newly completed work from a task deliberately changed from checked to unchecked, so an automatic merge or rebase can incorrectly mark unresolved work complete; the tests also omit this three-way regression case.

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🛡️ GitGuardex code-assist

✅ No findings. Nothing worth an inline comment in this diff.


Provider codex · commit 0f9134d

@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 15:24
@NagyVikt
NagyVikt merged commit 9a3893d into dev Aug 31, 2026
1 check passed
@NagyVikt
NagyVikt deleted the agent/codex/auto-reconcile-openspec-tasks-conflicts-2026-08-31-16-17 branch August 31, 2026 15:24
NagyVikt added a commit that referenced this pull request Aug 31, 2026
* feat(finish): reconcile OpenSpec task progress conflicts (#753)

* feat(finish): reconcile OpenSpec task progress conflicts

Constraint: Merge only identical task documents whose checkbox states differ; fail closed on structural or evidence changes.

Tested: npm test; npm run test:coverage; npm run lint; npm run package:check; npm run format:check:changed.

* fix(finish): validate reconciled OpenSpec changes

Review: Codex noted that --specs does not validate change tasks; use strict non-interactive change validation.

Tested: node --test test/openspec-tasks-reconcile.test.js; openspec validate --changes --strict --no-interactive; npm run lint.

* fix(preflight): isolate verification from finish runtime

Root cause: outer GUARDEX_FINISH_* state leaked into nested finish fixtures during npm test, causing extra preflights, event-stream pollution, and timing failures.

Tested: finish-env agent-preflight.sh run; node --test test/agent-preflight-quiet.test.js; npm run lint.

* fix(finish): validate only reconciled OpenSpec changes

Constraint: unrelated OpenSpec changes must not block safe task-progress reconciliation.\nTested: bash -n templates/scripts/agent-branch-finish.sh; node --test test/openspec-tasks-reconcile.test.js; npm run format:check:changed

* fix(review): address 1 code-assist finding(s)

- HIGH templates/scripts/agent-reconcile-openspec-tasks.js:43 The reconciler silently discards intentional task reopenings by treating completion as a monotonic OR. Without comparing both sides to index stage 1, it cannot distinguish newly completed work from a task deliberately changed from checked to unchecked, so an automatic merge or rebase can incorrectly mark unresolved work complete; the tests also omit this three-way regression case.

---------

Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>

* style(test): format OpenSpec reconciler regression (#755)

Constraint: preserve the merged three-way reconciliation behavior.\nTested: npm run format:check:changed; node --test test/openspec-tasks-reconcile.test.js

Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>

---------

Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
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