@thebassclef/lite 0.1.0 → 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 (163) hide show
  1. package/dist/cli.cjs +2 -0
  2. package/dist/cli.js +2 -0
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1 -1
  6. package/package.json +1 -1
  7. package/substrate/.bassclef/lite-manifest.json +999 -92
  8. package/substrate/.claude/hooks/longrun-prep-compounding-axis-check.sh +492 -0
  9. package/substrate/.claude/hooks/longrun-prep-compounding-sequence-check.sh +492 -0
  10. package/substrate/.claude/hooks/pre-commit-gate.sh +1 -2
  11. package/substrate/.claude/hooks/turn-prose-kiss-check.sh +30 -1
  12. package/substrate/.claude/luminaries/glenford-myers.md +230 -0
  13. package/substrate/.claude/luminaries/hunt-thomas.md +115 -0
  14. package/substrate/.claude/luminaries/hyrum-wright.md +94 -0
  15. package/substrate/.claude/luminaries/michael-feathers.md +2 -2
  16. package/substrate/.claude/luminaries/tony-hoare.md +170 -0
  17. package/substrate/.claude/luminaries/vaughn-vernon.md +50 -0
  18. package/substrate/.claude/luminaries/w-edwards-deming.md +158 -0
  19. package/substrate/.claude/rules/accessor-library-discipline.md +138 -0
  20. package/substrate/.claude/rules/adr-discipline.md +120 -0
  21. package/substrate/.claude/rules/api-conventions.md +125 -0
  22. package/substrate/.claude/rules/bootstrap-pair-discipline.md +141 -0
  23. package/substrate/.claude/rules/cold-adopter-harness-discipline.md +129 -0
  24. package/substrate/.claude/rules/compounding-axis-fresh-analysis.md +188 -0
  25. package/substrate/.claude/rules/compounding-sequence-fresh-analysis.md +188 -0
  26. package/substrate/.claude/rules/defensive-bash.md +68 -0
  27. package/substrate/.claude/rules/deferred-actions.md +233 -0
  28. package/substrate/.claude/rules/github-issue-flash-tweet.md +156 -0
  29. package/substrate/.claude/rules/hook-wire-on-author.md +103 -0
  30. package/substrate/.claude/rules/iteration-bet-brief-completeness.md +54 -0
  31. package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +3 -3
  32. package/substrate/.claude/rules/longrun-prep-plan-doc-compression.md +89 -0
  33. package/substrate/.claude/rules/loop-discipline.md +81 -0
  34. package/substrate/.claude/rules/manual-prod-approval.md +100 -0
  35. package/substrate/.claude/rules/marker-enrichment-discipline.md +99 -0
  36. package/substrate/.claude/rules/mobile-ephemeral-session.md +109 -0
  37. package/substrate/.claude/rules/new-dependency-check.md +51 -0
  38. package/substrate/.claude/rules/option-label-discipline.md +108 -0
  39. package/substrate/.claude/rules/pattern-annotation.md +100 -0
  40. package/substrate/.claude/rules/plain-english-discipline.md +11 -9
  41. package/substrate/.claude/rules/plan-enumeration-needs-value-props.md +211 -0
  42. package/substrate/.claude/rules/pr-title-shape.md +161 -0
  43. package/substrate/.claude/rules/prototype-workflow.md +65 -0
  44. package/substrate/.claude/rules/reserved-skill-names.md +123 -0
  45. package/substrate/.claude/rules/schema-management.md +49 -0
  46. package/substrate/.claude/rules/security.md +37 -0
  47. package/substrate/.claude/rules/skill-composition-declarations.md +124 -0
  48. package/substrate/.claude/rules/skill-description-clarity.md +247 -0
  49. package/substrate/.claude/rules/skill-procedure-step-list.md +137 -0
  50. package/substrate/.claude/rules/stuck-signal-diagnostic.md +140 -0
  51. package/substrate/.claude/rules/substrate-config-schema.md +98 -0
  52. package/substrate/.claude/rules/test-list-discipline.md +175 -0
  53. package/substrate/.claude/rules/test-sufficiency.md +210 -0
  54. package/substrate/.claude/rules/testing-tier-config.md +145 -0
  55. package/substrate/.claude/rules/testing.md +38 -0
  56. package/substrate/.claude/rules/turn-estimate-grounding.md +134 -0
  57. package/substrate/.claude/rules/visual-hierarchy.md +437 -0
  58. package/substrate/.claude/rules/we-dont-break-adopters.md +126 -0
  59. package/substrate/.claude/rules/wu-sequencing-compounds.md +145 -0
  60. package/substrate/.claude/skills/build/SKILL.md +1 -1
  61. package/substrate/.claude/skills/chronicle/SKILL.md +55 -0
  62. package/substrate/.claude/skills/clean-artifacts/SKILL.md +249 -0
  63. package/substrate/.claude/skills/decompose/SKILL.md +1 -1
  64. package/substrate/.claude/skills/diagnose/SKILL.md +1 -1
  65. package/substrate/.claude/skills/feynman/SKILL.md +90 -0
  66. package/substrate/.claude/skills/howdoi/SKILL.md +1 -1
  67. package/substrate/.claude/skills/ia-model/SKILL.md +1 -1
  68. package/substrate/.claude/skills/interaction-design/SKILL.md +1 -1
  69. package/substrate/.claude/skills/interpret-input/SKILL.md +8 -8
  70. package/substrate/.claude/skills/journal/SKILL.md +209 -0
  71. package/substrate/.claude/skills/kiss/SKILL.md +1 -1
  72. package/substrate/.claude/skills/launch/SKILL.md +14 -23
  73. package/substrate/.claude/skills/lean-canvas/SKILL.md +1 -1
  74. package/substrate/.claude/skills/longrun/SKILL.md +45 -8
  75. package/substrate/.claude/skills/luminary/SKILL.md +1 -1
  76. package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +1 -1
  77. package/substrate/.claude/skills/onboard-repo/SKILL.md +143 -709
  78. package/substrate/.claude/skills/pattern-review/SKILL.md +1 -1
  79. package/substrate/.claude/skills/personas/SKILL.md +5 -5
  80. package/substrate/.claude/skills/promote/SKILL.md +1 -1
  81. package/substrate/.claude/skills/requirement/SKILL.md +1 -1
  82. package/substrate/.claude/skills/retro/SKILL.md +1 -1
  83. package/substrate/.claude/skills/riff/SKILL.md +1 -1
  84. package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +1 -1
  85. package/substrate/.claude/skills/session-end/SKILL.md +1 -1
  86. package/substrate/.claude/skills/session-log/SKILL.md +3 -3
  87. package/substrate/.claude/skills/skills/SKILL.md +1 -1
  88. package/substrate/.claude/skills/spec/SKILL.md +1 -1
  89. package/substrate/.claude/skills/sprint/SKILL.md +1 -1
  90. package/substrate/.claude/skills/stage/SKILL.md +1 -1
  91. package/substrate/.claude/skills/state-a-problem/SKILL.md +1 -1
  92. package/substrate/.claude/skills/temperance/SKILL.md +1 -1
  93. package/substrate/.claude/skills/use-case/SKILL.md +1 -1
  94. package/substrate/.claude/skills/user-stories/SKILL.md +1 -1
  95. package/substrate/.claude/skills/value-prop/SKILL.md +1 -1
  96. package/substrate/.claude/skills/verify/SKILL.md +1 -1
  97. package/substrate/.claude/skills/visual-review/SKILL.md +503 -0
  98. package/substrate/.claude/skills/whats-the-plan/SKILL.md +202 -0
  99. package/substrate/.claude/skills/whereami/SKILL.md +2 -2
  100. package/substrate/CONTRIBUTING.md +1 -1
  101. package/substrate/README.md +5 -5
  102. package/substrate/lib/prose-scan-boundary.sh +171 -0
  103. package/substrate/lib/tier-check.sh +50 -1
  104. package/substrate/lib/tier-dependency-audit.sh +159 -4
  105. package/substrate/presence/install/bassclef-sync.template.sh +1 -1
  106. package/substrate/scripts/generate-lite-manifest.sh +21 -5
  107. package/substrate/standards/adr-template.md +86 -0
  108. package/substrate/standards/api-conventions/nextjs.md +84 -0
  109. package/substrate/standards/artifact-composition.md +209 -0
  110. package/substrate/standards/bash-hook-safety.md +246 -0
  111. package/substrate/standards/branch-stacking.md +408 -0
  112. package/substrate/standards/code-safety-principles.md +176 -0
  113. package/substrate/standards/composer-prerequisites.md +155 -0
  114. package/substrate/standards/dependency-discipline/cargo.md +39 -0
  115. package/substrate/standards/dependency-discipline/gem.md +43 -0
  116. package/substrate/standards/dependency-discipline/go-mod.md +41 -0
  117. package/substrate/standards/dependency-discipline/npm.md +42 -0
  118. package/substrate/standards/dependency-discipline/pip.md +42 -0
  119. package/substrate/standards/deployment-topology/ec2-tailscale.md +225 -0
  120. package/substrate/standards/deployment-topology.md +69 -0
  121. package/substrate/standards/docs-sync-allowlist.md +4 -4
  122. package/substrate/standards/domain-and-dns.md +145 -0
  123. package/substrate/standards/frontend-stack.md +67 -0
  124. package/substrate/standards/frontmatter-schema.md +154 -0
  125. package/substrate/standards/hook-injection-discipline.md +202 -0
  126. package/substrate/standards/hook-install-class.md +215 -0
  127. package/substrate/standards/input-handler-interface.md +152 -0
  128. package/substrate/standards/lite-manifest-schema-changes.md +60 -0
  129. package/substrate/standards/luminary-matching.md +105 -0
  130. package/substrate/standards/migration-discipline/active-record.md +50 -0
  131. package/substrate/standards/migration-discipline/alembic.md +43 -0
  132. package/substrate/standards/migration-discipline/gorm.md +50 -0
  133. package/substrate/standards/migration-discipline/prisma.md +53 -0
  134. package/substrate/standards/migration-discipline/sqlalchemy.md +51 -0
  135. package/substrate/standards/mobile-ephemeral-session.md +167 -0
  136. package/substrate/standards/model-routing-discipline.md +160 -0
  137. package/substrate/standards/persona-schema.md +229 -0
  138. package/substrate/standards/pluggable-luminaries.md +323 -0
  139. package/substrate/standards/pr-body-discipline.md +115 -0
  140. package/substrate/standards/preview-state-schema.md +189 -0
  141. package/substrate/standards/reserved-skill-names.md +120 -0
  142. package/substrate/standards/scannable-multi-option-output.md +261 -0
  143. package/substrate/standards/sdlc-gates/typescript.md +57 -0
  144. package/substrate/standards/session-board.md +256 -0
  145. package/substrate/standards/state-spine-contract.md +255 -0
  146. package/substrate/standards/steering-hints/kiss-words.md +11 -0
  147. package/substrate/standards/substrate-config-schema.md +267 -0
  148. package/substrate/standards/tier-dependency-analysis.md +1 -1
  149. package/substrate/standards/tier-tag-schema.md +1 -1
  150. package/substrate/standards/two-layer-config.md +99 -0
  151. package/substrate/standards/use-case-format.md +292 -0
  152. package/substrate/standards/user-story-invest.md +268 -0
  153. package/substrate/standards/velocity-and-appetite.md +229 -0
  154. package/substrate/standards/voice-input-pattern.md +119 -0
  155. package/substrate/standards/worktree-management.md +211 -0
  156. package/substrate/templates/chronicle-template.md +75 -0
  157. package/substrate/templates/memory-proposal-template.md +77 -0
  158. package/substrate/templates/persona-template.md +200 -0
  159. package/substrate/templates/pr-faq.md +45 -0
  160. package/substrate/templates/secret-rotation-template.md +162 -0
  161. package/substrate/templates/spec-template.md +131 -0
  162. package/substrate/templates/use-case-template.md +194 -0
  163. package/substrate/templates/user-story-template.md +107 -0
@@ -1357,7 +1357,7 @@ fi
1357
1357
  # bassclef#611 — clarity-check propagation. Writes a tiny consumer-side
1358
1358
  # workflow that calls bassclef's reusable clarity-check workflow.
1359
1359
  #
1360
- # Vendor binding tier: GitHub-Actions-Locked per standards/vendor-bindings.md.
1360
+ # Vendor binding tier: GitHub-Actions-Locked (per bassclef vendor-bindings standard; see operator substrate for full spec).
1361
1361
  # ADO/GitLab/Bitbucket migration tracked at bassclef#629.
1362
1362
  #
1363
1363
  # Skip paths:
@@ -28,7 +28,7 @@
28
28
 
29
29
  set -euo pipefail
30
30
 
31
- MANIFEST_VERSION="1.5.1"
31
+ MANIFEST_VERSION="1.5.7"
32
32
 
33
33
  # --- arg parse ---
34
34
  DRY_RUN=0
@@ -117,9 +117,22 @@ extract_hook_tier() {
117
117
  || true
118
118
  }
119
119
 
120
+ # Normalize `—` YAML escape to literal em-dash character. Closes
121
+ # bassclef-upstream#1548 — YAML frontmatter with double-quoted strings can
122
+ # carry `—` as a 6-char literal; jq preserves it as `\\u2014` in JSON
123
+ # output, which downstream renderers write verbatim into MDX. Adopters see
124
+ # raw `—` on the live site. Normalizing at extraction time lets jq
125
+ # emit the standard `—` JSON escape sequence, which parses cleanly to
126
+ # em-dash at every consumer.
127
+ normalize_em_dash() {
128
+ local val="$1"
129
+ echo "${val//\\u2014/—}"
130
+ }
131
+
120
132
  # Extract description from markdown YAML frontmatter (first line of description: field).
121
133
  extract_yaml_description() {
122
- awk '
134
+ local val
135
+ val=$(awk '
123
136
  /^---$/ { c++; if (c == 2) exit; next }
124
137
  c == 1 && /^description:[[:space:]]/ {
125
138
  sub(/^description:[[:space:]]*/, "")
@@ -130,7 +143,8 @@ extract_yaml_description() {
130
143
  print
131
144
  exit
132
145
  }
133
- ' "$1"
146
+ ' "$1")
147
+ normalize_em_dash "$val"
134
148
  }
135
149
 
136
150
  # Extract a `<field>:` inline YAML list from the frontmatter as a JSON array string.
@@ -183,7 +197,8 @@ extract_yaml_outputs() {
183
197
  # Returns empty string when the field is absent, quoting normalized like
184
198
  # extract_yaml_description does.
185
199
  _extract_yaml_string_field() {
186
- awk -v f="$2" '
200
+ local val
201
+ val=$(awk -v f="$2" '
187
202
  /^---$/ { c++; if (c == 2) exit; next }
188
203
  c == 1 && $0 ~ ("^" f ":[[:space:]]") {
189
204
  sub("^" f ":[[:space:]]*", "")
@@ -194,7 +209,8 @@ _extract_yaml_string_field() {
194
209
  print
195
210
  exit
196
211
  }
197
- ' "$1"
212
+ ' "$1")
213
+ normalize_em_dash "$val"
198
214
  }
199
215
 
200
216
  # Extract `problem:` frontmatter field per bassclef-web#268 + web#265 Stage 1
@@ -0,0 +1,86 @@
1
+ ---
2
+ tier: lite
3
+ id: ADR-NNN
4
+ title: <Short title — present-tense imperative, ≤80 chars>
5
+ status: proposed
6
+ date: <YYYY-MM-DD>
7
+ supersedes: null
8
+ superseded_by: null
9
+ ---
10
+
11
+ # ADR-NNN — <Title>
12
+
13
+ ## Context
14
+
15
+ What is the issue motivating this decision? Describe the forces at play. Include constraints (technical, business, organizational), prior options considered, and what's driving the need for a decision now.
16
+
17
+ Keep this section descriptive, not prescriptive. The reader should understand the situation before encountering the decision.
18
+
19
+ ## Decision
20
+
21
+ What did we decide? State the choice in one or two sentences.
22
+
23
+ Follow with the rationale — why this option, not the alternatives.
24
+
25
+ ## Status
26
+
27
+ `proposed` | `accepted` | `deprecated` | `superseded`
28
+
29
+ Lifecycle:
30
+ - `proposed` — drafted, under review
31
+ - `accepted` — adopted; load-bearing
32
+ - `deprecated` — no longer recommended, but not yet replaced
33
+ - `superseded` — replaced by ADR-MMM (note in `superseded_by` frontmatter)
34
+
35
+ ## Consequences
36
+
37
+ What becomes easier? Harder? More expensive? Cheaper?
38
+
39
+ What follow-on work does this decision enable or block?
40
+
41
+ What invariants does this decision establish? Future decisions must respect them.
42
+
43
+ ## References
44
+
45
+ - Related ADRs: ADR-XXX, ADR-YYY
46
+ - External sources: links to RFCs, blog posts, library docs that informed the decision
47
+ - Source incidents: PRs, chronicles, or tickets that surfaced the need
48
+
49
+ ---
50
+
51
+ ## How to use this template
52
+
53
+ 1. Copy this file to your project's ADR directory:
54
+ - `docs/adrs/ADR-NNN-<slug>.md` (most common)
55
+ - `architecture/decisions/ADR-NNN-<slug>.md` (bassclef's own layout)
56
+ 2. Pick the next sequential ADR number (look at existing files)
57
+ 3. Replace the placeholder content; fill every section
58
+ 4. Set status to `proposed` on draft; flip to `accepted` after operator review
59
+ 5. Touch the marker: `mkdir -p state/markers/adr && touch state/markers/adr/<decision-slug>-ADR-NNN.md`
60
+ 6. Commit alongside the architectural change
61
+
62
+ ## When to write an ADR
63
+
64
+ Per `.claude/rules/adr-discipline.md`, ADRs are required for load-bearing decisions:
65
+
66
+ - Schema changes (ORM schema files, migration creation)
67
+ - Framework or library choice at the platform level (not per-component)
68
+ - Deployment topology changes (orchestrator, region, service-mesh, single-vs-multi-region)
69
+ - Cross-cutting concerns (auth, logging, multi-tenancy, observability stack)
70
+ - Interface boundaries between bounded contexts (per Evans DDD)
71
+ - Deprecating or superseding a prior ADR
72
+
73
+ Skip ADRs for:
74
+ - Routine code changes (bug fixes, feature additions within an existing pattern)
75
+ - Component-level library choices (which icon library, which date-picker)
76
+ - Cosmetic refactors (variable renames, file reorganizations without behavior change)
77
+
78
+ When in doubt, write the ADR. The marginal cost is ten minutes; the value to future you reading "why" is large.
79
+
80
+ ## Refs
81
+
82
+ - Michael Nygard's original ADR proposal: [Documenting Architecture Decisions](https://cognitect.com/blog/2011/11/15/documenting-architecture-decisions)
83
+ - bassclef#1149 — adr-discipline rule + hook
84
+ - `.claude/rules/adr-discipline.md` — the rule that fires
85
+ - `.claude/hooks/adr-discipline-check.sh` — the mechanical check
86
+ - `.claude/rules/blocked-items.md` — BLOCK protocol the hook fires
@@ -0,0 +1,84 @@
1
+ ---
2
+ tier: lite
3
+ description: Stack-specific instantiation of .claude/rules/api-conventions.md for Next.js App Router.
4
+ ---
5
+
6
+ # API Conventions — Next.js App Router
7
+
8
+ Stack-specific instantiation of `.claude/rules/api-conventions.md` for Next.js App Router. Composed under ARCH-T0 #1133 Path A.
9
+
10
+ ## When this sibling fires
11
+
12
+ When adopter's `.claude/bassclef-configs.jsonc` has `tech_stack.frontend: nextjs`. The loader (future ticket) reads this sibling and applies the Next.js-specific guidance below in addition to the universal principles in the parent rule.
13
+
14
+ Until the loader ships, this sibling is discoverable via the cross-reference table in the parent rule.
15
+
16
+ ## File location
17
+
18
+ - API routes live under `src/app/api/`
19
+ - Route handler files: `src/app/api/[resource]/route.ts`
20
+ - Nested resources: `src/app/api/[parent]/[parentId]/[child]/route.ts`
21
+ - Dynamic segments use bracket syntax per Next.js App Router conventions
22
+
23
+ ## Globs (for hook + tooling targeting)
24
+
25
+ - `src/app/api/**/*.ts`
26
+ - `src/app/api/**/*.tsx`
27
+
28
+ These globs scope hooks + linting rules that fire only when the adopter is on Next.js.
29
+
30
+ ## Auth conventions
31
+
32
+ Next.js-specific auth helpers:
33
+
34
+ - Use `getServerSession()` from NextAuth.js (or equivalent for the adopter's auth provider) for session retrieval in route handlers
35
+ - Middleware at `src/middleware.ts` runs before route handlers; use it for auth gating, redirects, tenant resolution
36
+ - API routes that modify data MUST check the session at handler entry; no exceptions
37
+
38
+ ## Validation conventions
39
+
40
+ Recommended Next.js + TypeScript stack pattern:
41
+
42
+ - Use Zod schemas for request body validation
43
+ - Parse + validate at the start of the route handler:
44
+
45
+ ```typescript
46
+ import { z } from "zod";
47
+
48
+ const CreateDealSchema = z.object({
49
+ title: z.string().min(1).max(200),
50
+ amount: z.number().positive(),
51
+ });
52
+
53
+ export async function POST(req: Request) {
54
+ const body = await req.json();
55
+ const parsed = CreateDealSchema.safeParse(body);
56
+ if (!parsed.success) {
57
+ return Response.json(
58
+ { error: { code: "VALIDATION_ERROR", message: "Invalid input", details: parsed.error.issues } },
59
+ { status: 400 }
60
+ );
61
+ }
62
+ // ...
63
+ }
64
+ ```
65
+
66
+ ## Tenant context resolution
67
+
68
+ For multi-tenant Next.js apps:
69
+
70
+ - Tenant context resolved in middleware or at route boundary
71
+ - Passed through to queries via React Server Components context or explicit function arguments
72
+ - Never resolved inside ORM query callbacks (race conditions, leak risk)
73
+
74
+ ## Composition with universal principles
75
+
76
+ Apply the universal principles from `.claude/rules/api-conventions.md` first; the Next.js-specific patterns above add detail without overriding. When the two conflict (e.g., a Next.js convention contradicts the universal route-naming rule), the universal principle wins; file a `/promote` ticket if you believe the convention should be amended.
77
+
78
+ ## Refs
79
+
80
+ - Parent rule: `.claude/rules/api-conventions.md`
81
+ - ARCH-T0 #1133 — operator-stack-leakage audit + remediation
82
+ - bassclef#1309 — this sibling (api-conventions Path A WU-6 of bet 2026-06-20e)
83
+ - bassclef#1150 T18 — sister Path A (migration-discipline)
84
+ - Next.js App Router docs: https://nextjs.org/docs/app/building-your-application/routing/route-handlers
@@ -0,0 +1,209 @@
1
+ ---
2
+ tier: lite
3
+ description: The substrate has three artifact classes that logically compose into a work-decomposition tree.
4
+ ---
5
+
6
+ # Artifact-Composition Standard
7
+
8
+ The substrate has three artifact classes that logically compose into a
9
+ work-decomposition tree. This standard codifies that hierarchy and the
10
+ typed cross-references that make it walkable.
11
+
12
+ ## The composition tree
13
+
14
+ ```
15
+ Roadmap (multi-week, multi-stage strategic frame)
16
+ └── Stage
17
+ └── Iteration goal (scoped commitment, fixed time budget)
18
+ └── Phase
19
+ └── Stack manifest (physical implementation plan)
20
+ └── WS branch → PR → merged
21
+ ```
22
+
23
+ Each level is a separate artifact in a separate directory. The
24
+ relationship between levels is expressed via **typed frontmatter
25
+ fields** — not implicit-by-date-prefix or implicit-by-prose-citation.
26
+
27
+ ## When this standard applies
28
+
29
+ Required for every roadmap, iteration goal, and stack manifest written
30
+ in any sunj-labs repo (bassclef + consumers via bassclef-sync).
31
+
32
+ Optional for older artifacts predating this standard — backfill
33
+ opportunistically when touching them, not as a forcing migration.
34
+
35
+ ## Required + optional cross-references
36
+
37
+ | Artifact class | Location | Required frontmatter | Optional frontmatter |
38
+ |---|---|---|---|
39
+ | Roadmap | `docs/roadmaps/` | — | `bets: [list of paths]` (populated as bets shape) |
40
+ | Iteration goal | `docs/iteration-bets/` | — | `parent_roadmap: <path>`, `stack_manifest: <path>` |
41
+ | Stack manifest | `docs/stacks/` (or `docs/branch-stacks/` — see note) | `bet: <path>` | `parent_roadmap: <path>` (transitive convenience) |
42
+
43
+ **Required** = if the relationship exists, the field MUST be present in
44
+ frontmatter. A bet that descends from a roadmap MUST set
45
+ `parent_roadmap:`. A bet that doesn't descend from any roadmap (small
46
+ one-off bets) doesn't have the field.
47
+
48
+ **Optional** = the field is present when the artifact has a downward
49
+ relationship the parent should know about. A roadmap's `bets:` list
50
+ can be empty until the first goal shapes; populating it is a
51
+ maintenance discipline.
52
+
53
+ ### Note on stack-manifest directory
54
+
55
+ The standard's earlier `standards/project-directory-layout.md` named
56
+ `docs/branch-stacks/` for stack manifests. Actual usage in bassclef
57
+ landed at `docs/stacks/`. Both paths exist in some repos. Consolidation
58
+ is a separate cleanup; this standard accepts either as a valid stack-
59
+ manifest location and points at whichever the artifact resolves to.
60
+
61
+ ## Cross-reference integrity rule
62
+
63
+ **A half-broken cross-reference is a substrate-defect.** Specifically:
64
+
65
+ | Pattern | Signal |
66
+ |---|---|
67
+ | Prose citation present, frontmatter field missing | Substrate-defect — fix the artifact |
68
+ | Frontmatter field present, target path doesn't exist | Substrate-defect — broken link |
69
+ | Frontmatter field present, target's reciprocal field missing | Substrate-defect — one-way reference |
70
+
71
+ Reciprocal-field discipline:
72
+
73
+ - A bet with `parent_roadmap:` SHOULD appear in that roadmap's `bets:`
74
+ list (the parent maintains the index).
75
+ - A bet with `stack_manifest:` MUST point to a stack manifest whose
76
+ `bet:` field points back at this bet.
77
+ - A stack manifest with `parent_roadmap:` SHOULD point to a roadmap
78
+ whose `bets:` list includes the manifest's parent goal.
79
+
80
+ These reciprocal checks are surface-level mechanical: a future
81
+ `/compose` skill (or `/sprint --tree` extension) can validate them
82
+ in one pass. Today they're agent self-discipline at artifact write
83
+ time.
84
+
85
+ ## Why typed, not implicit-by-prose
86
+
87
+ The substrate already had implicit composition by date-prefix
88
+ convention (a roadmap at `2026-04-25-...` is "the parent of" a bet at
89
+ `2026-04-25-...` simply because they share a date). That implicit
90
+ convention failed:
91
+
92
+ - Bets without roadmaps share dates with bets that have them
93
+ - Stack manifests reference bets via prose mention with no parseable
94
+ link
95
+ - New session pickup has to read three directories and infer
96
+ relationships from filenames
97
+
98
+ Typed frontmatter:
99
+
100
+ - Makes the relationship machine-readable (skills can walk the tree)
101
+ - Survives renames (path is explicit, not derived)
102
+ - Self-documents at the artifact level (a reader of any one artifact
103
+ sees its parent + children without external context)
104
+
105
+ ## Walkable lineage
106
+
107
+ Given a typed cross-reference graph, any tool can render the lineage
108
+ from any starting point:
109
+
110
+ ```
111
+ $ /compose docs/iteration-bets/2026-04-25-example-pipeline.md
112
+
113
+ Lineage:
114
+ docs/roadmaps/2026-04-25-example-roadmap.md
115
+ └── docs/iteration-bets/2026-04-25-example-pipeline.md (active, Phase A0)
116
+ └── docs/stacks/2026-04-25-pipeline-stack.md (6 WSes, 1 pr-open)
117
+
118
+ Siblings (other bets descending from same roadmap):
119
+ - (none yet — pipeline is sole child)
120
+ ```
121
+
122
+ The `/compose` skill is a separate /promote (bassclef#275 Part 3,
123
+ deferred from this WS). Until it ships, agents walk the lineage
124
+ manually by reading frontmatter — but the discipline is the same.
125
+
126
+ ## Anti-patterns
127
+
128
+ **Don't substitute prose for frontmatter fields.** "This bet descends
129
+ from a historical example roadmap" in the body is not a substitute for
130
+ `parent_roadmap: docs/roadmaps/...` in the frontmatter. Prose is for
131
+ narrative; frontmatter is for the machine-readable graph.
132
+
133
+ **Don't forget reciprocal updates.** When you set `stack_manifest:` on
134
+ a bet, also update the stack manifest's `bet:` field if it doesn't
135
+ already point back. One-way edges silently break the walkable lineage.
136
+
137
+ **Don't backfill mass migrations.** Older artifacts predating this
138
+ standard don't need a forcing PR. Backfill opportunistically when you
139
+ touch them. The cost of mass backfill (large diff, no behavior change)
140
+ exceeds the value of consistency-now.
141
+
142
+ **Don't add fields not in the table above.** If a new relationship
143
+ shape emerges (e.g., a bet that supersedes a prior bet), propose
144
+ extending this standard before adding ad-hoc frontmatter fields.
145
+ Schema discipline matters because tools will eventually parse this.
146
+
147
+ ## Composition with other standards
148
+
149
+ - `standards/project-directory-layout.md` — defines WHERE artifacts
150
+ go; this standard defines HOW they reference each other. Pair, not
151
+ replace.
152
+ - `standards/branch-stacking.md` — stack-manifest content discipline;
153
+ this standard adds the `bet:` and `parent_roadmap:` cross-refs.
154
+ - `standards/session-board.md` — session-board references active bets
155
+ by path in its `active_bets:` frontmatter; that's another typed
156
+ cross-ref pattern (session → bets), but the session-board owns the
157
+ schema for that one.
158
+ - `.claude/rules/artifact-ingestion.md` — "Sources read" block is the
159
+ ingestion pattern at write time; cross-refs are the persistent graph
160
+ the ingestion block samples from.
161
+
162
+ ## Enforcement
163
+
164
+ Methodology-level today. Future mechanical enforcement:
165
+
166
+ 1. `/compose` skill validates reciprocal references and surfaces
167
+ half-broken edges.
168
+ 2. `/sprint` extension renders the lineage tree as an orientation aid
169
+ at session start.
170
+ 3. A hook on PR creation could grep the touched bet/manifest/roadmap
171
+ files for required-field presence and flag missing cross-refs.
172
+
173
+ Until those exist, the discipline is agent self-check at artifact
174
+ write time. The "Sources read" block in any new artifact is the
175
+ natural moment to verify cross-refs resolve — both directions.
176
+
177
+ ## Override
178
+
179
+ There is no override. Cross-references are either typed in frontmatter
180
+ or they don't exist. Prose-only references don't count toward the
181
+ graph and a future tooling pass will flag them.
182
+
183
+ If a relationship genuinely doesn't exist (e.g., a one-off bet with no
184
+ parent roadmap), don't fabricate one. Omit the field entirely. Empty
185
+ fields are not the same as missing relationships — only set a field
186
+ when the relationship it expresses is real.
187
+
188
+ ## Retirement condition
189
+
190
+ This standard retires when (a) all bassclef and consumer-repo
191
+ roadmap/bet/stack artifacts conform AND (b) the `/compose` skill is
192
+ shipped and validated AND (c) cross-ref drift hasn't surfaced as an
193
+ operator-visible defect for ≥6 months.
194
+
195
+ Until then, it's load-bearing for any session that writes or modifies
196
+ an artifact in any of the three classes.
197
+
198
+ ## Relationship to other standards/rules
199
+
200
+ - `standards/project-directory-layout.md` — directory destinations
201
+ (where) paired with this standard's relationships (how)
202
+ - `standards/branch-stacking.md` — stack-manifest internal schema;
203
+ this standard adds the upward cross-refs
204
+ - `standards/session-board.md` — session-level coordinator; references
205
+ bets by path (sibling cross-ref pattern)
206
+ - `.claude/rules/artifact-ingestion.md` — write-time discipline that
207
+ surfaces cross-ref work
208
+ - bassclef#275 — promotion issue this standard partially closes
209
+ (Part 1; the dir mv is WS-A0-4, the `/compose` skill is deferred)