Skip to content

Scaffold Cargo workspace with ADR enforcement#1

Merged
Brad-Edwards merged 2 commits intomainfrom
feat/project-scaffolding
Apr 12, 2026
Merged

Scaffold Cargo workspace with ADR enforcement#1
Brad-Edwards merged 2 commits intomainfrom
feat/project-scaffolding

Conversation

@Brad-Edwards
Copy link
Copy Markdown
Contributor

Summary

First capcom work order step (project scaffolding). Sets up the Cargo workspace, Rust toolchain, ADR enforcement, CI, and pre-commit hooks so subsequent work order steps have a building/testing/linting project to add code to. Mirrors aphelion's scaffolding pattern adapted for Rust.

What's in the PR

Cargo workspace (new):

  • Cargo.toml — workspace manifest (resolver 2, edition 2024, Rust 1.85+, MIT, workspace lints)
  • crates/capcom/ — library crate with placeholder version() and one passing unit test
  • crates/capcom-engine/ — binary crate, entry point for the future co-located out-of-process engine node (ADR-012)
  • rust-toolchain.toml — stable channel, rustfmt + clippy components, minimal profile
  • rustfmt.toml — edition 2024

ADR enforcement (new):

  • scripts/check-adr-conformance.sh — grep-based check for banned engines (ADR-001: MillenniumDB, Graphflow) and distributed primitives (ADR-003/005/009) over Rust source and Cargo.toml. Works in both pre-commit and CI modes with line-level // adr-override: ADR-NNN escapes.
  • .claude/hooks/adr-boundary-check.sh — same checks as a Claude Code PreToolUse hook on Edit/Write.
  • .claude/settings.json updated to register the new hook alongside protect_files.sh.

CI pipeline (replacing TODO placeholders in .github/workflows/ci.yml):

  • adr-conformance job — runs the conformance script
  • lint job — cargo fmt --all --check + cargo clippy --workspace --all-targets -- -D warnings
  • test job — cargo build --workspace --all-targets + cargo test --workspace --all-targets
  • All third-party actions pinned to commit SHAs.

Pre-commit additions to .pre-commit-config.yaml:

  • Stage 3: cargo fmt --all --check
  • Stage 4: scripts/check-adr-conformance.sh
  • Clippy and full tests deliberately left out of pre-commit (too slow for fail-fast); CI handles them.

Docs / config:

  • README.md — replaces "Project Name" placeholder with build/test/run commands, layout, and architectural constraints summary
  • .gitignore — adds Rust entries (target/, *.pdb)
  • .editorconfig — adds [*.rs] and [*.toml] sections
  • CHANGELOG.md — new 0.2.0 entry

Also carried along (uncommitted working-tree state from the earlier Ground Control workflow migration):

  • .ground-control.yaml — now populated with real cargo workflow commands (was commented-out placeholders)
  • AGENTS.md, CLAUDE.md, .mcp.json — Ground Control Context pointers updated
  • Deleted .claude/skills/{implement,ship,stage,review-tests,gh-workflow-monitor}/ — workflow skills now live at user level (~/.claude/skills/) per the skill centralization work tracked in Ground Control as GC-O008 / ADR-023
  • Previous 0.1.0 CHANGELOG entry (Ground Control migration)

What's NOT in the PR

  • No actual kernel code. lib.rs has only version(). main.rs prints a placeholder.
  • No storage, data model, transactions, query execution, schema, or indexes. Those are the next work order step.
  • No IPC / boundary contract implementation. Aphelion work order step 4.
  • No local ADR document copies. capcom enforces aphelion's ADR numbers by pattern; it doesn't keep its own docs/adrs/ copies. Can be added later if wanted.

Verification (all pass locally)

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo build --workspace --all-targets
  • cargo test --workspace --all-targets (1 test: capcom::tests::version_is_non_empty)
  • scripts/check-adr-conformance.sh
  • gc_get_repo_ground_control_context returns status: ok with full workflow block populated
  • CI green on this PR

Test plan

  • CI adr-conformance job passes
  • CI lint job passes (fmt + clippy on the workspace)
  • CI test job passes (build + test)

Cargo workspace with two crates (library + binary), pinned Rust stable
toolchain with rustfmt and clippy, real CI pipeline (adr-conformance,
lint, test), pre-commit hooks for formatting and ADR checks, and
grep-based scripts enforcing the aphelion ADRs that apply to the
capcom kernel (ADR-001 no banned engines, ADR-003/005/009 no
distributed primitives).

Work order:
- crates/capcom (library): placeholder kernel API with version()
- crates/capcom-engine (binary): placeholder entry point for the
  co-located out-of-process engine node (ADR-012)
- scripts/check-adr-conformance.sh: banned engine + distributed
  primitive detection over Rust source and Cargo.toml
- .claude/hooks/adr-boundary-check.sh: same checks as PreToolUse hook
- .github/workflows/ci.yml: three real jobs replacing TODO placeholders
- .pre-commit-config.yaml: cargo fmt check + ADR conformance
- README.md: build/test/run/layout/constraints documentation

Also carries the Ground Control workflow config migration (earlier
uncommitted work): .ground-control.yaml populated with real cargo
workflow commands, AGENTS.md / CLAUDE.md / .mcp.json pointers updated,
and the stale project-level skill copies removed since the workflow
skills now live at user level.

Verified locally:
- cargo fmt --all --check
- cargo clippy --workspace --all-targets -- -D warnings
- cargo build --workspace --all-targets
- cargo test --workspace --all-targets (1 test passing)
- scripts/check-adr-conformance.sh

First capcom work order step — kernel features (storage, data model,
transactions, query execution) land in subsequent steps per aphelion
notes/work-order.md.
@Brad-Edwards Brad-Edwards merged commit c92b547 into main Apr 12, 2026
3 checks passed
@Brad-Edwards Brad-Edwards deleted the feat/project-scaffolding branch April 12, 2026 03:58
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