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
6 changes: 2 additions & 4 deletions internal/cli/codex_marketplace.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ func WriteCodexLocalMarketplace(marketplaceRoot, repoRoot, marketplaceName strin
// so a throwaway dir removed after install would hard-fail every subsequent codex
// invocation. It prints the version-masquerade advisory on every call: a
// `--plugin-dir` install reports the checkout's checked-in .codex-plugin/plugin.json
// version, not necessarily its current HEAD (the full stamping fix lives in
// next-post-release-preversion-bump).
// version, not necessarily its current HEAD (the full stamping fix is deferred).
func installCodexLocalPluginDir(ops hostOps, checkout string, stderr io.Writer) error {
marketplaceRoot := filepath.Join(codexHome(), "spacedock-plugin-dir", channelMarketplace(devBranch))
if err := os.MkdirAll(marketplaceRoot, 0o755); err != nil {
Expand All @@ -138,8 +137,7 @@ func installCodexLocalPluginDir(ops hostOps, checkout string, stderr io.Writer)
fmt.Fprintf(stderr,
"Installed codex plugin from %s.\n"+
"version-masquerade advisory: the reported version reflects the checkout's "+
"checked-in .codex-plugin/plugin.json, not necessarily its current HEAD — "+
"see next-post-release-preversion-bump.\n",
"checked-in .codex-plugin/plugin.json, not necessarily its current HEAD.\n",
checkout)
return nil
}
10 changes: 9 additions & 1 deletion internal/cli/codex_plugin_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ func TestRunCodexPluginDirInstallsThenLaunchesWithoutTheFlag(t *testing.T) {
// TestCodexPluginDirAdvisoryPresenceAndAbsence is AC-3: every --plugin-dir codex
// install prints the version-masquerade advisory; a plain (non---plugin-dir) launch
// prints none. The pair (not a presence-only check) means the test cannot pass by
// printing the advisory unconditionally.
// printing the advisory unconditionally. The present subtest also guards that the
// advisory carries its meaning-bearing clause (not necessarily its current HEAD) and
// leaks no internal branch identifier.
func TestCodexPluginDirAdvisoryPresenceAndAbsence(t *testing.T) {
const advisory = "version-masquerade advisory"

Expand All @@ -92,6 +94,12 @@ func TestCodexPluginDirAdvisoryPresenceAndAbsence(t *testing.T) {
if !strings.Contains(stderr.String(), advisory) {
t.Fatalf("stderr missing the version-masquerade advisory: %q", stderr.String())
}
if !strings.Contains(stderr.String(), "not necessarily its current HEAD") {
t.Fatalf("advisory lost its meaning-bearing clause: %q", stderr.String())
}
if strings.Contains(stderr.String(), "next-post-release-preversion-bump") {
t.Fatalf("advisory leaks the internal branch identifier: %q", stderr.String())
}
})

t.Run("absent on plain launch", func(t *testing.T) {
Expand Down
Loading