BCE — diagnose, repair, and prove architecture conformance
BCE is a fail-closed architecture-conformance gate. A blueprint is policy; source code is the normal
repair surface. Prefer the repository's BCE MCP server for diagnosis and working-tree verification.
Use the CLI only when MCP is unavailable or the requested lifecycle operation is intentionally absent
from MCP.
For first adoption, use the current coding agent's reasoning and author to draft one supported
boundary from stated intent. An additional provider call is optional. Resolve bundled references
under the installed node_modules/bce-engine/docs/ and spec/, not the consumer's own docs/.
Choose the shortest workflow
- Existing repository is red: follow the MCP-first repair loop below. Do not load lifecycle
authoring material.
- Readiness or setup looks broken: call
doctor_repository {} before the gate.
- A blueprint or gate may be vacuous: call
validate_blueprint, then assess_teeth.
- The user asks to inspect or compare policy: call
inspect_blueprint, explain_constraint, or
compare_blueprint_policy; replay supplied evidence with verify_review_packet.
- The user asks to create or adopt a new rule: read
references/lifecycle.md before acting. Use local bce author, or the optional bce propose adapter;
governance changes use the CLI and require an authenticated human review.
- The user asks to tune an Agent Skill: use the separate
skill-tuning skill.
MCP-first repair loop
- Call
run_gate {}. The generated server starts in the repository, so omit repoDir unless the
user deliberately targets another tree.
- Read structured fields, not the process exit alone:
gateFailed: true, outcome: "violation", or a report verdict: "fail" is RED;
outcome: "refusal" is RED and must not be routed around;
- advisory mode may return
exitCode: 0 while the substantive verdict is still RED.
- Use each violation's
constraintId, evidenceRef, observed, and expected to identify the
smallest source-code correction.
- Change code, not policy. Do not edit blueprints, baselines, mode, waivers, workflows, MCP config,
installed skills, or engine pins merely to clear a violation.
- Call
run_gate {} again against the live working tree. Finish only when gateFailed is false,
outcome is pass, and every selected report passes.
- Report the exact violation fixed, changed code files, final score/verdict, and whether policy
changed. A normal repair must say policy did not change.
The MCP server exposes ten read-only tools:
| Tool |
Use it for |
doctor_repository |
installation, scope, proof, policy, CI, skill, and MCP readiness |
run_gate |
live-tree diagnosis and the final done-check |
validate_blueprint |
schema and safe-pattern validation |
assess_teeth |
non-vacuity evidence |
check_baseline |
new debt and shrink opportunities without changing policy |
inspect_blueprint |
the canonical Promise/Lens/Proof/Limits review model |
explain_constraint |
one clause through the same review grammar |
compare_blueprint_policy |
conservative semantic direction for an exact base/candidate pair |
verify_review_packet |
packet and optional decision integrity replay |
get_report |
a deterministic report already written by the engine |
MCP cannot generate a proposal, record a decision, ratify, amend, graduate, create a baseline, or
weaken policy. That absence is a security boundary, not missing functionality.
CLI fallback
If the project has no working BCE MCP server, use the exact local package rather than fetching a
moving version:
npx --no-install bce gate --repo . --extractor ast --all
For an uncommitted repair, gate already scans the live tree. If you intentionally run one
blueprint directly, add --no-pin; otherwise run grades committed HEAD by default:
npx --no-install bce run --blueprint <path> --ct-repo . --no-pin --extractor ast --out compliance-report.json
Exit 0 is a process pass only after reading advisory state and the report verdict. Exit 1 is a
graded violation or usage/configuration error; exit 2 is a fail-closed scan/refusal condition. Treat 1
and 2 as RED.
Policy boundary
The following are governed surfaces: .blueprints/**, .bce-mode.json, baseline and waiver files,
the BCE workflow, agent/MCP configuration, installed skills, and engine pins. Do not change one as an
incidental repair. If the contract itself is wrong, stop and propose a separate reviewed policy
change with rationale.
Never:
- lower a threshold, grow a baseline, or narrow scope just to obtain green;
- interpret advisory exit
0 as conformance when reports still fail;
- claim a constraint works without a discriminating RED;
- report
evaluator-refutable as extractor-real teeth;
- treat a structural refusal as a pass;
- claim an agent-operated run is independent-human evidence.
Authoring and adoption
Only load references/lifecycle.md when the task is to create, validate, prove, onboard, ratify, or
operate a contract. It contains the constraint grammar, extraction profiles, exact commands,
advisory/baseline/graduation path, and CI invariants.
Use the repository's existing package manager: pnpm exec bce or yarn bce replaces the npm runner.
Do not fetch a package named bce, silently change package managers, or require a global install.
Prefer local, version-matched package documentation. The v0.3.1 package includes
spec/SPEC.md, offline review prepare, and solo-steward ratification. Use the installed local
binary for those commands; a source checkout is not required. The immutable npm 0.3.0 tarball
lacks those additions and omits spec/SPEC.md; when operating that version, use
https://github.com/blueprint-conformance/bce/blob/v0.3.0/spec/SPEC.md if the local file is absent.
Identify the existing artifact before installing anything. The current exact registry target is
bce-engine@0.3.1; run npm view bce-engine@0.3.1 version dist.integrity and verify its release
record before changing the selected artifact. Check the separately selected CI engine too;
upgrading locally does not update an existing workflow.
1---2name: bce3description: Propose, review, diagnose, and repair architecture contracts with BCE, preferring its read-only MCP tools for inspection, exact violations, and live-tree done-checks. Use when an AI-first blueprint proposal or policy comparison is requested, a BCE gate is red, advisory output reports violations despite exit 0, architectural drift must be fixed without weakening policy, or a blueprint needs validation or teeth evidence. Do not use for ordinary lint, formatting, or type errors.4license: Apache-2.05---67# BCE — diagnose, repair, and prove architecture conformance89BCE is a fail-closed architecture-conformance gate. A blueprint is policy; source code is the normal10repair surface. Prefer the repository's BCE MCP server for diagnosis and working-tree verification.11Use the CLI only when MCP is unavailable or the requested lifecycle operation is intentionally absent12from MCP.1314For first adoption, use the current coding agent's reasoning and `author` to draft one supported15boundary from stated intent. An additional provider call is optional. Resolve bundled references16under the installed `node_modules/bce-engine/docs/` and `spec/`, not the consumer's own `docs/`.1718## Choose the shortest workflow1920- **Existing repository is red:** follow the MCP-first repair loop below. Do not load lifecycle21 authoring material.22- **Readiness or setup looks broken:** call `doctor_repository {}` before the gate.23- **A blueprint or gate may be vacuous:** call `validate_blueprint`, then `assess_teeth`.24- **The user asks to inspect or compare policy:** call `inspect_blueprint`, `explain_constraint`, or25 `compare_blueprint_policy`; replay supplied evidence with `verify_review_packet`.26- **The user asks to create or adopt a new rule:** read27 `references/lifecycle.md` before acting. Use local `bce author`, or the optional `bce propose` adapter;28 governance changes use the CLI and require an authenticated human review.29- **The user asks to tune an Agent Skill:** use the separate `skill-tuning` skill.3031## MCP-first repair loop32331. Call `run_gate {}`. The generated server starts in the repository, so omit `repoDir` unless the34 user deliberately targets another tree.352. Read structured fields, not the process exit alone:36 - `gateFailed: true`, `outcome: "violation"`, or a report `verdict: "fail"` is RED;37 - `outcome: "refusal"` is RED and must not be routed around;38 - advisory mode may return `exitCode: 0` while the substantive verdict is still RED.393. Use each violation's `constraintId`, `evidenceRef`, `observed`, and `expected` to identify the40 smallest source-code correction.414. Change code, not policy. Do not edit blueprints, baselines, mode, waivers, workflows, MCP config,42 installed skills, or engine pins merely to clear a violation.435. Call `run_gate {}` again against the live working tree. Finish only when `gateFailed` is false,44 `outcome` is `pass`, and every selected report passes.456. Report the exact violation fixed, changed code files, final score/verdict, and whether policy46 changed. A normal repair must say policy did not change.4748The MCP server exposes ten read-only tools:4950| Tool | Use it for |51|---|---|52| `doctor_repository` | installation, scope, proof, policy, CI, skill, and MCP readiness |53| `run_gate` | live-tree diagnosis and the final done-check |54| `validate_blueprint` | schema and safe-pattern validation |55| `assess_teeth` | non-vacuity evidence |56| `check_baseline` | new debt and shrink opportunities without changing policy |57| `inspect_blueprint` | the canonical Promise/Lens/Proof/Limits review model |58| `explain_constraint` | one clause through the same review grammar |59| `compare_blueprint_policy` | conservative semantic direction for an exact base/candidate pair |60| `verify_review_packet` | packet and optional decision integrity replay |61| `get_report` | a deterministic report already written by the engine |6263MCP cannot generate a proposal, record a decision, ratify, amend, graduate, create a baseline, or64weaken policy. That absence is a security boundary, not missing functionality.6566## CLI fallback6768If the project has no working BCE MCP server, use the exact local package rather than fetching a69moving version:7071```bash72npx --no-install bce gate --repo . --extractor ast --all73```7475For an uncommitted repair, `gate` already scans the live tree. If you intentionally run one76blueprint directly, add `--no-pin`; otherwise `run` grades committed `HEAD` by default:7778```bash79npx --no-install bce run --blueprint <path> --ct-repo . --no-pin --extractor ast --out compliance-report.json80```8182Exit `0` is a process pass only after reading advisory state and the report verdict. Exit `1` is a83graded violation or usage/configuration error; exit `2` is a fail-closed scan/refusal condition. Treat `1`84and `2` as RED.8586## Policy boundary8788The following are governed surfaces: `.blueprints/**`, `.bce-mode.json`, baseline and waiver files,89the BCE workflow, agent/MCP configuration, installed skills, and engine pins. Do not change one as an90incidental repair. If the contract itself is wrong, stop and propose a separate reviewed policy91change with rationale.9293Never:9495- lower a threshold, grow a baseline, or narrow scope just to obtain green;96- interpret advisory exit `0` as conformance when reports still fail;97- claim a constraint works without a discriminating RED;98- report `evaluator-refutable` as extractor-real teeth;99- treat a structural refusal as a pass;100- claim an agent-operated run is independent-human evidence.101102## Authoring and adoption103104Only load `references/lifecycle.md` when the task is to create, validate, prove, onboard, ratify, or105operate a contract. It contains the constraint grammar, extraction profiles, exact commands,106advisory/baseline/graduation path, and CI invariants.107108Use the repository's existing package manager: `pnpm exec bce` or `yarn bce` replaces the npm runner.109Do not fetch a package named `bce`, silently change package managers, or require a global install.110111Prefer local, version-matched package documentation. The v0.3.1 package includes112`spec/SPEC.md`, offline `review prepare`, and solo-steward ratification. Use the installed local113binary for those commands; a source checkout is not required. The immutable npm `0.3.0` tarball114lacks those additions and omits `spec/SPEC.md`; when operating that version, use115https://github.com/blueprint-conformance/bce/blob/v0.3.0/spec/SPEC.md if the local file is absent.116Identify the existing artifact before installing anything. The current exact registry target is117`bce-engine@0.3.1`; run `npm view bce-engine@0.3.1 version dist.integrity` and verify its release118record before changing the selected artifact. Check the separately selected CI engine too;119upgrading locally does not update an existing workflow.