Skip to content

test(arch): first architecture-tests integration file + matrix update (task #240) - #1588

Merged
joelteply merged 1 commit into
canaryfrom
feat/architecture-tests-first-proofs
Jun 9, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/architecture-tests-first-proofs

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

First integration-tier proof in the architecture-test matrix. Validates the proof-discipline doc landed in #1584 by flipping the No silent TS fallthrough row to unit + integration coverage.

What ships

core/continuum-core/tests/architecture_no_fallbacks.rs — 3 tests:

  • unknown_command_returns_typed_no_fallback_error — basic CommandNotFound contract via public API
  • no_fallback_error_is_structural_across_command_shapes — structural across 7 command shapes
  • registered_command_still_dispatches — positive path preserved

Matrix update in PROVING-THE-DOCTRINE.md reflects the new coverage.

Why this matters

Per proof-discipline doc: 'prove it as we build it.' The matrix is self-auditing via git grep '// proves:'. This PR establishes the first integration-tier proof file in the matrix, validating the convention with a real test set covering the no-fallbacks doctrine clause.

Test plan

  • cargo test -p continuum-core --test architecture_no_fallbacks --features metal,accelerate — 3/3 pass
  • // proves: no-fallback fallthrough tag convention applied

Doctrine alignment

  • [[no-fallbacks-ever]] — the clause being proven
  • [[abstract-into-literal-design-principle]] — proof matrix (abstract) ships with first literal proof file
  • CANARY-ALPHA-EXECUTION-ROADMAP.md Group B (architecture-test matrix first proofs)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 [email protected]

… (task #240)

Establishes `core/continuum-core/tests/architecture_no_fallbacks.rs`
as the first integration-tier proof in the architecture-test matrix
that landed alongside the substrate doctrine docs (#1584). Validates
the proof-discipline doc by flipping the matrix's first row from
unit-only to unit + integration.

## What this PR ships

1. **`architecture_no_fallbacks.rs`** — three integration tests that
   prove the no-fallbacks doctrine clause from outside the runtime
   module:
   - `unknown_command_returns_typed_no_fallback_error` — basic
     CommandNotFound contract via the public `CommandExecutor::new` +
     `execute` API. Catches the class of bug where the in-module unit
     test passes via private access but the integration boundary is
     broken.
   - `no_fallback_error_is_structural_across_command_shapes` — same
     contract holds for 7 unrelated command shapes (single-token,
     slash-separated, deeply-nested, dashed, UPPER, n0/spec1al,
     empty). Catches partial-fallthrough regressions where only some
     prefixes silently route to TS.
   - `registered_command_still_dispatches` — registered Rust modules
     STILL dispatch successfully. Pins the positive path so that
     future no-fallback-strengthening doesn't over-shoot into
     breaking real dispatch.

2. **`PROVING-THE-DOCTRINE.md` matrix update** — flips the
   "No silent TS fallthrough" row to include the new integration test
   alongside the existing in-module unit test.

## Why this matters

Per the proof-discipline doc: "prove it as we build it." The matrix
is meant to be self-auditing via `git grep '// proves:'`. The
no-fallbacks clause was previously covered by a single in-module
unit test in `runtime/command_executor.rs::tests`. That unit test
passes because the test mod has access to the executor's internals;
this PR proves the SAME contract through the same public API a real
substrate caller uses.

The slogan: ship the abstract recipe AND the literal instantiation
together. The proof-discipline doc was the recipe; this is the first
literal instantiation in the matrix.

## Test plan

- [x] `cargo test -p continuum-core --test architecture_no_fallbacks
      --features metal,accelerate` — 3/3 pass
- [x] Tests live in standard integration-tier location
      (`core/continuum-core/tests/`)
- [x] `// proves: no-fallback fallthrough` tag convention applied
      per [PROVING-THE-DOCTRINE.md](docs/architecture/PROVING-THE-DOCTRINE.md)

## Doctrine alignment

- [[no-fallbacks-ever]] — the clause being proven
- Substrate doctrine "Prove it as we build it" — each PR that
  advances a doctrine clause SHOULD include the proof
- [[abstract-into-literal-design-principle]] — the proof matrix
  (abstract) ships with the first literal proof file

## Related

- Task #240 (this PR opens it; subsequent PRs fill the other matrix
  rows)
- Builds on #1584 (substrate doctrine + proof discipline docs)
- Builds on #1585 (no-fallbacks fix in CommandExecutor)
- Tracked under CANARY-ALPHA-EXECUTION-ROADMAP.md Group B
  (architecture-test matrix first proofs)

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@joelteply
joelteply merged commit d149a0f into canary Jun 9, 2026
2 checks passed
@joelteply
joelteply deleted the feat/architecture-tests-first-proofs branch June 9, 2026 23:13
joelteply added a commit that referenced this pull request Jun 9, 2026
…e) (#1589)

Second proof in the architecture-test matrix: a Shape 5 (build-graph
constraint) test that pins the engine-OS layering doctrine clause.

## What ships

`core/continuum-core/tests/architecture_engine_os_layering.rs` — two
integration tests:

1. `runtime_submodule_paths_outside_runtime_ratchet` — walks every
   .rs file outside `core/continuum-core/src/runtime/`, counts
   imports that reach into specific runtime submodule paths (e.g.
   `use crate::runtime::message_bus::MessageBus`), and asserts the
   count doesn't grow beyond the current grandfathered budget of 29.
   New violations BLOCK the test; existing ones are tracked for
   follow-up cleanup PRs.

2. `runtime_internal_submodule_use_is_allowed` — sanity-pins the
   intentional scope: `runtime/*` files CAN reach into their own
   sibling submodules (that's normal internal composition). The
   constraint applies only to consumers OUTSIDE `runtime/*`.

## Why ratchet (not strict)

29 existing violations exist across the substrate; their fixes
require considered decisions:
- Some items (e.g. `BusEvent`) aren't currently re-exported at the
  runtime root; promoting them is a public-API decision per item.
- Some callers genuinely reach for internals that should be
  refactored, not promoted.

The ratchet pattern: existing count is the budget, new ones BLOCK,
the number only goes DOWN. When a follow-up PR fixes violations, it
updates `GRANDFATHERED_VIOLATIONS` to the new lower count. When the
count reaches 0, the constraint graduates to strict enforcement.

This matches the proof-discipline doc's discipline: ship the
abstract recipe (the test) AND the literal first state (the
grandfathered count) together. Every subsequent PR ratchets down.

## Matrix update

`PROVING-THE-DOCTRINE.md` row for "Engine-OS layering" flips from
🔴 (no proof) to 🟡 (ratchet active, target is full ✅ when count = 0).

## What this catches going forward

- A new module that does `use crate::runtime::message_bus::BusEvent`
  instead of `use crate::runtime::BusEvent` (after BusEvent gets
  promoted to root) will fail the test.
- A refactor that splits `command_executor` into two submodules
  won't silently break consumers — the test reminds the substrate
  to update root re-exports.
- A cognition module that reaches into `runtime::late_bound::*`
  internals will be caught at PR review.

## Doctrine alignment

- Substrate doctrine § "Engine-on-OS framing" — runtime is the
  engine block; consumers compose against the public surface
- [[adapter-pattern-is-the-pivot-insurance]] — the public re-export
  layer IS the pivot insurance for engine internals

## Test plan

- [x] `cargo test -p continuum-core --test
      architecture_engine_os_layering --features metal,accelerate`
      — 2/2 pass
- [x] `// proves: engine-OS layering` tag convention applied
- [x] Ratchet logic verified (both grow-detection and
      shrink-detection paths)

## Related

- Task #240 (this PR adds the second proof to the matrix)
- Builds on #1588 (first proof — no-fallbacks integration test)
- Follow-up: dedicated cleanup PRs ratchet the 29 → 0 over time

Co-authored-by: Claude Opus 4.7 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant