@thebassclef/lite 0.0.1 → 0.1.2

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 (289) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +85 -4
  3. package/dist/cli.cjs +1612 -0
  4. package/dist/cli.js +1589 -0
  5. package/dist/index.cjs +4 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +4 -0
  8. package/package.json +51 -3
  9. package/substrate/.bassclef/lite-manifest.json +2701 -0
  10. package/substrate/.claude/agents/architect.md +70 -0
  11. package/substrate/.claude/agents/builder.md +114 -0
  12. package/substrate/.claude/agents/designer.md +156 -0
  13. package/substrate/.claude/agents/reviewer.md +88 -0
  14. package/substrate/.claude/hooks/artifact-ingestion-gate.sh +357 -0
  15. package/substrate/.claude/hooks/assert-verify-steering.sh +77 -0
  16. package/substrate/.claude/hooks/bassclef-source-config-validate.sh +215 -0
  17. package/substrate/.claude/hooks/bassclef-sync.sh +634 -0
  18. package/substrate/.claude/hooks/compound-noun-scrub.sh +292 -0
  19. package/substrate/.claude/hooks/kiss-expansion-inject.sh +69 -0
  20. package/substrate/.claude/hooks/longrun-prep-compounding-axis-check.sh +492 -0
  21. package/substrate/.claude/hooks/longrun-prep-compounding-sequence-check.sh +492 -0
  22. package/substrate/.claude/hooks/plain-english-steering.sh +156 -0
  23. package/substrate/.claude/hooks/post-skill-friction-check.sh +177 -0
  24. package/substrate/.claude/hooks/post-skill-telemetry.sh +62 -0
  25. package/substrate/.claude/hooks/pre-build-gate.sh +511 -0
  26. package/substrate/.claude/hooks/pre-commit-gate.sh +451 -0
  27. package/substrate/.claude/hooks/session-end.sh +433 -0
  28. package/substrate/.claude/hooks/session-reflection.sh +303 -0
  29. package/substrate/.claude/hooks/skill-body-grade-gate.sh +219 -0
  30. package/substrate/.claude/hooks/skill-body-intent-drift.sh +107 -0
  31. package/substrate/.claude/hooks/skill-step-list-check.sh +171 -0
  32. package/substrate/.claude/hooks/state-validate.sh +271 -0
  33. package/substrate/.claude/hooks/substrate-clarity-gate.sh +1110 -0
  34. package/substrate/.claude/hooks/temperance-gate.sh +147 -0
  35. package/substrate/.claude/hooks/testing-tier-enforce.sh +233 -0
  36. package/substrate/.claude/hooks/turn-prose-grade-measure.sh +219 -0
  37. package/substrate/.claude/hooks/turn-prose-kiss-check.sh +463 -0
  38. package/substrate/.claude/hooks/vocabulary-migration-check.sh +171 -0
  39. package/substrate/.claude/hooks/whereami-utc-gate.sh +142 -0
  40. package/substrate/.claude/luminaries/alan-cooper.md +170 -0
  41. package/substrate/.claude/luminaries/alistair-cockburn.md +140 -0
  42. package/substrate/.claude/luminaries/amazon-pr-faq.md +34 -0
  43. package/substrate/.claude/luminaries/ash-maurya.md +121 -0
  44. package/substrate/.claude/luminaries/bill-buxton.md +210 -0
  45. package/substrate/.claude/luminaries/charles-sanders-peirce.md +150 -0
  46. package/substrate/.claude/luminaries/david-ogilvy.md +192 -0
  47. package/substrate/.claude/luminaries/don-norman.md +173 -0
  48. package/substrate/.claude/luminaries/edward-tufte.md +179 -0
  49. package/substrate/.claude/luminaries/eric-evans.md +160 -0
  50. package/substrate/.claude/luminaries/frederick-brooks.md +50 -0
  51. package/substrate/.claude/luminaries/gang-of-four.md +157 -0
  52. package/substrate/.claude/luminaries/glenford-myers.md +230 -0
  53. package/substrate/.claude/luminaries/hunt-thomas.md +115 -0
  54. package/substrate/.claude/luminaries/hyrum-wright.md +94 -0
  55. package/substrate/.claude/luminaries/jason-fried-dhh.md +46 -0
  56. package/substrate/.claude/luminaries/jesse-james-garrett.md +154 -0
  57. package/substrate/.claude/luminaries/john-ousterhout.md +94 -0
  58. package/substrate/.claude/luminaries/karl-popper.md +132 -0
  59. package/substrate/.claude/luminaries/kent-beck.md +168 -0
  60. package/substrate/.claude/luminaries/linus-torvalds.md +218 -0
  61. package/substrate/.claude/luminaries/martin-fowler.md +164 -0
  62. package/substrate/.claude/luminaries/michael-feathers.md +125 -0
  63. package/substrate/.claude/luminaries/michael-nygard.md +118 -0
  64. package/substrate/.claude/luminaries/robert-c-martin.md +164 -0
  65. package/substrate/.claude/luminaries/saltzer-schroeder.md +194 -0
  66. package/substrate/.claude/luminaries/sophia-prater.md +193 -0
  67. package/substrate/.claude/luminaries/stephen-toulmin.md +131 -0
  68. package/substrate/.claude/luminaries/tony-hoare.md +170 -0
  69. package/substrate/.claude/luminaries/vaughn-vernon.md +50 -0
  70. package/substrate/.claude/luminaries/w-edwards-deming.md +158 -0
  71. package/substrate/.claude/rules/accessor-library-discipline.md +138 -0
  72. package/substrate/.claude/rules/adr-discipline.md +120 -0
  73. package/substrate/.claude/rules/api-conventions.md +125 -0
  74. package/substrate/.claude/rules/artifact-ingestion.md +179 -0
  75. package/substrate/.claude/rules/assert-only-after-verify.md +137 -0
  76. package/substrate/.claude/rules/blocked-items.md +146 -0
  77. package/substrate/.claude/rules/bootstrap-pair-discipline.md +141 -0
  78. package/substrate/.claude/rules/branching.md +28 -0
  79. package/substrate/.claude/rules/cold-adopter-harness-discipline.md +129 -0
  80. package/substrate/.claude/rules/commit-conventions.md +22 -0
  81. package/substrate/.claude/rules/compounding-axis-fresh-analysis.md +188 -0
  82. package/substrate/.claude/rules/compounding-sequence-fresh-analysis.md +188 -0
  83. package/substrate/.claude/rules/context-engineering.md +202 -0
  84. package/substrate/.claude/rules/context-management.md +85 -0
  85. package/substrate/.claude/rules/defensive-bash.md +68 -0
  86. package/substrate/.claude/rules/deferred-actions.md +233 -0
  87. package/substrate/.claude/rules/destructive-operations.md +69 -0
  88. package/substrate/.claude/rules/diagnosis.md +38 -0
  89. package/substrate/.claude/rules/github-issue-flash-tweet.md +156 -0
  90. package/substrate/.claude/rules/guardrails.md +73 -0
  91. package/substrate/.claude/rules/hook-wire-on-author.md +103 -0
  92. package/substrate/.claude/rules/identifier-leak-prevention.md +104 -0
  93. package/substrate/.claude/rules/iteration-bet-brief-completeness.md +54 -0
  94. package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +98 -0
  95. package/substrate/.claude/rules/longrun-prep-plan-doc-compression.md +89 -0
  96. package/substrate/.claude/rules/loop-discipline.md +81 -0
  97. package/substrate/.claude/rules/manual-prod-approval.md +100 -0
  98. package/substrate/.claude/rules/marker-enrichment-discipline.md +99 -0
  99. package/substrate/.claude/rules/mobile-ephemeral-session.md +109 -0
  100. package/substrate/.claude/rules/new-dependency-check.md +51 -0
  101. package/substrate/.claude/rules/oo-ad-entry-point.md +117 -0
  102. package/substrate/.claude/rules/operator-facing-prose.md +196 -0
  103. package/substrate/.claude/rules/option-label-discipline.md +108 -0
  104. package/substrate/.claude/rules/pattern-annotation.md +100 -0
  105. package/substrate/.claude/rules/plain-english-discipline.md +156 -0
  106. package/substrate/.claude/rules/plan-enumeration-needs-value-props.md +211 -0
  107. package/substrate/.claude/rules/pr-body-shape.md +317 -0
  108. package/substrate/.claude/rules/pr-strategy.md +167 -0
  109. package/substrate/.claude/rules/pr-title-shape.md +161 -0
  110. package/substrate/.claude/rules/prototype-workflow.md +65 -0
  111. package/substrate/.claude/rules/reserved-skill-names.md +123 -0
  112. package/substrate/.claude/rules/schema-management.md +49 -0
  113. package/substrate/.claude/rules/sdlc-gates.md +149 -0
  114. package/substrate/.claude/rules/security.md +37 -0
  115. package/substrate/.claude/rules/session-artifacts.md +236 -0
  116. package/substrate/.claude/rules/skill-composition-declarations.md +124 -0
  117. package/substrate/.claude/rules/skill-description-clarity.md +247 -0
  118. package/substrate/.claude/rules/skill-procedure-step-list.md +137 -0
  119. package/substrate/.claude/rules/state-schema-validation.md +162 -0
  120. package/substrate/.claude/rules/stuck-signal-diagnostic.md +140 -0
  121. package/substrate/.claude/rules/substrate-config-schema.md +98 -0
  122. package/substrate/.claude/rules/test-list-discipline.md +175 -0
  123. package/substrate/.claude/rules/test-sufficiency.md +210 -0
  124. package/substrate/.claude/rules/testing-tier-config.md +145 -0
  125. package/substrate/.claude/rules/testing.md +38 -0
  126. package/substrate/.claude/rules/turn-estimate-grounding.md +134 -0
  127. package/substrate/.claude/rules/visual-hierarchy.md +437 -0
  128. package/substrate/.claude/rules/we-dont-break-adopters.md +126 -0
  129. package/substrate/.claude/rules/whereami-load-bearing.md +202 -0
  130. package/substrate/.claude/rules/writing-craft-discipline.md +92 -0
  131. package/substrate/.claude/rules/wu-sequencing-compounds.md +145 -0
  132. package/substrate/.claude/skills/build/SKILL.md +640 -0
  133. package/substrate/.claude/skills/chronicle/SKILL.md +55 -0
  134. package/substrate/.claude/skills/clean-artifacts/SKILL.md +249 -0
  135. package/substrate/.claude/skills/decompose/SKILL.md +280 -0
  136. package/substrate/.claude/skills/diagnose/SKILL.md +297 -0
  137. package/substrate/.claude/skills/feynman/SKILL.md +90 -0
  138. package/substrate/.claude/skills/howdoi/SKILL.md +105 -0
  139. package/substrate/.claude/skills/ia-model/SKILL.md +108 -0
  140. package/substrate/.claude/skills/interaction-design/SKILL.md +112 -0
  141. package/substrate/.claude/skills/interpret-input/SKILL.md +180 -0
  142. package/substrate/.claude/skills/journal/SKILL.md +209 -0
  143. package/substrate/.claude/skills/kiss/SKILL.md +449 -0
  144. package/substrate/.claude/skills/launch/SKILL.md +915 -0
  145. package/substrate/.claude/skills/lean-canvas/SKILL.md +332 -0
  146. package/substrate/.claude/skills/longrun/SKILL.md +463 -0
  147. package/substrate/.claude/skills/luminary/SKILL.md +481 -0
  148. package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +177 -0
  149. package/substrate/.claude/skills/onboard-repo/SKILL.md +1624 -0
  150. package/substrate/.claude/skills/pattern-review/SKILL.md +99 -0
  151. package/substrate/.claude/skills/personas/SKILL.md +207 -0
  152. package/substrate/.claude/skills/promote/SKILL.md +283 -0
  153. package/substrate/.claude/skills/requirement/SKILL.md +98 -0
  154. package/substrate/.claude/skills/retro/SKILL.md +117 -0
  155. package/substrate/.claude/skills/riff/SKILL.md +114 -0
  156. package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +163 -0
  157. package/substrate/.claude/skills/session-end/SKILL.md +309 -0
  158. package/substrate/.claude/skills/session-log/SKILL.md +299 -0
  159. package/substrate/.claude/skills/skills/SKILL.md +228 -0
  160. package/substrate/.claude/skills/spec/SKILL.md +105 -0
  161. package/substrate/.claude/skills/sprint/SKILL.md +392 -0
  162. package/substrate/.claude/skills/stage/SKILL.md +384 -0
  163. package/substrate/.claude/skills/state-a-problem/SKILL.md +185 -0
  164. package/substrate/.claude/skills/temperance/SKILL.md +108 -0
  165. package/substrate/.claude/skills/use-case/SKILL.md +417 -0
  166. package/substrate/.claude/skills/user-stories/SKILL.md +268 -0
  167. package/substrate/.claude/skills/value-prop/SKILL.md +251 -0
  168. package/substrate/.claude/skills/verify/SKILL.md +160 -0
  169. package/substrate/.claude/skills/visual-review/SKILL.md +503 -0
  170. package/substrate/.claude/skills/whats-the-plan/SKILL.md +202 -0
  171. package/substrate/.claude/skills/whereami/SKILL.md +307 -0
  172. package/substrate/AGENTS.md +79 -0
  173. package/substrate/CLAUDE-lite.md +85 -0
  174. package/substrate/CODE_OF_CONDUCT.md +28 -0
  175. package/substrate/CONTRIBUTING.md +177 -0
  176. package/substrate/README.md +173 -0
  177. package/substrate/SECURITY.md +19 -0
  178. package/substrate/architecture/decisions/ADR-029-release-pipeline.md +79 -0
  179. package/substrate/architecture/decisions/ADR-031-non-breaking-changes-adopter-discipline.md +139 -0
  180. package/substrate/architecture/decisions/ADR-032-adopter-sync-dispatcher-architecture.md +192 -0
  181. package/substrate/architecture/decisions/ADR-039-release-tagging-scheme.md +145 -0
  182. package/substrate/architecture/decisions/ADR-040-planning-skill-vocabulary-and-lite-profile.md +155 -0
  183. package/substrate/architecture/decisions/ADR-044-unified-skill-body-template.md +162 -0
  184. package/substrate/lib/clean-artifacts-sweep.sh +112 -0
  185. package/substrate/lib/code-comment-discipline.sh +144 -0
  186. package/substrate/lib/composer-preflight.sh +459 -0
  187. package/substrate/lib/hook-inject.sh +255 -0
  188. package/substrate/lib/luminary-pick.sh +96 -0
  189. package/substrate/lib/output-discipline.sh +143 -0
  190. package/substrate/lib/prose-scan-boundary.sh +171 -0
  191. package/substrate/lib/rewrite-check.sh +214 -0
  192. package/substrate/lib/state.sh +1372 -0
  193. package/substrate/lib/telemetry.sh +205 -0
  194. package/substrate/lib/tier-check.sh +187 -0
  195. package/substrate/lib/tier-dependency-audit.sh +1088 -0
  196. package/substrate/presence/install/bassclef-hook-connect.sh +178 -0
  197. package/substrate/presence/install/bassclef-sync.dispatcher.template.sh +841 -0
  198. package/substrate/presence/install/bassclef-sync.template.sh +2076 -0
  199. package/substrate/presence/install/schedule-auto-save.cron.sh +88 -0
  200. package/substrate/presence/install/schedule-auto-save.taskscheduler.md +122 -0
  201. package/substrate/scripts/aggregate-telemetry.sh +217 -0
  202. package/substrate/scripts/analyze-tier-dependencies.sh +239 -0
  203. package/substrate/scripts/generate-lite-manifest.sh +505 -0
  204. package/substrate/scripts/generate-tier-manifest.sh +28 -0
  205. package/substrate/scripts/intent-drift-check.sh +456 -0
  206. package/substrate/scripts/lite-manifest-drift-check.sh +146 -0
  207. package/substrate/scripts/render-lite-manifest-doc.sh +150 -0
  208. package/substrate/standards/adr-template.md +86 -0
  209. package/substrate/standards/api-conventions/nextjs.md +84 -0
  210. package/substrate/standards/artifact-composition.md +209 -0
  211. package/substrate/standards/bash-hook-safety.md +246 -0
  212. package/substrate/standards/bassclef-configs-schema.md +232 -0
  213. package/substrate/standards/bassclef-evolution.md +143 -0
  214. package/substrate/standards/bassclef-internal-jargon.md +244 -0
  215. package/substrate/standards/bassclef-managed-sentinel.md +96 -0
  216. package/substrate/standards/bassclef-source-config.md +228 -0
  217. package/substrate/standards/branch-stacking.md +408 -0
  218. package/substrate/standards/code-safety-principles.md +176 -0
  219. package/substrate/standards/composer-prerequisites.md +155 -0
  220. package/substrate/standards/deferred-actions-schema.md +204 -0
  221. package/substrate/standards/dependency-discipline/cargo.md +39 -0
  222. package/substrate/standards/dependency-discipline/gem.md +43 -0
  223. package/substrate/standards/dependency-discipline/go-mod.md +41 -0
  224. package/substrate/standards/dependency-discipline/npm.md +42 -0
  225. package/substrate/standards/dependency-discipline/pip.md +42 -0
  226. package/substrate/standards/deployment-topology/ec2-tailscale.md +225 -0
  227. package/substrate/standards/deployment-topology.md +69 -0
  228. package/substrate/standards/docs-sync-allowlist.md +76 -0
  229. package/substrate/standards/domain-and-dns.md +145 -0
  230. package/substrate/standards/frontend-stack.md +67 -0
  231. package/substrate/standards/frontmatter-schema.md +154 -0
  232. package/substrate/standards/graceful-exit.md +227 -0
  233. package/substrate/standards/hook-idempotency.md +102 -0
  234. package/substrate/standards/hook-injection-discipline.md +202 -0
  235. package/substrate/standards/hook-install-class.md +215 -0
  236. package/substrate/standards/input-handler-interface.md +152 -0
  237. package/substrate/standards/lite-manifest-schema-changes.md +135 -0
  238. package/substrate/standards/luminary-matching.md +105 -0
  239. package/substrate/standards/luminary-problem-patterns.md +481 -0
  240. package/substrate/standards/migration-discipline/active-record.md +50 -0
  241. package/substrate/standards/migration-discipline/alembic.md +43 -0
  242. package/substrate/standards/migration-discipline/gorm.md +50 -0
  243. package/substrate/standards/migration-discipline/prisma.md +53 -0
  244. package/substrate/standards/migration-discipline/sqlalchemy.md +51 -0
  245. package/substrate/standards/mobile-ephemeral-session.md +167 -0
  246. package/substrate/standards/model-routing-discipline.md +160 -0
  247. package/substrate/standards/ogilvy-writing-rules.md +225 -0
  248. package/substrate/standards/opener-discipline.md +96 -0
  249. package/substrate/standards/operator-facing-prose-discipline.md +201 -0
  250. package/substrate/standards/persona-schema.md +229 -0
  251. package/substrate/standards/pluggable-luminaries.md +323 -0
  252. package/substrate/standards/pr-body-discipline.md +115 -0
  253. package/substrate/standards/preview-state-schema.md +189 -0
  254. package/substrate/standards/project-directory-layout.md +276 -0
  255. package/substrate/standards/release-tagging.md +137 -0
  256. package/substrate/standards/reserved-skill-names.md +120 -0
  257. package/substrate/standards/scannable-multi-option-output.md +261 -0
  258. package/substrate/standards/sdlc-compliance.md +286 -0
  259. package/substrate/standards/sdlc-gates/typescript.md +57 -0
  260. package/substrate/standards/secrets-lifecycle.md +210 -0
  261. package/substrate/standards/security-scanner-adapter.md +145 -0
  262. package/substrate/standards/session-board.md +256 -0
  263. package/substrate/standards/skill-output-discipline.md +90 -0
  264. package/substrate/standards/state-spine-contract.md +255 -0
  265. package/substrate/standards/state-spine.md +511 -0
  266. package/substrate/standards/steering-hints/kiss-words.md +11 -0
  267. package/substrate/standards/substrate-config-schema.md +267 -0
  268. package/substrate/standards/tech-stack-config.md +109 -0
  269. package/substrate/standards/tier-dependency-analysis.md +167 -0
  270. package/substrate/standards/tier-runtime-deps/lite.md +57 -0
  271. package/substrate/standards/tier-tag-schema.md +155 -0
  272. package/substrate/standards/two-layer-config.md +99 -0
  273. package/substrate/standards/use-case-format.md +292 -0
  274. package/substrate/standards/user-story-invest.md +268 -0
  275. package/substrate/standards/velocity-and-appetite.md +229 -0
  276. package/substrate/standards/voice-input-pattern.md +119 -0
  277. package/substrate/standards/whereami-schema.md +301 -0
  278. package/substrate/standards/worktree-management.md +211 -0
  279. package/substrate/standards/writing-guide.md +213 -0
  280. package/substrate/templates/chronicle-template.md +75 -0
  281. package/substrate/templates/deferred-action-template.md +45 -0
  282. package/substrate/templates/memory-proposal-template.md +77 -0
  283. package/substrate/templates/persona-template.md +200 -0
  284. package/substrate/templates/pr-faq.md +45 -0
  285. package/substrate/templates/secret-rotation-template.md +162 -0
  286. package/substrate/templates/spec-template.md +131 -0
  287. package/substrate/templates/use-case-template.md +194 -0
  288. package/substrate/templates/user-story-template.md +107 -0
  289. package/substrate/templates/whereami-template.md +101 -0
@@ -0,0 +1,145 @@
1
+ ---
2
+ tier: lite
3
+ description: "Bassclef's testing discipline is configured per path-matcher in .claude/bassclef-configs.jsonc under the testing section."
4
+ ---
5
+
6
+ # Testing-Tier Config
7
+
8
+ Bassclef's testing discipline is configured per path-matcher in `.claude/bassclef-configs.jsonc` under the `testing` section. Four tiers — 0 strict TDD / 1 test-with / 2 smoke / 3 manual-verify — pick by blast radius. Most-specific path-matcher wins. The mtime-checking hook (`testing-tier-enforce.sh`) enforces Tier 0 mechanically; Tier 1 WARNs; Tier 2 + Tier 3 stay silent.
9
+
10
+ This rule supersedes the honor-system framing of `.claude/rules/testing.md`. That rule remains the test-content guidance (what makes a good test); this rule governs which paths require tests and what enforcement fires.
11
+
12
+ ## Why this rule exists
13
+
14
+ Bassclef shipped `.claude/rules/testing.md` with three layers — unit + integration + smoke — and a "skip glue code, trivial getters" exemption. That exemption ran on the honor system. No check fires when a new exported function ships without a test. No check fires when someone edits source without touching the test. No check fires when a hook update skips its test.
15
+
16
+ The 2026-06-15 substrate-archaeology session named the pattern. TDD-everywhere runs too verbose for adopter surfaces like chronicles and one-off scripts. TDD-nowhere runs too lax for bassclef's own hooks and schemas, where a silent bug hits every adopter. The tier framework lets impact pick the enforcement level.
17
+
18
+ The Tier 0 mtime hook does the actual work. INSTEAD of asking the agent to run tests from memory: the hook BLOCKs the commit when the test mtime did not advance with the source. A gate at the moment of failure beats a rule that fires after.
19
+
20
+ ## The four tiers
21
+
22
+ | Tier | Name | What it means | Enforcement |
23
+ |---|---|---|---|
24
+ | **0** | Strict TDD | Test mtime ≤ source mtime AND test file present | BLOCK at pre-commit |
25
+ | **1** | Test-with | New test expected when new source ships | WARN at pre-commit |
26
+ | **2** | Smoke | Smoke test exists somewhere for this surface | Silent (advisory only) |
27
+ | **3** | Manual verify | Operator eyeballs the change | Silent (no enforcement) |
28
+
29
+ **Tier 0** is for surfaces where silent bugs compound across every adopter. Bassclef hooks, state-spine schemas, lib/state.sh accessors, and the substrate's own pre-commit gates live here.
30
+
31
+ **Tier 1** is for bassclef's own glue scripts (`scripts/*.sh`) and adopter-app source files where TDD is expected but the WARN gives leeway for in-progress work.
32
+
33
+ **Tier 2** is for adopter-app routes and components where end-to-end smoke tests cover the surface without per-file unit tests. The path-matcher does not look for a sibling test file; the operator confirms a smoke test exists.
34
+
35
+ **Tier 3** is the silent default for narrative content. Chronicles, journal entries, iteration-goal docs, decompositions, and operator-private narrative all live here. INSTEAD of testing narrative: the operator reads it.
36
+
37
+ ## Path-matcher precedence
38
+
39
+ Two categories of path matchers, with different ownership:
40
+
41
+ 1. **Substrate-internal paths** — bassclef's own infrastructure. **Hard-coded in this rule body.** NOT adopter-configurable. Adopters read the discipline; they cannot edit it.
42
+ 2. **Adopter-app paths** — adopter's own code paths. Configured in adopter's `bassclef-configs.jsonc` `testing.path_matchers`. Per-adopter.
43
+
44
+ The hook walks both lists. Substrate paths take precedence; adopter overrides on substrate paths are silently ignored. When no entry matches, `testing.global_floor` applies. The default global floor is Tier 1 (WARN on missing test).
45
+
46
+ ### Substrate-internal path-matchers (HARD-CODED — not adopter-configurable)
47
+
48
+ | Path | Tier | Why this is Tier 0 / fixed |
49
+ |---|---|---|
50
+ | `.claude/hooks/*.sh` | 0 | Silent bugs compound across every adopter using bassclef |
51
+ | `scripts/migrate-adopter-references.sh` | 0 | Adopter-facing migration tool; Tier 0 hooks call it at session-start (per ADR-031); a defect hits every adopter machine. (Moved from `strategy/templates/` per bassclef-upstream#317 Phase 1b.) |
52
+ | `scripts/bassclef-orphan-parking.sh` | 0 | Adopter-facing migration tooling — same reason as above |
53
+ | `scripts/bassclef-migrate-summary.sh` | 0 | Adopter-facing migration tooling — same reason as above |
54
+ | `presence/install/*.sh` | 0 | Adopter-facing distribution dispatcher + sync + install bootstrap; a defect hits every adopter machine. (Moved from `strategy/templates/` per bassclef-upstream#317 Phase 1a.) |
55
+ | `standards/state-spine/schemas/*.json` | 0 | Schema defects corrupt the state spine universally |
56
+ | `lib/state.sh` | 0 | Accessor library central to all state reads; one defect breaks every consumer |
57
+ | `lib/intent-matcher.sh` | 0 | Intent dispatch — a defect breaks every chain |
58
+ | `scripts/*.sh` | 1 | Other operator-class scripts not listed above; WARN if missing test |
59
+ | `chronicle/*.md` | 3 | Narrative content; operator-read, no test |
60
+ | `docs/iteration-bets/*.md` | 3 | Narrative; operator-read |
61
+ | `docs/decompositions/*.md` | 3 | Narrative; operator-read |
62
+ | `docs/operator-private/journals/*.md` | 3 | Narrative; operator-read |
63
+
64
+ These are bassclef's substrate. Per ADR-031 and Linus's rule that bassclef keeps adopters working — discipline is a contract, not a preference. INSTEAD of letting adopters lower their tier: bassclef holds the discipline for its own substrate. Adopters read this rule; they cannot lower it themselves.
65
+
66
+ Why not adopter-configurable:
67
+ - **Substrate integrity is a contract.** Adopters rely on bassclef's reliability guarantee; lowering bassclef's own tier would undermine the contract while still depending on it.
68
+ - **Hyrum's Law applied to discipline.** Configurable tier means some adopter lowers it; their substrate degrades silently; bassclef's future fixes that assumed the discipline break their setup.
69
+ - **Linus's kernel/userspace boundary.** Linux exposes kernel state as READ surfaces, not WRITE permission over kernel correctness machinery. bassclef's tier discipline is the same shape.
70
+ - **Brooks's conceptual integrity.** Discipline is bassclef's coherent vision; configurability creates per-adopter drift.
71
+
72
+ ### Adopter-app path-matchers (configurable per adopter)
73
+
74
+ Adopters edit `testing.path_matchers` in their own `.claude/bassclef-configs.jsonc` for THEIR code:
75
+
76
+ ```jsonc
77
+ "testing": {
78
+ "global_floor": 1,
79
+ "path_matchers": [
80
+ { "match": "src/middleware.ts", "tier": 0 },
81
+ { "match": "src/lib/auth/**", "tier": 0 },
82
+ { "match": "src/app/**/route.ts", "tier": 2 },
83
+ { "match": "src/components/**/*.tsx", "tier": 2 }
84
+ ]
85
+ }
86
+ ```
87
+
88
+ The substrate entry wins when an adopter's `path_matchers` entry matches a substrate path (above). The hook ignores adopter attempts to lower substrate tiers — by design.
89
+
90
+ ## Test-file sibling mapping (Tier 0 only)
91
+
92
+ For Tier 0 paths, the hook expects a sibling test file:
93
+
94
+ | Source path | Expected test path |
95
+ |---|---|
96
+ | `.claude/hooks/<name>.sh` | `.claude/hooks/tests/<name>.test.sh` |
97
+ | `standards/state-spine/schemas/<name>.schema.json` | `standards/state-spine/schemas/tests/<name>.test.sh` |
98
+ | `lib/<name>.sh` | `lib/tests/<name>.test.sh` |
99
+
100
+ The hook BLOCKs when the source is edited and the test mtime did not advance. The BLOCK message names three things: the source path, the expected test path, and the mtime gap. INSTEAD of failing silently: the message tells the agent which test file to touch.
101
+
102
+ ## Override discipline
103
+
104
+ `SKIP_TESTING_TIER_ENFORCE=1 <command>` bypasses the hook for one command. The bypass is logged via `trace-helper.sh` per bassclef's existing override idiom.
105
+
106
+ Use it sparingly. Three cases warrant the override. One-shot migration scripts that bootstrap state. Emergency rescues when the hook itself is broken. Documentation changes where the agent has clear evidence the source change carries no behavior.
107
+
108
+ INSTEAD of overriding for routine work that fails the check: write the test. The hook fires at the cheapest moment to add one. Deferred test-writing almost never happens.
109
+
110
+ ## Allowlist baseline (grace window)
111
+
112
+ `.claude/hooks/testing-tier-enforce-allowlist.txt` lists existing Tier 0 sources that ship without tests as of the hook's land date. Each entry carries a dated grace window. The hook BLOCKs on listed paths in two cases. First — the grace window expires. Second — the source gets edited (new edits during grace still BLOCK). The allowlist covers pre-existing unedited state only.
113
+
114
+ The grace window is set per-adopter at `/onboard-repo` (default 60 days). Operator decides whether to backfill tests for grandfathered hooks or to remove them from the allowlist as they are next touched.
115
+
116
+ INSTEAD of forcing retroactive backfill at hook-land: the grace window covers existing untested bassclef hooks while new edits trigger enforcement. Per-hook backfill happens as those hooks are next touched.
117
+
118
+ ## When this rule fires
119
+
120
+ This rule is methodology — it loads in every session via `additionalDirectories`. Agents self-check before writing source files in Tier 0 paths. The `testing-tier-enforce.sh` hook is the mechanical layer (bassclef#1037 WU-3).
121
+
122
+ Together: rule supplies the why; hook fires at the moment of failure.
123
+
124
+ ## Composes with
125
+
126
+ - **@luminary kent-beck** — TDD anchor. Beck's red-green-refactor cycle is the discipline this rule does for Tier 0. A test written before source naturally satisfies "test mtime ≤ source mtime" — the test came first.
127
+ - **@luminary john-ousterhout** — Design-judgment anchor. The tier choice IS a design decision. Push every path to Tier 0 and you get shallow modules where tests just mirror source. Push every path to Tier 3 and you get silent regressions. The tier slider applies Ousterhout's "complexity is incremental" — pick the right tier per surface. Do not flatten the answer.
128
+ - `.claude/rules/testing.md` — the existing rule on test content (what makes a good test). This rule does not replace it; it adds the per-path tier decision that testing.md left implicit.
129
+ - `.claude/rules/state-schema-validation.md` — sister mechanical-enforcement rule at the state-spine write surface.
130
+ - `.claude/rules/blocked-items.md` — the BLOCK protocol the hook fires.
131
+ - `.claude/hooks/pre-commit-gate.sh` — the chain the new hook joins.
132
+ - `.claude/hooks/testing-tier-enforce.sh` — the mechanical implementation (bassclef#1037 WU-3).
133
+ - `.claude/bassclef-configs.jsonc` — the adopter-edit surface with inline comments.
134
+
135
+ ## Refs
136
+
137
+ - bassclef#1037 — this rule's filing ticket (testing-tier-config primitive)
138
+ - bassclef#1036 — sister ticket; Ousterhout luminary stub
139
+ - bassclef#867 — anchor-luminary verification pattern
140
+ - `docs/iteration-bets/2026-06-15a-discipline-and-versioning-foundations.md` — Phase A bet
141
+ - `docs/roadmaps/2026-06-15-engineering-discipline-and-versioning.md` — parent roadmap
142
+
143
+ ## Retirement condition
144
+
145
+ This rule retires only if the testing-tier framework itself is replaced by a different enforcement model (for example, vitest coverage gates per tier — Phase E). The discipline of per-path tier choice survives any future enforcement-mechanism swap.
@@ -0,0 +1,38 @@
1
+ ---
2
+ tier: lite
3
+ globs: ["**/*.ts", "**/*.tsx", "**/*.test.*", "**/*.spec.*"]
4
+ description: Three-layer test strategy — loads when touching source or test files
5
+ ---
6
+
7
+ > **Companion rule (bassclef#1037):** `.claude/rules/testing-tier-config.md` governs WHICH paths require which level of test enforcement (Tier 0 strict TDD / 1 test-with / 2 smoke / 3 manual verify). This rule (testing.md) governs WHAT makes a good test once a tier requires one. The tier-config rule supersedes the honor-system framing implicit in "skip glue code, trivial getters" below — tier choice is now configured per path-matcher in `.claude/bassclef-configs.jsonc`, and the `testing-tier-enforce.sh` hook fires mechanically.
8
+
9
+ Three layers, all required. Skipping shifts cost to production debugging.
10
+
11
+ Layer 1 — Unit (vitest):
12
+ Pure function logic. New pure function = new test, no exceptions.
13
+ Pre-commit WARNs if new source file has no matching test.
14
+ CI BLOCKs on failure.
15
+
16
+ Layer 2 — Integration:
17
+ Pipeline wiring. Real DB + real Redis, mock only external APIs at HTTP level.
18
+ CI BLOCKs on failure.
19
+
20
+ Layer 3 — E2E/Smoke:
21
+ Post-deploy. Curl-based minimum (health, API, auth redirect).
22
+ Playwright for critical user paths when needed.
23
+
24
+ Coverage policy:
25
+ 100% branch for safety rules. ≥80% line for business logic.
26
+ Skip glue code, trivial getters, third-party internals, LLM output content.
27
+
28
+ Naming: `test_{what}_{scenario}_{expected_outcome}`
29
+ Fixtures: factories not hardcoded data.
30
+
31
+ Change matrix:
32
+ Pure function → unit. Agent/worker → integration. API route → integration + smoke.
33
+ Schema migration → integration. Middleware/auth → E2E. UI component → smoke.
34
+
35
+ Order:
36
+ For pure functions and non-trivial logic, write the test before or
37
+ alongside the implementation — not after. If you wrote the test after,
38
+ state so in the verify summary so the reviewer can audit for tautology.
@@ -0,0 +1,134 @@
1
+ ---
2
+ tier: lite
3
+ description: "Plain check: Before I ship a turn estimate to an adopter, I cite a past bet's actuals + write a range + name the shape."
4
+ ---
5
+
6
+ # Turn-Estimate Grounding
7
+
8
+ **Plain check:** Before I ship a turn estimate to an adopter, I cite a past bet's actuals + write a range + name the shape. Ungrounded numbers do not ship.
9
+
10
+ ---
11
+
12
+ Every turn estimate that lands in adopter-facing prose (goal docs, PR bodies, canvases, ticket bodies) carries three parts:
13
+
14
+ 1. **Source** — cite a past bet's closeout actuals with comparable scope shape (WU count, test-heavy vs docs-heavy, defect diagnosis interludes)
15
+ 2. **Range not point** — write a range (e.g., "40-80 turns") not a point ("60 turns")
16
+ 3. **Plain-language framing** — name the shape driving the number in one sentence
17
+
18
+ Ungrounded turn estimates do not ship to adopter-facing prose. This rule extends the argument shape from `.claude/rules/assert-only-after-verify.md` to numeric claims. It applies at the same reasoning surface — the moment a number gets written down for an adopter to read.
19
+
20
+ ## When this rule fires
21
+
22
+ Every time budget estimate, turn count, or effort range that lands in prose an adopter will read:
23
+
24
+ - `docs/iteration-bets/*.md` frontmatter `appetite:` line
25
+ - `docs/iteration-bets/*.md` body when narrative surfaces a number
26
+ - PR body `Test plan` or `Summary` sections when they cite effort
27
+ - `docs/canvases/*.md` sizing sections
28
+ - Ticket body `Estimate` fields (INVEST format uses S/M/L; this rule fires when a turn count appears instead)
29
+ - Chronicle time-budget actuals sections when they cite the filed number
30
+ - Journal drafts when they cite bet actuals for a past bet
31
+
32
+ Does NOT fire on:
33
+
34
+ - **Chronicle body actuals** for a past bet (backward-looking; the number IS the source itself)
35
+ - **Operator-only surfaces** — internal chronicles, private strategy docs, session-timing markers
36
+ - **Runtime numbers** at checkpoint or closeout time — those cite what happened, not what will happen
37
+
38
+ ## What the rule requires
39
+
40
+ Before any turn estimate ships to adopter-facing prose:
41
+
42
+ 1. **Cite a past bet by path** — one or two bets whose closeout actuals inform this estimate. Format: `bet 2026-07-09c (5 WUs; heavy test setup; ~110 turns actual)`. Path optional but preferred when the calibration goal is recent.
43
+ 2. **Write a range** — the range spans enough to cover the estimate's uncertainty. A 40-80 turn range signals the shape is well-understood but has natural variance. A 200-600 turn range signals real uncertainty and prompts the operator to consider splitting the goal.
44
+ 3. **Name the shape** — one sentence stating what drives the number. Examples: "documentation-heavy; single-file SKILL edit + rule text," "5 WUs riding a shared fixture; each cure ships end-to-end with 10-15 Tier 0 tests," "test-first Beck TDD with 4 substantive WUs sharing a fixture foundation."
45
+
46
+ ## Worked examples
47
+
48
+ ### Anti-pattern (what NOT to do)
49
+
50
+ ```yaml
51
+ appetite: 500-700 turns
52
+ ```
53
+
54
+ Ungrounded. Range too wide. No shape named. Adopter reads this and either dismisses the goal as heavyweight or trusts an ungrounded number.
55
+
56
+ ### Anti-pattern (point estimate)
57
+
58
+ ```yaml
59
+ appetite: 250 turns
60
+ ```
61
+
62
+ Point not range. False precision. No source cited.
63
+
64
+ ### Anti-pattern (source-free range)
65
+
66
+ ```yaml
67
+ appetite: 40-80 turns
68
+ ```
69
+
70
+ Range is fine but ungrounded. Adopter has no way to check if 40-80 is realistic.
71
+
72
+ ### Conformant pattern
73
+
74
+ ```yaml
75
+ appetite: 40-80 turns
76
+ appetite_source: "bet 2026-07-09d (documentation-heavy adopter polish; 2 substantive WUs; ~30 turns actual). Similar shape — single-file SKILL edit + rule text; no new test infrastructure."
77
+ ```
78
+
79
+ Or in narrative form:
80
+
81
+ > **Appetite:** 40-80 turns. Similar shape to bet 09d (~30 turns actual for 2 WUs of single-file SKILL edits + rule text). This bet adds one more WU so the top of the range widens.
82
+
83
+ Both forms carry source + range + shape.
84
+
85
+ ## Trivial-fix exception
86
+
87
+ Fix branches and quick-fix PRs may skip the discipline when the change is under 10 lines AND no goal doc time budget line is being authored. Silence about effort is fine on trivial fixes.
88
+
89
+ ## Adopter-friendly framing
90
+
91
+ Numbers can be honest AND friendly. Instead of:
92
+
93
+ > "This goal needs 500-700 turns"
94
+
95
+ Prefer:
96
+
97
+ > "This bet groups 5 substantive changes. Past bets of this shape landed around 100-350 turns. The wider top of the range covers defect diagnosis interludes that add 30-50 turns per step when they fire."
98
+
99
+ The friendly version:
100
+ - Cites a past shape ("bets of this shape landed around 100-350")
101
+ - Names the shape driver ("5 substantive changes")
102
+ - Explains the top-of-range variance ("defect diagnosis interludes")
103
+
104
+ ## Composes with
105
+
106
+ - `.claude/rules/assert-only-after-verify.md` — parent discipline; this rule extends argument shape to numeric claims
107
+ - `.claude/rules/plain-english-discipline.md` — grade 8 target with grade 10 ceiling; friendly numbers pass the same reading-level test as prose
108
+ - `.claude/rules/pr-body-shape.md` — Test plan and Summary sections that cite effort follow this rule
109
+ - `.claude/rules/pr-title-shape.md` — sister at title surface
110
+ - `.claude/skills/longrun/SKILL.md` Step 1 pre-flight — cites this rule at time budget estimation
111
+ - @luminary stephen-toulmin — argument shape (claim + evidence + why the evidence supports the claim)
112
+ - @luminary karl-popper — falsifiability (grounded estimates check against past actuals; ungrounded ones cannot be checked)
113
+ - Memory `feedback_no_token_estimates.md` — sister at token-estimate surface
114
+ - Memory `feedback_tight_ticket_appetite.md` — calibration for infra tickets
115
+ - Memory `feedback_longrun_appetite_estimates_too_tight.md` — calibration for WU-heavy bets (3-4x off pattern)
116
+
117
+ ## Override
118
+
119
+ `SKIP_TURN_ESTIMATE_GROUNDING=1` — logged via trace-helper. Use only when quoting an external number verbatim (e.g., citing a Shape Up appetite from Basecamp's book).
120
+
121
+ INSTEAD of overriding for routine work: cite the past bet. The cost is one sentence; the discipline compounds across every future adopter who reads a goal doc.
122
+
123
+ ## Refs
124
+
125
+ - sunj-labs/bassclef-upstream#670 — this rule's filing ticket
126
+ - sunj-labs/bassclef-upstream#559 — R8 mechanization umbrella (parent argument-shape work)
127
+ - sunj-labs/bassclef-upstream#582 — assert-verify-steering hook (sister at prose-scan surface)
128
+ - Bet 2026-07-09e — this rule's ship vehicle (eats own dogfood on the time budget line)
129
+ - Toulmin — *The Uses of Argument* (Cambridge, 1958)
130
+ - Popper — *The Logic of Scientific Discovery* (Hutchinson, 1959)
131
+
132
+ ## Retirement condition
133
+
134
+ This rule retires only if goal docs stop surfacing turn estimates in adopter-facing prose. A mechanical layer (Stop hook that scans goal doc frontmatter for ungrounded time budget lines) may ship as a follow-on when methodology drift is observed. Until then, this rule is methodology; the discipline holds at reasoning origin per ADR-035 substrate-as-system tenet.