Skip to content

History bots publish to the generated branch, not main (Part of #4847) - #4962

Merged
squid-protocol merged 1 commit into
mainfrom
churn/4847-history-bots-generated
Oct 12, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/4847-history-bots-generated

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4847.

What

The four *-history workflows and archetype-validation opened an auto-merged PR into main per run (about 40 of 322 main commits in 7 days, each queueing open PRs behind it). They now publish to the generated branch, as evidence-pages.yml does (#4827).

  • tests/tools/generated_branch.py: publish (scratch index + commit-tree + push <sha>:refs/heads/generated; checkout and HEAD untouched; no commit when nothing differs; retried on a lost race, writers own disjoint paths), fetch (restore a path from generated, no-op when absent), show (published copy, else committed copy: the reader fallback).
  • Each of the 5 workflows: the create-pull-request and gh pr merge steps, the loop guard and pull-requests: write are gone; a publish step runs only when github.ref == refs/heads/main (a dispatch elsewhere writes nothing, as evidence-pages.yml writes the generated branch on a workflow_dispatch from any ref (add a main-only guard) #4925). Appended CSVs (call_resolution_history, tree_sitter_accuracy_history, graph_coverage_history) and the archetype record are restored from generated first, otherwise each run would append to main's frozen copy. The four history workflows gained workflow_dispatch.
  • tree-sitter: the bot no longer rewrites the language_standards/__init__.py docstring table (the PR-time audit already enforces it, --summary-table); the blurbs go to the step summary.
  • Readers: README, docs/validation.md, graph_accuracy.md, graph_comparison_README, java.md link to generated (raw URL for the charts); skills and READMEs updated; small separate section in docs/ci.md.

The files already committed on main

Left untouched: frozen at the last bot PR. They are the seed and the fallback (nothing breaks if generated lacks a file). Ledgers keep their verdicts on main (people edit them there); the bot refreshes counts from main's copy and publishes the result, so unvalidated shapes newly seen by the bot appear on generated only until a sweep regenerates the ledger locally.

Trade-off to decide

archetype_validation.json is shipped inside the package (analysis_lens.py loads it at import). Its refreshed copy now lives on generated; the packaged copy only changes when someone re-runs archetype_drift.py measure --write-record and commits it (e.g. at release). No label depends on it.

Verification

Workflow changes cannot run locally. Verified instead: all 5 parse as YAML; tests/tools/test_generated_branch.py (14 tests): publish/fetch/show/race-free disjoint writers/no-op/missing-file against a local bare remote; per-workflow lint (no PR, no gh pr merge, no PAT, publishes the listed files, pull-requests: write absent, fetch precedes --history); and a lint that only the listed workflows still commit to main. pr_gates --fast 5/5, --ratchets 7 pass 0 fail 0 skipped. Not done: a live run.

After merge

Dispatch each of the 5 workflows once from main to seed generated (README chart embeds are broken until tri_comparison_chart.svg and graph_coverage_chart.svg exist there).

Class: workflows that commit bot output to main

Moved here: call-resolution-history, graph-comparison-history, tree-sitter-accuracy-history, tri-comparison-history, archetype-validation. Not moved (listed in the lint): gitgalaxy.yml (architecture brief, read from checkout by agents), mainframe-ground-truth.yml (ground_truth_history.jsonl; #4935 in flight, not edited), evidence-refresh.yml (evidence records: approval inputs, must be on main; evidence_report), release-crucible-archive.yml (PR into language-crucible, not this repo). publish.yml / mirror-tag-sync.yml push to other remotes only.

Cross-repo: none.

🤖 Generated with Claude Code

call-resolution, graph-comparison, tree-sitter-accuracy, tri-comparison history and archetype-validation
opened an auto-merged PR into main per run. They now publish their output to `generated` through
tests/tools/generated_branch.py (plumbing push, retried on a lost race; main only). Appended CSVs are restored
from generated first; readers (README/docs chart embeds, skills) point at generated.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 12, 2026 08:08
@squid-protocol
squid-protocol enabled auto-merge (squash) October 12, 2026 08:08
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

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

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant