Skip to content

feat(audit): sys_activity source pointer — ActivityPointer model (ADR-0052 §5) - #1957

Merged
os-zhuang merged 1 commit into
mainfrom
feat/adr-0052-activity-source-pointer
Jun 16, 2026
Merged

feat(audit): sys_activity source pointer — ActivityPointer model (ADR-0052 §5)#1957
os-zhuang merged 1 commit into
mainfrom
feat/adr-0052-activity-source-pointer

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

ADR-0052 §5 — add source_object / source_id to sys_activity, completing it as a proper ActivityPointer base.

  • object_name / record_id = WHICH record the activity is about (the "regarding" record, e.g. a contact).
  • source_object / source_id (new) = the rich entity the activity was derived from — the email row in sys_email, a call/meeting task, a sys_comment.

So the timeline drills from a one-line summary to the full record, and apps can query "all activities sourced from sys_email". This is the structured, queryable replacement for an id buried in metadata.

Why (design review with @jack)

Mainstream platforms all split rich communication entities (their own tables) from the timeline (a pointer/aggregation) — never cram an email into a generic activity blob:

Rich entityTimeline
DataverseEmail/PhoneCall/AppointmentActivityPointer base (+ regardingobjectid)
SalesforceEmailMessage/Task/EventActivityTimeline view
ServiceNowsys_email/Interactionactivity formatter

sys_activity is ObjectStack's ActivityPointer; it was missing the drill-to-source pointer. This adds it.

Deliberately NOT done: extending the type enum with email/call/meeting. That couples a shared platform primitive to one vertical's vocabulary (every domain has its own — interview, site_visit, inspection…), an endless treadmill. type stays neutral; domain kind rides in metadata.kind; the rich entity lives in its own table.

Verification (showcase, browser)

A source-pointed sys_activity row (regarding a project, sourced from a task) inserted → 201, and querying sys_activity filtered by source_object='showcase_task' returned it with the pointer populated. plugin-audit 18/18 tests pass; builds clean. (Demo row cleaned up.)

Note: the CLI build remains red on main from the pre-existing CEL drift in validate-expressions.ts (#1933 area, another worktree) — untouched here.

🤖 Generated with Claude Code

…(ADR-0052 §5)
Add `source_object` / `source_id` to `sys_activity`. `object_name`/`record_id`
say WHICH record an activity is about (the "regarding" record); the new pair
points to the RICH ENTITY it was derived from — the email row in `sys_email`,
the call/meeting task, the `sys_comment` — so the timeline drills from a one-line
summary to the full record, and apps can query "all activities sourced from X".
This completes `sys_activity` as a proper ActivityPointer base (cf. Dataverse
ActivityPointer → Email/PhoneCall/Appointment; Salesforce ActivityTimeline →
EmailMessage/Task/Event): one materialized, indexed timeline that references —
never duplicates — the rich, separately-tabled communication entities. The
structured, queryable replacement for an id buried in `metadata`.
Deliberately NOT done (per the design review): extending the `type` enum with
domain verbs (email/call/meeting) — that couples a shared platform primitive to
one vertical's vocabulary. `type` stays neutral; domain kind rides in
`metadata.kind`; the rich entity lives in its own table.
- sys-activity.object.ts: + source_object, source_id (text, searchable, optional)
- ADR-0052 §5 updated to the ActivityPointer model
- Verified in the showcase: a source-pointed activity round-trips and is
queryable by source_object; plugin-audit 18/18 tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercelBot commented Jun 16, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
specBuildingBuildingPreview, CommentJun 16, 2026 8:54am

Request Review

@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Jun 16, 2026
@os-zhuang
os-zhuang merged commit 038ccde into mainJun 16, 2026
12 of 13 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-audit.

5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/implementation-status.mdx(via @objectstack/plugin-audit)
  • content/docs/concepts/packages.mdx(via @objectstack/plugin-audit)
  • content/docs/getting-started/cli.mdx(via @objectstack/plugin-audit)
  • content/docs/guides/packages.mdx(via @objectstack/plugin-audit)
  • content/docs/guides/production-readiness.mdx(via @objectstack/plugin-audit)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

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

Labels

documentationImprovements or additions to documentationsize/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@os-zhuang