feat: lakebase-feature-status bin + MCP tool (FEIP-7215)#47
Open
kevin-hartman wants to merge 2 commits into
Open
feat: lakebase-feature-status bin + MCP tool (FEIP-7215)#47kevin-hartman wants to merge 2 commits into
kevin-hartman wants to merge 2 commits into
Conversation
New substrate primitive that renders a one-screen snapshot of a feature's TDD workflow state: phase, gate approvals, plan summary, test-list completion, experiment table, recent decisions, and open smells. Both human-readable (default) and machine-readable (`--json`) modes. What's new - `scripts/tdd/feature-status.ts`: aggregator module that reads `plan.json`, `test-list.json`, each `experiments/*/outcomes.json` + `timeline.json`, `workflow-state.json`, `selection-log.md`, and `smells.json`, and returns a `FeatureStatusSnapshot`. - `scripts/tdd/feature-status.cli.ts`: thin CLI wrapper. Registered as the `lakebase-feature-status` bin in package.json. - `tests/bdd/tdd-feature-status.test.ts`: 11 tests covering behavior on N=1 fixtures, partial-state fallbacks, and the stable JSON schema shape (top-level + nested key sets). - `skills/lakebase-tdd-workflows/references/feature-status-schema.md`: the schema contract. Append-only key sets, no field-type changes without a deliberate review (enforced by the BDD shape assertions). - README + SKILL cheat sheets gain a `lakebase-feature-status` row. Collateral fix The kit's `scripts/tdd/test-list.ts` and `scripts/tdd/spec-sync.ts` carried inline `require.main === module` entrypoint shims that worked under tsx but crashed when tsup bundled them into an ESM CLI output (`module is not defined in ES module scope`). Surfaced as soon as feature-status.cli.ts imported the same module chain. Fixed by extracting both shims into proper `.cli.ts` wrappers, matching the existing `get-connection.cli.ts` pattern. Module files now export functions only; entry points live in dedicated files. tsup config gains two entries; README + SKILL cheat sheets repointed at the new `.cli.js` paths. Tests - 11/11 tests in tests/bdd/tdd-feature-status.test.ts - 85/85 in the tdd BDD subset (12 files), no regressions - 351/351 in the full vitest suite, 44 pre-existing skipped, 0 failures Co-authored-by: Isaac
…5 slices 3 + 4) Exposes the feature-status primitive over the MCP wire protocol, and proves the existing module + renderer handle parallel-experiment races without special casing. Slice 3 — MCP tool exposure - apps/mcp-server/tools.ts: new `lakebase_feature_status` tool. Schema requires `featureId`, accepts optional `tddDir` (defaults `./.tdd`). Handler delegates to the real `getFeatureStatus()` module (filesystem read; no network calls). - tests/mcp-server/tools.test.ts: name added to the registry expectation; schema-shape assertion mirrors the existing per-tool pattern. - tests/mcp-server/handshake.test.ts: wire-protocol expected list updated. - tests/mcp-server/tools-feature-status.test.ts (new): 4 real-fs handler tests staging an actual .tdd/ tree via mkdtempSync. No mocks — the underlying primitive is pure-filesystem and benefits from the end-to-end exercise. Slice 4 — N>=2 race coverage - tests/bdd/tdd-feature-status.test.ts: 3 new tests staging an N=2 fixture with `exp-postgres-arrays` (succeeded, 3 cycles) and `exp-json-blob` (running, 2 cycles). Asserts the snapshot returns one entry per experiment, renderer lists both rows with status + branch + tests + cycles, and JSON payload keeps the documented shape under the multi-experiment case. - references/feature-status-schema.md: short paragraph clarifying that the payload shape doesn't branch on `plan.mode`. Cross- experiment comparison rendering (promote-vs-synthesize decision aid) is intentionally out of scope here — that lives in FEIP-7208. Tests - 14/14 in tests/bdd/tdd-feature-status.test.ts - 4/4 in tests/mcp-server/tools-feature-status.test.ts - 13/13 in tests/mcp-server/tools.test.ts (regression check) - 1/1 in tests/mcp-server/handshake.test.ts (wire protocol) - 366/366 across the full vitest suite, 44 pre-existing skipped, 0 failures Co-authored-by: Isaac
This was referenced May 28, 2026
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
lakebase-feature-statussubstrate primitive: one-screen snapshot of a feature's TDD workflow state (phase, plan, test-list completion, experiment table, recent decisions, open smells). Both human-readable (default) and machine-readable (--json) modes, plus an MCP tool wrapper.skills/lakebase-tdd-workflows/references/feature-status-schema.md. Shape stability is asserted by BDD tests so any future field rename/removal is a deliberate review gate.require.main === moduleCLI shims fromscripts/tdd/test-list.tsandspec-sync.tsinto proper.cli.tswrappers (matching the existingget-connection.cli.tsconvention). The inline shims crashed when tsup bundled them into an ESM output; surfaced as soon as a new CLI imported those modules.What's new
scripts/tdd/feature-status.ts— aggregator module readingplan.json,test-list.json, per-experimentoutcomes.json+timeline.json,workflow-state.json,selection-log.md,smells.json.scripts/tdd/feature-status.cli.ts—lakebase-feature-statusbin.apps/mcp-server/tools.ts—lakebase_feature_statusMCP tool. Schema requiresfeatureId, accepts optionaltddDir(defaults./.tdd).tests/bdd/tdd-feature-status.test.ts— 14 tests covering N=1 behavior, partial-state fallbacks, JSON schema shape stability, and N≥2 race rendering.tests/mcp-server/tools-feature-status.test.ts— 4 real-filesystem MCP handler tests (no mocks; the underlying primitive is pure-filesystem and benefits from end-to-end exercise).skills/lakebase-tdd-workflows/references/feature-status-schema.md— stable payload contract.lakebase-feature-statusrow; pre-existing rows repointed at the new.cli.jspaths.Test plan
npm run typecheckcleannpx vitest run tests/bdd/tdd-feature-status.test.ts— 14/14npx vitest run tests/mcp-server/tools-feature-status.test.ts— 4/4npx vitest run tests/mcp-server/tools.test.ts— 13/13 (regression: registry assertion grew by one)npx vitest run tests/mcp-server/handshake.test.ts— 1/1 (wire-protocol expected list updated)npm test(full suite) — 366 passed, 44 pre-existing skipped, 0 failednpm run build— cleanlakebase-feature-status F1-checkout --tdd <synthetic-fixture>renders the one-screen snapshot--jsonemits the documented payloadSlice breakdown (FEIP-7215)
--jsonmode + stable schema doc + schema-shape BDDThis pull request and its description were written by Isaac.