Clean up OPERATIONS.md #66
Labels
No labels
blocked
bug
duplicate
effort
high
effort
low
effort
medium
effort
minimal
enhancement
help wanted
invalid
pr
feedback
pr
reviewing
question
status
backlog
status
document
status
done
status
implement
status
pending
status
planning
status
reviewing
waiting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tepichord/milner#66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Naina:
Overview
OPERATIONS.md is 3,071 lines / 13 sections, and two of those sections are the same bring-up order (§8 and §13).12 Split it by operational domain into
docs/, keep OPERATIONS.md as the index + the one bring-up order, and delete the duplicated §13. The§Ncross-reference scheme is already broken in the tree (§7h, §8=storage, teardown=§9)345, so the split is also a correctness fix: every reference moves todocs/<domain>.md §Nand a new pytest guard makes a wrong pointer fail CI.Technical Approach
Create
docs/and move section blocks verbatim — no prose rewrite in this change.6789docs/tailscale.mddocs/vault.mddocs/pocket-id.mddocs/headlamp.mddocs/woodpecker-ci.mddocs/storage.mddocs/durable-volumes.mddocs/preview-environment.mddocs/logging.mddocs/history.mdKeep global
§Nnumbers stable (decision (a) in Research Findings). A moved section keeps its number; only the file qualifier changes, so no renumbering can silently repoint a reference.Collapse the duplicate bring-up orders — delete §13, keep §8, which already carries the correct
§10bpointer (§13 carries the stale§8b).1011Fix the stale pointers the split would otherwise multiply (verified, not exhaustive):121314151617
cloudflare/README.md:160,.env.example:105,121,ARCHITECTURE.md:232,314,OPERATIONS.md:25§7h§9hworker/README.md:94,ARCHITECTURE.md:325§8(storage)§10worker/README.md:114,README.md:246,311,371,gitops/.../local-path/values.yaml:43§9(teardown)§11cREADME.md:344§11h§11d.env.example:94§7§9aPLAN.md:34§5§4hOPERATIONS.md:706§8c§10cRetarget the four documentation guards to the runbook file set.18192021
test_runbook_carries_no_volatile_identity_literalsand the fenced-code half oftest_runbook_keeps_its_tokens_out_of_argvparametrize overRUNBOOKS. The "exactly onev()/vk()definition" assertion becomes set-wide (a second definition still silently wins).22 Thevkcall-site window is reworked to "a|/printfproducer in the preceding two lines" — the current definition-to-body window is same-file and breaks oncevklives indocs/vault.mdwhile call sites live indocs/pocket-id.md/docs/woodpecker-ci.md.2324test_drill_ladder_points_at_the_harnessreadsdocs/durable-volumes.mdand### 11d..2526Add the missing cross-reference guard — this is what turns the manual audit into a failing test:
Update the in-repo map —
AGENTS.mdrepo-map rows (OPERATIONS.md, newdocs/row),README.md,ARCHITECTURE.md,.env.example,gitops/install.sh,drills/check.sh, and the gitops manifests that cite section numbers.Implementation Details
docs/{tailscale,vault,pocket-id,headlamp,woodpecker-ci,storage,durable-volumes,preview-environment,logging,history}.mdOPERATIONS.md,AGENTS.md,ARCHITECTURE.md,README.md,PLAN.md,USER_STORIES.md,.env.example,tests/test_docs.py,tests/test_static.py,drills/check.sh,worker/README.md,data/README.md,cloudflare/README.md,cloudflare/terraform.tfvars.example,gitops/install.sh,gitops/clusters/milner/**(manifest comments referencingOPERATIONS.md §N)v()/vk()definition in the whole runbook set.docs/<domain>.md §N; Forgejo's auto-slugs are not GitHub's, so do not author#anchorlinks relying on heading text.28git ls-files, so an untracked new doc changes test behaviour.27docs/durable-volumes.md(still operationally relevant); only §11f/§11g move.docs/history.mdis the interim home and an ADR migration is a follow-up.§1 What lives wherestays in OPERATIONS.md rather than moving beside AGENTS.md's repo map.Acceptance Criteria
docs/*.mdfile and appears nowhere else (no §13 duplicate).§Nreference in the repo resolves to a heading in the file it names; the 7 stale-pointer rows above are corrected.v()/vk()definition acrossRUNBOOKS.python3 -m pytest tests/ -vis green.Testing Plan
docs/foo.md §9zfails; the current tree's stale pointers fail before the fix and pass after.docs/vault.mdand confirmtest_runbook_carries_no_volatile_identity_literalsfails with that filename.vkcall with no|/printfproducer in any runbook file fails, including when the call and the definition are in different files.wc -l OPERATIONS.md docs/*.md— no file approaches the original 3,071 lines;grep -rn 'OPERATIONS\.md §' --include='*.md' --include='*.yaml' --include='*.sh' .returns no references to moved sections.Related Issues
tests/test_docs.py,tests/test_static.py— the guards that constrain the split.Research Findings
§Nnumbers across files; every mature system adds explicit IDs or link checking. Here the check is a pytest guard overgit ls-files '*.md'. (myst-parser docs, clausul.com)WithAutoHeadingID,WithAttribute) and its slugs are not guaranteed to match GitHub's, so explicit file-qualified references beat#anchorlinks. (gitea issue #17262)Pre-Mortem
OPERATIONS.md §N, so a reference written in a form the new guard's regex or file scan does not cover silently survives, and agents follow a pointer that names both the wrong file and the wrong section. The plan's headline correctness fix then becomes a net regression rather than a cleanup.RUNBOOKSand converting thevkdefinition-to-body window into a preceding-two-lines check is the subtlest part of the change, and an empty glob or mis-scoped window makes the guard vacuous. A later regression (a secondv()/vk()definition, or a token passed on argv) then ships green, while an over-strict variant fails CI on unrelated files and pressures a rushed partial revert.docs/durable-volumes.mdanddocs/preview-environment.md, and deleting §13 assumes §8 is a strict superset, so a boundary drawn wrong drops content or duplicates it under a new filename with no test able to detect it. Because prose rewrites are explicitly out of scope, the loss would only surface much later during a real runbook procedure.