ASDD Wave 2: reconciler diff engine, decision promotion, docs cross-link#6
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 2 of the ASDD core implementation. Three beads closed.
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.internal/spec/promote/+gemba spec promote. Discoversbd mailitems labeledspec-decision:<slug>, generates a unified diff appending### D-NN <title>under## Decisions. Never mutates the spec in place — operator applies viagit apply(git is the journal).docs/design/asdd-whitepaper.md.Test plan
go build ./...cleango test ./internal/spec/... ./internal/cli/...— 380 tests pass across 14 packagesgemba spec diff <spec.md>renders table +--jsonoutputgemba spec promote <spec.md> --mail-id <id>prints diff to stdoutgemba spec promote ... --applyrefuses (manualgit applyonly)Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com