Skip to content

plugin-sharing: INFO line when isSystem writes cover an active sharing rule but materialise zero grants (demand 3 of #4707, maintainer-ruled 2026-08-06) #6783

Description

@os-zhuang

Part of #4707. Execution sub-card cut by the triage seat per the maintainer's 2026-08-06 ruling recorded on that thread (demand 3 = do).

Task

When a seed run (or any isSystem write batch) writes rows to an object covered by an active sharing rule and materialises zero grants because the record-write hooks skip isSystem sessions, emit one INFO line naming the behaviour and the remedy, per the ruling's wording: include the guidance "sharing materialisation skipped for isSystem writes; re-evaluate rules or restart to backfill".

Anchors (re-verified on origin/main @ e1e7629)

  • The skip itself: packages/plugins/plugin-sharing/src/rule-hooks.ts:157, :165, :180, :194 — each record-write hook returns early on (ctx?.session as any)?.isSystem.
  • The eventual heal the INFO line should point at: the boot backfill (sharing-plugin.ts, whose own comment at :47 documents that seed rows are written with isSystem and the hooks deliberately skip them).
  • The original symptom (hotcrm#640): fresh install, 9 active rules, 9 matching accounts, sys_record_share empty — every visible layer said "configured", nothing said "inert".

Shape notes for the dev (from the parent card, not a ruling)

  • The signal must be one line per seed run/batch, not per row — the failure mode being fixed is silence, not verbosity.
  • Behaviour is otherwise correct (boot backfill heals it); ⛔ do not change the skip itself, and do not make the INFO an error/warn — the ruling asked for INFO.
  • Demand 2 of the parent is decided (the flag is NOT being split); this card must not introduce any new switch.

Scope

packages/plugins/plugin-sharing only (identity lane).

Refs: #4707 (anchor card — closure rides on the sub-cards landing), hotcrm#640 / PR hotcrm#652, sibling devx sub-card for demand 1.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions