coentrify 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +2 -1
  3. package/bin/coentrify.js +79 -12
  4. package/package.json +3 -2
  5. package/src/changelog/0.0.1.md +259 -0
  6. package/src/changelog/0.0.2.md +219 -0
  7. package/src/changelog/0.0.3.md +81 -0
  8. package/src/changelog/0.0.4.md +198 -0
  9. package/src/changelog/0.0.5.md +160 -0
  10. package/src/changelog/0.0.6.md +282 -0
  11. package/src/changelog/0.0.7.md +113 -0
  12. package/src/changelog/0.0.8.md +212 -0
  13. package/src/changelog/0.1.0.md +9 -0
  14. package/src/changelog/overview.md +13 -0
  15. package/src/coentrify-json.md +72 -0
  16. package/src/commands.md +48 -0
  17. package/src/glossary.md +132 -0
  18. package/src/how-it-works.md +51 -0
  19. package/src/onboarding.md +140 -0
  20. package/src/origin.md +19 -0
  21. package/src/philosophy.md +99 -0
  22. package/src/proof.md +596 -0
  23. package/src/readme.md +76 -0
  24. package/src/recommendations.md +100 -0
  25. package/src/standards/ai/match-known-commands-deterministically-classify-the-rest.md +22 -0
  26. package/src/standards/ai/overview.md +6 -0
  27. package/src/standards/ai/prompt-small-models-differently.md +21 -0
  28. package/src/standards/angular/canmatch-wildcard-for-route-access.md +22 -0
  29. package/src/standards/angular/interface-not-abstract-class-for-mock-swap.md +37 -0
  30. package/src/standards/angular/no-any-in-templates.md +25 -0
  31. package/src/standards/angular/no-inline-templates.md +14 -0
  32. package/src/standards/angular/one-component-per-folder-flat.md +12 -0
  33. package/src/standards/angular/one-projected-node-per-control-flow-block.md +19 -0
  34. package/src/standards/angular/overview.md +16 -0
  35. package/src/standards/angular/prefer-content-projection-over-props-angular.md +17 -0
  36. package/src/standards/angular/projected-content-is-never-styled-by-the-host.md +23 -0
  37. package/src/standards/angular/static-attribute-not-literal-binding.md +23 -0
  38. package/src/standards/angular/track-timed-items-by-an-id.md +17 -0
  39. package/src/standards/angular/ui-copy-in-template.md +26 -0
  40. package/src/standards/angular/use-modern-angular-template-apis.md +20 -0
  41. package/src/standards/architecture/adopt-configure-override.md +25 -0
  42. package/src/standards/architecture/app-shield.md +57 -0
  43. package/src/standards/architecture/converge-only-once-proven.md +22 -0
  44. package/src/standards/architecture/folder-concerns.md +28 -0
  45. package/src/standards/architecture/overview.md +11 -0
  46. package/src/standards/architecture/per-application-split-over-shared-branching.md +25 -0
  47. package/src/standards/architecture/separation-before-layer-standards.md +17 -0
  48. package/src/standards/architecture/unique-where-it-counts.md +19 -0
  49. package/src/standards/behavior/a-go-before-work-elsewhere.md +17 -0
  50. package/src/standards/behavior/a-maybe-is-a-trigger-to-investigate.md +20 -0
  51. package/src/standards/behavior/a-name-describes-its-unit.md +19 -0
  52. package/src/standards/behavior/a-quiet-tree-while-a-suite-runs.md +19 -0
  53. package/src/standards/behavior/always-make-no-mistakes.md +45 -0
  54. package/src/standards/behavior/always-verify-before-reporting-done.md +18 -0
  55. package/src/standards/behavior/always-work-from-a-plan.md +29 -0
  56. package/src/standards/behavior/anchor-edits-after-formatting.md +17 -0
  57. package/src/standards/behavior/backward-trace-missing-prerequisites.md +20 -0
  58. package/src/standards/behavior/code-review-compounds-into-patterns-and-sweeps.md +21 -0
  59. package/src/standards/behavior/communication-boundary.md +18 -0
  60. package/src/standards/behavior/dev-tiers.md +25 -0
  61. package/src/standards/behavior/docs-hold-only-what-the-director-decided.md +23 -0
  62. package/src/standards/behavior/dont-filter-data-without-a-spec.md +20 -0
  63. package/src/standards/behavior/dont-introduce-tech-debt.md +25 -0
  64. package/src/standards/behavior/feature-workflow.md +31 -0
  65. package/src/standards/behavior/file-a-change-with-coentrify.md +24 -0
  66. package/src/standards/behavior/flag-every-addition-of-your-own.md +22 -0
  67. package/src/standards/behavior/free-text-replies-no-buttons.md +20 -0
  68. package/src/standards/behavior/general-working-rules.md +37 -0
  69. package/src/standards/behavior/non-destructive-documenting-and-test-automation.md +20 -0
  70. package/src/standards/behavior/normal-dashes.md +15 -0
  71. package/src/standards/behavior/note-issues.md +26 -0
  72. package/src/standards/behavior/overview.md +46 -0
  73. package/src/standards/behavior/own-ports-own-processes.md +37 -0
  74. package/src/standards/behavior/project-lifecycle.md +21 -0
  75. package/src/standards/behavior/propagate-renames-and-convention-changes-everywhere.md +16 -0
  76. package/src/standards/behavior/prose-style.md +24 -0
  77. package/src/standards/behavior/prototype-mode-is-speed-first.md +20 -0
  78. package/src/standards/behavior/regular-layered-gap-analysis.md +20 -0
  79. package/src/standards/behavior/reload-the-standards-after-compacting.md +16 -0
  80. package/src/standards/behavior/review-changes-before-reporting-done.md +17 -0
  81. package/src/standards/behavior/review-every-capture-before-reporting.md +21 -0
  82. package/src/standards/behavior/standards-maintenance.md +65 -0
  83. package/src/standards/behavior/standards-over-skills.md +17 -0
  84. package/src/standards/behavior/sweeps-enumerate-into-tech-debt-first.md +20 -0
  85. package/src/standards/behavior/sync-the-docs-after-every-change.md +20 -0
  86. package/src/standards/behavior/the-quality-of-the-question.md +17 -0
  87. package/src/standards/behavior/things-of-one-kind-are-consistent.md +20 -0
  88. package/src/standards/behavior/understand-the-need.md +69 -0
  89. package/src/standards/behavior/use-us-english-everywhere.md +17 -0
  90. package/src/standards/behavior/verify-apis-against-docs-and-the-installed-artifact.md +17 -0
  91. package/src/standards/behavior/verify-control-before-rename.md +11 -0
  92. package/src/standards/code/code-principles.md +32 -0
  93. package/src/standards/code/escape-hatch-comments.md +20 -0
  94. package/src/standards/code/name-by-concept-not-copy.md +20 -0
  95. package/src/standards/code/no-abbreviated-names.md +20 -0
  96. package/src/standards/code/no-describe-what-comments.md +26 -0
  97. package/src/standards/code/overview.md +10 -0
  98. package/src/standards/code/pre-empt-recurring-code-review-nits.md +31 -0
  99. package/src/standards/commits/commits.md +44 -0
  100. package/src/standards/commits/gate-commits-on-exit-codes.md +22 -0
  101. package/src/standards/commits/main-stays-green-work-stays-clean.md +23 -0
  102. package/src/standards/commits/overview.md +8 -0
  103. package/src/standards/commits/verify-staging-before-committing.md +29 -0
  104. package/src/standards/docs/application-template.md +89 -0
  105. package/src/standards/docs/docs-are-hierarchical-explicit-and-short.md +48 -0
  106. package/src/standards/docs/docs-describe-behavior-not-wiring.md +24 -0
  107. package/src/standards/docs/docs-folder-structure.md +38 -0
  108. package/src/standards/docs/docs-state-knowledge.md +23 -0
  109. package/src/standards/docs/documentation-philosophy.md +62 -0
  110. package/src/standards/docs/feature-spec-template.md +89 -0
  111. package/src/standards/docs/feature-template.md +62 -0
  112. package/src/standards/docs/file-names.md +20 -0
  113. package/src/standards/docs/glossary.md +18 -0
  114. package/src/standards/docs/library-feedback.md +20 -0
  115. package/src/standards/docs/no-faux-headers-in-lists.md +18 -0
  116. package/src/standards/docs/overview.md +20 -0
  117. package/src/standards/docs/ui-vocabulary.md +31 -0
  118. package/src/standards/docs/workspace-levels.md +24 -0
  119. package/src/standards/docs/workspace-suite.md +24 -0
  120. package/src/standards/docs/workspace-template.md +41 -0
  121. package/src/standards/e2e/e2e-assert-before-interacting.md +21 -0
  122. package/src/standards/e2e/e2e-mock-contract.md +20 -0
  123. package/src/standards/e2e/e2e-runs-on-the-development-build.md +18 -0
  124. package/src/standards/e2e/e2e-test-conventions.md +61 -0
  125. package/src/standards/e2e/e2e-tests-must-demonstrate-behavior.md +28 -0
  126. package/src/standards/e2e/one-check-for-many-canvas-clicks.md +17 -0
  127. package/src/standards/e2e/overview.md +14 -0
  128. package/src/standards/e2e/per-feature-overview-test.md +30 -0
  129. package/src/standards/e2e/real-input-for-frame-races.md +25 -0
  130. package/src/standards/e2e/substring-locator-collisions.md +23 -0
  131. package/src/standards/e2e/use-the-e2e-pipeline-for-browser-probing.md +18 -0
  132. package/src/standards/electron/electron-packaging-and-suite.md +22 -0
  133. package/src/standards/electron/electron-shell-shape.md +21 -0
  134. package/src/standards/electron/overview.md +6 -0
  135. package/src/standards/gamedev/2d-visual-design.md +22 -0
  136. package/src/standards/gamedev/budget-exceptions.json +6 -0
  137. package/src/standards/gamedev/captures-and-reels.md +39 -0
  138. package/src/standards/gamedev/devbox.md +21 -0
  139. package/src/standards/gamedev/game-design-laws-experience.md +68 -0
  140. package/src/standards/gamedev/game-design-laws-guidance.md +43 -0
  141. package/src/standards/gamedev/game-design-laws-own-style.md +33 -0
  142. package/src/standards/gamedev/game-design-laws-progress.md +54 -0
  143. package/src/standards/gamedev/game-design-laws-quality.md +30 -0
  144. package/src/standards/gamedev/game-design-laws-story.md +45 -0
  145. package/src/standards/gamedev/game-design-laws-ui.md +52 -0
  146. package/src/standards/gamedev/game-design-laws-world.md +38 -0
  147. package/src/standards/gamedev/game-design-laws.md +112 -0
  148. package/src/standards/gamedev/game-phases-concept.md +29 -0
  149. package/src/standards/gamedev/game-phases-design.md +39 -0
  150. package/src/standards/gamedev/game-phases-development.md +30 -0
  151. package/src/standards/gamedev/game-phases-live.md +19 -0
  152. package/src/standards/gamedev/game-phases.md +52 -0
  153. package/src/standards/gamedev/game-work-workflow.md +47 -0
  154. package/src/standards/gamedev/gamedev-working-cadence.md +52 -0
  155. package/src/standards/gamedev/incremental-pacing.md +22 -0
  156. package/src/standards/gamedev/launch-strategy.md +50 -0
  157. package/src/standards/gamedev/measure-sound-never-guess.md +24 -0
  158. package/src/standards/gamedev/overview.md +29 -0
  159. package/src/standards/gamedev/own-icons.md +19 -0
  160. package/src/standards/gamedev/silent-runs.md +26 -0
  161. package/src/standards/gamedev/sprite-sheet-frames.md +23 -0
  162. package/src/standards/overview.md +43 -0
  163. package/src/standards/records/activity-log.md +33 -0
  164. package/src/standards/records/changelog-per-version.md +43 -0
  165. package/src/standards/records/healing-log.md +23 -0
  166. package/src/standards/records/overview.md +10 -0
  167. package/src/standards/records/playtest-files.md +38 -0
  168. package/src/standards/records/request-log.md +30 -0
  169. package/src/standards/records/user-test-files.md +21 -0
  170. package/src/standards/reporting/change-report.md +43 -0
  171. package/src/standards/reporting/overview.md +6 -0
  172. package/src/standards/reporting/reels-and-video-proof.md +32 -0
  173. package/src/standards/scripts/no-npx-in-scripts.md +20 -0
  174. package/src/standards/scripts/npm-script-naming.md +43 -0
  175. package/src/standards/scripts/overview.md +7 -0
  176. package/src/standards/scripts/thin-wrappers-in-ci-and-hooks.md +25 -0
  177. package/src/standards/security/keep-personal-data-out-of-requests.md +16 -0
  178. package/src/standards/security/keep-secrets-away-from-agents.md +21 -0
  179. package/src/standards/security/never-access-the-keychain.md +16 -0
  180. package/src/standards/security/overview.md +7 -0
  181. package/src/standards/simple-workflow/bugs-template.md +38 -0
  182. package/src/standards/simple-workflow/overview.md +12 -0
  183. package/src/standards/simple-workflow/plan-template.md +50 -0
  184. package/src/standards/simple-workflow/plans-vs-persistent-files.md +31 -0
  185. package/src/standards/simple-workflow/remove-completed-items-from-docs.md +19 -0
  186. package/src/standards/simple-workflow/roadmap-template.md +41 -0
  187. package/src/standards/simple-workflow/technical-debt-template.md +44 -0
  188. package/src/standards/simple-workflow/the-simple-workflow.md +48 -0
  189. package/src/standards/simple-workflow/todo-template.md +31 -0
  190. package/src/standards/tests/a-bugs-test-reproduces-with-real-input.md +18 -0
  191. package/src/standards/tests/bracket-state-changes-with-contrast-assertions.md +37 -0
  192. package/src/standards/tests/gestures-in-tests.md +35 -0
  193. package/src/standards/tests/implementation-agnostic-assertions.md +20 -0
  194. package/src/standards/tests/implementation-agnostic-locators.md +18 -0
  195. package/src/standards/tests/overview.md +13 -0
  196. package/src/standards/tests/realistic-test-data-variance.md +24 -0
  197. package/src/standards/tests/seed-surfaces-every-state-on-page-1.md +17 -0
  198. package/src/standards/tests/test-design.md +47 -0
  199. package/src/standards/tests/test-the-system-behind-a-mock.md +21 -0
  200. package/src/standards/tickets-workflow/agent-roles.md +54 -0
  201. package/src/standards/tickets-workflow/budget-exceptions.json +6 -0
  202. package/src/standards/tickets-workflow/building-a-ticket.md +47 -0
  203. package/src/standards/tickets-workflow/overview.md +15 -0
  204. package/src/standards/tickets-workflow/stabilize-before-adding.md +18 -0
  205. package/src/standards/tickets-workflow/the-builder.md +28 -0
  206. package/src/standards/tickets-workflow/the-conductor.md +44 -0
  207. package/src/standards/tickets-workflow/the-done-part.md +23 -0
  208. package/src/standards/tickets-workflow/ticket-template.md +96 -0
  209. package/src/standards/tickets-workflow/work-item-names.md +30 -0
  210. package/src/standards/tickets-workflow/work-tracking.md +177 -0
  211. package/src/standards/tickets-workflow/work-workflow.md +123 -0
  212. package/src/standards/tickets-workflow/writing-a-ticket.md +50 -0
  213. package/src/standards/tooling/browser-captures-go-to-disk.md +20 -0
  214. package/src/standards/tooling/check-where-a-pane-click-landed.md +19 -0
  215. package/src/standards/tooling/defer-tooling-until-the-cost-shows-up.md +19 -0
  216. package/src/standards/tooling/develop-against-mocks.md +19 -0
  217. package/src/standards/tooling/hygiene-tests-run-on-their-own-runner.md +18 -0
  218. package/src/standards/tooling/lightweight-test-reporting-only.md +16 -0
  219. package/src/standards/tooling/node-versions.md +24 -0
  220. package/src/standards/tooling/overview.md +17 -0
  221. package/src/standards/tooling/parallel-agents.md +45 -0
  222. package/src/standards/tooling/playwright-parallel-runs.md +30 -0
  223. package/src/standards/tooling/playwright-video-recording.md +32 -0
  224. package/src/standards/tooling/read-before-you-truncate.md +19 -0
  225. package/src/standards/tooling/start-playwright-on-a-clean-port.md +22 -0
  226. package/src/standards/tooling/vitepress-wiki.md +38 -0
  227. package/src/standards/typescript/always-add-explicit-types.md +32 -0
  228. package/src/standards/typescript/barrel-imports.md +21 -0
  229. package/src/standards/typescript/no-magic-values.md +52 -0
  230. package/src/standards/typescript/one-artifact-per-file.md +19 -0
  231. package/src/standards/typescript/overview.md +8 -0
  232. package/src/standards/ui/communicate-state.md +21 -0
  233. package/src/standards/ui/never-obscure-information-the-user-needs.md +26 -0
  234. package/src/standards/ui/overview.md +16 -0
  235. package/src/standards/ui/pixel-perfect-design-check.md +22 -0
  236. package/src/standards/ui/ui-component-design.md +34 -0
  237. package/src/standards/ui/ui-components-first.md +25 -0
  238. package/src/standards/ui/ui-layout-via-slot-composition.md +33 -0
  239. package/src/standards/ui/ui-library-is-domain-agnostic.md +20 -0
  240. package/src/standards/ui/ui-refactor-preserve-dont-redesign.md +25 -0
  241. package/src/standards/ui/ui-styleguide.md +30 -0
  242. package/src/standards/ui/ui-variants-by-function-not-by-color.md +23 -0
  243. package/src/standards/ui/validation-errors-fire-on-submit.md +20 -0
  244. package/src/standards/ui/walk-the-users-journey.md +29 -0
  245. package/src/standards/web/always-use-design-tokens-for-colors.md +24 -0
  246. package/src/standards/web/dark-mode-through-tokens.md +19 -0
  247. package/src/standards/web/hidden-attribute-loses-to-display.md +22 -0
  248. package/src/standards/web/overview.md +9 -0
  249. package/src/standards/web/scss-shared-partial-imports.md +16 -0
  250. package/src/standards/web/transitions-only-on-user-toggle.md +19 -0
  251. package/src/standards.md +66 -0
  252. package/src/tools/overview.md +22 -0
  253. package/src/tools/scripts/coentrify-update.py +242 -0
  254. package/src/tools/scripts/unlink-missing-standards.py +138 -0
  255. package/src/tools/specs/changelog-append.md +15 -0
  256. package/src/tools/specs/coentrify-json-check.md +21 -0
  257. package/src/tools/specs/commit-gate.md +32 -0
  258. package/src/tools/specs/healing-append.md +15 -0
  259. package/src/tools/specs/landing.md +29 -0
  260. package/src/tools/specs/refuse-wrap-up-questions.md +22 -0
  261. package/src/tools/specs/reload-core-rules.md +20 -0
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env python3
2
+ """Removes every link to a standard the project did not adopt, and keeps the words.
3
+
4
+ usage: unlink-missing-standards.py [folder]
5
+
6
+ Run from the root of the project, after the setup and after every update. The
7
+ folder defaults to standards. A link is removed when it points at a markdown
8
+ file that is not on disk.
9
+
10
+ - A list item that holds only such a link is removed whole, as in a Related list.
11
+ - In an overview, a list item that opens with such a link is removed whole.
12
+ - A pair of brackets that holds only such links is removed whole.
13
+ - Every other such link becomes its own words.
14
+ - A Related section that ends up empty is removed.
15
+ - Code is left alone.
16
+ """
17
+ import re
18
+ import sys
19
+ from pathlib import Path
20
+
21
+ DEFAULT_FOLDER = "standards"
22
+ MARKDOWN_EXTENSION = ".md"
23
+ FENCE = "```"
24
+ RELATED_HEADING = "## Related"
25
+ HEADING = re.compile(r"^#{1,6} ")
26
+ ONE_LINK = r"\[[^\]]+\]\([^)\s]+\)"
27
+ LINK = re.compile(r"\[([^\]]+)\]\(([^)\s]+)\)")
28
+ LINK_ONLY_ITEM = re.compile(rf"^\s*[-*] {ONE_LINK}\s*$")
29
+ LEADING_LINK_ITEM = re.compile(rf"^\s*[-*] {ONE_LINK}")
30
+ INDEX_PAGE = "overview.md"
31
+ LINK_ONLY_BRACKETS = re.compile(rf" ?\(({ONE_LINK}(?:(?:, | and ){ONE_LINK})*)\)")
32
+ CODE_SPAN = re.compile(r"(`+).+?\1")
33
+ PLACEHOLDER = "\x00{}\x00"
34
+ PLACEHOLDER_PATTERN = re.compile(r"\x00(\d+)\x00")
35
+
36
+
37
+ def is_missing(target: str, page: Path) -> bool:
38
+ path = target.split("#", 1)[0]
39
+ if not path.endswith(MARKDOWN_EXTENSION) or "://" in path or path.startswith("/"):
40
+ return False
41
+ return not (page.parent / path).is_file()
42
+
43
+
44
+ def unlink_line(line: str, page: Path) -> tuple[str, int]:
45
+ """Returns the line without its missing links, and how many were removed."""
46
+ spans: list[str] = []
47
+
48
+ def hide(match: re.Match) -> str:
49
+ spans.append(match.group(0))
50
+ return PLACEHOLDER.format(len(spans) - 1)
51
+
52
+ removed = 0
53
+ text = CODE_SPAN.sub(hide, line)
54
+
55
+ def brackets(match: re.Match) -> str:
56
+ nonlocal removed
57
+ links = LINK.findall(match.group(1))
58
+ kept = [f"[{words}]({target})" for words, target in links if not is_missing(target, page)]
59
+ removed += len(links) - len(kept)
60
+ if len(kept) == len(links):
61
+ return match.group(0)
62
+ if not kept:
63
+ return ""
64
+ lead = " " if match.group(0).startswith(" ") else ""
65
+ return f"{lead}({', '.join(kept)})"
66
+
67
+ def words(match: re.Match) -> str:
68
+ nonlocal removed
69
+ if not is_missing(match.group(2), page):
70
+ return match.group(0)
71
+ removed += 1
72
+ return match.group(1)
73
+
74
+ text = LINK_ONLY_BRACKETS.sub(brackets, text)
75
+ text = LINK.sub(words, text)
76
+ return PLACEHOLDER_PATTERN.sub(lambda match: spans[int(match.group(1))], text), removed
77
+
78
+
79
+ def without_empty_related(lines: list[str]) -> list[str]:
80
+ for index, line in enumerate(lines):
81
+ if line.strip() != RELATED_HEADING:
82
+ continue
83
+ end = index + 1
84
+ while end < len(lines) and not HEADING.match(lines[end]):
85
+ end += 1
86
+ if any(text.strip() for text in lines[index + 1:end]):
87
+ continue
88
+ start = index
89
+ while start > 0 and not lines[start - 1].strip():
90
+ start -= 1
91
+ gap = [""] if end < len(lines) and start > 0 else []
92
+ return without_empty_related(lines[:start] + gap + lines[end:])
93
+ return lines
94
+
95
+
96
+ def unlink_page(page: Path) -> int:
97
+ lines = page.read_text().split("\n")
98
+ result: list[str] = []
99
+ removed = 0
100
+ in_code = False
101
+ for line in lines:
102
+ if line.lstrip().startswith(FENCE):
103
+ in_code = not in_code
104
+ if in_code or line.lstrip().startswith(FENCE):
105
+ result.append(line)
106
+ continue
107
+ pattern = LEADING_LINK_ITEM if page.name == INDEX_PAGE else LINK_ONLY_ITEM
108
+ if pattern.match(line):
109
+ target = LINK.search(line).group(2)
110
+ if is_missing(target, page):
111
+ removed += 1
112
+ continue
113
+ text, count = unlink_line(line, page)
114
+ removed += count
115
+ result.append(text)
116
+ if removed:
117
+ page.write_text("\n".join(without_empty_related(result)).rstrip("\n") + "\n")
118
+ return removed
119
+
120
+
121
+ def main() -> int:
122
+ folder = Path(sys.argv[1] if len(sys.argv) > 1 else DEFAULT_FOLDER)
123
+ if not folder.is_dir():
124
+ print(f"unlink: the folder {folder} does not exist", file=sys.stderr)
125
+ return 1
126
+ total = 0
127
+ pages = 0
128
+ for page in sorted(folder.rglob(f"*{MARKDOWN_EXTENSION}")):
129
+ removed = unlink_page(page)
130
+ if removed:
131
+ print(f"unlink: {page}: {removed}")
132
+ total += removed
133
+ pages += 1
134
+ print(f"unlink: {total} links removed in {pages} pages")
135
+ return 0
136
+
137
+
138
+ sys.exit(main())
@@ -0,0 +1,15 @@
1
+ # Changelog Append
2
+
3
+ A spec for the script that adds one line to a version's changelog in a project without tickets ([Changelog Per Version](../../standards/records/changelog-per-version.md)).
4
+
5
+ ## What It Does
6
+
7
+ - It appends one entry at the bottom of the page's one `## Changed` list.
8
+ - An entry is one bullet that ends in its time: ``- <what changed> `HH:MM` ``.
9
+ - It refuses a page with any section but Changed, an entry with a heading, more than one bullet, a bullet with a semicolon, and a bullet without its time.
10
+ - It refuses while a merge is in progress in the page's repository.
11
+
12
+ ## The Check
13
+
14
+ - One bullet with its time is appended at the bottom.
15
+ - Two bullets, a semicolon or a missing time refuses and changes nothing.
@@ -0,0 +1,21 @@
1
+ # Coentrify JSON Check
2
+
3
+ A spec for the check that keeps a project's `coentrify.json` true ([coentrify.json](../../coentrify-json.md)). It runs as a pre-commit step in the project.
4
+
5
+ ## What It Does
6
+
7
+ - It fails when the file does not parse, when a folder it names is missing, and when a standard it lists is not on disk.
8
+ - It fails on a state other than `tracked` or `customized`. A module's `source` key is no standard.
9
+ - It fails on a `healing` or `filing` other than `automatic` or `review`, and on `filing` without `contributor: true`.
10
+ - It fails on a library under `libraries` without a `source`, or with a `filing` other than `automatic` or `review`.
11
+ - As a pre-commit step it also refuses a commit that changes a tracked standard by hand. The commit passes once the state is `customized`, or when the commit changes the version, as an update does.
12
+
13
+ ## The Check
14
+
15
+ - A file that names its folders and lists standards on disk passes.
16
+ - A missing folder, a missing standard, a state of `draft` or a `healing` of `sometimes` fails.
17
+ - `filing` without `contributor: true` fails.
18
+ - A library with a `source` and a `filing` passes, and one without a `source` fails.
19
+ - A commit that edits a tracked standard by hand refuses, and passes once its state is `customized`.
20
+ - A module with a `source` of its own passes.
21
+ - A commit that edits tracked standards and changes the version passes.
@@ -0,0 +1,32 @@
1
+ # Commit Gate
2
+
3
+ A spec for a hook that refuses a commit an agent did not gate on its check ([Gate Commits On Exit Codes](../../standards/commits/gate-commits-on-exit-codes.md), [Verify Staging Before Committing](../../standards/commits/verify-staging-before-committing.md)).
4
+
5
+ ## Where It Runs
6
+
7
+ - Before every shell command an agent runs, where the agent's app supports such a hook.
8
+ - It reads the command and nothing else, and refuses it with a message that says what to do instead.
9
+
10
+ ## What It Does
11
+
12
+ - It refuses a `git commit` or a `git tag` that runs right after a `;`.
13
+ - It refuses one that follows a check piped into `grep`, `tail` or `head` anywhere before it in the command, since the pipe hides the check's exit code, saved in a variable or not.
14
+ - It refuses a `git commit` that follows a `git add` in the same command, since the staged list was not read in between.
15
+ - It ignores what is quoted, a heredoc body, a command substitution and a comment, so a message with a `;` in it passes.
16
+ - A `git tag` that only lists tags passes, piped onward or not, a listing option such as `--sort` or `--contains` included.
17
+
18
+ ## The Check
19
+
20
+ - `npm test && git commit -m x` passes.
21
+ - `npm test; git commit -m x` refuses.
22
+ - `npm test | tail -3 && git commit -m x` refuses.
23
+ - `npm test >check.log 2>&1; rc=$?; [ $rc -eq 0 ] && git commit -m x` passes.
24
+ - `npm test | tail -3; rc=$?; [ $rc -eq 0 ] && git commit -m x` refuses.
25
+ - `git add a && git commit -m x` refuses.
26
+ - `git commit -m "a; b"` passes.
27
+ - A commit message given in a heredoc that holds a `;` passes.
28
+ - `ls` passes.
29
+ - `ls; git tag -l` passes.
30
+ - `ls; git tag | sort` passes.
31
+ - `ls; git tag --sort=-v:refname` passes.
32
+ - `ls; git tag v1` refuses.
@@ -0,0 +1,15 @@
1
+ # Healing Append
2
+
3
+ A spec for the script that adds one entry to the healing log ([Healing Log](../../standards/records/healing-log.md)).
4
+
5
+ ## What It Does
6
+
7
+ - It takes the log, what went wrong, what changed, and the commit, which defaults to the current one.
8
+ - It appends one line: `- <date> - <what went wrong> - <what changed> - <commit>`, with today's date.
9
+ - It creates the log with its title when it does not exist.
10
+ - It refuses an empty part, a part that holds ` - `, which would break the shape, and a semicolon, since one entry holds one change.
11
+
12
+ ## The Check
13
+
14
+ - Two appends give two lines in the same shape, under the title.
15
+ - A part with ` - ` or a semicolon refuses and changes nothing.
@@ -0,0 +1,29 @@
1
+ # Landing
2
+
3
+ A spec for the three scripts that land work on the main branch when several agents work at once ([Parallel Agents](../../standards/tooling/parallel-agents.md)). The main branch and the repository are settings, `main` and the current folder by default.
4
+
5
+ ## Merge
6
+
7
+ - It merges one branch into the main branch with `--no-ff` and the message it is given.
8
+ - It refuses a branch that does not hold the latest main, so the tree that lands is the one its builder checked.
9
+ - It refuses while a merge is in progress, on a tree with tracked changes, off the main branch, without exactly one branch named, and with a message that does not open with a story's or a ticket's id.
10
+ - It takes a lock first, and refuses while another merge holds it, so two merges never run at once.
11
+
12
+ ## Main Checks
13
+
14
+ - It runs every check it is given, as the project's own scripts, and prints each one's exit code.
15
+ - It refuses with no check named, while a merge is in progress, and while a merge holds the lock.
16
+ - A failed check leaves its output in a log and the script prints where. The script exits with the failure.
17
+
18
+ ## Docs Commit
19
+
20
+ - It runs every check it is given, then stages the paths it is given and commits them with the message, only when every check exits 0.
21
+ - It refuses without a check, without a path, off the main branch, and while a merge is in progress.
22
+
23
+ ## The Check
24
+
25
+ - A merge of a branch that holds the latest main lands it in one merge commit, its message opening with the story's id.
26
+ - A merge of a branch that main has moved past refuses, and main is as it was.
27
+ - A merge on a dirty tree, off main, while the lock is held, or with a message without an id refuses and changes nothing.
28
+ - Main checks with no check named refuses. With a passing and a failing check, it prints both codes and exits with the failure.
29
+ - A docs commit with a failing check commits nothing.
@@ -0,0 +1,22 @@
1
+ # Refuse Wrap-Up Questions
2
+
3
+ A spec for a hook that keeps the end of a turn free of answer buttons ([Free Text Replies, No Buttons](../../standards/behavior/free-text-replies-no-buttons.md)). Each app ends a turn its own way, so a project writes the hook for the app its agents run in.
4
+
5
+ ## Where It Runs
6
+
7
+ - Before the call an app makes to end a turn with a recap, where the app has such a call.
8
+ - An app without one needs no hook: the standard alone holds there.
9
+
10
+ ## What It Does
11
+
12
+ - It refuses a call that carries a question for the director or answer options to click.
13
+ - It passes every other call, the recap alone included.
14
+ - The refusal tells the agent to drop the question and the options, send the recap, and ask in prose in the closing message.
15
+ - It reads the call and nothing else: no network, no state, and no change to the call.
16
+
17
+ ## The Check
18
+
19
+ - A call with a recap alone passes.
20
+ - A call with a question refuses.
21
+ - A call with answer options refuses.
22
+ - A call with an empty question or an empty list of options passes.
@@ -0,0 +1,20 @@
1
+ # Reload Core Rules
2
+
3
+ A spec for a hook that puts the Core Rules back in context after a compaction ([Reload The Standards After Compacting](../../standards/behavior/reload-the-standards-after-compacting.md)).
4
+
5
+ ## Where It Runs
6
+
7
+ - When a session starts again after a compaction, where the agent's app supports such a hook and does not read the entry point again by itself.
8
+
9
+ ## What It Does
10
+
11
+ - It reads the index, `standards/overview.md` unless the project keeps it elsewhere.
12
+ - It prints every standard that the Core Rules section of the index links to, in full and in order.
13
+ - It skips a link to a file that is not on disk.
14
+ - It prints nothing, and still succeeds, when the project has no index.
15
+
16
+ ## The Check
17
+
18
+ - With an index that links three Core Rules, it prints all three in order.
19
+ - With one of them missing on disk, it prints the other two.
20
+ - Without an index, it prints nothing and exits 0.