Skip to content

example-app: prove the disjoint-field merge (close AC-SYNC-02 debt) - #1

Open
rdryfoos wants to merge 3 commits into
mainfrom
demo/close-sync-debt
Open

example-app: prove the disjoint-field merge (close AC-SYNC-02 debt)#1
rdryfoos wants to merge 3 commits into
mainfrom
demo/close-sync-debt

Conversation

@rdryfoos

@rdryfoos rdryfoos commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Closes the tracked debt on AC-SYNC-02 (disjoint-field merge) with a real proof — test_AC_SYNC_02_disjoint_field_edits_merge_without_conflict — so two devices editing different fields of the same item both survive the merge. Alongside it:

  • checks off task T005 and drops the "deferred" note in src/sync.py
  • adds src/metrics.py — small in-process event counters for local debugging

The SpecAssay Thread Report workflow posts a briefing on this PR: what moved on the Golden Thread, the SYNC thread as it stands now, and any changed files that sit far from the thread.

Demonstration PR for the SpecAssay Thread Report feature — kept open as a worked example, not intended to merge.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added event tracking capabilities for monitoring application activity.
    • Improved synchronization so edits to different fields on the same item are preserved during reconciliation.
    • Same-field conflicts now resolve using timestamp-based last-write-wins behavior.
  • Documentation
    • Updated synchronization documentation to reflect the completed conflict-resolution behavior.
  • Tests
    • Added coverage verifying that non-conflicting field edits merge correctly across devices.

Closes the tracked-debt on AC-SYNC-02 (disjoint-field merge) with a real proof
(test_AC_SYNC_02_*), checks off task T005, and drops the 'deferred' note. Also
adds src/metrics.py — incidental event counters that carry no @Covers, so the
Thread Report will surface it as 'far from the thread'.
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

🧵 Thread Report

🟢 Golden Thread intact

What moved

Thread Status

SYNC

ID Status
AC-SYNC-01 🟢 proven
AC-SYNC-02 🟢 proven ◀ changed

+2 untouched backlog rows not shown.

Off Thread

1 changed file sits off the thread — changed, but nothing in it carries a mark tying it to an intent this PR moved. Not a defect (a refactor and unwanted scope look identical here); just worth a glance:


Thread Report illuminates; it does not refuse. "Off thread" is a visibility call, not a gate. Set offthread_ack: record|required in the SpecAssay config to add a human tick.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The example app adds an in-process event counter and proves disjoint-field synchronization. Synchronization documentation and task tracking now mark AC-SYNC-02 as completed.

Changes

Event metrics

Layer / File(s) Summary
Event counter API
examples/example-app/src/metrics.py
Adds bump, snapshot, and reset functions backed by a private counter.

Synchronization proof

Layer / File(s) Summary
Disjoint-field merge validation
examples/example-app/src/sync.py, examples/example-app/tests/test_sync.py, examples/example-app/specs/sync/tasks.md
Documents timestamp-based last-write-wins behavior for same-field conflicts. Adds a test for independent title and completion edits. Marks T005 and AC-SYNC-02 as completed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: proving the disjoint-field merge and closing AC-SYNC-02 debt.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch demo/close-sync-debt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
examples/example-app/tests/test_sync.py (1)

52-64: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Make the device connectivity precondition explicit.

SyncHub.reconcile returns without syncing when device.online is false. This test never sets a.online or b.online, so it depends on the Device constructor default. Set both devices online before reconciliation, or verify that the constructor guarantees online=True.

Proposed test setup
     a = Device("a")
     b = Device("b")
+    a.online = True
+    b.online = True
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/example-app/tests/test_sync.py` around lines 52 - 64, Make the
connectivity precondition explicit in
test_AC_SYNC_02_disjoint_field_edits_merge_without_conflict by setting both
devices, a and b, online before calling SyncHub.reconcile. Keep the existing
reconciliation sequence unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@examples/example-app/tests/test_sync.py`:
- Around line 52-64: Make the connectivity precondition explicit in
test_AC_SYNC_02_disjoint_field_edits_merge_without_conflict by setting both
devices, a and b, online before calling SyncHub.reconcile. Keep the existing
reconciliation sequence unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e536c754-6105-4986-bdd2-2c1003104868

📥 Commits

Reviewing files that changed from the base of the PR and between c9da9a2 and d6d317a.

📒 Files selected for processing (4)
  • examples/example-app/specs/sync/tasks.md
  • examples/example-app/src/metrics.py
  • examples/example-app/src/sync.py
  • examples/example-app/tests/test_sync.py

rdryfoos pushed a commit that referenced this pull request Aug 10, 2026
…ks, broken path, real offthread_ack)

Rewrites docs/thread-report.md for the shipped v2: the single-line gate
header, clickable diff-hunk/registry links (with the sha256 anchor + blob
fallback note), hidden untouched-backlog rows, the broken path (post the
report, then block via a separate verdict step), and offthread_ack as a real
config key. Cross-links both live demos — green PR #1 and broken PR #2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TM5e4tKiqCUNANBCkTtH2r
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.

2 participants