Skip to content

Delegate fledge spec check to the real specsync binary for CI parity#424

Merged
0xLeif merged 1 commit into
mainfrom
feat/spec-check-delegate-specsync
Jun 23, 2026
Merged

Delegate fledge spec check to the real specsync binary for CI parity#424
0xLeif merged 1 commit into
mainfrom
feat/spec-check-delegate-specsync

Conversation

@0xLeif

@0xLeif 0xLeif commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

fledge spec check only validated spec structure (frontmatter, required sections, files exist). CI runs CorvidLabs/spec-sync, which additionally parses each governed source file's public exports and fails when they drift from the spec's Public API tables. The two checkers were orthogonal β€” a spec could pass fledge spec check locally yet fail spec-sync in CI (the green-locally/red-in-CI trap).

This closes the gap by construction: when the specsync binary is on PATH, spec check shells out to it (the same binary CI runs), so a local pass guarantees a CI pass. When absent, it falls back to today's structural check with an install hint.

Rather than re-implement spec-sync's ~3.7k-LOC, per-language export-AST layer inside fledge (which would just create a second checker that drifts from upstream), we delegate to the real, separately-versioned tool.

Changes

  • src/spec/engine.rs (new) β€” find_specsync (PATH lookup) + try_check_via_specsync. Invokes specsync check --force --format json --root <root> (+--strict), parses the {passed, errors, warnings, stale, specs_checked} report, renders fledge-style. --force mirrors the CI action so results match a fresh run, not the local hash cache.
  • src/spec/commands.rs β€” delegation runs first; structural fallback + cargo install specsync hint when absent. JSON output gains an engine field ("specsync" | "structural").
  • src/spec/mod.rs β€” registers the module.
  • specs/spec/spec.spec.md β†’ v12, documenting the new engine module.

Behavior

State fledge spec check
specsync on PATH Delegates β†’ identical to CI (export-coverage validation)
specsync absent Structural check (as before) + install hint

Note: delegation runs whatever specsync is installed. CI currently pins v4.3.2; for byte-identical parity, contributors should install the pinned version.

Test Plan

  • Built specsync v4.5.0 from source; fledge spec check --strict through it reports 0 errors / 0 warnings / exit 0 against this repo (engine=specsync)
  • Stub-binary tests confirm exact arg forwarding (check --force --format json --root … [--strict]), non-zero exit on findings, both render branches
  • Fallback path (no specsync) unchanged; emits install hint
  • New unit tests for report parsing (full + minimal) and rendering
  • cargo test, cargo clippy -- -D warnings, cargo fmt --check all pass

Dogfooding catch: the real specsync immediately flagged that adding pub(crate) mod engine introduced an undocumented export that would have failed CI under strict β€” exactly the trap this PR eliminates. It's documented in spec.spec.md v12, which is why the check is clean.

πŸ€– Generated with Claude Code

@0xLeif 0xLeif requested a review from a team as a code owner June 23, 2026 23:06
@0xLeif 0xLeif requested review from 0xGaspar, Kyntrin and tofu-ux June 23, 2026 23:06
…parity

fledge's built-in `spec check` only validated spec *structure* (frontmatter,
required sections, files exist). CI runs `CorvidLabs/spec-sync`, which also
parses each governed source file's public exports and fails when they drift
from the spec's Public API tables. The two checkers were orthogonal, so a spec
could pass `fledge spec check` locally yet fail spec-sync in CI.

When the `specsync` binary is on PATH, `spec check` now shells out to it
(`specsync check --force --format json --root <root>`, plus `--strict`),
guaranteeing identical results to CI by construction, and renders the findings
in fledge's style. When absent, it falls back to the structural check with a
`cargo install specsync` hint. JSON output gains an `engine` field
("specsync" | "structural").

- src/spec/engine.rs (new): find_specsync + try_check_via_specsync, with tests
- src/spec/commands.rs: delegate first, structural fallback + hint, engine field
- src/spec/mod.rs: register engine module
- specs/spec/spec.spec.md: v12, document the new engine module

Verified against specsync v4.5.0 built from source: `spec check --strict`
reports 0 errors / 0 warnings / exit 0 against this repo.

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request retires the standalone fledge site by replacing all pages and the RSS feed with redirects to the CorvidLabs hub, and updates the CLI's spec check command to delegate to the real specsync binary when available. Feedback on these changes suggests passing the root path as an OsString to avoid lossy UTF-8 conversions when executing specsync, and returning a valid XML feed instead of HTML for rss.xml to prevent content-type parsing errors in RSS readers on static hosts like GitHub Pages.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/spec/engine.rs
Comment thread site/src/pages/rss.xml.ts
@0xLeif 0xLeif force-pushed the feat/spec-check-delegate-specsync branch from 3ff48d6 to 650ae57 Compare June 23, 2026 23:08

@Kyntrin Kyntrin 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.

I trust Leif, LGTHIM!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

βœ… Corvin says...

      _
    <(^\  .oO(Caw! ^v^)
     |/(\
      \(\\
      " "\\

"Looking sharp! Like a beak should be."

CI Summary

Check Status
Dependency Audit βœ… Passed
Integration (3 OS) βœ… Passed
Lint (fmt + clippy) βœ… Passed
Spec Validation βœ… Passed
Tests (3 OS) βœ… Passed

Powered by corvid-pet

@0xLeif 0xLeif merged commit 9d228be into main Jun 23, 2026
13 checks passed
@0xLeif 0xLeif deleted the feat/spec-check-delegate-specsync branch June 23, 2026 23:36
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.

2 participants