Skip to content

feat(spec): size demoable units to a review-sized floor (ADR 0026)#273

Merged
norrietaylor merged 2 commits into
mainfrom
feat/272-larger-units
Jun 16, 2026
Merged

feat(spec): size demoable units to a review-sized floor (ADR 0026)#273
norrietaylor merged 2 commits into
mainfrom
feat/272-larger-units

Conversation

@norrietaylor

Copy link
Copy Markdown
Owner

Implements Levers 1 and 3 of #272 — the spec/config-level batch that produces fewer, larger sub-issues. Levers 2 and 4 stay as sequenced follow-ups per that issue (Lever 2 touches the Feature→Unit→task walkers; Lever 4 needs its own ADR).

Problem

sdd-spec had no lower bound on demoable-unit size — step 5 said only "split as the work naturally falls" — so units landed at ~100 net lines where an engineer's natural PR is ~500. Sub-issue count is 2 + N Units + M tasks; small units inflate N directly and M downstream (sdd-triage decomposes per unit). ADR 0022 only folded tasks within a Unit, a layer below where the over-decomposition originates.

Lever 1 — unit lower bound in sdd-spec

  • step 5: a ~400 net-line demoable-unit target + a unit-cohesion rule symmetric to ADR 0022's task rule — fold two prospective units when their implementation file sets overlap, or they form a strict produce→consume chain, unless a dependency edge to a third unit forces them apart.
  • SDD_SPEC_MIN_UNIT floor (default 400), wired through a min_unit workflow_call input exactly as SDD_TRIAGE_MIN_TASK flows today: wrappers/sdd-spec.yml maps vars.SDD_SPEC_MIN_UNIT → the prompt reads ${{ inputs.min_unit }}; blank → 400, 0 disables.
  • spec gate 5 (shared/sdd-gates.md): an under-sized unit is a Warning (advisory), symmetric to triage gate 5.

Lever 3 — retune the task floor

SDD_TRIAGE_MIN_TASK default raised 300 → 400 so the unit grain and task grain target the same review size. ADR 0022 carries a forward-link amendment note; its cohesion mechanism is unchanged.

Files

  • .github/workflows/sdd-spec.mdmin_unit input + step-5 sizing block
  • .github/workflows/sdd-triage.md — task-floor fallback 300 → 400
  • wrappers/sdd-spec.yml — map vars.SDD_SPEC_MIN_UNITmin_unit
  • shared/sdd-gates.md — spec gate 5
  • decisions/0026-demoable-unit-sizing.md — new ADR
  • decisions/0022-triage-task-sizing.md — forward-link amendment note
  • docs/sdd/install.mdSDD_SPEC_MIN_UNIT row + retuned default
  • .github/workflows/sdd-spec.lock.yml, sdd-triage.lock.yml — recompiled (gh-aw v0.77.5)

Lock note

sdd-validate.lock.yml is intentionally not in this PR. It imports shared/sdd-gates.md@main, so a PR-branch compile resolves the pre-gate-5 remote fragment and produces no drift (the lint compile check passes). Gate 5 lands in that lock post-merge when recompile-locks regenerates it from the merged @main fragment.

Acceptance

  • gh aw compile → 0 errors, 0 warnings; lint lock-drift check passes (only sdd-spec/sdd-triage locks change, both committed)
  • sdd-spec step 5 states the ~400 target + cohesion rule; min_unit flows wrapper → input → prompt; blank → 400, 0 disables
  • SDD_TRIAGE_MIN_TASK default is 400 in prompt, ADR, and install docs
  • A ~400-line feature specifies as one demoable unit, not three or four

Scope

Addresses N (unit count) and the task floor. The structural M reduction — collapsing the single-task Unit grouping sub-issue — is Lever 2 in #272, deferred because it touches sdd-execute, sdd-cycle-detect, and sdd-validate gate 1.

Closes none — #272 stays open for Levers 2 and 4.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 383d49c0-35ac-4b51-bfef-69181c803dc2

📥 Commits

Reviewing files that changed from the base of the PR and between 4120736 and 31e5a9b.

📒 Files selected for processing (4)
  • .github/workflows/sdd-spec.lock.yml
  • .github/workflows/sdd-spec.md
  • .github/workflows/sdd-triage.lock.yml
  • .github/workflows/sdd-triage.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/sdd-triage.md
  • .github/workflows/sdd-spec.md

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added SDD_SPEC_MIN_UNIT / min_unit to set the demoable unit sizing floor (default: 400 lines; 0 disables unit bundling).
    • Added an advisory “spec boundary” gate rule for under-sized units.
  • Documentation

    • Updated guidance to align unit/task sizing on ~400 net-changed lines, including ADR updates.
  • Chores

    • Updated reusable workflow inputs and configuration wiring, adjusted min_task blank fallback to 400, and refreshed related generated workflow artifacts and log ignores.

Walkthrough

Introduces a new min_unit workflow input for sdd-spec (wired from SDD_SPEC_MIN_UNIT, defaulting to 400, with 0 disabling bundling), compiles it into sdd-spec.lock.yml with prompt sizing instructions, raises sdd-triage's min_task blank-fallback from 300 to 400, and adds ADR 0026 with supporting gate, docs, and .gitignore updates.

Changes

Demoable-unit sizing floor

Layer / File(s) Summary
ADR 0026, amended ADR 0022, gates, install docs, .gitignore
decisions/0026-demoable-unit-sizing.md, decisions/0022-triage-task-sizing.md, shared/sdd-gates.md, docs/sdd/install.md, .gitignore
New ADR 0026 defines the ~400-line demoable-unit target, cohesion-folding rule, and SDD_SPEC_MIN_UNIT semantics. ADR 0022 is amended raising SDD_TRIAGE_MIN_TASK default. shared/sdd-gates.md adds the advisory gate-5 under-size Warning rule. docs/sdd/install.md adds SDD_SPEC_MIN_UNIT and updates SDD_TRIAGE_MIN_TASK/SDD_AGILE_MAX defaults. .gitignore excludes gh-aw audit log artifacts.
sdd-spec workflow source: min_unit input, authoring procedure, wrapper wiring
.github/workflows/sdd-spec.md, wrappers/sdd-spec.yml
sdd-spec.md declares the min_unit workflow_call input and expands the demoable-unit procedure with the ~400-line target and soft tie-breaker folding rule. wrappers/sdd-spec.yml maps vars.SDD_SPEC_MIN_UNIT into min_unit.
sdd-spec.lock.yml compiled: input, env wiring, prompt text, regenerated heredocs
.github/workflows/sdd-spec.lock.yml
Compiled lock file adds min_unit to the workflow_call interface, exports GH_AW_INPUTS_MIN_UNIT through prompt creation and placeholder-substitution steps, rewrites the embedded unit-sizing instructions in the agent prompt, and regenerates heredoc sentinels for safe-outputs config and MCP gateway config blocks.
sdd-triage: min_task default 300→400 in source and compiled lock
.github/workflows/sdd-triage.md, .github/workflows/sdd-triage.lock.yml
sdd-triage.md updates the min_task blank-fallback documentation from 300 to 400. The compiled lock updates the min_task instruction text and regenerates metadata hashes and heredoc sentinels for the prompt assembly, safe-outputs config, and MCP gateway config blocks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

  • norrietaylor/spectacles#253: Both PRs modify sdd-triage prompt inputs and bundling-floor semantics around min_task/GH_AW_INPUTS_MIN_TASK, with the current PR further raising the blank-fallback default from 300 to 400 and recompiling the lock.
  • norrietaylor/spectacles#16: Both PRs extend the sdd-spec reusable workflow interface and regenerate its compiled prompt/config artifacts, with this PR adding the min_unit input for demoable-unit sizing control.

Poem

🐇 Hoppity-hop through the spec-land floor,
Four hundred lines, not a smidge less — no more!
min_unit blooms where tiny units dwell,
Folding wee slices together, oh well.
The triage bunny nods: 400's the way,
Review-sized PRs hop merrily today! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: implementing feature ADR 0026 to establish a ~400 net-line demoable-unit sizing floor (Lever 1), with specific reference to the decision architecture record.
Description check ✅ Passed The description comprehensively details Levers 1 and 3 of issue #272, explains the problem context, documents all modified files with their purposes, and clarifies scope/deferral of other levers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/272-larger-units

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
decisions/0022-triage-task-sizing.md (1)

51-61: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Bring ADR 0022’s default up to 400 everywhere.

The amendment note says 400, but these sections still document SDD_TRIAGE_MIN_TASK as 300. That leaves the ADR internally contradictory and out of sync with the updated sizing docs.

♻️ Proposed fix
- (default `300`)
+ (default `400`)
...
- passes empty and the agent falls back to 300.
+ passes empty and the agent falls back to 400.
...
- `docs/sdd/install.md` documents `SDD_TRIAGE_MIN_TASK` (default `300`).
+ `docs/sdd/install.md` documents `SDD_TRIAGE_MIN_TASK` (default `400`).
...
- bundles at the 300-line default
+ bundles at the 400-line default

Also applies to: 88-101

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@decisions/0022-triage-task-sizing.md` around lines 51 - 61, The ADR 0022
document has an internal inconsistency where the default value for
SDD_TRIAGE_MIN_TASK is documented as 300 in multiple locations, but the
amendment note specifies it should be 400. Update all references to the
SDD_TRIAGE_MIN_TASK default value in the document from 300 to 400. This includes
the explanation at decisions/0022-triage-task-sizing.md lines 51-61 (anchor
location) and the related section at lines 88-101 (sibling location) to ensure
the ADR is internally consistent and aligned with the updated sizing
documentation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@decisions/0022-triage-task-sizing.md`:
- Around line 51-61: The ADR 0022 document has an internal inconsistency where
the default value for SDD_TRIAGE_MIN_TASK is documented as 300 in multiple
locations, but the amendment note specifies it should be 400. Update all
references to the SDD_TRIAGE_MIN_TASK default value in the document from 300 to
400. This includes the explanation at decisions/0022-triage-task-sizing.md lines
51-61 (anchor location) and the related section at lines 88-101 (sibling
location) to ensure the ADR is internally consistent and aligned with the
updated sizing documentation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 09593850-3e96-43f3-ae8b-4f80a1d284fa

📥 Commits

Reviewing files that changed from the base of the PR and between cc708a4 and 952e4c2.

📒 Files selected for processing (10)
  • .github/workflows/sdd-spec.lock.yml
  • .github/workflows/sdd-spec.md
  • .github/workflows/sdd-triage.lock.yml
  • .github/workflows/sdd-triage.md
  • .gitignore
  • decisions/0022-triage-task-sizing.md
  • decisions/0026-demoable-unit-sizing.md
  • docs/sdd/install.md
  • shared/sdd-gates.md
  • wrappers/sdd-spec.yml

Implements Levers 1 and 3 of #272 — the spec/config-level batch to produce
fewer, larger sub-issues. Lever 2 (collapse single-task Units) and Lever 4
(soften fastpath gates) stay as sequenced follow-ups.

Lever 1 — unit lower bound in sdd-spec:
- step 5 states a ~400 net-line demoable-unit target and a unit-cohesion rule
  symmetric to ADR 0022's task rule (fold two prospective units when their
  implementation file sets overlap or they form a produce/consume chain, unless
  a dependency forces them apart)
- new SDD_SPEC_MIN_UNIT floor (default 400), wired through a min_unit
  workflow_call input on the spec lock; the sdd-spec wrapper maps
  vars.SDD_SPEC_MIN_UNIT, the prompt reads inputs.min_unit; blank -> 400,
  0 disables
- spec gate 5 in shared/sdd-gates.md flags an under-sized unit as a Warning
  (advisory), symmetric to triage gate 5

Lever 3 — retune the task floor:
- SDD_TRIAGE_MIN_TASK default raised 300 -> 400 so the unit grain and task grain
  target the same review size; ADR 0022 carries a forward-link amendment note

New ADR 0026 documents both. docs/sdd/install.md gains the SDD_SPEC_MIN_UNIT
row and the retuned default.

sdd-spec and sdd-triage locks recompiled (gh-aw v0.77.5). sdd-validate.lock is
unchanged here: it imports shared/sdd-gates.md@main, so gate 5 lands in that
lock post-merge via recompile-locks. Root cause and full lever analysis: #272.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@norrietaylor norrietaylor force-pushed the feat/272-larger-units branch from 952e4c2 to 4120736 Compare June 15, 2026 23:15
# Conflicts:
#	.github/workflows/sdd-spec.lock.yml
#	.github/workflows/sdd-triage.lock.yml
@norrietaylor norrietaylor merged commit 24c9d10 into main Jun 16, 2026
12 checks passed
@norrietaylor norrietaylor deleted the feat/272-larger-units branch June 16, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant