Skip to content

feat: sync AGENTS.md policy block from organization snippet - #35

Merged
juliusknorr merged 2 commits into
mainfrom
feat/sync-agents-md
Dec 3, 2026
Merged

juliusknorr merged 2 commits into
mainfrom
feat/sync-agents-md

Conversation

@juliusknorr

Copy link
Copy Markdown
Member

Keeps the policy snippet from AGENT_MD_SNIPPETS.md in sync across org repos.

  • scripts/sync-agents-md.sh replaces the block between <!-- euro-office-policy:start ... --> and <!-- euro-office-policy:end --> in each repo's AGENTS.md and opens or refreshes one PR per repo (branch docs/sync-agents-md). With --repo it appends the block where missing. Skips -ghsa- and -rehearsal repos.
  • .github/workflows/sync-agents-md.yml runs the sync on pushes to main that touch the snippet, and on dispatch (dry run by default). On PRs it only runs the test.
  • scripts/test-sync-agents-md.sh covers append, idempotency, replace, CRLF, duplicate blocks and a missing end marker.

Dry run: no repo has markers yet, so an org-wide run is a no-op. --repo Euro-Office/sdkjs plans an update.

Open before merge / rollout

  • Decide the Signed-off-by rule in the snippet (it forbids agent sign-off, which conflicts with maintainers who certify the DCO through their agent)
  • Consider adding the Euro-Office/security-advisories link to the snippet (DocumentServer's copy already has it)
  • Manual PRs moving existing hand-written policy text between the markers: DocumentServer (keep its SPDX/attribution bullets outside the block), MobileEditors, editors-android, editors-engine, editors-ios
  • Dispatch with repos: Euro-Office/sdkjs Euro-Office/fidelity-bench, dry run off
  • Non-dry-run path is untested so far, try it on one repo first

Replaces the block between euro-office-policy markers in each repo's AGENTS.md with AGENT_MD_SNIPPETS.md and opens one PR per repo. Runs on snippet changes to main and on dispatch.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr juliusknorr added documentation Improvements or additions to documentation enhancement New feature or request organizational labels Nov 11, 2026
@juliusknorr
juliusknorr marked this pull request as ready for review November 30, 2026 22:12

@moodyjmz moodyjmz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "stale block replaced" test doesn't test replacement. ${around/Label every issue/Stale rule} (test-sync-agents-md.sh:21) matches nothing, because the snippet has no "Label every issue", so stale equals around and the assertion repeats the idempotency check above it. Substituting a line that is in the snippet would make it bite.

The substituted text was not in the snippet, so the fixture equalled the synced file and the check repeated the idempotency test. Use a line from the snippet and fail if the fixture is unchanged.

Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: ClaudeCode:claude-opus-5-5
@juliusknorr

Copy link
Copy Markdown
Member Author

Good catch, thanks. The test now replaces a line that is really in the snippet, and a guard fails if the fixture doesn't change. I checked that it fails with the replace logic broken (bcbf9b3).

@juliusknorr
juliusknorr requested a review from moodyjmz December 1, 2026 21:57

@moodyjmz moodyjmz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. The fixture now replaces a line that is in the snippet, and the new guard fails if it doesn't change.

@juliusknorr
juliusknorr merged commit 252ff21 into main Dec 3, 2026
3 checks passed
@juliusknorr
juliusknorr deleted the feat/sync-agents-md branch December 3, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request organizational

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants