Skip to content
Open
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

### Changed

- Plugins built from a source checkout without `--release-version` now report
`0.0.0+source` as their own version instead of `0.1.0` (Codex, WorkSwarm) or
`0.0.0` (DSH) (Refs #511). This covers the template version, `plugin_version` in
`runtime/manifest.json` and `--plugin-info`. `runtime_version` still reports the
bundled runtime, so the two differ in a source build. Release builds are
unchanged: `--release-version` still accepts only `MAJOR.MINOR.PATCH`, must match
the built runtime and is rejected before any output is written. The DSH bundle
has no release mode.
- Apps workflow implementations now live in `apps/workflows/`: campaign capture,
task launching, paired benchmark comparison, improvement and skill evaluation.
The previous Apps imports retain explicit compatibility exports. New optimization
Expand Down
8 changes: 8 additions & 0 deletions docs/codex-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ plugin manifest and pins the bundled README's video link to the release tag.
The tracked source template remains unchanged.
Unbuilt source previews use the runtime's explicit `0+unknown` fallback.

A build without `--release-version` is a source build, not a release. Its
`plugin.json` `version` and the `plugin_version` in `runtime/manifest.json` and
`--plugin-info` are `0.0.0+source`; the `+source` suffix is SemVer build
metadata that marks the package as not released. `runtime_version` still reports
the bundled runtime (`0+unknown`, or the generated version), so in a source
build the two fields differ on purpose. The marker does not identify the source:
use `content_sha256` and the source commit to compare builds.

Only the ZIP is attached to Releases. The raw `plugins/inferrsi/` source template
does not contain the bundled runtime and is not an installation package.

Expand Down
4 changes: 3 additions & 1 deletion docs/dsh-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ the launcher is `scripts/inferrsi.py`.

- Use `--plugin-info` to check the selected interpreter, bundled runtime version,
and content SHA-256. An unbuilt source checkout can report `0+unknown` as the
runtime version.
runtime version. The bundle is always a source build with no release mode, so
`package.json` `version` and `plugin_version` are `0.0.0+source`, which marks
it as not a release.
- Use `find "<question>"` to search Cases, Skills and Records. Follow the
emitted `read` command to inspect the selected material and its revision.
On a remote connection, use `inferrsi_remote` with `operation: "cli"` and
Expand Down
6 changes: 6 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ uploaded wheel/sdist or explicitly select the SCM build version. Development
builds without a stable tag may
have a development version and are not stable releases.

Plugins built from a source checkout without `--release-version` report
`0.0.0+source` as their own version (the Codex and WorkSwarm builders and the
DSH bundle, which has no release mode). Only the release workflow's
`--release-version` stamps the tag version. A clean tag checkout does not
resolve to its tag version by itself.

## Failure and concurrency behavior

Runs are serialized across schedule and manual dispatch. A failed build creates
Expand Down
5 changes: 5 additions & 0 deletions docs/workswarm-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ Plain unbuilt source reports runtime version `0+unknown`; `--plugin-info`
reports that development state explicitly. A versioned build can use
`--release-version <version>` only when the already-built runtime agrees;
this stamps generated host metadata without modifying canonical source bytes.
A build without it is a source build, not a release: `manifest.json` `version`
and `plugin_version` in `runtime/manifest.json` and `--plugin-info` are
`0.0.0+source`, while `runtime_version` still reports the bundled runtime. The
marker does not identify the source; compare builds by `content_sha256` and the
source commit.

Actual end-to-end desktop/LLM journeys,
cancellation/reconnect, other host releases and Linux/macOS installation require
Expand Down
2 changes: 1 addition & 1 deletion plugins/inferrsi-dsh/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inferrsi-dsh",
"version": "0.0.0",
"version": "0.0.0+source",
"description": "InferRSI inference-engine research and evidence workflows for DeepSeek Harness",
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion plugins/inferrsi/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "inferrsi",
"version": "0.1.0",
"version": "0.0.0+source",
"description": "Research inference optimizations and prepare, run and inspect evidence-based comparisons.",
"author": {"name": "InferMatrixLab"},
"homepage": "https://github.com/InferMatrixLab/InferRSI",
Expand Down
2 changes: 1 addition & 1 deletion plugins/workswarm/inferrsi/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0",
"version": "0.0.0+source",
"package_type": "plugin",
"id": "inferrsi",
"name": "InferRSI",
Expand Down
136 changes: 136 additions & 0 deletions tests/test_plugin_source_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
"""Source-built plugins report an explicit non-release version.

Release builds stamp ``--release-version`` and are covered in test_codex_plugin
and test_workswarm_plugin. These tests pin what a build without it reports.
"""

import json
import os
import shutil
import subprocess
import sys
import tarfile
from pathlib import Path

import pytest

from tools import build_dsh_plugin
from tools.build_codex_plugin import build_plugin as build_codex_plugin
from tools.build_workswarm_plugin import build_plugin as build_workswarm_plugin
from tools.plugin_bundle import PROJECT, _io_path

SOURCE_VERSION = "0.0.0+source"
GENERATED_VERSION = "0.2.0"
TEMPLATES = {
"codex": "plugins/inferrsi/plugin.json",
"workswarm": "plugins/workswarm/inferrsi/manifest.json",
"dsh": "plugins/inferrsi-dsh/package.json",
}
METADATA_FILES = {"codex": "plugin.json", "workswarm": "manifest.json", "dsh": "package.json"}
RELEASE_BUILDERS = {"codex": build_codex_plugin, "workswarm": build_workswarm_plugin}


def make_checkout(root, generated_version):
"""Copy only what the three builders read; optionally add the SCM-generated version."""
project = root / "source"
ignore = shutil.ignore_patterns("__pycache__", "*.pyc")
for directory in ("src/inferrsi", "plugins"):
shutil.copytree(_io_path(PROJECT / directory), _io_path(project / directory),
ignore=ignore)
(project / "docs").mkdir()
for name in ("codex-plugin.md", "workswarm-plugin.md", "dsh-plugin.md", "dashboard.md"):
shutil.copyfile(PROJECT / "docs" / name, project / "docs" / name)
shutil.copyfile(PROJECT / "LICENSE", project / "LICENSE")
generated = _io_path(project / "src/inferrsi/_version.py")
# A developer's editable install may have left a generated file in the source tree.
generated.unlink(missing_ok=True)
if generated_version is not None:
generated.write_text(f'__version__ = version = "{generated_version}"\n',
encoding="utf-8")
return project, generated_version or "0+unknown"


@pytest.fixture(scope="module")
def unbuilt(tmp_path_factory):
return make_checkout(tmp_path_factory.mktemp("unbuilt"), None)


@pytest.fixture(scope="module")
def built(tmp_path_factory):
return make_checkout(tmp_path_factory.mktemp("built"), GENERATED_VERSION)


@pytest.fixture(params=["unbuilt", "built"])
def checkout(request):
return request.getfixturevalue(request.param)


def build_package(host, project, tmp_path, monkeypatch, release_version=None):
"""Build one host from ``project`` and return its metadata, manifest and --plugin-info."""
if host == "dsh":
monkeypatch.setattr(build_dsh_plugin, "PROJECT", project)
result = build_dsh_plugin.build_bundle(tmp_path / "inferrsi-dsh.tgz")
extracted = _io_path(tmp_path / "extracted")
with tarfile.open(result["archive"]) as bundle:
bundle.extractall(extracted)
package = extracted / "package"
launcher = package / "assets/inferrsi/scripts/inferrsi.py"
else:
result = RELEASE_BUILDERS[host](tmp_path / "plugin", project=project,
release_version=release_version)
package = _io_path(Path(result["plugin"]))
launcher = package / "skills/inferrsi/scripts/inferrsi.py"
run = subprocess.run(
[sys.executable, "-I", "-S", "-X", "utf8", str(launcher), "--plugin-info"],
cwd=tmp_path, capture_output=True, text=True, encoding="utf-8", timeout=45,
env=dict(os.environ, LOCALAPPDATA=str(tmp_path / "runtime-cache")),
)
assert run.returncode == 0, run.stderr
return {
"metadata": json.loads((package / METADATA_FILES[host]).read_text(encoding="utf-8")),
"manifest": json.loads((package / "runtime/manifest.json").read_text(encoding="utf-8")),
"info": json.loads(run.stdout),
}


@pytest.mark.parametrize("host", TEMPLATES)
def test_templates_carry_the_source_marker(host):
template = json.loads((PROJECT / TEMPLATES[host]).read_text(encoding="utf-8"))
assert template["version"] == SOURCE_VERSION


@pytest.mark.parametrize("host", TEMPLATES)
def test_source_build_reports_the_marker_beside_the_bundled_runtime(
host, checkout, tmp_path, monkeypatch,
):
project, runtime_version = checkout
package = build_package(host, project, tmp_path, monkeypatch)
# The plugin is not a release; the runtime keeps its own, possibly different, version.
assert package["metadata"]["version"] == SOURCE_VERSION
assert package["manifest"]["plugin_version"] == SOURCE_VERSION
assert package["manifest"]["runtime_version"] == runtime_version
assert package["info"]["plugin_version"] == SOURCE_VERSION
assert package["info"]["runtime_version"] == runtime_version


@pytest.mark.parametrize("host", RELEASE_BUILDERS)
def test_release_build_keeps_stamping_the_matching_runtime_version(
host, built, tmp_path, monkeypatch,
):
project, runtime_version = built
package = build_package(host, project, tmp_path, monkeypatch,
release_version=runtime_version)
assert package["metadata"]["version"] == runtime_version
assert package["manifest"]["plugin_version"] == runtime_version
assert package["manifest"]["runtime_version"] == runtime_version
assert package["info"]["plugin_version"] == runtime_version
assert package["info"]["runtime_version"] == runtime_version


@pytest.mark.parametrize("host", RELEASE_BUILDERS)
def test_release_build_rejects_a_version_other_than_the_runtime(host, checkout, tmp_path):
project, _ = checkout
output = tmp_path / "mismatch"
with pytest.raises(ValueError, match="match the built runtime"):
RELEASE_BUILDERS[host](output, project=project, release_version="9.9.9")
assert not output.exists() and not output.with_suffix(".zip").exists()
Loading