SILLBEAM HANDBOOK

Commands

Check architecture and export reports: prerequisites, output formats and exit codes.

Architecture reports and exit codes

BASH
php bin/console sillbeam:architecture
php bin/console sillbeam:architecture --all
php bin/console sillbeam:architecture --issue=2
php bin/console sillbeam:architecture --issue=2 -v
php bin/console sillbeam:architecture --couplings
php bin/console sillbeam:architecture --format=json
php bin/console sillbeam:report
php bin/console sillbeam:report --couplings
php bin/console sillbeam:report --output=docs/architecture-report.md
php bin/console sillbeam:doctor
php bin/console sillbeam:make:module user
php bin/console sillbeam:make:project shop
php bin/console sillbeam:about

Text shows a short success status for valid architecture. A single diagnosis is fully explained; several diagnoses appear as a complete compact index with the first diagnosis expanded. Findings and diagnoses are counted separately. --all explains every group; --issue=N selects an existing positive diagnosis number including its original findings. Numbers apply only to that check run. -v adds rule codes, original messages, context and full paths; otherwise readable relative paths are used.

Exit codes for sillbeam:architecture and sillbeam:report: 0 = valid architecture, 1 = completed analysis with architecture violations, 2 = incomplete/unavailable analysis, invalid configuration or usage, or export write failure. A valid report is not proof of a healthy service container. debug:container, debug:router and doctrine:mapping:info still need a compiled container.

--couplings adds informative application couplings to text. It can be combined with --all or --issue=N. --all and --issue are mutually exclusive. --format=json always returns the complete separate schema-1 data contract and cannot be combined with any of those three presentation options. Invalid option combinations and syntactically invalid values return exit 2 before analysis; a positive diagnosis number outside the available range is rejected with exit 2 only after analysis.

Symfony options for environment, debug, help, verbosity and ANSI remain available. Regardless of verbosity and ANSI settings, JSON contains exactly one document without banners or ANSI sequences. --quiet also suppresses JSON while retaining the exit code; Markdown export still writes the file. The application bootstrap itself must not print before returning the Console Application.

Reporting without a compiled container

In the existing bin/console, replace only the Console Application import with the optional Core adapter. Keep the Composer/Symfony Runtime bootstrap, kernel construction, environment and debug settings. No second executable or extra configuration file is required.

PHP
use Sillbeam\Core\Console\Application;
// replaces the existing Symfony Console Application import
PHP
return function (array $context) {
    $kernel = new App\Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

    return new Application($kernel);
};

The full command names sillbeam:architecture, sillbeam:report, sillbeam:doctor, sillbeam:inspect:module and sillbeam:graph are available before kernel boot; find()/get() also support these exact names. Other commands, including list and generators, retain the normal Symfony boot path. Without the adapter, reporting and Doctor require successful boot first. The recipe does not change bin/console.

Reporting uses the actual kernel configuration hooks, Symfony loaders, YAML/PHP/XML imports, environment, parameters, bundle prepend configuration and Composer mappings. It does not compile services, so it can generate reports even when unrelated service errors exist. Unreadable configuration, a missing bundle, unsupported kernel preparation or fatal analysis failures return exit 2; a broken configuration hook cannot be bypassed.

JSON schema and unknown activation

Schema version 1 contains schema_version, status (valid, violations, unavailable), valid, complete, findings, modules and projects. Use this data contract to process the report; it describes the format rather than a specific console output. The inspected schema is available as a JSON file.

Findings contain rule, severity (error/fatal), message and context as a JSON object. Available remediation is in context.suggestion; report.execution describes execution failures. Modules retain identity, scope, owner, paths, declarations, observed dependencies and evidence.

Without a valid compiled graph, active is null, inactive_reason is unknown, Project modules is null and activation reasons are empty. Complete analysis retains enabled state from configuration; fatal identity/discovery blockers can make it unknown too. Check exit code, schema_version and complete before using activation data.

Nonempty application coupling evidence adds optional application_dependencies and application_references with class, source file/line and target_file. It is informational and creates no findings or module-graph edges. Schema version 1 is retained; consumers with an old strictly closed schema copy must allow the optional fields.

Markdown export

sillbeam:report writes architecture-report.md in the project root by default. Relative --output paths resolve against the kernel project root regardless of working directory; absolute local paths are allowed. The parent directory must exist. The command creates neither directories nor additional export formats.

The report includes the installed Composer version (or source), UTC check time, status, counts, available locations and remediation hints. It writes a report even with violations (exit 1) or unavailable analysis (exit 2). An existing report is atomically replaced only after a temporary file in the same directory has been written completely; write failures preserve the previous report and return exit 2. Invalid usage writes no report.

The standalone report contains status and completeness, separate finding/diagnosis counts, a module/Project overview and every diagnosis with its problem, reason, resolution options and locations. The overview uses readable names, private owners, states, dependencies and hosts; name collisions are distinguished by IDs and, when needed, local numbers. Technical Evidence retains complete original findings with rule, severity, message, context, paths and lines plus descriptor identity mappings. --couplings adds an optional informative appendix. Diagnostic presentation matches the CLI; the export is not a terminal transcript.

Analyzer-backed example reports in the published tag cover small, large, incomplete and colliding-name catalogs. A written report with exit 1 or 2 is not approval: available declarations may be useful, but unknown activation and an empty incomplete catalog remain unverified. Write/replacement failures preserve the old report and remove temporary files.

Minimal generators in Core

BASH
php bin/console sillbeam:make:module user
php bin/console sillbeam:make:project shop
php bin/console sillbeam:make:module checkout --project=Shop

These commands belong to Core and require neither an additional creation tool nor Symfony MakerBundle. They generate only directories and empty final PHP descriptors. They generate no controllers, services, entities, templates or configuration.

Names start with an ASCII letter and contain only ASCII letters/digits. Only an initial lowercase ASCII letter is uppercased: user becomes User, userProfile becomes UserProfile; every other character is preserved. The effective name applies to the directory, namespace, class and filename. Paths, namespaces, leading digits, spaces, underscores, hyphens and non-ASCII letters are rejected. Supply the base name without the Module/Project suffix: existing corresponding suffixes are rejected and the suffix is added automatically. --project accepts the unchanged directory name, ID or full descriptor class of a uniquely discovered Project. Default paths are src/Module/User/UserModule.php, src/Project/Shop/ShopProject.php and src/Project/Shop/Module/Checkout/CheckoutModule.php.

Resolved discovery roots, namespaces, exclusions and Composer mappings apply unchanged. For new shared modules or Projects without --project, exactly one root of that type must be configured; explicit roots must exist. Private modules are created inside their existing Project. Excluded paths, symlinks in creation paths, overlapping areas and existing targets are rejected; nothing is overwritten. Success returns 0, validation/write failures return 1.

Discovery is not activation: shared modules still need assignment in Project mode. Private modules belong physically to their Project. New multi-Project layouts need configured hosts before the next boot. Fix existing invalid architecture or configuration first so Symfony can run the generators.

Installation Doctor: JSON v1

BASH
php bin/console sillbeam:doctor --format=json
php bin/console sillbeam:doctor --format=text

Doctor remains a static, read-only installation inspector without automatic repair. JSON serializes the same Inspector results as the default text output; dynamic configuration remains unverified. Without the Core adapter, Symfony can boot and write cache before the command starts.

Doctor’s own JSON schema v1 contains schema_version, status, exit_code, summary, checks and errors. It is separate from architecture JSON v1. Each check contains id, status, description and detail. IDs identify categories and can repeat: retain every row, do not overwrite by ID and do not assume ordering.

Stable check IDs: bundle.registration, console.adapter, configuration.loading, configuration.files, routing.import, discovery.configuration, services.imports. Descriptions and detail messages are not machine identifiers.

Statuses and exit codes: verified → 0, action required → 1, not verified → 2. Exit 2 takes precedence over 1. Command errors return doctor.usage or doctor.execution, empty checks, zero counts and exit 2. Always check the process exit code alongside JSON. --quiet produces no JSON; keep STDERR separate from STDOUT. --help is command metadata, not a Doctor report.

Inspect one module

BASH
php bin/console sillbeam:inspect:module Billing
php bin/console sillbeam:inspect:module Billing -v
php bin/console sillbeam:inspect:module Billing --project=shop

Select a module by ID or full descriptor class. For ambiguous shared/private IDs, --project narrows the context; remaining collisions require the descriptor class. Compact text output shows module state, scope, Project context and direct DEPENDS ON / USED BY relationships with declared and observed evidence.

-v adds configuration, full classes and paths, activation evidence, separate relationships, reference locations, original findings and context. Declared without observation does not mean unused. Missing observations in incomplete analysis do not prove the absence of references.

Active requires proven activation; Disabled requires known disabled configuration and inactivity; Unassigned requires enabled configuration with proven absence from the graph. Otherwise the state remains Unknown. Project and global activation are separate. Invalid architecture does not publish a runtime graph.

Exit codes: 0 for successful selection and valid overall architecture, 1 for architecture violations, 2 for invalid usage, unknown/ambiguous selection or incomplete/unavailable analysis. Disabled or unassigned modules alone are not errors. Text only: there is no --format option or JSON support.

SVG and Mermaid export

BASH
php bin/console sillbeam:graph
php bin/console sillbeam:graph --module=Billing --output=billing.svg
php bin/console sillbeam:graph --module=Billing --project=shop --output=docs/billing.svg
php bin/console sillbeam:graph --output=architecture.svg --force
php bin/console sillbeam:graph --format=mermaid > architecture.mmd

The default is architecture.svg in the current working directory; --format=svg explicitly selects the same behavior. Core renders directly in PHP: no Graphviz, Node.js or extra renderer. --output selects the file; missing parent directories are created. Existing regular files require --force; directories and symbolic links are rejected. Serialize forced exports to the same destination.

--module accepts an ID or descriptor class and shows only direct incoming and outgoing relationships, without transitive expansion. --project selects ownership/activation context. Incident relationships across private boundaries remain visible. Overall analysis still determines status, even when the filter hides other errors.

--format=mermaid writes only raw Mermaid source to STDOUT, without producing SVG. --output and --force are invalid in this mode; redirect output through the shell. --quiet suppresses text and Mermaid but still writes the SVG file.

Exit codes: 0 export with valid architecture, 1 export with violations, 2 diagnostic export for incomplete/unavailable analysis, 3 invalid invocation or unknown/ambiguous selection, 4 SVG filesystem failure. A write failure takes precedence over analysis status. A written file does not certify valid architecture.

Solid arrows show direct declared dependencies; dashed orange arrows show observed undeclared references. Known disabled configuration and recorded cycle participants remain visible. Unknown activation and incomplete reference evidence remain explicitly unknown. Dense graphs can contain crossing lines; exporting neither repairs architecture nor validates a Symfony container.