Skip to content

ASDD Wave 2: reconciler diff engine, decision promotion, docs cross-link#6

Merged
MikeBengtson merged 6 commits into
mainfrom
feat/asdd-wave-2
May 13, 2026
Merged

ASDD Wave 2: reconciler diff engine, decision promotion, docs cross-link#6
MikeBengtson merged 6 commits into
mainfrom
feat/asdd-wave-2

Conversation

@MikeBengtson
Copy link
Copy Markdown
Collaborator

Summary

Wave 2 of the ASDD core implementation. Three beads closed.

  • gm-v0sp.5 — Reconciler diff engine (pure planner). internal/spec/reconcile/ + gemba spec diff. Field-level ownership: spec owns title/type/parent/priority; bead-owned fields (status/assignee/notes) surface as informational drift but apply will ignore them. Orphan detection via lockfile mapping (never auto-prune). Nonce-stale propagation. Idempotence property test.
  • gm-v0sp.10 — Decision promotion. internal/spec/promote/ + gemba spec promote. Discovers bd mail items labeled spec-decision:<slug>, generates a unified diff appending ### D-NN <title> under ## Decisions. Never mutates the spec in place — operator applies via git apply (git is the journal).
  • gm-v0sp.14 — README + constitution template cross-link to docs/design/asdd-whitepaper.md.

Test plan

  • go build ./... clean
  • go test ./internal/spec/... ./internal/cli/... — 380 tests pass across 14 packages
  • gemba spec diff <spec.md> renders table + --json output
  • gemba spec promote <spec.md> --mail-id <id> prints diff to stdout
  • gemba spec promote ... --apply refuses (manual git apply only)

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

MikeBengtson and others added 6 commits May 13, 2026 05:14
Add a "Spec-driven development (ASDD)" section to README pointing at
docs/design/asdd-whitepaper.md as the canonical reference, with bullets
for gemba spec new/lint/diff/snapshot/analyze and a note on the Spec Kit
interception layer. Add a single-line whitepaper reference comment to
the constitution template so generated constitutions cross-link back.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- internal/spec/promote/: Discover (MailLister iface + bd shell), Propose
  produces a minimal unified diff appending a `### D-NN <title>` block
  under `## Decisions`. Auto-numbers D-NN as max(existing)+1, zero-padded.
- internal/cli/spec_promote.go: gemba spec promote <spec.md>
  * no args -> list candidates
  * --mail-id -> print diff to stdout
  * --mail-id --edit -> write diff to temp file, open $EDITOR (fallback vi)
  * --mail-id --apply -> refuse: apply is manual, pipe to `git apply`
- Round-trip test applies the diff and re-parses the spec cleanly.
- Zero in-place mutation; git is the journal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pure planner for the ASDD interception layer. Diffs a parsed spec.md
against the current bd bead set and the .spec.lock.json mapping, emitting
sorted Create/Update/Orphan operations with field-level diffs and a
versioned JSON schema ($schema = gemba.reconcile.v1).

Field ownership:
  spec owns Title, Type, Parent, Priority, in-spec edges
  bead owns Status, Assignee — surfaced as Informational diffs only

Nonce-stale detection: when lock.Nonce != spec.Nonce the Plan and every
Op carry NonceStale = true. The apply step (gm-v0sp.6) will refuse to
act under those conditions.

Includes a BeadLister interface (default shells out to `bd list --json`,
StaticBeadLister for tests/CLI --bd-stub) and an idempotence property
test: applying every Create/Update from a Plan into the existing set
and re-Diffing produces an empty Plan.

CLI: `gemba spec diff <spec.md>` — read-only, human table by default,
--json for machine consumers, --bd-stub <file> for tests.

No bd mutations, no disk writes, no network. Apply is the next bead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MikeBengtson MikeBengtson merged commit d4d8958 into main May 13, 2026
3 of 6 checks passed
@MikeBengtson MikeBengtson deleted the feat/asdd-wave-2 branch May 13, 2026 11:00
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