[PR #382] [MERGED] build(catalog): preserve generatedAt across rebuilds to stop cross-PR conflicts #941

Closed
opened 2026-10-20 17:32:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/382
Author: @kolacheee
Created: 8/16/2026
Status: ✅ Merged
Merged: 8/16/2026
Merged by: @kolacheee

Base: staging ← Head: fix/catalog-generatedat-churn


📝 Commits (2)

  • 80f19ed build(catalog): preserve generatedAt across rebuilds to stop cross-PR conflicts
  • dd5bf1b fix(catalog): validate committed generatedAt as canonical ISO-8601, not just Date.parse

📊 Changes

8 files changed (+176 additions, -4 deletions)

View changed files

📝 .github/workflows/pull-request-checks.yml (+3 -0)
📝 CONTRIBUTING.md (+2 -0)
📝 scripts/build-agent-catalog.mjs (+2 -1)
📝 scripts/build-feature-packages.mjs (+2 -1)
📝 scripts/build-pixelforge-package.mjs (+2 -1)
📝 scripts/catalog-lanes.mjs (+45 -0)
📝 scripts/sync-catalog-artwork.mjs (+2 -1)
➕ scripts/tests/catalog-generatedat-determinism.regression.mjs (+118 -0)

📄 Description

Pull request

Linked issue

Closes #381 — removes the timestamp conflict that fires on every concurrent package PR (implements Option B). Options A and C from #381 are broader enhancements beyond the reported problem and are captured there for a possible owner-led follow-up.

Why this change

Every package build stamped catalog.generatedAt with the current wall-clock time right before writing catalog/{catalog,v2,v3}.json. That single line differs between any two regenerations, so two package PRs open at the same time always conflict on it — and when one merges, every other open PR has to rebase and re-run the full CI suite. With several devs working concurrently this fires constantly. It is the catalog conflict that happens every time (a merge only stays clean when just one side regenerated; as soon as both do, the timestamp collides).

What changed

  • writeCatalogFamily() (scripts/catalog-lanes.mjs) now resolves generatedAt through a new resolveCatalogGeneratedAt(): preserve the committed value by default so a no-op rebuild is byte-identical, and refresh it only when a publish step opts in with MARINARA_CATALOG_STAMP_GENERATED_AT=1. A fixed epoch is the first-build fallback.
  • Removed the four per-build catalog.generatedAt = new Date() stamps (build-agent-catalog.mjs, build-feature-packages.mjs, build-pixelforge-package.mjs) and routed sync-catalog-artwork.mjs through the same resolver — it previously rewrote catalog.json with a fresh timestamp on every run, diverging it from the v2/v3 lanes, so this also fixes a latent inconsistency.
  • Added scripts/tests/catalog-generatedat-determinism.regression.mjs and wired it into the catalog PR check; added a CONTRIBUTING note.

With the always-changing timestamp gone, two PRs that touch different packages now typically auto-merge (non-adjacent array inserts). Adjacent-entry conflicts and the full "CI owns the catalog" redesign (Option A) are discussed in #381 — A is deliberately left for the repo owner because it changes the CODEOWNERS/owner-only-main integrity model.

Package and security impact

No package payload, artifact, manifest, hash, or committed catalog file changes — this only changes how the generator fills one derived field. Security-neutral: it does not alter who commits or reviews catalog/ + artifacts/. The Engine catalog schema only requires a valid ISO-8601 datetime, and the capability package manager (package-manager.service.ts) drives updates by per-package version, never by catalog generatedAt — verified — so preserving the value is functionally inert for the Engine.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • node scripts/tests/catalog-generatedat-determinism.regression.mjs — passes locally (preserve-by-default, epoch fallback, and MARINARA_CATALOG_STAMP_GENERATED_AT=1 refresh). Now part of the pull-request-checks gate.
  • node scripts/test-catalog-lanes.mjs — passes locally. All five edited scripts pass node --check.
  • node scripts/validate-catalog.mjs — not checked above because it fails on this Windows checkout on a pre-existing CRLF artifact (eightball agents.json size), reproducible with these changes stashed; it is unrelated to this PR and expected to pass on CI's Linux/LF runner. Please confirm green in CI.
  • No package is added/changed, so the manifest/artifact/install/mode boxes are N/A for this PR.
  • Maintainer note: because nothing sets MARINARA_CATALOG_STAMP_GENERATED_AT, generatedAt now freezes at its current committed value. That is functionally inert for the Engine (above), but if you want main's timestamp to keep advancing per release, add MARINARA_CATALOG_STAMP_GENERATED_AT=1 to the staging→main promotion step.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

(CONTRIBUTING.md updated to document the preserve-by-default behavior and the MARINARA_CATALOG_STAMP_GENERATED_AT=1 opt-in.)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/382 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/16/2026 **Status:** ✅ Merged **Merged:** 8/16/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/catalog-generatedat-churn` --- ### 📝 Commits (2) - [`80f19ed`](https://github.com/Pasta-Devs/Marinara-Agents/commit/80f19ed2b52e42a5951be4848718a07e8cf48148) build(catalog): preserve generatedAt across rebuilds to stop cross-PR conflicts - [`dd5bf1b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/dd5bf1ba4875f18b928ca0dbbff7472e85a5f753) fix(catalog): validate committed generatedAt as canonical ISO-8601, not just Date.parse ### 📊 Changes **8 files changed** (+176 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-checks.yml` (+3 -0) 📝 `CONTRIBUTING.md` (+2 -0) 📝 `scripts/build-agent-catalog.mjs` (+2 -1) 📝 `scripts/build-feature-packages.mjs` (+2 -1) 📝 `scripts/build-pixelforge-package.mjs` (+2 -1) 📝 `scripts/catalog-lanes.mjs` (+45 -0) 📝 `scripts/sync-catalog-artwork.mjs` (+2 -1) ➕ `scripts/tests/catalog-generatedat-determinism.regression.mjs` (+118 -0) </details> ### 📄 Description # Pull request ## Linked issue Closes #381 — removes the timestamp conflict that fires on every concurrent package PR (implements **Option B**). Options A and C from #381 are broader enhancements beyond the reported problem and are captured there for a possible owner-led follow-up. ## Why this change Every package build stamped `catalog.generatedAt` with the current wall-clock time right before writing `catalog/{catalog,v2,v3}.json`. That single line differs between *any* two regenerations, so two package PRs open at the same time always conflict on it — and when one merges, every other open PR has to rebase and re-run the full CI suite. With several devs working concurrently this fires constantly. It is the catalog conflict that happens *every* time (a merge only stays clean when just one side regenerated; as soon as both do, the timestamp collides). ## What changed - `writeCatalogFamily()` (`scripts/catalog-lanes.mjs`) now resolves `generatedAt` through a new `resolveCatalogGeneratedAt()`: **preserve the committed value by default** so a no-op rebuild is byte-identical, and refresh it **only** when a publish step opts in with `MARINARA_CATALOG_STAMP_GENERATED_AT=1`. A fixed epoch is the first-build fallback. - Removed the four per-build `catalog.generatedAt = new Date()` stamps (`build-agent-catalog.mjs`, `build-feature-packages.mjs`, `build-pixelforge-package.mjs`) and routed `sync-catalog-artwork.mjs` through the same resolver — it previously rewrote `catalog.json` with a fresh timestamp on every run, *diverging* it from the v2/v3 lanes, so this also fixes a latent inconsistency. - Added `scripts/tests/catalog-generatedat-determinism.regression.mjs` and wired it into the catalog PR check; added a CONTRIBUTING note. With the always-changing timestamp gone, two PRs that touch *different* packages now typically auto-merge (non-adjacent array inserts). Adjacent-entry conflicts and the full "CI owns the catalog" redesign (**Option A**) are discussed in #381 — A is deliberately left for the repo owner because it changes the CODEOWNERS/owner-only-`main` integrity model. ## Package and security impact No package payload, artifact, manifest, hash, or committed catalog file changes — this only changes how the *generator* fills one derived field. Security-neutral: it does not alter who commits or reviews `catalog/` + `artifacts/`. The Engine catalog schema only requires a valid ISO-8601 datetime, and the capability package manager (`package-manager.service.ts`) drives updates by per-package `version`, never by catalog `generatedAt` — verified — so preserving the value is functionally inert for the Engine. ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [x] Installed or updated the affected package through Marinara Engine - [x] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `node scripts/tests/catalog-generatedat-determinism.regression.mjs` — **passes locally** (preserve-by-default, epoch fallback, and `MARINARA_CATALOG_STAMP_GENERATED_AT=1` refresh). Now part of the `pull-request-checks` gate. - `node scripts/test-catalog-lanes.mjs` — passes locally. All five edited scripts pass `node --check`. - `node scripts/validate-catalog.mjs` — **not** checked above because it fails on this Windows checkout on a *pre-existing* CRLF artifact (`eightball agents.json` size), reproducible with these changes stashed; it is unrelated to this PR and expected to pass on CI's Linux/LF runner. Please confirm green in CI. - No package is added/changed, so the manifest/artifact/install/mode boxes are N/A for this PR. - Maintainer note: because nothing sets `MARINARA_CATALOG_STAMP_GENERATED_AT`, `generatedAt` now freezes at its current committed value. That is functionally inert for the Engine (above), but if you want `main`'s timestamp to keep advancing per release, add `MARINARA_CATALOG_STAMP_GENERATED_AT=1` to the `staging`→`main` promotion step. ## Documentation impact - [x] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation (CONTRIBUTING.md updated to document the preserve-by-default behavior and the `MARINARA_CATALOG_STAMP_GENERATED_AT=1` opt-in.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-20 17:32:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#941
No description provided.