Skip to content

feat(audit): move audit/realtime objects to owning plugins (ADR-0029 K2)#1460

Merged
os-zhuang merged 1 commit into
mainfrom
claude/adr-0029-k2-audit-ownership
Jun 1, 2026
Merged

feat(audit): move audit/realtime objects to owning plugins (ADR-0029 K2)#1460
os-zhuang merged 1 commit into
mainfrom
claude/adr-0029-k2-audit-ownership

Conversation

@os-zhuang
Copy link
Copy Markdown
Contributor

@os-zhuang os-zhuang commented Jun 1, 2026

Summary

Continues the ADR-0029 K2 decomposition of the platform-objects monolith. The audit/activity data model moves to its capability plugins so each owns the sys_* objects its behavior produces/observes.

Objects moved (git mv, history preserved):

  • sys_audit_log / sys_activity / sys_comment@objectstack/plugin-audit — exactly what the audit writers emit (audit_log + activity rows) and hook (sys_comment @mention notifications).
  • sys_presence@objectstack/service-realtime.

Deliberately not moved (still registered, not owned here):

  • sys_notification — reworked by ADR-0030 messaging.
  • sys_attachment — re-evaluated: it's a polymorphic file↔record link depending on sys_file, which is owned by @objectstack/service-storage. The audit writers never touch it; it was only grouped under audit/ by the old folder layout. It belongs with storage and will move in the storage-domain decomposition PR, not here. The audit plugin keeps registering it (imported from platform-objects) so it stays available meanwhile.

Wiring (D7 + D8)

  • Each plugin registers its objects via manifest.register and owns the Audit Logs setup-nav contribution (D7), so the menu entry follows the object that backs it. (Relies on the D7 serving-path fix in fix(objectql): apply D7 setup-nav contributions in the protocol serving path (empty Setup menu) #1457.)
  • i18n bundles (en/zh-CN/ja-JP/es-ES) extracted into each plugin, loaded on kernel:ready (D8). Seeded from the platform-objects bundles so existing hand-translations are preserved. Regenerate with os i18n extract against each scripts/i18n-extract.config.ts.
  • platform-objects audit barrel + i18n-extract config + tests updated to drop the moved objects (orphan generated translations remain as the accepted interim state, matching the security/sharing/webhooks moves).

Note: service-realtime no longer imports @objectstack/platform-objects in code, but its package.json dependency is intentionally left in place — removing it triggers the path-filtered validate-deps workflow, which currently fails on pre-existing high-severity advisories in an unrelated transitive chain (driver-sql > sqlite3 > tar). The dep cleanup rides along with the storage-domain PR instead.

Tests

  • plugin-audit: 12 passed (new canonical-identity tests for the 3 owned objects).
  • service-realtime: 23 passed (incl. moved sys_presence test).
  • platform-objects: 52 passed.
  • Full pnpm turbo build green.

https://claude.ai/code/session_01Tv6F1Ub6bhCedrx3r8sZM4

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 1, 2026 9:02am

Request Review

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file tests size/xl labels Jun 1, 2026
Decompose the platform-objects monolith further: the audit/activity data
model moves to @objectstack/plugin-audit and presence to
@objectstack/service-realtime, so each plugin owns the sys_* objects its
own behavior produces/observes (ADR-0029 K2/D7/D8).

Objects moved (git mv, preserving history):
  - sys_audit_log / sys_activity / sys_comment → @objectstack/plugin-audit
    (exactly what the audit writers emit: audit_log + activity rows, and
    the sys_comment @mention hook)
  - sys_presence → @objectstack/service-realtime

Deliberately left in platform-objects (still registered, not owned here):
  - sys_notification — reworked by ADR-0030 messaging.
  - sys_attachment — a polymorphic file↔record link that depends on
    sys_file; it belongs with @objectstack/service-storage, so it moves in
    the storage-domain decomposition rather than being mis-homed under the
    audit plugin. The audit plugin keeps registering it (imported from
    platform-objects) so it stays available meanwhile.

Wiring:
  - Each plugin registers its objects via manifest.register and owns the
    Audit Logs setup-nav contribution (D7), so the entry follows the
    object that backs it.
  - i18n bundles (en/zh-CN/ja-JP/es-ES) extracted into each plugin and
    loaded on kernel:ready (D8). Seeded from the platform-objects bundles
    so existing translations are preserved; regenerate with
    `os i18n extract` against each scripts/i18n-extract.config.ts.
  - platform-objects audit barrel + i18n-extract config + tests updated
    to drop the moved objects (orphan generated translations remain as
    the accepted interim state, matching the security/sharing/webhooks
    moves).

Adds canonical-identity tests for the moved audit objects (parity with
the existing sys_presence test).
@os-zhuang os-zhuang force-pushed the claude/adr-0029-k2-audit-ownership branch from a019892 to 823aae9 Compare June 1, 2026 08:57
@os-zhuang os-zhuang marked this pull request as ready for review June 1, 2026 09:26
@os-zhuang os-zhuang merged commit be1b916 into main Jun 1, 2026
12 checks passed
xuyushun441-sys pushed a commit that referenced this pull request Jun 2, 2026
feat(studio): designer ↔ global-chat context + "Ask AI" entry point (P1) (#1460)

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

Labels

dependencies Pull requests that update a dependency file size/xl tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants