Skip to content

fix(sync): stop the report calling pending work in sync - #68

Merged
rparundekar merged 6 commits into
mainfrom
fix/sync-report-truth
Nov 4, 2026
Merged

rparundekar merged 6 commits into
mainfrom
fix/sync-report-truth

Conversation

@rparundekar

@rparundekar rparundekar commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The sync report said "in sync" on steps with work pending, and some of its counts were wrong. Reading the 2026-11-03 report showed:

  • Invite read "in sync" with room additions pending. Directory and clean did the same.
  • "No Slack account" counted each person once per room pass, so it was about double the real number.
  • A person with two live Slack accounts could be invited under the second one to a room they were already in.
  • Identity ran without name matches, so people on another address looked like they had no Slack account.
  • CRM rows missing from the intake were described as probable test data.

Fix

  • sync.py: an exit 0 whose findings start with apply with --write or re-run --write reads DRIFT. Any other open finding reads the new needs review, which leaves the exit code alone. A run that wrote stays WROTE, and PARTIAL still wins.
  • invite_organizers.py: counts people, with room additions as a separate tile. Anyone with two live accounts, or with reviewed rows that disagree, is held and not invited. Everyone held is named in the log and on the page. A column id that is no live account is treated as stale, and a deactivated lookup hit gives way to a live column id.
  • sync.py: identity runs with --suggest. Suggestions are never written automatically.
  • sync_crm.py: new wording for rows on the CRM but not the intake.

Known limit

A person with no usable lookup hit whose reviewed rows disagree stays "no Slack account", with a warning in the log. They aren't invited, so it can't cause a wrong invite. Two different held people with the same name show as one in the held count and list; neither is invited.

Verification

  • New tests in test_sync.py, test_invite_organizers.py and test_resolve_slack_ids.py. The affected skill suites and the library tests pass with gws off the PATH, and pre-commit is clean.
  • An independent review of the follow-up commits reproduced the invite and labelling defects fixed in the last two commits, and a re-check confirmed those fixes.

🤖 Generated with Claude Code

Generated using wayfare.

rparundekar and others added 2 commits November 3, 2026 22:45
- A step that exits 0 while its own findings list warn or bad items now
  reads DRIFT. Invite, directory and clean all said "in sync" with work
  pending.
- Invite counts people: one organizer in two passes was counted twice, so 31
  read as 61. Room additions get their own count.
- A person whose Slack ID column disagrees with the live lookup is held, not
  invited. They have two accounts, and an invite could add a second copy.
- The identity step runs with --suggest, so people on another address show
  up as name matches. Invite's advice points there first.
- CRM rows missing from the intake no longer read as probable test data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Split DRIFT from a new "needs review" outcome. Findings a --write would
  apply are DRIFT. Findings no write clears are needs review, which leaves the
  exit code at 0 and never points anyone at a write.
- Hold a Slack ID conflict only when the column's account is live. A stale id
  no longer blocks an invite.
- A second address cannot invite a held person.
- Count no-account and already-in people correctly across passes.
- A malformed findings file no longer crashes run_step.
- Word the advice so a name match is not treated as proof, and fix stale text.
- Docs and tests cover the new outcome and the run_step wiring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rparundekar

Copy link
Copy Markdown
Collaborator Author

Self-Review: Improvements

Two agents ran (the 50-300 line tier): code-reviewer and security. Security found nothing exploitable.

Important (3 / 3 fixed):

  • sync.py:381: every warn or bad finding read DRIFT, so notes told operators to run writes with nothing to do, and exit 2 would fire every night. Fixed: DRIFT only for findings a --write applies. Everything else is the new "needs review", which keeps the exit code.
  • sync.py, nightly.md, WORKFLOW.md: docs described the old contract. Fixed.
  • invite_organizers.py:168: the conflict hold fired on an unverified column id. Fixed: it hydrates the id and holds only when both accounts are live.

Suggestions (6 / 6 fixed):

  • A second address could invite a held person.
  • no-account was deduplicated by display name, so two people sharing a name counted as one.
  • already-in counted rooms next to a per-person count.
  • findings handling crashed on a malformed file.
  • Stale text in resolve_slack_ids.py and sync_crm.py.
  • Name-match advice now says a name proves nothing (from the security pass).

The fixes were checked by the test scripts and pre-commit. The agents did not re-review this commit.


Generated using wayfare.

rparundekar and others added 4 commits November 3, 2026 22:55
The stale-id case leaves a stranger in the room, which loads the Slack
config from the sheet. It passed locally only because gws is installed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An independent review of the follow-up commits reproduced these:

- Reviewed rows that disagree with each other skipped the hold, so a second
  account could be invited. They are now conflicts against the live answer.
- A hit on a deactivated account beat a correct live column id and stranded
  the person. It now counts as a miss, and is never invited.
- A wrong cell silently dropped a different organizer. Everyone held is now
  named in the log and on the page, and an account is exempt from the
  strangers list only for someone on that room's roster.
- `--write` anywhere in an action read as DRIFT, so identity's name matches
  would exit 2 every night. Only the prefixes in APPLY_ACTIONS count now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A third row naming the one live account was dropped, so the invite hold could
be skipped when the first two ids were dead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rparundekar
rparundekar marked this pull request as ready for review November 4, 2026 18:16
@rparundekar
rparundekar merged commit f46c342 into main Nov 4, 2026
3 checks passed
@rparundekar
rparundekar deleted the fix/sync-report-truth branch November 4, 2026 18:17
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