mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #381] Catalog regeneration forces every concurrent PR to rebase (catalog/*.json conflicts) #191
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Aug 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/381
Originally assigned to: @kolacheee on GitHub.
Problem
Every package release regenerates
catalog/catalog.json,catalog/v2/catalog.json, andcatalog/v3/catalog.json. Because every package PR commits its regenerated catalog, any two PRs open at the same time touch the same three files. When one merges, the others conflict and must rebase — which also re-runs the full CI suite on each. With several devs working concurrently this happens constantly.Why the conflicts fire
The catalogs are pure derived data —
scripts/build-agent-catalog.mjs(+build-feature-packages.mjs,build-pixelforge-package.mjs) aggregate everypackages/<id>/manifest.jsoninto onepackages[]array via the sharedwriteCatalogFamily()inscripts/catalog-lanes.mjs. Two independent conflict sources:generatedAt— each builder stampedcatalog.generatedAt = new Date().toISOString()right before writing. That single line differs between any two regenerations, so it conflicts even when the two PRs touched completely different packages. (This is the one that fires every time. A merge only stays clean when one side regenerated — as soon as both do, the timestamp collides.)packages[]entries — when two PRs insert/bump entries near each other in the sorted array.Constraint that shapes the fix
raw.githubusercontent.com/Pasta-Devs/Marinara-Agents/<channel>/catalog/...(staging Engine ← this repo'sstaging; stable Engine ←main). So the catalogs must stay committed on those branches — deleting them isn't an option.CONTRIBUTING.md,catalog/+artifacts/are a deliberate security-review surface: "A contributor who can change both an artifact and its catalog entry can also change the recorded hash... paths map toSpicyMarinarain.github/CODEOWNERS.mainmust remain owner-only." Any change to who/what commits catalog + artifact hashes intersects that integrity control.Options
B — Make
generatedAtdeterministic (implemented; security-neutral)Preserve the committed
generatedAtacross rebuilds; refresh it only on an explicitMARINARA_CATALOG_STAMP_GENERATED_AT=1opt-in (e.g. at release). A no-op rebuild becomes byte-identical, and the always-conflicting timestamp line disappears — so two PRs that touch different packages typically auto-merge (non-adjacent array inserts). The Engine catalog schema only needs a valid ISO datetime, which a preserved value satisfies. This removes the conflict that actually fires on every concurrent PR and is the low-risk majority of the fix.→ Draft PR: (link to follow)
A — CI owns the catalog: PRs stop committing it, automation regenerates on merge
The "elegant end state": feature PRs commit only their own
packages/<id>/sources + artifact; CI regenerates + validates the catalog in-job, and a post-merge job regenerates + commits the published catalog. PRs would then share no files and never force a rebase.But this needs an owner (SpicyMarinara) decision, because it changes the integrity-review model above:
staging/mainbypasses the CODEOWNERS gate and the owner-only-mainpromotion that currently vet those hashes.validate-catalog.mjsfrom validating the committed catalog to validating a freshly generated one, and adds a full catalog rebuild to the PR check (CI cost).Because that touches the security posture of a repo I don't own, I'm not implementing the auto-commit unilaterally — flagging it here for the owner to decide whether the bot-commit path is acceptable (it is arguably more consistent than hand-committed hashes, since CI always recomputes them, but it's the owner's call).
C — Regenerate-on-conflict git merge driver (security-neutral middle ground)
A
.gitattributesmerge=driver forcatalog/**/*.jsonthat re-runs the deterministic generator instead of a textual 3-way merge, registered via annpmsetup step. The human still commits and the owner still reviews the result, so the integrity model is unchanged — but local rebases auto-resolve. Weaker than A (GitHub's own mergeability still flags the PR; only local rebases auto-fix), and largely unnecessary once B lands, but it's compatible if more is wanted later.Recommendation
Ship B now (done — draft PR incoming). It's safe, needs no infra/permission changes, and eliminates the conflict that fires every time. Treat A as an owner-gated follow-up (it's the ideal but it's a security-model decision), and keep C in reserve if entry-adjacency conflicts still bite after B.
Filed after CI work on #375 surfaced how often these catalog rebases block concurrent PRs.
@kolacheee commented on GitHub (Aug 16, 2026):
Option B implemented in draft PR #382 (branch
fix/catalog-generatedat-churn):generatedAtis now preserved across rebuilds (fresh stamp only onMARINARA_CATALOG_STAMP_GENERATED_AT=1), with a determinism regression wired into the catalog check. Options A and C remain as described above — A is left for the owner because it changes the CODEOWNERS/owner-only-mainintegrity model.