Repository navigation
Derive project identity from package version and compiler revisions #94
Description
Summary
Stop requiring application authors to repeat the package version in
agent-bundle.config.ts and runtime registries. Derive release identity from
the project package, preserve Agent Bundle's existing source/config/model
revisions, and expose those distinct axes consistently in manifests, dev
status, runtime requests, and provenance.
This is a focused identity migration, not part of filesystem route discovery.
Problem
Agent Bundle currently requires plugin.version in config, while examples may
also restate name/version inside runtime application registries. At the same
time, ProjectContext already records source revision, config digest, model
digest, and source inputs. A static version in multiple authoring surfaces can
drift, while replacing semantic version with a development hash would conflate
release and source identity.
Contract
Reuse and extend the existing ProjectContext; do not introduce a parallel
identity object.
interface ProjectIdentity {
packageName: string;
packageVersion: string;
sourceRevision: string;
configDigest: string;
modelDigest: string;
}Rules:
package.jsonname/version are authoritative for packaged projects;- release artifacts and host manifests retain the semantic package version;
- development status and generated manifests also expose the canonical source
revision; - config/model digests remain separate compatibility/provenance axes;
- a display label may render
<packageVersion>+dev.<short-source-revision>without changing the canonical
semantic version; - changing
package.jsoninvalidates the project context and source revision; - runtime registries and route modules never restate project identity;
- release builds fail closed when package identity is missing or invalid;
- a documented development-only fallback may exist for unpackaged scratch
projects, but it cannot produce a release artifact.
Migration
- Read and validate package identity during project loading.
- Add derived identity to normalized config and generated manifests.
- Warn when
plugin.versiondiffers frompackage.json. - Make
plugin.versionoptional and prefer package identity. - Remove duplicated runtime application identity during route migration.
- Deprecate and later remove
plugin.versionthrough the repository's normal
breaking-change policy; this issue does not promise a fixed compatibility
window.
Acceptance criteria
- One packaged project declares its version only in
package.json. - Build, inspect, Workbench, runtime context, and host manifests agree on
package version, source revision, config digest, and model digest. - Editing source changes source revision without changing package version.
- Editing package version changes package and source identity deterministically.
- A conflicting legacy
plugin.versionfails or warns according to the active
migration phase; it never silently wins. - A release build without valid package identity fails closed.
- No application route or runtime registry repeats name/version.
Design references
- Current required plugin identity type
- Current config normalization
- Current
ProjectContextrevision and digest model - Node.js package metadata conventions
Stack position
- Can land independently of filesystem routes after current project loading.
- #93 filesystem routes and #95 request context consume its derived identity when available but do not block initial implementation on the migration.
Full meta-framework stack
- Foundations: #93 routes - #94 identity - #95 context - #96 renderer
- Runtime: #97 events - #98 state - #99 notices
- Host: #100 components - #101 lifecycle
- Surfaces and proof: #102 CLI/scripts - #103 Rstest - #104 proximity example - #105 Workbench
Activity
feat(identity): derive package name/version into project identity (st…
feat(identity): derive package name/version into project identity (st…
ScriptedAlchemy commentedon Sep 1, 2026
Stages 1-2 landed in #121 (merge e8908cc), the reconciled superset of #117 and #115 (#117 could not be reopened after a post-closure rebase force-push, so the identical branch landed as #121).
Delivered (stages 1-2):
packageName/packageVersionderived from the project'spackage.json, validated (npm name rules incl. reserved names, strict semver 2.0.0), carried as optional axes onNormalizedMetadata/ProjectContext, and exposed distinctly in artifact manifests,inspectoutput, and dev status DTOs (SourceStatus,ArtifactEpoch, agent API wire, workbench client decoders).package.jsonis authoritative for the release axes;plugin.versionauthors only the native plugin version and a mismatch reports the AB4008 warning. Invalid identity is a diagnostic, never a crash: AB4009 invalid npm name, AB4010 invalid semver, AB4011 unusable package.json (unparsable or symlinked outside the project root).0.0.0-dev.<short-revision>display fallback; no new required fields.plugin.nameremains the host-native slug, never derived from the npm package name.Remaining (stage 3): making
plugin.versionoptional and release fail-closed behavior.ScriptedAlchemy commentedon Sep 2, 2026
Stage 3 landed in #270 (merge 09067f6), together with #237's build-time constant.
plugin.versionis now optional: omitted → derived frompackage.json(migration step 4); declared → still authoritative for the host-facing version during the migration, with AB4008 staying a warning (step 3 policy unchanged).agent-bundle buildrefuses a project with neither an authoredplugin.versionnor a validpackage.jsonversion with the new AB4013 error before anything compiles.dev/inspect/validatekeep the labeled0.0.0-dev.<short-revision>fallback — the documented development-only state that can never produce a release artifact.agent-bundle/meta(Infer plugin version from package.json and expose a build-time version constant to plugin code #237): build, inspect, dev status, host manifests, and compiled Node + browser bundles all report the same identity axes.examples/audiobook-curatornow declares its version only inpackage.json(the acceptance-criteria proof project).Remaining for this issue: migration step 5 (remove duplicated runtime application identity during route migration — tracked with the #93/#95 route work) and step 6 (deprecate and eventually remove
plugin.versionper the normal breaking-change policy). Leaving open for those.ScriptedAlchemy commentedon Sep 2, 2026
Completed the final #94 migration steps in #322 (squash merge
0e3c444a).Already complete before this PR
plugin.version, release fail-closed AB4013, and compiledagent-bundle/metaidentity (feat(agent-bundle): optional plugin.version with fail-closed releases and an agent-bundle/meta build-time constant #270).Final remaining scope delivered
agent-bundle/metaidentity rather than restating name/version. The prebuilt RSC example now declares1.0.0inpackage.json, omitsplugin.version, and shares one host slug/package-derived version across its config, MCP server, runtime registry, and App bootstrap.AgentBundlePluginConfig.versionis now formally@deprecated; docs direct new projects topackage.jsonand preserve removal through the normal breaking-change policy with no promised fixed window.Evidence
pnpm typecheck— greenpnpm lint— green (0 errors, 0 warnings)mcp-app-example@1.0.0, no legacymcp-app-status-panel, and no unresolvedagent-bundle/meta@agent-bundle/rsc-agent-runtime-demo, package version1.0.0, and source validation passedAll acceptance owned by #94 is now complete; closing.
fix(docs,create): close the audited #94/#97/#104/#105 remainders (#372)
ScriptedAlchemy commentedon Sep 3, 2026
Closed-issue re-audit (G3) — PARTIAL → fixed in #372 (squash
ccb9cd18a).Verified on
origin/main:plugin.versionis@deprecated(packages/agent-bundle/src/core/types.ts:23);AB4008–AB4011emit fromconfig/validate.ts:1654-1660andAB4013fromconfig/validate.ts:1705;packageName/packageVersionrideProjectContext(core/project-context.ts:33-52);agent-bundle/metais exported;examples/audiobook-curatorandexamples/rsc-agent-runtimedeclare their version only inpackage.json;docs/diagnostics.md§Release identity documents the deprecation.What did not match the closing claim "docs direct new projects to
package.json": the headline configs inREADME.mdanddocs/framework-mode.md, and all threecreate-agent-bundletemplates, still authoredplugin.version: '0.1.0'— every scaffolded project started on the deprecated field. #372 removes it from both docs and the templates (package.json0.1.0is the single source; a scaffolded minimal project validates with zero diagnostics andinspectreportsversion: "0.1.0"derived frompackageVersion), adds a per-template scaffold test pinning "noversion:in the config,0.1.0in package.json" (packages/create-agent-bundle/tests/scaffold.test.ts), and ships acreate-agent-bundlepatch changeset. Evidence: scaffold tests 23/23,scaffold-packed.e2e(minimal template auto-installs and passes its owncheckwithoutplugin.version) ✓, CI green on #372.Remaining by design:
examples/hooks-and-scripts,mcp-app, andskills-starterkeepplugin.versionbecause theirpackage.jsonhas noversion(dropping it would tripAB4013);worktree-proximitydeclares both, in agreement (noAB4008).