Skip to content

fix(packs): a runtime pack's persistence overrides its compiled definition - #442

Merged
johnnyelwailer merged 2 commits into
mainfrom
fix/pack-persistence-runtime-override
Oct 8, 2026
Merged

johnnyelwailer merged 2 commits into
mainfrom
fix/pack-persistence-runtime-override

Conversation

@johnnyelwailer

Copy link
Copy Markdown
Owner

Fixes the #435 review finding (Codex P1). If T3TEAM_PACKS_DIR held a newer version of a pack that the compiled-in distribution also registers, and the newer version changed its collection metadata, runtime registration threw Duplicate pack persistence. runT3TeamServerCommand caught that for the whole runtime map, so the updated pack kept the stale compiled definition and every other runtime pack lost its store.

Fix

registerPackCollections(definitions, source) now keeps a compiled layer and a runtime layer. The effective map is the compiled baseline overlaid by the runtime layer, with runtime winning per pack id. That matches how the rest of the compiled-in distribution is overridden (t3team-distribution-bootstrap.ts: "a runtime pack that provides a given content type overrides it"). A conflicting definition inside one source still fails atomically, and re-registering an identical definition is still a no-op.

Tests

vp test run src/t3team-packDocumentConfig.test.ts src/t3team-packPersistence.test.ts src/t3team-distributionPersistenceModule.test.ts: 3 files, 7 tests pass. The new test was committed first and failed with Error: Duplicate pack persistence: override-test. It checks that a runtime pack overrides the compiled definition, that a compiled-only pack and a runtime-only pack both survive, and that a later compiled activation never replaces the runtime override.

🤖 Generated with Claude Code

Phil J and others added 2 commits October 7, 2026 21:35
…definition

Fails today with "Duplicate pack persistence" (#435 review, Codex P1).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ition

Compiled-in and runtime persistence shared one registry that treated any differing definition
for the same pack id as a duplicate. When T3TEAM_PACKS_DIR held a newer version of a compiled
pack, runtime registration threw, the boot catch dropped the whole runtime map, and every
runtime pack lost its store. Each source now registers into its own layer (conflicts within one
source still fail atomically) and the effective map is the compiled baseline overlaid by the
runtime layer, matching how the other compiled-in content is overridden.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for aa5862e.

This comment will update automatically after the next completed run.

@johnnyelwailer
johnnyelwailer marked this pull request as ready for review October 8, 2026 05:56
@johnnyelwailer
johnnyelwailer merged commit 46588d5 into main Oct 8, 2026
23 of 24 checks passed
@johnnyelwailer
johnnyelwailer deleted the fix/pack-persistence-runtime-override branch October 8, 2026 05:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T05:57:40.938531Z aa5862e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant