codex-security icon indicating copy to clipboard operation
codex-security copied to clipboard

Document npm, bundled plugin, and runtime/catalog version mapping

Open chainTe opened this issue 3 months ago • 1 comments

Summary

Codex Security exposes several version identifiers. Release documentation should explain what each one versions and how to establish the immutable relationship between an npm package, its bundled plugin content, and the runtime/catalog identifiers shown to users.

Different version strings do not by themselves prove different plugin bytes. The original report was about documenting provenance for downstream vendoring and support diagnostics.

Current request

  • Explain the npm package version/tag, .codex-plugin/plugin.json version, Codex runtime version, and any independently versioned catalog/plugin distribution identifier.
  • Document which metadata establishes the bundled source commit/content identity.
  • Provide a reproducible mapping or inspection workflow for a released package.
  • Explain which identifiers should be included in a bug report and which are expected to differ.

#361 remains open as the related documentation proposal. Aligning version numbers is one possible design choice, not required if their relationship is clearly documented.

Historical example

The report compared npm tag npm-v0.1.5, bundled plugin manifest 0.1.14, and a reported runtime/catalog plugin version 0.1.15. At that tag:

commit:       66778d0d85f478d7832854b81d0a6ddb93a3ce4c
bundled tree: 09b14c17694b5f568dd61860f2bc63771e5e4280
manifest:     0.1.14

The historical source inspection was:

git checkout npm-v0.1.5
git rev-parse HEAD
git rev-parse HEAD:sdk/typescript/_bundled_plugin
jq -r .version sdk/typescript/_bundled_plugin/.codex-plugin/plugin.json

That path and version tuple describe the old tag, not the current packaging layout. Observations that a manifest version stayed unchanged across older releases should likewise remain historical evidence, rather than a claim that current plugin versions never change.

chainTe avatar Aug 03 '26 13:08 chainTe

Your three observed values check out, and building the table across every published tag turns up something sharper than a documentation gap: bundledPluginVersion cannot identify bundled content, because it has never changed while the content has changed every release.

The mapping, derived from all six published tags

npm tag commit _bundled_plugin tree plugin.json version package.json version
npm-v0.1.0 a45e3ee2f9cc 2076731023a2 0.1.14 0.1.0
npm-v0.1.1 e94d6bef9797 2076731023a2 0.1.14 0.1.1
npm-v0.1.2 1e03c89ad22d 464e53b25a58 0.1.14 0.1.2
npm-v0.1.3 f89633aeee1e 7f2e7c0a8879 0.1.14 0.1.3
npm-v0.1.4 ab3b91c8b1fc faf3bfb780d1 0.1.14 0.1.4
npm-v0.1.5 66778d0d85f4 09b14c17694b 0.1.14 0.1.5

(Tree hashes are the _bundled_plugin entry SHA from the contents API at each tag, which is the git tree object — the same value your git rev-parse HEAD:sdk/typescript/_bundled_plugin produces. npm-v0.1.5 reproduces your 09b14c17694b… exactly.)

What that shows

  1. package.json version tracks the npm tag 1:1 — that pair is a reliable anchor.
  2. plugin.json version is frozen at 0.1.14 across all six releases, while the bundled tree hash changes at 0.1.2, 0.1.3, 0.1.4 and 0.1.5. So it is not a stale-by-one-release mismatch — the field simply does not track the bundled content at all.
  3. That value is user-visible: cli.ts reports it as bundledPluginVersion from BUNDLED_PLUGIN_VERSION via codex-security info, which is where people (understandably) read it as a content identifier. It appears in bug reports for that reason — e.g. #27's diagnostics show bundledPluginVersion: 0.1.14 on 0.1.1.
  4. 0.1.0 and 0.1.1 share tree 2076731023a2, so the bundled plugin was genuinely byte-identical across those two npm releases.

For byte-for-byte vendoring today

The only self-consistent anchor available in this repo is the tag → commit → tree triple:

git rev-parse "npm-v${VERSION}"                                   # commit
git rev-parse "npm-v${VERSION}:sdk/typescript/_bundled_plugin"    # bundled tree

Pin on the tree hash, not on bundledPluginVersion.

What I could not determine

The runtime/catalog 0.1.15 is not derivable from this repository — nothing here emits it, so I can't verify or map it. That part genuinely needs maintainer input, as does whether the frozen plugin.json version is intentional (a manifest-schema version, say) or an oversight in the release process.

Happy to open a focused docs PR adding the verifiable half of this — the tag/commit/tree recipe plus a note that bundledPluginVersion does not identify bundled content — and leave the runtime mapping for you to fill in. Say the word and I'll put it up.

Souptik96 avatar Aug 04 '26 07:08 Souptik96