Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
improve PR messages from oss sync (#2549)
robert-inkeep584311a9c7b8
diff --git a/.github/scripts/bridge-public-pr-to-monorepo.mjs b/.github/scripts/bridge-public-pr-to-monorepo.mjsindex 2b4501afd..4da8c41b9 100644--- a/.github/scripts/bridge-public-pr-to-monorepo.mjs+++ b/.github/scripts/bridge-public-pr-to-monorepo.mjs@@ -309,7 +309,7 @@ function prefixPatchPaths(patch, prefix, pathRewrites = {}) {}function internalPullRequestTitle(publicPr) {- return `Sync public PR #${publicPr.number}: ${publicPr.title}`;+ return `Sync ${publicPr.base.repo.full_name} public PR #${publicPr.number}: ${publicPr.title}`;}function singleLineCommitSubject(value) {@@ -322,7 +322,7 @@ function bridgeCommitSubject({ publicRepo, publicPr, hasConflicts }) {const title = singleLineCommitSubject(publicPr.title);const suffix = hasConflicts ? ` (${CONFLICT_COMMIT_MARKER})` : '';return [- `chore(sync): mirror ${publicRepo}#${publicPr.number}`,+ `sync(oss): mirror ${publicRepo}#${publicPr.number}`,title ? `: ${title}` : '',suffix,].join('');@@ -432,21 +432,24 @@ function formatOriginalCommitMessages(commitMessages, publicRepo) {if (entries.length === 0) return '';- const formatted = entries.map((entry, index) => {- const [subject, ...bodyLines] = entry.message.split('\n');- const body =- bodyLines.length > 0 ? `\n\n${bodyLines.map((line) => ` ${line}`).join('\n')}` : '';- const author = entry.author ? `\n Author: ${entry.author.name} <${entry.author.email}>` : '';+ const formatted = entries.map((entry) => {+ const lines = [];if (entry.sha && entry.shortSha && publicRepo) {- return `${index + 1}. [${entry.shortSha}](https://github.com/${publicRepo}/commit/${entry.sha}) ${subject}${author}${body}`;+ lines.push(`[${entry.shortSha}](https://github.com/${publicRepo}/commit/${entry.sha})`);+ } else if (entry.shortSha) {+ lines.push(entry.shortSha);+ } else {+ lines.push('Commit');+ }+ if (entry.author) {+ lines.push(`Author: ${entry.author.name} <${entry.author.email}>`);}- const prefix = entry.shortSha- ? `${index + 1}. ${entry.shortSha} ${subject}`- : `${index + 1}. ${subject}`;- return `${prefix}${author}${body}`;+ lines.push('');+ lines.push(entry.message);+ return lines.join('\n');});- return ['Commits:', '', ...formatted].join('\n');+ return ['Commits:', '', formatted.join('\n\n')].join('\n');}function buildCommitAttribution({ commitAuthors, commitMessages = [], publicRepo }) {@@ -470,7 +473,7 @@ function buildInternalPrBody({ publicPr, branchName, mirrorPath }) {: '_No public PR body was provided._';const compose = (original) => `## Summary-Mirror public PR [#${publicPr.number}](${publicPr.html_url}) from \`${publicPr.base.repo.full_name}\` into \`inkeep/agents-private\` for canonical review and merge.+Mirror public PR [#${publicPr.number}](${publicPr.html_url}) from \`${publicPr.base.repo.full_name}\` into \`inkeep/agents-private\` for internal review and merge.## Attribution- Original author: @${publicPr.user.login}@@ -487,9 +490,10 @@ ${original}</details>## Notes-- This PR branch is auto-managed from the public repo PR.-- Merge the monorepo PR, not the public PR.-- After the internal PR merges, the public repo should be updated by the next non-dry-run mirror sync.+- Do not edit this PR directly. This branch is fully managed by the public PR bridge and may be overwritten on the next sync.+- Do not merge the public repo PR. Public mirror PRs cannot land changes directly.+- To accept the contribution, merge this monorepo PR. The change will sync back to the public repo automatically, and the public PR will close automatically.+- To make edits or updates to these changes, they should be made directly to the public PR. Contributor updates there will sync back into this monorepo PR.${buildBridgeMetadata(publicPr, mirrorPath)}`;diff --git a/.github/scripts/bridge-public-pr-to-monorepo.test.mjs b/.github/scripts/bridge-public-pr-to-monorepo.test.mjsindex 136eaf319..1f2629a90 100644--- a/.github/scripts/bridge-public-pr-to-monorepo.test.mjs+++ b/.github/scripts/bridge-public-pr-to-monorepo.test.mjs@@ -74,16 +74,19 @@ describe('buildCommitAttribution', () => {['Commits:','',- '1. [1234567](https://github.com/inkeep/open-knowledge/commit/1234567890abcdef) Add search',- ' Author: Sarah Inkeep <[email protected]>',+ '[1234567](https://github.com/inkeep/open-knowledge/commit/1234567890abcdef)',+ 'Author: Sarah Inkeep <[email protected]>','',- ' ',- ' Explain the indexing path.',- '2. [fedcba9](https://github.com/inkeep/open-knowledge/commit/fedcba9876543210) Fix empty query',- ' Author: Robert Inkeep <[email protected]>',+ 'Add search','',- ' ',- ' Co-authored-by: A <[email protected]>',+ 'Explain the indexing path.',+ '',+ '[fedcba9](https://github.com/inkeep/open-knowledge/commit/fedcba9876543210)',+ 'Author: Robert Inkeep <[email protected]>',+ '',+ 'Fix empty query',+ '',+ 'Co-authored-by: A <[email protected]>',].join('\n'),);expect(attribution.trailers).toEqual([@@ -113,7 +116,7 @@ describe('bridgeCommitSubject', () => {publicPr: { number: 361, title: 'Preserve contributor commit messages' },hasConflicts: false,}),- ).toBe('chore(sync): mirror inkeep/open-knowledge#361: Preserve contributor commit messages');+ ).toBe('sync(oss): mirror inkeep/open-knowledge#361: Preserve contributor commit messages');});test('normalizes multiline titles and preserves the conflict marker', () => {@@ -124,7 +127,7 @@ describe('bridgeCommitSubject', () => {hasConflicts: true,}),).toBe(- 'chore(sync): mirror inkeep/open-knowledge#361: Fix bridge subject (with conflicts; needs manual resolution)',+ 'sync(oss): mirror inkeep/open-knowledge#361: Fix bridge subject (with conflicts; needs manual resolution)',);});});@@ -506,13 +509,13 @@ describe('commitIndicatesConflicts (metadata-re-sync conflict-hold guard)', () =test('true for a conflict-marker mirror commit message', () => {expect(commitIndicatesConflicts(- 'chore(sync): mirror inkeep/open-knowledge#310 (with conflicts; needs manual resolution)',+ 'sync(oss): mirror inkeep/open-knowledge#310 (with conflicts; needs manual resolution)',),).toBe(true);});test('false for a clean mirror commit message', () => {- expect(commitIndicatesConflicts('chore(sync): mirror inkeep/open-knowledge#310')).toBe(false);+ expect(commitIndicatesConflicts('sync(oss): mirror inkeep/open-knowledge#310')).toBe(false);});test('false for absent / non-string input', () => {@@ -534,8 +537,8 @@ describe('commitIndicatesConflicts (metadata-re-sync conflict-hold guard)', () =// observable draft/comment OUTCOME, not call counts.const CONFLICT_HEAD =- 'chore(sync): mirror inkeep/open-knowledge#310 (with conflicts; needs manual resolution)';-const CLEAN_HEAD = 'chore(sync): mirror inkeep/open-knowledge#310';+ 'sync(oss): mirror inkeep/open-knowledge#310 (with conflicts; needs manual resolution)';+const CLEAN_HEAD = 'sync(oss): mirror inkeep/open-knowledge#310';// Drive the real syncPublicPr through a metadata-only ('edited') event with the// GitHub API faked. Returns the load-bearing observable mutations it made.