Skip to content

Add full plugin audit#12

Closed
Oleg-Melnik wants to merge 1 commit into
masterfrom
perform-full-audit
Closed

Add full plugin audit#12
Oleg-Melnik wants to merge 1 commit into
masterfrom
perform-full-audit

Conversation

@Oleg-Melnik

Copy link
Copy Markdown
Collaborator

Adds a full static audit of the plugin at master (a2b0478, plugin 0.1.1) as
.agents/tasks/embed-code-gradle-plugin-audit.md. Documentation only — no production code changes.

The audit covers all production sources, buildSrc/build scripts, the CI workflow, tests, and the
README, and includes a live check of the upstream embed-code-go release layout. The build and test
suite were not executed.

Findings at a glance

  • High (1)EmbedCodePlatform maps the Linux asset to the bare embed-code-linux. It works
    against every published release today (v1.2.4 still ships it unzipped), but the upstream release
    workflow now zips the Linux binary, so the next release will publish embed-code-linux.zip and
    latest-mode installs on Linux will 404.
  • Medium (5) — CI never builds master (pull_request-only); checkEmbedding not wired into
    check; the ZIP-extraction path has no CI coverage (no macOS runner); no toolchain auto-provisioning
    (build needs JDK 25 + 17); no release/publish automation ahead of Portal submission.
  • Low (10) — swallowed IOException in installFromVerifiedAsset, sha256+rolling-latest not
    enforced, redundant path re-validation, duplicated buildSrc versions, and other cleanups.
  • Informational — accepted limitations (TOCTOU residue, sticky latest, concurrent daemons, zip
    size caps, API rate limits) recorded with rationale.
  • Resolved — confirms the fixes landed across PRs Init Gradle project #1Harden cached release asset handling #9 are present, including the local
    re-verification restored post-Harden cached release asset handling #9.

No correctness or security defects were found in the current code. H1 is the one item that will cause a
real-world outage and is worth fixing proactively.

@Oleg-Melnik Oleg-Melnik self-assigned this Jul 23, 2026

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Oleg-Melnik I've left a few comments and moved the high-risk item into a separate issue.

However, I think it's better to group smaller comments into issues rather than adding the audit file to the codebase.

Comment on lines +49 to +51
`.github/workflows/check.yml` still triggers only on `pull_request`. The post-merge state of `master`
is never verified, and the README badge reflects the latest PR run, not `master`. Flagged in every
review since PR #1. Two lines: add `push: branches: [master]`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It doesn't make sense to execute check on master, as check is performed to verify that PR is buildable and passes tests. It's just redundant two-step verification.

Comment on lines +55 to +57
Consumers running `./gradlew check` will not get embedding verification; the README shows manual
invocation without explaining that this is deliberate (network dependency). Either wire it (possibly
opt-in) or add one sentence of rationale to the README's *Execution* section.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think that plugin should extend default tasks. Only user should specify when to call the plugin.

Comment on lines +75 to +79
Publishing metadata is complete and Portal-ready (plugin ID `io.spine.embed-code`, POM, sources/javadoc
jars, configuration-cache compatibility declared), but the only workflow is `check.yml`. There is no
`publishPlugins` workflow, no tag-triggered release, and no documented manual release procedure or
CHANGELOG. Before Portal submission, add at least a documented release process; a tag-triggered
workflow with Portal keys in repository secrets is the standard shape.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We have an issue for this. It will be added, when plugin passes Gradle Plugin Portal verification.

Comment on lines +91 to +96
### L2. `sha256` with rolling latest is advised against but not enforced

The KDoc now says to configure `sha256` "together with `version`", but the combination
(`sha256` set, `version` absent) is still accepted and hard-fails on the next upstream release when
the downloaded asset stops matching. Consider failing fast at execution with a message that says to
pin `version`, rather than surfacing as a digest mismatch.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's more of a debugging feature. I don't think anyone will actually add the sha256 version hash to the configuration.

Comment on lines +123 to +127
### L7. README no longer explains `$name/` references for named sources

The named-source example is followed only by the mutual-exclusivity note; the sentence explaining that
embedding instructions reference the roots as `$model/` / `$database/` was dropped during the PR #9
README restructure and not restored.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We are not supposed to describe how works Embed-Code, only the plugin. Embed-Code app has own documentation, which is mentioned in the readme.

Comment on lines +157 to +159
- **Sticky latest:** "latest" is resolved once and pinned until `clean`. This is now clearly documented
in the README (*Version* section) with the local re-verification behavior. Users wanting automatic
updates must clean; that tradeoff is deliberate.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This behavior already gone, as well as latest version usage.

Comment on lines +29 to +41
### H1. Linux asset mapping will break on the next upstream release

`EmbedCodePlatform.kt:73` requests the Linux asset as `embed-code-linux` (bare binary).
Verified live during this audit: the current upstream latest (`v1.2.4`) still publishes
`embed-code-linux` unzipped, so everything works **today**. However, the upstream release workflow
on `embed-code-go`'s default branch now zips the Linux binary ("Publish Linux as a ZIP so Unix
executable permissions survive extraction"). The **next** release will publish `embed-code-linux.zip`,
and latest-mode installs on Linux will fail with HTTP 404 — and the `addReleaseTagMigrationHint` text
will not explain why.

**Recommendation:** try `embed-code-linux.zip` first and fall back to the bare asset (or select by
release metadata), so both existing and future releases install. Update the functional-test fixture
(`createFakeRelease`) in the same change — it currently mirrors the bare-binary layout and masks this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Extracted as an issue.

@Oleg-Melnik
Oleg-Melnik deleted the perform-full-audit branch July 23, 2026 12:37
@Oleg-Melnik

Copy link
Copy Markdown
Collaborator Author

Closed after all the necessary issues were created.

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.

2 participants