Skip to content

Promote core-jvm proto-stub memory into shared skills#17

Merged
alexander-yevsyukov merged 1 commit into
masterfrom
claude/lucid-meitner-wwaisi
Jun 15, 2026
Merged

Promote core-jvm proto-stub memory into shared skills#17
alexander-yevsyukov merged 1 commit into
masterfrom
claude/lucid-meitner-wwaisi

Conversation

@alexander-yevsyukov

Copy link
Copy Markdown
Contributor

What

Applies two test-code conventions captured in core-jvm's agents memory
(.agents/memory/) to the shared skill definitions so they ship to every
Spine repository on the next pull, instead of living only as repo-local memory.

Source memory entries:

  • Proto Builder DSL Policy in Tests — DSL only for complete .build();
    plain Java chains for buildPartial(); never .apply { } on a proto builder.
  • @NonValidated on buildPartial() stubs — annotate the return type of any
    function returning a buildPartial() proto with @NonValidated.

Changes

  • kotlin-jvm-tester/SKILL.md (the test-writing authority) — new "Proto
    stubs" guidance next to the existing "Proto assertions" note:
    • Kotlin Protobuf DSL (message { … }) for complete (.build()) messages;
    • a buildPartial() stub is a plain Java builder chain, never .apply { };
    • a function returning a buildPartial() message annotates its return type
      @NonValidated (io.spine.validation.NonValidated); .build() returns and
      pure delegators do not.
  • spine-code-review/SKILL.md — refines the blanket "prefer Protobuf DSL
    over Java builders" checklist item so a reviewer does not flag a
    buildPartial() test chain and does flag a missing @NonValidated,
    pointing to kotlin-jvm-tester for detail.

Why here

Both lessons are about proto-message construction in test/stub code, so the
authoritative home is kotlin-jvm-tester. The blanket DSL rule echoed in
spine-code-review would otherwise mis-flag a legitimate buildPartial() chain,
so it's refined in lockstep. core-jvm's local memory is left untouched (source
of the lesson); maintainers may prune it separately now that it's shared.

Validation

  • Directory names match frontmatter name; SKILL.md files well under the size
    cap (284 / 132 lines).
  • Added prose/example lines within the 100-char max-line-length.
  • New .agents/skills/kotlin-jvm-tester/SKILL.md reference resolves via the
    in-repo symlinks.
  • No task-plan references introduced.

https://claude.ai/code/session_013wn51MjLUzds4YS2wp3GsV


Generated by Claude Code

Encode two test-code conventions captured in core-jvm's agents memory
into the org-wide skill definitions, so they ship to every Spine repo:

- kotlin-jvm-tester: proto stubs use the Kotlin Protobuf DSL only for
  complete `.build()` messages; a `buildPartial()` stub is a plain Java
  builder chain (never `.apply { }`), and a function returning a
  `buildPartial()` message annotates its return type `@NonValidated`.
- spine-code-review: refine the Protobuf-DSL checklist item so a
  reviewer does not flag a `buildPartial()` test chain and does flag a
  missing `@NonValidated` annotation.

https://claude.ai/code/session_013wn51MjLUzds4YS2wp3GsV
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jun 15, 2026
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review June 15, 2026 11:34
Copilot AI review requested due to automatic review settings June 15, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR promotes two proto-stub testing conventions (previously captured as core-jvm repo-local agent memory) into the shared skill documentation so they apply consistently across Spine repositories.

Changes:

  • Refines spine-code-review guidance so reviewers prefer the Kotlin Protobuf DSL only for fully-built (.build()) messages and explicitly allow buildPartial() stubs as Java builder chains.
  • Adds kotlin-jvm-tester guidance covering (1) DSL vs buildPartial() usage in tests and (2) requiring @NonValidated on return types for helpers that return buildPartial() messages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
skills/spine-code-review/SKILL.md Updates the review checklist to avoid mis-flagging buildPartial() chains and to require @NonValidated on buildPartial() stub helpers.
skills/kotlin-jvm-tester/SKILL.md Documents the authoritative conventions for building complete vs partial proto messages in tests, and when to annotate with @NonValidated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexander-yevsyukov alexander-yevsyukov merged commit b9ff891 into master Jun 15, 2026
1 check passed
@alexander-yevsyukov alexander-yevsyukov deleted the claude/lucid-meitner-wwaisi branch June 15, 2026 11:38

@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: 2af59fa8e4

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

`@NonValidated` (`io.spine.validation.NonValidated`) — e.g.
`private fun stubEvent(): @NonValidated Event = Event.newBuilder().setId(id).buildPartial()`.
This holds for every message type. A `.build()` return needs no annotation, nor does a
function that only delegates to an already-annotated helper.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve @NonValidated on delegating returns

For a wrapper that only calls an annotated partial-stub helper but declares its own return type, this exception lets the wrapper expose a plain Event/message return even though the value is still partial; callers and reviewers then lose the @NonValidated contract at the new API boundary. Please require delegating functions to keep @NonValidated on their own return type unless they validate before returning.

Useful? React with 👍 / 👎.

Comment on lines +217 to +218
**Proto stubs — DSL vs. `buildPartial()`.** Build a *complete* message with the
Kotlin Protobuf DSL (`message { field = value }`) — the default for anything fully

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope Kotlin DSL guidance away from Java specs

When an XJavaSpec needs a complete proto fixture, this skill still governs that Java test, but the new absolute instruction to use the Kotlin Protobuf DSL cannot be followed in src/test/java. Please scope this rule to Kotlin specs and state that Java bridge suites should keep using the Java builder API, otherwise agents may generate non-compiling Java tests.

Useful? React with 👍 / 👎.

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.

4 participants