Uh oh!
There was an error while loading. Please reload this page.
feat(standards): org-wide engineering standards — canon + sync guard (backend#1602) - #170
Conversation
…1602) One canonical org-standards.md — the org's working rules — stamped into every active repo's CLAUDE.md between org-standards markers, so every Claude Code session in every repo loads the same rules. standards-sync.py audits the fleet develop-first (weekly report-only; a create-prs dispatch opens per-repo sync PRs against develop), with caller-drift's design rules: never all-clear from a failed read, absence never implicit (devex-bootstrap exempt with written reason), malformed markers reported and never auto-spliced. Offline selftest: 19 checks over the splice logic and every fail-closed path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
LukasWodka
commented
Aug 6, 2026
Drive-by diagnosis on the Root cause: PyYAML isn't importable in the runner. The job runs Precedent + fix: backend#1531's The more interesting finding — three of your assertions are currently vacuous. These pass: …but read the interleaved stderr: in this environment the script is exiting 2 because PyYAML is missing, not because the canon was empty / had a nested marker / was unreadable. The assertion is That's the same class as the Not my PR and I haven't touched it — flagging only because the false-green would survive the dependency fix and then look permanently healthy. |
…existence (backend#1602) Both from Bugbot on .github#170. The selftest's good-path load_targets check parses YAML, and a clean setup-python has no PyYAML — the job died at the final check (mirrors caller-drift's selftest job now). And resolve_branch now uses the exact-match git/ref/heads/develop lookup, the same endpoint remediate() trusts for the base sha. Verified live: backend resolves develop, release-train falls back to main. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LukasWodka
commented
Aug 6, 2026
Note for review: the red pii-gate / pii-check is not from this diff — the gate fails closed because the org |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 647f43e. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
…drift) (backend#1602) Bugbot on .github#170: Python exits 1 on an unhandled traceback, and 1 is reserved for confirmed drift — so a malformed API payload or filesystem error produced a drift report instead of the unknown-state failure. The entry point now maps any crash to exit 2 with an ::error:: line. Pinned by a selftest that runs the guard with gh stripped from PATH. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.

Summary
Item 1 of tracebloc/backend#1602 (content approved by Lukas 2026-08-06): one canonical
org-standards.md— the org's ~50-line working rules — plus the guard that keeps every active repo'sCLAUDE.mdcarrying it verbatim, so every Claude Code session in every repo loads the same rules.org-standards.md— the canon: branches & PRs (develop-only, small single-purpose PRs, no stacked PRs, sync before starting, reviewer requested at open), quality bar (run affected tests before push / never push red, read the full diff, evidence not assertion, same-day Bugbot triage, recurring findings become BUGBOT.md/house-rules entries), kanban (team-coordinated pickup — the old "never from Backlog" rule is retired), releases (the train owns staging/main and every registry), filing rules, AI-session guardrails. Drafted from the train's actual behaviour, RFC-1405, epic #1405's adopted process rules, and external research (Google eng-practices, DORA, trunk-based development, Anthropic/Cursor guidance). Header meta-rule: the moment a rule becomes mechanically enforced, its sentence gets deleted here — prose is only for what tooling can't judge.scripts/standards-sync.py— caller-drift's design rules applied to CLAUDE.md blocks: develop-first reads; never all-clear from a failed read (one unreadable repo → exit 2); absence never implicit (every repo-inventory.yml repo is a target or a written exemption — sole exemption today:devex-bootstrap, backend#1597 item 3); malformed/duplicated markers are reported and never auto-spliced.scripts/tests/standards-sync-selftest.py— offline, no network, no token: 19 checks over the splice logic (repo-owned prose preserved byte-for-byte around the block, idempotence, MALFORMED never spliced) and every fail-closed path..github/workflows/standards-sync.yml— selftest on PRs touching these four files; audit on schedule (Mondays 07:00 UTC, after caller-drift) andworkflow_dispatch. Report-only by default; dispatching withcreate-prs: trueopens/refreshes onedocs/1602-org-standards-syncPR per drifted repo against its develop. Drift reports comment on backend#1602; never an all-clear comment.The audit deliberately does not run on PRs: the canon is read from the checkout, so a PR editing it would see the whole fleet as legitimately behind and go red by construction (the same checkout-vs-API awkwardness caller-drift documents; here it is resolved by scoping the trigger instead).
Type
Feature (process/CI).
Test plan
selftestjob on this PRpython -m py_compileon both scriptsactionlintlocally on the new workflow (SC2016 markdown-in-printf silenced with the same disable comment caller-drift.yml uses)MISSING_BLOCK(CLAUDE.md exists, no managed block yet), 5×NO_FILE(.github,cli,e2e-test-agent,release-train,rfcs), and the develop-first fallback correctly readmainfor the two repos without a develop branchPROJECTS_KANBAN_TOKENcarries Contents:RW + Pull requests:RW on the targets (else mint a fine-grainedSTANDARDS_SYNC_TOKEN); then dispatchcreate-prs: trueand review the ~19 sync PRsRollout
Wave 1 stamps the block fleet-wide (create-prs dispatch, one reviewable PR per repo). Wave 2 — separate per-repo PRs with named individual owners — fills repo-specific CLAUDE.md content and retires the two live contradictions (client's stale assignee rule, model-zoo's
masterline). Tracking: tracebloc/backend#1602.🤖 Generated with Claude Code
Note
Medium Risk
New automation can push branches and open PRs across many repos when dispatched with write-capable tokens; logic is fail-closed and offline-tested, but mistaken remediation or token scope still has org-wide blast radius.
Overview
Introduces
org-standards.mdas the single source of org engineering rules (branches/PRs, quality bar, kanban, releases, filing, AI session limits) meant to live inside each repo'sCLAUDE.mdbetween<!-- org-standards:begin/end -->markers.Adds
scripts/standards-sync.pyandstandards-sync-selftest.py: develop-first reads fromrepo-inventory.yml, classify drift without treating failed reads as “no file,” refuse to auto-splice malformed markers, and optionally opendocs/1602-org-standards-syncPRs per repo.standards-sync.ymlruns the offline selftest on PR/push to the four touched files; the live audit runs on schedule andworkflow_dispatchonly (not on PRs, so canon edits do not fail the whole fleet by design), posts drift to backend#1602 when not clean, and can remediate viacreate-prs: true.Reviewed by Cursor Bugbot for commit a1d6f4c. Bugbot is set up for automated code reviews on this repo. Configure here.