Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .agents/tasks/archive/938-move-codegen-request-writer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
slug: 938-move-codegen-request-writer
branch: claude/busy-dirac-wwflbm
owner: claude
status: in-progress
started: 2026-06-10
---

## Goal

`CodeGeneratorRequestWriter` lives in the `tool-base` module under
`io.spine.tools.code.proto`, with its spec, and the build is green.
This is the receiving half of
[base-libraries#938](https://github.com/SpineEventEngine/base-libraries/issues/938).

## Context

- The class is protoc-plugin tooling; its only consumers are the protoc-plugin
entry points of the Compiler and ProtoTap. Both already depend on ToolBase.
- Repackaged from `io.spine.code.proto` to `io.spine.tools.code.proto` to avoid
a split package across artifacts (see the issue discussion).
- `replaceExtension` is still consumed from `io.spine.io` (`base`); it moves to
ToolBase later under base-libraries#939.
- The removal half happens in `base-libraries` on the same-named branch.

## Plan

- [x] Add `CodeGeneratorRequestWriter.kt` to
`tool-base/src/main/kotlin/io/spine/tools/code/proto/`.
- [x] Add `CodeGeneratorRequestWriterSpec.kt` (with a local `constructRequest`
helper) to `tool-base/src/test/kotlin/io/spine/tools/code/proto/`.
- [x] Bump version `2.0.0-SNAPSHOT.398` -> `2.0.0-SNAPSHOT.399`.
- [ ] `./gradlew build` green; commit regenerated dependency reports if any.
- Blocked in the sandbox: all Spine artifact repositories return 403 for
the buildscript dependency `io.spine.tools:protobuf-setup-plugins`, so
no Gradle build can run here at all. Verification is delegated to PR CI.
- Local mitigations: the moved sources are unchanged from `base` (which
built and passed tests) except the package line, and every consumed API
(`replaceExtension`, `decodeBase64`, `toBase64Encoded`,
`extensionRegistry`, `KClass.parse`, `toJson`) was verified present in
`base` at the pinned version `2.0.0-SNAPSHOT.404`.
- [x] Push and open a draft PR.

## Log

- 2026-06-10 — drafted; executing autonomously per issue #938.
- 2026-06-10 — code added and version bumped; sandbox cannot resolve Spine
snapshot artifacts (403 on all repos), so the build runs on PR CI instead.
85 changes: 85 additions & 0 deletions .agents/tasks/archive/fix-build-cache-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
slug: fix-build-cache-support
branch: claude/busy-dirac-wwflbm
owner: claude
status: in-review
started: 2026-06-10
---

## Goal

Builds of projects using the `io.spine.generated-sources` and
`io.spine.descriptor-set-file` plugins succeed with `org.gradle.caching=true`:
after `./gradlew clean build`, the copied generated code under
`$projectDir/generated/<sourceSet>` and the `desc.ref` file are present even
when `generateProto` is restored from the Gradle build cache.

## Context

With the build cache on, `clean build` fails in the `classic-codegen` module
(reproduced locally): `compileKotlin` reports `Unresolved reference 'Classpath'`
because no generated code is present.

Root cause — same pattern as SpineEventEngine/compiler#67. Both plugins in
`protobuf-setup-plugins` do work in `doLast` of the cacheable
`GenerateProtoTask` without declaring outputs:

- `GeneratedSourcePlugin` copies protoc output into
`$projectDir/generated/<sourceSet>/` (undeclared — the build-breaker:
`clean` deletes `generated/`, the task is restored `FROM-CACHE`, the
`doLast` copy never runs, compilation fails).
- `DescriptorSetFilePlugin` writes `desc.ref` next to the descriptor set file
(undeclared — missing from resources/JARs after a cache restore).

The descriptor set file itself is already a declared output of
`GenerateProtoTask` (verified for protobuf-gradle-plugin 0.10.0 in
compiler#67), so only `desc.ref` needs declaring.

This repository's own build applies the *published*
`protobuf-setup-plugins:2.0.0-SNAPSHOT.381` (dogfooding via the root
buildscript classpath), so `org.gradle.caching` stays disabled in
`gradle.properties` until a fixed version is published and the dogfooded
`ToolBase.version` is bumped (decision confirmed by the user).

Known limitation (out of scope): in repos where the Spine Compiler launch
task also writes into `generated/<sourceSet>` (e.g. `validation`), the
overlapping outputs degrade cacheability of the codegen tasks; correctness
is preserved because Gradle re-executes instead of restoring.

## Plan

- [x] Diagnose and reproduce on `classic-codegen` (`build` → `clean` →
`build` with `--build-cache`).
- [x] `GeneratedSourcePlugin`: declare `$projectDir/generated/<sourceSet>`
as an output of `GenerateProtoTask`.
- [x] `DescriptorSetFilePlugin`: declare `desc.ref`
(`DescriptorSetReferenceFile.NAME`) as an output.
- [x] `gradle.properties`: keep `org.gradle.caching` commented out; explain
the dogfooding gate.
- [x] Integration tests in `protobuf-setup-plugins` (TestKit, per existing
spec style): `build` → `clean` → `build` with the cache ON (assert
`generateProto` is `FROM_CACHE`, generated sources + `desc.ref`
restored, compilation of code referencing a generated class succeeds)
and with the cache OFF (assert re-execution works as before).
- [x] Verify: new tests fail without the fix, pass with it; module build
green.

## Log

- 2026-06-10 — Investigated; reproduced on `classic-codegen` with the
dogfooded `.381` plugins; user chose to keep `org.gradle.caching` disabled
until dogfooding catches up.
- 2026-06-10 — The new integration test exposed a second gap: in a pure-Java
project `compileJava` does not depend on `generateProto` because
`configureSourceSetDirs()` severs the dependency carried by the protoc
output dirs and adds the `generated/` dirs as plain `File`s. (Masked in
Spine repos by the Kotlin compile dependency from `setupKotlinCompile()`.)
Fixed by adding the dirs via `project.files(dir).builtBy(task)`.
- 2026-06-10 — Verified: with the output declarations temporarily removed,
the cache-on test fails and the cache-off test passes; with the fix both
pass. `:protobuf-setup-plugins:build` and `dokkaGenerate` are green
(11 test suites, 0 failures).
- 2026-06-10 — Reviewed by `spine-code-review` and `kotlin-engineer` agents:
both approve. Applied follow-ups: `internal` on `BuildCacheSpec`,
explicit `this@configureSourceSetDirs` in `builtBy`, fixed stale
`copyGeneratedFiles` KDoc. Final build: 22 tests, 0 failures.
92 changes: 0 additions & 92 deletions .agents/tasks/archive/prohibit-automatic-commits.md

This file was deleted.

165 changes: 0 additions & 165 deletions .agents/tasks/archive/prompt-caching-org.md

This file was deleted.

Loading
Loading