Skip to content

refactor: define the bound activity once, in graph-schema - #68

Merged
Mearman merged 2 commits into
mainfrom
refactor/one-bound-activity
Oct 12, 2026
Merged

Mearman merged 2 commits into
mainfrom
refactor/one-bound-activity

Conversation

@Mearman

@Mearman Mearman commented Oct 12, 2026

Copy link
Copy Markdown
Member

boundActivitySchema and BoundActivity now live in graph-schema beside modelSchema, built from the same object schema as the model's own activity, and both contracts parse activities with that one schema. It is declared as the named interface BoundActivitySchema, as ModelSchema is, and the declaration-emit test now checks that a consumer embedding it names it rather than writing it out.

The first commit pins the wire shape on the old code: each contract's activity type exactly, and in graph-sync that both contracts give the same JSON Schema, accept and reject the same values, and that a sync page's items pass boundItemsSchema unchanged. Those tests pass unchanged after the refactor, and each contract now also checks that its activity schema is graph-schema's object itself.

The contracts no longer export the name, so process-graph/source/github and process-graph/store lose boundActivitySchema and BoundActivity; both are exported from the process-graph root entry instead. That is a breaking change for anyone importing them from a subpath, so the refactor commit carries a BREAKING CHANGE footer and merging releases a new major version of process-graph. The GitHub issues adapter now depends on graph-schema for the type.

Closes #31

@Mearman
Mearman marked this pull request as ready for review October 12, 2026 07:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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
🔒 Security Review ✅ Completed 2026-10-12T08:15:57.039431Z c6a3241 Manual request
ℹ️ 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.

@Mearman

Mearman commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Decision recorded: the removal of boundActivitySchema and BoundActivity from the process-graph/source/github and process-graph/store subpaths is a breaking change to the published surface, so it releases as a major. Neither known consumer (Switchboard, pipewright) imports the names from a subpath, so the cost is nominal, and a re-export under the old name would keep two import paths for one symbol. The one definition is exported from the root entry with the rest of the model types.

@Mearman

Mearman commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

@codex security review

1 similar comment
@Mearman

Mearman commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 5d9fff348d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@Mearman

Mearman commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 5d9fff348d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@Mearman

Mearman commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

@codex security review

A sync page's activities and the store's upserted activities must be one
shape, since graph-sync passes a page's items straight to items.upsert.
Each contract now pins its activity type exactly, and graph-sync checks
that both give the same JSON Schema, accept and reject the same values,
and that a sync page's items pass boundItemsSchema unchanged.
The source and store contracts each built their own boundActivitySchema
by unwrapping modelSchema's element union. graph-schema now defines it
beside modelSchema, from the same object schema as the model's activity,
declared as the named interface BoundActivitySchema so declaration
files that embed it name it rather than writing it out. Both contracts
parse activities with it, and the GitHub issues adapter takes the
BoundActivity type from graph-schema. The wire shape of both contracts'
v1 is unchanged, which the earlier pinned tests hold.

Closes #31

BREAKING CHANGE: process-graph/source/github and process-graph/store no
longer export boundActivitySchema or BoundActivity; import them from the
process-graph root entry.
@Mearman
Mearman force-pushed the refactor/one-bound-activity branch from 5d9fff3 to c6a3241 Compare October 12, 2026 08:12
@Mearman

Mearman commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: c6a3241fbf

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@Mearman
Mearman merged commit 38ef67e into main Oct 12, 2026
14 checks passed
@Mearman
Mearman deleted the refactor/one-bound-activity branch October 12, 2026 09:16
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.

Share one bound activity schema between the source and store contracts

1 participant