Skip to content

Consume contextual group notification contracts and owned normalization - #1817

Merged
jlucaso1 merged 16 commits into
mainfrom
codex/group-notification-contract
Oct 30, 2026
Merged

jlucaso1 merged 16 commits into
mainfrom
codex/group-notification-contract

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Group notifications currently expose raw create/link/unlink shapes and parse without the real account facts. This adds owned typed normalization, generated ordered envelope guards and LINK/UNLINK decisions, plus a compatibility adapter preserving the public event API.

The independent contract overlay pins WhatSpec adbe317bf0320bb0cb83824722f6eb60c2ac69da from oxidezap/whatspec#59. Contract bytes and SHA-256 digests are verified. The main IR pin/schema and package dependency graph are unchanged. Envelope and LINK/UNLINK code are generated static Rust; complex CREATE and other action payloads are handwritten adapters qualified against independent original-source fixtures. No runtime JS is introduced.

The nondefault generated-group-notifications feature and an installed GroupNotificationFactsProvider opt into runtime adoption. Effective username/history/opus flags and country lookup come from the provider; exact local device PN/LID identities come from the cached device snapshot. Without a provider, the existing parser remains active. Cache, session rotation, ACK and storage effects remain in existing handlers.

Coverage includes exact destination identity, locally recovered invalid participant_pn, field-specific username gates, history gates, participant defaults/superadmin mapping, typed unknown actions, marker flags without actions, request methods, parent/subgroup integrity and error ordering. Inherited Object.prototype results and unsupported numeric/legacy ranges reject explicitly. Source qualification uses explicit account/Wid/country/telemetry/binary mocks and no authenticated session.

Runtime implementation validation: 83 group tests; three feature-enabled client runtime-facts tests; 127 codegen unit tests plus four checks; pinned-nightly all-target Clippy for wacore/codegen; formatting. The library check without default features with tokio-runtime and the new feature passed; existing library tests require default SQLite/transport features.

Head d942ebe advances the four overlay provenance pins and generated comments to the producer head reviewed without findings. Runtime code, all three contract fixtures and oracle inputs are unchanged. All 22 generated artifacts match codegen --check and formatting passes. Codex reviewed 838ac4d without findings; its E2E and autofix workflows passed. Codex completed final-head d942ebe review without findings. Final-head CI remains pending.

Current CI blocker: API Consumers job Independent API hosts (msrv) failed on d942ebe. Fresh dependency resolution for tests/sqlite-interop (bundled/sqlcipher) and tests/sqlite-sdk-browser selected lock_api 0.5.0, parking_lot 0.13.0 and parking_lot_core 0.10.0, which require Rust 1.95; the job uses Rust 1.94.1. This needs separate dependency/MSRV coordination before readiness. Evidence: https://github.com/oxidezap/whatsapp-rust/actions/runs/40953685196/job/123728253723. Other final-head workflows are still queued/running; autofix passed.

Depends on the producer contract PR. Keep draft pending final qualification; no merge is requested.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Copy link
Copy Markdown
Member Author

@codex review

Please review this draft on head ec54c30. Focus on independent whatspec pin/digest and oracle provenance, typed PN/LID validation, failure precedence, participant_pn recovery, username/history gates, admin implications, and API compatibility. The contextual adapter is deliberately opt-in and incomplete; raw create/link nodes must not be mistaken for full normalization, and runtime adoption remains pending.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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 ✅ Completed 2026-10-30T00:37:33.493591Z c2df8bc Draft marked ready
🔒 Security Review ✅ Completed 2026-10-30T00:38:57.471073Z c2df8bc Draft marked ready
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No code issue found in this review blocks merging, though the PR remains draft pending its stated qualification and CI checks.

Summary

Adds opt-in group notification parsing with account facts, owned typed results, generated envelope checks, and a compatibility adapter for existing events.

  • Group notifications can be parsed into owned, typed actions.
  • Clients can opt into group parsing with account and device facts.
  • Pinned contracts produce static group parser code and oracle checks.
  • The Wasmtime cache uses the updated zstd dependency line.

Previous unnumbered threads were rechecked:

  • The blanket username finding was withdrawn. The current code gates requested-user usernames separately and leaves participant and subject usernames unchanged.
  • jlucaso1 explained that rejecting unknown roles is intentional for the source-qualified parser; the legacy fallback remains unchanged. Greptile retracted that finding.
  • Action dispatch now uses GroupNotificationActionTag, addressing the earlier wire-tag requirement.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Group notification] --> B{Feature enabled and facts provider installed?}
  B -->|No| C[Existing parser]
  B -->|Yes| D[Account facts and cached device identities]
  D --> E[Generated envelope checks]
  E --> F[Owned typed actions]
  F --> G[Compatibility adapter]
  C --> H[Existing handlers]
  G --> H
  H --> I[Cache, session, storage and ACK effects]
Loading

Reviews (12) · Last reviewed commit: "fix(tooling): preserve registry identity..." · Reviewed by Greptile

Comment thread wacore/src/stanza/groups/normalized.rs Resolved
Comment thread wacore/src/stanza/groups/normalized.rs Resolved
Comment thread wacore/src/stanza/groups/normalized.rs Resolved

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

ℹ️ 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 wacore/src/stanza/groups/normalized.rs Resolved
Comment thread wacore/src/stanza/groups/normalized.rs Resolved

Copy link
Copy Markdown
Member Author

@codex review

Review final head da98323. Only the immutable upstream qualifier pin/header changed since the initial implementation: upstream now tests an independent official input matrix and rejects two deliberate IR mutations. Regeneration and --check passed again; all other artifacts are unchanged. The wider generated envelope/create/link/runtime work is still explicitly pending, so this draft must not merge yet.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: da983236fb

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

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

📦 Binary size report

Metric main PR Δ
bin size (stripped) 11.30 MiB 11.30 MiB +224 B (+0.00%) 🔺
bin .text 9.12 MiB 9.12 MiB +128 B (+0.00%) 🔺
bin allocated (text+data+bss) 11.30 MiB 11.30 MiB +8 B (+0.00%) 🔺
deps crates (Cargo.lock) 573 571 -2 (-0.35%) 🔽

Heavy diagnostics were omitted from this gate-only measurement. The size gate uses the linked binary measurements above.

Baseline: 1fcb58a27 · Head: c2df8bcf9 · Graphs

@jlucaso1 jlucaso1 changed the title Consume qualified group unlink normalization with contextual guards Consume contextual group notification contracts and owned normalization Oct 29, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review head 20482b8. This completes the previously partial UNLINK adapter with generated ordered envelope/LINK parsing, owned typed actions, original-JS conformance and opt-in runtime facts. It pins source ae4ea6e from whatspec#59. Existing review concerns about tag dispatch, field-specific username gates and unknown roles are covered by complete parsers and tests. Please review the complete final diff; keep draft pending CI/review.

Copy link
Copy Markdown
Member Author

@codex review

Final head is now 20ac098. The follow-up only regenerates the missing tag-constant provenance comment from the newer preserved evidence already on this branch; implementation remains 20482b8. Review the complete diff. Both previous Codex threads now have source/test evidence and are resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 20ac098219

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

@codspeed

codspeed Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 19.47%

3 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 132 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 4 regressed benchmarks
✅ 911 untouched benchmarks
⏩ 20 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime eight_clients[65536] 1.4 ms 2.1 ms -31.71%
❌ Walltime four_external_blobs[65536] 156.8 µs 219.4 µs -28.52%
❌ Walltime four_external_blobs[1048576] 2.7 ms 3.6 ms -23.83%
❌ Walltime eight_clients[1048576] 23.8 ms 30.5 ms -22.1%
⚡ CPU Simulation connect_to_ready 208.3 ms 178.1 ms +16.91%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/group-notification-contract (c2df8bc) with main (1fcb58a)

Open in CodSpeed

Footnotes

  1. 20 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Copy link
Copy Markdown
Member Author

@codex review

Please review final head 30647b4. The complete normalized implementation in 20ac098 was reviewed without findings. Follow-ups preserve that work, fix generated boolean assertions so all-target Clippy passes, and align all four overlay pins to WhatSpec 3d4737934a55239928b3265523448aef2978a82b. The three contract fixtures are byte-identical to the producer; the main IR pin is unchanged. Local validation passed: 83 group parser tests, 127 codegen unit tests plus four checks, three runtime-facts tests with generated-group-notifications enabled, wacore/codegen all-target Clippy, formatting and all 22 generated text artifacts. E2E, binary size and CodSpeed passed on the previous 97af08d head with identical runtime implementation. Please inspect the complete final diff, including opt-in runtime facts, owned actions, legacy compatibility and source qualification. Both PRs stay draft pending final CI/review.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 30647b493b

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

@codex review

Please review c7d9607. The prior review of 30647b4 completed without findings. This follow-up only advances the four immutable overlay provenance pins and generated comments to WhatSpec ed8da49c24a0e943854e1c7077c60129e169aeb4. All three contract fixtures remain byte-identical; no runtime implementation or oracle inputs changed. All 22 generated text artifacts match codegen --check. The runtime implementation retains its 83 group tests, 127 codegen tests plus four checks, three feature-enabled runtime-facts tests and all-target Clippy validation. Final CI and producer review still gate readiness.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: c7d96070b5

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

@codex review

Please review final head 838ac4d. The prior c7d9607 review completed without findings. This follow-up only advances the four immutable overlay provenance pins and generated comments to WhatSpec 57494ccd865fa6471743264fea036f00d26d89cb, which now rejects unqualified opaque source effects. All three contracts are byte-identical to the producer; runtime implementation, fixtures and oracle inputs are unchanged. All 22 generated artifacts match codegen --check, formatting passes, and the unchanged runtime implementation retains its 83 group tests, three feature-enabled runtime-facts tests, 127 codegen tests plus four checks and all-target Clippy validation. Please check the final full diff and immutable provenance linkage. CI and the producer's final review remain required before readiness.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 838ac4d7a7

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

@codex review

Please review final head d942ebe. The prior 838ac4d review completed without findings; its E2E and autofix workflows passed. This follow-up only advances the four immutable overlay pins and generated provenance comments to WhatSpec adbe317bf0320bb0cb83824722f6eb60c2ac69da, whose completed review also found no major issues. All three contracts are byte-identical to the producer; runtime code, fixtures and oracle inputs are unchanged. All 22 generated text artifacts match codegen --check, formatting passes and producer wa-notif validation is now 131 tests plus all-target/all-feature Clippy. Please verify the final full diff and provenance linkage. Final CI remains pending and both PRs stay draft; no merge.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: d942ebe509

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

Reuse the exact two CI hunks from 94371ae, isolated in 99dd573. No app-state or retry code is imported.
@jlucaso1
jlucaso1 marked this pull request as ready for review October 30, 2026 00:35
@jlucaso1
jlucaso1 merged commit 3075d3f into main Oct 30, 2026
41 of 46 checks passed
@jlucaso1
jlucaso1 deleted the codex/group-notification-contract branch October 30, 2026 00:36
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